Mahalanobis++: Improving OOD Detection via Feature Normalization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Mueller, Maximilian, Hein, Matthias
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908376491884544
author Mueller, Maximilian
Hein, Matthias
author_facet Mueller, Maximilian
Hein, Matthias
contents 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 $\ell_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 $\ell_2$-normalization improves the conventional Mahalanobis distance-based approaches significantly and consistently, and outperforms other recently proposed OOD detection methods.
format Preprint
id arxiv_https___arxiv_org_abs_2505_18032
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Mahalanobis++: Improving OOD Detection via Feature Normalization
Mueller, Maximilian
Hein, Matthias
Machine Learning
Computer Vision and Pattern Recognition
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 $\ell_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 $\ell_2$-normalization improves the conventional Mahalanobis distance-based approaches significantly and consistently, and outperforms other recently proposed OOD detection methods.
title Mahalanobis++: Improving OOD Detection via Feature Normalization
topic Machine Learning
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2505.18032