Abstract
Cardiac digital twins provide a physics and physiology informed framework to deliver personalized medicine. However, highfidelity multiscale cardiac models remain a barrier to adoption due to their extensive computational costs. Artificial Intelligencebased methods can make the creation of fast and accurate wholeheart digital twins feasible. We use Latent Neural Ordinary Differential Equations (LNODEs) to learn the pressurevolume dynamics of a heart failure patient. Our surrogate model is trained from 400 simulations while accounting for 43 parameters describing celltoorgan cardiac electromechanics and cardiovascular hemodynamics. LNODEs provide a compact representation of the 3D0D model in a latent space by means of an Artificial Neural Network that retains only 3 hidden layers with 13 neurons per layer and allows for numerical simulations of cardiac function on a single processor. We employ LNODEs to perform global sensitivity analysis and parameter estimation with uncertainty quantification in 3 hours of computations, still on a single processor.
Similar content being viewed by others
Introduction
Cardiac digital twins integrate physiological and pathological patientspecific data to monitor, analyze and forecast patient disease progression and outcomes. Highfidelity multiscale and anatomically accurate models are available but require extensive highperformance computing resources to run, which limit their clinical translation^{1}. Over the past years, these mathematical models evolved from an electromechanical description of the human ventricular activity in idealized shapes^{2,3} and realistic geometries^{4,5,6,7}, while also addressing diseased conditions^{8,9,10,11,12}, to wholeheart function^{13,14,15,16,17,18}. Nevertheless, running many electromechanical simulations still entail high computational costs, hindering the development and application of cardiac digital twins. The use of Machine Learning tools, such as Gaussian Processes Emulators^{19} and Artificial Neural Networks (ANNs)^{20,21}, allows to create efficient surrogate models that can be employed in manyquery applications^{22}, such as sensitivity analysis and parameter inference^{23,24,25}. In the framework of digital twinning and personalized medicine, bridging the chasm between the need for a supercomputer^{26,27,28,29} and performing accurate numerical simulations on a standard computer^{30,31,32,33} would have a tremendous impact on the clinical adoption of computational cardiology.
In this work, we develop a Scientific Machine Learning method to build a comprehensive surrogate model involving both cardiac and cardiovascular function. Specifically, we train a system of Latent Neural Ordinary Differential Equations (LNODEs)^{20,34,35} that learns the pressurevolume transients of a heart failure patient while varying 43 model parameters that describe cardiac electrophysiology, active and passive mechanics, and cardiovascular fluid dynamics, by employing 400 3D0D closedloop electromechanical training simulations. We design a suitable loss function that is minimized during the tuning process of the ANN parameters, which entails small relative errors of LNODEs, i.e., from 2% to 6%, when the number of training samples is small compared to the dimensionality of the parameter space and the explored model variability. These LNODEs enable fourchamber heart numerical simulations on a standard computer by encoding pressurevolume dynamics while spanning electromechanofluid model parameters throughout the cardiovascular system. Furthermore, they can be easily trained on a single central processing unit (CPU).
We use the trained LNODEs to perform global sensitivity analysis (GSA) and robust parameter estimation with uncertainty quantification (UQ)^{23,24}. For the former, we observe how model parameters impact the variability of scalar quantities of interest (QoIs) retrieved from the pressurevolume time traces, by considering both firstorder and highorder interactions via Sobol indices^{36}. For the latter, we combine two Bayesian statistics methods, i.e., Maximum a Posteriori (MAP) estimation and Hamiltonian Monte Carlo (HMC)^{34,37,38}, where we exploit efficient matrixfree adjointbased methods, automatic differentiation and vectorization^{34}. In particular, we design several test cases where we calibrate tens of model parameters by matching the pressure and volume time traces, that are timedependent QoIs, coming from 5 unseen 3D0D numerical simulations for the trained ANN. GSA and parameter estimation with UQ can be carried out in 3 hours of computations by using a single core standard laptop.
Results
We display the whole computational pipeline in Fig. 1.

Topleft: we use a database of N_{sims} = 405 electromechanical simulations generated by a personalized anatomy fourchamber heart model from a heart failure patient (see Supplementary Material 1), where we vary \({N}_{{{{\mathcal{P}}}}}=43\) parameters that describe cell, tissue, wholeheart and cardiovascular system material properties and boundary conditions. For all the numerical simulations, we run 5 heartbeats in sinus rhythm and we perform our analysis on the pressure and volume transients of the last cardiac cycle. We refer to Supplementary Material 2 for all the details about the fourchamber physicsbased mathematical model and the numerical settings of these simulations. All the information regarding model parameters can be found in Supplementary Material 3.

