Source-linked AI summary
Evaluating model calibration in classification
Juozas Vaicenavicius, David Widmann, Carl Andersson, Fredrik Lindsten, Jacob Roll, Thomas B. Schön
TL;DR
The paper addresses how to evaluate whether multiclass probability outputs reflect realized outcome distributions, beyond calibrating only predicted-class confidence. It develops a probability-theoretic framework, refines interpretations of empirical calibration measures, and proposes hypothesis tests and multidimensional reliability diagrams.
Problem
Calibration evaluation must determine whether the entire probabilistic classifier output, not only predicted-class confidence, matches realized outcome distributions.
Method
The paper develops a general probability-theoretic framework using calibration functions, hypothesis tests, and multidimensional reliability diagrams.
Results
Empirical miscalibration estimates should not be naively compared across probabilistic classifiers but can be used in hypothesis tests for model reliability.
Takeaways & Limitations
Calibration evaluation should use rigorous statistical interpretations and tools that examine chosen aspects or the full multiclass probability output.
Takeaways & Limitations
The lower-bound interpretation relies on asymptotics with a fixed binning, while convergence rates for different binning schemes remain future work.
Abstract
from arXiv · showhide
Probabilistic classifiers output a probability distribution on target classes rather than just a class prediction. Besides providing a clear separation of prediction and decision making, the main advantage of probabilistic models is their ability to represent uncertainty about predictions. In safety-critical applications, it is pivotal for a model to possess an adequate sense of uncertainty, which for probabilistic classifiers translates into outputting probability distributions that are consistent with the empirical frequencies observed from realized outcomes. A classifier with such a property is called calibrated. In this work, we develop a general theoretical calibration evaluation framework grounded in probability theory, and point out subtleties present in model calibration evaluation that lead to refined interpretations of existing evaluation techniques. Lastly, we propose new ways to quantify and visualize miscalibration in probabilistic classification, including novel multidimensional reliability diagrams.
1 Introduction
The paper argues that calibration evaluation should assess whether an entire probabilistic classifier output reflects real-world probabilities, especially in safety-critical applications. It develops a probability-theoretic framework that refines existing evaluation methods and introduces multidimensional reliability diagrams.
- Calibration asks whether classifier outputs can be interpreted as real-world probabilities relevant to decision making.
- Safety-critical applications require evaluating the entire classifier output rather than only the predicted class’s confidence score.
- The paper develops a general mathematical framework grounded in probability theory for evaluating probabilistic multiclass classifiers.
- Existing calibration techniques become special cases within the framework, which supports statistical interpretation and more cautious conclusions.
- The authors reinterpret popular calibration techniques to avoid unjustified conclusions with potentially undesirable practical consequences.
- The paper proposes multidimensional reliability diagrams that represent full calibration information for classification problems with three or four classes.
- The proposed evaluation methods are illustrated on standard neural network classifiers.
- The work responds to calls for broader predictive-uncertainty evaluation beyond conventional metrics.
2 Problem formulation
The paper formulates multiclass calibration probabilistically, distinguishes full reliability from weaker calibration conditions, and reviews existing evaluation and construction approaches. A motivating example shows why marginal or predicted-class calibration alone may be insufficient for reliable probabilistic outputs.
- 2 Problem formulation: The problem is posed using i.i.d. input–target pairs, finite class labels, and probabilistic classifiers mapping inputs to distributions over classes.
- 2 Problem formulation: The optimal classifier is the conditional distribution p(Y|X), but finite data generally make it impossible to recover exactly.
- 2 Problem formulation: A classifier is reliable when the target distribution conditional on any model prediction equals that prediction.
- 2 Problem formulation: Predicted-class confidence calibration and marginal calibration are weaker conditions that need not imply full multiclass reliability.
- 2 Problem formulation: A three-class toy example satisfies predicted-class and marginal calibration while violating the paper’s reliability condition.
- 2 Problem formulation: The paper’s framework supports arbitrary calibration aspects, empirical evaluation, hypothesis tests, and multidimensional reliability diagrams.
- 2.1 Related work: Practical use of calibrated classifiers requires methods both to evaluate calibration and to build candidate models.
- 2.1 Related work: Prior work studies reliability diagrams, predictive-uncertainty scoring, calibration-aware training, and post-processing recalibration.
3 Theoretical framework
The framework characterizes calibration through conditional predictive distributions, then evaluates selected aspects using induced problems and quantitative miscalibration measures.
- A calibrated classifier can be constructed from any measurable representation h, ranging from the ideal model to an uninformative marginal predictor.If h is bijective, the resulting classifier is ideal; if h is constant, it always predicts the marginal distribution of Y.
- 3.1 Calibration functions: The calibration function r maps each prediction μ to the conditional distribution of the target given that prediction.Reliability holds exactly when r is the identity function, while deviations from identity quantify miscalibration at different predictions.
- 3.1 Calibration functions: Partial calibration evaluation applies measurable transformations ψ to predictions and outcomes, creating induced probabilistic models for examining particular calibration aspects.A calibrated model induces calibrated models for these problems, but an induced calibration function equal to identity does not guarantee full calibration.
- 3.1 Calibration functions: The framework includes canonical calibration and top-k prediction evaluations; Guo et al.'s perfect-calibration definition is the special case k = 1.The top-k construction captures calibration of the k largest predictions through an induced calibration function.
- 3.2 Measures of miscalibration: A distance function between predictions and calibration-function values summarizes expected or worst-case miscalibration over a chosen region of the probability simplex.The region can be the entire simplex or a restricted area of interest; total variation and squared Euclidean distance are examples.
4 Empirical calibration evaluation
The paper develops empirical calibration estimators, uncertainty-aware hypothesis tests, and visualizations that expose limitations of direct miscalibration comparisons and one-dimensional reliability diagrams.
- Estimators: Histogram regression estimates the calibration function by making it constant within each partition bin, with zero assigned to empty bins.
- Estimators: Finer partitions can yield convergence to the calibration function, while data-dependent binning may converge faster in practice.
- Estimators: The resulting estimator can be interpreted as an estimator of expected miscalibration, including the binary special case used by Guo et al.
- Estimator properties: Fixed-partition estimates provide a lower bound on true expected miscalibration asymptotically for uncalibrated models under the theorem's convexity conditions.
- Statistical testing: Consistency resampling estimates statistic variability under known calibration functions, enabling p-values for testing perfect calibration.
- Model comparison: Comparing two models only through realized miscalibration estimates is unjustified because estimator biases and distributions can differ.
- Reliability diagrams: The proposed visualizations use deviation plots and consistency bars, while multidimensional diagrams show class-wise deviations on the probability simplex and encode bin proportions by color.
5 Experimental results
The framework is illustrated on a Gaussian mixture and neural-network classifiers using reliability diagrams, miscalibration estimates, consistency bars, and hypothesis testing. Results show that empirical estimates can behave subtly, while multidimensional diagrams reveal calibration patterns not captured equally by one-dimensional inspections.
- One-dimensional Gaussian mixture model: 0 for calibrated models and approximately 0.56 for the uncalibrated model in expected total variation miscalibration.Empirical estimates are close to zero for calibrated models but almost always overestimate expected miscalibration; the uncalibrated model shows both over- and underestimation.
- One-dimensional Gaussian mixture model: Increasing sample size, particularly increasing samples per bin, makes underestimation more likely for the uncalibrated model.
- One-dimensional Gaussian mixture model: Empirical deviations closely match the true analytical deviations in reliability diagrams for the perfect, calibrated constant, and uncalibrated Gaussian-mixture models.The diagrams also show prediction distributions and consistency bars.
- Neural networks: LeNet’s one-dimensional maximum-prediction diagrams on CIFAR-10 cannot visually rule out the reliability hypothesis for equally sized or data-dependent bins.
- Neural networks: Two-dimensional diagrams show small deviations, especially in regions with frequent predictions, for CIFAR-10 predictions grouped into three class groups.
- Neural networks: DenseNet and ResNet diagrams, especially one-dimensional diagrams with data-dependent bins, support the reliability hypothesis less than LeNet diagrams.
- Neural networks: The p-value test consistently indicates miscalibration for MNIST LeNet models with the best predictive uncertainty under negative log-likelihood.
6 Conclusion
The paper frames calibration evaluation as checking whether predicted probabilities match realized-outcome distributions. It proposes a probability-theoretic framework and argues that empirical miscalibration estimates should support hypothesis tests rather than naive classifier comparisons.
- Calibration evaluation checks whether probabilities predicted by a model match the distribution of realized outcomes.
- The paper proposes a general mathematical framework for evaluating model calibration or selected calibration aspects in classification problems.
- Empirical estimates of intuitive miscalibration measures should be used in hypothesis tests for model reliability, not naively to compare probabilistic classifiers.
A.1 Additional examples
Additional examples expose distinctions among calibration notions and show that estimator bias can differ substantially even for calibrated classifiers. The examples also reinterpret existing calibration evaluations through induced calibration functions.
- Perfect calibration according to Guo et al. (2017) does not imply calibrated marginal predictions in the three-class example.The model is perfectly calibrated under that definition, yet all marginal predictions are uncalibrated and the classifier is not reliable.
- The two uniformly distributed predictions in Figure 5 illustrate a classifier that is perfectly calibrated according to Guo et al. (2017) but lacks calibrated marginal predictions and reliability.
- Kendall and Gal’s calibration evaluation can be expressed using an induced calibration function.
- 0.5 is the estimator bias for the calibrated constant model with one simplex-wide bin and one data point, whereas the perfect model’s bias is 0.
A.2 Proofs
The proofs establish calibration results for classifiers formed from measurable transformations and convergence of partition-based empirical miscalibration estimators. They also characterize when Jensen’s inequality yields equality and motivate data-dependent simplex binning.
- A classifier defined through a measurable transformation can be calibrated, including the ideal model for a bijection and an uninformative marginal predictor for a constant function.
- Under Lipschitz calibration and shrinking finite data-independent partitions, the partition-based estimator converges almost surely to expected miscalibration.
- For continuous convex distances, the limiting partition expression is governed by Jensen’s inequality; equality has an explicit affine-function condition.
- Partitioning the probability simplex into bins with approximately equal numbers of predictions is presented as an alternative to fixed-width binning.The study uses recursive splits along the highest-variance dimension while predictions per bin exceed a threshold.
C.1.1 Perfect model
The figures evaluate estimated versus expected miscalibration across perfect, calibrated constant, and uncalibrated models, using total variation distance and reliability diagrams. They also visualize multidimensional reliability for DenseNet and ResNet on CIFAR-10.
- C.1.1 Perfect model: The perfect model is assessed by comparing estimated and expected miscalibration with 10 and 100 equally-sized bins across 1000 random-data series.The model uses β0 = 0 and β1 = −2, and miscalibration is measured with total variation distance.
- C.1.1 Perfect model: Reliability diagrams for the perfect model use a 10000-input random test set and show prediction distributions, resampled deviation percentiles, and the true analytical deviation.Crosses indicate the deviation of outcome distributions from predictions in each bin.
- C.1.1 Perfect model: The calibrated constant model is evaluated with 10 and 100 equally-sized bins over 1000 random-data series using total variation distance.This model sets β0 = β1 = 0.
- C.1.1 Perfect model: Reliability diagrams for the calibrated constant model use 10000 random test inputs and compare binned prediction distributions with resampled and analytical deviations.Crosses mark observed deviations, while red bars show the 5th and 95th percentiles from 1000 consistency resamples.
- C.1.1 Perfect model: The uncalibrated model is examined with 10 and 100 equally-sized bins across 1000 random-data series, and with reliability diagrams on 10000 random test inputs.The uncalibrated model sets β0 = β1 = 1; the diagrams include prediction distributions, resampled deviation percentiles, and the true analytical deviation.
- C.1.1 Perfect model: Two-dimensional reliability diagrams visualize DenseNet and ResNet CIFAR-10 predictions in 25- and 100-bin layouts using grouped classes, deviation arrows, and color-coded empirical prediction frequencies.The class groups are {0, 1, 2}, {3, 4, 5}, and {6, 7, 8, 9}.
D Expected miscalibration estimates for neural networks
The paper estimates expected miscalibration for DenseNet, ResNet, and LeNet trained on CIFAR-10 under multiple evaluation choices. These choices include binning schemes, calibration lenses, and distance functions, with total variation and equally-sized bins corresponding to Guo et al.'s expected miscalibration error.
- D Expected miscalibration estimates for neural networks: Tables 3 to 5 report expected-miscalibration estimates for DenseNet, ResNet, and LeNet trained on CIFAR-10.The estimates use different binning schemes, calibration lenses, and distance functions.
- D Expected miscalibration estimates for neural networks: Total variation distance with maximum predictions and equally-sized bins matches the expected miscalibration error used by Guo et al. (2017).The passage identifies this configuration as the comparison point for the reported estimates.
- D Expected miscalibration estimates for neural networks: Model accuracy is 0.933 ± 0.002 for DenseNet, 0.934 ± 0.002 for ResNet, and 0.727 ± 0.004 for LeNet.Standard deviations are estimated using bootstrapping.