The highest accuracy object detectors to date are based on a two-stage approach popularized by R-CNN, where a classifier is applied to a sparse set of candidate object locations. In contrast, one-stage detectors that are applied over a regular, dense sampling of possible object locations have the potential to be faster and simpler, but have trailed the accuracy of two-stage detectors thus far. In this paper, we investigate why this is the case. We discover that the extreme foreground-background class imbalance encountered during training of dense detectors is the central cause. We propose to address this class imbalance by reshaping the standard cross entropy loss such that it down-weights the loss assigned to well-classified examples. Our novel Focal Loss focuses training on a sparse set of hard examples and prevents the vast number of easy negatives from overwhelming the detector during training. To evaluate the effectiveness of our loss, we design and train a simple dense detector we call RetinaNet. Our results show that when trained with the focal loss, RetinaNet is able to match the speed of previous one-stage detectors while surpassing the accuracy of all existing state-of-the-art two-stage detectors. Code is at: https://github.com/facebookresearch/Detectron.
核心贡献 · Key contributions
识别出极端的前景-背景类别不平衡是单阶段检测器的主要障碍。 Identifies extreme foreground-background class imbalance as the main obstacle for one-stage detectors.
提出 Focal Loss,降低易分类样本的权重,聚焦于难分类负样本的训练。 Proposes Focal Loss that down-weights easy examples and focuses training on hard negatives.
设计了 RetinaNet,一种使用特征金字塔网络和锚点框的简单单阶段检测器。 Designs RetinaNet, a simple one-stage detector using Feature Pyramid Network and anchor boxes.
证明使用 Focal Loss 的 RetinaNet 在速度上匹配单阶段检测器,在精度上超越两阶段检测器。 Demonstrates RetinaNet with Focal Loss matches speed of one-stage detectors and surpasses accuracy of two-stage detectors.
使用 ResNet-101-FPN 骨干网络在 5 fps 下达到 39.1 的 COCO AP,实现最先进水平。 Achieves state-of-the-art COCO AP of 39.1 with ResNet-101-FPN backbone at 5 fps.
表明 Focal Loss 对超参数鲁棒,且其他形式的损失函数也能取得类似效果。 Shows Focal Loss is robust to hyperparameters and alternative formulations yield similar results.
局限 · Limitations
Focal Loss 仅在目标检测上评估,未研究其在其他任务上的有效性。 Focal Loss is evaluated only on object detection; its effectiveness on other tasks is not studied.
RetinaNet 使用固定锚点框,性能可能依赖于锚点框的设计和密度。 RetinaNet uses fixed anchor boxes; performance may depend on anchor design and density.
该方法需要仔细调整α和γ超参数以达到最佳性能。 The method requires careful tuning of α and γ hyperparameters for optimal performance.
训练稳定性依赖于分类子网的特定偏置初始化。 Training stability relies on a specific bias initialization for the classification subnet.
实验仅限于 COCO 数据集,未验证在其他数据集上的泛化能力。 Experiments are limited to COCO dataset; generalization to other datasets is not verified.
论文章节 · Sections(共 17)
摘要Abstract
1 引言1 Introduction
2 相关工作2 Related Work
3 焦点损失3 Focal Loss
3.1 平衡交叉熵3.1 Balanced Cross Entropy
3.2 焦点损失定义3.2 Focal Loss Definition
3.3 类别不平衡与模型初始化3.3 Class Imbalance and Model Initialization
3.4 类别不平衡与两阶段检测器3.4 Class Imbalance and Two-stage Detectors