Abstract
Contrastive learning has been proved to be a promising technique for image-level representation learning from unlabeled data. Many existing works have demonstrated improved results by applying contrastive learning in classification and object detection tasks for either natural images or medical images. However, its application to medical image segmentation tasks has been limited. In this work, we use lung segmentation in chest X-rays as a case study and propose a contrastive learning framework with temporal correlated medical images, named CL-TCI, to learn superior encoders for initializing the segmentation network. We adapt CL-TCI from two state-of-the-art contrastive learning methods-MoCo and SimCLR. Experiment results on three chest X-ray datasets show that under two different segmentation backbones, U-Net and Deeplab-V3, CL-TCI can outperform all baselines that do not incorporate any temporal correlation in both semi-supervised learning setting and transfer learning setting with limited annotation. This suggests that information among temporal correlated medical images can indeed improve contrastive learning performance. Between the two variations of CL-TCI, CL-TCI adapted from MoCo outperforms CL-TCI adapted from SimCLR in most settings, indicating that more contrastive samples can benefit the learning process and help the network learn high-quality representations.
Introduction
Deep learning models for medical image segmentation typically require massive amounts of expert-labeled data, which is expensive and time-consuming to produce. Self-supervised learning (SSL)—specifically contrastive learning—has emerged as a way to "pre-train" models on unlabeled data. Standard contrastive methods like SimCLR or MoCo typically generate positive pairs by applying random augmentations to a single image. However, in the medical domain, patients often have multiple scans taken over time. Standard SSL treats these temporally correlated scans as "negative pairs," ignoring the fact that the underlying anatomical structure remains nearly identical.
This paper introduces CL-TCI (Contrastive Learning with Temporal Correlated Images), a framework that leverages these natural temporal correlations to learn more robust anatomical features, significantly boosting performance in scenarios where labeled data is scarce.
Methodology
CL-TCI adapts two popular frameworks, SimCLR and MoCo, to incorporate temporal information. The core innovation is treating all images belonging to the same patient as positive pairs, acting as a form of "natural augmentation."
- CL-TCI-SimCLR: Uses large batches where images from the same patient are pulled together in the feature space.
- CL-TCI-MoCo: Uses a momentum encoder and a dictionary (queue) of previous representations, allowing the model to compare against a much larger set of negative samples efficiently.
To handle multiple positive samples in a single batch (e.g., multiple scans of the same patient plus their synthetic augmentations), the framework utilizes the Supervised Contrastive (SupContrast) loss. After pre-training, the encoder is used to initialize standard segmentation backbones such as U-Net and DeepLab-V3+.
Experimental Setup
The study utilizes three distinct datasets to evaluate performance and transferability:
- BCH-CXR: A dataset from Boston Children’s Hospital containing 3,121 unlabeled images from 105 patients. A subset of 308 images was expert-annotated for evaluation.
- JSRT: A public dataset of 247 chest X-rays used to test transfer learning.
- Montgomery: A public dataset of 138 X-rays used for additional transfer learning evaluation.
Key Results and Insights
CL-TCI consistently outperformed baselines that do not incorporate temporal correlation across all tests and both backbones.
- Superiority with Limited Labels: On the BCH-CXR dataset with only 10 labeled images, CL-TCI-MoCo achieved a Mean Dice score of 0.877, compared to 0.771 for random initialization and 0.846 for standard MoCo.
- Robust Transferability: When pre-trained on hospital data and fine-tuned on the public JSRT dataset, CL-TCI-MoCo reached a Dice score of 0.943 with just 10 labels.
- Qualitative Improvements: Visual results show that CL-TCI leads to better boundary definitions for the lungs, especially in challenging cases.
- MoCo vs. SimCLR: The MoCo-based variant consistently outperformed the SimCLR variant. The authors attribute this to the dictionary mechanism, which provides a more diverse set of contrastive samples, helping the network learn higher-quality representations.
- Implicit Clustering: t-SNE visualizations revealed that even without labels, the model naturally learned to cluster images by patient ID, suggesting it successfully captured unique patient-specific anatomical signatures.
Conclusion
CL-TCI demonstrates that temporal correlation in medical imaging provides a powerful signal for self-supervised learning. By treating longitudinal scans as positive pairs, the model learns consistent anatomical features that generalize well even with extremely limited labeled data. While the method relies on datasets with multiple scans per patient, it offers a promising direction for other medical imaging tasks where temporal data is common, such as monitoring disease progression in oncology or cardiology.
Summary updated