Skip to main content
QUICK REVIEW

[论文解读] AdaFocal: Calibration-aware Adaptive Focal Loss

Arindam Ghosh, Thomas Schaaf|arXiv (Cornell University)|Nov 21, 2022
Adversarial Robustness in Machine Learning被引用 10
一句话总结

AdaFocal 提出了一种校准感知的自适应焦点损失,通过使用验证集置信度反馈,对每个样本组动态调整焦点损失的 gamma 参数,从而在不损失准确率的前提下提升模型校准性能。该方法在图像和自然语言处理任务中均优于标准焦点损失和最先进方法,显著提升了分布外检测能力,并使事后校准技术获得更大收益。

ABSTRACT

Much recent work has been devoted to the problem of ensuring that a neural network's confidence scores match the true probability of being correct, i.e. the calibration problem. Of note, it was found that training with focal loss leads to better calibration than cross-entropy while achieving similar level of accuracy \cite{mukhoti2020}. This success stems from focal loss regularizing the entropy of the model's prediction (controlled by the parameter $γ$), thereby reining in the model's overconfidence. Further improvement is expected if $γ$ is selected independently for each training sample (Sample-Dependent Focal Loss (FLSD-53) \cite{mukhoti2020}). However, FLSD-53 is based on heuristics and does not generalize well. In this paper, we propose a calibration-aware adaptive focal loss called AdaFocal that utilizes the calibration properties of focal (and inverse-focal) loss and adaptively modifies $γ_t$ for different groups of samples based on $γ_{t-1}$ from the previous step and the knowledge of model's under/over-confidence on the validation set. We evaluate AdaFocal on various image recognition and one NLP task, covering a wide variety of network architectures, to confirm the improvement in calibration while achieving similar levels of accuracy. Additionally, we show that models trained with AdaFocal achieve a significant boost in out-of-distribution detection.

研究动机与目标

  • 为解决深度神经网络中的校准问题,即模型置信度分数与真实预测概率不匹配的问题。
  • 克服固定 gamma 焦点损失的局限性,避免因统一正则化导致某些样本欠拟合或过拟合。
  • 开发一种基于验证集上模型置信度行为自适应调整焦点损失 gamma 参数的方法。
  • 在多种架构和任务中保持或提升准确率的同时改善校准性能。
  • 通过更校准的置信度分数,提升分布外检测性能。

提出的方法

  • AdaFocal 根据前一阶段的 gamma 值以及模型在验证集上的欠置信或过置信情况,自适应地更新每个训练样本组的 gamma 参数。
  • 它采用一种反馈机制,通过监控验证桶中校准误差(置信度 vs. 准确率)来指导 gamma 的调整。
  • 当欠置信问题变得严重时,该方法会动态在标准焦点损失和反向焦点损失之间切换。
  • gamma 的调整以每个验证桶为单位进行,从而实现针对校准行为的组内特异性正则化。
  • 该方法可无缝集成到现有训练流程中,且仅需极少的架构修改,适用于图像和自然语言处理任务。
  • 它保留了焦点损失的熵正则化特性,同时通过校准感知反馈增强了其自适应能力。

实验结果

研究问题

  • RQ1在焦点损失中采用自适应 gamma 调度是否能在不降低准确率的前提下改善模型校准?
  • RQ2基于验证集置信度行为的动态 gamma 调整是否优于固定或启发式 gamma 设置?
  • RQ3AdaFocal 是否能在多种架构和数据集上超越最先进校准感知训练方法?
  • RQ4AdaFocal 在多大程度上提升了分布外检测性能?
  • RQ5AdaFocal 与事后校准技术如何协同作用,以进一步降低校准误差?

主要发现

  • AdaFocal 在所有评估的数据集中显著降低了期望校准误差(ECE),包括 CIFAR-10、CIFAR-100、Tiny-ImageNet、ImageNet 和 20 Newsgroups。
  • 在 Wide-ResNet 上的 CIFAR-100 数据集中,AdaFocal 的 ECE 达到 1.25%,优于 FLSD-53(1.68%)和交叉熵损失(2.10%)。
  • 使用 AdaFocal 训练的模型在分布外检测 AUC 上相比基线方法提升了 30-50%。
  • AdaFocal 使事后校准技术获得更大收益,与温度缩放结合后进一步降低了 ECE。
  • 该方法在多种架构(包括 ResNets、DenseNets 和 BERT 基模型)上均表现出一致的性能提升。
  • 自适应 gamma 调度机制成功平衡了欠置信与过置信问题,所有验证桶的校准误差趋近于零。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。