Skip to content

Commit 934612f

Browse files
committed
upd8 readme
1 parent 6b5ea12 commit 934612f

File tree

2 files changed

+34
-11
lines changed

2 files changed

+34
-11
lines changed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# UncerGuidedI2I
2-
Uncertainty Guided Progressive GANs for Medical Image Translation
2+
PyTorch imeplementation of Uncertainty Guided Progressive GANs for Medical Image Translation
33

4+
## Introduction
45
![](./UncerGuidedI2I_Model.gif)
56

67
This repository provides the code for the MICCAI-2021 paper "Uncertainty-guided Progressive GANs for Medical Image Translation".
@@ -20,22 +21,23 @@ root
2021
|-losses.py
2122
```
2223

23-
## How to use
24+
## Getting started
2425
### Requirements
2526
```
27+
python >= 3.6.10
2628
pytorch > 1.6.0
2729
torchio
2830
scikit-image
2931
scikit-learn
3032
```
3133

3234
### Preparing Datasets
33-
The experiments of the paper used T1 MRI scans from the IXI dataset and a propietary PET/CT dataset.
35+
The experiments of the paper used T1 MRI scans from the IXI dataset and a proprietary PET/CT dataset.
3436

3537
`data/IXI/` has jupyter notebooks to prepare the data for motion correction as well as undersampled MRI reconstruction.
3638
For custom datasets, use the above notebooks as example to prepare the dataset and place them under `data/`. The dataset class in `src/ds.py` loads the paired set of images (corrupted and the non-corrupted version).
3739

38-
### Training
40+
### Learning models with uncertainty
3941
`src/networks.py` provides the generator and discriminator architectures.
4042

4143
`src/utils.py` provides two training APIs `train_i2i_UNet3headGAN` and `train_i2i_Cas_UNet3headGAN`. The first API is to be used to train the primary GAN, whereas the second API is to be used to train the subsequent GANs.
@@ -51,16 +53,18 @@ netG_A, netD_A = train_i2i_UNet3headGAN(
5153
device='cuda',
5254
num_epochs=50,
5355
init_lr=1e-5,
54-
ckpt_path='../ckpt/i2i_UNet3headGAN',
56+
ckpt_path='../ckpt/i2i_0_UNet3headGAN',
5557
)
5658
```
59+
This will save checkpoints in `../ckpt/` named as `i2i_0_UNet3headGAN_eph*.pth`
5760

58-
An example command to use the first API is:
61+
An example command to use the second API (here we assumed the primary GAN and first subsequent GAN are trained already):
5962
```python
63+
# first load the prior GAN modules
6064
netG_A1 = CasUNet_3head(1,1)
61-
netG_A1.load_state_dict(torch.load('../ckpt/uncorr2CT_UNet3headGAN_v1_eph78_G_A.pth'))
65+
netG_A1.load_state_dict(torch.load('../ckpt/i2i_0_UNet3headGAN_eph49_G_A.pth'))
6266
netG_A2 = UNet_3head(4,1)
63-
netG_A2.load_state_dict(torch.load('../ckpt/uncorr2CT_Cas_UNet3headGAN_v1_eph149_G_A.pth'))
67+
netG_A2.load_state_dict(torch.load('../ckpt/i2i_1_UNet3headGAN_eph49_G_A.pth'))
6468
netG_A3 = UNet_3head(4,1)
6569

6670
netD_A = NLayerDiscriminator(1, n_layers=4)
@@ -71,7 +75,27 @@ list_netG_A, list_netD_A = train_uncorr2CT_Cas_UNet3headGAN(
7175
device='cuda',
7276
num_epochs=50,
7377
init_lr=1e-5,
74-
ckpt_path='../ckpt/uncorr2CT_Cas_UNet3headGAN_v1_block3',
75-
noise_sigma=0.0
78+
ckpt_path='../ckpt/i2i_2_UNet3headGAN',
7679
)
80+
```
81+
82+
### Citations
83+
If you find the bits from this project helpful, please cite the following works:
84+
```
85+
@inproceedings{upadhyay2021uncerguidedi2i,
86+
title={Uncertainty Guided Progressive GANs for Medical Image Translation},
87+
author={Upadhyay, Uddeshya and Chen, Yanbei and Hebb, Tobias and Gatidis, Sergios and Akata, Zeynep},
88+
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI)},
89+
year={2021},
90+
organization={Springer}
91+
}
92+
```
93+
and
94+
```
95+
@article{upadhyay2021uncertainty,
96+
title={Uncertainty-aware Generalized Adaptive CycleGAN},
97+
author={Upadhyay, Uddeshya and Chen, Yanbei and Akata, Zeynep},
98+
journal={arXiv preprint arXiv:2102.11747},
99+
year={2021}
100+
}
77101
```

src/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,5 +241,4 @@ def train_i2i_Cas_UNet3headGAN(
241241
# num_epochs=50,
242242
# init_lr=1e-5,
243243
# ckpt_path='../ckpt/uncorr2CT_Cas_UNet3headGAN_v1_block3',
244-
# noise_sigma=0.0
245244
# )

0 commit comments

Comments
 (0)