Exploring Simple Siamese Representation Learning

Xinlei Chen, Kaiming He

Abstract

SimSiam (Simple Siamese) is a minimalist framework for self-supervised visual representation learning. It achieves state-of-the-art results without the "bells and whistles" of its predecessors, such as negative image pairs, large batch sizes, or momentum encoders. By employing a simple stop-gradient operation, the model effectively avoids collapsing into trivial solutions. This paper demonstrates that SimSiam can learn meaningful representations that transfer well to various downstream tasks, matching or exceeding more complex methods.

Introduction

In self-supervised learning, Siamese networks are a standard approach for processing two different augmentations (views) of the same image. The objective is to maximize the similarity between the representations of these views. However, a significant challenge in this paradigm is collapsing: the network may converge to a trivial solution where it outputs a constant vector for all inputs, achieving perfect similarity but learning no useful features.

Previous state-of-the-art methods introduced various mechanisms to prevent collapse:

  • SimCLR (Contrastive Learning): Uses negative pairs to push dissimilar images apart.
  • SwAV (Clustering): Constrains representations into distinct clusters.
  • BYOL (Momentum Encoders): Employs a slowly evolving target network.

The authors of SimSiam investigate whether these complex components are truly necessary for learning meaningful visual features.

Methods

The SimSiam architecture is designed for simplicity. It processes two random augmentations of an image, $x_1$ and $x_2$, through a shared encoder network $f$.

The SimSiam architecture featuring a shared encoder, a prediction head $h$, and a critical stop-gradient operation.

The framework relies on two key elements:

  1. The Prediction Head ($h$): A small multi-layer perceptron (MLP) applied to one branch. This asymmetry is hypothesized to help the model predict representations across different augmentations.
  2. Stop-Gradient: Gradients are not back-propagated through one of the branches during the similarity loss calculation. The loss is symmetrized by swapping the branches and averaging the results.

Because weights are shared and no momentum encoders or negative samples are used, SimSiam represents a "bare-bones" Siamese network.

Key Insights: The Role of Stop-Gradient

The most critical finding is the necessity of the stop-gradient operation. Without it, the model collapses immediately to a trivial solution.

Empirical evidence showing that without stop-gradient, the model collapses (zero output std, near-zero accuracy), whereas with stop-gradient, it learns effectively.

The authors propose the EM Hypothesis to explain this behavior. They suggest SimSiam implicitly performs an Expectation-Maximization-like algorithm, alternating between optimizing network weights and finding optimal representations. The stop-gradient operation is a natural implementation of this alternating optimization.

Furthermore, SimSiam is remarkably independent of batch size. Unlike SimCLR, which requires large batches (e.g., 4096) for sufficient negative samples, SimSiam performs well with standard batch sizes (256–512), making it highly accessible.

Results

The quality of representations was evaluated primarily on ImageNet-1K.

  • Linear Evaluation: SimSiam achieves 67.7% top-1 accuracy with 100 epochs of training. At 800 epochs, it reaches 71.3%, outperforming SimCLR.
  • Transfer Learning: On downstream tasks like object detection (PASCAL VOC) and instance segmentation (COCO), SimSiam matches or exceeds the performance of supervised pre-training and more complex self-supervised methods like MoCo v2 and BYOL.
  • Robustness: The method is robust to various Batch Normalization configurations and hyperparameter choices.

Discussion

While SimSiam is powerful, it does not quite reach the peak accuracy of BYOL during very long training runs. The momentum encoder in BYOL likely provides a "smoothing" effect that benefits final convergence, even if it is not strictly necessary to prevent collapse. The EM Hypothesis remains a compelling theoretical framework, though it currently serves as a proof-of-concept rather than a formal proof. Future research may further formalize why this specific architecture avoids the global minimum of a collapsed solution.

Summary updated

BibTeX
@inproceedings{chen2021exploring,
  author = {Xinlei Chen and Kaiming He},
  title = {{Exploring Simple Siamese Representation Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  url = {https://openreview.net/forum?id=yWNMc58aoQ},
}
Figure