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

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

Yen-Chang Hsu, Yilin Shen, Hongxia Jin, Zsolt Kira

Abstract

Out-of-distribution (OoD) detection is critical for the safe deployment of deep learning models. While the ODIN framework significantly improved detection performance, its reliance on OoD data for hyperparameter tuning limits its real-world applicability. We present Generalized ODIN (G-ODIN), which eliminates this requirement. G-ODIN utilizes a Decomposed Confidence Scoring (DeConf) mechanism and a novel in-distribution-only input preprocessing strategy. Our approach achieves state-of-the-art results on standard benchmarks without prior exposure to OoD samples, while providing insights into the challenges of semantic versus non-semantic distribution shifts.

Introduction

Deep neural networks (DNNs) are prone to making overconfident predictions on inputs that do not belong to any of the training classes. This behavior is a significant hurdle for safety-critical applications such as autonomous driving and medical diagnosis. The ODIN (Out-of-DIstribution detector for Neural networks) method addressed this by using temperature scaling and input preprocessing. However, a fundamental limitation of ODIN is the "chicken-and-egg" problem: it requires a sample of OoD data to tune its hyperparameters, yet the space of possible OoD data is effectively infinite.

Generalized ODIN (G-ODIN) overcomes this by introducing two key innovations: a decomposed logit structure that explicitly models "in-distribution-ness" and a tuning strategy that relies solely on the in-distribution validation set.

Methodology

Decomposed Confidence Scoring (DeConf)

Standard classifiers typically employ a softmax function, which assumes a closed-world scenario. G-ODIN rethinks this by decomposing the network's logit $f_i(x)$ into a ratio: $$f_i(x) = \frac{h_i(x)}{g(x)}$$ In this formulation, $h_i(x)$ represents the joint probability of the class and the domain being in-distribution, while $g(x)$ acts as a learned, input-dependent "in-distribution-ness" score. This $g(x)$ term effectively functions as a dynamic temperature scaling factor.

The DeConf framework decomposes neural network outputs into a joint class-domain probability $h(x)$ and an in-distribution-ness score $g(x)$.

In-Distribution Input Preprocessing (IPP)

Original ODIN uses small input perturbations to increase the gap between in-distribution (ID) and OoD confidence scores. G-ODIN modifies this by selecting the perturbation magnitude $\epsilon$ that maximizes the confidence of the ID validation set. This removes the need for "proxy" OoD datasets during the setup phase, making the detector truly generalized.

Experimental Results

We evaluated G-ODIN across standard benchmarks (CIFAR-10, CIFAR-100, SVHN) and large-scale datasets (DomainNet). Our results show that G-ODIN, particularly the DeConf-C variant combined with our IPP strategy, consistently outperforms original ODIN and the Mahalanobis distance baseline.

Performance comparison of G-ODIN (DeConf variants with IPP) against standard baselines across AUROC and TNR@TPR95 metrics.

On the CIFAR-100 dataset, G-ODIN improved the AUROC for detecting TinyImageNet from 91.1% (ODIN) to 98.6%. These results are achieved without any exposure to OoD data during tuning, demonstrating the robustness of the DeConf architecture.

Discussion and Conclusion

A key insight from our large-scale analysis on DomainNet is the distinction between semantic and non-semantic shifts. While G-ODIN excels at detecting non-semantic shifts (e.g., style changes), purely semantic shifts (new object categories) remain a formidable challenge.

In conclusion, G-ODIN provides a robust, probabilistic framework for OoD detection that is practical for real-world deployment. By decomposing confidence scores and utilizing in-distribution-only tuning, it achieves state-of-the-art performance while maintaining generalizability across unseen domains.

Summary updated

BibTeX
@inproceedings{hsu2020generalized,
  author = {Yen-Chang Hsu and Yilin Shen and Hongxia Jin and Zsolt Kira},
  title = {{Generalized ODIN: Detecting Out-of-distribution Image without Learning from Out-of-distribution Data}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.01096},
}
Figure