NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DOS: Diverse Outlier Sampling for Out-of-Distribution Detection

Wenyu Jiang, Hao Cheng, Mingcai Chen, Chongjun Wang, Hongxin Wei · OpenReview

Abstract

Modern neural networks are known to give overconfident prediction for out-of-distribution inputs when deployed in the open world. It is common practice to leverage a surrogate outlier dataset to regularize the model during training, and recent studies emphasize the role of uncertainty in designing the sampling strategy for outlier dataset. However, the OOD samples selected solely based on predictive uncertainty can be biased towards certain types, which may fail to capture the full outlier distribution. In this work, we empirically show that diversity is critical in sampling outliers for OOD detection performance. Motivated by the observation, we propose a straightforward and novel sampling strategy named DOS (Diverse Outlier Sampling) to select diverse and informative outliers. Specifically, we cluster the normalized features at each iteration, and the most informative outlier from each cluster is selected for model training with absent category loss. With DOS, the sampled outliers efficiently shape a globally compact decision boundary between ID and OOD data. Extensive experiments demonstrate the superiority of DOS, reducing the average FPR95 by up to 25.79% on CIFAR-100 with TI-300K.

Introduction

Deep neural networks often fail silently by providing high-confidence predictions for inputs that lie far outside their training distribution. To address this, Outlier Exposure (OE) has emerged as a standard technique, where models are trained on auxiliary "outlier" datasets to learn a boundary between known and unknown classes. However, the effectiveness of OE is heavily dependent on how outliers are sampled from large auxiliary pools.

Standard random sampling is often inefficient, as many random images are "easy" for the model and provide little signal for refining the decision boundary. Conversely, "greedy" sampling strategies that focus exclusively on high-uncertainty (hard) examples often suffer from sampling bias, focusing on a narrow subset of the outlier space and failing to generalize to the full spectrum of the "unknown."

Diverse Outlier Sampling (DOS)

We propose Diverse Outlier Sampling (DOS), a method designed to select outliers that are both informative and representative of the broader distribution. DOS operates through a three-step process during each training iteration:

  1. Feature-Based Clustering: Candidate outliers are partitioned into $K$ clusters using K-means. To ensure the clustering captures semantic meaning rather than just prediction magnitude, we perform this on normalized latent features.
  2. Active Selection: From each cluster, the most "informative" outlier—defined as the one with the highest predictive uncertainty or energy—is selected.
  3. Regularization: The selected outliers are used to train the model, typically using an "absent category" loss that encourages the model to classify them as "unknown."
Comparison of decision boundaries formed by different outlier sampling strategies.

As shown in the figure above, while uncertainty-based sampling (c) focuses on the boundary, it can leave gaps. The "Diverse & Uncertain" strategy (d) creates a more globally compact decision boundary by ensuring outliers are sampled from all directions around the in-distribution data.

Key Insights: The Role of Diversity

The core contribution of DOS is the recognition that "hardness" alone is insufficient. When sampling is driven purely by uncertainty, the model tends to over-sample specific types of outliers that it finds difficult, leading to a biased boundary.

Distribution of sampled outliers across different semantic clusters for Greedy vs. Uniform sampling.

Empirical analysis (see figure above) reveals that greedy sampling is heavily skewed toward a few clusters. By enforcing a more uniform selection across clusters, DOS ensures that the model's understanding of "out-of-distribution" is not limited to a specific niche, leading to better generalization on unseen test sets.

Experimental Results

DOS was evaluated on standard benchmarks including CIFAR-100 and ImageNet-10, using TI-300K and ImageNet-RC as auxiliary outlier pools.

  • Performance Gains: On CIFAR-100, DOS achieved a significant reduction in FPR95, dropping from 50.15% (baseline) to 24.36%. This represents a relative improvement of over 25% compared to previous state-of-the-art greedy methods like NTOM.
  • Scalability: The method scales effectively to large-scale models. Using a pre-trained CLIP (ViT-B/16) backbone, DOS achieved an average FPR95 of 3.41%, outperforming standard OE (4.13%).
  • Efficiency: Despite the overhead of K-means, DOS-trained models converge faster, requiring fewer epochs to reach peak performance compared to random or greedy alternatives.

Conclusion

Diverse Outlier Sampling (DOS) demonstrates that diversity is a critical, yet often overlooked, component of effective outlier exposure. By combining semantic clustering with uncertainty-based selection, DOS shapes a more robust and compact decision boundary. While clustering adds a small computational overhead, the resulting gains in detection accuracy and training efficiency make it a powerful tool for building reliable open-world AI systems.

Summary updated

BibTeX
@inproceedings{jiang2024dos,
  author = {Wenyu Jiang and Hao Cheng and Mingcai Chen and Chongjun Wang and Hongxin Wei},
  title = {{DOS: Diverse Outlier Sampling for Out-of-Distribution Detection}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=iriEqxFB4y},
}
Figure