Generalized ODIN: Detecting Out-of-distribution Image without Learning from Out-of-distribution Data

TL;DR

Proposed generalized ODIN achieves high OoD detection without out-of-distribution data tuning, via confidence decomposition and input preprocessing.

cs.CV 🔴 Advanced 2020-02-26 47 views
Yen-Chang Hsu Yilin Shen Hongxia Jin Zsolt Kira
deep learning anomaly detection unsupervised robustness image recognition

Key Findings

Methodology

Building on ODIN, this work introduces a probabilistic confidence decomposition, explicitly modeling the in/out distribution variable d. The classifier is designed with hi(x) and g(x) branches, representing class confidence and distribution shift. The approach employs input perturbation tuned solely on in-distribution data, avoiding OoD data. Extensive experiments on CIFAR-10/100, TinyImageNet, LSUN, SVHN, and DomainNet validate the method's effectiveness, outperforming traditional methods requiring OoD tuning. The framework also analyzes semantic and non-semantic shifts, revealing different detection challenges.

Key Results

  • On CIFAR-100, DeConf-C achieves 97.6% AUROC and 87.8% TNR@TPR95, surpassing ODIN (90.5%, 56.0%) by over 7 percentage points, demonstrating robust OoD detection without OoD data.
  • In large-scale DomainNet, the method effectively distinguishes semantic from non-semantic shifts, with non-semantic shifts being more challenging, yet still well detected.
  • The no-OoD-tuning version performs comparably or better than tuned SOTA methods, confirming strong generalization and practical applicability.

Significance

This work addresses a critical bottleneck in deploying deep models in real-world scenarios where OoD data is unavailable or hard to label. By eliminating the need for OoD samples during tuning, it significantly reduces deployment complexity. The confidence decomposition enhances the model's ability to recognize unfamiliar inputs, improving safety in autonomous systems, security, and medical diagnostics. The large-scale analysis provides insights into the nature of distribution shifts, guiding future research toward more resilient detection strategies.

Technical Contribution

The paper introduces a probabilistic framework for confidence decomposition, designing classifiers with factorized logits hi(x) and g(x). The model incorporates adaptive input perturbation tuned solely on in-distribution data, leveraging a novel structure that models the joint probability of class and domain. This approach generalizes ODIN, removing the dependence on OoD data for hyperparameter tuning, and achieves superior detection performance across multiple benchmarks. The theoretical grounding and extensive empirical validation mark a significant advance in unsupervised OoD detection.

Novelty

This is the first approach to explicitly decompose confidence scores into probabilistic factors within a classifier structure, enabling high-performance OoD detection without any OoD data. Unlike prior methods relying on outlier generation or regularization, this method employs a factorized model with input perturbation tuned solely on in-distribution data, representing a fundamental shift in the design philosophy. The analysis of distribution shift types further distinguishes this work from existing literature.

Limitations

  • The method's performance may degrade under extreme distribution shifts or novel classes beyond the modeled assumptions, as the confidence factors may not fully capture unseen variations.
  • Computational costs increase with high-dimensional data and complex models, posing challenges for real-time deployment.
  • While tuning perturbation magnitude only on in-distribution data simplifies the process, its effectiveness across diverse datasets and tasks still requires further validation.

Future Work

Future directions include integrating self-supervised learning to enhance feature robustness, exploring multi-scale and dynamic perturbation strategies, and extending the framework to video and multimodal data. Additionally, developing theoretical bounds for detection under various shift types and reducing computational overhead will be key to broader adoption.

AI Executive Summary

Deep neural networks excel within their training distribution but falter when faced with out-of-distribution (OoD) samples, posing safety and reliability concerns in real-world applications. Traditional OoD detection methods often depend on tuning hyperparameters with OoD data, which is impractical in many scenarios where such data is unavailable or hard to define. This paper introduces a novel approach, 'Generalized ODIN,' that overcomes this limitation by eliminating the need for OoD data during tuning.

The core innovation lies in a probabilistic confidence decomposition framework, which splits the classifier's confidence into two factors: one representing the likelihood of the sample belonging to known classes, and another indicating the degree of distributional shift. The classifier is designed with two branches—hi(x) and g(x)—to model these factors explicitly. This structure allows the model to better distinguish in-distribution from OoD samples, especially when combined with an input perturbation strategy that is tuned solely on in-distribution validation data.

Extensive experiments on datasets such as CIFAR-10/100, TinyImageNet, LSUN, SVHN, and the large-scale DomainNet demonstrate the effectiveness of this approach. Results show that the proposed method achieves AUROC scores exceeding 97% and TNR@TPR95 over 87% without any OoD data tuning, outperforming existing methods like ODIN and Mahalanobis that require OoD samples for hyperparameter tuning. The analysis of different distribution shifts reveals that non-semantic shifts are inherently more challenging, guiding future research directions.

