LiaoShiqi97 / DSCM_fundus

1 stars 0 forks source link

This is Shiqi Liao's master thesis project:

Counterfactual inference on retina fundus images using deep structural causal models


Structure

This repository contains code and assets structured as follows:

Requirements

We use Python 3.7.2 for all experiments and you will need to install the following packages:

pip install numpy pandas pyro-ppl pytorch-lightning scikit-image scikit-learn scipy seaborn tensorboard torch torchvision

or simply run pip install -r requirements.txt. You will also need to sync the submodule: git submodule update --recursive --init.

Usage

We assume that the code is executed from the root directory of this repository.

you can then train the models as:

python -m deepscm.experiments.medical.trainer -e SVIExperiment -m ConditionalVISEM --default_root_dir /path/to/checkpoints --downsample 3 --decoder_type fixed_var --train_batch_size 256 {--gpus 0}

The checkpoints are saved in /path/to/checkpoints or the provided checkpoints can be used for testing and plotting:

python -m deepscm.experiments.medical.tester -c /path/to/checkpoint/version_?

Conclusion

We make counterfactual inference on three different preprocessed fundus images.

My Image


This Repository is following the DSCM strategy in paper Deep Structural Causal Models for Tractable Counterfactual Inference(https://arxiv.org/abs/2006.06485)