NeurIPS 2026QuestionsPapersAreasAboutMarkdown

MahaVar: OOD Detection via Class-wise Mahalanobis Distance Variance under Neural Collapse

Dong Hwan Kim, Hyunsoo Yoon

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Graphs, OOD Detection & Medical Imaging › Out-Distribution Detection Methods · Type: new method · Keywords: OOD detection, Mahalanobis distance, Neural Collapse, variance, post-hoc detection

Areas: Safety & Security › Adversarial Security › Out-of-Distribution Detection

Summary

MahaVar introduces a post-hoc OOD detector that augments Mahalanobis distance with class-wise distance variance, leveraging the high variance of ID samples under Neural Collapse.

Explained to a 5-year-old

Computers compare new things to many examples they know. If the thing matches one example very well and not others, it is familiar. If it matches none well, it is new. The new idea looks at how far each guess is from different groups of examples. Familiar things have guesses that vary a lot, while new things have guesses that are more similar. This helps the computer say when it has seen something it does not know, making it safer to use.

Explained to a 5-year-old, longer

When we ask a computer to recognize something, it compares it to many examples it has learned. If the thing is something it has seen before, it will match one of those examples very well. If the thing is completely new, it might not match any example very well. The new idea looks at how far each guess is from each group of examples. For familiar things, the distances to the groups are very different - one is tiny, the others are big. For new things, the distances are more similar, none is especially tiny. By checking how different these distances are, we can tell if the thing is familiar or not. This difference is called variance, and it helps us spot out-of-distribution items. The method uses a simple rule: high variance means the item is likely from what the computer knows. Low variance means the item might be something the computer has never seen. This makes the computer more careful, especially in important tasks like driving or medical diagnosis. Overall, it gives a safer way for computers to decide what they understand and what they don’t.

For a technical reader

The paper observes that in-distribution samples produce class-wise Mahalanobis distances with a sharp minimum to the correct class and large distances to others, creating high variance across classes. Out-of-distribution samples lack this sharp pattern, resulting in more uniform distances and lower variance. Leveraging Neural Collapse theory, the authors prove that under relaxed assumptions ID data naturally exhibits high variance, providing a solid justification for using variance as an OOD score. The proposed post-hoc detector simply adds a variance term to the classic Mahalanobis distance, yielding a single scalar score per input. Evaluated on OpenOOD v1.5 with CIFAR-100 and ImageNet, the approach consistently improves AUROC and FPR@95 over existing Mahalanobis-based baselines.

Problem

Detecting out-of-distribution samples is essential for ensuring deep neural networks behave reliably in safety-critical settings, but existing methods often struggle to distinguish OOD from ID data.

Method

The approach computes class-wise Mahalanobis distances for each sample and adds a variance term that captures the spread of these distances across classes, using theoretical insights from Neural Collapse to justify high variance for ID samples.

Results

The approach yields state-of-the-art AUROC and FPR@95 scores on CIFAR-100 and ImageNet, outperforming existing Mahalanobis-based detectors.

Contributions

The paper provides an empirical observation that ID samples exhibit high class-wise Mahalanobis distance variance, a theoretical analysis linking this to Neural Collapse, and a post-hoc OOD detector that leverages this variance.

Limitations and assumptions

The analysis relies on relaxed Neural Collapse assumptions and may not hold for all model configurations.

Practical relevance

The method improves reliability of deep neural networks in safety-critical applications by providing a simple post-hoc OOD detector.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction