论文:Focal Loss for Dense Object Detection
参考:https://zhuanlan.zhihu.com/p/49981234/
目标检测算法可以分为两大类:Two-stage detector 和 One-stage detector。由于像RCNN系列的二阶段检测器拥有region proposal的操作,这类算法可以达到很高的准确率,但是速度较慢。而像YOLO,SSD这样直接回归的检测算法,这类算法速度很快,但是准确率不如前者。作者提出focal loss的出发点也是希望one-stage detector可以达到two-stage detector的准确率,同时不影响原有的速度。
这篇论文发现,one-stage detector精度不如two-stage detector的根本原因是样本类别不均匀导致的。因为一张图片中,真实目标(正样本)的数量远远大于负样本数量,负样本占总的loss的大部分,而且多是容易分类的,因此使得模型的优化方向并不是我们所希望的那样。
CE ( p , y ) = { − log ( p ) if y = 1 − log ( 1 − p ) o t h e r w i s e . \textbf{CE}(p,y)=\begin{cases}-\textbf{log}(p) & \text{ if } y=1 \\ -\textbf{log}(1-p) & otherwise. \end{cases} CE(p,y)={