Papers
Topics
Authors
Recent
Search
2000 character limit reached

GFR-SAM: Training-Free Referring Camouflaged Object Segmentation via Cross-Image Prompting

Published 13 Jul 2026 in cs.CV | (2607.11732v1)

Abstract: Referring Camouflaged Object Detection (Ref-COD) requires segmenting hidden targets guided by reference cues. While supervised methods are annotation-heavy and training-free approaches via sparse point-prompting are sensitive to localization errors, we propose GFR-SAM, a robust three-stage training-free framework. GFR-SAM shifts the paradigm from fragile point-matching to a "Generate-Filter-Refine" pipeline. First, we introduce In-Context Exemplar-guided Segmentation, empowering SAM3 with cross-image inference to generate candidate masks via holistic visual exemplars, bypassing its native intra-image constraints. Second, a Region-Global Contrastive Filtering module ranks candidates through DINOv3-based prototypical alignment, effectively suppressing background distractors. Finally, a Geometric-Semantic Refinement module synergizes bounding box and text prompts to recover fine-grained boundaries and enhance instance recall. Evaluated on the R2C7K benchmark, GFR-SAM outperforms existing training-free methods by 8.7\% in weighted F-measure ($F_βw$) and competes with supervised state-of-the-art counterparts. Ultimately, this work underscores the potential of unlocking SAM3's latent capability for cross-image In-Context prompting, establishing a robust, training-free paradigm that effectively bridges the gap between general-purpose foundation models and specialized, label-intensive perception tasks without the need for task-specific fine-tuning.

Summary

  • The paper introduces a novel training-free framework that uses cross-image prompting to segment camouflaged objects.
  • It employs a three-stage Generate-Filter-Refine pipeline combining in-context exemplar encoding, semantic filtering with DINOv3, and geometric-semantic refinement.
  • Experimental results show improved weighted F-measure and robustness in occluded, low-contrast scenes, rivaling state-of-the-art supervised methods.

GFR-SAM: Training-Free Referring Camouflaged Object Segmentation via Cross-Image Prompting

Introduction and Motivation

The task of Referring Camouflaged Object Detection (Ref-COD) presents unique challenges in segmenting objects that are visually blended into their environments, guided by external reference cues. Conventional COD approaches are hampered by their inability to isolate specific targets in complex scenes, particularly under camouflage, occlusion, and multi-instance conditions. Existing supervised Ref-COD methods demand costly pixel-level annotations and are prone to overfitting to specific camouflage appearances, limiting generalization. Training-free approaches leveraging foundation models, especially via point prompts, suffer degradation from prompt localization errors and the indistinguishability of foreground-background boundaries.

GFR-SAM addresses this paradigm's fragility through a robust, three-stage pipeline—Generate-Filter-Refine—that activates the latent potential of the SAM3 foundation model for cross-image referencing. This framework is distinguished by: 1) in-context exemplar-guided mask generation, 2) semantic filtering via prototypical alignment with DINOv3 features, and 3) geometric-semantic refinement for enhanced recall and boundary precision. This holistic methodology outperforms previous training-free methods and even rivals state-of-the-art supervised models on the R2C7K benchmark. Figure 1

Figure 1: Comparative visualization of GFR-SAM versus prior training-free segmentation approaches, highlighting precise boundary recovery and robust instance isolation.

Methodology

Generate-Filter-Refine Pipeline

The GFR-SAM framework decomposes Ref-COD into three synergistic stages:

  1. In-Context Exemplar-guided Segmentation (Ice-Seg): Utilizes the Exemplar Encoder in SAM3 for cross-image inference. By extracting visual prototypes from reference images and injecting them into the mask decoder, candidate masks are produced, bypassing the fragility of point prompts and overcoming SAM3's native intra-image limitation.
  2. Region-Global Contrastive Filtering (RGCF): Employs DINOv3-based patch embeddings to generate a semantic similarity heatmap between reference prototype and each target patch. Candidate masks are scored based on region-global contrast, ensuring selection of the region most discriminative against background distractors.
  3. Geometric-Semantic Refinement (GSR): Combines bounding box prompts from selected candidates with category-level text prompts, leveraging SAM3's refinement capability for high-recall segmentation in complex multi-object scenes. Figure 2

    Figure 2: Overview of the GFR-SAM pipeline, depicting data flow and integration of reference and target information in each stage.

In-Context Exemplar Encoder

