Abstract
Out-of-distribution (OOD) detection is a critical requirement for ensuring the safety and reliability of neural networks in real-world applications. While existing research has identified that In-distribution (ID) samples occupy a low-dimensional subspace in the feature space, the geometric properties of this subspace remain under-explored. Drawing inspiration from the phenomenon of Neural Collapse ($\mathcal{NC}$), we propose a novel OOD scoring function: Entropy-enhanced Principal Angle (EPA). EPA integrates the global geometric characteristics of the ID subspace with its internal class-specific properties. Our extensive experiments demonstrate that EPA achieves state-of-the-art (SOTA) performance and exceptional robustness across various network architectures and OOD benchmarks.
The Challenge of Overconfident Models
Deep learning models are notoriously overconfident, often assigning high-certainty labels to data they have never encountered before. This behavior poses a significant risk in safety-critical domains such as autonomous driving or medical diagnostics. While previous OOD detection methods have utilized distance metrics or softmax statistics, they often fail to capture the principled geometric "signature" of a well-trained model. EPA addresses this by leveraging the predictable geometric evolution of features during training, known as Neural Collapse.
Methodology: Leveraging Neural Collapse
EPA identifies OOD samples by combining two complementary insights derived from the $\mathcal{NC}$ theory:
- Principal Angle (PA) with Origin Shifting: $\mathcal{NC}$ theory suggests that during the final stages of training, features of the same class collapse toward their means, forming a Simplex Equiangular Tight Frame (ETF). We found that ID samples lie within a specific subspace far from a calculated "origin" ($o'$). By shifting the origin based on the model's final layer weights and biases, we calculate the Principal Angle between a test sample and the ID subspace. A larger angle indicates a geometric mismatch with the training data, signaling an OOD sample.
- Entropy Enhancement: While the PA captures global subspace structure, $\mathcal{NC}$ also implies that ID samples should have highly concentrated output probabilities. EPA integrates Softmax Entropy to capture this inner property, handling samples that might be geometrically similar to ID data but lack class-specific confidence.
- Adaptive Scaling: To combine these metrics without manual tuning, we introduce an automated scaling factor ($\beta$) based on training set statistics.
As a post-hoc method, EPA can be applied to existing pre-trained models without the need for retraining or specialized loss functions.
Experimental Results
State-of-the-Art Performance
We evaluated EPA against a rigorous benchmark including ImageNet-1k as the ID set and various OOD datasets like OpenImage-O and Texture. The results across multiple architectures—RepVGG, ResNet-50d, and Swin Transformer—show that EPA consistently outperforms existing SOTA methods like ViM, KNN, and GEN.
On the Swin Transformer, EPA achieved an average AUROC of 96.22%. Notably, EPA significantly reduces the False Positive Rate (FPR@95). For instance, on ResNet-50d, EPA's average FPR@95 was 40.34%, a substantial improvement over ViM (52.61%) and KNN (61.96%).
Robustness to Distribution Shift
To test real-world reliability, we evaluated EPA on ImageNet-C, which contains various image corruptions (e.g., blur, noise) at five levels of severity. EPA maintained the highest AUROC across all corruption levels, indicating that the geometric structure identified by $\mathcal{NC}$ is a fundamental property that persists even when data quality is degraded.
Key Insights and Conclusion
Our ablation studies confirm that the specific components of EPA are vital for its success. Shifting the origin to $o'$ alone provided a 2.36% boost in AUROC and an 8.04% reduction in FPR@95 compared to using a standard global mean. By combining global geometric gating (Principal Angle) with local confidence checks (Entropy), EPA provides a robust and principled framework for OOD detection. This work highlights that the predictable geometric evolution of neural networks is not just a theoretical curiosity but a powerful tool for building safer AI systems.
Summary updated