Skip to main content
QUICK REVIEW

[Paper Review] NECO: NEural Collapse Based Out-of-distribution detection

Mouïn Ben Ammar, Nacim Belkhir|arXiv (Cornell University)|Oct 10, 2023
Adversarial Robustness in Machine LearningComputer Science3 citations
TL;DR

NECO is a novel post-hoc out-of-distribution (OOD) detection method that leverages neural collapse properties—specifically, the geometric collapse of in-distribution features into a simplex equiangular tight frame (ETF) and the emerging orthogonality between in-distribution and out-of-distribution data. By measuring the relative norm of a sample within the ETF subspace, NECO achieves state-of-the-art performance across diverse architectures and benchmarks, with strong generalization and theoretical justification.

ABSTRACT

Detecting out-of-distribution (OOD) data is a critical challenge in machine learning due to model overconfidence, often without awareness of their epistemological limits. We hypothesize that ``neural collapse'', a phenomenon affecting in-distribution data for models trained beyond loss convergence, also influences OOD data. To benefit from this interplay, we introduce NECO, a novel post-hoc method for OOD detection, which leverages the geometric properties of ``neural collapse'' and of principal component spaces to identify OOD data. Our extensive experiments demonstrate that NECO achieves state-of-the-art results on both small and large-scale OOD detection tasks while exhibiting strong generalization capabilities across different network architectures. Furthermore, we provide a theoretical explanation for the effectiveness of our method in OOD detection. Code is available at https://gitlab.com/drti/neco

Motivation & Objective

  • To address the critical challenge of out-of-distribution (OOD) detection in deep neural networks, where models remain overconfident on OOD inputs.
  • To investigate whether neural collapse phenomena, typically observed in in-distribution data during late training, also manifest in OOD data and can be exploited for detection.
  • To develop a post-hoc OOD detection method that is architecture-agnostic, efficient, and does not require retraining or additional data.
  • To provide a theoretical foundation for the effectiveness of the proposed method based on geometric properties of neural collapse.

Proposed method

  • The method computes a score based on the relative norm of a sample's feature vector within the subspace spanned by the in-distribution class means, which form a Simplex Equiangular Tight Frame (ETF) under neural collapse.
  • It normalizes the norm of the feature vector within the ETF subspace by the total norm of the feature vector, creating a scalar OOD score.
  • The approach exploits the observed ID/OOD orthogonality (NC5), where OOD samples become increasingly orthogonal to the ETF structure as training progresses.
  • The method is post-hoc: it uses a pre-trained model without fine-tuning or additional data, relying only on the penultimate layer features.
  • The score is derived from geometric properties of neural collapse, particularly the convergence of class means to an ETF and the simplification to nearest class-center classification.
  • The method is invariant to model architecture and hyperparameter tuning, enabling broad generalization across models like ViT, Swin, and ResNet.
Figure 1: Convergence to ID/OOD orthogonality for ViT-B (left), Resnet-18 (right) both trained on CIFAR-10 as ID and tested in the presence of OOD data. Dashed purple lines indicate the end of warm-up steps in the case of ViT and learning rate decay epochs for ResNet-18.
Figure 1: Convergence to ID/OOD orthogonality for ViT-B (left), Resnet-18 (right) both trained on CIFAR-10 as ID and tested in the presence of OOD data. Dashed purple lines indicate the end of warm-up steps in the case of ViT and learning rate decay epochs for ResNet-18.

Experimental results

Research questions

  • RQ1Does the neural collapse phenomenon extend to out-of-distribution data, and can it be leveraged for OOD detection?
  • RQ2Can the geometric orthogonality between in-distribution and out-of-distribution features—observed during late training—be used as a reliable OOD signal?
  • RQ3How does NECO compare to existing post-hoc OOD detection methods in terms of performance and generalization across architectures?
  • RQ4What is the theoretical basis for the effectiveness of NECO in distinguishing OOD samples based on neural collapse geometry?

Key findings

  • NECO achieves state-of-the-art performance on the openOOD benchmark, outperforming 18 baseline methods on ImageNet-1K with a mean AUROC of 75.94% and FPR95 of 65.55% across multiple OOD datasets and architectures.
  • On the CIFAR-10/CIFAR-100 benchmark, NECO achieves near-perfect separation (AUROC > 89.5) when detecting SVHN as OOD with ViT-B/16, demonstrating strong discriminative power.
  • The method generalizes well across architectures: ViT-B/16 achieves the highest performance, suggesting it exhibits stronger neural collapse, which correlates with better OOD detection.
  • NECO shows consistent performance across diverse OOD benchmarks, including ImageNet-R, ImageNet-C, Textures, and iNaturalist, with AUROC values above 80% on several combinations.
  • The NECO score distribution shows clear separation between in-distribution and out-of-distribution samples in many settings, especially with ViT models, validating the method’s discriminative capability.
  • Theoretical analysis confirms that NECO’s effectiveness stems from the geometric collapse of in-distribution features and the emerging orthogonality of OOD data to the ETF subspace.
Figure 2: Feature projections on the first 2 principal components of a PCA fitted on CIFAR-10 (ID) using the ViT penultimate layer representation. OOD data are ImageNet-O (left), Textures (middle) and SVHN (right) . The Figure shows how NC1( 1 ) property is satisfied by ID data, and that OOD data li
Figure 2: Feature projections on the first 2 principal components of a PCA fitted on CIFAR-10 (ID) using the ViT penultimate layer representation. OOD data are ImageNet-O (left), Textures (middle) and SVHN (right) . The Figure shows how NC1( 1 ) property is satisfied by ID data, and that OOD data li

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.