Contrastive Learning-Based Feature Modulation Strategy for Test-Time Adaptation in Medical Image Segmentation
Yunze Bi, Jiayi Xie, Hongwei Wang · 2025
Medical image segmentation plays a critical role in various clinical applications, including organ delineation, tumor detection, and surgical planning. However, deploying segmentation models in real-world clinical environments remains challenging due to domain shifts between the training and test data, often leading to performance degradation. To address these challenges, we introduce contrastive learning into Test-Time Adaptation (TTA) for medical image segmentation. By leveraging data augmentation to generate new data sources and calculating NT-Xent loss, we enhance feature representation learning, improving model robustness against complex distribution changes. Furthermore, we propose a robust feature modulation strategy (FMS) comprising Enhanced Feature Optimization (EFO) and Selective Feature Regularization (SFR). This strategy not only improves the model's adaptability but also mitigates the inaccuracies in edge segmentation caused by entropy minimization. We rigorously evaluate our approach to segmentation and classification tasks across two different medical imaging modalities. Experimental results demonstrate the versatility of our method across multiple network architectures, achieving measurable performance improvements and providing a reliable solution for medical image segmentation in dynamic environments.