A Fast and Efficient Modern BERT based Text-Conditioned Diffusion Model for Medical Image Segmentation
Venkata Siddharth Dhara, Pawan Kumar
TL;DR
Medical image segmentation often requires dense pixel-level annotations, which hinder clinical deployment. This work introduces FastTextDiff, a text-conditioned diffusion framework that uses ModernBERT to fuse clinical text with image features via cross-modal attention, enabling label-efficient segmentation. By pretraining ModernBERT on MIMIC-III/IV and integrating it into a diffusion backbone, FastTextDiff achieves competitive or state-of-the-art Dice/IoU on MoNuSeg, QaTa-COV19, and MosMedDataPlus while significantly reducing training and inference time compared with baselines such as TextDiff and larger vision-language models. The results support the practical potential of multimodal medical imaging pipelines and highlight the value of clinical text guidance for scalable segmentation in data-scarce clinical settings.
Abstract
In recent times, denoising diffusion probabilistic models (DPMs) have proven effective for medical image generation and denoising, and as representation learners for downstream segmentation. However, segmentation performance is limited by the need for dense pixel-wise labels, which are expensive, time-consuming, and require expert knowledge. We propose FastTextDiff, a label-efficient diffusion-based segmentation model that integrates medical text annotations to enhance semantic representations. Our approach uses ModernBERT, a transformer capable of processing long clinical notes, to tightly link textual annotations with semantic content in medical images. Trained on MIMIC-III and MIMIC-IV, ModernBERT encodes clinical knowledge that guides cross-modal attention between visual and textual features. This study validates ModernBERT as a fast, scalable alternative to Clinical BioBERT in diffusion-based segmentation pipelines and highlights the promise of multi-modal techniques for medical image analysis. By replacing Clinical BioBERT with ModernBERT, FastTextDiff benefits from FlashAttention 2, an alternating attention mechanism, and a 2-trillion-token corpus, improving both segmentation accuracy and training efficiency over traditional diffusion-based models.
