AMMUNet: Multi-Scale Attention Map Merging for Remote Sensing Image Segmentation

Yang Yang, Shunyi Zheng

TL;DR

AMMUNet is a new UNet-based architecture designed to solve the "global vs. local" trade-off in remote sensing image segmentation. By introducing a Granular Multi-head Self-Attention (GMSA) module and a unique mechanism to merge attention maps across different scales, it achieves state-of-the-art accuracy on benchmark datasets while remaining computationally efficient enough for real-time use.

What Problem Does This Paper Address?

Remote sensing imagery (satellite or aerial photos) presents a unique challenge: objects like buildings or cars require fine-grained local detail to identify, but understanding the broader scene (e.g., distinguishing a forest from a park) requires "global context."

Standard Convolutional Neural Networks (CNNs) are great at local details but have a limited "receptive field"—they can't easily see the whole picture. Transformers (like ViT) solve this by using self-attention to model global relationships, but they are computationally "heavy" ($O(N^2)$ complexity). To save power, many models use "window-based" attention (like Swin Transformer), but this cuts off long-range dependencies between distant windows.

The authors of AMMUNet sought a way to maintain global modeling capabilities without the massive computational tax or the loss of context caused by window-splitting.

Methods

AMMUNet uses a UNet-style encoder-decoder structure with a ResNet50 backbone. Its core innovations reside in the decoder:

  1. Granular Multi-head Self-Attention (GMSA): Instead of looking at the whole image or large windows, GMSA divides feature maps into tiny $2 \times 2$ "granular" windows. This drastically reduces the number of parameters and computational cost.
  2. Attention Map Merging Mechanism (AMMM): This is the "aha" feature. The model takes high-level (coarse) attention maps from the deepest layers of the network and merges them with the fine-grained maps at shallower layers. It uses a fixed mask template and upsampling to ensure that global context from the "big picture" is preserved and injected into the high-resolution layers.
  3. Dimension Correspondence Module (DCM): A utility module that ensures memory formats (window-based vs. row-based) align correctly so that multi-scale maps can be merged seamlessly.

Datasets

The model was evaluated on two gold-standard datasets for remote sensing:

  • ISPRS Vaihingen Dataset: 33 high-resolution images (800 to 3000 pixels) categorized into six classes (Impervious Surfaces, Buildings, Low Vegetation, Trees, Cars, and Clutter).
  • ISPRS Potsdam Dataset: 38 very large images ($6000 \times 6000$ pixels) with the same six categories. For both datasets, the authors cropped the images into $512 \times 512$ patches for training.

Key Insights and Ideas

  • Reusing is Better than Recalculating: Instead of trying to calculate global attention at every high-resolution scale (which is nearly impossible due to memory limits), AMMUNet calculates it once at a low resolution and "merges" that knowledge upward through the decoder.
  • Granularity Matters: By using $2 \times 2$ windows in GMSA, the model captures very local relationships efficiently, while the AMMM provides the "long-range" context those tiny windows would otherwise miss.
  • Efficiency Gains: The computational complexity of GMSA grows much more slowly than standard Multi-head Self-Attention (MSA) as image size increases, making it better suited for the massive resolutions typical of remote sensing.

Key Results

AMMUNet outperformed several heavy hitters in the field, including DeepLabv3+, SegFormer, and UNetFormer:

  • Accuracy: It achieved a 75.48% mIoU (mean Intersection over Union) on the Vaihingen dataset and 77.90% mIoU on the Potsdam dataset.
  • Speed and Efficiency: In ablation studies, AMMUNet was significantly faster than "patch-free" global attention models. For example, while a standard UNet with patch-free MSA struggled at 18 FPS, AMMUNet maintained a much more usable 64.10 FPS while actually improving accuracy.
  • Sub-category Performance: The model was particularly effective at identifying "Buildings" and "Clutter," achieving the highest scores in those categories across both datasets.

Limitations and Future Work

While the paper demonstrates impressive efficiency, the authors primarily focused on the decoder's attention mechanism. The backbone remains a standard ResNet50; future iterations might explore more modern, lightweight backbones to further push the FPS. Additionally, the "fixed mask template" used for merging is a rigid operation; exploring learnable or dynamic merging templates could potentially yield even higher precision in complex urban environments.

Source: Yang Yang and Shunyi Zheng, "AMMUNet: Multi-Scale Attention Map Merging for Remote Sensing Image Segmentation," 2024. GitHub Link

Summary updated

Abstract

The advancement of deep learning has driven notable progress in remote sensing semantic segmentation. Attention mechanisms, while enabling global modeling and utilizing contextual information, face challenges of high computational costs and require window-based operations that weaken capturing long-range dependencies, hindering their effectiveness for remote sensing image processing. In this letter, we propose AMMUNet, a UNet-based framework that employs multi-scale attention map merging, comprising two key innovations: the granular multi-head self-attention (GMSA) module and the attention map merging mechanism (AMMM). GMSA efficiently acquires global information while substantially mitigating computational costs in contrast to global multi-head self-attention mechanism. This is accomplished through the strategic utilization of dimension correspondence to align granularity and the reduction of relative position bias parameters, thereby optimizing computational efficiency. The proposed AMMM effectively combines multi-scale attention maps into a unified representation using a fixed mask template, enabling the modeling of global attention mechanism. Experimental evaluations highlight the superior performance of our approach, achieving remarkable mean intersection over union (mIoU) scores of 75.48\% on the challenging Vaihingen dataset and an exceptional 77.90\% on the Potsdam dataset, demonstrating the superiority of our method in precise remote sensing semantic segmentation. Codes are available at https://github.com/interpretty/AMMUNet.
BibTeX
@misc{yang2024ammunet,
  author = {Yang Yang and Shunyi Zheng},
  title = {{AMMUNet: Multi-Scale Attention Map Merging for Remote Sensing Image Segmentation}},
  year = {2024},
  eprint = {2404.13408},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.13408},
}
Figure