Measuring Calibration in Deep Learning
By Jeremy Nixon, Michael W. Dusenberry, Linchuan Zhang, Ghassen Jerfel, Dustin Tran. 2019
692 citations recorded by the source corpus.
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.
Subfields: Artificial Intelligence, Evaluation & Benchmarks
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Artificial Intelligence
- Percy Liang
- Sergey Levine
- Quoc V. Le
- Mohit Bansal
- Yoshua Bengio
- Trevor Darrell
- Jianfeng Gao
- Luke S. Zettlemoyer
In Evaluation & Benchmarks
- Balaji Lakshminarayanan
- Neil Houlsby
- Percy Liang
- Dustin Tran
- Xiaohua Zhai
- Jitendra Malik
- Jonathon Shlens
- Tengyu Ma
Citations in the corpus
- Simple and Principled Uncertainty Estimation with Deterministic Deep Learning via Distance Awareness (2020, background): “[56] J.”
- Verified Uncertainty Calibration (2019, methodology): “1 and `1 calibration errors are also used in the literature [9, 23, 24].”
- Language models enable zero-shot prediction of the effects of mutations on protein function (2021, methodology): “Following Neumann et al. [58] and Nixon et al. [59] we adapt average calibration error for the multi-class setting as follows: where K is the number of classes, B + k is the number of non-empty bins for class k , and acc and conf are the accuracy and confidence for bin b and class k .”
- A survey of uncertainty in deep neural networks (2021, background): “With this adaptive bin size, the adaptive Expected Calibration Error (aECE) aECE = 1 R R∑ r=1 |conf(br)− acc(br)| , (51) and the adaptive Static Calibration Error (aSCE) aSCE = 1 KR K∑ k=1 R∑ r=1 |conf(brk)− acc(brk)| (52) are defined as extensions of the ECE and the SCE.”
- Coarse race data conceals disparities in clinical risk score performance (2023, background): “Calibration assesses how well predicted risk probabilities match the true probability of an outcome, and it is widely studied in ML and healthcare (Crowson et al., 2016; Kleinberg et al., 2016; Nixon et al., 2020; Yadlowsky et al., 2019; Deniffel et al., 2020; Khurshid et al., 2022).”
- Class-Incremental Domain Adaptation with Smoothing and Calibration for Surgical Report Generation (2021, methodology): “We evaluate the model using four metrics for image captioning, namely BLEUn [20], ROUGE [15], METEOR [3], CIDEr [23] and miscalibration with Expected Calibration Error (ECE), Static Calibration Error (SCE), Thresholded Adaptive Calibration Error (TACE) [where, threshold = 10−3], Brier Score (BS) [2,”
- Revisiting the Calibration of Modern Neural Networks (2021, background): “Nevertheless, it is well understood that estimating ECE accurately is difficult because estimators can be strongly biased and many estimator variants exist (Nixon et al., 2019; Roelofs et al., 2020; Vaicenavicius et al., 2019; Gupta et al., 2021).”
- Teaching Models to Express Their Uncertainty in Words (2022, methodology): “Then the MAD is given by: While this is not a proper scoring rule, it offers a simple numeric summary of the calibration curves shown in Section 3 (Hendrycks et al., 2018; Nixon et al., 2019).”
- Pitfalls of In-Domain Uncertainty Estimation and Ensembling in Deep Learning (2020, methodology): “Thresholded adaptive calibration error (TACE) was proposed as a step towards solving some of these problems (Nixon et al., 2019).”
- Dynamically Weighted Balanced Loss: Class Imbalanced Learning and Confidence Calibration of Deep Neural Networks (2021, background): “While ECE is the most common calibration metric, it has several drawbacks [52].”
- Local Temperature Scaling for Probability Calibration (2020, methodology): “As it is difficult to work directly with this definition to assess miscalibration, we extend several visual and quantitative metrics [11, 53, 54, 56, 57], which have previously been proposed in the context of classification.”
- Hands-On Bayesian Neural Networks—A Tutorial for Deep Learning Users (2020, background): “The final model might also generalize in unforeseen and overconfident ways on out-of-training-distribution data points [15, 16].”
- Mitigating bias in calibration error estimation (2020, background): “Recent work observed that the calculation of ECEbin is sensitive to implementation (Kumar et al., 2019; Nixon et al., 2019).”
- Regression diagnostics meets forecast evaluation: conditional calibration, reliability diagrams, and coefficient of determination (2021, background): “Recently, the estimation of calibration error has seen a surge of interest in machine learning (Guo et al., 2017; Kuleshov et al., 2018; Kumar et al., 2019; Nixon et al., 2019; Roelofs et al., 2022).”
- Uncertainty Sets for Image Classifiers using Conformal Prediction (2020, methodology): “There are two problems with naive: first, the probabilities output by CNNs are known to be incorrect (Nixon et al., 2019), so the sets from naive do not achieve coverage.”