Source-linked AI summary

Generalized Out-of-Distribution Detection: A Survey

Jingkang Yang, Kaiyang Zhou, Yixuan Li, Ziwei Liu

arXiv:2110.11334v3cs.CVcs.AIcs.LG

TL;DR

OOD-related tasks share goals but differ in definitions and settings, complicating comparisons. This survey unifies five tasks, reviews their methods, and finds data-augmentation approaches especially effective in benchmarked OOD detection.

  • Problem

    Related OOD tasks share motivations but differ subtly in definitions and settings, making their relationships difficult to understand and distinguish.

  • Method

    The survey introduces generalized OOD detection, unifying AD, ND, OSR, OOD detection, and OD while systematically reviewing their definitions, relationships, and methodologies.

  • Results

    Data-augmentation methods combining uncertainty estimation were most effective on CIFAR benchmarks, with PixMix reaching 93.1% on CIFAR-10 near-OOD.

  • Takeaways & Limitations

    The framework helps researchers accurately locate target problems, select suitable benchmarks, identify baselines, and explore interactions across related tasks.

  • Takeaways & Limitations

    The broad OOD definition requires specifying the shift type and motivation, while mainstream OOD detection primarily focuses on semantic shifts.

Abstract

from arXiv · show

Out-of-distribution (OOD) detection is critical to ensuring the reliability and safety of machine learning systems. For instance, in autonomous driving, we would like the driving system to issue an alert and hand over the control to humans when it detects unusual scenes or objects that it has never seen during training time and cannot make a safe decision. The term, OOD detection, first emerged in 2017 and since then has received increasing attention from the research community, leading to a plethora of methods developed, ranging from classification-based to density-based to distance-based ones. Meanwhile, several other problems, including anomaly detection (AD), novelty detection (ND), open set recognition (OSR), and outlier detection (OD), are closely related to OOD detection in terms of motivation and methodology. Despite common goals, these topics develop in isolation, and their subtle differences in definition and problem setting often confuse readers and practitioners. In this survey, we first present a unified framework called generalized OOD detection, which encompasses the five aforementioned problems, i.e., AD, ND, OSR, OOD detection, and OD. Under our framework, these five problems can be seen as special cases or sub-tasks, and are easier to distinguish. We then review each of these five areas by summarizing their recent technical developments, with a special focus on OOD detection methodologies. We conclude this survey with open challenges and potential research directions.

1 Introduction

The introduction frames OOD detection as necessary for trustworthy, safe visual recognition in open-world deployment, where unknown inputs should be detected and rejected. It proposes generalized OOD detection as a unified framework connecting AD, ND, OSR, OOD detection, and OD.

  • Motivation: Trustworthy visual recognition systems should detect unknown examples and reject them or hand them to humans for safe handling.The motivation includes rejecting non-food images in food classification and handing unusual autonomous-driving scenes to human users.
  • Problem Setting: Closed-world models assume i.i.d. test data, whereas open-world deployment exposes them to OOD samples that require cautious handling.Distributional shifts may arise from semantic changes or covariate changes across domains.
  • Problem Setting: OOD detection focuses on semantic distribution shifts, including new classes, where the ID and OOD label spaces differ and the model should make no prediction.Related open-world problems include OD, AD, and ND, which share the goal of identifying OOD examples.
  • Contributions: The survey introduces generalized OOD detection, treating AD, ND, OSR, OOD detection, and OD as special cases or sub-topics.The framework is intended to clarify similarities and differences among these problems.
  • Contributions: The survey systematically reviews the five topics so their similarities and differences can be compared, analyzed, and positioned within the literature.The authors state that this unification is intended to improve understanding of the problems and research positioning.

2 Generalized OOD Detection · 2.1 Anomaly Detection

