Table of Contents
Fetching ...

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

Tanish Baranwal, Jan Lebert, Jan Christoph

TL;DR

This work investigates denoising diffusion probabilistic models as data driven generators for cardiac excitation waves, training DDPMs on simulated spiral and scroll wave dynamics across 2D and 3D heart shaped geometries. The authors demonstrate parameter conditioned generation, 3D heart geometry generation, time evolution, and surface to volume reconstruction, showing diffusion outputs can closely resemble biophysical PDE solutions and even reproduce self termination statistics. They also reveal limitations, notably hallucinations under under constrained tasks and artifacts when training data are lacking, and highlight computational costs for training. Overall, DDPMs emerge as promising data driven priors for electrophysiology that could enable data driven modeling, reconstruction from partial measurements, and personalized simulations, while requiring careful constraint and validation.

Abstract

Electrical waves in the heart form rotating spiral or scroll waves during life-threatening arrhythmias such as atrial or ventricular fibrillation. The wave dynamics are typically modeled using coupled partial differential equations, which describe reaction-diffusion dynamics in excitable media. More recently, data-driven generative modeling has emerged as an alternative to generate spatio-temporal patterns in physical and biological systems. Here, we explore denoising diffusion probabilistic models for the generative modeling of electrical wave patterns in cardiac tissue. We trained diffusion models with simulated electrical wave patterns to be able to generate such wave patterns in unconditional and conditional generation tasks. For instance, we explored the diffusion-based i) parameter-specific generation, ii) evolution and iii) inpainting of spiral wave dynamics, including reconstructing three-dimensional scroll wave dynamics from superficial two-dimensional measurements. Further, we generated arbitrarily shaped bi-ventricular geometries and simultaneously initiated scroll wave patterns inside these geometries using diffusion. We characterized and compared the diffusion-generated solutions to solutions obtained with corresponding biophysical models and found that diffusion models learn to replicate spiral and scroll waves dynamics so well that they could be used for data-driven modeling of excitation waves in cardiac tissue. For instance, an ensemble of diffusion-generated spiral wave dynamics exhibits similar self-termination statistics as the corresponding ensemble simulated with a biophysical model. However, we also found that diffusion models {produce artifacts if training data is lacking, e.g. during self-termination,} and `hallucinate' wave patterns when insufficiently constrained.

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

TL;DR

This work investigates denoising diffusion probabilistic models as data driven generators for cardiac excitation waves, training DDPMs on simulated spiral and scroll wave dynamics across 2D and 3D heart shaped geometries. The authors demonstrate parameter conditioned generation, 3D heart geometry generation, time evolution, and surface to volume reconstruction, showing diffusion outputs can closely resemble biophysical PDE solutions and even reproduce self termination statistics. They also reveal limitations, notably hallucinations under under constrained tasks and artifacts when training data are lacking, and highlight computational costs for training. Overall, DDPMs emerge as promising data driven priors for electrophysiology that could enable data driven modeling, reconstruction from partial measurements, and personalized simulations, while requiring careful constraint and validation.

Abstract

Electrical waves in the heart form rotating spiral or scroll waves during life-threatening arrhythmias such as atrial or ventricular fibrillation. The wave dynamics are typically modeled using coupled partial differential equations, which describe reaction-diffusion dynamics in excitable media. More recently, data-driven generative modeling has emerged as an alternative to generate spatio-temporal patterns in physical and biological systems. Here, we explore denoising diffusion probabilistic models for the generative modeling of electrical wave patterns in cardiac tissue. We trained diffusion models with simulated electrical wave patterns to be able to generate such wave patterns in unconditional and conditional generation tasks. For instance, we explored the diffusion-based i) parameter-specific generation, ii) evolution and iii) inpainting of spiral wave dynamics, including reconstructing three-dimensional scroll wave dynamics from superficial two-dimensional measurements. Further, we generated arbitrarily shaped bi-ventricular geometries and simultaneously initiated scroll wave patterns inside these geometries using diffusion. We characterized and compared the diffusion-generated solutions to solutions obtained with corresponding biophysical models and found that diffusion models learn to replicate spiral and scroll waves dynamics so well that they could be used for data-driven modeling of excitation waves in cardiac tissue. For instance, an ensemble of diffusion-generated spiral wave dynamics exhibits similar self-termination statistics as the corresponding ensemble simulated with a biophysical model. However, we also found that diffusion models {produce artifacts if training data is lacking, e.g. during self-termination,} and `hallucinate' wave patterns when insufficiently constrained.
Paper Structure (21 sections, 10 equations, 10 figures, 3 tables)

This paper contains 21 sections, 10 equations, 10 figures, 3 tables.

