# ViRefSAM: Visual Reference-Guided Segment Anything Model for Remote Sensing Segmentation

Source: [ViRefSAM: Visual Reference-Guided Segment Anything Model for Remote Sensing Segmentation](<https://www.sota2.com/research/paper/68fa79c81e209131cea7f575>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T05:05:34.469Z

Authors: Hanbo Bi, Yulong Xu, Ya Li, Yongqiang Mao, Boyuan Tong, Chongyang Li, Chunbo Lang, Wenhui Diao, Hongqi Wang, Yingchao Feng, Xian Sun

Published: 2025-07-03T04:06:04.000Z

## 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-5$^i$, LoveDA-2$^i$, and COCO-20$^i$, 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.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Exo-to-Ego object correspondence on Ego-Exo4D Correspondences v2 (test)](<https://www.sota2.com/research/sota/exo-to-ego-object-correspondence-on-ego-exo4d-correspondences-v2-test.md>): Exo-to-Ego object correspondence; Ego-Exo4D Correspondences v2 (test); IoU: 42.2.

- [Ego-to-Exo object correspondence on Ego-Exo4D Correspondences v2 (test)](<https://www.sota2.com/research/sota/ego-to-exo-object-correspondence-on-ego-exo4d-correspondences-v2-test.md>): Ego-to-Exo object correspondence; Ego-Exo4D Correspondences v2 (test); IoU: 29.2.

- [Cross-view Object Correspondence on Ego-Exo4D v2 (test)](<https://www.sota2.com/research/sota/cross-view-object-correspondence-on-ego-exo4d-v2-test.md>): Cross-view Object Correspondence; Ego-Exo4D v2 (test); Ego Query IoU: not recorded.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2507.02294>)

[PDF](<https://arxiv.org/pdf/2507.02294.pdf>)
