Skip to content
Keras implementation of the paper "3D MRI brain tumor segmentation using autoencoder regularization" by Myronenko A. (https://arxiv.org/abs/1810.11654).
Jupyter Notebook Python
Branch: master
Clone or download
Latest commit 4a23289 Oct 10, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Apr 7, 2019
Example_on_BRATS2018.ipynb Added example notebook Jul 8, 2019
LICENSE Create LICENSE Sep 12, 2019
README.md Update README.md Oct 10, 2019
group_norm.py Fixed a bug in the VAE branch May 25, 2019
model.py Removed accuracy and added the dice coefficient as the new metric Jul 19, 2019

README.md

3D MRI Brain Tumor Segmentation Using Autoencoder Regularization

PWC Keras

The model architecture

The Model Architecture
Source: https://arxiv.org/pdf/1810.11654.pdf

Keras implementation of the paper 3D MRI brain tumor segmentation using autoencoder regularization by Myronenko A. (https://arxiv.org/abs/1810.11654). The author (team name: NVDLMED) ranked #1 on the BraTS 2018 leaderboard using the model described in the paper.

This repository contains the model complete with the loss function, all implemented end-to-end in Keras. The usage is described in the next section.

Usage

  1. Download the file model.py and keep in the same folder as your project notebook/script.

  2. In your python script, import build_model function from model.py.

    from model import build_model

    It will automatically download an additional script needed for the implementation, namely group_norm.py, which contains keras implementation for the group normalization layer.

  3. Note that the input MRI scans you are going to feed need to have 4 dimensions, with channels-first format. i.e., the shape should look like (c, H, W, D), where:

  • c, the no.of channels are divisible by 4.
  • H, W, D, which are height, width and depth, respectively, are all divisible by 24, i.e., 16. This is to get correct output shape according to the model.
  1. Now to create the model, simply run:

    model = build_model(input_shape, output_channels)

    where, input_shape is a 4-tuple (channels, Height, Width, Depth) and output_channels is the no. of channels in the output of the model. The output of the model will be the segmentation map generated by the model with the shape (output_channels, Height, Width, Depth), where Height, Width and Depth will be same as that of the input.

Example on BraTS2018 dataset

Go through the Example_on_BRATS2018 notebook to see an example where this model is used on the BraTS2018 dataset.

You can also test-run the example on Google Colaboratory by clicking the following button.

Open In Colab

However, note that you will need to have access to the BraTS2018 dataset before running the example on Google Colaboratory. If you already have access to the dataset, You can simply upload the dataset to Google Drive and input the dataset path in the example notebook.

Issues

If you encounter any issue or have a feedback, please don't hesitate to raise an issue.

Updates

  • Added an example notebook showing how to run the model on the BraTS2018 dataset.
  • Added a minus term before loss_dice in the loss function. From discussion in #7 with @woodywff and @doc78.
  • Thanks to @doc78 , the NaN loss problem has been permanently fixed.
  • The NaN loss problem has now been fixed (clipping the activations for now).
  • Added an argument in the build_model function to allow for different no. of channels in the output.
You can’t perform that action at this time.