Towards Text-Mask Consistency in Medical Image Segmentation
Authors: Jie Gui, Hang Tu, Wen Sha, Xiuquan Du
Organizations: Key Laboratory of Intelligent Computing and Signal Processing, Ministry of Education, Anhui University, Hefei, China · School of Artificial Intelligence, Anhui University, Hefei, China · School of Computer Science and Technology, Anhui University, Hefei, China
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. 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.
Figures & tables
Figure 1: Challenge and limitations of existing methods, and our solution.
Figure 2: Overview of the proposed C2Seg. Given medical images and their corresponding textual descriptions, visual and language features are extracted using dedicated encoders.
Figure 3: The architecture of (a) the generic attention mechanism, (b) the Multi-Modal Mutual Attention (M3Att), and (c) our proposed Bidirectional Complementary Attention Module (BCAM).
Method
Params(M)
Text
QaTa-COV19
MosMedData+
Dice(%)↑
mIoU(%)↑
HD95↓
ASSD↓
Dice(%)↑
mIoU(%)↑
HD95↓
ASSD↓
U-Net ( Ronneberger et al., 2015 )
31.4
×
79.02
69.46
33.98
9.03
64.60
50.73
23.52
6.35
U-Net++ ( Zhou et al., 2018 )
74.5
×
79.62
70.25
36.14
9.91
71.75
58.39
24.06
5.45
nnUNet ( Isensee et al., 2021 )
19.1
×
80.42
70.81
28.14
9.86
72.59
60.36
22.75
5.56
Swin-Unet ( Cao et al., 2023 )
82.3
×
78.07
68.34
31.51
9.20
63.29
50.19
25.31
7.69
TransUNet ( Chen et al., 2024 )
105.0
×
78.63
69.13
29.88
8.42
71.24
58.44
23.41
6.38
Table 1: Quantitative comparison on QaTa-COV19 and MosMedData+ datasets.
Method
Params(M)
Text
CVC-ClinicDB
Kvasir
Dice(%)↑
mIoU(%)↑
HD95↓
ASSD↓
Dice(%)↑
mIoU(%)↑
HD95↓
ASSD↓
U-Net ( Ronneberger et al., 2015 )
31.4
×
57.57
44.93
49.40
19.87
75.77
65.20
40.29
12.11
U-Net++ ( Zhou et al., 2018 )
74.5
×
88.94
82.91
12.16
3.99
87.00
79.71
20.87
6.63
nnUNet ( Isensee et al., 2021 )
19.1
×
85.69
77.72
13.48
5.84
86.95
79.19
20.39
5.81
Swin-Unet ( Cao et al., 2023 )
82.3
×
81.19
71.64
26.38
8.67
77.24
66.90
21.25
8.80
UKAN ( Li et al., 2025a )
9.4
×
89.74
84.47
13.19
3.72
87.77
81.13
21.37
5.82
Table 2: Quantitative comparison on CVC-ClinicDB and Kvasir datasets.
Figure 4: Visualization of different methods. Green, red, and blue represent true positive, false negative, and false positive pixels, respectively.
Case
Text encoder
Stage I
Stage II
MosMedData+
CVC-ClinicDB
HardCL
CaCL
DualA
BCAM
K-Gate
Dice(%)↑
mIoU(%)↑
Dice(%)↑
mIoU(%)↑
(a)
×
73.61
60.02
86.59
78.11
(b)
CLIP
✓
75.59
62.35
89.56
83.14
(c)
✓
✓
76.50
63.77
90.31
84.45
(d)
✓
✓
✓
77.03
64.45
90.68
85.98
(e)
✓
✓
✓
✓
77.32
64.51
91.26
86.33
Table 3: Ablation study on MosMedData+ and CVC-ClinicDB datasets.
Figure 5: Qualitative comparison of DualA and BCAM on QaTa-COV19 and Kvasir datasets.
(a) Ablations on KAN.
(b) Sensitivity of hyperparameters.
Settings
Dice(%)↑
mIoU(%)↑
Effect of ρ
Effect of τ
Effect of batch size
CNN encoder
77.29
64.51
( τ=0.07 , batch size = 256)
( ρ=0.8 , batch size = 256)
( ρ=0.8 , τ=0.07 )
Hybrid encoder
77.81
65.17
ρ
Dice(%)↑
mIoU(%)↑
τ
Dice(%)↑
mIoU(%)↑
batch size
Dice(%)↑
mIoU(%)↑
KAN encoder
76.21
63.27
0.6
77.64
65.05
0.05
77.59
65.12
128
76.52
63.93
BCAM (Linear)
77.26
64.42
0.8
77.81
65.17
0.07
77.81
65.17
256
77.81
65.17
K-Gate (MLP)
76.93
64.02
1.0
77.12
64.26
0.10
77.45
64.98
512
77.89
65.18
Table 4: Ablation of KAN and hyperparameters on MosMedData+ datasets.
Figure 6: Visualization of image feature distribution on QaTa-COV19 and MosMedData+ datasets under three pretraining strategies (no contrast, general contrast, and CaCL). Each color represents all images corresponding to a textual description.
Medical image segmentation delineates organs, lesions, and other structures in scans to support measurement, diagnosis, treatment planning, and research.
Medical image segmentation is a cornerstone of computer-assisted diagnosis and treatment planning. While recent multimodal vision-language models have shown promise in enhancing semantic understanding through textual descriptions, their resilience in "in-the-wild" clinical settings-characterized by scarce annotations and hardware-induced image degradations-remains under-explored. We introduce BiCLIP (Bidirectional and Consistent Language-Image Processing), a framework engineered to bolster robustness in medical segmentation. BiCLIP features a bidirectional multimodal fusion mechanism that enables visual features to iteratively refine textual representations, ensuring superior semantic alignment. To further stabilize learning, we implement an augmentation consistency objective that regularizes intermediate representations against perturbed input views. Evaluation on the QaTa-COV19 and MosMedData+ benchmarks demonstrates that BiCLIP consistently surpasses state-of-the-art image-only and multimodal baselines. Notably, BiCLIP maintains high performance when trained on as little as 1% of labeled data and exhibits significant resistance to clinical artifacts, including motion blur and low-dose CT noise.
Saivan Talaei, Fatemeh Daneshfar, Abdulhady Abas Abdullah +1
Department of Computer Engineering, University of Kurdistan, Sanandaj, Kurdistan, Iran · Artificial Intelligence and Innovation Center, University of Kurdistan, Erbil, Kurdistan, Iraq · Center for Machine Vision and Signal Analysis, University of Oulu, Oulu, Finland
Textual descriptions can reduce ambiguity in medical image segmentation by specifying the finding and location to be delineated. Existing text-guided methods mainly improve where image and language features interact but generally retain a single learned update pathway across all image-text pairs. We propose MRSeg, a parameter-efficient framework that uses each image-text pair to route the adaptation of visual and textual features before dense prediction. Frozen ConvNeXt-Tiny and PubMedBERT encoders provide multiscale visual features and clinical text tokens. A joint router uses the deepest visual feature and pooled text to predict a sparse mixture over low-rank adapter bases. The resulting route is shared across separate adapter banks for two visual scales and text, coordinating their adaptation while keeping the feature-specific parameters separate. Region Bridge uses text-derived queries to aggregate dense visual tokens into latent regions, refines these regions through self-attention and text cross-attention, and redistributes the refined information back to the feature maps. Finally, a multiscale decoder combines refined semantic features with shallow image evidence. On QaTa-COV19 and MosMedData+, MRSeg achieves 90.90/83.32 and 81.53/68.82 Dice/mIoU, respectively, with 7.11M trainable parameters and 7.60 GFLOPs. Code: https://github.com/maklachur/MRSeg.
Md Maklachur Rahman, Md Hasan Al Banna, Saraf Anjum +2
Texas A&M University, College Station, TX 77843, USA · Independent Researcher
Medical image segmentation remains challenging due to limited annotations for training, ambiguous anatomical features, and domain shifts. While vision-language models such as CLIP offer strong cross-modal representations, their potential for dense, text-guided medical image segmentation remains underexplored. We present MedCLIPSeg, a novel framework that adapts CLIP for robust, data-efficient, and uncertainty-aware medical image segmentation. Our approach leverages patch-level CLIP embeddings through probabilistic cross-modal attention, enabling bidirectional interaction between image and text tokens and explicit modeling of predictive uncertainty. Together with a soft patch-level contrastive loss that encourages more nuanced semantic learning across diverse textual prompts, MedCLIPSeg effectively improves data efficiency and domain generalizability. Extensive experiments across 16 datasets spanning five imaging modalities and six organs demonstrate that MedCLIPSeg outperforms prior methods in accuracy, efficiency, and robustness, while providing interpretable uncertainty maps that highlight local reliability of segmentation results. This work demonstrates the potential of probabilistic vision-language modeling for text-driven medical image segmentation.
Taha Koleilat, Hojat Asgariandehkordi, Omid Nejati Manzari +3