Overall, this work significantly advances the field of OoD detection by providing a practical, robust, and theoretically grounded framework that does not rely on OoD data, making it highly suitable for real-world deployment in safety-critical systems. Its ability to generalize across diverse datasets and shift types marks a substantial step toward more reliable AI systems.

Deep Analysis

Background

Deep learning models have achieved remarkable success in controlled environments, but their robustness in open-world settings remains limited. Early methods like OpenMax, DeepEnsemble, and temperature scaling improved confidence calibration but still relied heavily on labeled OoD data for tuning. Recent approaches such as ODIN and Mahalanobis distance-based detectors introduced input perturbation and feature space analysis, respectively, significantly enhancing detection performance. However, these methods depend on hyperparameters tuned with OoD samples, which limits their practicality. As datasets grow larger and more complex, the challenge of detecting diverse and unseen distribution shifts—semantic (new classes) and non-semantic (appearance variations)—becomes more pressing. The need for a method that can operate effectively without prior OoD data has become a key research focus, especially for deployment in safety-critical applications like autonomous driving, medical diagnosis, and security systems.

Core Problem

The core challenge is to develop OoD detection techniques that do not require prior access to OoD data for tuning hyperparameters. Existing methods often suffer from poor generalization when faced with unseen distribution shifts or novel classes, leading to false positives or missed detections. This is particularly problematic in real-world scenarios where collecting comprehensive OoD datasets is infeasible. The fundamental question is how to design models that can reliably distinguish in-distribution from out-of-distribution samples without relying on explicit OoD examples, thereby ensuring robustness, scalability, and ease of deployment across diverse applications.

Innovation

The paper introduces a probabilistic confidence decomposition framework, which models the classifier's output as a ratio of joint class-domain probability and domain probability, explicitly incorporating a binary variable d indicating in/out distribution. The classifier architecture is modified to include hi(x) and g(x) branches, representing class confidence and shift degree, respectively. This structure allows the model to learn from in-distribution data alone, using input perturbation tuned via validation data without OoD samples. The approach generalizes ODIN by replacing hyperparameter tuning with an adaptive, data-driven mechanism, leading to superior detection performance and robustness across datasets and shift types.

Methodology

  • �� Define the joint class-domain probability p(y, din|x) and the domain variable d.
  • �� Design a classifier with two branches: hi(x) modeling class confidence, g(x) modeling shift degree.
  • �� Use softmax normalization of hi(x) and g(x) to produce class probabilities conditioned on d.
  • �� Implement input perturbation by searching for an optimal magnitude only on in-distribution validation data, avoiding OoD samples.
  • �� Train the model by minimizing cross-entropy loss on p(y, din|x), encouraging hi(x) and g(x) to behave as factors of confidence and shift.
  • �� Evaluate detection scores based on hi(x) or g(x), with thresholds for rejection.
  • �� Explore different similarity measures (inner product, cosine, Euclidean) for hi(x) to enhance robustness.
  • �� Incorporate temperature scaling via g(x) for calibration and improved separation of OoD samples.

Experiments

The evaluation employs datasets like CIFAR-10/100, TinyImageNet, LSUN, SVHN, and DomainNet, comparing the proposed method with ODIN and Mahalanobis baselines. The experiments focus on scenarios without OoD data for tuning, using validation sets to automatically select perturbation magnitudes. Performance metrics include AUROC and TNR@TPR95, assessed across multiple shift types. Ablation studies analyze the impact of different classifier structures, similarity measures, and perturbation strategies. Results consistently show that the proposed confidence decomposition and input tuning outperform traditional methods, with AUROC improvements of over 7% in some cases, and robustness across datasets and shift types.

Results

On CIFAR-100, the method achieves AUROC scores exceeding 97%, with TNR@TPR95 over 87%, outperforming ODIN (AUROC 90.5%) and Mahalanobis (AUROC 92.4%). In large-scale DomainNet, detection of semantic shifts is easier than non-semantic shifts, but the method maintains high performance in both cases. The no-OoD-tuning version performs comparably to tuned SOTA methods, demonstrating excellent generalization. The analysis of different shift types reveals that non-semantic shifts pose greater detection challenges, guiding future research to focus on feature robustness and shift modeling.

Applications

This approach is suitable for deployment in autonomous vehicles, security systems, and medical diagnostics, where collecting comprehensive OoD data is impractical. It enables reliable detection of unknown inputs with minimal supervision, reducing false alarms and enhancing safety. The method's adaptability to various datasets and shift types makes it a versatile tool for real-world AI applications. Future integration with self-supervised learning and multimodal data could further improve detection accuracy and robustness in complex environments.

Limitations & Outlook

While effective, the method's performance may decline under extreme or highly novel distribution shifts, especially when the assumptions about shift factors do not hold. Computational complexity increases with high-dimensional data and complex models, limiting real-time application. Although tuning only on in-distribution data simplifies deployment, its effectiveness across diverse tasks and datasets requires further validation. Future work should address these limitations by developing more scalable algorithms and theoretical guarantees for detection under various shift scenarios.

