Pyramid Attention Network for Semantic Segmentation

Hanchao Li, Pengfei Xiong, Jie An, Lingxue Wang

Abstract

A Pyramid Attention Network (PAN) is proposed to exploit the impact of global contextual information in semantic segmentation. Different from most existing works, we combine attention mechanism and spatial pyramid to extract precise dense features for pixel labeling instead of complicated dilated convolution and artificially designed decoder networks. Specifically, we introduce a Feature Pyramid Attention module to perform spatial pyramid attention structure on high-level output and combining global pooling to learn a better feature representation, and a Global Attention Upsample module on each decoder layer to provide global context as a guidance of low-level features to select category localization details. The proposed approach achieves state-of-the-art performance on PASCAL VOC 2012 and Cityscapes benchmarks with a new record of mIoU accuracy 84.0% on PASCAL VOC 2012, while training without COCO dataset.

Introduction

Semantic segmentation requires a delicate balance between capturing global scene context and preserving local spatial details. Standard Fully Convolutional Networks (FCNs) often struggle with this balance, as the downsampling process in encoders leads to a loss of spatial resolution, making it difficult to predict small objects or fine boundaries accurately. While existing methods like DeepLab utilize dilated (atrous) convolutions to expand the receptive field without losing resolution, they can introduce "grid artifacts." Other methods like PSPNet use Spatial Pyramid Pooling (SPP) to capture context but may lose precise pixel localization.

The Pyramid Attention Network (PAN) addresses these challenges by replacing computationally heavy dilated convolutions with a novel attention-based pyramid structure. By integrating multi-scale context through attention, PAN extracts dense, precise features more efficiently.

Methodology

The PAN architecture is built upon a ResNet-101 backbone and introduces two primary modules: the Feature Pyramid Attention (FPA) and the Global Attention Upsample (GAU).

The overall architecture of the Pyramid Attention Network (PAN), featuring the Feature Pyramid Attention (FPA) and Global Attention Upsample (GAU) modules.

Feature Pyramid Attention (FPA)

The FPA module serves as the central bridge between the encoder and decoder. Unlike simple pooling, it employs a U-shaped structure with three pyramid scales (3x3, 5x5, and 7x7 convolutions). This structure allows the network to incorporate context from neighboring scales precisely. These multi-scale features are then utilized as a pixel-wise attention mask, multiplying the original high-level features to highlight relevant spatial information. By applying large kernels (like 7x7) only on high-level feature maps where resolution is low, the network gains a massive receptive field boost with minimal computational overhead.

Global Attention Upsample (GAU)

In traditional decoder networks, skip connections simply concatenate low-level and high-level features. The GAU module improves this by using high-level features to guide the selection of low-level details. It performs Global Average Pooling on high-level features to extract a global context vector, which then weights (gates) the low-level features. This effectively uses the "what" (category information from high-level features) to filter the "where" (localization details from low-level features), leading to more accurate object boundaries.

Experimental Results

The model was evaluated on the PASCAL VOC 2012 and Cityscapes benchmarks, demonstrating significant improvements over baseline architectures.

Visual comparison of semantic segmentation results. PAN demonstrates superior recovery of fine details compared to baseline FCN and FPA-only models.

Performance Benchmarks

  • PASCAL VOC 2012: PAN achieved a state-of-the-art 84.0% mIoU on the test set. Notably, this record was achieved without pre-training on the MS-COCO dataset or employing Dense-CRF post-processing.
  • Cityscapes: On this challenging urban scene dataset, PAN reached 78.6% mIoU, outperforming established models such as PSPNet and DeepLabv2.

Ablation Studies

Ablation experiments highlighted the effectiveness of the proposed modules. The authors found that Average Pooling consistently outperformed Max Pooling within the pyramid structure. Furthermore, the addition of a Global Pooling branch provided a significant accuracy boost, improving mIoU from 77.54% to 78.37% in baseline tests.

Conclusion

The Pyramid Attention Network demonstrates that multi-scale attention can be a powerful alternative to dilated convolutions for expanding receptive fields in semantic segmentation. By intelligently weighting features through the FPA and GAU modules, the network achieves superior localization and context integration. While the current implementation relies on a ResNet-101 backbone, the "plug-and-play" nature of these modules suggests they could be effectively integrated into various other encoder-decoder architectures to improve efficiency and accuracy in dense prediction tasks.

Summary updated

BibTeX
@inproceedings{li2018pyramid,
  author = {Hanchao Li and Pengfei Xiong and Jie An and Lingxue Wang},
  title = {{Pyramid Attention Network for Semantic Segmentation}},
  booktitle = {BMVC},
  year = {2018},
  url = {https://openreview.net/forum?id=RzburDKjgBP},
}
Figure