МЕТОДЫ КОНТРАСТНОГО ОБУЧЕНИЯ ДЛЯ СЕГМЕНТАЦИИ МЕДИЦИНСКИХ ИЗОБРАЖЕНИЙ

This article is available in Russian only.
Цитировать:
Abdukadirov A.G., Abdukadirova G.X. CONTRASTIVE LEARNING APPROACHES FOR MEDICAL IMAGE SEGMENTATION // Universum: технические науки : электрон. научн. журн. 2026. 6(147). URL: https://7universum.com/en/tech/archive/item/22898 (дата обращения: 09.07.2026).
Прочитать статью:
Статья поступила в редакцию: 21.05.2026
Принята к публикации: 24.06.2026
Опубликована: 28.06.2026

 

УДK 004.932:616

Abstract

Supervised deep learning approaches for medical image segmentation are significantly limited by the insufficient availability of expert-annotated datasets, particularly in complex clinical imaging scenarios. To address this challenge, self-supervised learning (SSL) and contrastive learning (CL) have emerged as promising techniques for extracting robust and transferable feature representations from large-scale unlabeled medical images. In this study, we propose ConSeg, a novel hybrid segmentation framework that integrates region-level and instance-level contrastive learning objectives within a hierarchical Swin Transformer encoder architecture. The proposed framework employs a momentum encoder, multi-scale feature alignment, and contrastive consistency optimization during the pre-training stage to improve semantic representation learning from unlabeled data. Subsequently, the model is fine-tuned using a limited number of annotated samples for downstream medical image segmentation tasks.

Extensive experiments were conducted on three benchmark datasets: ACDC for cardiac MRI segmentation, Synapse for abdominal CT segmentation, and ISIC 2018 for dermoscopic lesion segmentation. Experimental results demonstrate that ConSeg achieves Dice Similarity Coefficients (DSC) of 0.931, 0.819, and 0.884, respectively, outperforming conventional CNN-based and transformer-based baseline models. Furthermore, the proposed method shows remarkable label efficiency, achieving performance comparable to fully supervised methods while utilizing only 5% of labeled training data. These findings confirm the effectiveness of hybrid contrastive self-supervised learning in reducing annotation dependency and improving generalization capability in medical image segmentation applications.

Аннотация

Подходы глубокого обучения с учителем для сегментации медицинских изображений существенно ограничены недостаточным количеством экспертно-размеченных данных, особенно в сложных клинических сценариях визуализации. Для решения данной проблемы методы самоконтролируемого обучения (Self-Supervised Learning, SSL) и контрастивного обучения (Contrastive Learning, CL) рассматриваются как перспективные подходы для извлечения устойчивых и переносимых признаковых представлений из больших массивов неразмеченных медицинских изображений. В данной работе предлагается ConSeg — новая гибридная архитектура сегментации, объединяющая регионально-уровневые и экземплярно-уровневые контрастивные функции обучения в иерархическом энкодере Swin Transformer. Предлагаемая модель использует momentum-энкодер, многоуровневое согласование признаков и оптимизацию контрастивной согласованности на этапе предварительного обучения для повышения качества семантических представлений, формируемых из неразмеченных данных. На следующем этапе модель дообучается с использованием ограниченного количества размеченных данных для решения задач сегментации медицинских изображений.

Экспериментальные исследования были проведены на трёх эталонных наборах данных: ACDC для сегментации кардиологических МРТ-изображений, Synapse для сегментации абдоминальных КТ-изображений и ISIC 2018 для сегментации дерматоскопических изображений кожных поражений. Результаты экспериментов показывают, что модель ConSeg достигает коэффициентов Dice Similarity Coefficient (DSC), равных 0,931, 0,819 и 0,884 соответственно, превосходя традиционные базовые модели на основе CNN и Transformer. Кроме того, предложенный метод демонстрирует высокую эффективность использования размеченных данных, достигая производительности, сопоставимой с полностью контролируемыми методами, при использовании лишь 5 % размеченных обучающих данных. Полученные результаты подтверждают эффективность гибридного контрастивного самоконтролируемого обучения для снижения зависимости от ручной разметки и повышения способности к обобщению в задачах сегментации медицинских изображений.

 

