Abstract
Deep learning models frequently exhibit high confidence in incorrect predictions, a phenomenon that undermines their reliability in safety-critical applications. Traditional uncertainty measures, such as Shannon entropy, are often insufficient for misclassification detection because they rely on fixed, axiomatic properties of probability distributions rather than the semantic relationships between classes. This paper introduces REL-U (Relative Uncertainty), a data-driven metric that learns to identify patterns of model confusion. By optimizing a distance matrix through a contrastive objective, REL-U provides a measure of uncertainty relative to an observer. Experimental results across multiple benchmarks, including ImageNet and CIFAR-10C, demonstrate that REL-U consistently outperforms existing state-of-the-art detection methods, maintaining robustness even under distribution shifts.
Introduction
As deep neural networks are increasingly deployed in real-world scenarios, the ability to detect when a model is likely to make an error is paramount. However, these models are notoriously overconfident; a "soft-prediction" (the probability distribution over classes) often assigns a high probability to a single class even when that prediction is incorrect.
Standard uncertainty quantification methods, such as Shannon entropy or the Gini coefficient, are "axiomatic." They assume that uncertainty is a function of the distribution's "flatness." These methods fail to account for the fact that certain misclassifications are more likely or more "confusing" than others based on the semantic similarity of the classes involved. For instance, a model confusing a "dog" for a "cat" represents a different failure mode than confusing a "dog" for a "ship." REL-U addresses this by learning a metric that captures these specific patterns of confusion from data.
The REL-U Framework
Theoretical Foundation
REL-U is inspired by Rao’s diversity measure, which defines uncertainty as the expected distance between two independent draws from a predicted distribution. While traditional measures like the Gini coefficient use a fixed Hamming distance (where the distance between any two distinct classes is always 1), REL-U introduces a learned distance matrix $D$.
Learning the Metric
The core innovation of REL-U is the optimization of the matrix $D$ to distinguish between successful and unsuccessful predictions. The authors employ a contrastive optimization strategy:
- Positive Instances: For samples the model classifies correctly, the objective minimizes the uncertainty score.
- Negative Instances: For samples the model misclassifies, the objective maximizes the uncertainty score.
This approach allows the metric to identify fine-grained confusion. If a model is 90% certain an image is a "cat" but the remaining 10% is assigned to "dog"—a pattern the metric has learned is associated with errors—REL-U will flag the prediction as high-uncertainty, even if the Shannon entropy is low.
Computational Efficiency
A significant advantage of REL-U is that the authors derived a closed-form solution for the optimal matrix $D^*$. This eliminates the need for complex iterative training or backpropagation through the model, making the detector computationally efficient and easy to integrate into existing pipelines.
Experimental Evaluation
The effectiveness of REL-U was evaluated using various architectures (DenseNet-121, ResNet-34, ResNet-50) across several datasets:
- Standard Benchmarks: CIFAR-10, CIFAR-100, and ImageNet.
- Robustness Testing: CIFAR-10C (corrupted images) to evaluate performance under distribution shifts like noise and blur.
- Domain Mismatch: MNIST and SVHN to test the detector's behavior on entirely out-of-distribution data.
Key Results
The primary evaluation metric was the False Positive Rate at 95% True Positive Rate (FPR @ 95% TPR). This measures how many correct predictions are incorrectly flagged as errors when the system is tuned to catch 95% of actual misclassifications.
- Superior Detection: REL-U consistently outperformed baselines such as Maximum Softmax Probability (MSP), ODIN, and Doctor. On CIFAR-10 with DenseNet-121, REL-U achieved an FPR of 18.3%, a substantial improvement over MSP (32.7%) and Doctor (21.5%).
- Calibration Independence: Unlike many uncertainty measures that require the model to be well-calibrated (meaning its confidence matches its accuracy), REL-U remains effective regardless of the underlying model's calibration state.
- Data Efficiency: The "tuning set" required to learn the $D$ matrix is relatively small, requiring only hundreds or thousands of samples, which is significantly less than methods requiring full model retraining.
Discussion and Limitations
REL-U represents a shift in perspective: uncertainty is not just an inherent property of a probability vector, but a subjective measure relative to an observer who understands the model's failure patterns. This allows it to remain robust even when testing data undergoes distribution shifts, as the underlying structure of model confusion often persists.
However, the method has limitations. It requires a tuning set containing "negative samples" (misclassifications). For extremely high-accuracy models, gathering enough errors to learn an effective distance matrix may be difficult. Additionally, while REL-U is robust to natural shifts, it may still be vulnerable to adversarial attacks specifically designed to mimic the probability patterns of correct classifications.
Future work may involve extending the REL-U framework beyond image classification to domains such as natural language processing and regression, where the definition of "distance" between outputs is even more critical.
Summary updated