CFCamo: A Counterfactual Detect-or-Abstain Framework for Camouflaged Object Detection
Paper • 2606.11231 • Published
How to use cfcamo/cfcamo-rl-lora with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("/autodl-fs/data/cfcamo/sft_artifacts/sft_v4_r1to1_4b/final")
model = PeftModel.from_pretrained(base_model, "cfcamo/cfcamo-rl-lora")LoRA adapter for CFCamo: trained on top of cfcamo/cfcamo-sft-4b with Counterfactual Sequence Policy Optimization (CSPO) and a Counterfactual Paired Reward (CPR). This is the paper LoRA checkpoint at step 252 (ε=0.5) over the 4040-pair RL set — the single-large-GPU alternative to cfcamo/cfcamo-rl-full.
from transformers import AutoModelForImageTextToText, AutoProcessor
from peft import PeftModel
base = AutoModelForImageTextToText.from_pretrained(
"cfcamo/cfcamo-sft-4b", torch_dtype="auto", device_map="auto",
).eval()
model = PeftModel.from_pretrained(base, "cfcamo/cfcamo-rl-lora").eval()
processor = AutoProcessor.from_pretrained("cfcamo/cfcamo-sft-4b")
# (use the same detect-or-abstain prompt as cfcamo-rl-full — see that model card)
Or merge into a single standalone HF model:
python scripts/eval/merge_lora.py \
--base checkpoints/cfcamo-sft-4b \
--lora checkpoints/cfcamo-rl-lora \
--out checkpoints/cfcamo-rl-lora-merged
git clone https://github.com/suhang2000/CFCamo && cd CFCamo
pip install -e ".[eval]"
huggingface-cli download cfcamo/cfcamo-sft-4b --local-dir checkpoints/cfcamo-sft-4b
huggingface-cli download cfcamo/cfcamo-rl-lora --local-dir checkpoints/cfcamo-rl-lora
huggingface-cli download --repo-type dataset cfcamo/CF-COD --local-dir data/cfcod
# (place upstream COD into data/cfcod/<source>/{Imgs,GT}/ — see dataset card)
python scripts/eval/merge_lora.py \
--base checkpoints/cfcamo-sft-4b \
--lora checkpoints/cfcamo-rl-lora \
--out checkpoints/cfcamo-rl-lora-merged
python scripts/eval/eval_cfcod.py \
--cf-manifest data/cfcod/test/cf_manifest_test.jsonl \
--data-root data/cfcod \
--models "CFCamo-LoRA=checkpoints/cfcamo-rl-lora-merged" \
--out-dir results/cfcod_eval
@article{li2026cfcamo,
title = {{CFCamo}: A Counterfactual Detect-or-Abstain Framework for Camouflaged Object Detection},
author = {Li, Suhang and Yoshie, Osamu and Ieiri, Yuya},
journal = {arXiv preprint arXiv:2606.11231},
year = {2026}
}