Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

AI Confidence Scores: What 90% Calibration Means

· 7 min read · Home Tech

In this article
  1. What Is a Confidence Score?
  2. What Does "Calibration" Mean Exactly?
  3. Why a 90% Score Can Be Wrong
  4. How Is Calibration Achieved?
  5. How to Check If a Model Is Calibrated at 90%
  6. Common Mistakes and Misconceptions
  7. Why Calibration Matters in Real Applications
  8. Frequently Asked Questions

AI confidence scores tell you how likely a model's prediction is correct, but a 90% score only means what you think if the model is well-calibrated. Calibration at 90% requires that, across all predictions where the model says "90% confident," exactly 90 out of 100 turn out to be correct. This article explains what calibration means, why a raw confidence score can be misleading, and how to check whether a model's 90% claim is trustworthy.

in n | Number of predictions | - | 100 | 1
in c | Confidence score | % | 90 | 0
out expected | Expected correct | count | n * c / 100 | 0
out expected_pct | Expected correct | % | c | 1

What Is a Confidence Score?

A confidence score is a number, usually between 0 and 1 or 0% and 100%, that a machine learning model attaches to each prediction. For example, an image classifier might output "cat: 0.92, dog: 0.07, bird: 0.01." The 0.92 is the model's estimated probability that the image contains a cat. In a well-calibrated model, those probabilities correspond to real-world frequencies: if you collect every prediction with a score of 0.92, about 92% of them should be correct.

Confidence scores are used in many fields: medical diagnosis, fraud detection, self-driving cars, and natural language processing. They help humans decide when to trust the model and when to defer to a human expert. A high score usually means "act on this," and a low score means "check this." But the score is only useful if it is calibrated.

What Does "Calibration" Mean Exactly?

Calibration is the statistical property that predicted probabilities match observed frequencies. Formally, for a model to be perfectly calibrated at confidence level p, the proportion of correct predictions among all predictions with confidence p must equal p. So for 90% calibration:

  • Of all predictions where the model says 90% confident, exactly 90% are correct.
  • Of all predictions where the model says 70% confident, exactly 70% are correct.
  • This must hold for every confidence level, not just 90%.

In practice, models are rarely perfectly calibrated across all levels. Calibration is usually measured with a reliability diagram (a plot of predicted confidence vs. actual accuracy) or with metrics like Expected Calibration Error (ECE) and Maximum Calibration Error (MCE). ECE is the average difference between confidence and accuracy, weighted by the number of predictions in each bin. For example, if a model's average confidence in a bin is 0.90 and the actual accuracy in that bin is 0.85, the calibration error for that bin is 0.05.

Why a 90% Score Can Be Wrong

Many models are overconfident, especially modern deep neural networks. A model might output 0.90 for a prediction that is only correct 60% of the time. This happens because the training objective (like cross-entropy loss) encourages the model to be decisive, and the softmax function (which converts raw outputs to probabilities) tends to produce sharp, extreme values. Overconfidence is particularly common when the model is tested on data that differs from its training data—a phenomenon called distribution shift.

Underconfidence is also possible, though less common. A model might output 0.60 for predictions that are actually correct 80% of the time. This can happen with models that are regularized too heavily or trained on noisy labels. Both over- and under-confidence reduce the usefulness of the score.

How Is Calibration Achieved?

Calibration is not automatic; it must be explicitly enforced. Common techniques include:

  • Temperature scaling: A single scalar parameter T is learned on a validation set and divides the logits before the softmax. A higher T makes the distribution softer (less confident), a lower T makes it sharper. This is the simplest and often most effective post-hoc method.
  • Platt scaling: A logistic regression is trained on the model's raw scores to map them to calibrated probabilities.
  • Isotonic regression: A non-parametric method that fits a step function to the scores, ensuring monotonicity.
  • Label smoothing: During training, the target labels are softened (e.g., 0.9 for the true class instead of 1.0), which reduces overconfidence.
  • Ensembling: Averaging probabilities from multiple models often improves calibration.

