Papers › CAT-SAM: Conditional Tuning for Few-Shot Adaptation of Segment Anything Model

CAT-SAM: Conditional Tuning for Few-Shot Adaptation of Segment Anything Model

6 Feb 2024arXiv:2402.03631archive 2025-07-28

Aoran Xiao, Weihao Xuan, Heli Qi, Yun Xing, Ruijie Ren, Xiaoqin Zhang, Ling Shao, Shijian Lu

The recent Segment Anything Model (SAM) has demonstrated remarkable zero-shot capability and flexible geometric prompting in general image segmentation. However, SAM often struggles when handling various unconventional images, such as aerial, medical, and non-RGB images. This paper presents CAT-SAM, a ConditionAl Tuning network that adapts SAM toward various unconventional target tasks with just few-shot target samples. CAT-SAM freezes the entire SAM and adapts its mask decoder and image encoder simultaneously with a small number of learnable parameters. The core design is a prompt bridge structure that enables decoder-conditioned joint tuning of the heavyweight image encoder and the lightweight mask decoder. The bridging maps the prompt token of the mask decoder to the image encoder, fostering synergic adaptation of the encoder and the decoder with mutual benefits. We develop two representative tuning strategies for the image encoder which leads to two CAT-SAM variants: one injecting learnable prompt tokens in the input space and the other inserting lightweight adapter networks. Extensive experiments over 11 unconventional tasks show that both CAT-SAM variants achieve superior target segmentation performance consistently even under the very challenging one-shot adaptation setup. Project page: https://xiaoaoran.github.io/projects/CAT-SAM

PaperPDFCodeCode Syntology ran

In Syntology 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="2402.03631")

Code

Syntology Ran 5 of 9 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 5 ran with no contract checked.

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

weihao1115/cat-sam 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

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

5ran
4unverified

Licence: 0 of the 9 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 weihao1115/cat-sam. “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.

find_objects_from_mask weihao1115/cat-sam/cat_sam/datasets/misc.py official repository ran MIT (permissive) · ab8c035313260667 · report
find_random_points_in_objects weihao1115/cat-sam/cat_sam/datasets/misc.py official repository ran MIT (permissive) · 249675ff48bbd428 · report
get_json_dict_from_dir weihao1115/cat-sam/cat_sam/datasets/misc.py official repository ran MIT (permissive) · da50a8d659217d5d · report
to_numpy weihao1115/cat-sam/cat_sam/utils/evaluators.py official repository ran MIT (permissive) · fb3b97e28b328e7c · report
trunc_normal_ weihao1115/cat-sam/cat_sam/models/module_lib.py official repository ran MIT (permissive) · 9c42c0260c3c9229 · report
build_sam_vit_b weihao1115/cat-sam/cat_sam/models/segment_anything_ext/build_sam.py official repository unverified MIT (permissive) · f9bc5f31ce61cee8 · report
build_sam_vit_h weihao1115/cat-sam/cat_sam/models/segment_anything_ext/build_sam.py official repository unverified MIT (permissive) · 6b77c1f11fff3ed6 · report
build_sam_vit_l weihao1115/cat-sam/cat_sam/models/segment_anything_ext/build_sam.py official repository unverified MIT (permissive) · 3f8890e695469246 · report
to_2tuple weihao1115/cat-sam/cat_sam/models/module_lib.py official repository unverified MIT (permissive) · 87f16a36e0c0923b · report

Tasks

DecoderImage SegmentationSemantic Segmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdapterSAM

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