Boosting Few-shot Semantic Segmentation with Transformers

Guolei Sun, Yun Liu, Jingyun Liang, Luc Van GoolarXiv 2021

Introduction

Few-shot semantic segmentation (FSS) is a challenging task where a model must learn to segment objects of a novel class using only a few annotated "support" examples. Traditional approaches rely heavily on Convolutional Neural Networks (CNNs), which are adept at capturing local textures and patterns. However, CNNs often struggle with global context due to their limited receptive field. This paper introduces TRFS (TRansformer-based Few-shot Segmentation), a novel architecture that combines the long-range modeling capabilities of Transformers with the local feature extraction of CNNs to overcome these limitations.

Methodology

The TRFS framework employs a dual-pathway architecture designed to process features across multiple scales. The core of the system consists of two complementary enhancement modules:

  1. Global Enhancement Module (GEM): This module leverages Transformer blocks and Multi-Head Self-Attention to capture global relationships within the image. By treating features as sequences, it can relate distant pixels, providing the model with a "big picture" understanding of the object structure.
  2. Local Enhancement Module (LEM): This module uses standard convolutions to focus on fine-grained, local details, ensuring that the segmentation boundaries remain sharp and accurate.
The TRFS architecture integrates Global and Local Enhancement Modules across a multi-scale feature pyramid to capture both context and detail.

The pipeline starts with a pre-trained, frozen backbone (such as ResNet-50) that extracts features from both support and query images. These features are fused with a "prior mask" and then pooled into a pyramid of different resolutions (e.g., 60x60 down to 8x8). Each scale is processed by both the GEM and LEM, and their outputs are ultimately combined to produce the final segmentation prediction.

Experiments and Results

TRFS was rigorously tested on the PASCAL-5i and COCO benchmarks, two standard datasets for few-shot segmentation. The model achieved new state-of-the-art results, outperforming previous leaders like PFENet.

  • PASCAL-5i: TRFS showed a 1.3% mIoU improvement in the 5-shot setting over previous methods.
  • COCO: On this larger and more complex dataset, the model achieved a 1.9% mIoU gain over existing methods using a VGG-16 backbone.
Qualitative results demonstrating the model's ability to accurately segment objects in diverse and challenging scenarios.

Qualitative analysis reveals that TRFS is particularly robust in challenging conditions, such as varying illumination or partial occlusions. Ablation studies further highlighted that the combination of GEM and LEM is crucial; while each module provides value independently, their synergy is what drives the significant performance gains. Additionally, the multi-scale approach proved vital for handling objects of different sizes effectively.

Conclusion

By integrating Transformers into the few-shot segmentation pipeline, TRFS successfully addresses the global context limitations of pure CNN architectures. The dual-pathway design, combining global and local enhancement, provides a more holistic understanding of novel object classes. Future research could explore deeper interactions between these modules or the integration of more advanced vision Transformer backbones to further enhance efficiency and accuracy.

Summary updated

BibTeX
@misc{sun2021boosting,
  author = {Guolei Sun and Yun Liu and Jingyun Liang and Luc Van Gool},
  title = {{Boosting Few-shot Semantic Segmentation with Transformers}},
  year = {2021},
  eprint = {2108.02266},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.02266},
}
Figure