PreprintCited by 209Adversarial Robustness in Machine LearningAdvanced Neural Network ApplicationsMachine Learning and Data Classification

Measuring Calibration in Deep Learning

Open access
Nixon, Jeremy, Dusenberry, Mike, Jerfel, Ghassen, Nguyen, Timothy, Liu, Jeremiah, Zhang, Linchuan, Tran, Dustin·2019·arXiv

Abstract

Overconfidence and underconfidence in machine learning classifiers is measured by calibration: the degree to which the probabilities predicted for each class match the accuracy of the classifier on that prediction. How one measures calibration remains a challenge: expected calibration error, the most popular metric, has numerous flaws which we outline, and there is no clear empirical understanding of how its choices affect conclusions in practice, and what recommendations there are to counteract its flaws. In this paper, we perform a comprehensive empirical study of choices in calibration measures including measuring all probabilities rather than just the maximum prediction, thresholding probability values, class conditionality, number of bins, bins that are adaptive to the datapoint density, and the norm used to compare accuracies to confidences. To analyze the sensitivity of calibration measures, we study the impact of optimizing directly for each variant with recalibration techniques. Across MNIST, Fashion MNIST, CIFAR-10/100, and ImageNet, we find that conclusions on the rank ordering of recalibration methods is drastically impacted by the choice of calibration measure. We find that conditioning on the class leads to more effective calibration evaluations, and that using the L2 norm rather than the L1 norm improves both optimization for calibration metrics and the rank correlation measuring metric consistency. Adaptive binning schemes lead to more stablity of metric rank ordering when the number of bins vary, and is also recommended. We open source a library for the use of our calibration measures.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

DataCite · 10.48550/arxiv.1904.01685

Cites

