Your model is not wrong, it is overconfident
Accuracy tells you how often the label is right. Calibration tells you whether the confidence means anything — and for anything with a human downstream, the second matters more.
A classifier that is 90% accurate and reports 0.99 confidence on everything is worse than one that is 87% accurate and reports 0.87 when it means 0.87. The second can be thresholded. The first cannot be used for anything but a hard decision.
The definition
A model is calibrated if, among all predictions made with confidence p, the fraction that are correct is p. Bin the predictions by confidence and compare accuracy per bin to the bin’s mean confidence. The weighted average of those gaps is expected calibration error:
ECE = Σ (|Bₘ| / n) · | acc(Bₘ) − conf(Bₘ) |
Why modern networks are badly calibrated
Deeper networks trained to convergence on cross-entropy keep pushing the logit gap open long after the argmax has stopped changing — the loss keeps rewarding it. Batch normalisation and insufficient weight decay make it worse. The result is a model whose accuracy stopped improving at epoch 20 and whose confidence kept climbing until epoch 60.
The fix that is almost free
Temperature scaling: learn a single scalar T on a held-out set and divide the logits by it before the softmax.
p = softmax(z / T)
One parameter. It cannot change the argmax, so accuracy is untouched by construction, and it typically cuts ECE by a factor of three or more. Fit it on validation data, never on the training set.
What to do with the calibrated number
Once confidence means something, you can set a threshold and abstain below it.
On the sentiment service I run, predictions below the floor return uncertain
instead of a label. That single change did more for how much people trusted the
output than any accuracy work I did on the same model.
The check I now run every time
Plot the reliability diagram before shipping. If the curve sits below the diagonal, the model is overconfident and any downstream threshold you pick is built on a number that does not mean what it says.
— Ishaan Sandhwar