Papers › Text4Seg: Reimagining Image Segmentation as Text Generation

Text4Seg: Reimagining Image Segmentation as Text Generation

13 Oct 2024arXiv:2410.09855archive 2025-07-28

Mengcheng Lan, Chaofeng Chen, Yue Zhou, Jiaxing Xu, Yiping Ke, Xinjiang Wang, Litong Feng, Wayne Zhang

Multimodal Large Language Models (MLLMs) have shown exceptional capabilities in vision-language tasks; however, effectively integrating image segmentation into these models remains a significant challenge. In this paper, we introduce Text4Seg, a novel text-as-mask paradigm that casts image segmentation as a text generation problem, eliminating the need for additional decoders and significantly simplifying the segmentation process. Our key innovation is semantic descriptors, a new textual representation of segmentation masks where each image patch is mapped to its corresponding text label. This unified representation allows seamless integration into the auto-regressive training pipeline of MLLMs for easier optimization. We demonstrate that representing an image with 16×16 semantic descriptors yields competitive segmentation performance. To enhance efficiency, we introduce the Row-wise Run-Length Encoding (R-RLE), which compresses redundant text sequences, reducing the length of semantic descriptors by 74% and accelerating inference by 3×, without compromising performance. Extensive experiments across various vision tasks, such as referring expression segmentation and comprehension, show that Text4Seg achieves state-of-the-art performance on multiple datasets by fine-tuning different MLLM backbones. Our approach provides an efficient, scalable solution for vision-centric tasks within the MLLM framework.

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

Code

Syntology Ran 7 of 12 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 2 ran · fixture could not drive it; 4 ran with no contract checked.

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

mc-lan/text4seg officialmentioned in papermentioned on GitHubpytorchNOASSERTION 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

12 samples harvested; 7 ran; 0 honoured the contract we drafted; 5 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.

1ran · our draft was wrong
2ran · fixture could not drive it
4ran
5unverified

Licence: 12 of the 12 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 mc-lan/Text4Seg. “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.

collate_fn mc-lan/Text4Seg/ms-swift/text4seg/infer_refer_seg.py official repository ran licence not identified · pointer only · de467f8ba53ec4a4 · report
decode_mask mc-lan/text4seg/llava/eval/utils.py official repository ran · our draft was wrong licence not identified · pointer only · e5321304736f43a1 · report
decode_mask_s mc-lan/Text4Seg/ms-swift/text4seg/utils.py official repository ran licence not identified · pointer only · 6a0145687dd13bee · report
get_chunk mc-lan/Text4Seg/ms-swift/text4seg/infer_refer_seg.py official repository ran licence not identified · pointer only · fec9d7679b542a15 · report
get_rel_pos mc-lan/Text4Seg/ms-swift/text4seg/segment_anything/modeling/image_encoder.py official repository ran · fixture could not drive it no licence file found · pointer only · 733d7f0bedcb74c2 · report
translate_sequence mc-lan/Text4Seg/ms-swift/text4seg/utils.py official repository ran fingerprinted licence not identified · pointer only · 18d30ac60d5a69d2 · report
window_partition mc-lan/Text4Seg/ms-swift/text4seg/segment_anything/modeling/image_encoder.py official repository ran · fixture could not drive it fingerprinted no licence file found · pointer only · 105fa08885dc36cc · report
build_sam_vit_b mc-lan/Text4Seg/ms-swift/text4seg/segment_anything/build_sam.py official repository unverified no licence file found · pointer only · f9bc5f31ce61cee8 · report
build_sam_vit_h mc-lan/Text4Seg/ms-swift/text4seg/segment_anything/build_sam.py official repository unverified no licence file found · pointer only · 6b77c1f11fff3ed6 · report
build_sam_vit_l mc-lan/Text4Seg/ms-swift/text4seg/segment_anything/build_sam.py official repository unverified no licence file found · pointer only · 3f8890e695469246 · report
gget_chunk mc-lan/Text4Seg/ms-swift/text4seg/infer_refer_seg.py official repository unverified licence not identified · pointer only · 2a5e65f48eefb34b · report
window_unpartition mc-lan/Text4Seg/ms-swift/text4seg/segment_anything/modeling/image_encoder.py official repository unverified no licence file found · pointer only · 27be441cc8213e52 · report

Tasks

Image SegmentationReferring ExpressionReferring Expression SegmentationSegmentationSemantic SegmentationText Generation

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