Improving Semantic Segmentation in Transformers using Hierarchical Inter-Level Attention

Gary Leung, Jun Gao, Xiaohui Zeng, Sanja FidlerarXiv 2022 · DOI

Introduction

Semantic segmentation—the task of assigning a class label to every pixel in an image—is a cornerstone of computer vision, critical for applications like autonomous driving and medical imaging. Modern Hierarchical Vision Transformers (HVTs), such as Swin or SegFormer, have significantly advanced the field. However, these architectures typically rely on a unidirectional, feed-forward processing flow. Information moves from high-resolution, low-level features to abstract, low-resolution, high-level semantic features.

This linear progression forces a trade-off: low-level features provide the spatial resolution necessary for precise boundaries but lack semantic context, while high-level features capture the "big picture" but lose fine-grained spatial detail. Without a feedback mechanism, models often struggle with fuzzy object boundaries and misclassifications in complex scenes. To address this, the authors propose Hierarchical Inter-Level Attention (HILA), a module designed to enable bidirectional communication between processing stages.

The HILA Framework

HILA is a "plug-and-play" module that can be integrated into existing transformer backbones. It facilitates iterative refinement through two primary mechanisms:

  1. Top-Down Update: Higher-level features, rich in semantic information, are used to resolve ambiguities in lower-level features. This "semantic wisdom" helps denoise high-resolution maps, clarifying whether a pixel belongs to a sidewalk or a road based on the surrounding context.
  2. Bottom-Up Update: Following the top-down refinement, the "cleaned" low-level features are passed back up to the higher level. This provides the semantic map with sharper spatial evidence, improving overall clarity.
Architecture of the HILA block enabling bidirectional communication between feature levels.

By wrapping around standard transformer blocks, HILA allows for iterative communication. Crucially, weight sharing across these iterations ensures that the performance boost comes with minimal increases in parameter count.

Experimental Evaluation

The effectiveness of HILA was tested on the Cityscapes and ADE20K datasets. To better assess boundary quality on the complex ADE20K dataset, the researchers introduced a modified F-score metric.

The results demonstrate a significant efficiency gain. For instance, a SegFormer-B1 model augmented with HILA outperformed the larger SegFormer-B2 baseline. As shown in the performance plots below, HILA-equipped models achieve higher mIOU and F-scores while maintaining a smaller footprint in terms of both parameters and FLOPs.

Performance benchmarks showing HILA's efficiency gains in mIOU and F-score relative to model size and complexity.

On the Cityscapes dataset, adding HILA to SegFormer-B1 resulted in a +2.4 mIOU improvement and a +3.4 F-score increase. Furthermore, HILA-augmented models showed superior real-time performance, achieving high accuracy at lower input resolutions and running at up to 126% more FPS compared to baselines.

Discussion and Insights

The core insight behind HILA is that competition can resolve ambiguity. Drawing inspiration from Capsule Networks, HILA forces high-level "objects" to compete for assignments to low-level "parts," effectively denoising the features. Visualizations of the attention maps reveal a natural "part-whole" hierarchy: while Stage 4 might attend to an entire vehicle, the HILA-refined Stage 2 focuses on specific components like wheels or pillars.

Qualitatively, HILA excels at capturing thin or complex objects—such as traffic light stands and bicycle frames—that often baffle standard transformers. This suggests that the bidirectional flow is particularly adept at preserving fine-grained structural details.

Conclusion and Future Work

HILA represents a significant step toward more efficient and accurate vision transformers by breaking the linear processing paradigm. While the module is highly effective, the authors noted that its performance is maximized when the entire backbone is pretrained with HILA modules included. Future research may explore more global inter-level interactions or more sophisticated propagation methods to further enhance the synergy between semantic context and spatial detail.

Summary updated

BibTeX
@misc{leung2022improving,
  author = {Gary Leung and Jun Gao and Xiaohui Zeng and Sanja Fidler},
  title = {{Improving Semantic Segmentation in Transformers using Hierarchical Inter-Level Attention}},
  year = {2022},
  eprint = {2207.02126},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.02126},
}
Figure