Whitening for Self-Supervised Representation Learning

Aleksandr Ermolov, Aliaksandr Siarohin, Enver Sangineto, Nicu Sebe

Overview

This paper introduces W-MSE (Whitening Mean Squared Error), a self-supervised learning (SSL) approach that eliminates the need for negative samples or complex asymmetric architectures. By applying a whitening transform to latent features, the model "scatters" representations across a spherical distribution. This prevents the common problem of representation collapse while achieving state-of-the-art performance on standard benchmarks.

The Bottleneck in Current SSL Methods

In self-supervised representation learning, the goal is to train a neural network to extract meaningful features from unlabeled data. Most successful methods currently rely on contrastive learning, where the model learns to bring "positives" (different views of the same image) closer together while pushing "negatives" (views of different images) apart.

However, contrastive learning has a major bottleneck: it requires a massive number of negative samples to be effective, which demands huge batch sizes or complex "memory banks." Newer methods like BYOL and SimSiam avoid negatives but require "asymmetric" tricks—like momentum encoders or stop-gradient operations—to prevent representation collapse (a failure mode where the model outputs the same constant vector for every image). The authors of this paper sought a simpler, more direct way to prevent collapse without needing negatives or architectural gymnastics.

Introducing W-MSE

The authors propose W-MSE, which replaces the contrastive loss with a combination of a whitening operation and a simple Mean Squared Error (MSE) loss.

High-level architecture of W-MSE

The methodology follows a straightforward pipeline:

  1. Positive Pair Generation: Like other SSL methods, an image is taken and multiple augmented versions (positives) are created.
  2. The Whitening Transform: Before calculating the loss, the batch of features is "whitened." This operation transforms the features so they have a zero mean and an identity covariance matrix.
  3. MSE Loss: Once the features are whitened and projected onto a hypersphere, the model simply minimizes the MSE between positive pairs.
  4. Batch Slicing: To make the whitening stable and computationally efficient, the authors introduce "batch slicing," where the whitening matrix is calculated on smaller sub-batches to reduce variance and prevent numerical instability.

The Scattering Effect

Whitening forces the features to be linearly independent and spread out across the latent space. Because the covariance is constrained to be the identity matrix, the model cannot collapse all samples into a single point (which would result in zero variance).

Intuition behind the whitening and scattering effect

Instead of explicitly pushing different images apart (which is what negatives do), whitening imposes a global constraint on the batch. It ensures that, on average, the features are "scattered" enough that they don't overlap unless they are intended to be positives.

Key Insights and Advantages

  • No "Warmup" Required: Unlike methods like BYOL, which start with very low accuracy and require a long "warmup" period to stabilize the momentum encoder, W-MSE performs well from the very first epochs.
  • Simplicity is Key: W-MSE uses a standard Siamese network (shared weights for both branches) and doesn't require the stop-gradient or predictor-head tricks found in SimSiam.
  • Multiple Positives: Because W-MSE doesn't need space in the batch for negatives, it can easily incorporate more than two views of the same image (e.g., $d=4$ positives), which significantly boosts performance.

Performance and Results

The authors evaluated W-MSE across a wide range of standard computer vision benchmarks, demonstrating highly competitive results:

  • ImageNet-100: Using a ResNet-18, W-MSE with 4 positive views achieved 79.02% top-1 accuracy, significantly outperforming MoCo (72.80%) and other specialized losses like $\mathcal{L}_{align}$ and $\mathcal{L}_{uniform}$.
  • Full ImageNet: With a ResNet-50, W-MSE reached 72.56% top-1 accuracy after 400 epochs. This makes it highly competitive with state-of-the-art methods like BYOL (73.2%) and SimSiam (70.8%), despite being conceptually simpler.
  • Small Datasets: On CIFAR-10 and CIFAR-100, W-MSE consistently outperformed SimCLR and BYOL, showing that the whitening constraint is particularly robust when data is limited.

Limitations and Future Work

While highly effective, W-MSE does have some constraints. The whitening operation requires a batch size large enough to produce a stable estimate of the covariance matrix. If the batch is too small relative to the feature dimension, the Cholesky decomposition used for whitening can become unstable.

Interestingly, the authors found that combining whitening with a standard contrastive loss actually hurt performance. Whitening seems to be a complete alternative to negative-based contrasting, rather than a complementary tool. Future directions suggest exploring the combination of whitening with asymmetric architectures or investigating its use in other domains, such as NLP or Reinforcement Learning.

Summary updated

BibTeX
@inproceedings{ermolov2021whitening,
  author = {Aleksandr Ermolov and Aliaksandr Siarohin and Enver Sangineto and Nicu Sebe},
  title = {{Whitening for Self-Supervised Representation Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=JXJNLC8mgvHF},
}
Figure