Code of the paper "The Impact of Longitudinal Mammogram Alignment on Breast Cancer Risk Assessment".
- 📘 Introduction
- ⚙️ Method
- 🔍 Key findings of the paper
- 📚 Datasets
▶️ Reproduction of the results- 📄 Citation
This project focuses on breast cancer risk prediction using longitudinal mammography. By incorporating both current and prior scans, the model captures temporal changes in breast tissue, leading to improved prediction accuracy. Accurately modeling these changes requires proper alignment across time points. Alignment can be performed explicitly—by registering images or their feature representations—or implicitly, using deep learning models that learn temporal dependencies directly from data. Although several alignment methods have been proposed, their effectiveness for downstream tasks such as risk prediction remains underexplored. This project provides a unified framework to compare alignment techniques and examine how alignment quality influences predictive performance.
This repository provides the code necessary to:
- Train a deep learning-based image registration model for longitudinal mammography images (MammoRegNet)
- Register longitudinal mammography images using a trained MammoRegNet model
- Perform breast cancer risk prediction employing different alignment methods for longitudinal mammography images
We compare six alignment strategies for longitudinal breast cancer risk prediction:
-
NoAlign: Direct feature extraction without any alignment between time points. Serves as the baseline.
-
ImplicitAlign: Temporal dependencies are learned directly from the data without any explicit alignment or deformation modeling.
-
Feature-Level Alignment:
- FeatAlign: Joint training of the alignment module and risk prediction model using an L2 alignment loss.
- FeatAlignReg: Extension of FeatAlign with an added regularization loss to encourage smoother deformation fields.
-
Image-Level Alignment:
- ImgAlign: Applies MammoRegNet to align mammograms before feature extraction.
- ImgFeatAlign: Applies MammoRegNet’s deformation field in the feature space to warp extracted features instead of images.
- 🔄 Comparative study of alignment strategies for longitudinal mammography.
- 📈 Alignment improves accuracy of temporal breast cancer risk prediction.
- ⚖️ Explicit alignment methods outperform implicit alignment approaches.
- 🔧 Regularized feature alignment improves deformation but lowers risk prediction.
- 🥇 Feature-space warping with image-based deformation fields performs best.
We used two large, publicly available mammography datasets :
- Emory Breast Imaging Dataset (EMBED): https://aws.amazon.com/marketplace/pp/prodview-unw4li5rkivs2#overview}
- Cohort of Screen-Aged Women Case Control (CSAW-CC): https://snd.se/en/catalogue/dataset/2021-204-1
For reproducing the results follow the instructions below:
Important: for each script in the scripts folder, make sure you update the paths to load the correct datasets and export the results in your favorite directory.
Requirements are in the requirements.txt file
The preprocessing step ensures that the datasets are properly prepared before training.
The preprocessing folder contains the necessary scripts to preprocess images and split the datasets into training, validation and test.
To preprocess the EMBED dataset, use: preprocessing/preprocess_img_embed.py
To preprocess the CSAW-CC dataset, use: preprocessing/preprocess_img_csaw_cc.py
To split both datasets into training, validation, and test sets, use: preprocessing/split_data.py
For the risk prediction, create a CSV file describing your dataset by running the notebooks in the notebooks folder
For training MammoRegNet run scripts/train_MammoRegNet.sh
For training the risk prediction models run scripts/train_Risk_NoAlign.sh, scripts/train_Risk_ImplicitAlign.sh, scripts/train_Risk_FeatAlign.sh, scripts/train_Risk_FeatAlignReg.sh, scripts/train_Risk_ImgAlign.sh, and scripts/train_Risk_ImgFeatAlign.sh
Run scripts/test_MammoRegNet.sh
Run scripts/test_Risk_NoAlign.sh, scripts/test_Risk_ImplicitAlign.sh, scripts/test_Risk_FeatAlign.sh, scripts/test_Risk_FeatAlignReg.sh, scripts/test_Risk_ImgAlign.sh, and scripts/test_Risk_ImgFeatAlign.sh
