论文原地址

https://arxiv.org/pdf/1708.02002.pdf

论文中讲述focal loss思想的部分

As our experiments will show, the large class imbalance encountered during training of dense detectors overwhelms the cross entropy loss. Easily classified negatives comprise the majority of the loss and dominate the gradient. While α balances the importance of positive/negative examples, it does not differentiate between easy/hard examples. Instead, we propose to reshape the loss function to down-weight easy examples and thus focus training on hard negatives.

正如我们的实验将显示的那样,在密集检测器的训练过程中遇到的样本不平衡问题被交叉熵损失所湮没。容易分类的负赝本占据了大部分损失并主导了梯度。虽然 α 平衡了正/负示例的重要性,但它不区分简单/困难示例。因此,我们建议将损失函数重塑,减轻容易分类样本的权重,从而将训练重点放在难分类的负样本上。

More formally, we propose to add a modulating factor (1-pt)^γ to the cross entropy loss, with tunable focusing parameter γ ≥ 0. We define the focal loss as:
FL(pt)=−(1−pt)γlog(pt)FL(p_t) = -(1-p_t)^{\gamma} log(p_t)FL(pt​)=−(1−pt​)γlog(pt​)

上面为定义的FL(pt)损失函数。

The focal loss is visualized for several values of γ ∈ [0, 5] in Figure 1. We note two properties of the focal loss.
When an example is misclassified and pt is small, the modulating factor is near 1 and the loss is unaffected. As pt → 1, the factor goes to 0 and the loss for well-classified examples is down-weighted. (2) The focusing parameter γ smoothly adjusts the rate at which easy examples are down-weighted. When γ = 0, FL is equivalent to CE, and as γ is increased the effect of the modulating factor is likewise increased (we found γ = 2 to work best in our experiments).

Intuitively, the modulating factor reduces the loss contri-bution from easy examples and extends the range in which an example receives low loss. For instance, with γ = 2, an example classified with pt = 0.9 would have 100× lower loss compared with CE and with pt ≈ 0.968 it would have 1000× lower loss. This in turn increases the importance of correcting misclassified examples (whose loss is scaled down by at most 4× for pt ≤ .5 and γ = 2).

在图 1 中,对于 γ ∈ [0, 5] 的几个值,focal loss是可视化的。我们注意到focal loss的两个属性。
当一个样本被错误分类并且 pt 很小时,调制因子接近 1 并且损失不受影响。当 pt → 1 时,因子变为 0,并且分类良好的示例的损失被降低权重。 聚焦参数 γ 平滑地调整了简单示例被降权的速率。当 γ = 0 时,FL 等价于 CE,并且随着 γ 的增加,调节因子的影响同样增加(我们发现 γ = 2 在我们的实验中效果最好)。

直观地说,调制因子减少了简单样本的损失贡献,并扩大了样本获得低损失的范围。例如,当 γ = 2 时,分类为 pt = 0.9 的示例与 CE 相比损失低 100 倍,而 pt ≈ 0.968 则损失低 1000 倍。这反过来又增加了纠正错误分类示例的重要性(对于 pt ≤ .5 和 γ = 2,其损失最多减少 4 倍)。

In practice we use an α-balanced variant of the focal loss:
FL(pt)=−αt(1−pt)γlog(pt)FL(p_t) = -\alpha_t (1-p_t)^{\gamma} log(p_t)FL(pt​)=−αt​(1−pt​)γlog(pt​)

We adopt this form in our experiments as it yields slightly improved accuracy over the non-α-balanced form. Finally, we note that the implementation of the loss layer combines the sigmoid operation for computing p with the loss computation, resulting in greater numerical stability.

While in our main experimental results we use the focal loss definition above, its precise form is not crucial. In the appendix we consider other instantiations of the focal loss and demonstrate that these can be equally effective.

我们在实验中采用这种形式,因为它比非 α 平衡形式的精度略有提高。最后,我们注意到损失层的实现将计算 p的sigmoid 操作与损失函数计算相结合,从而获得更大的数值稳定性。

虽然在我们的主要实验结果中我们使用了上面的focal loss定义,但其精确形式并不重要。在附录中,我们考虑了focal loss的其他实例,并证明它们同样有效。

focal loss小结相关推荐

  1. 堪比Focal Loss!解决目标检测中样本不平衡的无采样方法

    训练目标检测模型的一个难点是样本不均衡,特别是正负样本比例严重失衡.目前解决这类问题主要是两种方案(见综述Imbalance Problems in Object Detection: A Revie ...

  2. 一、Focal Loss理论及代码实现

    文章目录 前言 一.基本理论 二.实现 1.公式 2.代码实现 1.基于二分类交叉熵实现. 2.知乎大佬的实现 前言 本文参考:几时见得清梦博主文章 参考原文:https://www.jianshu. ...

  3. 剖析Focal Loss损失函数: 消除类别不平衡+挖掘难分样本 | CSDN博文精选

    作者 | 图像所浩南哥 来源 | CSDN博客 论文名称:< Focal Loss for Dense Object Detection > 论文下载:https://arxiv.org/ ...

  4. NeurIPS 2020 | Focal Loss改进版来了!GFocal Loss:良心技术,无Cost涨点!

    本文作者:李翔 https://zhuanlan.zhihu.com/p/147691786 本文仅供学习参考,如有侵权,请联系删除! 论文地址:https://arxiv.org/abs/2006. ...

  5. 清晰易懂的Focal Loss原理解释

    来源:https://www.cnblogs.com/king-lps/p/9497836.html 编辑:石头 1. 总述 Focal loss主要是为了解决one-stage目标检测中正负样本比例 ...

  6. 无痛涨点!大白话讲解 Generalized Focal Loss

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 作者丨李翔 来源丨https://zhuanlan.zhihu.c ...

  7. 目标检测--Focal Loss for Dense Object Detection

    Focal Loss for Dense Object Detection ICCV2017 https://arxiv.org/abs/1708.02002 本文算是用简单的方法解决复杂的问题了,好 ...

  8. Focal Loss和它背后的男人RetinaNet

    说起Focal Loss,相信做CV的都不会陌生,当面临正负样本不平衡时可能第一个想到的就是用Focal Loss试试.但是怕是很多人会不知道这篇论文中所提出的one stage目标检测模型Retin ...

  9. Focal Loss升级:让Focal Loss动态化,类别极端不平衡也可以轻松解决

    学习群|扫码在主页获取加入方式 计算机视觉研究院专栏 作者:Edison_G 尽管最近长尾目标检测取得了成功,但几乎所有的长尾目标检测器都是基于两阶段范式开发的.在实践中,一阶段检测器在行业中更为普遍 ...

  10. Focal Loss升级 E-Focal Loss让Focal Loss动态化,类别极端不平衡也得到提升

    尽管最近长尾目标检测取得了成功,但几乎所有的长尾目标检测器都是基于两阶段范式开发的.在实践中,一阶段检测器在行业中更为普遍,因为它们有一个简单和快速的Pipeline,易于部署.然而,在长尾情况下,这 ...

最新文章

  1. 科研必备:10款提升科研效率的神器
  2. 对 Azure 虚拟网络网关的改进
  3. css text-align-last设置末尾文本对齐方式
  4. AC Again hdoj 1582 搜索
  5. kafka偏移量保存到mysql里_【队列】调试应用时进行的kafka偏移量调整
  6. 架构师,是否需要写代码?
  7. C#中的WebSocket服务器
  8. 预览文章: 猿们平常都喜欢听啥音乐?
  9. 多家航空巨头遭大规模供应链攻击
  10. 终极解决方案——sbt配置阿里镜像源,解决sbt下载慢,dump project structure from sbt耗时问题
  11. Flask数据库学习
  12. python3.9.0a2怎么安装pygame_Python自学——pygame安装
  13. 华师计算机前沿讲座课程论文,17春华师《教育技术前沿讲座》在线作业
  14. office2020与2016版的不同_如何解决Office2020与office2020兼容问题
  15. 修改Win7硬盘分区盘符出现“虚拟磁盘管理器-参数错误”
  16. DS18B20+数码管显示
  17. iphone11右上角信号显示_原来,iOS 11移动信号图标里竟然隐藏着 iPhone 8的巨大秘密...
  18. 我喜欢夜晚,黑黑的夜色带给人安全感
  19. 如果不能时刻保持学习的心态,那么你将被 IT 甩回开普乐星去
  20. android媲美微信扫码库

热门文章

  1. R语言领跑 大数据岗位霸占IT薪酬榜单
  2. 给最后一个li增加样式
  3. 清除浮动的七种方式方法(实例代码讲解)
  4. Swift2.0新特性
  5. Instruments-Automation: 通过命令行执行测试用例
  6. 关于linux下的iptables 的浅析命令和了解
  7. 【深入理解webpack】library,libraryTarget,externals的区别及作用
  8. 学习OpenGL ES之法线贴图
  9. 30种图像动画特效算法(C#多线程版)(上)
  10. Oracle常见的Hint(二)