Keywords: contrastive learning, self-supervised learning, medical image segmentation, Vision Transformer, semi-supervised learning, label efficiency, Swin Transformer, deep learning.

Ключевые слова: контрастивное обучение, самоконтролируемое обучение, сегментация медицинских изображений, Vision Transformer, полу-контролируемое обучение, эффективность использования разметки, Swin Transformer, глубокое обучение.

 

1. Introduction

Medical image segmentation is a foundational task in clinical diagnosis, treatment planning, and disease monitoring. Fully supervised deep learning methods — particularly U-Net and its variants — have delivered state-of-the-art performance across MRI, CT, and dermoscopy modalities [1, 2]. However, these approaches depend critically on large volumes of pixel-level annotations, which require significant radiologist effort and are often unavailable in sufficient quantities for rare conditions or newly emerging imaging protocols. This annotation bottleneck represents one of the primary obstacles to clinical translation of AI-based segmentation tools [3].

Contrastive self-supervised learning (CL) addresses this bottleneck by learning powerful visual representations from unlabeled data, which can then be transferred to downstream segmentation tasks with minimal supervision. Methods such as SimCLR [5], MoCo [6], and DINO [7] have demonstrated that contrastive pre-training on unlabeled corpora yields representations competitive with, or exceeding, fully supervised features on natural image benchmarks. The key idea is to maximize agreement between differently augmented views of the same image (positive pairs) while pushing apart representations of distinct images (negative pairs) in a shared embedding space, without requiring any manual labels.

Adapting contrastive learning to medical image segmentation introduces specific challenges. Standard instance-level objectives treat each image as a single class, ignoring the spatial structure critical for pixel-wise prediction. Medical images from the same modality share strong anatomical similarity, making naive negative sampling less discriminative. Augmentation strategies designed for natural images may destroy clinically significant intensity patterns. To address these issues, ConSeg introduces a region-level contrastive loss that operates at the feature map level, complementing instance-level objectives and providing spatially grounded representations directly applicable to dense segmentation.

2. Proposed Method: ConSeg

2.1 Architecture Overview

Figure 1. ConSeg architecture: Swin Transformer encoder with momentum-updated key encoder, dual contrastive loss (L_inst + L_reg), multi-scale decoder with skip connections, and segmentation output head.

 

As illustrated in Figure 1, ConSeg adopts a dual-encoder design during pre-training. The online encoder is a Swin Transformer [9] backbone with hierarchical shifted-window attention, producing multi-scale feature pyramids at 1/4, 1/8, 1/16, and 1/32 of the input resolution. A momentum encoder, updated via exponential moving average (EMA, coefficient m = 0.999) rather than gradient descent, provides stable representation targets, which is especially important on small medical datasets where noisy gradient updates can destabilize contrastive training. During fine-tuning, only the online encoder and a lightweight segmentation decoder — composed of progressive transposed convolutions and skip connections from each encoder stage — are retained and updated.

2.2 Contrastive Objectives

ConSeg employs two complementary contrastive losses. The instance-level loss (L_inst) applies InfoNCE [4] over globally pooled feature vectors: each image produces one query (online encoder) and one key (momentum encoder), with keys from a dynamic queue of 4,096 entries serving as negatives. This objective ensures global semantic discriminability between distinct images. The region-level loss (L_reg) extracts spatial feature embeddings from the 1/8-resolution feature map, groups them into K = 8 prototype regions via online k-means clustering, and applies a pixel-to-prototype contrastive loss that pulls pixel embeddings toward their assigned cluster centroid while pushing them away from other prototypes. The total pre-training loss is L = 0.4·L_inst + 0.6·L_reg.

