Margin Preserving Self-paced Contrastive Learning Towards Domain Adaptation for Medical Image Segmentation

Zhizhe Liu, Zhenfeng Zhu, Shuai Zheng, Yang Liu, Jiayu Zhou, Yao Zhao · DOI

Abstract

To bridge the gap between the source and target domains in unsupervised domain adaptation (UDA), the most common strategy puts focus on matching the marginal distributions in the feature space through adversarial learning. However, such category-agnostic global alignment lacks of exploiting the class-level joint distributions, causing the aligned distribution less discriminative. To address this issue, we propose in this paper a novel margin preserving self-paced contrastive Learning (MPSCL) model for cross-modal medical image segmentation. Unlike the conventional construction of contrastive pairs in contrastive learning, the domain-adaptive category prototypes are utilized to constitute the positive and negative sample pairs. With the guidance of progressively refined semantic prototypes, a novel margin preserving contrastive loss is proposed to boost the discriminability of embedded representation space. To enhance the supervision for contrastive learning, more informative pseudo-labels are generated in target domain in a self-paced way, thus benefiting the category-aware distribution alignment for UDA. Furthermore, the domain-invariant representations are learned through joint contrastive learning between the two domains. Extensive experiments on cross-modal cardiac segmentation tasks demonstrate that MPSCL significantly improves semantic segmentation performance, and outperforms a wide variety of state-of-the-art methods by a large margin.

Introduction

Deep learning models for medical image segmentation often suffer from performance degradation when applied to data from a different domain (e.g., MRI to CT) due to domain shift. Conventional Unsupervised Domain Adaptation (UDA) methods typically rely on category-agnostic global alignment, using adversarial learning to match feature distributions. However, this approach often fails to preserve semantic boundaries, potentially misaligning features of different anatomical structures across domains. This results in a lack of discriminability in the aligned feature space, where different tissue classes may overlap.

Conceptual comparison of category-agnostic alignment versus the proposed category-aware alignment with margin preservation.

Methodology

The proposed Margin Preserving Self-paced Contrastive Learning (MPSCL) framework addresses these limitations through three core components:

1. Domain-adaptive Category Prototypes

Instead of standard instance-based contrastive learning, MPSCL utilizes category prototypes—centroids representing specific tissue classes (e.g., Aorta, Myocardium). These prototypes are dynamically updated to serve as anchors for both source and target domains, facilitating category-aware alignment rather than just global distribution matching.

2. Margin Preserving Contrastive Learning

To enhance feature discriminability, a margin preserving contrastive loss is introduced. Inspired by angular margin penalties in metric learning, this loss imposes a deviation angle penalty ($m$) to enforce a geometric separation between different categories in the embedding space. This ensures that features are not only aligned across domains but also well-separated by class, reducing intra-class variation while boosting inter-class difference.

3. Self-paced Pseudo-labeling (SPL)

Supervision in the unlabeled target domain is provided via pseudo-labels. To mitigate the impact of noisy labels during early training stages, a self-paced strategy is employed. Pixels are selected based on a "confidence difference" metric—the gap between the top two predicted class probabilities. The selection threshold is gradually relaxed, allowing the model to learn from increasingly difficult samples as its performance improves.

Overview of the MPSCL framework, showing the interaction between the feature encoder, domain-adaptive prototypes, and the contrastive learning modules.

Experimental Results

The framework was evaluated on the Multi-Modality Whole Heart Segmentation (MMWHS) 2017 dataset, focusing on cross-modal adaptation between MRI and CT for four cardiac structures: Ascending Aorta (AA), Left Atrium blood cavity (LAC), Left Ventricle blood cavity (LVC), and Myocardium (MYO).

Quantitative Performance

MPSCL demonstrated significant improvements over state-of-the-art (SOTA) methods:

  • MRI → CT: Achieved an average Dice score of 84.08%, a substantial improvement over the previous SOTA (SIFAv2 at 74.10%). The Average Surface Distance (ASD) was reduced to 3.47.
  • CT → MRI: Achieved an average Dice score of 69.87%, outperforming other category-aware methods like CAG (63.44%).

Qualitative Insights

Visual analysis confirms that MPSCL produces sharper organ boundaries and reduces segmentation artifacts compared to global alignment methods. The margin penalty effectively clusters features around their respective prototypes, as evidenced by tighter angular distributions in the feature space. This results in more robust segmentation even in challenging cross-modal scenarios.

Conclusion

MPSCL introduces a robust framework for cross-modal medical image segmentation by combining category-aware contrastive learning with a margin-preserving objective and self-paced pseudo-labeling. By focusing on class-level joint distributions rather than just global marginal distributions, the model achieves superior alignment and discriminability, setting a new benchmark for UDA in cardiac imaging.

Summary updated

BibTeX
@article{liu2021margin,
  author = {Zhizhe Liu and Zhenfeng Zhu and Shuai Zheng and Yang Liu and Jiayu Zhou and Yao Zhao},
  title = {{Margin Preserving Self-paced Contrastive Learning Towards Domain Adaptation for Medical Image Segmentation}},
  journal = {IEEE J. Biomed. Health Informatics},
  year = {2021},
  doi = {10.1109/jbhi.2022.3140853},
}
Figure