The paper presents generalized OOD detection as a unified framework for AD, ND, OSR, OOD detection, and OD, distinguishing them by distribution shifts and task assumptions. It then defines anomaly detection as identifying deviations from predefined normality, separating sensory and semantic AD while describing its framework position and evaluation.

  • 2 Generalized OOD Detection: Generalized OOD detection unifies AD, ND, OSR, OOD detection, and OD as related open-world tasks that detect samples outside a defined in-distribution.The framework addresses differences in the definitions and properties of ID and OOD data.
  • 2 Generalized OOD Detection: The framework distinguishes its sub-tasks using covariate versus semantic shift, single versus multiple classes, whether ID classification is needed, and inductive versus transductive settings.Covariate shift changes P(X) while retaining Y; semantic shift changes P(Y) and consequently affects P(X).
  • 2.1 Anomaly Detection: Current AD settings often constrain the supposedly open world to specific scenarios, such as realistic images or one industrial assembly line and product.Sensory AD includes industrial inspection, forensics, forgery recognition, and adversarial defense, while semantic AD includes crime surveillance and image crawling.
  • 2.1 Anomaly Detection: Anomaly detection identifies test samples that deviate from predefined normality, with sensory AD addressing covariate shift and semantic AD addressing label shift.AD’s normal concept should reflect the real task, such as defining hotdogs as the normal category in a not-hotdog detector.
  • 2.1 Anomaly Detection: Sensory AD assumes normal samples share P(X), detects samples from P′(X), and preserves the label distribution so that P(Y) = P′(Y).It targets observational or surface differences among objects with the same or similar semantics.
  • 2.1 Anomaly Detection: Semantic AD assumes normalities belong to one semantic category, detects novel classes under P(Y) ≠ P′(Y), and includes applications such as surveillance and category-specific image crawling.A benchmark can use one MNIST class as ID and the other nine classes as semantic anomalies.
  • 2.1 Anomaly Detection: AD treats ID samples as a whole without requiring differentiation among their classes or statistical modalities, linking normality to ID and anomalies to OOD.This distinguishes AD from tasks such as OSR and OOD detection that require different treatment of ID samples.
  • 2.1 Anomaly Detection: AD evaluation scores samples by normality confidence, thresholds low-confidence cases as abnormal, and uses AUROC from TPR–FPR curves.Anomalies are treated as positives and true normalities as negatives; precision and recall provide related evaluation values.

Remark: Alternative Taxonomy on Anomalies

Anomalies may be categorized as point, contextual, or collective types. The survey focuses mainly on point anomaly detection, while distinguishing task-level sensory/semantic and methodology-level supervision taxonomies as orthogonal.

  • Alternative Taxonomy on Anomalies: Anomalies are commonly classified as point, contextual, or collective types.Contextual anomalies often arise in time-series tasks.
  • Alternative Taxonomy on Anomalies: The survey emphasizes point anomaly detection because of its practical popularity and usefulness for clarifying similarities and differences among sub-tasks.
  • Taxonomy based on Supervision: Task-level sensory/semantic and methodology-level unsupervised or supervised taxonomies are orthogonal because they address different aspects of anomaly detection.

2.2 Novelty Detection

Novelty detection identifies test samples outside all training categories and treats them as potential resources for future analysis or incremental learning rather than inherently erroneous or malicious cases. It primarily concerns semantic shift without requiring ID classification, with one-class and multi-class settings evaluated like anomaly detection.

  • Definition: Novelty detection identifies test samples that do not belong to any training category for future specialized analysis or incremental learning.Its motivation differs from anomaly detection because novel samples are generally viewed constructively rather than as erroneous, fraudulent, or malicious.
  • Definition: ND covers one-class settings with a single training class and multi-class settings with multiple training classes.Multi-class methods may use a classifier, whereas one-class methods cannot, even though ID classification is not required.
  • Position in Framework: Within generalized OOD detection, ND addresses OOD samples with semantic shift and does not require classification of ID samples.This makes ND equivalent to semantic anomaly detection in problem definition.
  • Evaluation: ND evaluation uses the same metrics as anomaly detection: AUROC, AUPR, or F-scores.The evaluation protocol is explicitly shared with AD.
  • Nuance between AD and ND: ND is distinguished from AD in some literature by being fully unsupervised, with no novel data in training, whereas AD may include abnormal training samples.Neither ND nor AD requires classification of ID data, unlike OSR and OOD detection as discussed later.

2.3 Open Set Recognition

