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.
