Skip to main content
QUICK REVIEW

[Paper Review] Swin Transformer V2: Scaling Up Capacity and Resolution

Ze Liu, Han Hu|arXiv (Cornell University)|Nov 18, 2021
Multimodal Machine Learning ApplicationsComputer Science60 references127 citations
TL;DR

This paper scales Swin Transformer to 3B parameters and 1,536×1,536 images using residual-post-norm, scaled cosine attention, and log-spaced continuous position bias, aided by self-supervised pre-training, achieving state-of-the-art on several vision tasks.

ABSTRACT

Large-scale NLP models have been shown to significantly improve the performance on language tasks with no signs of saturation. They also demonstrate amazing few-shot capabilities like that of human beings. This paper aims to explore large-scale models in computer vision. We tackle three major issues in training and application of large vision models, including training instability, resolution gaps between pre-training and fine-tuning, and hunger on labelled data. Three main techniques are proposed: 1) a residual-post-norm method combined with cosine attention to improve training stability; 2) A log-spaced continuous position bias method to effectively transfer models pre-trained using low-resolution images to downstream tasks with high-resolution inputs; 3) A self-supervised pre-training method, SimMIM, to reduce the needs of vast labeled images. Through these techniques, this paper successfully trained a 3 billion-parameter Swin Transformer V2 model, which is the largest dense vision model to date, and makes it capable of training with images of up to 1,536$ imes$1,536 resolution. It set new performance records on 4 representative vision tasks, including ImageNet-V2 image classification, COCO object detection, ADE20K semantic segmentation, and Kinetics-400 video action classification. Also note our training is much more efficient than that in Google's billion-level visual models, which consumes 40 times less labelled data and 40 times less training time. Code is available at \url{https://github.com/microsoft/Swin-Transformer}.

Motivation & Objective

  • Motivate scaling vision transformers to close the capacity gap with language models.
  • Address training instability that arises when enlarging model capacity.
  • Bridge resolution gaps between pre-training and fine-tuning for high-resolution inputs.
  • Reduce dependence on large labeled datasets via self-supervised pre-training.

Proposed method

  • Introduce residual post-normalization (res-post-norm) to stabilize training by normalizing residual outputs before merging back to the main branch.
  • Replace dot-product attention with scaled cosine attention to mitigate extreme attention values in large models.
  • Propose log-spaced continuous position bias (Log-CPB) generated by a small meta network to enable transfer across different window sizes.
  • Use self-supervised pre-training (SimMIM) to reduce reliance on labeled data, enabling training of very large models.
  • Apply memory- and computation-saving techniques (ZeRO, activation checkpointing, sequential self-attention) to train up to 3B parameters at high resolutions.
Figure 1 : To better scale up model capacity and window resolution, several adaptions are made on the original Swin Transformer architecture (V1): 1) A res-post-norm to replace the previous pre-norm configuration; 2) A scaled cosine attention to replace the original dot product attention ; 3) A log-
Figure 1 : To better scale up model capacity and window resolution, several adaptions are made on the original Swin Transformer architecture (V1): 1) A res-post-norm to replace the previous pre-norm configuration; 2) A scaled cosine attention to replace the original dot product attention ; 3) A log-

Experimental results

Research questions

  • RQ1How can vision transformers be scaled to billions of parameters while maintaining training stability?
  • RQ2How can pre-training be made transferable across different input resolutions and window sizes?
  • RQ3Can self-supervised pre-training reduce labeled data requirements for large vision models?
  • RQ4What combinations of architectural and optimization strategies enable efficient training of large vision backbones on high-resolution images?

Key findings

  • A 3B-parameter Swin Transformer V2 achieves state-of-the-art results on multiple vision tasks: ImageNet-V2 top-1 84.0%, COCO object detection 63.1/54.4 box/mask AP, ADE20K 59.9 mIoU, and Kinetics-400 86.8% top-1.
  • Res-post-norm and scaled cosine attention improve stability and accuracy, especially for larger models.
  • Log-spaced continuous position bias enables effective transfer across window sizes (pre-training with smaller windows and fine-tuning with larger ones).
  • Self-supervised pre-training (SimMIM) with significantly less labeled data achieves strong performance (70M labeled images used vs. 40× more in prior work).
  • Memory- and compute-saving strategies (ZeRO, activation checkpointing, sequential self-attention) enable training at 1,536×1,536 resolutions on large models.
Figure 2 : The Signal Propagation Plot [ 76 , 6 ] for various model sizes. H-size models are trained at a self-supervised learning phase, and other sizes are trained by an image classification task. * indicates that we use a 40-epoch model before it crashes.
Figure 2 : The Signal Propagation Plot [ 76 , 6 ] for various model sizes. H-size models are trained at a self-supervised learning phase, and other sizes are trained by an image classification task. * indicates that we use a 40-epoch model before it crashes.

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.