Hybrid modeling of the human cardiovascular system using NeuralFMUs

Tobias Thummerer, Johannes Tintenherr, Lars Mikelsons · DOI

Abstract

Hybrid modeling, the combination of first principle and machine learning models, is an emerging research field that gathers more and more attention. Even if hybrid models produce formidable results for academic examples, there are still different technical challenges that hinder the use of hybrid modeling in real-world applications. By presenting NeuralFMUs, the fusion of a FMU, a numerical ODE solver and an ANN, we are paving the way for the use of a variety of first principle models from different modeling tools as parts of hybrid models. This contribution handles the hybrid modeling of a complex, real-world example: Starting with a simplified 1D-fluid model of the human cardiovascular system (arterial side), the aim is to learn neglected physical effects like arterial elasticity from data. We will show that the hybrid modeling process is more comfortable, needs less system knowledge and is therefore less error-prone compared to modeling solely based on first principle. Further, the resulting hybrid model has improved in computation performance, compared to a pure first principle white-box model, while still fulfilling the requirements regarding accuracy of the considered hemodynamic quantities. The use of the presented techniques is explained in a general manner and the considered use-case can serve as example for other modeling and simulation applications in and beyond the medical domain.

The Challenge of Cardiovascular Modeling

Modeling the human cardiovascular system presents a classic "Goldilocks" problem in computational medicine. High-fidelity 1D-fluid models are accurate but computationally expensive, making them impractical for real-time applications like wearable technology or bedside monitoring. Conversely, simplified white-box models—such as static pipe models—are computationally efficient but often omit crucial dynamic effects like arterial wall elasticity.

Discrepancy between simplified physical models and high-fidelity reference data in the thoracic aorta and digital arteries.

As shown in the figure above, these simplifications lead to significant errors in pressure wave predictions, particularly in peak pressure values. While pure machine learning (black-box) approaches could theoretically bridge this gap, they require vast amounts of data and often fail to respect fundamental physical laws. This research introduces a hybrid approach: keeping the robust foundation of physics while using Artificial Neural Networks (ANNs) to "fill in the blanks" of missing dynamics.

Methods: The NeuralFMU Framework

The core innovation of this work is the NeuralFMU, an evolution of the Neural ODE concept. While a standard Neural ODE uses an ANN to define a system's derivative, a NeuralFMU integrates a Functional Mock-up Unit (FMU)—a standardized, portable version of a physical model—directly into the neural network loop.

The NeuralFMU architecture, integrating state and derivative ANNs with a physical FMU backbone and a numerical ODE solver.

The Workflow

  1. Physical Backbone: The researchers began with a simplified Modelica model of the arterial system consisting of 116 static pipes, intentionally ignoring elasticity to maintain low computational overhead.
  2. Structural Placeholders: Small physical placeholders (C-capacitors or LC-circuits) were added to the Modelica model at 10 key arterial segments to provide the neural network with a mathematical "hook" to inject learned dynamics.
  3. Hybrid Loop: The model was exported as an FMU and integrated into the Julia programming environment using FMI.jl and FMIFlux.jl.
  4. Training: An ANN was trained to manipulate the state derivatives of the FMU. This allowed the network to learn the specific "pressure drop" and "elastic response" that the simplified physical model lacked.

Datasets and Training

The study utilized the Pulse Wave Database (PWDB), containing simulated data for 4,374 virtual healthy subjects. The model was trained on data from a single subject across 10 arterial segments (e.g., Thoracic Aorta, Brachial Artery) and subsequently tested on a second, "unknown" patient to evaluate its ability to generalize physical principles rather than simply memorizing data.

Key Results and Insights

  • Massive Speedup: The high-fidelity reference model required approximately 75.6 seconds per pulse wave. In contrast, the NeuralFMU completed the same simulation in just ~0.02 seconds, representing a speedup factor of roughly 3,750x.
  • Enhanced Accuracy: The hybrid model significantly outperformed the simplified Modelica baseline. By utilizing LC-circuit placeholders, the ANN successfully learned the phase-shifting in pulse waves, allowing the hybrid model to closely track the reference wave shapes.
  • Structural Integration: Unlike simple residual learning (where a network predicts the error of a physical model), the NeuralFMU places the network inside the ODE solver. This ensures the model maintains physical consistency over time.
  • Generalization: The model maintained its accuracy when tested on a patient with a different heart rate, suggesting it successfully captured generalized hemodynamic principles.

Conclusion

NeuralFMUs demonstrate that hybrid modeling can offer the "best of both worlds": the speed of simplified models and the accuracy of high-fidelity simulations. For medical applications where milliseconds matter—such as real-time monitoring in wearables—this 3,750x speedup provides a viable path toward personalized, physics-informed digital twins. Future work will focus on improving the stability of these hybrid loops and expanding the training set to encompass a broader range of physiological diversity.

Summary updated

BibTeX
@article{thummerer2021hybrid,
  author = {Tobias Thummerer and Johannes Tintenherr and Lars Mikelsons},
  title = {{Hybrid modeling of the human cardiovascular system using NeuralFMUs}},
  journal = {Journal of Physics Conference Series},
  year = {2021},
  doi = {10.1088/1742-6596/2090/1/012155},
}
Figure