Introduction
Vision Transformers (ViTs) have revolutionized computer vision, but they face a fundamental trade-off between computational efficiency and the ability to capture long-range global dependencies. Standard ViTs utilize global self-attention, which scales quadratically with image resolution, making them impractical for high-resolution tasks. To mitigate this, local window-based architectures like the Swin Transformer were introduced. While these models achieve linear complexity by restricting attention to small patches, they often struggle to establish global context across the entire image without complex and computationally expensive communication mechanisms.
This paper introduces the Multi-resolution Overlapped Attention (MOA) module, a novel plug-and-play component designed to efficiently inject global spatial information into local vision transformers. By leveraging overlapping patches for key and value embeddings, the MOA-Transformer achieves state-of-the-art performance with significantly fewer parameters than its predecessors.
Architecture and Methodology
The MOA-Transformer follows a hierarchical structure similar to other modern vision backbones but integrates the MOA module to bridge the gap between isolated local windows.
The architecture consists of several key components:
- Base Local Transformer: The network processes images through standard local window-based multi-head attention blocks.
- MOA Module Placement: Instead of applying global attention at every layer, the MOA module is strategically inserted only between the major stages of the network, typically before downsampling or patch merging operations.
- Overlapped Key/Value Patches: A critical innovation of the MOA module is the use of overlapping windows for Key and Value embeddings, while Query patches remain standard and non-overlapping. This design forces the network to transmit neighborhood pixel information across window boundaries, effectively breaking the isolation of local windows.
- Efficiency via Dimensionality Reduction: To maintain low computational overhead, a $1 \times 1$ convolution is used to reduce the hidden dimension of the feature map (by a factor $R$) before performing the global attention operation. The resulting globally enriched features are then added back to the local transformer's output.
Key Insights
The success of the MOA-Transformer stems from a few core principles:
- Strategic Overlap: Making key/value patches slightly larger than query patches is a simple yet powerful way to facilitate information exchange. Interestingly, ablation studies revealed that a small overlap (approximately 17%) is optimal; excessive overlap does not yield further gains and may even be detrimental.
- Cost-Effective Global Context: By restricting global attention to specific points in the hierarchy and using dimensionality reduction, the model gains the benefits of global receptive fields for a negligible increase in parameters and GFLOPs.
- Simplicity: Unlike "shifted window" approaches that require complex indexing and masking, the MOA module provides a more straightforward path to cross-window communication.
Experimental Results
The MOA-Transformer was evaluated on standard benchmarks including ImageNet-1K, CIFAR-10, and CIFAR-100. Across all datasets, it demonstrated superior efficiency and accuracy compared to existing state-of-the-art models.
On ImageNet-1K, the Tiny variant (MOA-T, labeled as 'Ours-T' in performance plots) achieved 82.05% accuracy with only 17M parameters, significantly outperforming Swin-T (81.3% with 29M parameters) and Twins-SVT-S (81.7% with 24M parameters). The Base variant (MOA-B) reached 83.7% accuracy with 68M parameters, surpassing Swin-B's 83.3% despite Swin-B requiring 86.7M parameters.
Similar trends were observed on CIFAR-100, where MOA-B achieved 78.68% accuracy, outperforming Swin-B (78.45%) while utilizing roughly 38% fewer parameters. Ablation studies further confirmed the module's impact: removing the global attention component entirely caused CIFAR-100 accuracy to drop from 78.63% to 75.56%.
Conclusion
The MOA-Transformer addresses a critical bottleneck in local vision transformers by providing an efficient mechanism for global feature aggregation. By using overlapped attention windows and strategic dimensionality reduction, the model achieves a better balance of accuracy and parameter efficiency than previous architectures. Future work may involve extending this backbone to dense prediction tasks such as object detection and semantic segmentation, where the combination of local detail and global context is paramount.
Summary updated