Plain Language Accessible to non-experts

想象你在一个工厂里工作,工厂每天都生产不同的产品。你对每个产品都很熟悉,知道它们的标准样子,但偶尔会出现一些奇怪的产品,比如变形或颜色不同的。这些奇怪的产品可能是因为机器出了问题,或者是新产品刚刚引入。工厂需要一种方法,能快速判断这些奇怪的产品是否正常,或者是否属于新类别。传统的方法就像用一套固定的标准检测,但如果出现新产品或变形的产品,就容易出错。本文的方法像是给工厂设计了一个智能检测系统,它不仅能判断产品是否符合标准,还能根据产品的细节拆解出不同的特征,比如颜色、形状、材质等。这样,即使遇到新类型或变形的产品,也能更准确地识别出来。更重要的是,这个系统不需要提前知道所有可能出现的奇怪产品,只用一些正常产品的样本就能学会识别异常。通过这种方式,工厂的检测变得更智能、更灵活,也更可靠。

ELI14 Explained like you're 14

想象你在学校里,有个老师每天都认识很多同学,知道他们平时长得像什么。有一天,有个新同学来了,他长得有点不一样,老师一眼就能看出来。以前老师只靠记住每个同学的样子,但有时候新同学长得不一样,老师就会搞不清楚。现在,老师用一种特别的方法,把每个同学的特征拆开来看,比如脸的形状、发型、衣服颜色,然后再结合这些信息判断这个新同学是不是认识的同学。这样,即使新同学长得不一样,老师也能很快知道他是不是认识的。这就像这篇论文里的方法,它把图片的“信心”拆成两个部分:一个是图片属于已知类别的可能性,另一个是图片是不是偏离正常的可能性。通过这种拆分,模型可以更好地判断图片是不是“陌生的”,不用提前告诉它所有可能的“陌生”图片。这就像老师用拆解特征的方法,变得更聪明、更灵活,能更准确地识别出新奇或异常的图片。

Glossary

Out-of-Distribution (OoD, 分布外)

指样本来自与训练数据不同的分布,模型在检测时难以识别其是否为已知类别。

论文中用于描述模型在遇到未知或偏移数据时的检测对象。

信心分解 (Confidence Decomposition)

将分类置信度拆解为多个因子,以更细粒度地理解模型输出的可信度。

论文提出的核心思想,用于提升无调优检测性能。

温度缩放 (Temperature Scaling)

一种调节softmax输出平滑程度的技术,通过调整温度参数改善模型校准。

用于增强模型对偏移样本的区分能力。

输入扰动 (Input Perturbation)

在输入数据上施加微小变化,以增强模型对异常样本的敏感性。

ODIN和本文改进方法中的关键技术。

AUROC (Area Under ROC Curve, ROC曲线下面积)

衡量二分类模型性能的指标,值越接近1越好。

用于评估OoD检测的效果。

Open Questions Unanswered questions from this research

  • 1 如何在极端偏移或新类别出现时,模型仍能保持高效检测能力,仍需研究更鲁棒的结构设计。
  • 2 在大规模高维数据中,实时检测的计算成本和效率优化仍是挑战。
  • 3 未来需结合多模态信息和自监督学习,进一步提升无调优检测的泛化能力。

Applications

Immediate Applications

自动驾驶安全系统

利用该方法检测未知道路情况或障碍物,提升自动驾驶的安全性,无需大量OoD样本即可部署。

安防监控异常检测

在监控系统中识别异常行为或未知入侵者,减少误报,提高反应速度。

Long-term Vision

智能机器人自主学习

使机器人能在未知环境中自主识别新物体或场景,减少人工调校,推动自主学习发展。

Abstract

Deep neural networks have attained remarkable performance when applied to data that comes from the same distribution as that of the training set, but can significantly degrade otherwise. Therefore, detecting whether an example is out-of-distribution (OoD) is crucial to enable a system that can reject such samples or alert users. Recent works have made significant progress on OoD benchmarks consisting of small image datasets. However, many recent methods based on neural networks rely on training or tuning with both in-distribution and out-of-distribution data. The latter is generally hard to define a-priori, and its selection can easily bias the learning. We base our work on a popular method ODIN, proposing two strategies for freeing it from the needs of tuning with OoD data, while improving its OoD detection performance. We specifically propose to decompose confidence scoring as well as a modified input pre-processing method. We show that both of these significantly help in detection performance. Our further analysis on a larger scale image dataset shows that the two types of distribution shifts, specifically semantic shift and non-semantic shift, present a significant difference in the difficulty of the problem, providing an analysis of when ODIN-like strategies do or do not work.

cs.CV cs.LG eess.IV