Understanding and Improving the Role of Projection Head in Self-Supervised Learning

Kartik Gupta, Thalaiyasingam Ajanthan, Anton van den Hengel, Stephen GouldarXiv 2022 · DOI

Introduction

In Self-Supervised Learning (SSL), particularly contrastive frameworks like SimCLR, models are trained to identify that different augmentations (views) of the same image represent the same underlying object. A standard architecture consists of a backbone network, which extracts features, and a projection head (typically a small multi-layer perceptron) appended to the end. Curiously, while the projection head is essential for training, it is discarded for downstream tasks. This "throwaway" nature raises a fundamental question: why is the projection head necessary if its outputs are ultimately unused?

The Projection Head as a Subspace Selector

Researchers have moved beyond observing that the head works to investigating how it works, proposing that it functions as a subspace selector. Rather than just being an extra layer, it identifies which feature dimensions the contrastive loss should emphasize and which it should ignore.

A key finding is the presence of a "rank deficit." The projection head consistently maps high-dimensional backbone features into a lower-rank subspace. As shown in Figure 3, the rank of the vector space spanned by the projection head output ($z$) is significantly lower than that of the backbone output ($h$). This suggests the head acts as a filter, absorbing the noise and "style" variations introduced by aggressive data augmentations. This "null space"—the information the head discards—is often useful for downstream tasks, but removing it during training allows the backbone to learn cleaner, more generalizable "content" features.

Figure 3: Eigenvalue spectra and rank analysis of backbone (h) vs. projection head (z) outputs. The significant rank reduction in z supports the subspace selection hypothesis.

Proposed Method: Adaptive Contrastive Loss

Building on this insight, the authors reformulate SSL as a bilevel optimization problem. Instead of treating the projection head as a static architectural component, they view it as a dynamic, parametric part of the loss function:

  1. Inner Optimization: For every mini-batch, the projection head is optimized to find the best subspace for the contrastive loss for that specific data.
  2. Outer Optimization: The backbone is then updated using the gradient from this newly optimized loss.

To maintain stability and prevent the head from overfitting to a single mini-batch, the authors include a proximal $L_2$ penalty that ensures the head doesn't drift too far from its previous state in a single step.

Experimental Results

The necessity of the projection head is empirically validated across several benchmarks, including CIFAR-10, STL-10, TinyImageNet, and ImageNet. As illustrated in Figure 6, omitting the projection head leads to a dramatic drop in linear evaluation accuracy, particularly on more complex datasets like ImageNet.

Figure 6: Linear evaluation accuracy across various datasets. The inclusion of a projection head (linear or non-linear) significantly boosts performance compared to using no head.

The proposed "Adaptive Contrastive Loss" consistently outperformed standard SimCLR across all tested datasets:

  • CIFAR-10: Achieved 91.97% linear evaluation accuracy (vs. 91.11% for SimCLR).
  • CIFAR-100: Reached 69.12% (vs. 68.01% for SimCLR).
  • TinyImageNet: Jumped to 51.72% (vs. 50.64% for SimCLR).

Crucially, the gains were even more pronounced in K-Nearest Neighbor (KNN) evaluations, with a nearly 2% lead on CIFAR-100 and TinyImageNet, proving that the bilevel approach reaches higher accuracy by optimizing the feature subspace more effectively.

Conclusion and Future Work

This work clarifies the role of the projection head as a critical buffer that manages the trade-off between augmentation invariance and feature quality. While the empirical results are strong, future work remains to provide a formal mathematical proof of why this specific bilevel structure optimizes generalization and to scale the approach to massive datasets like ImageNet-1k, which requires significant computational resources.

Summary updated

BibTeX
@misc{gupta2022understanding,
  author = {Kartik Gupta and Thalaiyasingam Ajanthan and Anton van den Hengel and Stephen Gould},
  title = {{Understanding and Improving the Role of Projection Head in Self-Supervised Learning}},
  year = {2022},
  eprint = {2212.11491},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.11491},
}
Figure