This repository contains the official implementation of MultiNSDEs. Full details of the approach can be found in the paper published in the Journal of Biomedical Informatics.
To download everything from this repository onto your local directory, execute the following line on your terminal:
$ git https://github.com/SCAI-BIO/MultiNSDE.git MultiNSDEs
$ cd MultiNSDEs
First you need to set an environment. The model has been tested using the "SDGAD" environment. Please create it using
$ conda env create -f environment.yml
$ conda activate SDGAD
The datasets used in the paper are not included in this repository and must be obtained independently from their respective data providers through the following portals or data request forms:
Access to these datasets is subject to the respective data providers' access requirements and data use agreements.
Once access has been obtained, please preprocess the selected dataset as described in the supplementary material of the paper. It is recommended to organize the preprocessed data into three separate sets:
-
Prognosis model data
Data used for training and evaluating the prognosis models. -
Causal ML model data
This dataset is essentially the same as in (1), but restricted to patients with non-missing baseline values. -
Propensity score and observation model data
Data used to train the models required for estimating treatment assignment and observation probabilities.
This folder contains the code to run MultiNSDEs for both prognosis and causal infrence. For a deeper look into the MultiNSDE implementation, navigate to the Networks folder.
This folder contains code to run MultiNSDEs for prognosis tasks, including prediction, reconstruction, and counterfactual simulations allowing digital twins generation.
This folder contains code to run MultiNSDEs as outcome models for causal inference.
The MultiNODEs folder contains an adapted version of the official code modified to work with the datasets and scenarios described in the paper.
We provide example scripts for running MultiNSDEs on each dataset, both for prognosis and causal inference. The scripts and their corresponding configuration files are located in the bash_script/MultiNSDEs/dataset folders.
For the prognosis approach, two training configurations are provided:
train1.sh: trains and validates the model using the standard configuration defined inconfig1.sh.train2.sh: trains and validates the model in extrapolation mode.
Alternatively, extrapolation mode can be enabled by setting the extrapolation parameter to 1 in config1.sh and running train1.sh.
For details on the model parameters and training settings, please refer to the corresponding config.sh files.
If you use MultiNSDEs or any part of this repository in your research, please cite our paper:
@article{valderrama2026multinsde,
title = {{MultiNSDE}: treatment-aware neural {SDEs} for generative modeling of real and counterfactual patient trajectories},
author = {Valderrama, Diego and Fourtoy, Achille and Mähler, India and Gerken, Annika and Stodtmann, Sven and Fröhlich, Holger},
journal = {Journal of Biomedical Informatics},
pages = {105130},
year = {2026},
doi = {10.1016/j.jbi.2026.105130}
}- Prof. Dr. Holger Fröhlich
- Diego Valderrama
- Department of Biomedical AI & Data Science, Fraunhofer Institute for Algorithms and Scientific Computing (SCAI), Schloss Birlinghoven, 1, 53757 Sankt Augustin.