Home

Awesome

MaskGAN for Unpaired MR-to-CT Translation [MICCAI2023]

arXiv cite

πŸ“’ Updates!

πŸ† MaskGAN Framework

A novel unsupervised MR-to-CT synthesis method that:

Framework

Comparison with State-of-the-Art Methods on Paediatric MR-CT Synthesis

Result

The repository offers the official implementation of our paper in PyTorch. The next reflects some results of using MaskGAN in different benchmarks. Results are shown over original values on radiometric values for MRI and Hounsfield unit (HU) for CT scans. In addition, the best weights obtained during the training stage are shared to be used for inference or retraining.

Unpaired Pediatric brain MRI-CT images (Private dataset) <img src="imgs/pediatric_brain_sample.png" width="100">

MethodsTypeMRI→CTCT→MRI
MAE ↓PSNR ↑SSIM (%) ↑MAE ↓PSNR ↑SSIM (%) ↑
CycleGAN [Zhu2017,ICCV]2D80.8621.3375.07118.1515.0465.26
AttentionGAN [Tang2021,TNNLS]2D81.6721.2475.94115.3016.2267.13
QS-Attn-Seg [Liu2023,arxiv]3D63.5522.3281.42113.8216.7167.97
MaskGAN (w/o Shape)2D62.2822.5682.36112.8816.8368.34
MaskGAN (Ours)2D62.1322.8982.50112.7516.9568.44

Unpaired Adult brain MRI/CT images. Original dataset are paired (Link) <img src="imgs/adult_brain_sample.png" width="100">

MethodsTypeMRI→CTCT→MRI
MAE ↓PSNR ↑SSIM (%) ↑MAE ↓PSNR ↑SSIM (%) ↑
CycleGAN [Zhu2017,ICCV]2D52.1021.4384.1271.5719.6762.07
AttentionGAN [Tang2021,TNNLS]2D51.4121.4884.1572.2319.8863.75
QS-Attn-Seg [Liu2023,arxiv]3D46.7122.2986.0163.9820.0866.23
MaskGAN (w/o Shape)2D46.2622.3286.0563.6020.1267.68
MaskGAN (Ours)2D45.1122.4586.3162.9520.5367.87

πŸ› οΈ Installation

Option 1: Directly use our Docker image

docker pull stevephan46/maskgan:d20b79d4731210c9d287a370e37b423006fd1425
docker run --name maskgan --gpus all --shm-size=16g -it -v /path/to/data/root:/data stevephan46/maskgan:d20b79d4731210c9d287a370e37b423006fd1425

Option 2: Install environments locally

pip install -r requirements.txt

πŸ“š Dataset Preparation and Mask Generations

Refer to preprocess/README.md file.

πŸš€ Model Testing

python test.py --dataroot dataroot --name exp_name --gpu_ids 0 --model mask_gan --netG att 
--dataset_mode unaligned --no_dropout --load_size 150 --pad_size 225 --crop_size 224 --preprocess resize_pad_crop --no_flip
--batch_size 4

The results will be saved at ./results/exp_name. Use --results_dir {directory_path_to_save_result} to specify the results directory. There will be four folders fake_A, fake_B, real_A, real_B created in results.

πŸ’Ύ Use of pretrained weights

This zip file contains trained weights of MaskGAN run over MRI/CT pediatric brain dataset. To use them, unzip the contents in the folder pretrained_weights. You can use them as pretrained weights during your training step or using directly for testing with the defaults parameters. Just add the next parameter.

--use_pretrained_weights True

You can use other pretrained weights, which are shown in the first table of this page.

πŸ” Evaluate results

python evaluation.py --results_folder exp_name

Results for MRI-to-CT synthesis generation and CT-to-MRI are shown.

πŸš€ MaskGAN Training

python train.py --dataroot dataroot --name exp_name --gpu_ids 0 --display_id 0 --model mask_gan --netG att 
--dataset_mode unaligned --pool_size 50 --no_dropout
--norm instance --lambda_A 10 --lambda_B 10 --lambda_identity 0.5 --lambda_mask 1.0 --lambda_shape 0.5 --load_size 150 --pad_size 225 --crop_size 224 --preprocess resize_pad_crop --no_flip
--batch_size 4 --niter 40 --niter_decay 40 --display_freq 1000 --print_freq 1000 --n_attentions 5

πŸ“œ Citation

If you use this code for your research, please cite our papers.

@inproceedings{phan2023structure,
  title={Structure-preserving synthesis: {MaskGAN} for unpaired mr-ct translation},
  author={Phan, Vu Minh Hieu and Liao, Zhibin and Verjans, Johan W and To, Minh-Son},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={56--65},
  year={2023},
  organization={Springer}
}

πŸ™ Acknowledgments

This source code is inspired by CycleGAN and AttentionGAN.