AxWin Transformer: A Context-Aware Vision Transformer Backbone with Axial Windows

Fangjian Lin, Yizhe Ma, Sitong Wu, Long Yu, Shengwei TianarXiv 2023

Abstract

Recently Transformer has shown good performance in several vision tasks due to its powerful modeling capabilities. To reduce the quadratic complexity caused by the attention, some outstanding work restricts attention to local regions or extends axial interactions. However, these methods often lack the interaction of local and global information, balancing coarse and fine-grained information. To address this problem, we propose AxWin Attention, which models context information in both local windows and axial views. Based on the AxWin Attention, we develop a context-aware vision transformer backbone, named AxWin Transformer, which outperforms the state-of-the-art methods in both classification and downstream segmentation and detection tasks.

Introduction

Vision Transformers (ViTs) have significantly advanced computer vision, yet they face a fundamental scaling challenge: the quadratic computational cost of standard global self-attention relative to image resolution. Existing solutions generally fall into two categories:

  1. Window-based attention (e.g., Swin): Restricts attention to local windows, capturing fine details efficiently but lacking long-range global context.
  2. Axial-based attention (e.g., CSWin): Employs horizontal and vertical "strips" to capture global context, which can overlook critical local information and leave "blank portions" in the feature map as resolution increases.

The AxWin Transformer addresses this by balancing local precision and global awareness, which is particularly critical for dense prediction tasks like object detection and semantic segmentation.

Methods

The AxWin Transformer architecture is built upon three primary innovations designed to integrate local and global context efficiently.

Overview of the AxWin Transformer architecture, including the Multi-Scale Patch Embedding (MSPE), AxWin Transformer Block, Axial Window Attention, and Inner Convolution Feed-Forward Network (ICFFN).

1. AxWin Attention

The core of the architecture is the AxWin Attention module. Rather than choosing between local windows or global axes, the module splits the input feature's channels into two groups. The Window Group performs standard non-overlapping window self-attention to focus on local features, while the Axial Group rearranges features into rows and columns for axial self-attention to capture global context. Concatenating these outputs allows the model to process fine-grained details and long-range dependencies simultaneously.

2. Multi-Scale Patch Embedding (MSPE)

Unlike standard ViTs that use simple patch merging, AxWin employs a multi-branch downsampling strategy. MSPE uses depth-wise convolutions at different scales and fuses them, ensuring that multi-resolution context is preserved as spatial dimensions shrink across stages.

3. Inner Convolution Feed-Forward Network (ICFFN)

The standard MLP block is enhanced by inserting a $3 \times 3$ depth-wise convolution between the fully connected layers. This modification introduces a "local bias" to the feed-forward process, improving the model's ability to handle fine-grained spatial information.

Key Results

The model was evaluated on ImageNet-1K (classification), COCO (detection/segmentation), and ADE20K (semantic segmentation). The configurations for the variants tested are detailed below.

Detailed architectural configurations for AxWin-T (Tiny), AxWin-S (Small), and AxWin-B (Base) variants.

AxWin Transformer consistently outperformed state-of-the-art (SOTA) models across benchmarks:

  • Classification: AxWin-T achieved 83.9% Top-1 accuracy, surpassing Swin-T (81.3%) and CSWin-T (82.7%).
  • Object Detection: AxWin-B reached 50.0 box AP, significantly higher than CSWin-B (48.7) and Swin-B (48.5).
  • Semantic Segmentation: AxWin-B achieved 52.8 mIoU, outperforming Swin-B (48.1) by a wide margin.

Discussion and Conclusion

The success of AxWin Transformer stems from its ability to "fill the axial gaps." By running window attention in parallel with axial attention, the model avoids the sparsity issues of axial-only methods, leading to higher "shape bias"—the ability to recognize objects by overall structure rather than just texture. Furthermore, the AxWin-T variant achieves higher accuracy than Swin-T while using ~22% fewer FLOPs (3.5G vs 4.5G), demonstrating that optimized attention patterns can be more effective than raw compute.

While the fixed "split-size" hyperparameter and implementation complexity remain areas for future refinement, the AxWin Transformer provides a robust backbone for high-resolution vision tasks and potential extensions into video understanding.

Summary updated

BibTeX
@misc{lin2023axwin,
  author = {Fangjian Lin and Yizhe Ma and Sitong Wu and Long Yu and Shengwei Tian},
  title = {{AxWin Transformer: A Context-Aware Vision Transformer Backbone with Axial Windows}},
  year = {2023},
  eprint = {2305.01280},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.01280},
}
Figure