  We propose a machine learning-based method to build a system of differential
equations that approximates the dynamics of 3D electromechanical models for the
human heart, accounting for the dependence on a set of parameters.
Specifically, our method permits to create a reduced-order model (ROM), written
as a system of Ordinary Differential Equations (ODEs) wherein the forcing term,
given by the right-hand side, consists of an Artificial Neural Network (ANN),
that possibly depends on a set of parameters associated with the
electromechanical model to be surrogated. This method is non-intrusive, as it
only requires a collection of pressure and volume transients obtained from the
full-order model (FOM) of cardiac electromechanics. Once trained, the ANN-based
ROM can be coupled with hemodynamic models for the blood circulation external
to the heart, in the same manner as the original electromechanical model, but
at a dramatically lower computational cost. Indeed, our method allows for
real-time numerical simulations of the cardiac function. We demonstrate the
effectiveness of the proposed method on two relevant contexts in cardiac
modeling. First, we employ the ANN-based ROM to perform a global sensitivity
analysis on both the electromechanical and hemodynamic models. Second, we
perform a Bayesian estimation of two parameters starting from noisy
measurements of two scalar outputs. In both these cases, replacing the FOM of
cardiac electromechanics with the ANN-based ROM makes it possible to perform in
a few hours of computational time all the numerical simulations that would be
otherwise unaffordable, because of their overwhelming computational cost, if
carried out with the FOM. As a matter of fact, our ANN-based ROM is able to
speedup the numerical simulations by more than three orders of magnitude.
