Neural Mean Discrepancy for Efficient Out-of-Distribution Detection
Xin Dong, Junfeng Guo, Ang Li, Wei-Te Ting, Cong Liu, H. T. Kung
Abstract
Various approaches have been proposed for out-of-distribution (OOD) detection by augmenting models, input examples, training sets, and optimization objectives. Deviating from existing work, we have a simple hypothesis that standard off-the-shelf models may already contain sufficient information about the training set distribution which can be leveraged for reliable OOD detection. Our empirical study on validating this hypothesis, which measures the model activation's mean for OOD and in-distribution (ID) minibatches, surprisingly finds that activation means of OOD mini-batches consistently deviate more from those of the training data. In addition, training data's activation means can be computed offline efficiently or retrieved from batch normalization layers as a ‘free lunch’. Based upon this observation, we propose a novel metric called Neural Mean Discrepancy (NMD), which compares neural means of the input examples and training data. Leveraging the simplicity of NMD, we propose an efficient OOD detector that computes neural means by a standard forward pass followed by a lightweight classifier. Extensive experiments show that NMD outperforms state-of-the-art OOD approaches across multiple datasets and model architectures in terms of both detection accuracy and computational cost.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
22 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Exploring the Limits of Out-of-Distribution Detection cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Heterogeneous Forgetting Compensation for Class-Incremental Learning cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Improving robustness against common corruptions by covariate shift adaptation cites Big Self-Supervised Models are Strong Semi-Supervised Learners
- SAFE: Sensitivity-Aware Features for Out-of-Distribution Object Detection cites Energy-based Out-of-distribution Detection
- Neuron Activation Coverage: Rethinking Out-of-distribution Detection and Generalization cites Exploring the Limits of Out-of-Distribution Detection
- Neuron Activation Coverage: Rethinking Out-of-distribution Detection and Generalization cites Energy-based Out-of-distribution Detection
- Neuron Activation Coverage: Rethinking Out-of-distribution Detection and Generalization cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Cited by top-tier papers22
- Domain Watermark: Effective and Harmless Dataset Copyright Protection is Closed at HandJunfeng Guo, Yiming Li, Lixu Wang, Shu-Tao Xia et al.NeurIPS 2023 · 93 citations
- SAFE: Sensitivity-Aware Features for Out-of-Distribution Object DetectionSamuel Wilson, Tobias Fischer, Feras Dayoub, Dimity Miller et al.ICCV 2023 · 46 citations
- Heterogeneous Forgetting Compensation for Class-Incremental LearningJiahua Dong, Wenqi Liang, Yang Cong, Gan SunICCV 2023 · 28 citations
- Neuron Activation Coverage: Rethinking Out-of-distribution Detection and GeneralizationYibing Liu, Chris Xing Tian, Haoliang Li, Lei Ma et al.ICLR 2024 · 28 citations
- Structural Alignment for Network Pruning through Partial RegularizationShangqian Gao, Zeyu Zhang, Yanfu Zhang, Feihu Huang et al.ICCV 2023 · 26 citations
Builds on23
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Big Self-Supervised Models are Strong Semi-Supervised LearnersTing Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi et al.NeurIPS 2020 · 2,611 citations
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
- Improving robustness against common corruptions by covariate shift adaptationSteffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann et al.NeurIPS 2020 · 688 citations
- Exploring the Limits of Out-of-Distribution DetectionStanislav Fort, Jie Ren, Balaji LakshminarayananNeurIPS 2021 · 443 citations
Related papers
- Fast Decision Boundary based Out-of-Distribution DetectorLitian Liu, Yao QinICML 2024 · 47 citations
- Detecting Out-of-Distribution Through the Lens of Neural CollapseLitian Liu, Yao QinCVPR 2025
- Mahalanobis++: Improving OOD Detection via Feature NormalizationMaximilian Müller, Matthias HeinICML 2025
- Test-Time Linear Out-of-Distribution DetectionKe Fan, Tong Liu, Xingyu Qiu, Yikai Wang et al.CVPR 2024
- Exploiting Discrepancy in Feature Statistic for Out-of-Distribution DetectionXiaoyuan Guan, Jiankang Chen, Shenshen Bu, Yuren Zhou et al.AAAI 2024 · 4 citations