Open set recognition (OSR) extends novelty detection by requiring classifiers to both recognize known classes accurately and detect semantically shifted unknown classes. It evaluates novelty detection, ID classification, and sometimes their joint performance.

  • Definition: OSR requires multi-class classifiers to accurately classify known known classes while detecting unknown unknown classes.These correspond to in-distribution and out-of-distribution samples, respectively.
  • Position in Framework: OSR addresses semantic shift in testing, where P(Y) ≠ P′(Y), and differs from multi-class novelty detection by additionally requiring accurate ID classification.Within the generalized OOD framework, known known classes are ID and unknown unknown classes are OOD.
  • Application and Benchmark: OSR supports robust deployment of image classifiers by rejecting unknown samples while maintaining strong classification on known classes.A MNIST benchmark may use six classes as ID and four as OOD, with an additional requirement for accurate classification of the six ID classes.
  • Evaluation: OSR evaluation includes F-scores, AUROC, AUPR, and standard ID accuracy, with joint criteria such as CCR@FPRx measuring class-wise recall at a specified false-positive rate.For example, CCR@FPRx can evaluate recall when FPR equals 10^-1.

2.4 Out-of-Distribution Detection

OOD detection identifies test samples that differ semantically from the training distribution and should therefore be rejected, while retaining accurate classification on in-distribution classes. Although related to OSR and sometimes extended to covariate shifts, the field primarily focuses on semantic-shift detection and must balance detection with generalization.

  • Definition: OOD detection rejects inputs semantically different from the training distribution rather than predicting them.Its distribution is generally defined by non-overlapping label distributions between training and OOD samples.
  • Position in Framework: In multiclass classification, OOD detection preserves performance on in-distribution classes while rejecting samples outside their semantic support.This makes it canonical to OSR while distinguishing it from anomaly and novelty detection through multiclass classification and in-distribution classification requirements.
  • Application and Benchmark: OOD benchmarks commonly train on one dataset, such as CIFAR-10, and evaluate against other datasets such as SVHN without overlapping labels.The application often targets safety-critical settings including autonomous driving.
  • Mainstream OOD Detection Focuses on Semantics: OOD detection primarily targets semantic shifts, although some studies also detect covariate shifts because they can substantially degrade model performance.The survey treats semantic-shift detection as its central focus while recognizing covariate-shift detection as task-dependent.
  • To Generalize, or To Detect?: A valid OOD task balances detecting samples the model cannot or should not generalize to against generalizing across acceptable distribution changes.This balance depends on the task’s meaningfulness and inherent difficulty.

2.5 Outlier Detection · 2.6 Related Topics

Outlier detection differs from generalized OOD settings by processing all observations rather than using a training-test scheme, yet is included because outliers represent one type of out-of-distribution. The survey also distinguishes five related topics by their assumptions, goals, and relationships to generalized OOD detection.

  • 2.5 Outlier Detection: Outlier detection directly processes all observations and selects outliers, unlike AD, ND, OSR, and OOD detection, which detect unseen test samples differing from training data.The framework treats outlier detection as an unusual inclusion because it does not follow the usual training-test scheme.
  • 2.5 Outlier Detection: The survey includes outlier detection because outliers intuitively represent one type of out-of-distribution and help clarify distinctions among OD, AD, ND, and OOD.The topic is rarely addressed in recent deep learning venues, but remains useful for familiarizing readers with related terminology.
  • 2.6 Related Topics: Learning with Rejection shares with OOD detection and OSR the underlying spirit of classification with a rejection option, despite methodological differences.Its foundations include early abstention work and studies revealing neural networks’ overconfidence on OOD data.
  • 2.6 Related Topics: Domain adaptation and domain generalization assume covariate shift without semantic shift and require accurate predictions among the same classes, complementing OOD detection’s focus on semantic shift.Both approaches follow an open-world assumption, but differ from generalized OOD detection settings.
  • 2.6 Related Topics: Novelty discovery receives all observations in advance semi-supervised and discovers new categories, whose unknown classes may overwhelm the unlabeled set rather than remain sparse outliers.This distinguishes novelty discovery from outlier detection.
  • 2.6 Related Topics: Zero-shot learning follows a training-testing scheme and uses extra information, such as label relationships, to classify unknown test classes under an open-world assumption.Its goal is similar to novelty discovery, but its setting differs.
  • 2.6 Related Topics: Open-world recognition combines novelty or open-set recognition with incremental learning to detect novel images, label new classes, and learn those classes continuously.It extends OSR by adding the ability to incrementally learn new classes over time.
  • 2.6 Related Topics: Conformal prediction provides confidence measures and prediction intervals with specified confidence levels, offering informative uncertainty signals for OOD detection.In OOD scenarios, wider prediction intervals or lower confidence levels generated by conformal prediction are particularly insightful.

