
swinv2_cr_small_ns_256
Image classification1,673 ops49.7M params
Swin Transformer reworked with post-norm, cosine attention and log-spaced bias to scale up.
Image classification · 1,793 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
SwinV2-S and SwinV2-B use 96 and 128 channels with blocks {2, 2, 18, 2}.
About this model's family
Swin Transformer V2 is the adapted version of the original Swin Transformer, reworked so that both model capacity and window resolution can be scaled up. The underlying Swin idea is to bring visual priors such as hierarchy, locality and translation invariance into a vanilla Transformer encoder, so the block keeps its modeling power while suiting many visual tasks. The motivation is that scaling up language models had been incredibly successful. The scaling up of vision models, by contrast, had been lagging behind.
The first two changes target training stability: a residual-post-norm method combined with cosine attention. Post-norm normalizes the output of each residual block before it merges back into the main branch, so the amplitude of the main branch does not accumulate as the network gets deeper. Scaled cosine attention makes the computation independent of the amplitude of block inputs, so attention values are less likely to fall into extremes. The third change, a log-spaced continuous position bias (Log-CPB), generates bias values for arbitrary coordinate ranges by applying a small meta network to log-spaced coordinates, so a model pre-trained at low resolution can move to larger windows. Alongside the architecture, the paper uses the self-supervised SimMIM method to reduce its need for vast labeled images.
With these techniques the authors trained a 3 billion-parameter Swin Transformer V2 model. It set new performance records on ImageNet-V2 image classification, COCO object detection, ADE20K semantic segmentation and Kinetics-400 video action classification. The members traced here are torchvision's swin_v2_t, swin_v2_s and swin_v2_b builders, which all rely on the same SwinTransformer base class. The paper keeps the stage, block and channel settings of the original Swin Transformer for its four standard configurations. SwinV2-T uses C = 96 first-stage channels with blocks {2, 2, 6, 2}. SwinV2-S and SwinV2-B use 96 and 128 channels with blocks {2, 2, 18, 2}. Without fine-tuning, enlarging the window from 8 to 24 leaves accuracy at 78.9% versus 81.8%, where the original approach degrades from 81.7% to 68.7%.
Key idea. Swin Transformer V2 adds res-post-norm and scaled cosine attention to make the model easier to scale up in capacity, plus a log-spaced continuous relative position bias so it transfers more effectively across window resolutions.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{liu2022swintransformerv2scaling,
title={Swin Transformer V2: Scaling Up Capacity and Resolution},
author={Ze Liu and Han Hu and Yutong Lin and Zhuliang Yao and Zhenda Xie and Yixuan Wei and Jia Ning and Yue Cao and Zheng Zhang and Li Dong and Furu Wei and Baining Guo},
year={2022},
eprint={2111.09883},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2111.09883},
}