Few-Shot Semantic Segmentation with Prototype Learning

Nanqing Dong, Eric P. XingBMVC 2018

Abstract

Semantic segmentation typically requires vast amounts of pixel-level annotations, which are costly to obtain. This paper addresses this challenge by introducing a generalized framework for few-shot semantic segmentation. Moving beyond traditional one-class scenarios, the proposed method tackles multi-class ($N$-way) tasks by combining prototype learning with metric learning. A novel "permutation training" strategy is employed to ensure the model remains robust to class ordering. Experimental results on the PASCAL-5ⁱ benchmark demonstrate that this approach achieves state-of-the-art performance without increasing the number of model parameters.

Introduction

Semantic segmentation—the task of assigning a category label to every pixel in an image—is notoriously data-hungry. Training standard models requires thousands of meticulously annotated images. Few-shot learning aims to mitigate this by teaching models to recognize new concepts from just a handful of examples, known as the "support set."

While few-shot techniques have matured for image classification, applying them to segmentation is significantly more complex. The model must not only recognize a category but also delineate its exact boundaries in a new "query" image. Most prior work was limited to "1-way" segmentation (finding one specific class against a background). This paper tackles the more complex $N$-way $k$-shot problem, where the model must distinguish between multiple unseen classes simultaneously.

Methodology

The authors propose a two-branch architecture designed to prevent the model from simply memorizing training data (overfitting). The high-level workflow involves extracting representative features from a support set to guide the segmentation of a query image.

Overview of the few-shot semantic segmentation framework, showing the interaction between the Prototype Learner and the Segmentor.

Architectural Components

  1. The Prototype Learner: This branch processes support images and their corresponding masks. It uses a feature extractor (VGG16) followed by Global Average Pooling (GAP) to condense the features of a specific class into a single representative vector, or "prototype."
  2. The Segmentor: This branch takes the query image and the generated prototypes as input. It "fuses" the query features with the prototypes to produce the final segmentation mask.

Key Innovations

  • Metric Learning: Instead of learning a fixed mapping, the model utilizes a non-parametric weighted nearest neighbor classifier. It calculates the similarity between query pixels and class prototypes using a distance metric (e.g., Euclidean distance), making the model more flexible for unseen categories.
  • Permutation Training: To ensure the model does not become dependent on the order in which classes are presented, the authors shuffle the order of prototypes during training. This forces the network to focus on the intrinsic differences between prototypes.
  • Alternative Training Scheme: The two branches are optimized alternatively, helping the prototype learner converge on stable representations before the segmentor utilizes them for dense prediction.
Detailed architecture showing (a) prototype generation with classification loss, (b) the segmentation branch with prototype fusion, and (c) the distance metric calculation.

Experimental Setup

The study utilizes PASCAL-5ⁱ, a standard benchmark for few-shot segmentation derived from the PASCAL VOC 2012 dataset. The dataset is split into folds, where specific classes are held out during training and used only for evaluation. For $N$-way experiments, the authors focused on a 2-way setup (e.g., distinguishing "person" and "horse" from the background) to demonstrate the framework's multi-class capabilities.

Results and Discussion

The proposed method showed significant improvements over baselines and competitive performance against existing state-of-the-art (SOTA) methods:

  • 2-way Segmentation: On the 2-way 5-shot task, the model achieved a mean Intersection over Union (mIOU) of 43.7%, vastly outperforming a fine-tuned FCN baseline (28.6%).
  • 1-way Segmentation: In the 1-way 5-shot scenario, it achieved an mIOU of 62.3%, surpassing previous SOTA methods like co-FCN (60.8%).
  • Efficiency: The model achieves these results without adding extra parameters to the backbone, as the learning occurs through the distance metric and prototype generation.

Insights

By forcing the network to communicate through a low-dimensional "prototype" vector, the authors create a bottleneck that prevents the segmentor from memorizing specific training pixels. Furthermore, $N$-way segmentation is shown to be more than just $N$ independent 1-way tasks; it requires handling class competition and background ambiguity, which the metric-learning approach manages naturally.

Conclusion

This framework provides a robust and interpretable approach to few-shot semantic segmentation. While performance is currently tied to the VGG16 backbone, the core methodology is backbone-agnostic. Future work could involve integrating modern backbones like ResNet or adding refinement modules such as Conditional Random Fields (CRFs) to further sharpen segmentation boundaries.

Summary updated

BibTeX
@inproceedings{dong2018few,
  author = {Nanqing Dong and Eric P. Xing},
  title = {{Few-Shot Semantic Segmentation with Prototype Learning}},
  booktitle = {BMVC},
  year = {2018},
}
Figure