Attention-Based Multi-Context Guiding for Few-Shot Semantic Segmentation

Tao Hu, Pengwan Yang, Chiliang Zhang, Gang Yu, Yadong Mu, Cees G. M. Snoek

Abstract

Semantic segmentation typically requires extensive pixel-level annotations, posing a significant challenge for data-scarce scenarios. Few-shot semantic segmentation addresses this by learning to segment unseen classes from a limited number of support images. This paper presents the Attention-Based Multi-Context Guiding (A-MCG) network, which improves upon existing methods by leveraging multi-scale feature integration and a recurrent fusion mechanism for multi-shot scenarios. A-MCG achieves state-of-the-art results on the PASCAL-5$^i$ and COCO benchmarks, demonstrating the efficacy of spatial attention and sequential information distillation in low-data regimes.

Introduction

Semantic segmentation—the task of assigning category labels to every pixel—is notoriously data-hungry. While standard deep learning models require thousands of labor-intensive annotations, humans can often identify new objects after seeing just one or two examples. Few-shot semantic segmentation seeks to bridge this gap, requiring models to segment a previously unseen "query" image based on only a few labeled "support" images.

Existing approaches often face three critical limitations:

  1. Inefficient Feature Utilization: Relying solely on high-level features from the final layer ignores valuable multi-scale context.
  2. Lack of Attention: Models struggle to distinguish target objects from complex backgrounds without a mechanism to focus on relevant features.
  3. Inflexible Multi-Shot Fusion: Simple operations like logical "OR" fail to capture the underlying commonalities across multiple support images in k-shot learning.

Proposed Method: A-MCG Network

The proposed A-MCG network architecture consists of three primary branches: a support branch, a query branch, and a feature fusion branch.

The A-MCG architecture integrates multi-scale features from ResNet-101 stages and uses a Conv-LSTM for final fusion.

Multi-Context Guiding (MCG)

Unlike traditional models that fuse only the final feature maps, the MCG module integrates features from multiple stages of a ResNet-101 backbone. This allows the support information to guide the query branch at various levels of abstraction, from low-level textures to high-level semantics. This multi-scale approach ensures that the model has a clearer understanding of the target object's appearance.

Residual Attention Module (RAM)

To suppress background noise and highlight the target class, the network incorporates spatial attention. This mechanism acts as a form of self-supervision, forcing the model to concentrate on relevant features across different scales. The authors found that spatial attention (focusing on where the object is) is significantly more effective for dense pixel-level tasks than channel attention.

Conv-LSTM for k-shot Learning

For multi-shot scenarios (e.g., 5-shot), the authors replace static fusion methods with a Convolutional Long Short-Term Memory (Conv-LSTM) unit. By treating support features as a sequence, the model collaboratively integrates information to learn a more robust representation of the target category, leading to smoother and more accurate segmentations.

Key Insights and Qualitative Analysis

A critical finding of this work is the impact of the spatial attention mechanism on feature discriminability. By focusing on the target object, the model can better separate the class of interest from the background.

Visualization of attention maps and activation histograms before and after applying the attention mechanism.

As shown in the qualitative results, the attention mechanism significantly refines the feature maps, concentrating activations on the target object (e.g., the boat or duck) while suppressing irrelevant background signals. This refinement is reflected in the histogram shift, where activations become more distinct and concentrated after the attention module is applied.

Experimental Results

The A-MCG network was evaluated on the PASCAL-5$^i$ and COCO benchmarks, demonstrating superior performance over previous state-of-the-art methods:

  • PASCAL-5$^i$: The model achieved a mean Intersection over Union (mIoU) of 61.2% for 1-shot and 62.2% for 5-shot learning, representing gains of 1.1% and 1.4% respectively over previous benchmarks.
  • COCO: On this more complex dataset, A-MCG consistently outperformed baselines by approximately 3% mIoU in both 1-shot and 5-shot settings.
  • Ablation Studies: Removing the multi-context fusion (using only the final layer) dropped performance by 2.4%, highlighting the importance of the multi-scale approach.

Conclusion and Future Work

The A-MCG network demonstrates that multi-scale context and sequential fusion are vital for few-shot tasks. While the model shows significant progress, it is currently primarily designed for binary (target vs. background) segmentation. Future work will explore extending this architecture to multi-class few-shot scenarios and addressing the computational overhead introduced by the multi-scale fusion and recurrent units.

Summary updated

BibTeX
@inproceedings{hu2019attention,
  author = {Tao Hu and Pengwan Yang and Chiliang Zhang and Gang Yu and Yadong Mu and Cees G. M. Snoek},
  title = {{Attention-Based Multi-Context Guiding for Few-Shot Semantic Segmentation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33018441},
}
Figure