ViRefSAM: Visual Reference-Guided Segment Anything Model for Remote Sensing Segmentation
- 3 February 2026
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Geoscience and Remote Sensing
- Vol. 64 (01962892) , 1-20
Abstract
The Segment Anything Model (SAM), with its prompt-driven paradigm, exhibits strong generalization in generic segmentation tasks. However, applying SAM to remote sensing (RS) images still faces two major challenges. First, manually constructing precise prompts for each image (e.g., points or boxes) is labor-intensive and inefficient, especially in RS scenarios with dense small objects or spatially fragmented distributions. Second, SAM lacks domain adaptability, as it is pre-trained primarily on natural images and struggles to capture RS-specific semantics and spatial characteristics, especially when segmenting novel or unseen classes. To address these issues, inspired by few-shot learning, we propose ViRefSAM, a novel framework that guides SAM utilizing only a few annotated reference images that contain class-specific objects. Without requiring manual prompts, ViRefSAM enables automatic segmentation of class-consistent objects across RS images. Specifically, ViRefSAM introduces two key components while keeping SAM’s original architecture intact: (1) a Visual Contextual Prompt Encoder that extracts class-specific semantic clues from reference images and generates object-aware prompts via contextual interaction with target images; and (2) a Dynamic Target Alignment Adapter, integrated into SAM’s image encoder, which mitigates the domain gap by injecting class-specific semantics into target image features, enabling SAM to dynamically focus on task-relevant regions. Extensive experiments on three few-shot segmentation benchmarks, including iSAID-5i, LoveDA-2i, and COCO-20i, demonstrate that ViRefSAM enables accurate and automatic segmentation of unseen classes by leveraging only a few reference images, and consistently outperforms existing few-shot segmentation methods across diverse datasets.Keywords
All Related Versions
Funding Information
- National Natural Science Foundation of China (62301538)
This publication has 92 references indexed in Scilit:
- STAMF: Synergistic transformer and mamba fusion network for RGB-Polarization based underwater salient object detectionInformation Fusion, 2025
- IRSAM: Advancing Segment Anything Model for Infrared Small Target Detection2024
- AgMTR: Agent Mining Transformer for Few-Shot Segmentation in Remote SensingInternational Journal of Computer Vision, 2024
- Few-Shot Segmentation via Divide-and-Conquer ProxiesInternational Journal of Computer Vision, 2023
- Self-support Few-Shot Semantic Segmentation2022
- Adaptive Agent Transformer for Few-Shot Segmentation2022
- Part-Aware Prototype Network for Few-Shot Semantic Segmentation2020
- A new fully convolutional neural network for semantic segmentation of polarimetric SAR imagery in complex land cover ecosystemISPRS Journal of Photogrammetry and Remote Sensing, 2019
- Microsoft COCO: Common Objects in Context2014
- The Pascal Visual Object Classes (VOC) ChallengeInternational Journal of Computer Vision, 2009