Skip to main content
QUICK REVIEW

[Paper Review] An Empirical Study of Training Self-Supervised Vision Transformers

Xinlei Chen, Saining Xie|arXiv (Cornell University)|Apr 5, 2021
Advanced Neural Network ApplicationsComputer Science17 citations
TL;DR

This paper presents an empirical study of training self-supervised Vision Transformers (ViT), identifying training instability as a major hidden issue that degrades accuracy by 1–3% without causing divergence. The authors propose freezing the patch projection layer as a simple yet effective stabilizing trick, demonstrating consistent accuracy gains across multiple self-supervised frameworks like MoCo v3, and establish strong SOTA results for ViT in linear probing and fine-tuning settings.

ABSTRACT

This paper does not describe a novel method. Instead, it studies a straightforward, incremental, yet must-know baseline given the recent progress in computer vision: self-supervised learning for Vision Transformers (ViT). While the training recipes for standard convolutional networks have been highly mature and robust, the recipes for ViT are yet to be built, especially in the self-supervised scenarios where training becomes more challenging. In this work, we go back to basics and investigate the effects of several fundamental components for training self-supervised ViT. We observe that instability is a major issue that degrades accuracy, and it can be hidden by apparently good results. We reveal that these results are indeed partial failure, and they can be improved when training is made more stable. We benchmark ViT results in MoCo v3 and several other self-supervised frameworks, with ablations in various aspects. We discuss the currently positive evidence as well as challenges and open questions. We hope that this work will provide useful data points and experience for future research.

Motivation & Objective

  • To investigate fundamental training components—batch size, learning rate, optimizer—for self-supervised Vision Transformers.
  • To identify and address hidden training instability in ViT that degrades accuracy by 1–3% without causing divergence.
  • To benchmark ViT performance across multiple self-supervised frameworks, including MoCo v3, BYOL, and SwAV.
  • To explore scaling ViT models (e.g., ViT-Large, ViT-Huge) and assess their performance under self-supervised pre-training.
  • To compare self-supervised ViT with supervised ViT and convolutional networks (ResNets), especially in low-data regimes.

Proposed method

  • The authors conduct extensive ablation studies on key training components: batch size, learning rate, and optimizer (AdamW) in self-supervised ViT training.
  • They introduce a stabilizing technique: freezing the learned patch projection layer, using fixed random projections instead of learned weights.
  • They employ dense kNN monitoring (every tens of iterations) to detect sudden performance dips and improve training stability tracking.
  • They benchmark ViT in contrastive learning frameworks such as MoCo v3, BYOL, and SwAV, using standard data augmentations and SyncBatchNorm.
  • They compare ViT with ResNets and supervised pre-training on ImageNet and small datasets, evaluating via linear probing and end-to-end fine-tuning.
  • They use a memory bank (10% of ImageNet) to enable efficient, dense kNN evaluation for monitoring training stability.
Figure 1: Training curves of different batch sizes ( MoCo v3 , ViT-B/16, 100-epoch ImageNet, AdamW, $lr{=}1.0e\text{-}4$ ).
Figure 1: Training curves of different batch sizes ( MoCo v3 , ViT-B/16, 100-epoch ImageNet, AdamW, $lr{=}1.0e\text{-}4$ ).

Experimental results

Research questions

  • RQ1How do standard training hyperparameters (learning rate, batch size, optimizer) affect the stability and accuracy of self-supervised ViT?
  • RQ2Why do some self-supervised ViT models show mild accuracy degradation (1–3%) without clear divergence, and can this be mitigated?
  • RQ3Does freezing the patch projection layer improve training stability and final accuracy in self-supervised ViT?
  • RQ4How does self-supervised ViT compare to supervised ViT and ResNets in transfer learning performance, especially on small datasets?
  • RQ5To what extent can ViT models benefit from self-supervised pre-training when scaled up (e.g., ViT-Large, ViT-Huge), and does this close the gap with supervised pre-training?

Key findings

  • Freezing the patch projection layer consistently improves training stability and boosts accuracy by 1–3% across multiple self-supervised frameworks, including MoCo v3.
  • Self-supervised ViT models achieve SOTA performance: 83.2% top-1 accuracy on ImageNet via end-to-end fine-tuning with MoCo v3, surpassing supervised ViT-B.
  • For ViT-Large, self-supervised pre-training outperforms its supervised counterpart in transfer learning, demonstrating the necessity of self-supervised pre-training for large ViTs.
  • The ViT-BN-H variant (with BatchNorm) achieves 79.1% accuracy under linear probing, showing that architectural modifications can improve self-supervised ViT performance.
  • Removing position embeddings degrades accuracy only slightly, indicating that self-supervised ViT can learn strong representations without strong inductive biases.
  • In low-data regimes, self-supervised ViT significantly outperforms supervised ViT and matches or exceeds ResNet performance, closing the gap with supervised pre-training.
Figure 2: Training curves of different learning rates (MoCo v3, ViT-B/16, 100-epoch ImageNet, AdamW, batch 4096).
Figure 2: Training curves of different learning rates (MoCo v3, ViT-B/16, 100-epoch ImageNet, AdamW, batch 4096).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.