2.7 Organization of Remaining Sections

The paper focuses on OOD detection methodologies, briefly reviews AD, ND, OSR, and OD, and organizes methods into four methodological groups. It also compares representative methods empirically and discusses remaining problems and limitations.

  • Section 3 provides a comprehensive overview of proposed OOD detection methodologies.
  • Section 4 briefly introduces methodologies for AD, ND, OSR, and OD.
  • Methods are categorized as classification-based, density-based, distance-based, or reconstruction-based.These groups rely on classifiers, model data density, use distance metrics, or employ reconstruction techniques, respectively.
  • The paper empirically compares representative OOD detection methods with methods from other sub-tasks and highlights remaining problems and limitations.

3 OOD Detection: Methodology

OOD detection methodology spans classification-based, density-based, and distance-based approaches, with classification methods further divided into post-hoc, training-based, and outlier-exposure strategies. These methods derive OOD scores from model outputs, intermediate features, gradients, or synthesized and collected outliers.

  • Methodology overview: The survey organizes OOD detection methods into classification-based, density-based, and distance-based categories.Classification-based methods are introduced first, followed by density-based and distance-based methods.
  • Classification-based methods: Post-hoc methods improve OOD detection without modifying training, reducing adoption barriers when retraining is costly.ODIN uses temperature scaling and input perturbation to amplify ID/OOD separability.
  • Classification-based methods: Energy-based scoring interprets lower-energy test samples as in-distribution and higher-energy samples as out-of-distribution.Unlike calibration, the energy score is designed to maximize ID/OOD separation rather than represent predictive correctness likelihood.
  • Classification-based methods: Training-based methods improve confidence through specialized branches or classes, ensembling, adversarial training, augmentation, pretext training, uncertainty modeling, input manipulation, and feature statistics.Some methods specifically use hidden representations from middle layers to increase sensitivity to covariate shift.
  • Outlier exposure: Outlier-exposure methods train on collected OOD samples, while outlier-generation methods synthesize OOD data when such samples are unavailable.Outlier exposure assumes access to OOD training data, which may be infeasible in practice.
  • Other information spaces: Gradient-based detection is effective, but its success may depend more on learned feature-embedding magnitude and predicted output distribution than on gradients themselves.ODIN uses input perturbations derived from input gradients to increase softmax scores.

4 Methodologies from Other Sub-tasks

This section surveys methodologies for AD, ND, OSR, and OD as sub-tasks within generalized OOD detection, aiming to inspire OOD detection research. It emphasizes OSR approaches spanning classification, distance, reconstruction, and density-based methods, alongside AD methods based on density and reconstruction.

  • Overview: The section introduces methodologies for AD, ND, OSR, and OD as related sub-tasks intended to inspire new OOD detection ideas.These sub-tasks are reviewed under the generalized OOD detection framework.
  • Open Set Recognition: OSR was introduced with 1-class SVM, binary SVM, and 1-vs-Set SVM, which bounds open-set space alongside in-distribution risk.The 1-vs-Set SVM solves a two-plane optimization problem instead of the classic half-space formulation.
  • Open Set Recognition: OSR also combines EVT, external negative datasets, auxiliary transformation or mutual-information tasks, and generated unknown samples, although image generation struggles with complex natural images.OpenMax applies per-class EVT calibration, while generated unknown samples work better on simple images than in high-dimensional natural-image settings.
  • Open Set Recognition: OSR methods use class-conditional prototypes, visual-feature clustering, Gaussian-mixture embeddings, nearest-neighbor distances, and reconstruction behavior to identify unknown samples.Reconstruction differences may appear in latent features or reconstructed pixels, while nearest-neighbor methods use training-sample distance ratios.
  • Anomaly Detection: AD methods model normal-data distributions with density estimation or compare reconstruction behavior and error between normal and anomalous samples.The surveyed approaches include parametric and nonparametric density estimation, neural generative models, energy-based models, frequency analysis, sparse reconstruction, and deep reconstruction models.

