All models

davit_tiny

A vision transformer that alternates window attention over patches with attention over channels.

Image classification · 589 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (27 KB)

Open in a new tab

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.

At a glance

Family
DaViT
Parameters
28.4M
Operations
589
Framework
PyTorch
Recurrent
No
Published
Lecture Notes in Computer Science (arXiv 2022)
Cited by
424 (as of 29 October 2026)
Authors
Mingyu Ding, Bin Xiao, Noel Codella and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m4101
Graph hash
070d42fa6e44df3671ec7b6a8bee09485c28514a6ab6332f4f88a198eb162164
Skeleton hash
b373ffb245507382dc055304edf34e4f564042d1ca82fb7be3db5e58ced65cdb
Architecture hash
da60a245c37a66283c7858b5d4bef6f50062b99f4e1afb3db501be756e1cda53
Diagram SHA-256
63de3530d274229d985ebb011049aef2e4f6db6ab05e070fa225b464e067d4ba
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('davit_tiny', pretrained=False)

What it is

About this model's family

DaViT, the Dual Attention Vision Transformer, is a vision backbone that captures global context while keeping computation efficient. Its trick is to run self-attention two ways: over spatial tokens, where the spatial dimension defines the token scope and channels are the features, and over channel tokens, where the channel dimension defines the token scope and the spatial dimension is the feature. Each channel token is an abstract representation of the entire image, so channel attention captures global interactions by taking all spatial positions into account. Spatial attention refines the local representations with fine-grained interactions across locations.

To keep the whole model linear in cost, tokens are grouped along the sequence direction for both kinds of attention: spatial window attention partitions the image into non-overlapping windows, and channel group attention divides the channels into groups. A dual attention block pairs one spatial window attention block with one channel group attention block, and the model alternates the two.

The network has four stages, each opened by a patch embedding layer implemented as a strided convolution, with dual attention blocks stacked inside each stage at fixed resolution. The captured timm members cover the tiny, small, base, large, huge and giant sizes; Tiny and Small both use base width C = 96 and differ in the third stage, with 3 or 9 blocks. Without extra data, DaViT-Tiny, DaViT-Small and DaViT-Base reach 82.8%, 84.2% and 84.6% top-1 on ImageNet-1K with 28.3M, 49.7M and 87.9M parameters. Scaled up with 1.5B weakly supervised image and text pairs, the giant model reaches 90.4% top-1 on ImageNet-1K.

Key idea. Channel group self-attention, which treats each channel as an image-level token, alternated with spatial window attention so a vision transformer gets global context at linear cost.

  • davit
  • dual attention vision transformer
  • channel group attention
  • spatial window attention
  • vision transformer
  • image classification
  • backbone
  • imagenet

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{davit2022,
  title = {DaViT: Dual Attention Vision Transformers},
  author = {Mingyu Ding and Bin Xiao and Noel Codella and Ping Luo and Jingdong Wang and Lu Yuan},
  year = {2022},
  journal = {Lecture notes in computer science},
  eprint = {2204.03645}
}