On the Role of the Projector in Contrastive Self-Supervised Learning: Last-Layer Rank Dynamics Drive Representation Quality
Organizations: Hong Kong Baptist University, Hong Kong, China · Indian Institute of Science, Bengaluru, India · Indian Institute of Technology Kharagpur, India · Indian Statistical Institute, Kolkata, India
Abstract
The dimensional collapse of representations in self-supervised contrastive learning is an ever-present issue. One notable technique to prevent such a collapse of representations is using a multi-layered perceptron network called Projector. In several works, the projector has been found to heavily influence the quality of representations learned in a self-supervised contrastive pre-training task. However, the question still lingers. What role does the projector play? Assuming the projector mitigates dimensional collapse, what prevents the terminal layer of the base encoder from functioning as the projector in the absence of an explicit multi-layer perceptron (MLP) head? In this work, we intend to study what happens inside the projector by examining the rank dynamics of the same and the encoder through empirical study and analysis. Through mathematical analysis, we observe that the effect of rank reduction predominantly occurs in the last layer. Motivated by this insight, we propose a weight regularization strategy applied specifically to the last layer. We demonstrate that this targeted approach yields better performance than applying orthogonal weight regularization across the entire network (WeRank), both with and without a projector. Our method improves Top-1 accuracy by more than 1% on SimCLR on the ImageNet100 dataset and consistently outperforms baseline SimCLR variants on CIFAR datasets, supporting our interpretation of the projector's role.
Figures & tables
| Method | ImageNet100 |
|---|---|
| SimCLR (vanilla) w/o Projector | 45.82 |
| SimCLR w/o Proj. + WeRank (Full Enc.) | 44.68 (-1.14) |
| SimCLR w/o Proj. + Wt. Reg. LL (Ours) | 46.82 ( +1.0 ) |
| Method | CIFAR10 | CIFAR100 |
|---|---|---|
| SimCLR (vanilla) | 86.1 | 56.3 |
| SimCLR + WeRank ( Pasand et al., 2024 ) | 86.5 ( +0.4 ) | 56.8 ( +0.5 ) |
| SimCLR + Wt. Reg. LL (Ours) | 86.3 ( +0.2 ) | 57.5 ( +1.2 ) |
| SimCLR (vanilla) w/o Projector | 84.5 | 52.8 |
| SimCLR w/o Proj. + WeRank (Full Enc.) | 84.9 ( +0.4 ) | 52.6 ( -0.2 ) |
| SimCLR w/o Proj. + Wt. Reg. LL (Ours) | 85.1 ( +0.6 ) | 53.1 ( +0.3 ) |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| ine Symbols | What it means |
|---|---|
| ine | Loss function |
| Input | |
| Encoder | |
| output of Encoder | |
| Projector | |
| Output of Projector |
Contrastive Learning
Contrastive learning trains representations by bringing related examples together and separating unrelated ones for recognition, retrieval, and transfer.
See all 326 papers