Adaptive Prototype Learning and Allocation for Few-Shot Segmentation

Gen Li, Varun Jampani, Laura Sevilla-Lara, Deqing Sun, Jonghyun Kim, Joongkyu Kim

Abstract

Prototype learning is extensively used for few-shot segmentation. Typically, a single prototype is obtained from the support feature by averaging the global object information. However, using one prototype to represent all the information may lead to ambiguities. In this paper, we propose two novel modules, named superpixel-guided clustering (SGC) and guided prototype allocation (GPA), for multiple prototype extraction and allocation. Specifically, SGC is a parameter-free and training-free approach, which extracts more representative prototypes by aggregating similar feature vectors, while GPA is able to select matched prototypes to provide more accurate guidance. By integrating the SGC and GPA together, we propose the Adaptive Superpixel-guided Network (ASGNet), which is a lightweight model and adapts to object scale and shape variation. In addition, our network can easily generalize to k-shot segmentation with substantial improvement and no additional computational cost. In particular, our evaluations on COCO demonstrate that ASGNet surpasses the state-of-the-art method by 5% in 5-shot segmentation.

Introduction

Few-shot segmentation (FSS) tasks require a model to segment a novel object in a "query" image given only a few labeled "support" images. Most existing approaches rely on prototypical learning, where the features of the object in the support image are compressed into a single vector (a prototype) via global average pooling.

However, a single vector is often insufficient to represent complex objects. It discards spatial information and struggles with "intra-class variation"—where the support and query objects differ in pose, scale, or visibility due to occlusion. While some methods attempt to match every pixel between images (affinity learning), these are often computationally expensive and prone to overfitting on small datasets. ASGNet aims to find a middle ground: multiple, flexible prototypes that capture different "parts" of an object.

Comparison between single prototype learning (a) and the proposed multiple prototype learning approach (b).

Methodology

The core of the paper is the Adaptive Superpixel-guided Network (ASGNet), which introduces two primary modules: Superpixel-guided Clustering (SGC) and Guided Prototype Allocation (GPA). This architecture moves beyond the "one-size-fits-all" prototype approach by using superpixel-guided clustering to create multiple, content-aware prototypes from support images.

Overview of the ASGNet architecture featuring SGC and GPA modules.

Superpixel-guided Clustering (SGC)

Instead of one global average, SGC uses a parameter-free, iterative clustering algorithm (inspired by SLIC superpixels) to group similar feature vectors within the support object's mask. This results in several "superpixel centroids" that act as multiple prototypes. Crucially, the number of prototypes is adaptive: larger objects are represented by more prototypes, while tiny objects might only use one. This prevents redundant computation on small objects while ensuring complex objects aren't over-simplified.

Guided Prototype Allocation (GPA)

Once multiple prototypes are extracted, the model must decide which one to use for each pixel in the query image. GPA uses an attention-like mechanism to calculate the cosine similarity between every query pixel and every support prototype. It then "allocates" the most relevant prototype to each query pixel, creating a spatially-aware guidance map. This makes the model more robust to occlusion; if a query object is partially occluded, the model can still find matches for the visible parts among the diverse set of support prototypes.

The architecture concludes with a Feature Pyramid Network (FPN)-like top-down structure to refine the segmentation mask using multi-scale information.

Key Results

ASGNet was evaluated on two standard benchmarks: Pascal-$5^i$ (derived from PASCAL VOC 2012) and COCO-$20^i$ (a more challenging dataset with 80 categories). It achieved significant performance gains, particularly in the more difficult 5-shot and COCO scenarios:

  • COCO-$20^i$: In the 5-shot setting, ASGNet reached 42.48% mIoU, surpassing the previous state-of-the-art (PFENet) by a substantial 5.08%.
  • Pascal-$5^i$: It achieved 64.36% mIoU in the 5-shot setting, a 2.40% improvement over the state-of-the-art.
  • Efficiency: Despite using multiple prototypes, the model is highly efficient. The adaptive scheme reduces redundant FLOPs compared to using a fixed, high number of prototypes, and it requires fewer trainable parameters than many competing architectures (10.4M parameters).

Conclusion

ASGNet demonstrates that adaptability in prototype learning is key to handling complex object shapes and scales in few-shot segmentation. By clustering in the feature space, SGC naturally identifies distinct parts of an object without requiring explicit part-level annotations. The SGC module is training-free and parameter-free, making it a lightweight "plug-and-play" component. While the quality of prototypes currently depends on seed initialization (MaskSLIC), the adaptive prototype approach shows great promise for extension to other few-shot tasks beyond segmentation, such as object detection or video-based learning.

Summary updated

BibTeX
@inproceedings{li2021adaptive,
  author = {Gen Li and Varun Jampani and Laura Sevilla-Lara and Deqing Sun and Jonghyun Kim and Joongkyu Kim},
  title = {{Adaptive Prototype Learning and Allocation for Few-Shot Segmentation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  url = {https://openreview.net/forum?id=k-vV0D91kZHc},
}
Figure