Bayesian ECG reconstruction using denoising diffusion generative models

Gabriel Victorino Cardoso, Lisa Bedin, Josselin Duchateau, Rémi Dubois, Eric MoulinesarXiv 2023 · DOI

TL;DR

This paper introduces a novel denoising diffusion generative model (DDGM) specifically trained on healthy ECG data to capture detailed cardiac morphology. This model is then leveraged as a powerful prior for solving various inverse problems in ECG analysis, enabling tasks like denoising, reconstructing missing leads, and predicting QT intervals, all without retraining the core model.

What Problem Does This Paper Address?

The electrocardiogram (ECG) is a cornerstone of cardiac diagnostics, providing insights into heart rhythm and electrical propagation. While current machine learning approaches often focus on temporal features for arrhythmia detection, a deeper understanding of the morphology of individual ECG events (like the P-wave, QRS complex, and T-wave) offers significant opportunities for more sophisticated diagnostics and preventive medicine. Specifically, accurately reconstructing and analyzing ECG signals is crucial for tasks like identifying subtle abnormalities, recovering incomplete data, and predicting critical intervals like the QT interval, which is linked to cardiac health and sudden cardiac death. Existing generative models for ECG often focus on data augmentation or generating longer time series, but this work aims to generate realistic single healthy heartbeats with high fidelity in morphology and inter-lead dependence, and then apply this generative capability to solve challenging inverse problems.

Methods

The core of this work is a Denoising Diffusion Generative Model (DDGM), specifically a variance-exploding (VE) framework. This model is trained on healthy ECG data to learn the distribution of normal heartbeats. The key innovation lies in using this trained DDGM as a prior for solving various Bayesian inverse problems. Instead of retraining a model for each specific task (like denoising or reconstruction), the pre-trained DDGM acts as a powerful, learned prior that guides the inference process.

The paper details the forward noising process (adding noise incrementally) and the backward denoising process (recovering the original signal from noise) inherent to DDGMs. A crucial aspect is the conditional DDGM, which allows generation of ECGs conditioned on patient-specific information like age, sex, and the preceding RR interval. This conditioning is achieved by incorporating these features into the network architecture.

For solving inverse problems, the paper employs techniques like Sequential Monte Carlo (SMC) and Maximum Likelihood Estimation (MLE) to leverage the DDGM prior. This allows for tasks such as:

  • Denoising: Removing noise from ECG signals.
  • Missing Lead Reconstruction: Filling in absent ECG leads.
  • QT Interval Prediction: Estimating the QT interval based on the preceding RR interval and QRS complex.
  • Abnormality Detection: Identifying deviations from the expected healthy ECG generated by the model.

Datasets

The primary dataset used is the 2021 PhysioNet Challenge dataset, which contains 43101 records from diverse patient populations. For training, a subset of healthy ECGs was selected. The paper also mentions using a control population from the test group that mirrors the age and gender distribution of MI patients for abnormality detection tasks.

Key Insights and Ideas

  • DDGMs as powerful priors: The paper demonstrates that a DDGM trained on healthy ECGs can serve as a highly effective prior for a variety of inverse problems, significantly simplifying and improving solutions without task-specific retraining.
  • Morphology matters: Focusing on the detailed morphology of ECG signals, rather than just temporal features, unlocks new diagnostic capabilities.
  • Conditional generation for personalization: Conditioning the DDGM on patient-specific attributes (age, sex, RR interval) allows for the generation of personalized ECGs, crucial for accurate individual diagnostics.
  • White-box interpretability: The DDGM-based approach offers a more transparent and interpretable way to analyze ECGs, allowing for direct comparison between expected and actual signals.
  • QT-RR relationship captured implicitly: The model implicitly learns and reproduces the complex QT-RR relationship, a key indicator of cardiac health, by conditioning on the QRS complex.

Key Results

  • Realistic ECG generation: The DDGM successfully generates realistic, healthy ECG signals with high fidelity in morphology and inter-lead dependence.
  • Effective denoising: The method achieves strong denoising performance, with rescaled Mahalanobis distances averaging 0.130 ± 0.003 on the test set.
  • Accurate missing lead reconstruction: The model reconstructs missing ECG leads with high accuracy, achieving R2 scores of 0.98-0.99, outperforming traditional Dower matrices.
  • Strong QT-RR prediction: The model shows a very strong agreement with the Fridericia model for QT-RR relationship prediction, achieving R2 scores of 0.98 ± 0.002.
  • Successful abnormality detection: The approach effectively differentiates between healthy and Myocardial Infarction (MI) patients, with rescaled Mahalanobis distances being significantly smaller for control patients. ROC analysis also shows promising classification performance (M: 0.75, F: 0.70).

Limitations and Future Work

  • Parameter inference: While the paper proposes a method for Maximum Likelihood Estimation (MLE) of parameters, it acknowledges that in several applications, these parameters might not be known and require estimation.
  • Computational cost: While the paper aims for efficiency, diffusion models can still be computationally intensive, especially for high-resolution data or large numbers of particles.
  • Future work: The authors suggest several future directions, including:
  • Generating 12-lead ECGs from fewer leads (e.g., 6-lead) for transferring diagnostic algorithms to devices with limited leads (like smartwatches).
  • Identifying general repolarization abnormalities, such as long QT syndrome, by "normalizing" the T-wave by the activation sequence.
  • Generating ECGs in specific pathological situations (e.g., left bundle branch block) by training on more diverse, labeled data.

Summary updated

BibTeX
@misc{cardoso2023bayesian,
  author = {Gabriel Victorino Cardoso and Lisa Bedin and Josselin Duchateau and Rémi Dubois and Eric Moulines},
  title = {{Bayesian ECG reconstruction using denoising diffusion generative models}},
  year = {2023},
  eprint = {2401.05388},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.05388},
}
Figure