Controlling Neural Collapse Enhances Out-of-Distribution Detection and Transfer Learning

Md Yousuf Harun, Jhair Gallardo, Christopher Kanan
2/14/2026

No official code found. Best implementation: yousuf907/NC-OOD (6 stars, MIT, last commit 2025-07-22).

Abstract

Out-of-distribution (OOD) detection and OOD generalization are widely studied in Deep Neural Networks (DNNs), yet their relationship remains poorly understood. We empirically show that the degree of Neural Collapse (NC) in a network layer is inversely related with these objectives: stronger NC improves OOD detection but degrades generalization, while weaker NC enhances generalization at the cost of detection. This trade-off suggests that a single feature space cannot simultaneously achieve both tasks. To address this, we develop a theoretical framework linking NC to OOD detection and generalization. We show that entropy regularization mitigates NC to improve generalization, while a fixed Simplex Equiangular Tight Frame (ETF) projector enforces NC for better detection. Based on these insights, we propose a method to control NC at different DNN layers. In experiments, our method excels at both tasks across OOD datasets and DNN architectures. Code for our experiments is available at: https://yousuf907.github.io/ncoodg

View on arXivView PDF

Code Implementations(1)

yousuf907/NC-OODCommunity66%
MIT

Source Code for Our ICML-2025 Paper "Controlling Neural Collapse Enhances Out-of-Distribution Detection and Transfer Learning"

60Shell, PythonMay 12, 20251 years agoMIT
continual-learningforward-transferneural-collapseood-detectionood-generalization+4 more

Similar Papers

Cite this paper

@article{harun2026controlling,
  title  = {Controlling Neural Collapse Enhances Out-of-Distribution Detection and Transfer Learning},
  author = {Md Yousuf Harun and Jhair Gallardo and Christopher Kanan},
  year   = {2026},
  eprint = {2502.10691},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2502.10691},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.10691.svg)](https://codeofpaper.com/paper/2502.10691)

Discussion