These methods are typically applied after training, using a held-out validation set to avoid overfitting the calibration parameters.

How to Check If a Model Is Calibrated at 90%

To verify 90% calibration, you need a dataset of predictions with their confidence scores and ground truth labels. Then:

  1. Bin the predictions by confidence score (e.g., 0.85–0.95).
  2. For each bin, compute the average confidence and the actual accuracy (proportion correct).
  3. Compare the two. If the average confidence is 0.90 and the accuracy is 0.90, the model is perfectly calibrated in that bin.
  4. Plot the reliability diagram: accuracy on the y-axis, confidence on the x-axis. The diagonal line (y=x) represents perfect calibration.
  5. Compute ECE or MCE to quantify the overall error.

For example, if you collect 1,000 predictions that all have a confidence score of 0.90, and 900 of them are correct, then the model is perfectly calibrated at 90%. If only 850 are correct, the model is overconfident by 5 percentage points.

Common Mistakes and Misconceptions

One common mistake is confusing confidence with accuracy. A 90% confidence score does not mean the prediction is 90% likely to be correct in an absolute sense—it means if the model is calibrated, then across many such predictions, 90% will be correct. A single prediction with 90% confidence either is correct or it isn't; the probability is a property of the long-run frequency, not of the individual case.

Another misconception is that a high confidence score always indicates a reliable prediction. A model can be very confident and very wrong, especially on out-of-distribution data. For example, a model trained on photos of dogs might be 95% confident that a photo of a cat is a dog, because it has never seen a cat. Calibration on the training distribution does not guarantee calibration on new, different data.

Also, calibration is not the same as accuracy. A model can be perfectly calibrated but have low accuracy (e.g., a coin flip that always outputs 0.5 confidence is perfectly calibrated but only 50% accurate). Conversely, a model can be highly accurate but poorly calibrated (e.g., a model that is correct 95% of the time but always outputs 0.99 confidence).

Why Calibration Matters in Real Applications

In high-stakes domains, calibration is critical. In medical diagnosis, a 90% confidence score might trigger a treatment decision. If the true accuracy is only 70%, patients could be harmed. In autonomous driving, a 90% confidence that an object is a pedestrian might determine whether the car brakes. In financial fraud detection, a 90% confidence might block a transaction. In all these cases, miscalibration can lead to costly errors.

Calibration also affects decision-making under uncertainty. If you want to maximize expected utility, you need accurate probabilities. For example, if you decide to take an umbrella when the weather model says 90% chance of rain, you want that 90% to be reliable. If it's actually 60%, you'll carry an umbrella unnecessarily 30% of the time.

Frequently Asked Questions

Q: What is the difference between confidence and calibration?
Confidence is the model's stated probability; calibration is the degree to which that probability matches reality. A model can have high confidence but poor calibration, or low confidence but good calibration.

Q: How do I know if a model is calibrated?
You need a labeled test set. Bin predictions by confidence, compute accuracy per bin, and compare. If the numbers match closely, the model is calibrated. You can also use metrics like Expected Calibration Error.

Q: Can I fix a miscalibrated model?
Yes. Post-hoc methods like temperature scaling, Platt scaling, or isotonic regression are simple and effective. You need a validation set to fit the calibration parameters.

Q: Does a 90% confidence score mean the model is correct 90% of the time?
Only if the model is perfectly calibrated. If the model is overconfident, the true accuracy will be lower. Always check calibration before trusting the score.

Q: Why are neural networks often overconfident?
Because they are trained to maximize the probability of the correct class, which pushes outputs toward 0 or 1. The softmax function amplifies small differences, and models can become overly certain, especially on unfamiliar data.

Q: Is calibration the same as reliability?
In this context, yes. A reliability diagram plots accuracy vs. confidence, and a model that follows the diagonal is well-calibrated. The terms are often used interchangeably.