Abstract
Supervised contrastive loss (SCL) is a competitive and often superior alternative to the cross-entropy loss for classification. While prior studies have demonstrated that both losses yield symmetric training representations under balanced data, this symmetry breaks under class imbalances. This paper presents an intriguing discovery: the introduction of a ReLU activation at the final layer effectively restores the symmetry in SCL-learned representations. We arrive at this finding analytically, by establishing that the global minimizers of an unconstrained features model with SCL loss and entry-wise non-negativity constraints form an orthogonal frame. Extensive experiments conducted across various datasets, architectures, and imbalance scenarios corroborate our finding. Importantly, our experiments reveal that the inclusion of the ReLU activation restores symmetry without compromising test accuracy. This constitutes the first geometry characterization of SCL under imbalances. Additionally, our analysis and experiments underscore the pivotal role of batch selection strategies in representation geometry. By proving necessary and sufficient conditions for mini-batch choices that ensure invariant symmetric representations, we introduce batch-binding as an efficient strategy that guarantees these conditions hold.
Introduction
In the study of deep neural networks, "Neural Collapse" (NC) describes a phenomenon where, during the terminal phase of training, the features of different classes converge to a perfectly symmetric geometric structure known as a Simplex Equiangular Tight Frame (ETF). In this state, the network has learned to maximize the separation between class representations, ensuring equal angles between them.
However, this geometric elegance is typically fragile, holding only for balanced datasets. In real-world applications, class imbalance is prevalent, causing this symmetry to distort. Such distortion often correlates with degraded generalization performance. While Supervised Contrastive Loss (SCL) has emerged as a robust alternative to standard Cross-Entropy (CE), it remains susceptible to geometric collapse under skew. This work investigates a simple yet effective architectural modification—the addition of a ReLU activation layer—to restore symmetry in SCL-learned representations even under extreme imbalance.
Methods: ReLU and Batch-Binding
The researchers approach the problem by refining the theoretical Unconstrained Features Model (UFM). By introducing a non-negativity constraint ($H \ge 0$) to represent a final-layer ReLU activation, they define the UFM+.
The Orthogonal Frame (OF)
Mathematically, the authors prove that for SCL with this non-negativity constraint, the global minimizers form an Orthogonal Frame (OF). In an OF, class means are mutually orthogonal and have equal norms. Crucially, this structure remains stable regardless of the degree of class imbalance. While a centered OF is equivalent to a Simplex ETF in balanced settings, the OF provides a more resilient geometric target when data is skewed.
Batch-Binding Strategy
Beyond architecture, the paper identifies that the learned geometry is highly sensitive to mini-batch selection. If mini-batches do not sufficiently "connect" different classes, the representation geometry can drift. To address this, the authors introduce batch-binding: a strategy where a small set of "binding examples" (one from every class) is included in every mini-batch. This ensures the Batch Interaction Graph remains connected, guaranteeing convergence to the unique global symmetry.
Results: Restoring Symmetry and Performance
The findings were validated across standard benchmarks, including MNIST, CIFAR-10, CIFAR-100, and Tiny ImageNet, using both "Step" and "Long-tail" (LT) imbalance distributions.
Symmetry Restoration
Visualizing the Gram matrices of learned representations provides clear evidence of symmetry restoration. As shown in Figure 1, vanilla SCL and CE exhibit significant off-diagonal noise and distortion as the imbalance ratio ($R$) increases. In contrast, the SCL + ReLU combination maintains a nearly perfect diagonal structure, indicating that the class means remain orthogonal even at an imbalance ratio of 100.
Performance and Convergence
A critical concern with adding constraints like ReLU is the potential impact on accuracy. However, empirical results demonstrate that restoring geometric symmetry does not come at a performance cost. In fact, for the most challenging scenarios, such as CIFAR-100 with a long-tail distribution and an imbalance ratio of 100, the SCL + ReLU model improved test accuracy from 37.19% to 39.71%.
Furthermore, the batch-binding strategy was found to significantly stabilize and accelerate convergence to the Orthogonal Frame geometry, particularly in architectures with lower capacity, such as DenseNet-40.
Conclusion
This work provides the first geometric characterization of Supervised Contrastive Loss under class imbalance. By demonstrating that a simple ReLU activation can restore representation symmetry without sacrificing accuracy, the authors offer a practical tool for improving imbalanced learning. Additionally, the introduction of batch-binding highlights the often-overlooked importance of batching strategies in shaping the geometric properties of deep learning models. Future research may explore the implications of these findings in over-parameterized regimes where the feature dimension is smaller than the number of classes, as well as the potential for similar architectural interventions in other contrastive learning frameworks.
Summary updated