Dreaming of Electrical Waves: Generative Modeling of Cardiac Excitation Waves Using Diffusion Models

Tanish Baranwal1, Jan Lebert2, Jan Christoph2
1University of California, Berkeley, 2University of California, San Francisco


Abstract

Background: Electrical waves in the heart form rotating spiral or scroll waves during life-threatening arrhythmias such as atrial or ventricular fibrillation. The spatio-temporal wave dynamics are typically modelled using coupled partial differential equations, which describe reaction-diffusion dynamics in excitable media. Recently, data-driven generative modelling has provided an alternative way to generate spatio-temporal patterns in physical and biological systems.

Aims: We explore the utility of diffusion-based generative modelling of electrophysiological cardiac wave patterns. We trained diffusion models with data produced with phenomenological biophysical models to generate electrical wave patterns such as spiral and scroll waves in cardiac tissue.

Methods: We characterize diffusion-generated wave patterns, determine how consistent and physically plausible they are compared to solutions generated with biophysical models, and explore the utility of diffusion models in multiple applications: i) inpainting and denoising with sparse or incomplete measurements, ii) predicting three-dimensional wave patterns from two-dimensional observations, iii) generating spontaneous spiral wave dynamics and iv) evolving spiral wave dynamics over time. We investigate to what extent diffusion models hallucinate', or invent patterns that may not correspond to physical solutions, and determine the plausibility of classifying spiral wave dynamics intofake' diffusion-generated and real patterns. We explore conditioning techniques to improve output fidelity of diffusion models and the potential ensemble effect of using diffusion models to improve upon the outputs of other pre-trained models.

Results: We found that diffusion models can outperform conventional neural networks, like the U-Net architecture, at the cost of higher training times. Diffusion models, when given insufficient constraints, tend to hallucinate visually plausible solutions that do not match reality.

Conclusion: Diffusion models are a powerful tool with many potential applications in cardiac arrhythmia research, which could potentially help identify arrhythmia patterns in situations where measurements are lacking or do not provide a full picture of the arrhythmia.