Organizations: Laboratory of Mathematics for Biology and Medicine, Università di Trento, Italy · MOX Laboratory, Department of Mathematics, Politecnico di Milano, Italy · Euler Institute, Università della Svizzera italiana, Switzerland
Modern forward electrocardiogram (ECG) computational models rely on an accurate representation of the torso domain. The lead-field method enables fast ECG simulations while preserving full geometric fidelity. Achieving high anatomical accuracy in torso representation is, however, challenging in clinical practice, as imaging protocols are typically focused on the heart and often do not include the entire torso. In addition, the computational cost of the lead-field method scales linearly with the number of electrodes, limiting its applicability in high-density recording settings. To date, no existing approach simultaneously achieves high anatomical fidelity, low data requirements and computational efficiency. In this work, we propose a shape-informed surrogate model of the lead-field operator that serves as a drop-in replacement for the full-order model in forward ECG simulations. The proposed framework consists of two components: a geometry-encoding module that maps anatomical shapes into a low-dimensional latent space, and a geometry-conditioned neural surrogate that predicts lead-field gradients from spatial coordinates, electrode positions and latent codes. The proposed method achieves high accuracy in approximating lead fields both within the torso (mean angular error 5°) and inside the heart, resulting in highly accurate ECG simulations (relative mean squared error <2.5%. The surrogate consistently outperforms the widely used pseudo lead-field approximation while preserving negligible inference cost. Owing to its compact latent representation, the method does not require a fully detailed torso segmentation and can therefore be deployed in data-limited settings while preserving high-fidelity ECG simulations.
Figures & tables
Figure 1: Graphical representation of the developed pipeline. (1.) Mesh generation stage: we used torso and heart models from a statistical PCA atlas. To create joint models, we varied (A.) the first 10 principal components of the torso, (B.) the first 10 principal components of the heart, and (C.) heart rotation angles along anatomical axes: αx along the LV–RV axis, αy along the anterior-posterior axis, and αz along the LV long axis. As a result, a set of geometries was obtained and used to generate training and test point clouds (2.), while a set of features (10 torso modes + 10 heart modes + 3 angles) was used as feature vectors describing each dataset (highlighted with an orange frame). (2.) Train/test point-cloud generation. (D.) Point cloud around and inside the torso used to train/test the DeepSDF model. (E.) Point cloud inside the torso used to train/test the ∇Z prediction model. (3.) Variation of unipolar electrode location on the anterior surface of the torso. (4.) Schematic representation of DeepSDF model used for generation of DeepSDF based shape codes (highlighted with a blue frame). (5.) Schematic representation of lead field gradient ∇Z prediction model.
Figure 2: Computed lead field for a unipolar lead (left shoulder), visualized using streamlines representing the direction of ∇Z . (A.) Streamlines shown throughout the entire torso. (B.) Close-up view of the heart region (the heart is shown in yellow); streamlines passing through the free wall of the left ventricle (LV) are highlighted in bold red. (C.) Enlarged view of the LV free wall (represented as a cylinder) with the corresponding gradient streamlines highlighted in bold. Note the change in the slope of the streamlines at the heart–torso interface, reflecting the change in direction of ∇Z across the boundary.
Figure 3: Design of training samples for parametric models of the torso and heart. A Projection of a 10-dimensional parametric space onto a 3D cube, obtained by neglecting the last 7 dimensions. Black dots indicate the position of 100 sampling points selected using Latin hypercube sampling from a uniform distribution. B and C are cross-sections of the parametric space for the heart ( B ) and torso ( C ) showing the variations of the three principal components: PC1, PC2 in blue colours, PC1, PC3 in green colours.
Figure 4: Chamfer distances (in mm) for the four SDF surfaces-torso, LV endocardium, RV endocardium, and epicardium, computed 80/20 training/validation geometries (left panel) and 10 test geometries (right panel). The color scale indicates the Chamfer distance value (in mm), with lighter colors corresponding to larger errors. For clarity, both the SDF surfaces and the geometry sets are sorted by increasing error.
Figure 5: Streamline visualization of the lead-field gradient for a unipolar lead (left shoulder). (A) FEM-based lead-field gradient. (B) Predicted lead-field gradient. Smaller sub-panels show close-up views of the heart and the LV free wall. Streamlines intersecting the LV free wall are highlighted. The bend in the streamlines at the heart-torso interface (highlighted in yellow) reflects the change in conductivity across tissues.
Figure 6: Cumulative distribution functions (CDFs) of prediction errors for ∇Z over the test dataset. Left column: errors over the full torso domain. Right column: errors restricted to points inside the heart and within 10mm of the heart surface. Top row: angular error (degrees). Bottom row: relative magnitude error. Blue and orange curves correspond to DeepSDF-based and PCA-based models, respectively. Solid lines indicate the mean CDF across 10 test patients; shaded regions show the range (minimum–maximum). Dashed vertical lines mark the median and 95th percentile error values.
Figure 7: Average angular error (degrees) in predicting ∇Z using DeepSDF-based (top row) and PCA-based (bottom row) encodings. Left column: errors across 100 uniformly distributed unipolar electrodes. Right column: errors across the 9 independent electrodes of the standard 12-lead ECG. Electrodes and patients are sorted by increasing error for visualization clarity.
Figure 8: Spatial distribution of errors projected onto the torso surface and averaged over 10 test cases. (A) Mean angular error (degrees) between DeepSDF-based predicted and FEM-based ∇Z , computed over 100 electrodes. (B–C) Mean RMSE of unipolar ECG signals for LBBB (B) and sinus rhythm (C), computed using FEM-based and predicted ∇Z . Errors are interpolated onto the torso surface; blue indicates smaller error. Insets show representative ventricular activation maps used for ECG computation.
Geometry encoding
Angular error
Angular error (ECG leads)
ECG rel. ℓ2 error
PCA-based
5.22±±0.61\SIUnitSymbolDegree
5.93±±1.26\SIUnitSymbolDegree
0.024±±0.013
DeepSDF-based
3.89±±0.51\SIUnitSymbolDegree
4.64±±0.99\SIUnitSymbolDegree
0.018±±0.01
Table 1: Average angular error (degrees) between FEM-based and predicted lead-field gradients ∇Z for points within the heart, and corresponding ECG relative ℓ2 error. The third column reports angular error restricted to precordial ECG leads. Values are given as mean ± standard deviation across test geometries.
Figure 9: Forward ECG simulation for sinus rhythm (A) and LBBB (B) cases, computed using FEM-based (ground truth, blue), predicted ∇Z (green) and using the pseudo lead-field formulation ∇Z∗ .
MOX Laboratory, Department of Mathematics, Politecnico di Milano, Milano, Italy · Division 2.2 Process Simulation, Bundesanstalt für Materialforschung und -prüfung (BAM), Berlin, Germany · Department of Mathematics, University of Trento, Trento, Italy
Department of Computer Science and Technology, University of Cambridge · Independent Researcher · Department of Medical and Surgical Specialties, Radiological Sciences, and Public Health, University of Brescia