To achieve robust cross-image representation, GFR-SAM modifies the standard RoI pooling in SAM3 with Mask-guided Spatial Gating (MSG), which eliminates background noise by gating patch features with binarized masks. Spatial and coordinate embeddings are excluded, retaining only the visual prototype for cross-image inference. Extensive ablations validate that MSG significantly boosts performance by purifying reference features. Figure 3

Figure 3: Similarity heatmaps with and without Mask-guided Spatial Gating, demonstrating increased localization accuracy and suppression of background activations.

Region-Global Contrastive Filtering

RGCF ranks candidate masks using a ratio of area-weighted patch similarity to global image similarity, computed with DINOv3 backbone. This regional-global normalization mitigates false positives from camouflaged backgrounds and enables fine-grained selection even in cluttered scenes. Ablations on backbone selection show that DINOv3 ViT-B/16 yields optimal performance. Figure 4

Figure 4: Visualizations of the progressive filtering process—candidate masks, top-1 ranked mask, and refined output—demonstrating each module's contribution.

Geometric-Semantic Refinement

The GSR stage injects geometric (bounding box) and semantic (text) prompts concurrently. Empirical analysis shows that geometric-semantic co-prompting outperforms geometric-only and semantic-only alternatives, activating SAM3's class-aware priors for comprehensive instance coverage, especially in ambiguous, low-contrast environments.

Experimental Evaluation

Benchmarking and Numerical Results

GFR-SAM is evaluated on R2C7K, encompassing 64 categories and both camouflaged and salient reference images. Metrics include Structure Measure (SmS_m), Adaptive E-measure (αE\alpha E), Weighted F-measure (FβwF_\beta^w), and MAE (MM). GFR-SAM achieves a weighted F-measure improvement of 8.7% over previous training-free leaders and matches/surpasses recent fully supervised approaches. Single-object and multi-object subsets confirm robustness across diverse occlusion and scale regimes. Figure 5

Figure 5: Qualitative comparison across competitors; GFR-SAM exhibits superior boundary alignment and multi-instance recall in challenging scenarios.

Ablation Studies

MSG in Ice-Seg yields a >40% gain on FβwF_\beta^w. Increasing candidate shot number up to three improves recall and structure metrics, with diminishing returns beyond due to distractor redundancy. Figure 6

Figure 6: RGCF ablation with varying candidate selection (KK); Top-1 selection optimizes single-object precision, while larger KK enhances multi-instance coverage pre-refinement.

Setting a lower confidence threshold (Ï„=0.35\tau=0.35) in GSR is critical to recovering camouflaged instances with weak activations; stringent thresholds cause recall collapse. Figure 7

Figure 7: Performance degradation as confidence threshold increases, highlighting trade-offs between recall and false positive rate.

Feature encoder comparison establishes DINOv3 ViT-B/16 as optimal for RGCF, with competitive trade-offs in computational resources. Figure 8

Figure 8: Ablation on number of shots; optimal balance achieved at N=3N=3 due to proposal diversity and noise mitigation.

Failure Analysis and Limitations

Three primary failure modes are identified: salience-led distraction (dominant non-camouflaged objects misidentified), refinement-induced false positives (over-inclusiveness from co-prompting), and detection failure in low-contrast, highly occluded targets. Addressing these will require adaptive refinement gating and more robust exemplar encoding (e.g., multi-scale feature aggregation). Figure 9

Figure 9: Examples of failure cases, illustrating distractor dominance, over-segmentation, and target absence.

Implications and Future Directions

GFR-SAM demonstrates that general-purpose foundation models can be repurposed for specialized, label-intensive visual tasks via in-context, cross-image prompting without additional training. The plug-and-play nature offers scalability to real-world applications (e.g., agricultural monitoring, search-and-rescue, defense), especially in annotation-limited settings. Further research is warranted on adaptive refinement, intelligent candidate pruning, and enhanced feature fusion to mitigate current failure cases and support even more complex perceptual tasks.

Conclusion

GFR-SAM establishes a robust, training-free solution to Ref-COD by decoupling mask generation, filter refinement, and semantic-guided expansion. Through in-context exemplar encoding, semantic-global filtering, and geometric-semantic co-prompting, it achieves unprecedented performance among training-free paradigms and rivals supervised specialists. The results validate the latent generalization capacity of foundation models and provide a blueprint for annotation-free adaptation to domain challenges (2607.11732).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.