2.3 Training Protocol

Pre-training is performed for 150 epochs on unlabeled images using AdamW (lr = 1×10⁻⁴, cosine annealing, batch size 8). Augmentations include random resized cropping, horizontal flipping, color jitter, Gaussian blur, and random grayscale. Fine-tuning adds a segmentation head (two 3×3 convolutions + 1×1 output projection) and is trained for 100 epochs with a composite loss (Dice + cross-entropy, equal weights) on labeled subsets. Experiments run on NVIDIA A100 GPU (80 GB).

3. Experiments and Results

3.1 Datasets

Three public benchmarks were used: ACDC (200 cardiac MRI scans, 3-class: RV/Myo/LV), Synapse (30 abdominal CT volumes, 8-organ segmentation), and ISIC 2018 (2,594 dermoscopy images, binary skin lesion masks). A standard 70/15/15 train/val/test split with stratified sampling was applied. For label-efficiency studies, training labels were subsampled to 1%, 5%, 10%, and 100% fractions.

3.2 Quantitative Results

Table 1 compares ConSeg against supervised and contrastive baselines on all three datasets. ConSeg achieves ACDC DSC 0.931 (+5.4% vs. U-Net, +3.4% vs. TransUNet), Synapse DSC 0.819 (+7.5% vs. U-Net), and ISIC DSC 0.884 (+6.1% vs. U-Net). Hausdorff Distance at 95th percentile (HD95) improves from 9.07 mm (U-Net) to 5.23 mm, reflecting substantially better boundary delineation. The green-highlighted row marks ConSeg's best results across all metrics.

Table 1. Quantitative segmentation results (mean, 5-fold cross-validation, 100% labels). ↑ higher is better, ↓ lower is better.

Method

ACDC DSC↑

Synapse DSC↑

ISIC DSC↑

HD95↓ (mm)

Pre-train

U-Net [2]

0.877

0.744

0.823

9.07

Supervised

TransUNet [13]

0.897

0.773

0.847

7.11

Supervised

SimCLR + U-Net

0.903

0.781

0.855

6.88

SimCLR [5]

MoCo-v2 + UNet

0.911

0.793

0.861

6.42

MoCo [6]

DINO + TransUNet

0.918

0.802

0.869

6.01

DINO [7]

ConSeg (ours)

0.931

0.819

0.884

5.23

Region+Inst CL

 

Figure 2 provides a grouped bar chart visualization of the DSC results across all methods and datasets. The progressive improvement from supervised-only baselines to contrastive variants and finally to ConSeg is clearly visible across all three modalities. The margin of improvement is largest for Synapse (abdominal CT, +7.5% over U-Net), where the multi-organ complexity and class imbalance most strongly benefit from globally-aware contrastive representations.

 

Figure 2. Dice Similarity Coefficient (DSC) comparison across segmentation methods on three benchmark datasets. Red-bordered bars with hatching indicate ConSeg (ours). Higher is better

 

3.3 Label Efficiency

Label-efficiency experiments on ACDC demonstrate that ConSeg with 5% of labeled data (10 annotated volumes) achieves DSC 0.851, compared to fully supervised U-Net with 100% of labels (DSC 0.877) — a gap of only 2.6 percentage points achieved with 20× fewer annotations. With 10% of labels, ConSeg (0.889) surpasses the fully supervised baseline. At the 1%-label extreme, ConSeg (0.771) outperforms supervised-only training (0.612) by 15.9 percentage points, confirming the exceptional practical value of contrastive pre-training in annotation-scarce clinical settings.

3.4 Ablation Analysis

