Skip to content

IDSIA/causal-ai-clinician

Repository files navigation

The Causal Artificial Intelligence Clinician for Early Hemodynamic Management of Septic Shock in ICU.

Managing septic shock in the intensive care unit (ICU) requires prompt and precise hemodynamic resuscitation, yet patient heterogeneity complicates the establishment of standardized protocols. This study introduces a Causal Artificial Intelligence Clinician designed to optimize intravenous fluid and vasopressor dosing during the critical first six hours of treatment. By integrating expert clinical knowledge into Structural Causal Models (SCMs), we estimate the Conditional Average Treatment Effects (CATE) from observational data, with models trained on 1,702 ICU admissions from the MIMIC database and externally validated on 1,434 ICU admissions from the eICU database. Results show that patients whose treatments deviates from our causal model’s recommendations experienced significantly lower survival rates and clinical improvements. The results further demonstrate that the causal model achieves predictive performance comparable to that of complex machine learning baselines, while relying on a significantly reduced set of variables and maintaining superior stability across diverse patient cohorts. These findings suggest that Causal AI offers a transparent, auditable, and robust framework for personalized clinical decision support in complex medical environments.

abstract

Simulate Interventions

You can access and interact with the causal model at this link.
Access requires a gmail account.

Loading can take up to 1 minutes depending on traffic. For most use cases, just input the desired charachteristics for the baseline population in the "Clinical Inputs" pane then click "Simulate". The causal model will generate heatmaps dispalying the distribution of the treatment effect for different doses of intravenous fluid and norepinephrine equivalent.

dashboard

For advanced use cases feel free to conctact us at: giovanni.angelotti@idsia.ch

Reproducibility

Requirements

  1. Access to MIMIC-IV. Learn more here.
  2. Access to eICU. Learn more here.
  3. A Google Cloud Project ID with the necessary IAM permissions to run queries on Big Query.
  4. A working Docker installation.
  5. A working installation of the Google SDK.
  6. Some additional MIMIC and eICU concepts. Learn more here.

Important Note: The Google account used for MIMIC-IV and eICU credentialing must be the same as the one associated to the Google Cloud Project ID.

Preliminaries

  1. Save this repo on your machine.
  2. Ensure your environment is authenticated to the Google Cloud.
    Without specific requirements, the simplest authenitcation method is to set up the ADC:
    gcloud auth application-default login
    Most of the times, you will need to run the above only once, the first time you use this library.
  3. Rename .env.template to .env then fill it with requested info:
    MODEL_DIR=path/to/where/to/save/trained/models
    REPORT_DIR=path/to/where/to/save/manuscript/files
    GOOGLE_CLOUD_PROJECT=your_gcp_project_id
    GOOGLE_APPLICATION_CREDENTIALS_DIR=path/to/.config/gcloud`
    MODEL_DIR will be the target directory where trained models will be stored and read from. REPORT_DIR will be the target directory where to save tables, figures and notes. In GOOGLE_CLOUD_PROJECT set the name the google cloud project you desire. Finally GOOGLE_APPLICATION_CREDENTIALS_DIR is the directory where you authenticated credentials live, if you have authenitcated with the ADC, this is usually $HOME/.config/gcloud on linux or %APPDATA%\gcloud\ on windows.

Usage

  1. To generate the trained models run:
    docker compose up train
    This can take several hours, even a days, on a user machine, when possible, consider to deploing this step either on the cloud or on a computing clusters.
    Once finished, MODEL_DIR will be populated with several .db files, each represent a different sensitivy analysis. More details about the criteria for each sensitivity analysis can be found in the experiments.yaml file.
    In the manuscript, the results shown are from the slim_argmin_base_abt_icu.db configuration.
  2. To generate figure, tables and notes we used in our manuscript run:
    docker compose up report
    All files will be saved in REPORT_DIR indicated in the .env file.
  3. To interactively navigate the results and the counterfactual simulations of our trained causal models, you can deploy our navigation dahsboard by running:
    docker compose up dashboard
    After running the previous, the dashboard can be accessed at http://localhost:8080/ form any local browser. The Dashboard startup can take several minutes, up to 10 depending on the underlying machines. These times are required to load models.
    Please note that in order to complete step 2 and 3, models from step 1 must be trained first.

If you cannot train models locally (step 1), we can provide you with already trained ones given proof of authorization to access the MIMIC-IV and eICU.
Contact us at: giovanni.angelotti@idsia.ch

About

Causal Inference for Critical Decision Making

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages