TL;DR
FSSAM (Few-Shot Segment Anything Model) successfully adapts the powerful SAM 2 video segmentation model for image-based Few-Shot Segmentation (FSS). By introducing a "Pseudo Prompt Generator" and iterative memory refinement, researchers bridge the gap between SAM 2's video-matching logic and the class-level matching required for FSS, achieving a new state-of-the-art mIoU of 81.0% on PASCAL-5$^i$.
The Challenge: Identity vs. Category Matching
Few-Shot Segmentation (FSS) is the "holy grail" of flexible computer vision: the ability to segment a completely new object class after seeing only one or two examples. Traditional methods often overfit on the specific classes they were trained on, failing to generalize to novel objects.
While foundation models like the original Segment Anything Model (SAM) have helped, the recent SAM 2 introduced a powerful memory-based matching mechanism specifically designed for video. However, applying SAM 2 directly to FSS reveals a fundamental mismatch:
- SAM 2's Design: It is trained to match the exact same object identity across different video frames.
- FSS's Requirement: It must match different objects that belong to the same category (e.g., matching a golden retriever in a support image to a poodle in a query image).
This "intra-class gap" makes SAM 2’s native matching incompatible with FSS. Out of the box, the model struggles to recognize that two different-looking objects are actually the same type.
Proposed Solution: FSSAM
To make SAM 2 "FSS-friendly," the authors propose FSSAM, which introduces three key modules to adapt the matching process without losing the foundation model's pre-trained knowledge:
- Pseudo Prompt Generator (PPG): Since SAM 2 expects to match a query object against a known memory of that same object, PPG uses a frozen DINOv2 model to create a "best guess" (pseudo-mask) of where the object might be in the query image. This "pseudo-memory" tricks SAM 2 into performing its high-quality "same-object" matching.
- Iterative Memory Refinement (IMR): The initial pseudo-masks are often noisy or incomplete. IMR iteratively pulls more foreground features into the memory while using the support image as a "filter" to ensure background noise doesn't leak in.
- Support-Calibrated Memory Attention (SCMA): Even with refinement, some background features might end up in the memory. SCMA uses the support image's features to "calibrate" the attention scores, suppressing regions in the memory that do not look like the target class.
Crucially, the authors keep most of SAM 2 frozen, only fine-tuning the memory encoder, attention layers, and mask decoder.
Key Results and Performance
FSSAM sets new state-of-the-art records across standard FSS benchmarks:
- PASCAL-5$^i$: Achieved 81.0% 1-shot mIoU, a significant 4.2% jump over the previous best foundation-based method (FounFSS).
- COCO-20$^i$: Achieved 62.3% 1-shot mIoU, outperforming existing baselines on this more challenging dataset.
- Generalization: Tests on LVIS-92$^i$ and PASCAL-Part proved the model can handle diverse, fine-grained categories without further training.
- Efficiency: Despite its robust performance, the model maintains a manageable parameter count (~132M) compared to massive competitors (900M+) and runs at roughly 2.8 FPS.
Qualitative results show the model excels at "cleaning up" masks—removing background objects that previous models would have mistakenly included.
Limitations and Future Work
The primary failure mode of FSSAM is its Initial Guess Dependency. Because the system relies on the Pseudo Prompt Generator (PPG) to start the process, if the initial DINOv2-based guess is completely wrong (e.g., it misses the object entirely or the foreground and background are too similar), the iterative refinement has nothing to build upon. Future work will likely focus on an error correction module to help the model recover when initial pseudo-prompts are misleading.
Summary updated