Papers › Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions

Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions

24 Feb 2021ICCV 2021 10arXiv:2102.12122archive 2025-07-28

Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, Ling Shao

Although using convolutional neural networks (CNNs) as backbones achieves great successes in computer vision, this work investigates a simple backbone network useful for many dense prediction tasks without convolutions. Unlike the recently-proposed Transformer model (e.g., ViT) that is specially designed for image classification, we propose Pyramid Vision Transformer~(PVT), which overcomes the difficulties of porting Transformer to various dense prediction tasks. PVT has several merits compared to prior arts. (1) Different from ViT that typically has low-resolution outputs and high computational and memory cost, PVT can be not only trained on dense partitions of the image to achieve high output resolution, which is important for dense predictions but also using a progressive shrinking pyramid to reduce computations of large feature maps. (2) PVT inherits the advantages from both CNN and Transformer, making it a unified backbone in various vision tasks without convolutions by simply replacing CNN backbones. (3) We validate PVT by conducting extensive experiments, showing that it boosts the performance of many downstream tasks, e.g., object detection, semantic, and instance segmentation. For example, with a comparable number of parameters, RetinaNet+PVT achieves 40.4 AP on the COCO dataset, surpassing RetinNet+ResNet50 (36.3 AP) by 4.1 absolute AP. We hope PVT could serve as an alternative and useful backbone for pixel-level predictions and facilitate future researches. Code is available at https://github.com/whai362/PVT.

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="2102.12122")

Code

Syntology Ran 22 of 30 code samples harvested from 3 repositories linked to this paper; 8 have no recorded run. Of those that ran: 2 ran · honoured contract; 4 ran · our draft was wrong; 16 ran with no contract checked.

By repository: official repository: 4 samples from 1 repository, 4 ran; community (archive-listed): 25 samples from 2 repositories, 17 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

whai362/PVT officialmentioned in papermentioned on GitHubpytorch report
DarshanDeshpande/jax-models mentioned on GitHubjax report
SforAiDl/vformer mentioned on GitHubpytorch report
hustvl/sparseinst mentioned on GitHubpytorchMIT report
microsoft/vision-longformer mentioned on GitHubpytorch report
open-mmlab/mmpose mentioned on GitHubpytorchApache-2.0 report
wangermeng2021/PVT-tensorflow2 mentioned on GitHubtf report
xiaohu2015/pvt_detectron2 mentioned on GitHubpytorchMIT report
open-mmlab/mmdetection 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; 22 ran; 2 honoured the contract we drafted; 8 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.

2ran · honoured contract
4ran · our draft was wrong
16ran
8unverified

Licence: 1 of the 30 samples is 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 3 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “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.

Attention whai362/PVT/classification/pvt.py official repository ran Apache-2.0 (permissive) · 5dada1aeda7932eb · report
Block whai362/PVT/classification/pvt.py official repository ran Apache-2.0 (permissive) · 583eadd9a5e6a087 · report
PatchEmbed whai362/PVT/classification/pvt.py official repository ran Apache-2.0 (permissive) · 916b4f73572180ec · report
PyramidVisionTransformer whai362/PVT/classification/pvt.py official repository ran Apache-2.0 (permissive) · c69b1b1a3052ca98 · report
AdaptiveAveragePool2D DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 4e79665da13fed0d · report
Attention DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 07fdb7e2bfa01afa · report
Attention microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · 592e8438de425b53 · report
DepthwiseConv2D DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · f523e66d872044ea · report
FastAttention microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · da55353e88022d26 · report
LinformerSelfAttention microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · 6ba11adb4f98f7ff · report
MlpBlock microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · 0440cd3acf07c3c4 · report
OverlapPatchEmbed DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · df41558bed765430 · report
PatchEmbed microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · b8071a3c02db7b92 · report
SRSelfAttention microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · e41b50defb828842 · report
SlidingChunk2D microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran MIT (permissive) · 46bc17ff8a5ba939 · report
TransformerMLP DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) ran · metamorphic tier: deterministic Apache-2.0 (permissive) · 374179113e51b201 · report
_get_invalid_locations_mask_cyclic microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 9e88f2b66f738494 · report
_get_invalid_locations_mask_exact microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 813948d3f352d1c6 · report
_get_invalid_locations_mask_zero microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran · our draft was wrong MIT (permissive) · f48afe5b9c50d66c · report
gaussian_orthogonal_random_matrix microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran · honoured contract MIT (permissive) · 1652fbb1719cc1b4 · report
softmax_kernel microsoft/vision-longformer/src/models/msvit.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 757aee54843af070 · report
AttnBlock microsoft/vision-longformer/src/models/msvit.py community (archive-listed) unverified MIT (permissive) · 2de4320db751601f · report
Block DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) unverified Apache-2.0 (permissive) · 3ec0d795856d98f3 · report
Long2DSCSelfAttention microsoft/vision-longformer/src/models/msvit.py community (archive-listed) unverified MIT (permissive) · c7c2414a1044ea7d · report
MsViT microsoft/vision-longformer/src/models/msvit.py community (archive-listed) unverified MIT (permissive) · 380e07f5bfb682af · report
PerformerSelfAttention microsoft/vision-longformer/src/models/msvit.py community (archive-listed) unverified MIT (permissive) · 53e595a68e74e8a6 · report
PyramidViT DarshanDeshpande/jax-models/jax_models/models/pvit.py community (archive-listed) unverified Apache-2.0 (permissive) · 5fad6fb95a0d420f · report
mask_invalid_locations microsoft/vision-longformer/src/models/msvit.py community (archive-listed) unverified MIT (permissive) · b7a2d11b74ff36f6 · report
slidingchunk_2dautograd microsoft/vision-longformer/src/models/msvit.py community (archive-listed) unverified MIT (permissive) · 56b6ba9dcdd328f4 · report
init_ identical code first harvested elsewhere ran · honoured contract fingerprinted licence of this copy not recorded · 3444251df88e6169 · report

Tasks

Image ClassificationInstance SegmentationObject DetectionSemantic Segmentationimage-classificationobject-detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Object Detection COCO minival PVT-Large (RetinaNet 3x,MS) AP50 63.6 #140 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 3x,MS) AP75 46.1 #140 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 3x,MS) APL 59.5 #140 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 3x,MS) APM 46.0 #140 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 3x,MS) APS 26.1 #140 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 3x,MS) box AP 43.4 #140 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 1x) AP50 63.7 #151 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 1x) AP75 45.4 #151 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 1x) APL 58.4 #151 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 1x) APM 46.0 #151 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 1x) APS 25.8 #151 of 220 Archive leaderboard report
Object Detection COCO minival PVT-Large (RetinaNet 1x) box AP 42.6 #151 of 220 Archive leaderboard report
Semantic Segmentation DensePASS PVT (Tiny, FPN) mIoU 31.20% #26 of 36 Archive leaderboard report
Semantic Segmentation SynPASS PVT mIoU 32.68% #4 of 6 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

Introduced by this paper: Spatial-Reduction Attention

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPVTPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxSpatial-Reduction AttentionTransformer

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