Improving model calibration with accuracy versus uncertainty optimization

Ranganath Krishnan, Omesh Tickoo

Researchers from Intel Labs have introduced a novel loss function called Accuracy versus Uncertainty Calibration (AvUC) that forces deep learning models to be "honest" about what they don't know. By penalizing models when they are confidently wrong or hesitantly right, this approach significantly improves model reliability and safety, especially when facing real-world data shifts and out-of-distribution inputs.

The Problem: Overconfident Neural Networks

Modern deep neural networks (DNNs) are notoriously overconfident. Even when a model makes a glaring error, it often assigns a high probability to its incorrect prediction. In safety-critical fields like autonomous driving or medical diagnosis, this lack of "calibration" is dangerous.

A well-calibrated model should be certain when it is accurate and indicate high uncertainty when it is likely to be wrong. However, training for uncertainty is difficult because there is no "ground truth" for it—we know the correct class label, but we don't have a label for exactly how "uncertain" a model should feel. Most existing solutions either require expensive ensembles of multiple models or post-processing steps that fail when the data distribution shifts (e.g., when a camera gets blurry or lighting changes).

Methods: The AvUC Loss Function

The authors propose a new optimization objective that uses the relationship between accuracy and uncertainty as an "anchor." They categorize every prediction into one of four quadrants:

  1. Accurate & Certain (AC): The ideal scenario.
  2. Inaccurate & Uncertain (IU): The model knows it's struggling; also ideal.
  3. Accurate & Uncertain (AU): The model is "lucky" but hesitant.
  4. Inaccurate & Certain (IC): The most dangerous scenario (overconfidence).

The core contribution is the AvUC loss function. Since the counts of these categories aren't naturally differentiable (you can't take a gradient of a count), the authors developed differentiable proxy functions using the hyperbolic tangent ($tanh$) of the model's uncertainty.

This loss can be used in two primary ways:

  • SVI-AvUC: Integrating the loss directly into the training of a Bayesian Neural Network using Stochastic Variational Inference.
  • AvUTS: A post-hoc method that extends traditional "Temperature Scaling" by optimizing for AvUC instead of just likelihood.

Key Insights and Ideas

  • Uncertainty as a Utility: Instead of treating uncertainty as a byproduct, the authors treat it as a utility to be maximized. The model is explicitly taught that being "Inaccurate and Certain" is the worst possible outcome.
  • The "Warm-up" Phase: The method requires a few initial epochs of standard training to establish a baseline uncertainty threshold. This threshold then acts as the dividing line for what the model considers "certain" vs. "uncertain."
  • Robustness to Shift: Most calibration methods work well on the specific data they were trained on but fall apart when the data changes slightly. AvUC remains robust because it focuses on the relationship between accuracy and uncertainty, which tends to be more stable than raw probability scores.
Detailed performance curves showing Confidence vs. Accuracy and Uncertainty behavior across ImageNet, CIFAR, and Out-of-Distribution (OOD) datasets.

Key Results

The authors evaluated their method on large-scale image classification tasks, including CIFAR-10 and ImageNet, as well as corrupted versions of these datasets (CIFAR-10-C and ImageNet-C) to test distributional shift. They also used SVHN as an Out-of-Distribution (OOD) dataset.

  • Superior Calibration: On ImageNet, SVI-AvUC consistently achieved lower Expected Calibration Error (ECE) and Uncertainty Calibration Error (UCE) compared to state-of-the-art methods like Deep Ensembles and Temperature Scaling. This performance gap widened as data corruption intensity increased.
Calibration performance (ECE, UCE, and Accuracy) across different data shift intensities for ImageNet and CIFAR-10.
  • Better OOD Detection: The model showed a much higher "Wasserstein distance" between the uncertainty distributions of in-distribution vs. out-of-distribution data. In plain English: it was much better at signaling "I haven't seen this before" when shown SVHN images.
  • Efficiency: While Deep Ensembles provide good calibration, they require training and running multiple models. AvUC provides comparable or better calibration within a single model framework, saving significant computational memory and time during inference.

Limitations and Future Work

  • Threshold Sensitivity: The method relies on an uncertainty threshold calculated from the training data. While the authors suggest using the average uncertainty of accurate/inaccurate predictions, the optimal threshold might vary for different tasks.
  • Bayesian Complexity: The primary implementation (SVI-AvUC) relies on Bayesian Neural Networks, which can still be more complex to implement and tune than standard "vanilla" networks.
  • Task Scope: The paper focuses on image classification. Future work could explore how AvUC performs in other domains like Natural Language Processing (NLP) or regression tasks where "accuracy" is defined differently.

Summary updated

BibTeX
@inproceedings{krishnan2020improving,
  author = {Ranganath Krishnan and Omesh Tickoo},
  title = {{Improving model calibration with accuracy versus uncertainty optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure