Abstract
Few-Shot Segmentation (FSS) aims to identify and segment novel object classes using minimal labeled examples. While the Segment Anything Model (SAM) provides powerful class-agnostic spatial grouping, its application to FSS is often hindered by a lack of semantic guidance. This paper introduces Foreground-Covering Prototype (FCP) generation, a framework that combines SAM's spatial precision with ResNet's semantic consistency. By transitioning from traditional prototype-to-pixel matching to a robust prototype-to-prototype strategy and utilizing an Attention-based Pseudo-Mask (APM), the proposed method achieves new state-of-the-art performance on standard benchmarks.
Introduction
The challenge of Few-Shot Segmentation (FSS) lies in generalizing to unseen categories with only a few support images. Recent advancements have sought to leverage the Segment Anything Model (SAM), which excels at zero-shot object boundary detection. However, SAM is inherently class-agnostic; it can segment "an object" but cannot identify "the target object" without external guidance.
Existing SAM-based FSS methods typically rely on "prototype-to-pixel" matching, where a single prototype derived from a support image is compared against every pixel in a query image. This approach often suffers from noise and fails to maintain class consistency, leading to inaccurate "pseudo-masks" that misidentify background elements as foreground.
Methodology
The authors propose a dual-pathway architecture designed to harmonize the "where" (spatial boundaries) and the "what" (semantic identity).
Dual-Pathway Feature Fusion
The model utilizes two distinct encoders to capture complementary information:
- SAM Image Encoder Features: Excellent for spatial aggregation and grouping pixels into coherent objects.
- ResNet Features: Excellent for maintaining "class consistency," ensuring that the semantic identity of an object is preserved across different images.
Attention-based Pseudo-Mask (APM)
A critical innovation is the discovery that cross-attention weights generated during SAM feature aggregation are significantly more accurate than traditional pseudo-masks. The model uses these weights to create an Attention-based Pseudo-Mask (APM), which guides the ResNet features to produce prototypes that are both spatially precise and semantically grounded.
Prototype-to-Prototype Matching
Unlike prior methods that match prototypes to query pixels, this framework generates prototypes for both support and query images. By performing prototype-to-prototype matching, the model establishes high-level relational correspondences. These matches are then used to generate visual prompts (points or boxes) for the SAM Mask Decoder, resulting in a more stable and less noisy segmentation process.
Experimental Results
The FCP method was rigorously evaluated on the PASCAL-5i and COCO-20i datasets using a cross-validation approach on novel classes.
- PASCAL-5i: Under the 1-shot setting, FCP achieved a mean Intersection over Union (mIoU) of 73.2%, outperforming the previous state-of-the-art, VRP-SAM (71.8%).
- COCO-20i: On this more complex dataset, FCP reached 52.5% mIoU, a substantial improvement over VRP-SAM's 50.2%.
Qualitative analysis demonstrates that FCP is particularly effective in cluttered environments. While baseline models often "leak" into background regions with similar textures, FCP maintains tight boundaries around the target object by matching at a higher level of abstraction.
Discussion and Conclusion
The success of FCP highlights the importance of matching at the appropriate level of abstraction. By shifting to prototype-to-prototype matching and leveraging internal attention mechanisms for pseudo-mask generation, the model effectively bridges the gap between SAM's spatial capabilities and the semantic requirements of FSS.
Despite its performance, the dual-encoder architecture introduces higher computational costs. Future research may focus on optimizing feature fusion or exploring more efficient iterative processes to reduce the memory footprint while maintaining high segmentation accuracy.
Summary updated