[Paper Review] Prototype as Query for Few Shot Semantic Segmentation
This paper proposes ProtoFormer, a novel few-shot semantic segmentation framework that treats the support set prototype as a conditional query in a Transformer decoder, enabling attention to focus on relevant semantic features in the query image. By modeling query features as keys and values, the method captures spatial details more effectively than prototype-based or pixel-wise methods, achieving state-of-the-art performance on COCO-20i with only 0.6M learnable parameters.
Few-shot Semantic Segmentation (FSS) was proposed to segment unseen classes in a query image, referring to only a few annotated examples named support images. One of the characteristics of FSS is spatial inconsistency between query and support targets, e.g., texture or appearance. This greatly challenges the generalization ability of methods for FSS, which requires to effectively exploit the dependency of the query image and the support examples. Most existing methods abstracted support features into prototype vectors and implemented the interaction with query features using cosine similarity or feature concatenation. However, this simple interaction may not capture spatial details in query features. To alleviate this limitation, a few methods utilized all pixel-wise support information via computing the pixel-wise correlations between paired query and support features implemented with the attention mechanism of Transformer. These approaches suffer from heavy computation on the dot-product attention between all pixels of support and query features. In this paper, we propose a simple yet effective framework built upon Transformer termed as ProtoFormer to fully capture spatial details in query features. It views the abstracted prototype of the target class in support features as Query and the query features as Key and Value embeddings, which are input to the Transformer decoder. In this way, the spatial details can be better captured and the semantic features of target class in the query image can be focused. The output of the Transformer-based module can be viewed as semantic-aware dynamic kernels to filter out the segmentation mask from the enriched query features. Extensive experiments on PASCAL-$5^{i}$ and COCO-$20^{i}$ show that our ProtoFormer significantly advances the state-of-the-art methods.
Motivation & Objective
- To address spatial inconsistency between support and query images in few-shot semantic segmentation.
- To improve feature interaction between query and support images beyond simple prototype matching or full pixel-wise attention.
- To reduce computational cost while preserving fine-grained spatial details in segmentation.
- To develop a lightweight yet effective method that generalizes well to unseen classes with few annotated examples.
- To explore the potential of using prototypes as conditional queries in Transformers for few-shot segmentation.
Proposed method
- The method treats the class-wise prototype from support images as a learnable query embedding in a Transformer decoder.
- Query features from the query image are used as keys and values in the Transformer decoder.
- The output of the Transformer decoder acts as semantic-aware dynamic kernels to refine the segmentation mask from enriched query features.
- The framework integrates a pixel decoder module to generate final segmentation masks after feature refinement.
- The model uses a shared backbone (e.g., ResNet50) for feature extraction from both support and query images.
- The architecture is end-to-end trainable with cross-entropy and Dice loss for segmentation supervision.
Experimental results
Research questions
- RQ1Can treating the support prototype as a query in a Transformer decoder improve feature alignment between support and query images?
- RQ2Does this query-based attention mechanism outperform traditional prototype matching and full pixel-wise attention in few-shot semantic segmentation?
- RQ3Can the proposed method achieve state-of-the-art performance with significantly fewer parameters than existing methods?
- RQ4How sensitive is the model’s performance to the number of Transformer layers or feature channels?
- RQ5Does the prototype-as-query mechanism enhance generalization on complex, diverse datasets like COCO-20i?
Key findings
- ProtoFormer achieves new state-of-the-art performance on COCO-20i, surpassing DCAMA by 3.5% and 2.8% in mean mIoU for 1-shot and 5-shot segmentation under the ResNet101 backbone.
- On PASCAL-5i, ProtoFormer improves the baseline by 0.9% and 1.0% in mean mIoU for 1-shot and 5-shot settings, respectively, with only 0.03M additional parameters.
- The method achieves SOTA results using only 0.6M learnable parameters, significantly fewer than DCAMA, demonstrating high parameter efficiency.
- Ablation studies show that the model is robust to the number of Transformer decoder layers, with 1 layer already yielding optimal performance.
- The model maintains strong performance on challenging folds of PASCAL-5i and generalizes well to COCO-20i, indicating strong generalization ability.
- Qualitative results show that ProtoFormer reduces misclassification of background as foreground and improves boundary localization compared to baseline methods.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.