Abstract
Out-of-distribution (OOD) detection is indispensable for machine learning models deployed in the open world. Recently, the use of an auxiliary outlier dataset during training (also known as outlier exposure) has shown promising performance. As the sample space for potential OOD data can be prohibitively large, sampling informative outliers is essential. In this work, we propose a novel posterior sampling-based outlier mining framework, POEM, which facilitates efficient use of outlier data and promotes learning a compact decision boundary between ID and OOD data for improved detection. We show that POEM establishes state-of-the-art performance on common benchmarks. Compared to the current best method that uses a greedy sampling strategy, POEM improves the relative performance by 42.0% and 24.2% (FPR95) on CIFAR-10 and CIFAR-100, respectively. We further provide theoretical insights on the effectiveness of POEM for OOD detection.
Introduction
Modern neural networks are notoriously overconfident. When presented with images outside their training distribution—known as out-of-distribution (OOD) inputs—they frequently assign high-confidence scores to incorrect categories. This overconfidence is a significant barrier to the safe deployment of AI in real-world environments.
A common defense strategy is Outlier Exposure (OE), where a model is trained using an auxiliary dataset of "garbage" or non-target images to learn low-confidence representations for OOD data. However, the space of possible outliers is effectively infinite. Randomly selecting outliers from a massive pool often yields "easy" samples that do not help the model define its boundaries. Conversely, "greedy" mining—focusing only on the hardest outliers the model currently struggles with—can lead to a lack of diversity and poor generalization.
This paper introduces POEM (Posterior Sampling-based Outlier Mining), a framework that treats outlier selection as a sequential decision-making problem to identify the most informative samples for defining a robust decision boundary.
Methodology
POEM utilizes a dual-branch architecture to balance standard classification with intelligent outlier selection.
1. Dual-Branch Architecture
The framework employs a shared CNN backbone with two specialized heads:
- Classification Branch: This branch performs the primary task while regularizing the "energy" of inputs. It is designed to map in-distribution (ID) data to low energy levels and OOD data to high energy levels.
- Outlier Mining Branch: This serves as the selection engine. It applies Bayesian Linear Regression (BLR) to the high-level features extracted by the CNN to maintain a posterior distribution over the model's parameters.
2. Thompson Sampling for Outliers
To overcome the limitations of greedy selection, POEM uses Thompson Sampling. Instead of relying on a single point estimate of model error, POEM samples a model from its current posterior distribution. This sampled model calculates a Boundary Score for potential outliers. Samples with high scores are those the model identifies as being "on the edge" between ID and OOD. This approach ensures the model explores the outlier space effectively while exploiting known difficult regions.
3. Computational Efficiency
To maintain training tractability, POEM avoids performing a full Bayesian update at every step. Instead, it maintains a fixed-size queue of recent features to update the posterior periodically. This ensures that the computational overhead remains manageable compared to standard training procedures.
Experimental Results
The authors evaluated POEM using CIFAR-10 and CIFAR-100 as ID datasets, with ImageNet-RC and TinyImages as auxiliary outlier pools. The model was tested against various OOD sets, including SVHN, Textures, and Places365.
Performance Benchmarks
POEM established a new state-of-the-art on common benchmarks:
- CIFAR-10: POEM achieved a False Positive Rate (FPR95) of 2.54%, representing a 42.0% relative improvement over the previous leading greedy mining method.
- CIFAR-100: The framework reduced the FPR95 to 15.14%, significantly outperforming standard Outlier Exposure (19.54%) and greedy mining (19.96%).
- Accuracy: Importantly, these improvements in OOD detection were achieved without sacrificing the model's original classification accuracy on ID data.
Discussion and Insights
The success of POEM highlights several critical factors in OOD detection:
- The Importance of the Boundary: Outliers located far from the ID data are essentially useless for regularization. The most informative outliers are those residing in high-density regions near the ID/OOD decision boundary.
- Exploration Prevents Myopia: Greedy mining methods often fail because they focus too narrowly on what the model currently perceives as difficult. By maintaining a posterior distribution, POEM "explores" the outlier space to discover diverse, boundary-defining samples.
- Feature-Space Mining: By performing mining in the penultimate feature space rather than the raw pixel space, the model identifies semantically meaningful outliers rather than just noisy images.
Conclusion
POEM demonstrates that posterior sampling is a powerful mechanism for outlier mining, leading to more robust and compact decision boundaries. While the method increases training time (approximately 10.3 hours vs. 5.0 hours for standard energy-based models), the significant gains in detection reliability make it a compelling choice for safety-critical applications. Future research may extend this framework to other domains, such as Natural Language Processing (NLP).
Summary updated