Improved Predictive Uncertainty using Corruption-based Calibration

Tiago Salvador, Vikram Voleti, Alexander Iannantuono, Adam M. Oberman

Abstract

Distribution shift is an important concern in deep image classification, produced either by corruption of the source images, or a complete change, with the solution involving domain adaptation. While the primary goal is to improve accuracy under distribution shift, an important secondary goal is uncertainty estimation: evaluating the probability that the prediction of a model is correct. While improving accuracy is hard, uncertainty estimation turns out to be frustratingly easy. Prior works have appended uncertainty estimation into the model and training paradigm in various ways. Instead, we show that we can estimate uncertainty by simply exposing the original model to corrupted images, and performing simple statistical calibration on the image outputs. Our frustratingly easy methods demonstrate superior performance on a wide range of distribution shifts as well as on unsupervised domain adaptation tasks, measured through extensive experimentation.

Introduction

Deep learning models often become dangerously overconfident when faced with out-of-distribution (OOD) data. For deployment in high-stakes environments like healthcare or autonomous driving, models must provide reliable predictive uncertainty—knowing "when they don't know." While standard neural networks use softmax probabilities as a proxy for confidence, these estimates are notoriously unreliable under distribution shifts, such as weather changes, sensor noise, or shifts from photos to sketches.

Existing solutions like CPCS or TransCal often require internal feature access or auxiliary domain classifiers, making them difficult to implement in black-box scenarios. This paper introduces two "frustratingly easy" post-hoc calibration methods: Surrogate Adaptive Calibration (SAC) and Surrogate Temperature Scaling (STS). These methods require no model retraining and only rely on final softmax outputs.

Methodology

The core idea is that complex distribution shifts can be approximated by observing shifts in a model's output confidence. The authors propose using synthetic corruptions to create "surrogate" calibration sets that mimic the behavior of unknown test-time shifts.

Comparison of calibration methods across various operational constraints.

Surrogate Adaptive Calibration (SAC)

SAC operates by matching the mean maximum softmax probability ($p^{max}$) of an unlabeled test batch to the closest surrogate calibration set. A standard Temperature Scaling parameter is pre-optimized for each surrogate set; the parameter from the best-matching set is then applied to the test data.

Surrogate Temperature Scaling (STS)

STS is a simpler variant that pools all surrogate calibration sets (ranging from clean to highly corrupted) into a single union. A single Temperature Scaling parameter is learned from this combined set and applied universally to test data.

Key Insights: Confidence as a Proxy for Shift

A major finding is that the mean confidence of a model is a robust indicator of distribution shift. By matching this 1D metric, we can effectively calibrate against unknown corruptions using arbitrary synthetic ones (e.g., using "pixelation" to calibrate for "fog"). This allows the model to remain a complete black box while achieving state-of-the-art calibration.

Visualization of distribution matching between surrogate calibration sets and test data, showing corresponding ECE results.

Experimental Results

The methods were evaluated across synthetic corruptions (ImageNet-C), natural shifts (ImageNet-Sketch), and domain adaptation tasks (VisDA-2017).

  • Synthetic Shifts: On ImageNet-C, SAC and STS consistently outperformed Vanilla and standard TS, particularly at high corruption intensities where prior methods remained overconfident.
  • Natural Shifts: On ImageNet-Sketch, SAC achieved an Expected Calibration Error (ECE) of 10.71%, significantly lower than Vanilla (22.29%) and TransCal (52.24%).
  • Domain Adaptation: On VisDA-2017, STS achieved an ECE of 5.33%, outperforming the baseline Vanilla error of 21.10%.
  • Efficiency: SAC is highly sample-efficient, requiring as few as 100 unlabeled test samples to accurately estimate the required calibration parameters.

Conclusion

SAC and STS provide a computationally efficient, black-box approach to predictive uncertainty. While STS can slightly degrade performance at very low corruption levels due to its pooled nature, the overall gains in robustness under significant shift are substantial. These methods demonstrate that reliable uncertainty estimation does not require complex architectural changes or expensive retraining.

Summary updated

BibTeX
@misc{salvador2021improved,
  author = {Tiago Salvador and Vikram Voleti and Alexander Iannantuono and Adam M. Oberman},
  title = {{Improved Predictive Uncertainty using Corruption-based Calibration}},
  year = {2021},
  eprint = {2106.03762},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.03762},
}
Figure