Table of Contents
Fetching ...

ECGTwin: Personalized ECG Generation Using Controllable Diffusion Model

Yongfan Lai, Bo Liu, Xinyan Guan, Qinghao Zhao, Hongyan Li, Shenda Hong

TL;DR

ECGTwin addresses the problem of generating patient-specific ECG signals under target conditions by decoupling personalization from conditioning through a two-stage diffusion framework. It first learns an Individual Base Extractor to obtain a compact base vector representing a patient, using self-supervised contrastive learning, and then uses AdaX Condition Injector with two dedicated pathways to inject cardiac-condition text and demographics as well as the base vector and time information into a diffusion denoiser. The approach yields high-fidelity, diverse ECG digital twins that preserve individual traits, improves downstream personalized ECG auto-diagnosis, and supports interpretable, post-generation editing via cross-attention-based conditioning. The results on large-scale MIMIC-IV-ECG and external PTB-XL data demonstrate superior generation quality, stronger personal consistency, and practical potential for personalized healthcare applications.

Abstract

Personalized electrocardiogram (ECG) generation is to simulate a patient's ECG digital twins tailored to specific conditions. It has the potential to transform traditional healthcare into a more accurate individualized paradigm, while preserving the key benefits of conventional population-level ECG synthesis. However, this promising task presents two fundamental challenges: extracting individual features without ground truth and injecting various types of conditions without confusing generative model. In this paper, we present ECGTwin, a two-stage framework designed to address these challenges. In the first stage, an Individual Base Extractor trained via contrastive learning robustly captures personal features from a reference ECG. In the second stage, the extracted individual features, along with a target cardiac condition, are integrated into the diffusion-based generation process through our novel AdaX Condition Injector, which injects these signals via two dedicated and specialized pathways. Both qualitative and quantitative experiments have demonstrated that our model can not only generate ECG signals of high fidelity and diversity by offering a fine-grained generation controllability, but also preserving individual-specific features. Furthermore, ECGTwin shows the potential to enhance ECG auto-diagnosis in downstream application, confirming the possibility of precise personalized healthcare solutions.

ECGTwin: Personalized ECG Generation Using Controllable Diffusion Model

TL;DR

ECGTwin addresses the problem of generating patient-specific ECG signals under target conditions by decoupling personalization from conditioning through a two-stage diffusion framework. It first learns an Individual Base Extractor to obtain a compact base vector representing a patient, using self-supervised contrastive learning, and then uses AdaX Condition Injector with two dedicated pathways to inject cardiac-condition text and demographics as well as the base vector and time information into a diffusion denoiser. The approach yields high-fidelity, diverse ECG digital twins that preserve individual traits, improves downstream personalized ECG auto-diagnosis, and supports interpretable, post-generation editing via cross-attention-based conditioning. The results on large-scale MIMIC-IV-ECG and external PTB-XL data demonstrate superior generation quality, stronger personal consistency, and practical potential for personalized healthcare applications.

Abstract

Personalized electrocardiogram (ECG) generation is to simulate a patient's ECG digital twins tailored to specific conditions. It has the potential to transform traditional healthcare into a more accurate individualized paradigm, while preserving the key benefits of conventional population-level ECG synthesis. However, this promising task presents two fundamental challenges: extracting individual features without ground truth and injecting various types of conditions without confusing generative model. In this paper, we present ECGTwin, a two-stage framework designed to address these challenges. In the first stage, an Individual Base Extractor trained via contrastive learning robustly captures personal features from a reference ECG. In the second stage, the extracted individual features, along with a target cardiac condition, are integrated into the diffusion-based generation process through our novel AdaX Condition Injector, which injects these signals via two dedicated and specialized pathways. Both qualitative and quantitative experiments have demonstrated that our model can not only generate ECG signals of high fidelity and diversity by offering a fine-grained generation controllability, but also preserving individual-specific features. Furthermore, ECGTwin shows the potential to enhance ECG auto-diagnosis in downstream application, confirming the possibility of precise personalized healthcare solutions.

Paper Structure

This paper contains 44 sections, 10 equations, 14 figures, 6 tables, 1 algorithm.

Figures (14)

  • Figure 1: Training, inference and application of ECGTwin. Trained via contrastive learning and diffusion objectives respectively, and acting in a two-stage manner, our model is capable of simulating the plausible ECG signal (i.e. ECG digital twins) under a specified cardiac condition with input of a reference ECG and associated cardiac condition. The generated ECG digital twins carries more individual-relevant patterns and can be used to enhance the ECG diagnosis driven by deep learning methods.
  • Figure 2: Architecture of modules in ECGTwin's two stages. The complete flow chart can be find in App. \ref{['app:flow']}.
  • Figure 3: The visualization result of base vector t-SNE embeddings. (a)--(d): Base vectors of real ECGs from ten patients; (e)--(h): Base vectors of real ECGs and generated digital twins from three patients
  • Figure 4: Case study of personalized ECG generation. (a): Input data, including the reference ECG, associated cardiac condition, and the target cardiac condition. (b): The ECG digital twin generated by ECGTwin, along with the average cross-attention map of the report token PVC. Redder regions indicate higher amount of attention.
  • Figure 5: The flow chart of ECGTwin. The Individual Base Extractor first extracts the base vector of the patient from reference ECG and reference cardiac condition, then the latent diffusion model with AdaX Condition Injector integrates the base vector, current diffusion timestep and target cardiac condition to generate ECG digital twins by repeatedly denoising a latent sampled from Gaussian distribution.
  • ...and 9 more figures

Theorems & Definitions (2)

  • Definition 2.1
  • Definition 2.2