Learning to Augment Distributions for Out-of-Distribution Detection

Qizhou Wang, Zhen Fang, Yonggang Zhang, Feng Liu, Yixuan Li, Bo Han

Abstract

Open-world classification systems should discern out-of-distribution (OOD) data whose labels deviate from those of in-distribution (ID) cases, motivating recent studies in OOD detection. Advanced works, despite their promising progress, may still fail in the open world, owing to the lack of knowledge about unseen OOD data in advance. Although one can access auxiliary OOD data (distinct from unseen ones) for model training, it remains to analyze how such auxiliary data will work in the open world. To this end, we delve into such a problem from a learning theory perspective, finding that the distribution discrepancy between the auxiliary and the unseen real OOD data is the key to affecting the open-world detection performance. Accordingly, we propose Distributional-Augmented OOD Learning (DAL), alleviating the OOD distribution discrepancy by crafting an OOD distribution set that contains all distributions in a Wasserstein ball centered on the auxiliary OOD distribution. We justify that the predictor trained over the worst OOD data in the ball can shrink the OOD distribution discrepancy, thus improving the open-world detection performance given only the auxiliary OOD data. We conduct extensive evaluations across representative OOD detection setups, demonstrating the superiority of our DAL over its advanced counterparts.

Introduction

Deep learning models are notoriously overconfident, often assigning high-probability scores to inputs that deviate significantly from their training data. To mitigate this, researchers have turned to Outlier Exposure (OE), a technique where models are explicitly trained to recognize auxiliary OOD data—such as random natural images—as anomalies. However, a fundamental challenge persists: the auxiliary OOD data used during training is rarely representative of the "real" OOD data encountered in open-world applications. This "distribution discrepancy" means that a model might become an expert at detecting specific auxiliary proxies while remaining blind to novel, unseen anomalies.

The Problem of Distribution Discrepancy

The authors analyze the OOD detection problem from a learning theory perspective, identifying that the performance of a detector in the open world is heavily influenced by the gap between the auxiliary training distribution and the actual test-time OOD distribution. Standard OE approaches treat auxiliary data as a fixed point, which limits the model's ability to generalize. If the test-time OOD data differs significantly from the training proxy, the model's detection capabilities degrade.

Distributional-Augmented OOD Learning (DAL)

To address this, the authors propose Distributional-Augmented OOD Learning (DAL). Rather than treating the auxiliary OOD dataset as a single static distribution, DAL treats it as the center of a Wasserstein ball. This ball represents a set of all possible distributions that are mathematically "close" to the auxiliary data.

Worst-Case Training

DAL employs a robust optimization strategy by searching for the "worst-case" distribution within this Wasserstein ball—the distribution that maximizes the model's uncertainty or loss. By training the model to handle these worst-case scenarios, DAL ensures that the predictor performs uniformly well across a neighborhood of potential OOD distributions, effectively "shrinking" the discrepancy between auxiliary and real-world OOD data.

Efficiency via Embedding Space Perturbations

Searching for worst-case distributions in the high-dimensional pixel space is computationally expensive and often intractable. To maintain efficiency, DAL performs its search in the embedding space (high-level feature representations). This allows the model to explore semantic variations of OOD data without the overhead of generating new images. The authors utilize a dual formulation to transform the infinite-dimensional search into a tractable optimization problem involving data perturbations.

Experimental Evaluation

The researchers evaluated DAL across several standard and "hard" benchmarks, using CIFAR-10, CIFAR-100, and ImageNet-1k as In-Distribution (ID) datasets.

Key Results

DAL consistently outperformed state-of-the-art methods across multiple metrics, particularly in reducing the FPR95 (False Positive Rate at 95% True Positive Rate):

  • CIFAR-100: DAL reduced the average FPR95 by 13.46% compared to standard Outlier Exposure.
  • CIFAR-10: The method achieved an average FPR95 of 2.68%, surpassing advanced competitors like ATOM and POEM.
  • Hard OOD Tasks: On challenging tasks where OOD samples are semantically similar to ID samples (e.g., CIFAR-100 vs. CIFAR-10), DAL achieved an FPR95 of 25.45%, a significant improvement over the 29.40% recorded for standard OE.
  • Scalability: The method scaled effectively to ImageNet-1k, demonstrating that the embedding-space search remains a potent strategy for large-scale, complex datasets.

Conclusion and Future Directions

DAL represents a significant step forward in OOD detection by moving from "point estimate" training to a distributional approach. By acknowledging the inherent imperfection of auxiliary proxy data, DAL builds a robust buffer that helps models catch unseen anomalies.

While highly effective, the method relies on the careful selection of the Wasserstein ball radius ($\rho$). A radius that is too small offers little robustness, while one that is too large may cause OOD data to overlap with ID data, potentially harming classification accuracy. Future research may explore more complex input-space augmentations or causal modeling to further refine the boundaries of OOD detection.

Summary updated

Abstract

Open-world classification systems should discern out-of-distribution (OOD) data whose labels deviate from those of in-distribution (ID) cases, motivating recent studies in OOD detection. Advanced works, despite their promising progress, may still fail in the open world, owing to the lack of knowledge about unseen OOD data in advance. Although one can access auxiliary OOD data (distinct from unseen ones) for model training, it remains to analyze how such auxiliary data will work in the open world. To this end, we delve into such a problem from a learning theory perspective, finding that the distribution discrepancy between the auxiliary and the unseen real OOD data is the key to affecting the open-world detection performance. Accordingly, we propose Distributional-Augmented OOD Learning (DAL), alleviating the OOD distribution discrepancy by crafting an OOD distribution set that contains all distributions in a Wasserstein ball centered on the auxiliary OOD distribution. We justify that the predictor trained over the worst OOD data in the ball can shrink the OOD distribution discrepancy, thus improving the open-world detection performance given only the auxiliary OOD data. We conduct extensive evaluations across representative OOD detection setups, demonstrating the superiority of our DAL over its advanced counterparts.
BibTeX
@inproceedings{wang2023learning,
  author = {Qizhou Wang and Zhen Fang and Yonggang Zhang and Feng Liu and Yixuan Li and Bo Han},
  title = {{Learning to Augment Distributions for Out-of-Distribution Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=OtU6VvXJue},
}
Figure