SiT: Self-supervised vIsion Transformer

Sara Atito Ali Ahmed, Muhammad Awais, Josef Kittler

Abstract

Vision Transformers (ViTs) have revolutionized computer vision but are notoriously "data-hungry," often requiring massive labeled datasets to overcome their lack of inherent inductive biases. We present SiT (Self-supervised vIsion Transformer), a framework that leverages Group Masked Model Learning (GMML) and contrastive objectives to enable ViTs to excel on small-to-medium datasets. By combining reconstruction and contrastive tasks, SiT allows ViTs to outperform supervised models and state-of-the-art self-supervised methods across a diverse range of benchmarks, effectively making transformers a viable choice for data-constrained scenarios.

Introduction

While Convolutional Neural Networks (CNNs) possess built-in properties like translation invariance, Vision Transformers (ViTs) lack these inductive biases. Consequently, standard ViTs typically require gargantuan amounts of labeled data (e.g., ImageNet-21k or JFT-300M) to learn useful representations. This requirement makes them impractical for researchers working with niche or small-scale datasets.

SiT addresses this "data hunger" by introducing a self-supervised pretraining (SSP) strategy that teaches the model the underlying visual integrity of images. By forcing the model to reconstruct corrupted inputs and maintain global consistency, SiT imparts the necessary structural understanding that ViTs otherwise lack.

Methodology

The core of the SiT framework is the Group Masked Model Learning (GMML) task. Unlike previous approaches that might mask individual random pixels, SiT masks connected groups of patches—covering up to 70% of the image. This prevents the model from "cheating" by interpolating from immediate neighbors and forces it to understand global context.

SiT Architecture Overview

Architecture Components

  1. The Backbone: A standard Vision Transformer that processes image patches as a sequence of tokens.
  2. The Reconstruction Head: A lightweight 2-layer MLP decoder. Unlike models that use heavy transformer decoders for reconstruction, SiT demonstrates that the ViT backbone itself can perform the heavy lifting of spatial reasoning.
  3. The Contrastive Head: Drawing from SimCLR, this head ensures that different augmented views of the same image result in similar latent representations, maintaining global semantic consistency.

Training Objectives

The model is trained using a multi-task loss function. An $L_1$ reconstruction loss is used to recover masked or corrupted pixels (such as those replaced by noise or "alien" patches from other images). Simultaneously, a contrastive loss ensures that the model learns high-level features that are invariant to local corruptions.

Experimental Results

SiT was evaluated across a wide variety of benchmarks, including small/medium multi-class datasets (Flowers, Pets, CUB200, Cars) and large-scale multi-label datasets (MS-COCO).

Performance Gains

SiT consistently outperformed supervised pretraining (SP) on small datasets, often by margins of 1-4%. On the "Cars" dataset, SiT achieved a massive +64.7% improvement over a model trained from scratch. In transfer learning tasks, SiT showed superior performance compared to other self-supervised methods like MoCo-v3 and DINO, notably achieving a +11.8% gain on CUB200 over MoCo-v3.

Qualitative Reconstruction Results

Qualitative Analysis

Visualizations of the reconstruction task demonstrate the model's ability to recover complex structures. Whether dealing with training samples, testing samples, or out-of-distribution images from the internet, the model successfully restores the global integrity of the bird species and backgrounds, proving that it has learned robust visual features rather than just memorizing the training set.

Conclusion

SiT demonstrates that self-supervised pretraining can effectively replace the need for massive labeled datasets in Vision Transformers. By utilizing GMML and a dual-head architecture, SiT provides a flexible and efficient way to train ViTs for a broad range of downstream tasks. Future work will focus on extending this framework to dense prediction tasks like object detection and semantic segmentation to further validate its versatility.

Summary updated

BibTeX
@misc{ahmed2021sit,
  author = {Sara Atito Ali Ahmed and Muhammad Awais and Josef Kittler},
  title = {{SiT: Self-supervised vIsion Transformer}},
  year = {2021},
  eprint = {2104.03602},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.03602},
}
Figure