EPA: Neural Collapse Inspired Robust Out-of-Distribution Detector
Jiawei Zhang, Yufan Chen, Cheng Jin, Lei Zhu, Yuantao Gu
TL;DR
This work tackles robust out-of-distribution detection by exploiting Neural Collapse to reveal both global subspace structure and inner-subspace concentration in in-distribution features. It introduces the Entropy-enhanced Principal Angle (EPA) score, which fuses the Principal Angle ($PA$) between a test feature and the ID subspace with the softmax entropy ($H$) of classifier outputs, and uses a training-set–dependent scaling factor $\beta$ to balance the two components. The method is grounded in clear NC-derived insights and explicitly computes a subspace projection based on a training subset, enabling a practical post-hoc detector that adapts to data. Empirical results across CNN and Transformer backbones and multiple OOD benchmarks demonstrate EPA’s strong performance and robustness, with ablations confirming the contributions of $PA$, entropy, and feature biasing. This NC-informed perspective offers a principled path to more reliable OOD detection in real-world deployments.
Abstract
Out-of-distribution (OOD) detection plays a crucial role in ensuring the security of neural networks. Existing works have leveraged the fact that In-distribution (ID) samples form a subspace in the feature space, achieving state-of-the-art (SOTA) performance. However, the comprehensive characteristics of the ID subspace still leave under-explored. Recently, the discovery of Neural Collapse ($\mathcal{NC}$) sheds light on novel properties of the ID subspace. Leveraging insight from $\mathcal{NC}$, we observe that the Principal Angle between the features and the ID feature subspace forms a superior representation for measuring the likelihood of OOD. Building upon this observation, we propose a novel $\mathcal{NC}$-inspired OOD scoring function, named Entropy-enhanced Principal Angle (EPA), which integrates both the global characteristic of the ID subspace and its inner property. We experimentally compare EPA with various SOTA approaches, validating its superior performance and robustness across different network architectures and OOD datasets.
