Code Monkey home page Code Monkey logo

brats-e1d3's Introduction

E1D3 U-Net for Brain Tumor Segmentation

This repository contains official source code for the method proposed in: E1D3 U-Net for Brain Tumor Segmentation: Submission to the RSNA-ASNR-MICCAI BraTS 2021 Challenge.

Data Preparation:

Download the BraTS dataset. The structure of the dataset should be as follows (using nomenclature from BraTS 2021 dataset for the sake of demonstration, however this works for other BraTS dataset as well):

dataset/
    - BraTS2021_AAAAA/
        BraTS2021_AAAAA_flair.nii.gz
        BraTS2021_AAAAA_t1.nii.gz
        BraTS2021_AAAAA_t1ce.nii.gz
        BraTS2021_AAAAA_t2.nii.gz
        BraTS2021_AAAAA_seg.nii.gz
    - BraTS2021_AAAAB/
        BraTS2021_AAAAB_flair.nii.gz
        BraTS2021_AAAAB_t1.nii.gz
        BraTS2021_AAAAB_t1ce.nii.gz
        BraTS2021_AAAAB_t2.nii.gz
        BraTS2021_AAAAB_seg.nii.gz
    ...

Preprocess the dataset as follows:

python data_preprocess.py --data_dir "path_to_dataset"

[For training datasets only]: Crop and save data as .npy files via:

python data_crop_npy.py --src_folder "path_to_src_folder" --dst_folder "path_to_dst_folder"

Perform train/val split on the training dataset as needed. Place the newly generated splits in different folders, as the network's training session differentiates between training and validation splits according to where it is placed (defined in config.yaml file).

Neural Network Training/Testing

Training/Testing sessions can be executed in two ways: anaconda and docker. Training/Testing sessions are guided by the configuration defined in the config.yaml file.

1. Anaconda

If you have Anaconda set-up on your system, install PyTorch (tested with 1.8.1, CUDA 11.1). Install the rest of the dependencies with:

pip install -r requirements.txt

Move to the e1d3 folder to execute the following commands.

Training:

python train.py --config config.yaml --gpu 0

Testing:

python test.py --config config.yaml --gpu 0

2. Docker

If you have Docker set-up with GPU support, build a docker image as follows:

docker build -t brats_e1d3 .

To execute the container for training/testing, provide paths in absolute format.

Training:

docker run -it --rm --gpus all -v "train_data_path":"train_data_path" -v "val_data_path":"val_data_path" -v "model_save_path":"model_save_path" -v "config_path":"config_path" brats_e1d3 --train --config "config_path/config.yaml" --gpu 0

Testing:

docker run -it --rm --gpus all -v "test_data_path":"test_data_path" -v "model_save_path":"model_save_path" -v "config_path":"config_path" brats_e1d3 --test --config "config_path/config.yaml" --gpu 0

[Note]: The paths set internally in the docker container should match those provided in config.yaml, as those will only be visible to the training/testing session.

Citation

If you found any part of this work useful, please cite as follows:

@misc{bukhari2021e1d3,
    title={E1D3 U-Net for Brain Tumor Segmentation: Submission to the RSNA-ASNR-MICCAI BraTS 2021 Challenge},
    author={Syed Talha Bukhari and Hassan Mohy-ud-Din},
    year={2021},
    eprint={2110.02519},
    archivePrefix={arXiv},
    primaryClass={eess.IV},
    url={https://arxiv.org/abs/2110.02519},
}

brats-e1d3's People

Contributors

stalhabukhari avatar

Stargazers

Roman avatar Davyd Cardoso avatar Md. Shakil Hossain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.