SANSA: Unleashing the Hidden Semantics in SAM2 for Few-Shot Segmentation
Claudia Cuttano, Gabriele Trivigno, Giuseppe Averta, Carlo Masone
Abstract
Few-shot segmentation aims to segment unseen object categories from just a handful of annotated examples. This requires mechanisms that can both identify semantically related objects across images and accurately produce segmentation masks. We note that Segment Anything 2 (SAM2), with its prompt-and-propagate mechanism, offers both strong segmentation capabilities and a built-in feature matching process. However, we show that its representations are entangled with task-specific cues optimized for object tracking, which impairs its use for tasks requiring higher level semantic understanding. Our key insight is that, despite its class-agnostic pretraining, SAM2 already encodes rich semantic structure in its features. We propose SANSA (Semantically AligNed Segment Anything 2), a framework that makes this latent structure explicit, and repurposes SAM2 for few-shot segmentation through minimal task-specific modifications. SANSA achieves state-of-the-art performance on few-shot segmentation benchmarks specifically designed to assess generalization, outperforms generalist methods in the popular in-context setting, supports various prompts flexible interaction via points, boxes, or scribbles, and remains significantly faster and more compact than prior approaches. Code is available at https://github.com/ClaudiaCuttano/SANSA.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f6af3a2b-57fc-4251-99a2-7a5f2f6cfaedCited by top-tier papers2
- INSID3: Training-Free In-Context Segmentation with DINOv3Claudia Cuttano, Gabriele Trivigno, Christoph Reich, Daniel Cremers et al.CVPR 2026 · 13 citations
- MARCO: Navigating the Unseen Space of Semantic CorrespondenceClaudia Cuttano, Gabriele Trivigno, Carlo Masone, Stefan RothCVPR 2026 · 4 citations
Builds on48
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Segment AnythingAlexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao et al.ICCV 2023 · 13,211 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
Related papers
- APSeg: Auto-Prompt Network for Cross-Domain Few-Shot Semantic SegmentationWeizhao He, Yang Zhang, Wei Zhuo, Linlin Shen et al.CVPR 2024
- MaskSAM: Auto-Prompt SAM with Mask Classification for Volumetric Medical Image SegmentationBin Xie, Hao Tang, Bin Duan, Dawen Cai et al.ICCV 2025 · 7 citations
- MM-Prompt: Multi-modality and Multi-granularity Prompts for Few-Shot SegmentationHang Xiong, Runmin Cong, Jinpeng Chen, Chen Zhang et al.ACM MM 2025
- OFL-SAM2: Prompt SAM2 with Online Few-shot Learner for Efficient Medical Image SegmentationMeng Lan, Lefei Zhang, Xiaomeng LiAAAI 2026
- Bridge the Points: Graph-based Few-shot Segment Anything SemanticallyAnqi Zhang, Guangyu Gao, Jianbo Jiao, Chi Harold Liu et al.NeurIPS 2024 · 56 citations
