TL;DR
This paper introduces "OD-test," a more realistic evaluation framework for out-of-distribution (OOD) sample detectors. They demonstrate that existing evaluation methods are overly optimistic, leading to a false sense of reliability for OOD detection techniques, especially in high-dimensional settings.
What Problem Does This Paper Address?
Deep learning models are increasingly deployed in real-world scenarios where they encounter data that differs from their training distribution (out-of-distribution or OOD data). This can lead to unpredictable and potentially catastrophic failures. Detecting these OOD samples is crucial for building robust AI systems. However, current evaluation methods for OOD detectors are often too simplistic, typically using only two datasets (in-distribution and one type of outlier). This can lead to methods that perform well on known outliers but fail when faced with novel, unseen types of OOD data, a common scenario in practical applications. The authors argue that a more rigorous evaluation is needed to truly assess the reliability of OOD detection methods.
Methods
The core contribution is the OD-test evaluation scheme. Instead of just comparing in-distribution (Ds) data against a single outlier distribution (Dv), OD-test introduces a third, unseen outlier distribution (Dt). This simulates a more realistic scenario where a system might encounter OOD data that is different from any outliers it was trained to recognize.
The evaluation process for a given OOD detection method (M) is as follows:
- Train a reject function (r): This function is trained to distinguish between the in-distribution data (Ds) and a known outlier distribution (Dv).
- Evaluate on unseen outliers: The trained reject function is then evaluated on a third, unseen outlier distribution (Dt).
- Average across combinations: To ensure robustness, the process is repeated by cycling through all possible combinations of Dv and Dt from a curated set of datasets, and the results are averaged.
This three-dataset approach aims to prevent methods from overfitting to specific types of outliers and provides a more honest assessment of their generalization capabilities.
Datasets
The authors use a variety of standard image classification datasets for their experiments, including:
- MNIST
- FashionMNIST
- CIFAR10
- CIFAR100
- TinyImagenet
- STL10
These datasets are split into training, validation, and testing sets. For the OD-test evaluation, they are used to construct the source distribution (Ds), known outlier distribution (Dv), and the unseen outlier distribution (Dt).
Key Insights and Ideas
- Two-dataset evaluations are misleading: The most significant insight is that evaluating OOD detectors with only two datasets (in-distribution vs. one type of outlier) leads to overly optimistic results. Methods that perform well in this setting often fail dramatically when presented with a third, unseen outlier distribution.
- High-dimensional data is a major challenge: As the dimensionality of the input data increases (e.g., from MNIST to TinyImagenet), the performance of most OOD detection methods degrades significantly, often approaching random chance.
- Image classification accuracy doesn't guarantee OOD detection performance: Surprisingly, using a more accurate image classifier as the base for OOD detection doesn't necessarily lead to better OOD detection performance. This suggests that the underlying network architecture and its inductive biases play a crucial role.
- Nearest-neighbor methods show promise: In low-dimensional settings, K-Nearest Neighbors (K-NN) based methods (K-NNSVM) perform competitively and can even outperform other methods. They also explore using learned representations from autoencoders with K-NN, finding that direct input space K-NN is generally superior.
- Uncertainty-based methods are not as reliable as hoped: Methods relying on model uncertainty (like MC-Dropout and DeepEnsemble) did not provide a strong enough signal to reliably distinguish OOD samples in their experiments.
- ODIN is a strong contender for high-dimensional settings: Among the evaluated methods, ODIN (a method based on temperature scaling and input perturbation) shows the most consistent performance in high-dimensional scenarios, although its average accuracy is still below 80%.
Key Results
- The paper demonstrates a significant drop in accuracy for most methods when moving from a two-dataset evaluation to the OD-test framework. For example, "BinClass" (a direct binary classifier) achieves near-perfect accuracy on two datasets but drops to around 68% on OD-test.
- In high-dimensional settings (like TinyImagenet), many methods perform close to the random baseline (50% accuracy).
- ODIN consistently outperforms other methods in high-dimensional settings, achieving accuracies in the 60%-78% range across various datasets.
- The authors provide extensive plots and tables (Figures 3, 4, 5, 7) showing the performance breakdown of numerous methods across different datasets and evaluation schemes, highlighting the stark differences between two-dataset and OD-test evaluations.
Limitations and Future Work
- "Unknown Unknowns" remain a challenge: The paper acknowledges that even with OD-test, detecting truly novel "unknown unknowns" is still a significant challenge. The goal is to find methods that are less likely to overfit to known outliers (Dv) and thus more reliable when encountering unseen ones (Dt).
- No single method is "out-of-the-box" solution: The authors conclude that none of the evaluated methods are a perfect, ready-to-use solution for high-dimensional OOD detection.
- Future work directions:
- Developing methods that are less prone to overfitting to the training outlier set (Dv).
- Exploring better autoencoder architectures and reconstruction constraints for AEThreshold.
- Investigating how to best leverage the diversity of anomalies in the training outlier set (Dv).
- The authors release their PyTorch implementation and pre-trained models to encourage further research and community tackling of these challenges.
Summary updated