Lune

NeurIPS2020Top-tier venue

Calibrating Deep Neural Networks using Focal Loss

Jishnu Mukhoti, Viveka Kulharia, Amartya Sanyal, Stuart Golodetz, Philip H. S. Torr, Puneet K. Dokania

Abstract

Miscalibration -a mismatch between a model's confidence and its correctness -of Deep Neural Networks (DNNs) makes their predictions hard to rely on. Ideally, we want networks to be accurate, calibrated and confident. We show that, as opposed to the standard cross-entropy loss, focal loss [Lin et al., 2017] allows us to learn models that are already very well calibrated. When combined with temperature scaling, whilst preserving accuracy, it yields state-of-the-art calibrated models. We provide a thorough analysis of the factors causing miscalibration, and use the insights we glean from this to justify the empirically excellent performance of focal loss. To facilitate the use of focal loss in practice, we also provide a principled approach to automatically select the hyperparameter involved in the loss function. We perform extensive experiments on a variety of computer vision and NLP datasets, and with a wide variety of network architectures, and show that our approach achieves state-of-the-art calibration without compromising on accuracy in almost all cases. Code is available at https://github.com/torrvision/ focal_calibration .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

138 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Evidential Deep Learning for Open Set Action Recognition cites Improving model calibration with accuracy versus uncertainty optimization
  • Mitigating Neural Network Overconfidence with Logit Normalization cites Rethinking Calibration of Deep Neural Networks: Do Not Be Afraid of Overconfidence
  • Rethinking Calibration of Deep Neural Networks: Do Not Be Afraid of Overconfidence cites Improving model calibration with accuracy versus uncertainty optimization
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers138

  1. Mitigating Neural Network Overconfidence with Logit NormalizationHongxin Wei, Renchunzi Xie, Hao Cheng, Lei Feng et al.ICML 2022 · 386 citations
  2. Improving model calibration with accuracy versus uncertainty optimizationRanganath Krishnan, Omesh TickooNeurIPS 2020 · 217 citations
  3. Evidential Deep Learning for Open Set Action RecognitionWentao Bao, Qi Yu, Yu KongICCV 2021 · 204 citations
  4. On Calibration and Out-of-Domain GeneralizationYoav Wald, Amir Feder, Daniel Greenfeld, Uri ShalitNeurIPS 2021 · 184 citations
  5. Rethinking Calibration of Deep Neural Networks: Do Not Be Afraid of OverconfidenceDeng-Bao Wang, Lei Feng, Min-Ling ZhangNeurIPS 2021 · 177 citations

Related papers

  1. Dual Focal Loss for CalibrationLinwei Tao, Minjing Dong, Chang XuICML 2023 · 56 citations
  2. AdaFocal: Calibration-aware Adaptive Focal LossArindam Ghosh, Thomas Schaaf, Matthew GormleyNeurIPS 2022 · 71 citations
  3. The Devil is in the Margin: Margin-based Label Smoothing for Network CalibrationBingyuan Liu, Ismail Ben Ayed, Adrian Galdran, Jose DolzCVPR 2022 · 61 citations
  4. Uncertainty Weighted Gradients for Model CalibrationJinxu Lin, Linwei Tao, Minjing Dong, Chang XuCVPR 2025
  5. Learning to Doubt: Forgetting Aware Learning for Neural NetworksAwanish Kumar, Soumyadeep Ghosh, Akshita Sharma, Rahul GuptaKDD 2026
Dusk over the sea between two cliffs drawn in fine vertical lines