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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 42f60f73-edc6-49d8-931c-a3b5041fbf78Cited 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
