Uncertainty Estimation in Vision
A softmax score of 0.97 can still be a guess. Uncertainty estimation measures disagreement across predictions, so strange inputs route to humans before they cause harm.
Why Does This Exist?
A classifier returns a full probability vector on every input, including inputs nothing like its training data: a sketch, a night shot, a new sensor. The top score still looks confident, because softmax must sum to 1. Acting on that confidence produces the worst failures, from wrong triage to phantom braking.
Uncertainty estimation separates what the model knows from what it guesses. Ensembles and dropout sampling measure disagreement across predictions; calibration checks whether stated confidence matches accuracy; selective prediction routes the uncertain fraction to humans. This page covers disagreement-based scores and the abstention threshold. The two uncertainty kinds live in aleatoric versus epistemic uncertainty.
Think of It Like This
Five radiologists voting independently
One radiologist always names something, even on a blurry scan. Five independent radiologists who agree 5 to 0 are trustworthy; a 3 to 2 split with hedged language means calling the specialist. The vote spread, not any single vote, carries the doubt.
Ensembles are those five votes. Low variance means the models independently converged; high variance means the input sits where training gave no consensus. The analogy stops at cost: five radiologists bill five times, and so do five models, which is why cheaper approximations such as dropout sampling exist.
How It Actually Works
Ensemble variance and predictive entropy
Train models from different seeds, or run one dropout model times with dropout left on (Monte Carlo dropout). For an input, let be model 's predicted probability for the top class, with mean . The disagreement score is the variance : near zero when the members agree, large when they scatter. The fuller summary is the predictive entropy over classes , which also grows when the averaged distribution spreads out. Model-side doubt that more data would shrink is epistemic; noise baked into the input itself is aleatoric. Pick an abstention threshold on held-out data: inputs with say unsure and route to review instead of answering.
Worked five-model example
Five models score one familiar photo with top-class probabilities . The mean is , and the variance is . The same ensemble scores a corrupted frame at : mean and variance . The strange input disagrees about 69 times more (), so a threshold such as keeps the familiar photo and routes the corrupted one.
Code
import statistics
familiar = [0.82, 0.85, 0.80, 0.83, 0.81]strange = [0.45, 0.70, 0.30, 0.60, 0.40]print(round(statistics.pvariance(familiar), 4))# -> 0.0003print(round(statistics.pvariance(strange), 4))# -> 0.0204print(round(statistics.pvariance(strange) / statistics.pvariance(familiar), 1))# -> 68.9Watch Out For
Tuning the threshold on the test set
A threshold picked to maximize answered accuracy on the evaluation set bakes in that set's corruption mix. The symptom is a deployed router that abstains constantly or never once the mix shifts. Tune on a separate held-out split with a documented cost ratio for wrong answers versus delayed ones.
Agreement mistaken for correctness
Low variance means the members agree, not that they are right: five models sharing one blind spot vote together confidently. The symptom is unanimous wrong answers on a shifted slice. Pair the threshold with calibration checks and slice evaluations instead of trusting agreement alone.
The Quick Version
- Softmax confidence must sum to 1, so it cannot mark strange inputs; disagreement across runs can.
- Five-model variance near 0.0003 means familiar, near 0.020 means strange, about a 69-fold gap.
- A threshold such as 0.005 routes high-variance inputs to review instead of answering them.
- Predictive entropy over the averaged distribution summarizes the same doubt in one number.
- Tune thresholds on held-out data, and never read agreement as proof of correctness.