TL;DR
This paper introduces a novel, model-agnostic framework that allows existing Out-of-Distribution (OOD) detection models to be trained on real-world, contaminated datasets (containing both in-distribution and OOD samples). Crucially, it also accurately estimates the proportion of OOD samples in the training data, a problem previously unaddressed.
What Problem Does This Paper Address?
In the real world, AI training datasets are rarely pristine. They often contain a mix of "in-distribution" (ID) data that the model is supposed to learn from, and "out-of-distribution" (OOD) data that it's not. This contamination is a significant hurdle for OOD detection models, as almost all existing methods assume a perfectly clean ID-only training set. Adapting each of the many existing OOD detection techniques to handle contamination individually is impractical. Furthermore, knowing how much OOD data is present in the training set is a challenge in itself, as accurately estimating this proportion is difficult when the model itself is still learning from this contaminated data.
Methods
The core of the proposed solution is a versatile, model-agnostic iterative framework. This framework can be plugged into nearly any existing OOD detection method. It works by:
- Dynamic Weighting Function: A novel weighting mechanism assigns individual importance weights to each training sample in each iteration. This function is designed to be compatible with both OOD methods that use negative samples and those that don't.
- Iterative Training Structure: The framework employs an iterative process where the OOD detection model, the sample weights, and the estimated OOD proportion are refined together. This allows the model to gradually learn to distinguish ID from OOD samples.
- Transition Mechanism: A key innovation is a transition function that ensures ID samples, even if initially misclassified as OOD (due to unreliable early predictions), retain sufficient weight to be included in training. This prevents the model from prematurely discarding potentially useful ID data.
- OOD Proportion Estimation: The framework directly estimates the proportion of OOD samples in the training data. This is achieved by iteratively refining an OOD score threshold and using this to estimate the contamination level.
Datasets
The paper evaluates its framework on a wide range of datasets, including:
- CIFAR-10, Celeb_A, SVHN, GTSRB, CIFAR-100, Mini-ImageNet, Tiny-ImageNet
- ImageNet-1k
- iNaturalist, OpenImage-O
The authors construct contaminated training sets by selecting pairs of datasets to serve as ID and OOD sources, with varying proportions of OOD samples (e.g., 1% and 2%).
Key Insights and Ideas
- Real-world data is messy: The paper strongly emphasizes that the assumption of clean training data is unrealistic and a major bottleneck for practical OOD detection.
- Model-agnosticism is crucial: Given the diversity of OOD detection methods, a framework that works with any of them is essential for broad applicability.
- Estimating contamination is a chicken-and-egg problem: You need a good OOD model to estimate contamination, but you need to know the contamination to train a good OOD model. The iterative approach elegantly solves this.
- Early-stage misclassification is a major pitfall: The transition mechanism is vital for preventing the model from making critical errors early on that could derail the entire training process.
- Contaminated data can be leveraged: For methods that use negative samples, the framework shows how real OOD samples within the training set can be used directly, rather than relying solely on synthetically generated ones.
Key Results
- The proposed framework consistently outperforms the IAD (a competing model-agnostic AD method adapted for OOD) in OOD detection accuracy (measured by AUROC) across various datasets and backbone models, even under light contamination (1% OOD).
- The framework achieves substantial improvements in OOD detection performance compared to using backbone models directly on contaminated data.
- The method accurately estimates the OOD percentage in contaminated training datasets, a capability not present in existing model-agnostic approaches. The normalized error ($\epsilon$) for OOD percentage estimation is consistently low.
- Ablation studies confirm the importance of both the OOD percentage estimation and the transition function ($\tau(t)$) for achieving optimal performance.
Limitations and Future Work
- Hyperparameter tuning: While the framework is designed to be versatile, specific hyperparameters (like $\alpha$ and $k$ in the weight and transition functions) might require tuning for optimal performance on different tasks.
- Computational cost: The iterative nature of the framework naturally increases training time compared to a single-pass training of a backbone model.
- Future Work: The paper suggests further exploration of the framework's adaptability to different types of data and OOD detection tasks. The authors also highlight the potential for their OOD proportion estimation to be used for data curation and cleaning.
Summary updated