A Call to Reflect on Evaluation Practices for Failure Detection in Image Classification

Paul F Jaeger, Carsten Tim Lüth, Lukas Klein, Till J. Bungert

TL;DR

This paper reveals that the field of failure detection in machine learning is currently fragmented by inconsistent evaluation protocols that ignore realistic data shifts. By introducing a unified benchmarking framework, the authors demonstrate that simple softmax baselines often outperform complex state-of-the-art methods, while also uncovering a hidden numerical precision trap that plagues modern Vision Transformers.

What Problem Does This Paper Address?

In safety-critical applications like medical diagnosis or autonomous driving, it isn't enough for a model to be accurate; it must also know when it is likely to be wrong. This is the goal of failure detection.

Currently, research into this goal is siloed into four distinct sub-fields:

  1. Misclassification Detection (MisD): Detecting errors on data similar to the training set.
  2. Out-of-Distribution Detection (OoD-D): Identifying inputs that don't belong to the training classes.
  3. Selective Classification (SC): Allowing a model to "abstain" from predicting if confidence is low.
  4. Predictive Uncertainty Quantification (PUQ): Measuring how "sure" a model is.
Fragmentation of Failure Detection

The authors argue that these fields are essentially trying to solve the same problem but use inconsistent metrics and narrow benchmarks. For instance, many OoD methods focus on "far" outliers (like detecting a house number when trained on animal breeds) while ignoring "near" shifts (like a new breed of dog) or image corruptions. Furthermore, common metrics often ignore the underlying classifier's accuracy, leading to misleading rankings of which method is actually "safest" for deployment.

Methods

The authors propose a unified perspective based on three core requirements:

  • Requirement 1 (Unified Metric): Use a single standardized score—AURC (Area Under the Risk-Coverage Curve)—that accounts for both the classifier's accuracy and the quality of its confidence ranking.
  • Requirement 2 (Diverse Failure Sources): Evaluate models across a spectrum of shifts, including covariate shifts (image corruptions), sub-class shifts (unseen breeds), and new-class shifts.
  • Requirement 3 (Direct Assessment): Evaluate methods based on their ability to detect actual failures (incorrect predictions) rather than surrogate tasks like "outlier detection."

They conducted a massive empirical study called FD-shifts, benchmarking various Confidence Scoring Functions (CSFs) across multiple architectures (CNNs and Vision Transformers) and diverse datasets.

Datasets

The study utilizes a comprehensive suite of benchmarks to simulate real-world "in-the-wild" conditions:

  • Standard i.i.d. sets: CIFAR-10, CIFAR-100, SVHN.
  • Covariate Shifts: CIFAR-10-C and CIFAR-100-C (15 types of image corruptions).
  • Sub-class & Domain Shifts: iWildCam-2020-Wilds (camera traps), CAMELYON-17-Wilds (medical imaging), and BREEDS-Entity-13 (hierarchical sub-classes).
  • New-class Shifts: Testing on held-out classes from SVHN, TinyImageNet, and iWildCam.

Key Insights and Ideas

  • The "Softmax is King" Paradox: Despite years of research into complex uncertainty measures, a simple Maximum Softmax Response (MSR) baseline remains the most robust performer across a realistic range of failure sources. Most "state-of-the-art" methods fail to generalize beyond the specific, narrow scenarios they were designed for.
  • OoD Detection $\neq$ Failure Detection: Methods designed to find "outliers" are often poor at finding "failures." A model might correctly predict an "outlier" if it belongs to a semantically similar category, yet OoD protocols would penalize the model for not "rejecting" it.
  • The 32-bit Precision Trap: The authors discovered that the standard 32-bit floating-point precision used in deep learning is a bottleneck for Vision Transformers (ViTs). Because ViTs are so accurate, their logits can be so high that the softmax operation rounds the confidence score to exactly 1.0. This destroys the model's ability to rank its most confident predictions, leading to a massive (and artificial) drop in failure detection performance.

Key Results

  • MSR Dominance: In the large-scale benchmark, MSR or its Monte Carlo Dropout variant (MCD-MSR) achieved the best or near-best AURC scores on almost all i.i.d. and covariate shift tasks.
Large-scale benchmark results showing MSR dominance
  • Niche OoD Performance: Prevalent OoD-D methods (like MLS or MAHA) only showed superiority in a very narrow range of "far" new-class shifts. Their advantage vanished on more nuanced "near" semantic shifts.
  • ViT vs. CNN: While ViTs are significantly more accurate classifiers than CNNs, their relative ability to rank their own failures is surprisingly similar once numerical precision issues are corrected.
  • Precision Fix: Casting logits to 64-bit precision or using temperature scaling before the softmax operation recovered up to a 9% performance gain in AUROC for ViTs on certain datasets.

Limitations and Future Work

The authors acknowledge that while they have unified the evaluation protocol, they haven't yet found a single method that beats the softmax baseline across the board.

Future research should focus on:

  • Developing confidence scoring functions that generalize across the entire spectrum of distribution shifts.
  • Treating confidence calibration as an independent task from confidence ranking.
  • Investigating why current "advanced" methods fail to generalize to complex datasets like iWildCam or BREEDS.

The code and trained models for the FD-shifts benchmark are available at: https://github.com/IML-DKFZ/fd-shifts.

Summary updated

BibTeX
@inproceedings{jaeger2023call,
  author = {Paul F Jaeger and Carsten Tim Lüth and Lukas Klein and Till J. Bungert},
  title = {{A Call to Reflect on Evaluation Practices for Failure Detection in Image Classification}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=YnkGMIh0gvX},
}
Figure