Git Product home page Git Product logo

cardioem-4ch's Introduction

Whole-heart electromechanical simulations using Latent Neural Ordinary Differential Equations

This repository contains the code accompanying the paper [1]. We employ Latent Neural Ordinary Differential Equations (LNODEs) to learn the atrial and ventricular pressure-volume temporal dynamics of 400 four-chamber heart electromechanical simulations while spanning 43 physics-based model parameters that describe cell, tissue, whole-heart and cardiovascular system material properties and boundary conditions. We employ the surrogate model based on LNODEs to perform a global sensitivity analysis and robust parameter estimation with inverse uncertainty quantification for different test cases ('TLV', 'Tatria', 'Tventricles', 'Tall').

Installation

  1. Install a conda environment containing all the required packages:
conda create -n envcardioEM-4CH python=3.8 numpy=1.21.5 matplotlib=3.5.1 pandas=1.3.4 scipy=1.7.3 mpi4py=3.1
conda activate envcardioEM-4CH
conda install tensorflow
conda install -c anaconda scikit-learn
pip install SALib
pip install --upgrade "jax[cpu]"
pip install numpyro
pip install diffrax
  1. Clone this repository by typing:
git clone https://github.com/MatteoSalvador/cardioEM-4CH.git
  1. Remember to activate the conda environment envcardioEM-4CH by typing conda activate envcardioEM-4CH (in case it is not already active from the installation procedure at point 1).

  2. Unzip dataset.zip, which contains a tensor with all the 3D-0D numerical simulations (simulations.pkl), and a table with all the physics-based model parameters (parameters.npy).

  3. LNODEs training: execute the Python script train.py with proper settings, such as the total number of Adam (num_iters_ADAM) and BFGS (num_iters_BFGS) epochs, neurons, layers and states.

  4. Global sensitivity analysis: execute 4 different Python scripts sequentially (SA_salib_1_params.py, SA_salib_2_execution.py, SA_salib_3_analysis.py, SA_salib_4_postprocessing.py) with proper settings, such as the number of samples (nsamples), input (inputfile) and output (outputfile) files, required during the different stages.

  5. Parameter estimation with uncertainty quantification: execute the Python script run_PE_ANN.py with a certain test case ('TLV', 'Tatria', 'Tventricles', 'Tall') and proper settings, such as the folder containing the trained LNODEs (ANN_folder) and the number of trials (n_trials).

Authors

References

[1] M. Salvador, M. Strocchi, F. Regazzoni, C. Augustin, L. Dede', S. A. Niederer, A. Quarteroni. Whole-heart electromechanical simulations using Latent Neural Ordinary Differential Equations. npj Digital Medicine (2024).

[2] M. Salvador, F. Regazzoni, L. Dede', A. Quarteroni. Fast and robust parameter estimation with uncertainty quantification for the cardiac function. Computer Methods and Programs in Biomedicine (2023).

[3] F. Regazzoni, M. Salvador, L. Dede', A. Quarteroni. A Machine Learning method for real-time numerical simulations of cardiac electromechanics. Computer Methods in Applied Mechanics and Engineering (2022).

cardioem-4ch's People

Contributors

matteosalvador avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.