Towards Text-Mask Consistency in Medical Image Segmentation

Jie Gui, Hang Tu, Wen Sha, Xiuquan Du
11/20/2026
cs.CV
transformer-attentioncontrastive-ssl

Official code: JGuiidev/C2Seg (0 stars, Python, last commit 2026-11-19).

Abstract

Vision-language models for medical image segmentation often produce masks that conflict with the accompanying text, especially under multi-site/multi-lesion descriptions. We trace this failure to two factors: (i) highly templated and repetitive clinical language causes one-to-one hard contrastive learning to yield numerous false negatives, weakening cross-modal alignment; and (ii) predominantly vision-driven, one-way cross-attention lacks a language-dominant, spatially aware pathway, hindering effective injection of textual semantics into the spatial visual domain.

Show full abstract

To this end, we propose Consistency-enhanced Two-stage Segmentation (C2Seg). In the pretraining stage, Cluster-aware Contrastive Learning uses a frozen strong baseline to construct an intra-batch text similarity matrix as soft labels, thereby alleviating false negative conflicts and producing more discriminative visual representations. In the fusion stage, we introduce a Bidirectional Complementary Attention Module, where each modality dominates attention along its own path, fostering deep interaction and structural consistency between visual and textual representations. In order to enhance the expressive power of multimodal features, we further adopt KAN-based Attention Gating. Without updating the language encoder, our approach significantly improves text-mask consistency and segmentation accuracy on four public medical imaging datasets. The source code is available at https://github.com/JGuiidev/C2Seg.

View on arXivView PDF

Code Implementations(1)

JGuiidev/C2SegOfficial100%
00PythonNov 19, 20261 weeks ago

Similar Papers

Cite this paper

@article{gui2026towards,
  title  = {Towards Text-Mask Consistency in Medical Image Segmentation},
  author = {Jie Gui and Hang Tu and Wen Sha and Xiuquan Du},
  year   = {2026},
  eprint = {2611.27050},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.27050v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.27050.svg)](https://codeofpaper.com/paper/2611.27050)

Discussion