There are two models with an accuracy of 88%.
- Model A has a confidence of 89%
- Model B has a confidence of 99%
Which would you choose?
The ANSWER "any of them, they have the same accuracy" ends the interview.
➡️ what's missing?
Modern neural networks often mislead.
They give an overconfidence in predictions.
For example, in one experiment on the CIFAR-100 dataset, LeNet and ResNet were compared.
LeNet:
- accuracy ≈ 0.55
- average confidence ≈ 0.54
ResNet:
- accuracy ≈ 0.7
- average confidence ≈ 0.9
Despite the higher accuracy, ResNet is overconfident in its predictions. The model believes it's right with a 90% probability, but the actual accuracy is about 70%.
Calibration solves this problem.
A model is considered calibrated if the probabilities of predictions correspond to the real outcomes.
For example: if the model gives a probability of 70%, then in about 70% of cases, the event should actually occur.
This is important because such models are used in decision-making.
A poorly calibrated but confident model can give critically misleading results.
Example: a state hospital plans expensive medical tests.
A realistic assessment of probabilities helps optimally allocate the budget and make decisions.
If the model is not calibrated, it will give overly confident predictions.
Reliability diagrams are used to visually check calibration.
They show the dependence of the actual accuracy on the predicted confidence (softmax values).
An ideally calibrated model gives a line y = x.
They also use a scalar metric - expected calibration error (ECE).
One of its approximations is to divide the predictions into intervals and average the difference between accuracy and confidence across these bins.
The main methods of model calibration:
For binary classification:
- histogram binning
- isotonic regression
- Platt scaling
For multi-class classification:
- binning
- matrix and vector scaling
••••••••••••••••••••••••••••••••••••••
🤖 Data & ML | @DataXplore
