Organizations: Sichuan University · RAWMANTIC (Chengdu Yuan Sanwei Technology Co., Ltd.) · Tianjin University · University of Electronic Science and Technology of China · University of Bologna
Promptable segmentation tells a model where the target is but not what it looks like, so even correct point prompts can leak into the background or leave holes. We recast the task as correspondence matching and introduce MARS: each positive point becomes a visual prompt pairing its position with the image feature sampled there, and a ViT matches these prompts against the whole image before a DPT head decodes the mask. Trained on MARSET, a new dataset of high-resolution renders with pixel-accurate masks, MARS outperforms SAM and HQ-SAM in most settings, keeps improving as prompts are added, and transfers to specialized domains and one-shot segmentation.
Figures & tables
Figure 1: Overview of MARS. (a) A frozen SAM encoder (snowflake) feeds a DPT Upsample module, in parallel with a convolutional branch on the RGB image; their sum is the fused feature at 41 resolution. (b) Visual prompt tokens combine the fused feature sampled at each positive point with a point positional encoding (PE), while image tokens combine the fused feature with an image PE. (c) Both token sets are concatenated and processed jointly by a ViT, and a DPT head decodes the output mask. Flames mark trainable modules.
Figure 2: Visualization of various features. (a) SAM encoder: coarse, grid-like. (b) DPT upsampling: sharper, boundaries still coarse. (c) Conv branch: fine details, homogeneous. (d) Fused: fine details and discriminative responses.
Figure 3: Feature fusion modules. (a) A convolutional branch extracts local RGB features at 41 resolution. (b) DPT head consists of a DPT Upsample and a DPT Output module.
Figure 4: Visual prompts improve target localization. Adding the local image feature (b) to SAM’s point prompt (a) concentrates the mask logits (cosine similarity with the mask token) on the target and suppresses background responses.
Figure 5: Limitations of SAM-style decoding. With the same prompts, SAM’s decoder yields scattered, background-leaking responses, while our ViT-DPT decoder produces coherent target responses and cleaner masks.
Table 6
Configuration
# points (mIoU ↑ )
Model
Visual Prompt
Decoder
Feat. Fusion
Train Data
1
5
100
(a)
SAM [ 17 ]
✗
Two-way
✗
COCONut-S
55.19
68.23
60.08
(b)
+ Visual prompt
✓
Two-way
✗
COCONut-S
56.87
74.70
70.25
(c)
+ ViT-DPT dec.
✓
ViT-DPT
✗
COCONut-S
65.75
82.30
84.85
(d)
+ MARSET
✓
ViT-DPT
✗
MARSET
69.71
84.13
88.11
(e)
+ Fusion ( MARS )
✓
ViT-DPT
✓
MARSET
71.29
84.10
88.20
Table 2: Ablation study on the HQSeg-44K evaluation set (mIoU, %). Components are added progressively to SAM retrained on COCONut-S with a frozen encoder. Our final model is shaded.
SAM [ 17 ]
HQ-SAM [ 16 ]
MARS (ours)
Prompts
mIoU ↑
mBIoU ↑
mIoU ↑
mBIoU ↑
mIoU ↑
mBIoU ↑
COCO 2017
1 pt
53.69
49.12
52.70
47.88
73.28
66.20
5 pts
71.32
64.19
71.15
63.83
73.28
66.20
100 pts
46.08
38.98
55.93
48.29
75.17
66.84
COCONut-S
Table 3: Comparison with SAM and HQ-SAM with 1, 5 and 100 randomly sampled foreground points, identical for all methods. Each method reports mIoU and mBIoU (%, ↑ )
Figure 7: Zero-shot qualitative comparison of SAM, HQ-SAM, and MARS. Yellow dots indicate the 5 positive point prompts.
Figure 8: Qualitative results on real-world datasets. On columns: COD10K, CDS2K, CVC-ColonDB, and Leaf Disease. On rows: SAM, HQ-SAM, and MARS with 5-point prompts.
Figure 9: Qualitative one-shot results. Top: prompts generated by each method on the target image and overlay masks. Bottom: binary masks.
SAM
HQ-SAM
MARS (ours)
Dataset
Domain
mIoU ↑
mBIoU ↑
mIoU ↑
mBIoU ↑
mIoU ↑
mBIoU ↑
COD10K
Camouflage
75.00
65.22
76.95
67.25
78.89
69.52
Leaf disease
Agriculture
40.75
24.59
47.73
30.09
51.58
33.85
CDS2K
Industrial
46.62
39.71
50.84
42.87
56.54
47.71
CVC-ColonDB
Medical
62.78
46.99
68.85
49.92
80.56
61.42
Table 4: Cross-domain comparison of SAM, HQ-SAM and MARS (ours) on four datasets with 5 prompt points per target. Each method reports mIoU and mBIoU (%, ↑ ).
Method
mIoU ↑
mBIoU ↑
Time (s) ↓
Mem. (GB) ↓
PerSAM [ 40 ]
88.30
70.49
6.51
2.11
Matcher [ 21 ]
90.64
73.71
12.81
3.68
MARS (ours)
93.26
81.28
6.79
3.33
Table 5: One-shot comparison on PerSeg. The average runtime and peak GPU memory usage are measured on an RTX3080 GPU over the whole dataset.
Figure S3 : MARSET: ten scenes with three examples per scene. Each row shows three views of the scene named above it. GT overlays ground-truth masks on RGB images; Mask shows instance colors against a black background.
Model
Blocks
Params (M)
mIoU (%) ↑
1 pt
5 pts
100 pts
(b) +Visual prompt
2
4.06
56.87
74.70
70.25
SAM (widened)
24
321.17
66.45
79.88
31.41
(c) +ViT-DPT dec.
24
320.97
65.75
82.30
84.85
Table S1: Decoder capacity control on HQSeg-44K evaluation set.
Figure S4 : Qualitative exploration with text prompts. Colored overlays show the predicted masks, and dots mark the generated positive point prompts. The examples illustrate category-level selection, spatially qualified object selection, and selection by material.
Figure S9 : Qualitative transfer to camouflaged object segmentation on COD10K.
Figure S10 : Qualitative transfer to leaf lesion segmentation on Leaf Disease.
Figure S11 : Qualitative transfer to concealed industrial defect segmentation on CDS2K.
Figure S12 : Qualitative transfer to colorectal polyp segmentation on CVC-ColonDB.
Figure S13 : Additional one-shot segmentation comparisons on PerSeg.
Frozen segmentation foundation models often fail when the target class appears in a form that is weakly represented during pretraining. To address this problem, we introduce SegRAG, a retrieval-augmented inference-time spatial prompting pipeline for open-vocabulary semantic segmentation that uses frozen models without updating their weights. SegRAG builds a compact class-indexed memory from annotated references. When multiple references are available, Intra-Class Cohesion Distillation (ICCD) filters DINOv3 patch descriptors by cross-image foreground agreement. With one reference, foreground descriptors are retained directly without ICCD. Topographic Similarity Grounding (TSG) then turns high-similarity query regions into point prompts for SAM 3. In the matched five-shot comparison, SegRAG exceeds recent exemplar- and retrieval-based baselines on ADE20K-150, Cityscapes, and PC-59. It also improves over the SAM 3 text-only baseline by 1.15 to 3.92 mean Intersection over Union (mIoU) points. In the up-to-30-shot AgML agricultural domain-transfer evaluation, SegRAG raises mIoU from 25.27 to 59.24. It also recovers text-only failures, including cauliflower from 0.00 to 95.36 IoU and sugarbeet weed from 0.00 to 80.22 IoU. Controlled ablations show complementary contributions from ICCD, TSG point selection, and joint text-and-point prompting. SegRAG therefore formulates segmentation adaptation as an information organization and retrieval problem by maintaining annotated visual knowledge as an external, class-indexed memory that can guide a frozen segmentation model without weight updates. Code: https://github.com/boudiafA/SegRAG.
Modern referring image segmentation pipelines couple a vision-language model (VLM) for grounding with a promptable segmenter such as the Segment Anything Model (SAM) for mask generation. Prior training-free instances of this recipe consistently trail fine-tuned and reinforcement-learning (RL)-tuned specialists, and it has been unclear whether the gap comes from the VLM's grounding, SAM's capacity, or the prompt. We show that the gap is dominated by prompt ambiguity: a VLM-proposed bounding box (bbox) leaves SAM to guess which pixels inside the bbox belong to the object the expression denotes. Interior points are the natural disambiguator, but where they fall matters; prior work relies on naively sampled points that land on boundaries, distractors, and background clutter, and can even hurt performance compared to the bbox alone. Supervised and RL-tuned methods close this gap by training a VLM to predict better points; we show that this training is unnecessary. At a matched budget of five interior points, replacing naive sampling with stable, informative point selection improves cumulative Intersection-over-Union (cIoU) by 12-18 points across RefCOCO/+/g, with every model fixed. We turn this observation into PinPoint, a deterministic, training-free point selector that fuses four visual cues into a consensus map, selects compact, spatially diverse points away from boundaries, and uses the frozen VLM to label each point. Without any task-specific training, PinPoint matches supervised and RL-tuned specialists on the same stack while issuing only two VLM calls per query.
Pouya Sadeghi, Shawn He, Pedro Pablo Guerrero Vela +3
University of Waterloo · 2Critical ML, University of Waterloo · 3Apple
Promptable segmentation models provide a reusable interface, but direct transfer to automatic infrared small-target segmentation (IRSTD) exposes a mismatch between spatial prompts and target-domain mask responses. In a diagnostic using target-covering loose-box prompts deterministically derived from test reference masks, the best official SAM2.1 results are only 4.69%, 1.64%, and 2.28% IoU on NUAA-SIRST, NUDT-SIRST, and IRSTD-1K. We introduce SPARK-SAM (Self-Prompt Adaptation with Response Knowledge for SAM), which learns target-domain response knowledge and conditions the decoder through an image-conditioned joint self-prompt state. Training combines benchmark-mask supervision with reliability-aware response guidance. SPARK-SAM achieves 75.78%, 86.49%, and 68.34% IoU with 0.726M additional parameters, ranking first on two benchmarks among 14 retrained SAM variants and adaptations evaluated as automatic image-to-mask methods. The staged IRSTD-1K diagnostic shows that response adaptation reaches most of the final IoU before the predicted points acquire reliable target grounding. Prompt supervision aligns the predicted prompt candidates with target locations, and frozen-weight interventions measure output sensitivity to the joint self-prompt state. Matched ablations show consistent accuracy gains from response guidance and high-resolution prompt refinement across all three datasets. Code is available at https://github.com/Sakauma/SPARK-SAM.
Aji Mao, Zhenming Peng, Bailin Mu +1
School of Information and Communication Engineering, University of Electronic Science and Technology of China