Papers › Seg-R1: Segmentation Can Be Surprisingly Simple with Reinforcement Learning

Seg-R1: Segmentation Can Be Surprisingly Simple with Reinforcement Learning

27 Jun 2025arXiv:2506.22624archive 2025-07-28

Zuyao You, Zuxuan Wu

We present Seg-R1, a preliminary exploration of using reinforcement learning (RL) to enhance the pixel-level understanding and reasoning capabilities of large multimodal models (LMMs). Starting with foreground segmentation tasks, specifically camouflaged object detection (COD) and salient object detection (SOD), our approach enables the LMM to generate point and bounding box prompts in the next-token fashion, which are then used to guide SAM2 in producing segmentation masks. We introduce Group Relative Policy Optimization (GRPO) into the segmentation domain, equipping the LMM with pixel-level comprehension through a carefully designed training strategy. Notably, Seg-R1 achieves remarkable performance with purely RL-based training, achieving .873 S-measure on COD10K without complex model modification. Moreover, we found that pure RL training demonstrates strong open-world generalization. Despite being trained solely on foreground segmentation image-mask pairs without text supervision, Seg-R1 achieves impressive zero-shot performance on referring segmentation and reasoning segmentation tasks, with 71.4 cIoU on RefCOCOg test and 56.7 gIoU on ReasonSeg test, outperforming models fully supervised on these datasets.

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="2506.22624")

Code

Syntology Ran 15 of 23 code samples harvested from 2 repositories linked to this paper; 8 have no recorded run. Of those that ran: 8 ran · our draft was wrong; 1 ran · fixture could not drive it; 6 ran with no contract checked.

By repository: official repository: 6 samples from 1 repository, 6 ran; community (archive-listed): 17 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

geshang777/Seg-R1 officialmentioned on GitHubpytorch report
geshang777/FOCUS mentioned on GitHubpytorchApache-2.0 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

23 samples harvested; 15 ran; 0 honoured the contract we drafted; 8 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.

8ran · our draft was wrong
1ran · fixture could not drive it
6ran
8unverified

Licence: 0 of the 23 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

parse_custom_format geshang777/Seg-R1/demo/seg_r1_web_demo.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 90862d4542046d4e · report
parse_custom_format geshang777/Seg-R1/eval/eval_referring_segmentation.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 1d256130c02aa3e9 · report
prepare_message geshang777/Seg-R1/eval/eval_referring_segmentation.py official repository ran · our draft was wrong Apache-2.0 (permissive) · be1289f57ae4d5ad · report
prepare_test_messages geshang777/Seg-R1/eval/eval_foreground_segmentation.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 01df73ec0b6daf48 · report
resize_image_to_base64 geshang777/Seg-R1/eval/eval_foreground_segmentation.py official repository ran · our draft was wrong Apache-2.0 (permissive) · f5272a5a345c7d45 · report
resize_to_base64 geshang777/Seg-R1/eval/eval_referring_segmentation.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 038e4fd33f4e3c0e · report
compute_num_params geshang777/FOCUS/focus/evaluation/utils.py community (archive-listed) ran Apache-2.0 (permissive) · 8b40bb3f5347ccd5 · report
crop_with_mask geshang777/FOCUS/focus/modeling/clip_refiner/utils.py community (archive-listed) ran Apache-2.0 (permissive) · 4b40d7fecc852bbe · report
cross_entropy geshang777/FOCUS/focus/modeling/matcher.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 63e6e57b587c3aa8 · report
expand_box geshang777/FOCUS/focus/modeling/clip_refiner/utils.py community (archive-listed) ran Apache-2.0 (permissive) · 2fc0075c2a14b806 · report
get_reference_points geshang777/FOCUS/focus/modeling/edge_enhancer/edge_enhancer.py community (archive-listed) ran Apache-2.0 (permissive) · 8073d48cbfc0f7ad · report
mask2box geshang777/FOCUS/focus/modeling/clip_refiner/utils.py community (archive-listed) ran Apache-2.0 (permissive) · 50372092a6e364ac · report
time_text geshang777/FOCUS/focus/evaluation/utils.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 14982a5b13861f94 · report
window_partition geshang777/FOCUS/focus/modeling/backbone/dinov2.py community (archive-listed) ran · fixture could not drive it fingerprinted Apache-2.0 (permissive) · f9fd6241d935f07b · report
window_reverse geshang777/FOCUS/focus/modeling/backbone/dinov2.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · fb32094c6dbece71 · report
batch_dice_loss geshang777/FOCUS/focus/modeling/matcher.py community (archive-listed) unverified Apache-2.0 (permissive) · bc2cb481a75c370d · report
batch_sigmoid_ce_loss geshang777/FOCUS/focus/modeling/matcher.py community (archive-listed) unverified Apache-2.0 (permissive) · 1edd24985036b0bf · report
calculate_uncertainty geshang777/FOCUS/focus/modeling/criterion.py community (archive-listed) unverified Apache-2.0 (permissive) · 2dcb8123d89bb1ff · report
deform_inputs geshang777/FOCUS/focus/modeling/edge_enhancer/edge_enhancer.py community (archive-listed) unverified Apache-2.0 (permissive) · 16369aff5471aa71 · report
dice_loss geshang777/FOCUS/focus/modeling/criterion.py community (archive-listed) unverified Apache-2.0 (permissive) · 89f75e54ff128be0 · report
drop_path geshang777/FOCUS/focus/modeling/edge_enhancer/edge_enhancer.py community (archive-listed) unverified Apache-2.0 (permissive) · 4134f673786a2abe · report
make_optimizer geshang777/FOCUS/focus/evaluation/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 6f80ac05b5e36f8e · report
sigmoid_ce_loss geshang777/FOCUS/focus/modeling/criterion.py community (archive-listed) unverified Apache-2.0 (permissive) · d0c61e8dba511aa3 · report

Tasks

Foreground SegmentationObject DetectionReasoning SegmentationReinforcement Learning (RL)Salient Object DetectionSegmentationobject-detection

Datasets

Introduced by this paper, per the archive.

FCoT

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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