Deepmedic and 3D U-Net for brain tumor segmentation
We created two popular deep learning models DeepMedic and 3D U-Net in PyTorch for the purpose of brain tumor segmentation.
For more details about our methodology, please refer to our paper
The performance of our proposed ensemble on BraTS 2018 dataset is shown in the following table:
Dataset | Dice(ET) | Dice(WT) | Dice(TC) | Hausdorff95(ET) | Hausdorff95(WT) | Hausdorff95(TC) |
---|---|---|---|---|---|---|
Training | 0.735 | 0.902 | 0.813 | 5.433 | 5.398 | 6.932 |
Validation | 0.788 | 0.905 | 0.813 | 3.811 | 4.323 | 7.553 |
Testing | 0.749 | 0.875 | 0.793 | 4.219 | 6.479 | 6.522 |
For the training set, we use 5-folds cross validation. ET:Enhancing tumor, WT: whole tumor, TC: tumor core.
The system was employed for our research presented in [1,2], where the we integrate multiple DeepMedics and 3D U-Nets in order to get a robust tumor segmentation mask. We also utilize the brain parcellation masks for the purpose of bringing the location information to DeepMedic and 3D U-Net. If the use of the software or the idea of the paper positively influences your endeavours, please cite [1,2].
[1] Po-Yu Kao, Thuyen Ngo, Angela Zhang, Jefferson Chen, and B. S. Manjunath, "Brain Tumor Segmentation and Tractographic Feature Extraction from Structural MR Images for Overall Survival Prediction." International MICCAI Brainlesion Workshop. Springer, Cham, 2018.
[2] Po-Yu Kao, Shailja Shailja, Jiaxiang Jiang, Angela Zhang, Amil Khan, Jefferson W. Chen, and B. S. Manjunath, "Improving Patch-Based Convolutional Neural Networks for MRI Brain Tumor Segmentation by Leveraging Location Information" Front. Neurosci. 13:1449. doi: 10.3389/fnins.2019.01449
Python3.6
Pytorch0.4.0
pip install git+https://github.com/pykao/pytorch-v0.4.0@pytorch_0.4.0_poyu
Install custom pytorch kernels from https://github.com/thuyen/multicrop
pip install git+https://github.com/thuyen/multicrop.git
nibabel, nipype, natsort, SimpleITK
pip install nibabel,nipype,natsort,SimpleITK
FSL (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation)
The Harvard-Oxford subcortical atlases in subject space are stored at BrainParcellation/HarvardOxford-sub
python createBrainParcellation.py -i /DIR_TO_MR_T1.nii.gz -o /DIR_TO_SAVE_THE_BRAIN_PARCELLATION -n SUBJECT_NAME
The output brain parcellation will be named as SUBJECT_NAME_HarvardOxford-sub.nii.gz
For using the brain parcellation on DeepMedic and 3D U-Net, please change the paths in data/parcellation.py
accordingly
experiments/settings.yaml
to point to data directories. These are general settings, applied to all experiments. Additional experiment-specific configuration will overwrite these.
python split.py
python prep.py
For using the brain parcellation for DeepMedic and 3D U-Net, please change the paths in data/parcellation.py
accordingly
python data/parcellation.py
python train.py --gpu 0 --cfg deepmedic_ce
python train_12.py --gpu 0 --cfg deepmedic_ce_28x20x12
python train_6.py --gpu 0 --cfg deepmedic_ce_22X18X6
python train_unet.py --gpu 0 --cfg unet_dice2
To make predictions, run predict.py
, predict_6.py
, predict_12.py
or predict_unet.py
with similar arguments
To make submissions, look at make_submission.py
If you do not have enough memory to save the output probability maps, you are able to compress these maps to uint16 format by compress_data.py
To make submissions with compressed probability maps, please refer to ensemble_methods.py
Special thanks to Thuyen Ngo.