Skip to main content
QUICK REVIEW

[Paper Review] Local-to-Global Self-Attention in Vision Transformers

Jinpeng Li, Yichao Yan|arXiv (Cornell University)|Jul 10, 2021
Infrared Target Detection MethodologiesEngineering59 references22 citations
TL;DR

This paper proposes LG-Transformer, a multi-path self-attention mechanism in Vision Transformers that enables local-to-global feature reasoning at multiple scales within each stage. By applying window-based multi-head self-attention to feature maps downscaled to different resolutions—local (1/8), mid-level (1/16), and global (1/32)—the model captures both local details and global context efficiently, achieving 0.9% higher Top-1 accuracy on ImageNet and 0.8% higher mIoU on ADE20K with minimal computational overhead.

ABSTRACT

Transformers have demonstrated great potential in computer vision tasks. To avoid dense computations of self-attentions in high-resolution visual data, some recent Transformer models adopt a hierarchical design, where self-attentions are only computed within local windows. This design significantly improves the efficiency but lacks global feature reasoning in early stages. In this work, we design a multi-path structure of the Transformer, which enables local-to-global reasoning at multiple granularities in each stage. The proposed framework is computationally efficient and highly effective. With a marginal increasement in computational overhead, our model achieves notable improvements in both image classification and semantic segmentation. Code is available at https://github.com/ljpadam/LG-Transformer

Motivation & Objective

  • To address the limitation of hierarchical Vision Transformers that lack global reasoning in early stages due to localized self-attention.
  • To integrate both local inductive bias from CNNs and global modeling capability from Transformers in a single efficient architecture.
  • To improve performance in image classification and semantic segmentation without significantly increasing computational cost.
  • To validate the effectiveness of multi-granular attention paths in enhancing feature representation across different scales.

Proposed method

  • Design a multi-path self-attention module where feature maps are downsampled to three scales: 1/8, 1/16, and 1/32 of the original resolution.
  • Apply window-based multi-head self-attention (W-MSA) independently on each scale to model local and global dependencies.
  • Aggregate features from all paths at each stage to form a more discriminative representation.
  • Use a hierarchical Transformer architecture inspired by Swin Transformer, but extend each block with multiple attention paths.
  • Maintain computational efficiency by limiting global attention to the smallest scale (1/32), reducing global computation cost.
  • Implement the framework without introducing new operations, ensuring compatibility and ease of integration.

Experimental results

Research questions

  • RQ1Can local-to-global feature reasoning at multiple granularities improve performance in Vision Transformers without incurring high computational cost?
  • RQ2How does multi-path attention compare to single-path local attention in terms of convergence and accuracy?
  • RQ3Does combining local and global attention paths lead to better generalization in image classification and semantic segmentation?
  • RQ4What is the optimal placement of multi-path blocks across stages for performance gain?
  • RQ5How does the model’s inference speed compare to standard single-path Transformers?

Key findings

  • LG-Transformer achieves 0.9% higher Top-1 accuracy than Swin-Transformer on ImageNet-1K classification, with only a marginal increase in FLOPs.
  • On the ADE20K semantic segmentation benchmark, LG-Transformer improves mIoU by 0.8% over Swin-T*, achieving competitive performance with similar parameter count and FLOP budget.
  • The model converges faster and reaches lower training loss and higher validation accuracy than baseline models, indicating improved optimization stability.
  • Qualitative analysis shows clear discontinuities in local attention maps (1/8 and 1/16 scales), while global attention (1/32) captures coherent, whole-image context.
  • Adding LG-Attention blocks to more stages consistently improves validation performance and training convergence, demonstrating the benefit of multi-path design.
  • Despite improved accuracy, the model’s inference speed is slower than single-path counterparts due to the multi-path structure, indicating a trade-off between accuracy and speed.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.