Evaluation, Robustness & Ethics

model calibration

Calibration asks whether a model's confidence means what it says. When a classifier outputs '90% sure this is a cat', a well-calibrated model is right about 90% of the time across all the cases where it says 90%. This is different from accuracy: accuracy asks whether the top guess is correct; calibration asks whether the attached probability is honest. A model can be accurate but overconfident (claims 99% but is right 80% of the time), which is dangerous wherever the confidence drives a downstream decision — a self-driving car deciding whether to brake, a medical system deciding whether to defer to a doctor.

To make this precise, group predictions by their stated confidence and check the actual frequency of being correct in each group. A perfectly calibrated model satisfies: among all predictions made with confidence p, the empirical accuracy equals p, for every p. A reliability diagram visualizes this by binning predictions into confidence buckets (say 0–10%, 10–20%, …) and plotting bucketed confidence on the x-axis against bucketed accuracy on the y-axis; the ideal is the 45-degree diagonal. Bars sagging below the diagonal mean overconfidence; bars above mean underconfidence.

The standard scalar summary is the Expected Calibration Error (ECE): bin the predictions by confidence, and for each bin take the absolute gap between its average confidence and its actual accuracy, then average those gaps weighted by how many samples fall in each bin. ECE near 0 is well-calibrated; large ECE means the confidences are systematically off. Related measures include Maximum Calibration Error (the worst bin) and proper scoring rules like negative log-likelihood and the Brier score, which reward calibrated probabilities directly rather than via binning.

A well-known finding is that modern deep networks are badly miscalibrated, and typically overconfident — a 2017 study showed accuracy improved over the AlexNet era while calibration got worse, partly because high-capacity models trained with cross-entropy are pushed toward near-1 softmax outputs. Common fixes are post-hoc and cheap: temperature scaling divides the logits by a single learned scalar T before softmax, softening over-sharp distributions without changing which class wins (so accuracy is untouched); Platt scaling, isotonic regression, and ensembling / deep ensembles also help. Calibration matters precisely because so many safety-critical and decision-theoretic uses treat the softmax number as a real probability — and uncalibrated, it is not one.

Calibration and accuracy are orthogonal: you can be accurate but miscalibrated, or perfectly calibrated yet inaccurate (e.g. a model that always says '50%' on a balanced coin-flip task is calibrated but useless). Always report both, and remember temperature scaling needs a held-out validation set to fit T — fitting on the test set leaks information.

Also called
confidence calibrationECEreliability diagramexpected calibration error