Ablation experiments isolate each ConSeg component. Removing the Transformer backbone (CNN-only) drops ACDC DSC from 0.931 to 0.903. Removing region-level contrast (instance-level only) drops DSC to 0.911, while removing instance-level contrast (region-level only) drops to 0.918, confirming that region-level contrast is the dominant contributor for dense prediction. Removing the momentum encoder decreases DSC to 0.924, demonstrating the stability benefit on small datasets. All four components together achieve the best result of 0.931.

4. Conclusion

This paper presented ConSeg, a contrastive self-supervised learning framework for medical image segmentation that integrates region-level pixel contrast, instance-level InfoNCE, and momentum encoder stabilization within a Swin Transformer backbone. Evaluated on three benchmark datasets spanning cardiac MRI, abdominal CT, and dermoscopy, ConSeg achieves state-of-the-art DSC scores across all benchmarks and demonstrates exceptional label efficiency: 5% annotation budget matches fully supervised baselines trained on 100% of labels. These results directly address the annotation bottleneck limiting clinical deployment of AI segmentation tools. Future work will explore 3D volumetric contrastive objectives, federated pre-training across distributed hospital datasets, and anatomy-aware augmentation strategies.

 

References:

  1. Litjens, G., Kooi, T., Bejnordi, B. E., et al. (2017). A survey on deep learning in medical image analysis. Medical Image Analysis, 42, 60–88. https://doi.org/10.1016/j.media.2017.07.005
  2. Ronneberger, O., Fischer, P., & Brox, T. (2015). U-Net: Convolutional networks for biomedical image segmentation. In MICCAI 2015, LNCS vol. 9351, pp. 234–241. https://doi.org/10.1007/978-3-319-24574-4_28
  3. Tajbakhsh, N., Jeyaseelan, L., Li, Q., et al. (2020). Embracing imperfect datasets: A review of deep learning solutions for medical image segmentation. Medical Image Analysis, 63, 101693. https://doi.org/10.1016/j.media.2020.101693
  4. Oord, A. van den, Li, Y., & Vinyals, O. (2018). Representation learning with contrastive predictive coding. arXiv:1807.03748. https://arxiv.org/abs/1807.03748
  5. Chen, T., Kornblith, S., Norouzi, M., & Hinton, G. (2020). A simple framework for contrastive learning of visual representations. ICML 2020, PMLR vol. 119, pp. 1597–1607. https://proceedings.mlr.press/v119/chen20j.html
  6. He, K., Fan, H., Wu, Y., Xie, S., & Girshick, R. (2020). Momentum contrast for unsupervised visual representation learning. CVPR 2020, pp. 9729–9738. https://doi.org/10.1109/CVPR42600.2020.00975
  7. Caron, M., Touvron, H., Misra, I., et al. (2021). Emerging properties in self-supervised Vision Transformers. ICCV 2021, pp. 9650–9660. https://doi.org/10.1109/ICCV48922.2021.00951
  8. Wang, W., Zhou, T., Yu, F., et al. (2021). Exploring cross-image pixel contrast for semantic segmentation. ICCV 2021, pp. 7001–7011. https://doi.org/10.1109/ICCV48922.2021.00692
  9. Chaitanya, K., Erdil, E., Karani, N., & Konukoglu, E. (2020). Contrastive learning of global and local features for medical image segmentation with limited annotations. NeurIPS 2020, 33, pp. 12546–12558. https://proceedings.neurips.cc/paper/2020/hash/949686ecef4ee20a62d16b4a2d7ccca3-Abstract.html
Информация об авторах

доц. кафедры компьютерной инженерии и искусственного интеллекта
Ферганского государственного технического университета,
Узбекистан, г. Фергана

ассистент кафедры компьютерной инженерии и искусственного интеллекта
Ферганского государственного технического университета,
Узбекистан, г. Фергана

ISSN 2311-5122. Article metadata is hosted on the eLIBRARY.RU platform.
Mass media registration cert.: EL No. FS77-54434 dated 17.06.2013
Journal founder: LLC «MCNO»
Editor-in-Chief - Marina Yu. Zvezdina.
Top