Papers › Swin Transformer V2: Scaling Up Capacity and Resolution

Swin Transformer V2: Scaling Up Capacity and Resolution

18 Nov 2021CVPR 2022 1arXiv:2111.09883archive 2025-07-28

Ze Liu, Han Hu, Yutong Lin, Zhuliang Yao, Zhenda Xie, Yixuan Wei, Jia Ning, Yue Cao, Zheng Zhang, Li Dong, Furu Wei, Baining Guo

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×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}.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2111.09883")

Code

Syntology Ran 3 of 30 code samples harvested from 4 repositories linked to this paper; 27 have no recorded run. Of those that ran: 3 ran · violated contract.

By repository: community (archive-listed): 30 samples from 4 repositories, 3 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

23 repositories listed; official and paper-mentioned ones first.

microsoft/Swin-Transformer officialmentioned in papermentioned on GitHubpytorch report
ChristophReich1996/Swin-Transformer-V2 mentioned on GitHubpytorch report
JunnYu/x-transformers-paddle mentioned on GitHubjaxApache-2.0 report
impiga/plain-detr mentioned on GitHubpytorch report
isaaccorley/hydro-foundation-model mentioned on GitHubpytorch report
lucidrains/flash-cosine-sim-attention mentioned on GitHubpytorch report
nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2 mentioned on GitHubpaddleApache-2.0 report
rami0205/ngramswin mentioned on GitHubpytorchApache-2.0 report
rwightman/pytorch-image-models mentioned on GitHubpytorch report
shinya7y/UniverseNet pytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

30 samples harvested; 3 ran; 0 honoured the contract we drafted; 27 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · violated contract
27unverified

Licence: 0 of the 30 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

cast_tuple JunnYu/x-transformers-paddle/pd_x_transformers/x_transformers.py community (archive-listed) ran · violated contract fingerprinted Apache-2.0 (permissive) · 1f7c550e65142ef8 · report
default JunnYu/x-transformers-paddle/pd_x_transformers/x_transformers.py community (archive-listed) ran · violated contract Apache-2.0 (permissive) · 424012cb37b31172 · report
exists JunnYu/x-transformers-paddle/pd_x_transformers/autoregressive_wrapper.py community (archive-listed) ran · violated contract Apache-2.0 (permissive) · aa5486a3650902d8 · report
apply_for_scriptable_torch JunnYu/x-transformers-paddle/einops/_torch_specific.py community (archive-listed) unverified Apache-2.0 (permissive) · 29b5922a6530d4e2 · report
arg_to_varname lyqcom/aaic_swintransformerv2/src/configs/parser.py community (archive-listed) unverified Apache-2.0 (permissive) · 177a4abf40724f6e · report
argv_to_vars lyqcom/aaic_swintransformerv2/src/configs/parser.py community (archive-listed) unverified Apache-2.0 (permissive) · ffc9d7cced6f71fb · report
check_model_file Qdriving/Swin-TransformerV2-in-PP/paddleclas.py community (archive-listed) unverified Apache-2.0 (permissive) · a39394c9a8e29425 · report
cutmix_generate_bbox_adjust_lam nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/mixup.py community (archive-listed) unverified Apache-2.0 (permissive) · 80c04c4768d37ac0 · report
get_backend JunnYu/x-transformers-paddle/einops/_backends.py community (archive-listed) unverified Apache-2.0 (permissive) · a9ebd0f6584234a5 · report
get_config nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/config.py community (archive-listed) unverified Apache-2.0 (permissive) · 160fd4002bd2e51b · report
get_logger nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/main_multi_gpu.py community (archive-listed) unverified Apache-2.0 (permissive) · 043c2f16bd404117 · report
is_ellipsis_not_in_parenthesis JunnYu/x-transformers-paddle/einops/einops.py community (archive-listed) unverified Apache-2.0 (permissive) · eaade2de97f347bc · report
rand_bbox nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/mixup.py community (archive-listed) unverified Apache-2.0 (permissive) · 484edb411de743ae · report
rand_bbox_minmax nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/mixup.py community (archive-listed) unverified Apache-2.0 (permissive) · b27df77c248443b3 · report
rearrange JunnYu/x-transformers-paddle/einops/einops.py community (archive-listed) unverified Apache-2.0 (permissive) · 942acecd8aa049a5 · report
reduce JunnYu/x-transformers-paddle/einops/einops.py community (archive-listed) unverified Apache-2.0 (permissive) · 6913149f68bd7808 · report
rerange_index Qdriving/Swin-TransformerV2-in-PP/ppcls/loss/comfunc.py community (archive-listed) unverified Apache-2.0 (permissive) · 21421188135068e9 · report
shear_x nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/auto_augment.py community (archive-listed) unverified Apache-2.0 (permissive) · e0254103b7a7465f · report
shear_y nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/auto_augment.py community (archive-listed) unverified Apache-2.0 (permissive) · 00da552067622c6f · report
similar_architectures Qdriving/Swin-TransformerV2-in-PP/paddleclas.py community (archive-listed) unverified Apache-2.0 (permissive) · f262aa35d9f2b50f · report
translate_x_relative nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/auto_augment.py community (archive-listed) unverified Apache-2.0 (permissive) · 5931b70ac74f0d83 · report
trim_preceding_hyphens lyqcom/aaic_swintransformerv2/src/configs/parser.py community (archive-listed) unverified Apache-2.0 (permissive) · a99f170ebd682af5 · report
update_config nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/config.py community (archive-listed) unverified Apache-2.0 (permissive) · 1e4ddb470d424318 · report
window_partition lyqcom/aaic_swintransformerv2/src/models/swin_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 73879546dbb5b1b1 · report
window_partition Qdriving/Swin-TransformerV2-in-PP/ppcls/arch/backbone/model_zoo/swin_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 0fd983e99eaff69e · report
window_reverse Qdriving/Swin-TransformerV2-in-PP/ppcls/arch/backbone/model_zoo/swin_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 1a004818e36b501f · report
window_reverse lyqcom/aaic_swintransformerv2/src/models/swin_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 1129d77773d2fc84 · report
window_reverse lyqcom/aaic_swintransformerv2/src/models/swin_transformer_v2.py community (archive-listed) unverified Apache-2.0 (permissive) · db165c23fedab0fa · report
windows_partition nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/swin_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · e14035f3e23f1d93 · report
windows_reverse nku-shengzheliu/PaddlePaddle-Swin-Transformer-V2/swin_transformer.py community (archive-listed) unverified Apache-2.0 (permissive) · 3f5cac22adf9d786 · report

