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 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.
7 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
- Out-of-Distribution Detection with Relative Angles cites Energy-based Out-of-distribution Detection
- Out-of-Distribution Detection with Relative Angles cites ReAct: Out-of-distribution Detection With Rectified Activations
- Out-of-Distribution Detection with Relative Angles cites Out-of-Distribution Detection with Deep Nearest Neighbors
- Out-of-Distribution Detection with Relative Angles cites Learning Transferable Visual Models From Natural Language Supervision
- AP-OOD: Attention Pooling for Out-of- Distribution Detection cites Energy-based Out-of-distribution Detection
- AP-OOD: Attention Pooling for Out-of- Distribution Detection cites ReAct: Out-of-distribution Detection With Rectified Activations
- AP-OOD: Attention Pooling for Out-of- Distribution Detection cites Out-of-Distribution Detection with Deep Nearest Neighbors
- ReAct: Out-of-distribution Detection With Rectified Activations cites Energy-based Out-of-distribution Detection
- Out-of-Distribution Detection with Deep Nearest Neighbors cites Energy-based Out-of-distribution Detection
- Out-of-Distribution Detection with Deep Nearest Neighbors cites ReAct: Out-of-distribution Detection With Rectified Activations
- Swin Transformer V2: Scaling Up Capacity and Resolution cites Learning Transferable Visual Models From Natural Language Supervision
Cited 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