5 Benchmarks and Experiments

The experiments fairly compare diverse OOD, anomaly-detection, and robustness methods on CIFAR benchmarks under unified architectures and training settings. Data-augmentation-based uncertainty methods perform best, while extra data offers limited benefit and current detectors may be more sensitive to covariate than semantic shifts.

  • Benchmark design: The study compares popular methods from anomaly detection, OOD detection, and model robustness categories using OpenOOD’s CIFAR benchmarks.The evaluated OOD methods include post-hoc, training-required, and extra-data-required approaches.
  • Benchmark design: The benchmarks treat CIFAR-10 or CIFAR-100 as in-distribution and use disconnected datasets, with near-OOD and far-OOD datasets evaluated by AUROC.For CIFAR-100, near-OOD includes CIFAR-10 and TinyImageNet, while far-OOD includes MNIST, SVHN, Texture, and Places365.
  • Implementation: Fair comparisons use ResNet-18 and common training settings, including SGD with learning rate 0.1, momentum 0.9, weight decay 0.0005, and 100 epochs.These unified choices address differences in methods’ fields and implementations.
  • Results: Data-augmentation methods that improve model uncertainty are generally most effective, with PixMix achieving 93.1% on CIFAR-10 Near-OOD.Ensemble and Mixup also show excellent performance across most benchmarks.
  • Results: Extra data provides a meaningful advantage only for UDG on CIFAR-10 near-OOD, despite requiring substantial real outlier data.The comparison identifies KNN as the best extra-data-free method and UDG as the best extra-data method in that comparison.
  • Limitations: OpenOOD focuses deliberately on semantic shifts, while prior experiments indicate that most current OOD detectors are more sensitive to covariate shifts.The benchmark excludes pure covariate-shift settings to avoid misinterpretation and overemphasis on covariate-shift detection.

6 Challenges and Future Directions

The survey identifies challenges in properly evaluating generalized OOD detection and in developing outlier-free, realistic benchmarks. It also highlights future directions involving cross-task methodologies, combining OOD detection with generalization, and extending OOD detection to broader learning tasks.

  • Proper Evaluation and Benchmarking: Proper evaluation requires clearly distinguishing sub-tasks, identifying the target problem, and constructing appropriate benchmarks.Mainstream OOD detection primarily focuses on semantic shifts, while the broad definition of OOD detection creates additional challenges and concerns.
  • Proper Evaluation and Benchmarking: OOD benchmarks can produce inaccurate evaluations when OOD datasets contain images from in-distribution categories.Recent work addresses this issue by removing ID classes from OOD samples.
  • Outlier-free OOD Detection: Outlier exposure relies on the strong assumption that OOD training data are available, motivating outlier-free detection research.Erroneous samples in ImageNet OOD benchmarks also motivated the corrected NINCO dataset for more accurate evaluations.
  • Outlier-free OOD Detection: Future benchmarks should include realistic datasets and object-level OOD detection, especially for safety-critical applications such as autonomous driving.These expansions are intended to provide valuable insights into real-world scenarios.
  • Methodologies across Sub-tasks: Solutions can be shared across related sub-tasks, with density-based OOD detection drawing insights from established density-based anomaly detection methods.The survey also considers combining OOD detection with generalization and open-set semi-supervised learning.
  • OOD Detection For Broader Learning Tasks: OOD detection extends beyond classification to multi-label classification, object detection, image segmentation, time-series prediction, and LiDAR-based 3D object detection.The survey presents OOD detection as encompassing a broader spectrum of learning tasks.

7 Conclusion

The survey reviews AD, ND, OSR, OOD detection, and OD within a unified generalized OOD detection framework, clarifying their motivations, definitions, methodologies, and benchmarks.

  • 7 Conclusion: The survey unifies AD, ND, OSR, OOD detection, and OD as five topics within generalized OOD detection.It articulates each sub-task’s motivations and definitions to help readers identify target problems and suitable benchmarks.
  • 7 Conclusion: Sorting methodologies for each sub-task helps readers grasp mainstream methods, identify suitable baselines, and contribute future solutions.
Loading 2110.11334v3…