Tasks

Action ClassificationImage ClassificationInstance SegmentationObject DetectionSemantic Segmentationimage-classification

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Action Classification Kinetics-400 Video-SwinV2-G (ImageNet-22k and external 70M pretrain) Acc@1 86.8 #44 of 207 Archive leaderboard report
Image Classification ImageNet SwinV2-G Number of params 3000M #7 of 1060 Archive leaderboard report
Image Classification ImageNet SwinV2-G Top 1 Accuracy 90.17% #7 of 1060 Archive leaderboard report
Image Classification ImageNet SwinV2-B Number of params 88M #106 of 1060 Archive leaderboard report
Image Classification ImageNet SwinV2-B Top 1 Accuracy 87.1% #106 of 1060 Archive leaderboard report
Image Classification ImageNet V2 SwinV2-G Top 1 Accuracy 84.00% #4 of 33 Archive leaderboard report
Image Classification ImageNet V2 SwinV2-B Top 1 Accuracy 78.08 #13 of 33 Archive leaderboard report
Instance Segmentation COCO minival SwinV2-G (HTC++) mask AP 53.7 #9 of 93 Archive leaderboard report
Instance Segmentation COCO test-dev SwinV2-G (HTC++) mask AP 54.4 #10 of 112 Archive leaderboard report
Object Detection COCO minival SwinV2-G (HTC++) box AP 62.5 #15 of 220 Archive leaderboard report
Object Detection COCO test-dev SwinV2-G (HTC++) Params (M) 3000 #18 of 225 Archive leaderboard report
Object Detection COCO test-dev SwinV2-G (HTC++) box mAP 63.1 #18 of 225 Archive leaderboard report
Semantic Segmentation ADE20K SwinV2-G(UperNet) Validation mIoU 59.9 #15 of 235 Archive leaderboard report
Semantic Segmentation ADE20K SwinV2-G-HTC++ Liu et al. ([2021a]) Validation mIoU 53.7 #75 of 235 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxStochastic DepthSwin TransformerTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections