This repository stores the code implemented to generate the results of the paper: DIGOM: Disentangled Interaction Graphs for Outcome prediction in Multimodal healthcare : arXiv:2610.32451.
- MIMIC-IV (tasks
30dr,mortality_48h,disch_alive_48h): the cohorts must be generated from the MIMIC-IV, MIMIC-CXR-JPG and MIMIC-IV-Note databases, as described in src/data/README.md. - NIH-TB (tasks
tuberculosis,tuberculosis_died): download the preprocessed dataset TB_data.pickle.zip and unzip it in csvs/datasets:
$ unzip TB_data.pickle.zip -d csvs/datasets/
First, install the requirements under Python 3.12 as following, then DGL (its CUDA builds are not on PyPI):
$ pip install -r requirements.txt
$ pip install dgl==2.5.0 -f https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html
All experiments are run from the root of the repository, with --task one of mortality_48h, disch_alive_48h, 30dr, tuberculosis or tuberculosis_died. Each model is evaluated with a nested 5-fold cross-validation, with 100 hyperparameter optimization trials per fold (--n_trials). The results (best hyperparameters, trained models, metrics and predictions of each fold, and a summary.json across folds) are saved in records/<model>_<task>, with <model> one of DIGOM, EarlyFusion, JointFusion, LateFusion, STGNN, SGNN, MMGL, MaxCorrMGNN and MaxCorrMGNN_topk.
Note: on 30dr, the graph-based models require about 48 GB of GPU memory.
$ python -m experiments.run_digom --task mortality_48h
$ python -m experiments.run_baselines --model early --task mortality_48h # Early Fusion
$ python -m experiments.run_baselines --model joint --task mortality_48h # Joint Fusion
$ python -m experiments.run_baselines --model late --task mortality_48h # Late Fusion
$ python -m experiments.run_stgnn --task mortality_48h # STGNN (MIMIC-IV tasks only)
$ python -m experiments.run_sgnn --task mortality_48h # SGNN
$ python -m experiments.run_mmgl --task mortality_48h # MMGL
$ python -m experiments.run_maxcorrmgnn --task mortality_48h # MaxCorrMGNN (top-k on MIMIC-IV)
$ python -m experiments.run_maxcorrmgnn --task tuberculosis --top_k # MaxCorrMGNN top-k on NIH-TB
To train DIGOM with a single interaction type, or without any interaction, use --ablation with intra_patient_cross_modal, cross_patient_same_modal, cross_patient_cross_modal or no_interaction:
$ python -m experiments.run_digom --task mortality_48h --ablation cross_patient_cross_modal
The results are saved in records/DIGOM_<task>_<ablation>.
The models trained above are evaluated, without retraining, after masking one modality in the test set. Pass the directory of the trained models with --best_hps_dir, add --load_model, and give the masked modality with --modality_miss:
$ python -m experiments.run_digom --task mortality_48h --best_hps_dir records/DIGOM_mortality_48h --load_model --modality_miss cxr
The same options apply to every model script. The modalities are:
30dr:demo,cxr,dx,rad,proc,lab,med,dischmortality_48h,disch_alive_48h:demo,cxr,rad,proc,lab,charttuberculosis,tuberculosis_died:demographic_feat,ct_feat,snp_feat,cont_feat,regimen_feat,clinical_feat
The results are saved in records/<model>_<task>_missing_<modality>.
├── csvs
│ ├── datasets <- Cohorts of each task (to be generated or downloaded, see Section 1)
│ └── utils <- Mappings and intermediate files used to generate the MIMIC-IV cohorts
├── experiments <- Scripts to replicate our experiments
├── hps <- Ranges of the hyperparameter values
├── src <- All project modules
│ ├── data <- Generation of the MIMIC-IV cohorts (see src/data/README.md) and datasets
│ ├── managers
│ │ ├── evaluation.py <- Nested cross-validation of a model
│ │ └── tuning.py <- Hyperparameter optimization
│ ├── models
│ │ ├── digom.py <- DIGOM
│ │ ├── baselines.py <- Early, Joint and Late Fusion
│ │ ├── stgnn.py <- STGNN
│ │ ├── sgnn.py <- SGNN
│ │ ├── mmgl.py <- MMGL
│ │ └── maxcorrmgnn.py <- MaxCorrMGNN
│ ├── trainers <- Training loops of the models
│ └── utils <- Helper functions
├── LICENSE
├── README.md
└── requirements.txt