Coder Social home page Coder Social logo

matthiaszeller / vad-0d-dnn Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 41.13 MB

Code for paper "Deep Neural Network to Accurately Predict Left Ventricular Systolic Function Under Mechanical Assistance", Bonnemain et al.

Python 29.07% MATLAB 7.18% Modelica 63.75%
cardiovascular-disease modeling lvad signal-processing deep-learning simulation

vad-0d-dnn's Introduction

VAD-0D-DNN

About

This repository contains the code for the paper Deep Neural Network to Accurately Predict Left Ventricular Systolic Function Under Mechanical Assistance, Jean Bonnemain, Matthias Zeller, Luca Pegolotti, Simone Deparis, Lucas Liaudet.

Requirements

Project Overview

The project is subdivided in the following sections:

  • 0D Model Implementation in modelica/original/Mathcard.mo: 0D Model of the cardiovascular system implemented in the Modelica language.

  • 0D Model Simulation in Simulation_script: Python code running the simulations with OMPython package

    • Generate a dataset by solving the model with different parameter values
    • Perform a sensitivity analysis: fix 3 heart-failure parameters and vary the 4th one
    • Case study: simulate a few scenarios by varying heart failure severity, pump speed
  • Preprocessing in Pre-processing: Python code

    • Extract systemic arterial pressure and pulmonary arterial pressure from simulation data
    • Compute Fourier coefficients
    • Generate DNN input and output files
  • DNN Training and Testing in Deep_learning: Python code

    • Build and format dataset for the DNN
  • Post-processing: Post-processing, Matlab code

    • Compute hemodynamic quantities on the test set
  • Project pipelining: pipelining Python code gluing data generation, preprocessing, DNN training

    • script_pipeline.py: Automatic way to generate datasets with different pump configurations, merge them, train different DNNs on the merged dataset
    • script_check_sim_data.py: if an error occured while generating simulation data with script_pipeline.py, this script helps you to identify the corrupted parts and prevents from recomputing everyting
    • script_test_dnn.py : once the best DNN is chosen, use this script to run simulations on test data with this chosen DNN

Reproductibility

The procedure described below was tested on Ubuntu 20.04. The settings as set in script_pipeline.py generated about 2.1 TB of data and the whole procedure took about 20h to complete.

Overview

  1. Set the range of LVAD rotational speeds, the simulation settings (e.g. sampling), the number of Fourier coefficients to retain, the DNN architectures (and many other parameters) in pipeline/script_pipeline.py

  2. Set sampling settings in Pre-processing/setup_preprocessing.py

  3. Run the script pipeline/script_pipeline.py, which

    1. Generates simulation data for each specified pump configuration
    2. Merges data of all configurations in a single .mat file and creates training and test sets
    3. Trains the specified DNNs

    Note 1: this script might take several hours (or even days) to run

    Note 2: the output folder will have the following contents:

    .
    ├── 4000_LVAD_AP
    │   ├── outputs
    │   │   ├── Ursino1998Model_VAD2_output_0.mat
    │   │   ├── Ursino1998Model_VAD2_output_1.mat
    │   │   ├── ...
    │   ├── parameters.txt
    │   ├── X.mat
    │   ├── Y.mat
    │   └── ...
    ├── ...
    ├── 6000_LVAD_AP
    │   ├── ...
    ├── dataset.mat
    ├── dnns
    │   ├── dnn_10_layers_128_neurons
    │   │   ├── DNN_Performance.eps
    │   │   ├── history.bin
    │   │   ├── losses.eps
    │   │   ├── model.h5
    │   │   ├── Ytestpred.txt
    │   │   └── Ytest.txt
    │   ├── dnn_10_layers_16_neurons
    │   │   ├── ...
    │   ├── ...
    │   └── normdata.mat
    ├── logs.log
    └── mainlog.log
    
  4. Once you identified a DNN architecture that performs well, run pipeline/script_test_dnn.py to generate simulations on test data

  5. Compute hemodynamic quantities on test data:

    1. Setup paths in Post-processing/setupproj.m to target the outputs/ folder of the selected DNN architecture
    2. Run test_dnnmodelevaluation.m

vad-0d-dnn's People

Contributors

matthiaszeller avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

whucsu

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.