Intermediate Prototype Mining Transformer for Few-Shot Semantic Segmentation

Yuanwei Liu, Nian Liu, Xiwen Yao, Junwei Han

Overview

Few-shot semantic segmentation (FSS) aims to segment novel objects in a "query" image given only a handful of annotated "support" images. The Intermediate Prototype Mining Transformer (IPMT) tackles a fundamental bottleneck in this domain: the "intra-class diversity" problem. Instead of forcing a rigid category representation from a few support images onto a query image, IPMT introduces a learnable intermediate prototype. This prototype iteratively mines deterministic information from the support set and adaptive knowledge from the query itself to bridge the visual gap.

The Challenge: Category Information Gap

Most existing FSS methods rely on prototypes—feature vectors extracted from the support images that represent the target category. However, this approach struggles with the category information gap.

For example, if the support images show a "dog" sitting in a park but the query image shows a "dog" running on a beach, the visual features (pose, background, lighting) differ significantly. Standard methods attempt to force the support prototype onto the query, which often leads to poor segmentation because the support prototype is too far from the query's actual feature distribution.

t-SNE visualization showing that support prototypes (orange) can be far from query prototypes (magenta) due to diversity, while the proposed intermediate prototypes (blue) bridge that gap.

The Solution: Intermediate Prototype Mining Transformer

To resolve this, the authors propose the Intermediate Prototype Mining Transformer (IPMT), which uses a learnable prototype as a dynamic bridge. The architecture operates iteratively through several layers, each consisting of two main phases:

  1. Intermediate Prototype Mining (IPM): The model uses Masked Attention to update a learnable prototype. It pulls "deterministic" information from the annotated support images and "adaptive" information from the current predicted mask of the query image. This ensures the prototype stays true to the class while adapting to the query's specific appearance.
  2. Query Activation (QA): The updated prototype is then used to "activate" or highlight the relevant regions in the query feature map, refining the segmentation mask for the next iteration.

To ensure the prototype learns effectively, the authors introduce a Duplex Segmentation Loss (DSL). This loss supervises the prototype by requiring it to accurately segment both the support images (where the ground truth is known) and the query image.

The overall architecture of IPMT, showing the iterative refinement of the prototype (G) and query features (Fq).

Key Insights

  • The Query is a Source of Knowledge: Traditional FSS treats the query as a passive target. IPMT treats the query as an active source of "adaptive" category information.
  • Iterative Refinement: By repeating the mining and activation process (typically across 5 iterations), the model progressively pulls the intermediate prototype closer to the query's feature space.
  • Bridging the Gap: Euclidean distance measurements confirm that the intermediate prototypes are mathematically closer to the query features than the original support prototypes are.
  • Masked Attention is Key: By using masks to restrict attention to only the object regions, the model prevents background noise from polluting the prototype.

Experimental Results

The model was evaluated on two standard FSS benchmarks: PASCAL-5$^i$ and the more challenging COCO-20$^i$. IPMT achieved new state-of-the-art (SOTA) results on both benchmarks, often by significant margins:

  • PASCAL-5$^i$: Reached 66.8% mIoU (1-shot) and 68.2% mIoU (5-shot) using a ResNet-50 backbone, outperforming previous leaders like CyCTR by over 2%.
  • COCO-20$^i$: Achieved 43.0% mIoU (1-shot) and 47.5% mIoU (5-shot), demonstrating strong performance even on complex, multi-object scenes.

Qualitatively, IPMT is much better at handling diverse poses and appearances where previous methods failed, producing much more accurate masks in cases with high intra-class diversity.

Limitations and Future Work

While highly effective, IPMT presents a computational trade-off: increasing the number of IPMT layers improves accuracy but also increases computational cost. The authors found 5 layers to be the optimal balance. Additionally, the iterative process relies on an initial query mask; if this initial guess is extremely poor, it might take more iterations or a more robust initialization to converge correctly. Future research may continue to focus on addressing inherent intra-class diversity in FSS rather than solely improving support-side feature extraction.

Summary updated

BibTeX
@inproceedings{liu2022intermediate,
  author = {Yuanwei Liu and Nian Liu and Xiwen Yao and Junwei Han},
  title = {{Intermediate Prototype Mining Transformer for Few-Shot Semantic Segmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=lkM-H05_wo1},
}
Figure