Papers › Relax Image-Specific Prompt Requirement in SAM: A Single Generic Prompt for Segmenting...

Relax Image-Specific Prompt Requirement in SAM: A Single Generic Prompt for Segmenting Camouflaged Objects

12 Dec 2023arXiv:2312.07374archive 2025-07-28

Jian Hu, Jiayi Lin, Weitong Cai, Shaogang Gong

Camouflaged object detection (COD) approaches heavily rely on pixel-level annotated datasets. Weakly-supervised COD (WSCOD) approaches use sparse annotations like scribbles or points to reduce annotation effort, but this can lead to decreased accuracy. The Segment Anything Model (SAM) shows remarkable segmentation ability with sparse prompts like points. However, manual prompt is not always feasible, as it may not be accessible in real-world application. Additionally, it only provides localization information instead of semantic one, which can intrinsically cause ambiguity in interpreting the targets. In this work, we aim to eliminate the need for manual prompt. The key idea is to employ Cross-modal Chains of Thought Prompting (CCTP) to reason visual prompts using the semantic information given by a generic text prompt. To that end, we introduce a test-time adaptation per-instance mechanism called Generalizable SAM (GenSAM) to automatically enerate and optimize visual prompts the generic task prompt for WSCOD. In particular, CCTP maps a single generic text prompt onto image-specific consensus foreground and background heatmaps using vision-language models, acquiring reliable visual prompts. Moreover, to test-time adapt the visual prompts, we further propose Progressive Mask Generation (PMG) to iteratively reweight the input image, guiding the model to focus on the targets in a coarse-to-fine manner. Crucially, all network parameters are fixed, avoiding the need for additional training. Experiments demonstrate the superiority of GenSAM. Experiments on three benchmarks demonstrate that GenSAM outperforms point supervision approaches and achieves comparable results to scribble supervision ones, solely relying on general task descriptions as prompts. our codes is in: https://lwpyh.github.io/GenSAM/.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2312.07374")

Code

Syntology Ran 8 of 13 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 3 ran · our draft was wrong; 5 ran with no contract checked.

By repository: official repository: 13 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

jyLin8100/GenSAM officialmentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

13 samples harvested; 8 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

3ran · our draft was wrong
5ran
5unverified

Licence: 0 of the 13 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from jyLin8100/GenSAM. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

basic_clean jyLin8100/GenSAM/clip/simple_tokenizer.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 98f385d847636a3e · report
compute_num_params jyLin8100/GenSAM/utils.py official repository ran MIT (permissive) · 8b40bb3f5347ccd5 · report
fuse_mask jyLin8100/GenSAM/utils_model.py official repository ran MIT (permissive) · dfa1030744f2ab1a · report
get_pairs jyLin8100/GenSAM/clip/simple_tokenizer.py official repository ran · our draft was wrong MIT (permissive) · d919ae32e5e4e616 · report
resize_fn jyLin8100/GenSAM/datasets/wrappers.py official repository ran MIT (permissive) · 7c448639360af3b4 · report
time_text jyLin8100/GenSAM/utils.py official repository ran fingerprinted MIT (permissive) · 14982a5b13861f94 · report
to_mask jyLin8100/GenSAM/datasets/wrappers.py official repository ran MIT (permissive) · 68f0f6a323be1015 · report
whitespace_clean jyLin8100/GenSAM/clip/simple_tokenizer.py official repository ran · our draft was wrong fingerprinted MIT (permissive) · 9542161e9640b858 · report
build_model jyLin8100/GenSAM/clip/build_model.py official repository unverified MIT (permissive) · 1a165219e3845d5a · report
load jyLin8100/GenSAM/clip/clip.py official repository unverified MIT (permissive) · dc03e85a3091152d · report
make jyLin8100/GenSAM/datasets/datasets.py official repository unverified MIT (permissive) · 7fdb65394809a6a8 · report
register jyLin8100/GenSAM/datasets/datasets.py official repository unverified MIT (permissive) · 9687bf7a922f098a · report
set_save_path jyLin8100/GenSAM/utils.py official repository unverified MIT (permissive) · 7ab8ae87f1f425de · report

Tasks

Camouflaged Object Segmentation with a Single Task-generic PromptObject DetectionTest-time Adaptationobject-detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Camouflaged Object Segmentation with a Single Task-generic Prompt CAMO GenSAM E_{\phi} 0.775 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt CAMO GenSAM F_{\beta} 0.659 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt CAMO GenSAM MAE 0.113 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt CAMO GenSAM S_{\alpha} 0.719 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt COD10K GenSAM E_{\phi} 0.838 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt COD10K GenSAM F_{\beta} 0.681 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt COD10K GenSAM MAE 0.067 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt COD10K GenSAM S_{\alpha} 0.775 #3 of 3 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt Chameleon GenSAM E_{\phi} 0.807 #2 of 2 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt Chameleon GenSAM F_{\beta} 0.68 #2 of 2 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt Chameleon GenSAM MAE 0.09 #2 of 2 Archive leaderboard report
Camouflaged Object Segmentation with a Single Task-generic Prompt Chameleon GenSAM S_{\alpha} 0.764 #2 of 2 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: GenSAM

GenSAMSAM

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections