Symmetric Neural-Collapse Representations with Supervised Contrastive Loss: The Impact of ReLU and Batching

Ganesh Ramachandra Kini, Vala Vakilian, Tina Behnia, Jaidev Gill, Christos Thrampoulidis

TL;DR

Researchers have discovered that simply adding a ReLU activation to the final layer of a neural network prevents class imbalance from distorting its internal representations when using Supervised Contrastive Loss (SCL). By combining this "ReLU trick" with a novel "batch-binding" strategy, they ensure that models learn perfectly symmetric, orthogonal features regardless of how lopsided the training data is.

The Problem: Fragile Symmetry in Neural Collapse

In the final stages of training, deep neural networks often exhibit a fascinating phenomenon called Neural Collapse (NC). Essentially, the mathematical representations (embeddings) for all images belonging to a single class "collapse" into a single point. Ideally, these class points arrange themselves in a perfectly symmetric shape called a Simplex Equiangular Tight Frame (ETF)—think of it as the most spread-out, balanced geometry possible.

However, this beautiful symmetry is fragile. When a dataset is imbalanced (e.g., you have 1,000 images of cats but only 10 of dogs), the symmetry breaks. The "majority" classes dominate the geometry, squashing the "minority" classes into the corners. This distortion is particularly problematic for Supervised Contrastive Loss (SCL), a popular and often superior alternative to standard Cross-Entropy loss.

This paper asks a critical question: Can we force the network to maintain its symmetric geometry even when the data is heavily imbalanced?

Methods: The UFM+ Model and Batch-Binding

The authors tackle this challenge using both mathematical theory and rigorous experimentation:

  1. The UFM+ Model: They utilize the "Unconstrained Features Model" (UFM), a theoretical framework that treats the last layer's features as free variables. They refine this into UFM+ by adding a non-negativity constraint, which mathematically represents the effect of a ReLU activation at the final layer.
  2. Theoretical Proof: They prove analytically that the global minimizer for SCL with this non-negativity constraint is an Orthogonal Frame (OF). In this geometry, every class mean is at an exact 90-degree angle to every other class mean, with equal lengths.
  3. Batch-Binding: Contrastive loss works by comparing pairs of samples within a mini-batch. The authors found that standard random shuffling often fails to provide the necessary "interactions" for minority classes. To fix this, they introduce batch-binding, a strategy where a small set of "binding examples" (one from every class) is added to every single mini-batch to guarantee consistent geometric convergence.

Key Insights and Ideas

  • ReLU as a Geometric Anchor: We usually think of ReLU as just a way to introduce non-linearity. Here, it acts as a strict geometric constraint. By forcing features to be non-negative, it effectively "walls off" parts of the mathematical space, forcing the SCL loss to find a symmetric, orthogonal solution that it otherwise would have ignored under imbalance.
  • Orthogonality over Simplexes: While balanced data usually leads to an ETF (where angles are slightly greater than 90°), the introduction of ReLU shifts the "ideal" state to an Orthogonal Frame (exactly 90°). This OF geometry is remarkably robust; it doesn't care about the imbalance ratio.
  • The Batching Bottleneck: The paper reveals that SCL's failure to converge in imbalanced settings isn't just about the loss function—it's about the mini-batching. If a minority class rarely "sees" other classes in the same batch, it cannot learn its proper place in the global geometry. Batch-binding solves this by ensuring every class is always "represented" in the conversation.

Key Results

Class-mean correlation heatmaps comparing SCL + ReLU, SCL, and Cross-Entropy (CE) across different imbalance ratios (R). Notice how SCL + ReLU maintains a perfect diagonal (orthogonality) even at R=100.
  • Symmetry Restored: Experimental heatmaps of class-mean correlations (shown above) clearly demonstrate the impact of the ReLU trick. While standard SCL and Cross-Entropy (CE) become a messy blur under high imbalance ($R=100$), SCL+ReLU maintains a clean, sharp diagonal—the hallmark of a perfect Orthogonal Frame.
  • No Accuracy Trade-off: Crucially, adding ReLU to restore symmetry does not hurt test accuracy. In fact, for many imbalanced scenarios on CIFAR-100 and Tiny ImageNet, SCL+ReLU outperformed vanilla SCL and Cross-Entropy.
  • Faster Convergence: Using the batch-binding strategy allowed models to reach the symmetric "collapsed" state significantly faster than random shuffling, especially for complex datasets like CIFAR-100.

Limitations and Future Work

  • The UFM Assumption: The theoretical proofs rely on the Unconstrained Features Model, which assumes the network is powerful enough to produce any feature vector. While experiments show this holds for real-world ResNets, the theory doesn't explicitly account for the architectural constraints of shallower or highly regularized networks.
  • Feature Dimensionality: The study assumes the embedding dimension ($d$) is greater than the number of classes ($k$). The authors note that the "collapsed" geometry might change significantly in "over-complete" settings where $d < k$.
  • Generalization Link: While the paper proves how to restore symmetry, the deep underlying reason why symmetric training representations lead to better test-time generalization is still a "holy grail" question in deep learning theory that remains partially open.

Summary updated

BibTeX
@inproceedings{kini2024symmetric,
  author = {Ganesh Ramachandra Kini and Vala Vakilian and Tina Behnia and Jaidev Gill and Christos Thrampoulidis},
  title = {{Symmetric Neural-Collapse Representations with Supervised Contrastive Loss: The Impact of ReLU and Batching}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=AyXIDfvYg8},
}
Figure