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

This thesis explores how fine-tuned deep learning encoders can enhance diagnostic precision in ECG and CMR data, particularly when pre-trained models from healthy populations are transferred to pathology-rich clinical cohorts. By systematically assessing domain adaptation strategies and measuring improvements in latent space clustering, it demonstrates the potential of tailored fine-tuning to capture subtle cardiac abnormalities across diverse patient demographics.

Initial situation

Cardiovascular disease remains a global health priority, prompting efforts to enhance diagnostic accuracy and clinical decision-making. While large-scale datasets such as the UK Biobank provide valuable pre-trained encoders, these models are often derived from predominantly healthy cohorts. Consequently, they may not capture the nuanced pathologies observed in real-world clinical data. This project addresses the need to adapt and refine these encoders to ensure reliable performance on more diverse and pathology-rich populations.

Problem statement / Project goal

This thesis focuses on evaluating how fine-tuning pre-trained deep learning models can better represent critical cardiac abnormalities in ECG and CMR data. The core objective is to investigate domain adaptation strategies, assess the resulting improvements in clustering pathological cases, and examine the models’ robustness to dataset shifts. By systematically analyzing representation shifts in both ECG and CMR embeddings, the work aims to provide insights into improving diagnostic specificity for arrhythmias and structural heart diseases.

Data Preprocessing Pipeline

ECG Signal and Cardiac MRI Preprocessing Pipeline

ECG Signal and Cardiac MRI Preprocessing Pipeline - Showing parallel workflows for ECG signal processing (ALS Smoothing, Lead-specific Normalization) and cardiac MRI preprocessing (frame extraction, zero-padding, normalization).

Neural Network Architecture

Dual-Stream Neural Network Architecture

Dual-Stream Neural Network Architecture - Illustrating parallel processing streams with signal encoder (ViT) for ECG data and image encoder (ResNet-50) for MRI data, featuring attention and average pooling respectively.

Model Performance Visualization

UMAP Visualization of Cardiac Data Clusters

UMAP Visualization of Cardiac Data Clusters - Comparison between baseline (pre-trained) and fine-tuned (Chapman) models showing improved cluster separation. The labels represent different cardiac rhythm groups: SR (Sinus Rhythm, normal heart rhythm), SB (Sinus Bradycardia, slow heart rate), AFIB (Atrial Fibrillation, irregular rhythm), GSVT (Group of Supraventricular Tachycardia, fast heart rhythm), and PACE (Artificial Pacemaker rhythm). The visualization demonstrates how fine-tuning improves the model's ability to distinguish between these different cardiac conditions.

Method and Key Findings

The methodology developed for this project includes a reproducible pipeline for data preprocessing, model fine-tuning, and comprehensive evaluation. Emphasis is placed on silhouette and centroid analyses to assess how well pathological cases form distinct clusters in the latent space. Empirical results demonstrate that:

  • Fine-tuning significantly improves separation of arrhythmic classes in ECG datasets (Chapman, PTB-XL), highlighting effective transfer of disease-specific features.
  • Domain shifts are partially mitigated by specialized adaptation strategies, enabling more robust performance on out-of-distribution data.
  • CMR embeddings benefit from targeted retraining, with improved discrimination of structural pathologies despite a limited sample size (ACDC).

These findings confirm that pathology-focused refinement of pre-trained encoders can enhance diagnostic relevance in both ECG and CMR domains.

Key terms

  • Fine-TuningAdapting pre-trained models to pathology-rich data
  • Domain ShiftVariation in data distributions between different datasets
  • ECG and CMRClinical data modalities for cardiac assessment

Customer

Federal University of Rio de Janeiro
Link

Instituto Nacional de Cardiologia, Rio de Janeiro
Link

Team

Dominik Filliger
Noah Leuenberger

Supervisors
Prof. Dr. Sarah Brüningk
Prof. Dr. Arzu Çöltekin