[Paper Review] DaViT: Dual Attention Vision Transformers
DaViT introduces a dual attention mechanism in vision transformers that jointly models spatial and channel-wise self-attention to capture both local fine-grained and global contextual representations efficiently. By applying self-attention over both spatial tokens and transposed channel tokens, and grouping tokens to maintain linear complexity, DaViT achieves state-of-the-art accuracy—84.6% top-1 on ImageNet-1K with 87.9M parameters—while maintaining computational efficiency.
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.
Motivation & Objective
- To address the trade-off between global context modeling and computational efficiency in vision transformers.
- To design a mechanism that captures global long-range dependencies without quadratic complexity in spatial resolution.
- To explore the complementary roles of spatial and channel self-attention in improving representation learning.
- To demonstrate that dual attention can outperform standard local or global self-attention with fewer parameters and FLOPs.
- To evaluate the effectiveness of removing feed-forward networks (FFNs) in favor of deeper attention-only architectures.
Proposed method
- Introduces two types of tokens: spatial tokens (patch-based) and channel tokens (feature-based), where attention is applied across the channel dimension to model global image context.
- Applies self-attention on the transposed feature map to create channel tokens, each representing a global view of the entire image across all spatial locations.
- Groups spatial and channel tokens along the sequence dimension to maintain linear computational complexity with respect to sequence length.
- Alternates between spatial window self-attention and channel group self-attention in a dual-attention block to refine local and global representations.
- Employs a lightweight, parameter-efficient design by removing FFNs and replacing them with deeper stacks of dual-attention blocks to match FLOP budgets.
- Uses channel group self-attention with grouped queries and keys to reduce computational cost while preserving global modeling capacity.
Experimental results
Research questions
- RQ1Can joint modeling of spatial and channel self-attention improve global context modeling in vision transformers without increasing computational cost?
- RQ2How does dual attention compare to standard window or global self-attention in terms of accuracy and efficiency?
- RQ3Can a pure-attention architecture without feed-forward networks achieve strong performance on image classification?
- RQ4Does channel self-attention, which operates on global feature representations, outperform traditional channel attention modules like SE and ECA?
- RQ5To what extent does the dual attention mechanism reduce the number of layers needed to achieve SOTA performance?
Key findings
- DaViT-Base achieves 84.6% top-1 accuracy on ImageNet-1K with only 87.9M parameters and 15.2 GFLOPs, outperforming prior SoTA methods at similar FLOP levels.
- DaViT-Tiny achieves 82.8% top-1 accuracy on ImageNet-1K with 28.3M parameters and 4.5 GFLOPs, demonstrating strong efficiency-accuracy trade-off.
- A pure-attention variant of DaViT without FFNs achieves 82.5% top-1 accuracy on ImageNet-1K, outperforming both window-attention and channel-attention baselines by 1.5–1.7%.
- DaViT-Giant, pre-trained on 1.5B weakly supervised image-text pairs, reaches 90.4% top-1 accuracy on ImageNet-1K, showing strong scalability.
- DaViT models achieve higher throughput than Swin Transformer (e.g., 1059 vs. 1024 samples/sec on V100 for Tiny models), indicating better inference efficiency.
- Replacing channel self-attention with SE or ECA blocks reduces accuracy by 1.6%, confirming that the proposed attention mechanism is more effective for global feature fusion.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.