Classification Confidence Estimation with Test-Time Data-Augmentation

Yuval Bahat, Gregory ShakhnarovicharXiv 2020

Abstract

Machine learning plays an increasingly significant role in many aspects of our lives (including medicine, transportation, security, justice and other domains), making the potential consequences of false predictions increasingly devastating. These consequences may be mitigated if we can automatically flag such false predictions and potentially assign them to alternative, more reliable mechanisms, that are possibly more costly and involve human attention. This suggests the task of detecting errors, which we tackle in this paper for the case of visual classification. To this end, we propose a novel approach for classification confidence estimation. We apply a set of semantics-preserving image transformations to the input image, and show how the resulting image sets can be used to estimate confidence in the classifier's prediction. We demonstrate the potential of our approach by extensively evaluating it on a wide variety of classifier architectures and datasets, including ResNext/ImageNet, achieving state of the art performance. This paper constitutes a significant revision of our earlier work in this direction (Bahat & Shakhnarovich, 2018).

Introduction

Deep learning classifiers are increasingly deployed in high-stakes environments like autonomous driving and medical diagnostics. However, these models often exhibit "overconfidence," assigning high probability scores even to incorrect predictions. Standard metrics evaluate average performance across a dataset, but fail to provide reliable confidence estimates for individual, specific inputs. Existing solutions like Bayesian Neural Networks or Monte-Carlo Dropout often require specialized architectures or access to internal model parameters. This paper introduces a "black-box" method for confidence estimation that is compatible with any pre-trained classifier without requiring retraining or architectural modifications.

Methodology: Test-Time Data-Augmentation (TTA)

The proposed approach leverages the principle of invariance: if a model's prediction remains stable across various valid views of the same scene, it is likely correct. Conversely, if minor perturbations cause the label to change, the model is likely "guessing" based on noise.

Overview of semantics-preserving transformations used for Test-Time Data-Augmentation (TTA).

The process involves three main steps:

  1. Transformation Generation: A set of semantics-preserving transformations—such as horizontal flips, rotations, zooms, and brightness adjustments—is applied to the input image to create an augmented set.
  2. Confidence Scoring: Each augmented image is passed through the classifier. The resulting softmax probability vectors are averaged, and the value of the predicted class in this mean vector serves as the confidence score.
  3. Robust Ranking: To enhance reliability, the authors employ bootstrapping (sampling with replacement) and a "sliding window plurality" algorithm to rank images by certainty.

A key insight is that transformations must be "natural" for the specific dataset. For instance, while flipping a natural scene is valid, flipping a digit (e.g., in the SVHN dataset) may change its semantic meaning.

Evaluation and Results

The method was validated using diverse architectures (VGG-8, ResNet, ResNext, AlexNet) across several benchmarks: CIFAR-10/100, SVHN, STL-10, and ImageNet.

To compare performance across different classifiers, the authors introduced the Area Over Risk-Coverage (AORC) metric. Results showed that the TTA-based method consistently outperformed the standard Maximal Softmax Response (MSR) baseline.

  • SVHN Performance: The AORC score improved significantly from 69.0 to 81.2, marking a substantial gain in error detection capability.
  • ImageNet Gains: Using a ResNext model, the method achieved a 1.7 point coverage gain at a 1% risk threshold, effectively identifying 818 additional correct classifications compared to the baseline.

Conclusion

This work demonstrates that Test-Time Data-Augmentation is a powerful, model-agnostic tool for error detection and selective classification. While the method introduces linear computational overhead relative to the number of transformations, its "plug-and-play" nature makes it highly practical for existing systems. Future research may focus on automatically learning optimal transformation sets and extending the framework to handle adversarial examples.

Summary updated

BibTeX
@misc{bahat2020classification,
  author = {Yuval Bahat and Gregory Shakhnarovich},
  title = {{Classification Confidence Estimation with Test-Time Data-Augmentation}},
  year = {2020},
  eprint = {2006.16705},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.16705},
}
Figure