8 of 8 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • ECE has a severe imbalance of samples across bins because neural networks tend to always predict with high confidence, causing only a few bins to contribute most to ECE; ECE is also sensitive to bin boundaries.

    “However, there might be a severe imbalance of samples across the bins because neural networks tend to always predict with high confidence (Nixon et al., 2019). This causes only a few bins (concentrated towards the high confidence region) to contribute the most to ECE. In addition, ECE is also sensitive to the bin boundaries i.e., the number of bins.”
  • A cited study reports a greater reduction in closed-domain hallucinations than in open-domain ones.

    “Consistent with this, [27] reports a greater reduction in closed-domain hallucinations over open-domain ones.”

    From Calibrated Language Models Must Hallucinate (2024) · cites this paper as [27]

    The Abstract (p. 1) describes a study of calibration measures, and §5.3 (pp. 6–7) compares their sensitivity to binning choices. Searches for closed-domain and open-domain hallucinations found no passage reporting a reduction in either, so our copy does not address the attributed comparison. (LLM, conf=0.78)

    Experimental — accuracy not yet measured
  • Post-training alignment was used to reduce hallucination but was also found to reduce calibration.

    “Post-training alignment was applied to reduce hallucination (among other factors) but was also found to reduce calibration [27].”

    From Calibrated Language Models Must Hallucinate (2024) · cites this paper as [27]

    The Introduction (p. 2) describes a study of calibration measures, and §2.3 (p. 3) discusses post-processing classifier outputs for recalibration. Searches for post-training alignment, hallucination, and reduced calibration found no passage addressing the claimed trade-off. (LLM, conf=0.76)

    Experimental — accuracy not yet measured
  • Post-training reduces hallucination rates at the cost of increasing calibration error, as suggested by the model and shown in GPT-4 calibration curves.

    “As suggested by our model, post-training reduces hallucination rates at the cost of increasing calibration error.Note that calibration here is on a multiple-choice test rather than generative calibration which we study.”

    From Calibrated Language Models Must Hallucinate (2024) · cites this paper as [27]

    Section 5.4 (pp. 7–8) examines how calibration metrics rank recalibration methods; Section 2.3 (p. 3) describes post-processing classifiers to calibrate their predictions. Our copy does not address hallucination rates, GPT-4 calibration curves, or the claimed trade-off from post-training (searched: post-training, hallucination, GPT-4, multiple-choice). (LLM, conf=0.77)

    Experimental — accuracy not yet measured
  • In the first stage of pretraining, common today, the generative language model is optimized for predictive text performance.

    “Notably in the first stage of pretraining, common today, the generative LM is optimized for predictive text performance [9,27].”

    From Calibrated Language Models Must Hallucinate (2024) · cites this paper as [27]

    The Introduction (p. 1) discusses calibrated prediction probabilities, and the other retrieved passages concern classifier calibration. Searches for generative language models, pretraining, and next-token prediction found no passage addressing whether a generative LM is optimized for predictive text performance in its first stage of pretraining. (LLM, conf=0.76)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 18

  1. Cynthia S Crowson, Elizabeth J Atkinson, and Terry M Therneau. Assessing calibration of prognostic risk scores. Statistical methods in medical research , 25(4):1692-1706, 2016.
  2. Michael W. Dusenberry, Dustin Tran, Edward Choi, Jonas Kemp, Jeremy Nixon, Ghassen Jerfel, Katherine Heller, and Andrew M. Dai. Analyzing the role of model uncertainty for electronic health records. In Proc. of the ACM Conference on Health, Inference, and Learning (ACM CHIL) , pp. 204-213, Toronto Ontario Canada, April 2020. ACM. ISBN 978-1-4503-7046-2. doi: 10.1145/3368555.3384457. URL http://arxiv.org/abs/1906.03842 . · DOI
  3. Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association , 102(477):359-378, 2007.
  4. Dan Hendrycks, Mantas Mazeika, and Thomas G Dietterich. Deep anomaly detection with outlier exposure. arXiv preprint arXiv:1812.04606 , 2018. · arXiv
  5. David W Hosmer and Stanley Lemesbow. Goodness of fit tests for the multiple logistic regression model. Communications in statistics-Theory and Methods , 9(10):1043-1069, 1980.
  6. Xiaoqian Jiang, Melanie Osl, Jihoon Kim, and Lucila Ohno-Machado. Calibrating predictive model estimates to support personalized medicine. Journal of the American Medical Informatics Association , 19(2):263-274, 2011.
  7. Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate uncertainties for deep learning using calibrated regression. arXiv preprint arXiv:1807.00263 , 2018. · arXiv
  8. Aviral Kumar, Sunita Sarawagi, and Ujjwal Jain. Trainable calibration measures for neural networks from kernel mean embeddings. In International Conference on Machine Learning , pp. 2810-2819, 2018.
  9. Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. arXiv preprint arXiv:1711.09325 , 2017. · arXiv
  10. Allan H Murphy and Edward S Epstein. Verification of probabilistic predictions: A brief review. Journal of Applied Meteorology , 6(5):748-755, 1967.
  11. Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Twenty-Ninth AAAI Conference on Artificial Intelligence , 2015.
  12. Khanh Nguyen and Brendan O'Connor. Posterior calibration and exploratory analysis for natural language processing models. arXiv preprint arXiv:1508.05154 , 2015. · arXiv
  13. Alexandru Niculescu-Mizil and Rich Caruana. Predicting good probabilities with supervised learning. In Proceedings of the 22nd international conference on Machine learning , pp. 625-632. ACM, 2005.
  14. John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers , 10(3):61-74, 1999.
  15. Maithra Raghu, Katy Blumer, Rory Sayres, Ziad Obermeyer, Robert Kleinberg, Sendhil Mullainathan, and Jon Kleinberg. Direct uncertainty prediction for medical second opinions. arXiv preprint arXiv:1807.01771 , 2018. · arXiv
  16. Seonguk Seo, Paul Hongsuck Seo, and Bohyung Han. Learning for single-shot confidence calibration in deep neural networks through stochastic inferences. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition , pp. 9030-9038, 2019.
  17. Sunil Thulasidasan, Gopinath Chennupati, Jeff Bilmes, Tanmoy Bhattacharya, and Sarah Michalak. On mixup training: Improved calibration and predictive uncertainty for deep neural networks. arXiv preprint arXiv:1905.11001 , 2019. · arXiv
  18. Juozas Vaicenavicius, David Widmann, Carl Andersson, Fredrik Lindsten, Jacob Roll, and Thomas B Schön. Evaluating model calibration in classification. arXiv preprint arXiv:1902.06977 , 2019. · arXiv

Cited by

Sorted by citations

Authors
Nixon, J., Dusenberry, M., Jerfel, G., Nguyen, T., Liu, J., Zhang, L., & Tran, D.
Affiliations
Google (United States) (US)
Venue
arXiv
Publisher
arXiv
Published
2019
ISSN
2331-8422 (ISSN-L)
OpenAlex
W2933254221
Cited by
209
References
8
Citations by year
2026: 3 · 2025: 22 · 2024: 40 · 2023: 60 · 2022: 28 · 2021: 37 · 2020: 17 · 2019: 2
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion)
  • arXiv (Cornell University)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning
  • Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
  • Physical Sciences › Computer Science › Artificial Intelligence › Machine Learning and Data Classification
Keywords
classifier calibration, expected calibration error, overconfidence, underconfidence, recalibration, adaptive binning, calibration metrics, deep learning

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review