SiT: Self-supervised vIsion Transformer

Sara Atito, Muhammad Awais, Josef Kittler

TL;DR

SiT (Self-supervised vIsion Transformer) is a novel framework that enables Vision Transformers (ViTs) to overcome their notorious "data-hungry" nature. By combining a new "Group Masked Model Learning" (GMML) approach with contrastive learning, SiT allows ViTs to be pretrained effectively on small-to-medium datasets, often outperforming supervised pretraining for the first time in this domain.

What Problem Does This Paper Address?

Vision Transformers have taken the computer vision world by storm, but they come with a significant catch: they typically require massive amounts of labeled data (like ImageNet-21K) to perform well. Unlike Convolutional Neural Networks (CNNs), ViTs lack "inductive biases"—built-in assumptions about the local structure of images—making them difficult to train from scratch on smaller datasets.

While the NLP community has successfully used self-supervised pretraining (like BERT) to train massive models on unlabeled text, finding a similarly effective "pretext task" for vision has been challenging. The authors of SiT aimed to bridge this gap, creating a self-supervised method that makes ViTs practical for researchers who don't have access to millions of labeled images.

Methods

The core of the paper is the Self-supervised vIsion Transformer (SiT), which treats the transformer as a flexible autoencoder. The architecture, shown in Figure 1, employs two main self-supervised tasks simultaneously:

  1. Group Masked Model Learning (GMML): Inspired by BERT's masked language modeling, but adapted for images. Instead of masking random individual patches, SiT masks groups of connected patches (up to 70% of the image). The model must then reconstruct these missing regions based on the surrounding context.
  2. Contrastive Learning: Following the SimCLR approach, the model is trained to ensure that two different augmented views of the same image have similar representations in the embedding space, while views of different images are pushed apart.
Fig. 1: Self-supervised vIsion Transformer (SiT)

A key architectural innovation is the use of a lightweight decoder (just a 2-layer MLP and a transposed convolution) for the reconstruction task. This is possible because the transformer's global attention mechanism already does the heavy lifting of integrating contextual information, unlike CNN-based autoencoders that require deep, complex decoders.

Datasets

The authors evaluated SiT across a wide range of scales to prove its versatility:

  • Small/Medium Scale (Multi-class): Flowers, Pets, STL10, CUB200, Aircraft, Cars, CIFAR10, and CIFAR100.
  • Large Scale: ImageNet-1K.
  • Multi-label: Pascal VOC, MS-COCO, and Visual-Genome.
  • Video: DAVIS-2017 for instance segmentation.

The full statistics of these datasets are detailed in the table below: Table 1: Statistics of the multi-class and multi-label datasets used for evaluation.

Key Insights and Ideas

  • Spatial Context Matters: Masking single patches in an image is often too easy for a model because neighboring pixels are highly correlated. By masking groups of patches, SiT forces the model to learn higher-level semantic concepts to fill in the blanks.
  • ViTs as Natural Autoencoders: The paper demonstrates that ViTs are inherently suited for reconstruction tasks. Their ability to capture global dependencies allows them to "see" the whole image at once, making a heavy decoder unnecessary.
  • Breaking the Data Barrier: The most significant "aha" moment is that self-supervised pretraining can actually make ViTs less data-hungry than CNNs. By learning local statistical correlations through GMML, the model acquires the inductive bias it was originally missing.
  • Multi-task Synergy: Combining reconstruction (local focus) and contrastive learning (global focus) provides a more robust representation than either task alone.

Key Results

SiT achieved state-of-the-art results across multiple benchmarks:

  • Outperforming Supervised Learning: On small datasets, SiT pretraining followed by finetuning consistently beat training from scratch and even outperformed supervised pretraining in many cases. For example, on the Cars dataset, it improved accuracy by a staggering 64.7% over random initialization.
  • Superior to Concurrent SSL: SiT outperformed other popular self-supervised methods like MoCo-v3 and DINO on small-to-medium datasets by margins ranging from +0.8% to +11.8%.
  • Robust Reconstruction: As seen in Figure 2, the model can plausibly reconstruct images even when large portions are corrupted or replaced with noise, demonstrating a deep understanding of visual integrity.
Fig. 2: Reconstructed images from our trained SiT model. The images are randomly obtained from (a) Training data, (b) Test data, and (c) From the internet. Each row refers to the original images, corrupted images, and the reconstructed images, respectively. We applied moderate corruption for demonstration purposes.

Limitations and Future Work

While SiT excels at classification, the authors note that this study focused primarily on that task. They suggest that future work should investigate how well these learned representations transfer to other downstream tasks like object detection and dense segmentation. Additionally, they observed that certain aggressive data augmentations (like MixUp) can actually hurt the self-supervised training process, suggesting a need for more tailored augmentation strategies for multi-task SSL.

Summary updated

BibTeX
@misc{atito2021sit,
  author = {Sara Atito 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