Figures (10)

  • Figure 1: Diffusion-based generative modeling of electrical wave dynamics in cardiac tissue. A Forward diffusion process and generative reverse denoising process. The training data consists of spiral and scroll wave dynamics in excitable media. B General diffusion model architecture for processing image data with underlying U-Net architecture. C ResNet Attention block. D Diffusion model for generating scroll waves in heart-shaped geometries represented as pointclouds with corresponding scalar-valued data (Point-Voxel Diffusion Zhou2021).
  • Figure 2: Parameter-specific generation of spiral wave dynamics using diffusion-based generative modeling (Task 1), see also Supplementary Videos 1-5. A Different simulations of spiral waves while varying parameters $D$ and $\epsilon_0$ in eqs. (\ref{['eq:modelu']})-(\ref{['eq:modelr']}), or diffusion constant and time scale separation parameter, respectively, which influence the width of and distance between the waves, respectively. B The diffusion model was trained with data consisting of multi-spiral wave dynamics for the same parameter combinations ($D$,$\epsilon_0$) as in A with $500$ simulations per combination. Some parameter combinations (white) were left out during training (5 of 20). C The diffusion model generates parameter-specific spiral wave patterns for all parameter combinations, even though it was not trained on all of them. D The diffusion model can generate a full dynamical state with both dynamic variables $u$ and $r$ as well as E multiple timesteps of such states at once: $(u,r)(x,y,t_1, ... , t_n)$ with $t_n = 2,3, ... , 15$. F Diffusion-generated multi-timestep sample ($t_n = 10$) showing spatio-temporal spiral wave pattern with fast and slow variables (corresponds to $t_s = 100$ simulation time steps, see section \ref{['sec:results:parameterspecific']}).
  • Figure 3: Scheme to verify whether the diffusion-generated spiral wave patterns in Fig. \ref{['fig:parameter-specific1']} are parameter-specific: A The first state $(u,r)$ at $t_1$ of the diffusion-generated multi-timestep sample generated with parameters $(\epsilon_0^*,D^*)$ was loaded into the corresponding biophysical model with either identical or mismatching parameters $(\epsilon_0,D)$. The biophysical model was then integrated for $t_s$ time steps and the solutions were then compared to the last state of the diffusion-generated sample at $t_n$. This was repeated for all parameter combinations $(\epsilon_0,D)$, see section \ref{['sec:results:parameterspecific']} for details. B Trajectories in phase space starting from state $t_1$, co-evolving with matching parameters and diverging with mismatching parameters. C Error between diffusion-generated and simulated states over time ($t_n = 5$ corresponds to $t_s=150$) with matching (low error: black/purple) and mismatching (high error: orange/yellow) parameters for one diffusion-generated sample. D Examples of diffusion-generated and simulated states at $t_n = t_s$ with matching parameters ($(\epsilon_0^*,D^*)=(\epsilon_0,D)$) and mismatching parameters ($5 \times 5$ grid with same parameter combinations as in Fig. \ref{['fig:parameter-specific1']}A,B). The diffusion-generated sample was generated with the parameter combination indicated by the green square. The matching biophysical simulation was performed with the same parameters, while the mismatching simulation was performed with the combination indicated by the red square. The simulations deviate from the diffusion-generated samples when the parameters do not match which causes an error (pixel-wise absolute difference). E Confirmation that generations are parameter-specific: the average pixel-wise error (MAE) between simulated and diffusion-generated patterns at $t_n$ (averaged over 100 samples/simulation) is the lowest (black/purple: small, orange/yellow: large) for matching parameter combinations $(D,\epsilon_0) = (D^*,\epsilon_0^*)$. $\square$ parameter combination $(D^*,\epsilon_0^*)$ used to generate diffusion-generated sample; $*$ parameter combination of simulation $(D,\epsilon_0)$ with lowest error; $\square$ and $*$ match in 21 out of 25 cases, in the other cases the minimum is nearby with marginal difference in the error. $5 \times 5$ grid corresponds to same parameter combinations as in Fig. \ref{['fig:parameter-specific1']}A.
  • Figure 4: Diffusion-based modeling of reentrant electrical waves in heart-shaped bi-ventricular geometries (Task 2), see also Supplementary Video 6. A Template geometry used in simulations to generate training data. B$1,000$ randomized, unique variations of template geometry to create unique training samples, as described in Lebert2023. C Geometry-dependent bi-ventricular muscle fiber architecture initiated in each simulation. D Denoising process during diffusion-based generation of electrical scroll wave pattern in bi-ventricular heart shape. Both the tissue geometry and wave pattern are generated simultaneously. E Training data used to train diffusion model consisting of $5,000$ training samples showing electrical scroll wave patterns. Each simulation consists of $32,000$ particles, subsampled to $16,000$ particles for training, here voxelized and volume-rendered for visualization. The training data was simulated using a biophysical model (Aliev-Panfilov), see eqs.(\ref{['eq:modelu']})-(\ref{['eq:modelr']}), and integrated using the SPH-method Zhang2021Zhang2021b, see section \ref{['sec:methods:simulations']}. F Additional examples of diffusion-generated electrical scroll waves in bi-ventricular heart shapes. The diffusion model generates a bi-ventricular shape (each shape different) as well as a full dynamical state with both dynamic variables $(u,r)(\vec{x})$. The scroll wave patterns are anisotropic due to the specific ventricular muscle fiber organization in the training data.
  • Figure 5: Data-driven modelling of spiral wave dynamics using diffusion models. A Spatio-temporal prediction (Task 3) of $5$ frames from previous $5$ frames, see section \ref{['sec:results:evolve']}. B,C Comparison of ground-truth data (GT) simulated with biophysical model (finite differences) and data-driven methods (Diffusion vs. U-Net) to evolve the wave pattern. With a single spiral wave, the output of the diffusion model is visually indistinguishable from the ground-truth for many rotations, while U-Net quickly fails to sustain the wave pattern. With more complicated wave patterns, the diffusion models begins to deviate from the biophysical model after 2-3 spiral rotations (80 time steps).
  • ...and 5 more figures