Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

IPOLE-BAT-CMR-ECG/dl-framework

Repository files navigation

Fine-Tuning Pre-Trained ECG and CMR Encoders with a Modular Pipeline and Comprehensive Evaluation for Cardiovascular Diagnostics

Authors: Dominik Filliger & Noah Leuenberger (2025)

This repository provides a modular deep-learning pipeline for ECG and CMR representation learning, building on the work of Turgut et al. (2025) and extending the MMCL-ECG-CMR approach. Designed with reproducibility, extensibility, and adaptability in mind, the pipeline enables systematic experimental configurations while integrating preprocessing, training, and postprocessing workflows. Its modular architecture supports easy customization, allowing seamless integration of new components without disrupting the core framework. Accompanied by comprehensive technical documentation, the pipeline facilitates efficient adoption and future extensions for diverse research applications in the field of cardiovascular diagnostics. In the creation of this framework and all related code of this repository, AI coding assistants were used.

🚀 Quick Start

  1. Install Rye To install Rye, visit the official website and follow the instructions. For Unix-based systems, you can use the following command:

    curl -sSf https://rye.astral.sh/get | bash
  2. Setup Project

    # Clone repository
    git clone https://github.com/IPOLE-BAT-CMR-ECG/dl-framework.git
    cd dl-framework
    
    # Install dependencies
    rye sync --no-lock
    
    # Pull project data (requires access request from team)
    dvc pull  # This will set up the exact data configuration used in our work
  3. Configure Environment

    cp sample.env .env
    # Edit .env with your API keys for Weights & Biases / Neptune

📚 Documentation

Comprehensive documentation is available covering:

  • Detailed installation and setup guides
  • Data pipeline documentation
  • Model architectures and training
  • Analysis and visualization tools
  • Development guidelines

The documentation can be viewed by running the following command:

rye run docs

Afterwards open the following link in your browser: http://localhost:8000

📥 Fine-tuned Models

Download our fine-tuned model weights from SWITCHdrive.

📖 Research

For more details about our research:

🛠️ Basic Usage

# Preprocess data
rye run preprocess data=ecg

# Train model
rye run train experiment=fine_tuning/ecg_arryhthmia

# Generate embeddings
rye run generate_embeddings experiment=embeddings/ecg_arryhthmia

For detailed usage instructions and advanced features, please refer to our documentation.

🙏 Acknowledgments

This work builds upon:

If you use this code in your research, please cite the original paper:

@article{turgut2025unlocking,
  title={Unlocking the diagnostic potential of electrocardiograms through information transfer from cardiac magnetic resonance imaging},
  author={Turgut, {\"O}zg{\"u}n and M{\"u}ller, Philip and Hager, Paul and Shit, Suprosanna and Starck, Sophie and Menten, Martin J and Martens, Eimo and Rueckert, Daniel},
  journal={Medical Image Analysis},
  pages={103451},
  year={2025},
  publisher={Elsevier}
}

About

Modular DL framework to fine-tune pre-trained ECG/CMR encoders and evaluate pathology-aware embeddings for cardiac diagnostics.

Resources

Stars

Watchers

Forks

Contributors