MahaVar: OOD Detection via Class-wise Mahalanobis Distance Variance under Neural Collapse
Out-of-distribution (OOD) detection is a critical component for ensuring the reliability of deep neural networks in safety-critical applications. In this work, we present a key empirical observation: for in-distribution (ID) samples, class-wise Mahalanobis distances exhibit a pronounced sharp minimum structure, where the distance to the nearest class is small while distances to all other classes remain large, resulting in high variance across classes. In contrast, OOD samples tend to exhibit a less pronounced sharp minimum structure, producing comparatively lower variance across classes. We further provide a theoretical analysis grounding this observation in Neural Collapse geometry: under relaxed Neural Collapse assumptions on within-class compactness and inter-class separation, ID samples are shown to structurally exhibit high class-wise distance variance, offering a theoretical basis for its use as an OOD score. Motivated by this observation and its theoretical backing, we propose MahaVar, a simple and effective post-hoc OOD detector that augments the Mahalanobis distance with a class-wise distance variance term. Following the OpenOOD v1.5 benchmark protocol, MahaVar achieves state-of-the-art performance on CIFAR-100 and ImageNet, with consistent improvements in both AUROC and FPR@95 over existing Mahalanobis-based methods across all benchmarks.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Why is the Mahalanobis Distance Effective for Anomaly Detection?
The Mahalanobis distance-based confidence score, a recently proposed anomaly detection method for pre-trained neural classifiers, achieves state-of-the-art performance on both out-of-distribution (OoD) and adversarial ex…
Anomaly DetectionGeneral ClassificationMetric LearningOut of Distribution (OOD) DetectionInfinite-dimensional Mahalanobis Distance with Applications to Kernelized Novelty Detection
The Mahalanobis distance is a classical tool used to measure the covariance-adjusted distance between points in $\bbR^d$. In this work, we extend the concept of Mahalanobis distance to separable Banach spaces by reinterp…
Anomaly DetectionNovelty DetectionSemi-supervised Anomaly DetectionSupervised Anomaly Detection+2Semi- supervised Affinity Propagation Clustering Algorithm Based on Mahalanobis Distance
A semi-supervised affinity propagation clustering algorithm based on Mahalanobis distance (SAPBM) is proposed to try to solve some problems, including that the limitations of the distance measurement of the affinity prop…
ClusteringOn the use of Mahalanobis distance for out-of-distribution detection with neural networks for medical imaging
Implementing neural networks for clinical use in medical applications necessitates the ability for the network to detect when input data differs significantly from the training data, with the aim of preventing unreliable…
Out-of-Distribution DetectionOut of Distribution (OOD) DetectionA Simple Fix to Mahalanobis Distance for Improving Near-OOD Detection
Mahalanobis distance (MD) is a simple and popular post-processing method for detecting out-of-distribution (OOD) inputs in neural networks. We analyze its failure modes for near-OOD detection and propose a simple fix cal…
Intent DetectionOut-of-Distribution DetectionOut of Distribution (OOD) Detection