A Simple yet Powerful Instance-Aware Prompting Framework for Training-free Camouflaged Object Segmentation

Chao Yin, Jide Li, Xiaoqiang Li

Abstract

Camouflaged Object Segmentation (COS) remains highly challenging due to the intrinsic visual similarity between target objects and their surroundings. While training-based COS methods achieve good performance, their performance degrades rapidly with increased annotation sparsity. To circumvent this limitation, recent studies have explored training-free COS methods, leveraging the Segment Anything Model (SAM) by automatically generating visual prompts from a single task-generic prompt (e.g., "camouflaged animal") uniformly applied across all test images. However, these methods typically produce only semantic-level visual prompts, causing SAM to output coarse semantic masks and thus failing to handle scenarios with multiple discrete camouflaged instances effectively. To address this critical limitation, we propose a simple yet powerful Instance-Aware Prompting Framework (IAPF), the first training-free COS pipeline that explicitly converts a task-generic prompt into fine-grained instance masks. Specifically, the IAPF comprises three steps: (1) Text Prompt Generator, utilizing task-generic queries to prompt a Multimodal Large Language Model (MLLM) for generating image-specific foreground and background tags; (2) Instance Mask Generator, leveraging Grounding DINO to produce precise instance-level bounding box prompts, alongside the proposed Single-Foreground Multi-Background Prompting strategy to sample region-constrained point prompts within each box, enabling SAM to yield a candidate instance mask; (3) Self-consistency Instance Mask Voting, which selects the final COS prediction by identifying the candidate mask most consistent across multiple candidate instance masks. Extensive evaluations on standard COS benchmarks demonstrate that the proposed IAPF significantly surpasses existing state-of-the-art training-free COS methods.

Introduction

Camouflaged Object Segmentation (COS) is notoriously difficult because targets are designed to blend perfectly into their surroundings. While the Segment Anything Model (SAM) has revolutionized general segmentation, it requires precise visual prompts (points or boxes) to work well. Existing "training-free" COS methods attempt to automate this by using general prompts like "camouflaged animal." However, these methods typically generate semantic-level prompts—essentially one giant box or a messy cloud of points covering everything that looks like an animal. This leads to two major failures: mask bleeding, where multiple discrete objects are merged into a single coarse blob, and background confusion, where a single background tag is insufficient to distinguish hidden targets from complex environments.

The Instance-Aware Prompting Framework (IAPF)

The proposed IAPF keeps all underlying models frozen and operates in three distinct stages to upgrade visual prompts from "semantic-level" to "instance-level."

The IAPF architecture consists of a Text Prompt Generator, an Instance Mask Generator featuring the SFMBP strategy, and a Self-consistency Instance Mask Voting mechanism.

1. Text Prompt Generator

The framework utilizes a Multimodal Large Language Model (MLLM), such as LLaVA-1.5, to analyze the image and generate specific foreground tags (e.g., "bird") and multiple background tags (e.g., "rocks," "dirt"). This moves away from generic "camouflaged object" labels toward image-specific descriptions.

2. Instance Mask Generator

This core component handles the transition to instance-level awareness:

  • Box Prompting: An open-vocabulary detector (Grounding DINO) enumerates all potential instances of the foreground tag.
  • Single-Foreground Multi-Background Prompting (SFMBP): For each detected box, CLIP heatmaps are used to sample points. By contrasting the foreground tag against multiple background tags and normalizing scores locally within each box, the system ensures SAM receives high-quality points for every individual instance.
  • Mask Prediction: Each box-point triplet is fed to SAM to produce individual instance masks.

3. Self-consistency Instance Mask Voting (SIMV)

To mitigate the stochastic nature of MLLMs, the pipeline runs multiple times with synonymous prompts. The framework then selects the most consistent result across these runs to ensure robustness.

Experimental Results

IAPF sets a new standard for training-free COS, often outperforming even weakly supervised methods that use scribbles or points for training.

Qualitative comparison of IAPF against state-of-the-art training-free methods across various challenging camouflaged scenarios.

Quantitative Performance

On the COD10K-TEST dataset, IAPF achieved an $S_\alpha$ (structure-measure) of 0.856, significantly outperforming previous training-free leaders like RDVP-MSD (0.825) and GenSAM (0.783). In scenes with three or more camouflaged objects, IAPF maintained high accuracy while competing methods saw performance drops of 20-40% due to instance separation struggles.

Zero-Shot Generalization

The framework demonstrates strong utility in real-world scenarios. On the ACOD-12K agricultural dataset, IAPF outperformed the next best training-free method by a wide margin (0.603 vs 0.478 in $S_\alpha$), proving its utility in "in-the-wild" applications.

Conclusion

The Instance-Aware Prompting Framework (IAPF) demonstrates that SAM's limitations in COS are primarily due to prompt precision rather than segmentation power. By moving from "semantic-level" to "instance-level" prompts through local normalization and multi-background contrast, IAPF achieves state-of-the-art performance without task-specific fine-tuning. While computational overhead remains a consideration for real-time use, the framework's detector-agnostic design allows it to benefit from future improvements in open-vocabulary detection.

Summary updated

Abstract

Camouflaged Object Segmentation (COS) remains highly challenging due to the intrinsic visual similarity between target objects and their surroundings. While training-based COS methods achieve good performance, their performance degrades rapidly with increased annotation sparsity. To circumvent this limitation, recent studies have explored training-free COS methods, leveraging the Segment Anything Model (SAM) by automatically generating visual prompts from a single task-generic prompt (\textit{e.g.}, "\textit{camouflaged animal}") uniformly applied across all test images. However, these methods typically produce only semantic-level visual prompts, causing SAM to output coarse semantic masks and thus failing to handle scenarios with multiple discrete camouflaged instances effectively. To address this critical limitation, we propose a simple yet powerful \textbf{I}nstance-\textbf{A}ware \textbf{P}rompting \textbf{F}ramework (IAPF), the first training-free COS pipeline that explicitly converts a task-generic prompt into fine-grained instance masks. Specifically, the IAPF comprises three steps: (1) Text Prompt Generator, utilizing task-generic queries to prompt a Multimodal Large Language Model (MLLM) for generating image-specific foreground and background tags; (2) \textbf{Instance Mask Generator}, leveraging Grounding DINO to produce precise instance-level bounding box prompts, alongside the proposed Single-Foreground Multi-Background Prompting strategy to sample region-constrained point prompts within each box, enabling SAM to yield a candidate instance mask; (3) Self-consistency Instance Mask Voting, which selects the final COS prediction by identifying the candidate mask most consistent across multiple candidate instance masks. Extensive evaluations on standard COS benchmarks demonstrate that the proposed IAPF significantly surpasses existing state-of-the-art training-free COS methods.
BibTeX
@misc{yin2025simple,
  author = {Chao Yin and Jide Li and Xiaoqiang Li},
  title = {{A Simple yet Powerful Instance-Aware Prompting Framework for Training-free Camouflaged Object Segmentation}},
  year = {2025},
  eprint = {2508.06904},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.06904},
}
Figure