Bottomleft: we employ N_{train, valid} = 400 simulations to tune the LNODEs hyperparameters. This surrogate model learns the atrial and ventricular pressurevolume temporal dynamics of the last cardiac cycle only, while receiving time and model parameters as inputs. We perform Kfold cross validation with K = 10 for the trainingvalidation splitting. We detail the whole optimization process to get the final values of the LNODEs hyperparameters in Supplementary Material 4. We evaluate the accuracy of the trained LNODEs on a testing dataset consisting of the remaining N_{test} = 5 numerical simulations.

Bottomright: we employ the trained LNODEs to perform GSA.

Topright: we estimate model parameters with UQ on N_{test} = 5 numerical simulations by means of the trained LNODEs.
Learning atrial and ventricular pressurevolume loops
Automatic hyperparameters tuning with Kfold cross validation leads to an optimal ANN architecture comprising 3 hidden layers and 13 neurons per hidden layer. The optimal number of states is set to N_{z} = 8, i.e., no latent variables are selected. This is motivated by the tradeoff between the size of the training set N_{train, valid} with respect to the number of parameters \({N}_{{{{\mathcal{P}}}}}\), i.e., a thrifty system of LNODEs with no additional hidden variables z_{latent}(t) is selected to avoid overfitting. More details regarding LNODEs training and hyperparameters tuning are given in Supplementary Material 4.
In Table 1, we report the Normalized Root Mean Square Error (NRMSE) and R^{2} coefficients associated with the LA, LV, RA, and RV pressurevolume time traces provided by LNODEs. These values are obtained by considering a test set comprised of N_{test} = 5 electromechanical simulations. The accuracy obtained by our surrogate model in reproducing the cardiac outputs is high, manifesting testing errors that approximately range from 2% to 6% for all timedependent QoIs. The good match between models \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\) and \({{{{\mathcal{M}}}}}_{{{{\rm{ANN}}}}}\) is also confirmed by Fig. 2, where atrial and ventricular pressurevolume traces present a good overlap on the whole testing set.
Global sensitivity analysis
Figure 3 shows the totaleffect Sobol indices. We consider a parameter to be relevant if the associated Sobol indices are greater than 10^{−1} for at least one QoI. We notice that, as expected from a physiological point of view, some model parameters are compartmentalized, i.e., celltoorgan level values coming from a certain compartment of the cardiocirculatory system mostly explain the variability of QoIs that are specific to that region. Indeed, some parameters of the CRNLand model, such as atrial calcium/troponin complex when 50% of crossbridges are blocked \(per{m}_{{{{\rm{50}}}}}^{{{{\rm{CRNLand}}}}}\), atrial Ca^{2+}troponin cooperativity \(TRP{N}_{{{{\rm{n}}}}}^{{{{\rm{CRNLand}}}}}\) and atrial reference Ca^{2+} sensitivity \(c{a}_{{{{\rm{50}}}}}^{{{{\rm{CRNLand}}}}}\), or of the Guccione model, such as atrial stiffness in the transverse plane \({b}_{{{{\rm{t}}}}}^{{{{\rm{atria}}}}}\), have an important role in determining atrial behavior. Similar considerations occur for the ventricular part of the heart, where the most important parameters are related to the ToRORdLand model. Nevertheless, it is important to notice the interplay between some ventricular parameters of the ToRORdLand model at the cellular scale, such as ventricular steadystate duty ratio dr^{ToRORdLand}, ventricular calcium/troponin complex when 50% of crossbridges are blocked \(per{m}_{{{{\rm{50}}}}}^{{{{\rm{ToRORdLand}}}}}\) and ventricular reference Ca^{2+} sensitivity \(c{a}_{{{{\rm{50}}}}}^{{{{\rm{ToRORdLand}}}}}\) and the atrial function. This is a particularly interesting insight into cardiac physiology that can be clearly unraveled using this type of comprehensive sensitivity analysis. We highlight that, as expected, some model parameters, such as atrioventricular delay AV_{delay}, systemic resistance R^{sys} and pulmonary resistance R^{pulm} strongly affect all QoIs, whereas others, such as the pericardial coefficient k_{peri}, as well as aorta parameters (length Aol, stiffness k^{Art}), have a minor role in determining all QoIs.
Finally, we remark that Sobol indices are affected by the amplitude of the ranges in which the parameters are varied. In particular, the wider the range associated with a parameter, the greater the associated Sobol indices will be, as the parameter in question potentially generates greater variability in the QoI. Therefore, we stress that our results are valid for the specific ranges we used.
Robust parameter estimation
In the context of parameter calibration, a preliminary GSA allows to determine the identifiability of model parameters according to the provided QoIs. Based on the results obtained from global sensitivity analysis, we design 4 in silico test cases to show the robustness and flexibility of our parameter calibration process, which is driven by a combined use of MAP estimation and HMC starting from timedependent QoIs. In Table 2, we report the observed pressurevolume time traces and estimated model parameters for each test case. In \({{{{\mathcal{T}}}}}_{{{{\rm{LV}}}}}\) and \({{{{\mathcal{T}}}}}_{{{{\rm{ventricles}}}}}\), we estimate model parameters related to the ventricular and cardiovascular function starting from timedependent QoIs localized in the ventricles. In \({{{{\mathcal{T}}}}}_{{{{\rm{atria}}}}}\), we calibrate model parameters over the whole cardiac function and cardiocirculatory network by only considering atrial observations. Finally, we challenge our surrogate model by taking all cardiac pressures and volumes over time and by estimating 11 model parameters.
We perform parameter estimation with UQ on N_{test} = 5 electromechanical simulations that are unseen by the trained LNODEs. Figure 4 shows some twodimensional views of the posterior distribution for each test case and for all N_{test} numerical simulations. We notice that the true parameter values are contained inside the 95% credibility regions. Moreover, by using Bayesian statistics we are able to capture relationships among model parameters. In particular, in Fig. 4 we consider different pairs of model parameters for each test case and numerical simulation to maximize the number of interactions. For instance, pulmonary resistance scaling factor R^{pulm} and ventricular steadystate duty ratio dr^{ToRORdLand} are positively correlated with systemic resistance scaling factor R^{sys} and ventricular reference Ca^{2+} sensitivity \(c{a}_{{{{\rm{50}}}}}^{{{{\rm{ToRORdLand}}}}}\), respectively, while ventricular steadystate duty ratio dr^{ToRORdLand} and ventricular reference Ca^{2+} sensitivity \(c{a}_{{{{\rm{50}}}}}^{{{{\rm{ToRORdLand}}}}}\) are negatively correlated with fast endocardial layer scaling factor k_{FEC} and ventricular calcium/troponin complex when 50% of crossbridges are blocked \(per{m}_{{{{\rm{50}}}}}^{{{{\rm{ToRORdLand}}}}}\), respectively. We notice that, in some cases, cellbased atrial and ventricular parameters may be correlated, as it happens for atrial Ca^{2+}troponin cooperativity \(TRP{N}_{{{{\rm{n}}}}}^{{{{\rm{CRNLand}}}}}\) and ventricular calcium/troponin complex when 50% of crossbridges are blocked \(per{m}_{{{{\rm{50}}}}}^{{{{\rm{ToRORdLand}}}}}\), while in most situations, such as with ventricular steadystate duty ratio dr^{ToRORdLand} and atrial Ca^{2+}troponin cooperativity \(TRP{N}_{{{{\rm{n}}}}}^{{{{\rm{CRNLand}}}}}\), there is no interaction. We also remark that this kind of relationships may be unraveled among different physical problems. For instance, this occurs between cardiovascular hemodynamics (systemic resistance scaling factor R^{sys}) and the ventricular cell tension model (ventricular steadystate duty ratio dr^{ToRORdLand}). The aforementioned interactions among model parameters can be quite interesting and surprising from a physiological perspective, especially when they involve very different cardiovascular compartments of this complex multiscale and multiphysics mathematical model. For the sake of completeness, in Table 3, we report the identified parameter values of ventricular steadystate duty ratio dr^{ToRORdLand}, systemic resistance scaling factor R^{sys} and pulmonary resistance scaling factor R^{pulm} for all test cases, with respect to the first testing simulation. We see that the true values of the parameters are always contained inside the interval defined by median plus/minus interquartile range. We refer to Supplementary Material 6 for the tables containing similar results and comparisons for all test cases (\({{{{\mathcal{T}}}}}_{{{{\rm{LV}}}}}\), \({{{{\mathcal{T}}}}}_{{{{\rm{ventricles}}}}}\), \({{{{\mathcal{T}}}}}_{{{{\rm{atria}}}}}\) and \({{{{\mathcal{T}}}}}_{{{{\rm{all}}}}}\)) with all the relevant model parameters over the N_{test} electromechanical simulations.
Discussion
In this work, we propose a surrogate model based on LNODEs to learn the pressurevolume temporal dynamics of 3D0D closedloop fourchamber heart electromechanical simulations^{23}. The geometry is retrieved from a heart failure patient and some functional aspects have been incorporated in the electromechanical simulations. Specifically, we get QRS duration from 12lead electrocardiograms, ventricle reference tension for active contraction and heart rate, in order to achieve pressurevolume loops that are consistent with measured peak pressure and pressure transient duration^{25}. In particular, starting from 400 numerical simulations, we create an anatomyspecific surrogate model by leveraging LNODEs. These are defined by a lightweight feedforward fullyconnected ANN containing 3 hidden layers and 13 neurons per layer. LNODEs retain the variability of 43 model parameters that describe electrophysiology, active and passive mechanics, and hemodynamics, both at the cell level and organ scale, and covering a wide range of pressure and volume values (see Figures in Supplementary Material 2). Indeed, LNODEs allows to capture complex dynamics with a small number of tunable parameters. This paradigm, opposed to large machine learning models that work in the overparameterization regime, has proven to be very effective and robust, showing great generalization properties. Some other examples are given by Latent Dynamics Networks^{39} or Liquid Neural Networks^{40}, which are built on top of LNODEs to account for complex spacetime processes exhibiting abrupt changes by using very simple architectures and small latent spaces.
The generation of such a comprehensive training dataset poses an incredible technological challenge itself in the scientific community^{25}, and in recent years different surrogate models of cardiac electromechanics based on emulators have been proposed in the literature to provide fast and accurate evaluations based on computationally expensive physicsbased mathematical models^{19,25,41,42,43}. These emulators are built on a collection of precomputed numerical simulations obtained by sampling the parameter space, similarly to what has been done in this work. However, they only fit a static map between model parameters and pointwise QoIs extracted from the numerical simulations. On the other hand, LNODEs present a higher representational power, because they encode time dependent electromechanical simulations instead of pointwise QoIs, while also requiring a smaller amount of data to reach a prescribed accuracy^{23}. This is why this paper provides a comprehensive surrogate model embracing cardiac and cardiovascular function.
The choice of 400 numerical simulations for the training of LNODEs allows to get consistently low validation and testing errors, in the order of 2% to 6%, even in areas of the parameter space that are sparsely covered by the training samples (see Figure in Supplementary Material 3). The error remains within these bounds even if we increase the dimension of the testing set while decreasing the one of the training set (see Supplementary Material 9). In addition, LNODEs provide better generalization properties compared to Gaussian processes emulators, especially for ventricular function (see Supplementary Material 8).
LNODEs require a small amount of computational resources and enable several applications of interest in a very fast and accurate manner. Indeed, as reported in Table 4, running the training phase of the ANN along with GSA and robust parameter estimation on a single core standard laptop just requires 13 h of computations. We remark that this time can be reduced with a multicore implementation. On the other hand, employing the 3D0D model \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\) for the same computational pipeline would entail very significant costs. The overall speedup with the surrogate model \({{{{\mathcal{M}}}}}_{{{{\rm{ANN}}}}}\) is equal to 1718x. Furthermore, after the parameter calibration process, a wholeheart electromechanical simulation can run via highperformance computing with the estimated model parameters, showing all relevant spacetime fields, such as transmembrane potential, active contraction, displacement and stresses. This would provide relevant insights across the whole highfidelity cardiac model.
It is interesting to note that several model parameters related to electrophysiology, mechanics, and hemodynamics at the celltoorgan scale have a significant impact on the pressurevolume loops. These model parameters can be inferred from the pressurevolume relationships using Bayesian parameter estimation with UQ, i.e., their true values are contained within the 95% credibility regions of the posterior distribution. In addition, bayesian statistics provides important insights by capturing crosscorrelations between model parameters. This occurs even between different cardiovascular compartments, such as the systemic circulation and ventricular electromechanics. Our approach could be applied in a clinical setting by using clinically measured rather than computational pressurevolume loops to infer protein and celltoorgan function directly from clinical data.
Even though this paper focuses on a single anatomy, it represents an important milestone towards the construction of emulators incorporating geometric variability. Indeed, the presented approach can be extended to cover patient variability, by incorporating statistical shape modeling^{44,45} or other ANNbased methods, such as Universal Solution Manifold Networks^{46} or generative deep learning techniques based on Signed Distance Fields^{47,48}, within LNODEs, to encode different geometrical parameterizations. Furthermore, multiple pathological conditions and diagnoses can be taken into account by providing specific onehot vectors as additional inputs to the ANN^{47}. In this manner, we would run the numerical simulations with the biophysically detailed and anatomically accurate mathematical model just once and we would train an ANN that generalizes on multiple patients, while effectively capturing multiphysics and multiscale knowledge. Moreover, even though patientspecific pressurevolume loops have not been considered in this work, we aim at adding this information as part of our computational pipeline for parameter calibration with UQ. The proposed method paves the way to extensions incorporating different anatomies and pathological conditions, which would potentially allow for a universal wholeheart simulator that might be readily deployed in clinical practice for fast and reliable personalized parameter calibration based on patientspecific data.
Methods
Ethics statement
The clinical data used in this study were collected as part of a clinical trial (REC reference: 14/WM/1069) approved by the West MidlandsCoventry & Warwickshire Research Ethics Committee.
Learning atrial and ventricular pressurevolume loops
Following the model learning approach introduced in ref. ^{20}, we build a system of LNODEs, i.e., a set of ordinary differential equations whose right hand side is represented by a feedforward fullyconnected ANN, that learns the pressurevolume temporal dynamics of the 3D0D closedloop electromechanical model \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\) in a latent space. All details regarding cardiac anatomy and the model \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\), as well as the coupling to pressurevolume loops, are reported in Supplementary Material 1 and 2, respectively. In this framework, the fourchamber heart surrogate model \({{{{\mathcal{M}}}}}_{{{{\rm{ANN}}}}}\) reads:
where z_{0} is the vector of initial conditions. The ANN, with weights and biases encoded in \({{{\bf{w}}}}\in {{\mathbb{R}}}^{{N}_{w}}\), is defined by \({{{\mathcal{ANN}}}}:{{\mathbb{R}}}^{{N}_{z}+2+{N}_{{{{\mathcal{P}}}}}}\to {{\mathbb{R}}}^{{N}_{z}}\). Vector \({{{\boldsymbol{\theta }}}}\in {{{\boldsymbol{\Theta }}}}\subset {{\mathbb{R}}}^{{N}_{{{{\mathcal{P}}}}}}\) defines the model \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\) parameters. Some examples of θ could be conductances of different ionic channels, myocardial conductivity, atrial and ventricular active tension or passive stiffness, and resistances of the systemic and pulmonary circulation. The reduced state vector \({{{\bf{z}}}}(t)\in {{\mathbb{R}}}^{{N}_{z}}\) contains the timedependent pressure and volume variables of the left atrium (LA), right atrium (RA), left ventricle (LV) and right ventricle (RV), as well as additional latent variables without a direct physical interpretation, that is \({{{\bf{z}}}}(t)=[{{{{\bf{z}}}}}_{{{{\rm{physical}}}}}(t),{{{{\bf{z}}}}}_{{{{\rm{latent}}}}}(t)]={[{p}_{{{{\rm{LA}}}}}(t),{p}_{{{{\rm{LV}}}}}(t),{p}_{{{{\rm{RA}}}}}(t),{p}_{{{{\rm{RV}}}}}(t),{V}_{{{{\rm{LA}}}}}(t),{V}_{{{{\rm{LV}}}}}(t),{V}_{{{{\rm{RA}}}}}(t),{V}_{{{{\rm{RV}}}}}(t),{{{{\bf{z}}}}}_{{{{\rm{latent}}}}}(t)]}^{T}\). The ANN receives N_{z} state variables, \({N}_{{{{\mathcal{P}}}}}\) scalar parameters, and two periodic inputs. Indeed, even though LNODEs are just trained on the last cardiac cycle, the cosine and sine terms account for the heartbeat period T_{HB} and the atrioventricular delay AV_{delay} of wholeheart electromechanical simulations (see Supplementary Material 2 for further details). On the other hand, the vector of physicsbased model parameters θ, which involves cardiac electromechanics and cardiovascular hemodynamics, is not related to the time variable, as is the case for T_{HB} and AV_{delay}, and is given directly as input neurons to the ANN. We stress that, differently from ref. ^{23}, the initial reduced state vector z_{0} contains different sets of initial conditions for pressures, volumes and latent variables. Pressure and volume initial values are determined by model \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\). Following^{49}, latent variables are initialized to zero and these initial conditions act as additional tunable parameters along with the weights and biases of the ANN.
The loss function that we minimize during the ANN optimization process reads:
with α = β = γ = η = 0.1. The loss function aims at finding an optimal set of weights \(\widehat{{{{\bf{w}}}}}\) for the ANN. It comprises the normalized mean square error between ANN pressurevolume predictions z_{physical}(t) and observations \({\tilde{\bf{z}}}_{{{{\rm{physical}}}}}(t)\), as well as a weak penalization of the physical state vector time derivatives, maximum and minimum values for t ∈ [T − T_{HB}, T]. Indeed, given the small ratio between the dimensionality of the training dataset and the number of parameters θ of model \({{{{\mathcal{M}}}}}_{3{{{\rm{D}}}}{{\mbox{}}}0{{{\rm{D}}}}}\), we notice that these three additional terms reduce the generalization errors of the ANN. The penultimate weakly enforced condition on z_{latent}(t) favors a periodic solution for all the hidden latent variables. The last term of the loss function prescribes the L^{2} regularization of the ANN weights and ι is one of the automatically tuned LNODEs hyperparameters (see Supplementary Material 4).
Global sensitivity analysis
We employ the Saltelli’s method to perform a variancebased sensitivity analysis^{50}. We compute both firstorder Sobol indices and totaleffect Sobol indices for each combination of quantity of interest and model parameter^{36}. These two indices define how much varying a single parameter affects a specific QoI and how higherorder interactions among model parameters influences the model outputs, respectively. All mathematical details regarding the computation of Sobol indices and Saltelli’s sampling are given in Supplementary Material 5, along with firstorder Sobol indices computed using model \({{{{\mathcal{M}}}}}_{{{{\rm{ANN}}}}}\).
Robust parameter estimation
We perform parameter calibration with inverse UQ following a twostage approach. First, given a set of timedependent QoIs related to fourchamber heart pressure and volume traces, we solve a bounded and constrained optimization problem by employing model \({{{{\mathcal{M}}}}}_{{{{\rm{ANN}}}}}\) to obtain the pointwise MAP estimation for a predefined set of model parameters \({{{\boldsymbol{\theta }}}}\in {{{\boldsymbol{\Theta }}}}\subset {{\mathbb{R}}}^{{N}_{{{{\mathcal{P}}}}}}\). Second, we initialize HMC based on the MAP estimation and we build an approximation for the posterior distribution of θ^{37}, while accounting for the measurement and surrogate modeling errors via Gaussian Processes^{24}. We provide all the mathematical and numerical details regarding the optimal control problem we solve, MAP estimation, HMC, and how we account for the different sources of error during inverse UQ in Supplementary Material 6.
Software libraries
All 3D0D closedloop electromechanical simulations run with the Cardiac Arrhythmia Research Package (CARP)^{13,51}. We train model \({{{{\mathcal{M}}}}}_{{{{\rm{ANN}}}}}\) by using an inhouse highperformance Python library based on Tensorflow^{52}. We perform GSA by means of the open source Python library SALib^{53}. Parameter estimation with UQ is carried out by combining the open source Python libraries JAX^{54} and NumPyro^{55}.
Reporting summary
Further information on research design is available in the Nature Research Reporting Summary linked to this article.
Data availability
The fourchamber heart pressurevolume loops used to train and test LNODEs are available at: https://github.com/MatteoSalvador/cardioEM4CH.
Code availability
The code to train LNODEs, to perform GSA and to do Bayesian parameter estimation with uncertainty quantification is publicly available at: https://github.com/MatteoSalvador/cardioEM4CH.
References
Niederer, S. A., Lumens, J. & Trayanova, N. A. Computational models in cardiology. Nat. Rev. Cardiol. 16, 100–111 (2019).
Landajuela, M. et al. Numerical approximation of the electromechanical coupling in the left ventricle with inclusion of the Purkinje network. Int. J. Numer. Methods Biomed. Eng. 34, e2984 (2018).
Salvador, M., Dede’, L. & Quarteroni, A. An intergrid transfer operator using radial basis functions with application to cardiac electromechanics. Comput. Mech. 66, 491–511 (2020).
Augustin, C. M. et al. A computationally efficient physiologically comprehensive 3D0D closedloop model of the heart and circulation. Comput. Methods Appl. Mech. Eng. 386, 114092 (2021).
Regazzoni, F. et al. A cardiac electromechanical model coupled with a lumpedparameter model for closedloop blood circulation. J. Comput. Phys. 457, 111083 (2022).
Piersanti, R. et al. 3D0D closedloop model for the simulation of cardiac biventricular electromechanics. Comput. Methods Appl. Mech. Eng. 391, 114607 (2022).
SainteMarie, J. et al. Modeling and estimation of the cardiac electromechanical activity. Comput. Struct. 84, 1743–1759 (2006).
Asner, L. et al. Patientspecific modeling for left ventricular mechanics using datadriven boundary energies. Comput. Methods Appl. Mech. Eng. 314, 269–295 (2017).
Liu, H. et al. The impact of myocardial compressibility on organlevel simulations of the normal and infarcted heart. Sci. Rep. 11, 13466 (2021).
Mittal, R. et al. Computational modeling of cardiac hemodynamics: current status and future outlook. J. Comput. Phys. 305, 1065–1082 (2016).
Salvador, M. et al. Electromechanical modeling of human ventricles with ischemic cardiomyopathy: numerical simulations in sinus rhythm and under arrhythmia. Comput. Biol. Med. 136, 104674 (2021).
Schwarz, E. L., Pegolotti, L., Pfaller, M. R. & Marsden, A. L. Beyond CFD: emerging methodologies for predictive simulation in cardiovascular health and disease. Biophys. Rev. 4, 011301 (2023).
Augustin, C. M. et al. Anatomically accurate high resolution modeling of human whole heart electromechanics: A strongly scalable algebraic multigrid solver method for nonlinear deformation. J. Comput. Phys. 305, 622–646 (2016).
Fedele, M. et al. A comprehensive and biophysically detailed computational model of the whole human heart electromechanics. Comput. Methods Appl. Mech. Eng. 410, 115983 (2023).
Gerach, T. et al. Electromechanical wholeheart digital twins: a fully coupled multiphysics approach. Mathematics 9, 1247 (2021).
Pfaller, M. et al. The importance of the pericardium for cardiac biomechanics: from physiology to computational modeling. Biomech. Model. Mechanobiol. 18, 503–529 (2019).
Peirlinck, M. et al. Precision medicine in human heart modeling. Biomech. Model. Mechanobiol. 20, 803–831 (2021).
Strocchi, M. et al. A publicly available virtual cohort of fourchamber heart meshes for cardiac electromechanics simulations. PLoS One 15, 1–26 (2020).
Longobardi, S. et al. Predicting left ventricular contractile function via Gaussian process emulation in aorticbanded rats. Philos. Trans. R. Soc. A 378, 20190334 (2020).
Regazzoni, F., Dede’, L. & Quarteroni, A. Machine learning for fast and reliable solution of timedependent differential equations. J. Comput. Phys. 397, 108852 (2019).
Salvador, M., Dede’, L. & Manzoni, A. Non intrusive reduced order modeling of parametrized pdes by kernel pod and neural networks. Comput. Math. Appl. 104, 1–13 (2021).
Quarteroni, A., Manzoni, A. & Negri, F. Reduced Basis Methods for Partial Differential Equations. An Introduction, Vol. 92 (Springer, 2016).
Regazzoni, F., Salvador, M., Dede’, L. & Quarteroni, A. A machine learning method for realtime numerical simulations of cardiac electromechanics. Comput. Methods Appl. Mech. Eng. 393, 114825 (2022).
Salvador, M., Regazzoni, F., Dede’, L. & Quarteroni, A. Fast and robust parameter estimation with uncertainty quantification for the cardiac function. Comput. Methods Progr. Biomed. 231, 107402 (2023).
Strocchi, M. et al. Cell to whole organ global sensitivity analysis on a fourchamber electromechanics model using Gaussian processes emulators. PLOS Comput. Biol. 19, e1011257 (2023).
Marchesseau, S. et al. Personalization of a cardiac electromechanical model using reduced order unscented Kalman filtering from regional volumes. Med. Image Anal. 17, 816–829 (2013).
Marx, L. et al. Personalization of electromechanical models of the pressureoverloaded left ventricle: fitting of windkesseltype afterload models. Philos. Trans. R. Soc. A 378, 20190342 (2020).
Sermesant, M. et al. Patientspecific electromechanical models of the heart for the prediction of pacing acute effects in CRT: a preliminary clinical validation. Med. Image Anal. 16, 201–215 (2012).
Strocchi, M. et al. Simulating ventricular systolic motion in a fourchamber heart model with spatially varying robin boundary conditions to model the effect of the pericardium. J. Biomech. 101, 109645 (2020).
Cicci, L., Fresca, S., Manzoni, A. & Quarteroni, A. Efficient approximation of cardiac mechanics through reduced order modeling with deep learningbased operator approximation. arXiv:2202.03904 (2022).
Jung, A., Gsell, M. A. F., Augustin, C. M. & Plank, G. An integrated workflow for building digital twins of cardiac electromechanicsa multifidelity approach for personalising active mechanics. Mathematics 10, 823 (2022).
Regazzoni, F. & Quarteroni, A. Accelerating the convergence to a limit cycle in 3D cardiac electromechanical simulations through a datadriven 0D emulator. Comput. Biol. Med. 135, 104641 (2021).
Schiavazzi, D. E. et al. Patientspecific parameter estimation in singleventricle lumped circulation models under uncertainty. Int. J. Numer. Methods Biomed. Eng. 33, 3 (2017).
Chen, R. T. Q., Rubanova, Y., Bettencourt, J. & Duvenaud, D. Neural ordinary differential equations. arXiv:1806.07366 (2019).
Rubanova, Y., Chen, R. T. Q. & Duvenaud, D. K. Latent ordinary differential equations for irregularlysampled time series. In Advances in Neural Information Processing Systems, vol. 32 (Curran Associates, Inc., 2019).
Sobol’, I. M. On sensitivity estimation for nonlinear mathematical models. Matematicheskoe Modelirovanie 2, 112–118 (1990).
Betancourt, M. & Girolami, M. A conceptual introduction to Hamiltonian Monte Carlo. arXiv:1701.02434 (2017).
Homan, M. D. & Gelman, A. The NoUTurn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. J. Mach. Learn. Res. 15, 1593–1623 (2014).
Regazzoni, F., Pagani, S., Salvador, M., Dede’, L. & Quarteroni, A. Learning the intrinsic dynamics of spatiotemporal processes through latent dynamics networks. Nat. Commun. 15, 1834 (2024).
Hasani, R. M., Lechner, M., Amini, A., Rus, D. & Grosu, R. Liquid timeconstant networks. In AAAI Conference on Artificial Intelligence (2020).
Di Achille, P. et al. Gaussian process regressions for inverse problems and parameter searches in models of ventricular mechanics. Front. Physiol. 9, 1002 (2018).
Dabiri, Y. et al. Prediction of left ventricular mechanics using machine learning. Front. Phys. 7, 117 (2019).
Cai, L. et al. Surrogate models based on machine learning methods for parameter estimation of left ventricular myocardium. R. Soc. Open Sci. 8, 201121 (2021).
Rodero, C. et al. Linking statistical shape models and simulated function in the healthy adult human heart. PLOS Comput. Biol. 17, 1–28 (2021).
Rodero, C. et al. Calibration of cohorts of virtual patient heart models using Bayesian history matching. Ann. Biomed. Eng. 51, 241–252 (2023).
Regazzoni, F., Pagani, S. & Quarteroni, A. Universal solution manifold networks (USMNets): nonintrusive meshfree surrogate models for problems in variable domains. J. Biomech. Eng. 144, 121004 (2022).
Kong, F. et al. Sdf4chd: Generative modeling of cardiac anatomies with congenital heart defects. arXiv:2311.00332 (2023).
Verhülsdonk, J. et al. Sdf4chd: Generative modeling of cardiac anatomies with congenital heart defects. arXiv:2308.16568 (2023).
Regazzoni, F., Chapelle, D. & Moireau, P. Combining data assimilation and machine learning to build datadriven models for unknown long time dynamics–applications in cardiovascular modeling. Int. J. Numer. Methods Biomed. Eng. 37, e3471 (2021).
Saltelli, A. Making best use of model evaluations to compute sensitivity indices. Comput. Phys. Commun. 145, 280–297 (2002).
Vigmond, E. J., Hughes, M., Plank, G. & Leon, L. J. Computational tools for modeling electrical activity in cardiac tissue. J. Electrocardiol. 36, 69–74 (2003).
Abadi, M. et al. TensorFlow: Largescale machine learning on heterogeneous distributed systems. arXiv:1603.04467 (2016).
Herman, J. & Usher, W. SALib: An opensource Python library for sensitivity analysis. J. Open Sour. Softw. 2, 97 (2017).
Bradbury, J. et al. JAX: composable transformations of Python+NumPy programs. http://github.com/google/jax (2018).
Phan, D., Pradhan, N. & Jankowiak, M. Composable effects for flexible and accelerated probabilistic programming in NumPyro. arXiv:1912.11554 (2019).
Acknowledgements
This project has been funded by the Italian Ministry of University and Research (MIUR) within the PRIN (Research projects of relevant national interest 2017 “Modeling the heart across the scales: from cardiac cells to the whole organ” Grant Registration number 2017AXL54F). This project has also been supported by the INdAM GNCS Project CUP E55F22000270001. SAN acknowledges NIH R01HL152256, ERC PREDICTHF 453 (864055), BHF (RG/20/4/34803), EPSRC (EP/P01268X/1, EP/X012603/1), EPSRC Grant EP/X03870X/1 and The Alan Turing Institute. LD acknowledges the support by the FAIR (Future Artificial Intelligence Research) project, funded by the NextGenerationEU program within the PNRRPEAI scheme (M4C2, investment 1.3, line on Artificial Intelligence), Italy, the membership to the GNCSGruppo Nazionale per il Calcolo Scientifico (National Group for Scientific Computing, Italy), and the initiative “Dipartimento di Eccellenza 2023–2027”, Italian Ministry of University and Research (MUR), Italy.
Author information
Authors and Affiliations
Contributions
Matteo Salvador: conceptualization, data curation, formal analysis, investigation, methodology, visualization, writingoriginal draft, writingreview & editing. Marina Strocchi: data curation, investigation, writingoriginal draft, writingreview & editing. Francesco Regazzoni: formal analysis, investigation, methodology, writingoriginal draft, writingreview & editing. Christoph M. Augustin: writingoriginal draft, writingreview & editing. L. Dede’: supervision, funding acquisition, writingoriginal draft, writingreview & editing. Steven A. Niederer: supervision, funding acquisition, writingoriginal draft, writingreview & editing. Alfio Quarteroni: supervision, funding acquisition, writingoriginal draft, writingreview & editing.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Salvador, M., Strocchi, M., Regazzoni, F. et al. Wholeheart electromechanical simulations using Latent Neural Ordinary Differential Equations. npj Digit. Med. 7, 90 (2024). https://doi.org/10.1038/s4174602401084x
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s4174602401084x