Papers › DaViT: Dual Attention Vision Transformers

DaViT: Dual Attention Vision Transformers

7 Apr 2022arXiv:2204.03645archive 2025-07-28

Mingyu Ding, Bin Xiao, Noel Codella, Ping Luo, Jingdong Wang, Lu Yuan

In this work, we introduce Dual Attention Vision Transformers (DaViT), a simple yet effective vision transformer architecture that is able to capture global context while maintaining computational efficiency. We propose approaching the problem from an orthogonal angle: exploiting self-attention mechanisms with both "spatial tokens" and "channel tokens". With spatial tokens, the spatial dimension defines the token scope, and the channel dimension defines the token feature dimension. With channel tokens, we have the inverse: the channel dimension defines the token scope, and the spatial dimension defines the token feature dimension. We further group tokens along the sequence direction for both spatial and channel tokens to maintain the linear complexity of the entire model. We show that these two self-attentions complement each other: (i) since each channel token contains an abstract representation of the entire image, the channel attention naturally captures global interactions and representations by taking all spatial positions into account when computing attention scores between channels; (ii) the spatial attention refines the local representations by performing fine-grained interactions across spatial locations, which in turn helps the global information modeling in channel attention. Extensive experiments show our DaViT achieves state-of-the-art performance on four different tasks with efficient computations. Without extra data, DaViT-Tiny, DaViT-Small, and DaViT-Base achieve 82.8%, 84.2%, and 84.6% top-1 accuracy on ImageNet-1K with 28.3M, 49.7M, and 87.9M parameters, respectively. When we further scale up DaViT with 1.5B weakly supervised image and text pairs, DaViT-Gaint reaches 90.4% top-1 accuracy on ImageNet-1K. Code is available at https://github.com/dingmyu/davit.

PaperPDFCodeCode 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="2204.03645")

Code

Syntology Ran 8 of 15 code samples harvested from 1 repository linked to this paper; 7 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 6 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

dingmyu/davit officialmentioned in papermentioned on GitHubpytorch 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

15 samples harvested; 8 ran; 0 honoured the contract we drafted; 7 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.

1ran · our draft was wrong
1ran · fixture could not drive it
6ran
7unverified

Licence: 0 of the 15 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 dingmyu/davit. “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.

ChannelAttention dingmyu/davit/timm/models/davit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · ae32983bf5de53c3 · report
ChannelBlock dingmyu/davit/timm/models/davit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 98189454f1018bed · report
ConvPosEnc dingmyu/davit/timm/models/davit.py official repository ran MIT (permissive) · c6ff164380e31b6a · report
Mlp dingmyu/davit/timm/models/davit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · c1395a46164d140a · report
PatchEmbed dingmyu/davit/timm/models/davit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · dc8f008b6667e65a · report
WindowAttention dingmyu/davit/timm/models/davit.py official repository ran · metamorphic tier: deterministic MIT (permissive) · 5091ab6c514932c4 · report
window_partition dingmyu/davit/timm/models/davit.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 80c66c535be6f491 · report
window_reverse dingmyu/davit/timm/models/davit.py official repository ran · our draft was wrong MIT (permissive) · b83f31fb8b7c976a · report
DaViT dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · ceb98806b990f4e0 · report
MySequential dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · 5066418c2fb3b6c8 · report
SpatialBlock dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · dad192f68c8848d9 · report
_init_conv_weights dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · 266d4f400940d7a0 · report
_init_vit_weights dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · 62d0b713fcda8506 · report
lecun_normal_ dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · ef7b648f5c9e3de2 · report
variance_scaling_ dingmyu/davit/timm/models/davit.py official repository unverified MIT (permissive) · 2f6bf4b4b7d2ba1c · report

Tasks

Computational EfficiencyImage ClassificationInstance SegmentationMedical Image ClassificationObject DetectionSemantic Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Classification ImageNet DaViT-G GFLOPs 1038 #4 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-G Number of params 1437M #4 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-G Top 1 Accuracy 90.4% #4 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-H GFLOPs 334 #5 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-H Number of params 362M #5 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-H Top 1 Accuracy 90.2% #5 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-L (ImageNet-22k) GFLOPs 103 #85 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-L (ImageNet-22k) Number of params 196.8M #85 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-L (ImageNet-22k) Top 1 Accuracy 87.5% #85 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-B (ImageNet-22k) GFLOPs 46.4 #119 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-B (ImageNet-22k) Number of params 87.9M #119 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-B (ImageNet-22k) Top 1 Accuracy 86.9% #119 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-B GFLOPs 15.5 #306 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-B Number of params 87.9M #306 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-B Top 1 Accuracy 84.6% #306 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-T Number of params 28.3M #498 of 1060 Archive leaderboard report
Image Classification ImageNet DaViT-T Top 1 Accuracy 82.8% #498 of 1060 Archive leaderboard report
Instance Segmentation COCO minival DaViT-T (Mask R-CNN, 36 epochs) mask AP 44.3 #56 of 93 Archive leaderboard report
Medical Image Classification ImageNet DaViT-T GFLOPs 4.5 #1 of 2 Archive leaderboard report
Medical Image Classification ImageNet DaViT-S GFLOPs 8.8 #2 of 2 Archive leaderboard report
Medical Image Classification ImageNet DaViT-S Top 1 Accuracy 84.2% #2 of 2 Archive leaderboard report
Object Detection COCO minival DaViT-T (Mask R-CNN, 36 epochs) box AP 49.9 #82 of 220 Archive leaderboard report
Semantic Segmentation ADE20K DaViT-B Validation mIoU 49.4 #132 of 235 Archive leaderboard report
Semantic Segmentation ADE20K DaViT-T Validation mIoU 46.3 #178 of 235 Archive leaderboard report
Semantic Segmentation ADE20K val DaViT-S (UperNet) mIoU 48.8 #61 of 95 Archive leaderboard report
Semantic Segmentation ADE20K val DaViT-B (UperNet) mIoU 46.3 #71 of 95 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

AttentionDense ConnectionsLayer NormalizationLinear LayerMulti-Head AttentionResidual ConnectionSoftmaxVision Transformer

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