Generalized Out-of-Distribution Detection: A Survey

Jingkang Yang, Kaiyang Zhou, Yixuan Li, Ziwei Liu

TL;DR

This paper introduces a unified framework called generalized out-of-distribution (OOD) detection, which systematically connects five previously isolated research areas: anomaly detection, novelty detection, open set recognition, OOD detection, and outlier detection. By clarifying their subtle differences and providing a comprehensive survey of recent technical developments, the authors offer a roadmap for building more reliable machine learning systems that can safely navigate the "open world."

What Problem Does This Paper Address?

Most machine learning models are built on the "closed-world" assumption: the data they see during deployment will look exactly like the data they were trained on. In reality, when a model is deployed—say, in an autonomous vehicle—it will inevitably encounter objects or scenes it has never seen before.

The research community has developed several sub-fields to handle these "unknown unknowns," such as Anomaly Detection (AD) or Open Set Recognition (OSR). However, these fields have largely evolved in silos, using different terminology and experimental setups for very similar goals. This fragmentation leads to confusion for researchers and practitioners alike. This paper aims to bridge these gaps by providing a clear taxonomy and a holistic overview of the field.

Methods

The authors propose a Generalized OOD Detection framework that categorizes tasks based on four key axes:

  1. Distribution Shift Type: Does the task focus on covariate shift (changes in the input data style/domain while labels stay the same) or semantic shift (entirely new categories of objects)?
  2. In-Distribution (ID) Data Type: Is the model trained on a single class or multiple classes?
  3. Classification Requirement: Does the system need to classify the known samples, or just detect the unknowns?
  4. Learning Paradigm: Is it inductive (standard train-test split) or transductive (observing all data at once)?
Taxonomy of the generalized OOD detection framework, illustrating how different sub-tasks relate based on distribution shift, data type, and classification requirements.

The paper further categorizes OOD detection methodologies into four technical groups:

  • Classification-based: Leveraging model outputs like softmax probabilities or energy scores.
  • Density-based: Explicitly modeling the probability distribution of the training data (e.g., using Gaussian Mixture Models or Normalizing Flows).
  • Distance-based: Measuring how far a test sample is from the "prototypes" of known classes in the feature space.
  • Reconstruction-based: Using autoencoders to see if a sample can be accurately reconstructed; if it can't, it's likely OOD.

Datasets

The survey highlights the OpenOOD benchmark, which provides a standardized platform for fair comparison. Key datasets discussed include:

  • ID Datasets: MNIST, CIFAR-10, CIFAR-100, and ImageNet.
  • OOD Datasets: SVHN (house numbers), Texture (dtd), and Places365.
  • Near-OOD vs. Far-OOD: The authors distinguish between "Near-OOD" (semantically similar but different classes, like CIFAR-10 vs. CIFAR-100) and "Far-OOD" (completely different domains, like CIFAR-10 vs. MNIST).
Visual illustration of various sub-tasks under the generalized OOD framework using vision tasks.

Key Insights and Ideas

  • Semantic vs. Covariate Shift: A critical "aha moment" is that many current OOD detectors are actually more sensitive to covariate shifts (like changes in image style) than the semantic shifts (new classes) they were intended to detect. This suggests we need more "semantically coherent" detectors.
  • The Power of Data Augmentation: Surprisingly, simple data augmentation techniques like PixMix and CutMix are among the most effective ways to improve OOD detection by helping the model better estimate its own uncertainty.
  • Post-hoc is Often Better: Methods that can be applied to a pre-trained model without retraining (post-hoc) often outperform complex methods that require specialized training objectives.
  • Simplicity Wins: Non-parametric methods like K-Nearest Neighbors (KNN) in the feature space are remarkably competitive against much more complex probabilistic models.

Key Results

The paper summarizes quantitative findings from the OpenOOD benchmark:

  • Data Augmentation: PixMix achieved a top-tier 93.1% AUROC on the CIFAR-10 Near-OOD benchmark.
  • Inference-only Progress: Recent post-hoc methods (developed since 2021) show a clear upward trend in performance on realistic datasets compared to earlier toy-dataset-focused methods.
  • KNN Robustness: KNN-based detection maintains strong performance across diverse benchmarks including MNIST, CIFAR, and large-scale ImageNet, proving its generality.

Limitations and Future Work

The authors identify several pressing challenges:

  • Outlier-free Learning: Most high-performing methods currently rely on "Outlier Exposure"—training with a massive auxiliary dataset of "fake" OOD samples. Devising effective methods that don't need this extra data is a major goal.
  • The Accuracy-Detection Trade-off: There is often a tug-of-war between making a model more accurate on known classes and making it better at detecting unknowns. Future work should aim for "win-win" solutions.
  • Scaling to the Real World: Many methods that work on CIFAR fail to scale to the massive semantic space of ImageNet or real-world autonomous driving data.
  • Beyond Classification: OOD detection needs to be expanded into broader tasks like object detection, segmentation, and even large language models (LLMs) to mitigate hallucinations.

Summary updated

BibTeX
@article{yang2024generalized,
  author = {Jingkang Yang and Kaiyang Zhou and Yixuan Li and Ziwei Liu},
  title = {{Generalized Out-of-Distribution Detection: A Survey}},
  journal = {Int. J. Comput. Vis.},
  year = {2024},
  doi = {10.1007/s11263-024-02117-4},
}
Figure