Mask-Guided Foreground–Background Contrastive Learning for Text-Guided COVID-19 Segmentation in Chest X-Ray and CT Images
Baoyang Han, Jia WeiText-guided segmentation combines visual information with semantic descriptions, but semantic conditioning alone does not explicitly supervise the separation of foreground and background representations. We combine a VGG16-based encoder–decoder and the established cross-position attention pathway with a two-layer CLIP text adapter and mask-guided foreground–background contrastive supervision at three encoder levels. Reference masks guide contrastive sampling during training but are not inference inputs. On the fixed QaTa-COV19 chest X-ray benchmark, three independent runs yielded a Dice of 0.8589±0.0037 and a mean foreground intersection over union (mIoU) of 0.7583±0.0045; on the MosMedData+ two-dimensional CT-slice benchmark, the corresponding results were 0.8023±0.0038 and 0.6745±0.0044 (mean ± standard deviation). A two-factor ablation assessed the text adapter and contrastive term separately and jointly. Individual-negative InfoNCE yielded lower mean overlap scores than the proposed average-negative objective under the matched training settings. Inference-time left/right exchanges in unilateral-description subsets revealed substantial sensitivity to incorrect laterality. These findings describe fixed image/slice-level benchmarks and do not establish external clinical generalization.