Mahalanobis++: Improving OOD Detection via Feature Normalization
Maximilian Müller, Matthias Hein
Abstract
Detecting out-of-distribution (OOD) examples is an important task for deploying reliable machine learning models in safety-critial applications. While post-hoc methods based on the Mahalanobis distance applied to pre-logit features are among the most effective for ImageNet-scale OOD detection, their performance varies significantly across models. We connect this inconsistency to strong variations in feature norms, indicating severe violations of the Gaussian assumption underlying the Mahalanobis distance estimation. We show that simple ℓ 2 -normalization of the features mitigates this problem effectively, aligning better with the premise of normally distributed data with shared covariance matrix. Extensive experiments on 44 models across diverse architectures and pretraining schemes show that ℓ 2 -normalization improves the conventional Mahalanobis distance-based approaches significantly and consistently, and outperforms other recently proposed OOD detection methods. Code is available at github.com/mueller-mp/maha-norm.
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 87ad4d49-b0ab-4e49-a80f-38067e7ea9a8Cited by top-tier papers7
- Out-of-Distribution Detection with Relative AnglesBerker Demirel, Marco Fumero, Francesco LocatelloNeurIPS 2025 · 3 citations
- A Geometry-Based View of Mahalanobis OOD DetectionDenis Janiak, Jakub Binkowski, Tomasz KajdanowiczICML 2026 · 3 citations
- AP-OOD: Attention Pooling for Out-of- Distribution DetectionClaus Hofmann, Christian Huber, Bernhard Lehner, Daniel Klotz et al.ICLR 2026 · 2 citations
- CANDI: Curated Test-Time Adaptation for Multivariate Time-Series Anomaly Detection Under Distribution ShiftHyunGi Kim, Jisoo Mok, Hyungyu Lee, Juhyeon Shin et al.AAAI 2026
- SUE: Sparsity-based Uncertainty Estimation via Sparse Dictionary LearningTamás Ficsor, Gábor BerendEMNLP 2025
Builds on21
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
- Swin Transformer V2: Scaling Up Capacity and ResolutionZe Liu, Han Hu, Yutong Lin, Zhuliang Yao et al.CVPR 2022 · 2,138 citations
- Out-of-Distribution Detection with Deep Nearest NeighborsYiyou Sun, Yifei Ming, Xiaojin Zhu, Yixuan LiICML 2022 · 789 citations
- ReAct: Out-of-distribution Detection With Rectified ActivationsYiyou Sun, Chuan Guo, Yixuan LiNeurIPS 2021 · 733 citations
Related papers
- Simple and Effective Out-of-Distribution Detection via Cosine-based Softmax LossSoonCheol Noh, DongEon Jeong, Jee-Hyong LeeICCV 2023 · 6 citations
- Mitigating Neural Network Overconfidence with Logit NormalizationHongxin Wei, Renchunzi Xie, Hao Cheng, Lei Feng et al.ICML 2022 · 386 citations
- Enhancing Out-of-Distribution Detection with Extended Logit NormalizationYifan Ding, Xixi Liu, Jonas Unger, Gabriel EilertsenCVPR 2026 · 4 citations
- Igeood: An Information Geometry Approach to Out-of-Distribution DetectionEduardo Dadalto Câmara Gomes, Florence Alberge, Pierre Duhamel, Pablo PiantanidaICLR 2022 · 32 citations
- Neural Mean Discrepancy for Efficient Out-of-Distribution DetectionXin Dong, Junfeng Guo, Ang Li, Wei-Te Ting et al.CVPR 2022 · 40 citations
