Brain Tumor Segmentation using Deep Learning models

Saksham Checker
5 min readDec 24, 2021

--

A deep learning approach to segment tumors using MRI of brain.

Source Cleveland clinic

Abstract — Accurate automatic algorithms for the segmentation of brain tumors have the potential of improving disease diagnosis, treatment planning, as well as enabling large-scale studies of the pathology. This article presents the implementation of two Deep Learning models which are used for segmentation of brain tumor using the images available in a dataset on Kaggle.

Introduction

In the United States alone, it is estimated that 23,000 new cases of brain cancer will be diagnosed in 2015.1 While gliomas are the most common brain tumors, they can be less aggressive (i.e. low grade) in a patient with a life expectancy of several years, or more aggressive (i.e. high grade) in a patient with a life expectancy of at most 2 years.

Although surgery is the most common treatment for brain tumors, radiation and chemotherapy may be used to slow the growth of tumors that cannot be physically removed. Magnetic resonance imaging (MRI) provides detailed images of the brain, and is one of the most common tests used to diagnose brain tumors. All the more, brain tumor segmentation from MR images can have great impact for improved diagnostics, growth rate prediction and treatment planning.

The ultimate goal of brain tumor imaging analysis is to extract the patient-specific important clinical information, and their diagnostic features. This information embedded within the multidimensional image data, can guide and monitor interventions after the disease has been detected and localized, ultimately leading to knowledge for clinical diagnosis, staging, and treatment of disease.

Understanding the Dataset

The dataset referred in this article is taken from kaggle, “Brain MRI segmentation”.

It was originally collected from 110 patients at The Cancer Imaging archive. The dataset contains 110 folders, each for a patient. Every folder contains the Magnetic resonance image and its mask. In total there are 3929 images and mask pair making an average of 35.71 MR images of each patient. To increase the number of images, data augmentation was done with the following parameters — rotation_range=0.2, width_shift_range=0.05, height_shift_range=0.05, shear_range=0.05, zoom_range=0.05, horizontal_flip=True, fill_mode=’nearest’.

To test the models, the complete dataset was split into two parts — train and test with a ratio of 70 to 30.

Deep Learning Models

Two deep learning models are implemented on the dataset to segment the tumor.

UNet

The UNET was developed by Olaf Ronneberger et al. for Bio Medical Image Segmentation. The architecture contains two paths, the contraction path which is also known as the encoder which captures the context in the image. The encoder is just a traditional stack of convolutional and max pooling layers. Followed by the encoder path, there is decoder path or symmetric expanding path which is used to enable precise localization using transposed convolutions. Thus it is an end-to-end fully convolutional network (FCN), i.e. it only contains Convolutional layers and does not contain any Dense layer because of which it can accept image of any size.

Training

To train the UNet model for segmentation, 256x256x3 image is fed into the model as input. The training is done on 35 epochs with batch size as 32.

Linknet

LinkNet is a light deep neural network architecture designed for performing semantic segmentation, which can be used for tasks such as self-driving vehicles, augmented reality, etc.

Linknet architecture tries to efficiently share the information learnt by the encoder with the decoder after each downsampling block. This proves to be better than using pooling indices in decoder or just using fully convolutional networks in decoder. Not only this feature forwarding technique gives us good accuracy values, but also enables us to have few parameters in our decoder.

Linknet Architecture

Encoder and Decoder— In encoder and decoder block shown , input and output feature maps for each layer can be calculated using: n = 64x2^i, where i the block index. The first encoder block does not perform strided convolution and every convolution layer is followed by batch-normalization and ReLU as non-linearity. The encoder architecture is the same as that of ResNet-18

Encoder Decoder blocks

Training

To train the Linknet model for segmentation, 256x256x3 image is fed into the model as input. The training is done on 35 epochs with batch size as 32.

Evaluation Results

Both the models mentioned above were trained and tested on same conditions. Callback was set for minimum validation loss.

For UNet model, best weights gave validation loss of 0.084 and an accuracy of 99.90%. The log loss of train and test data vs the epoch for the model is shown in the figure below. Best weights are marked as cross in the graph.

UNet model results
Predictions of UNet model

For Linknet model, best weights gave validation loss of 0.070 and an accuracy of 99.74%. The log loss of train and test data vs the epoch for the model is shown in the figure below. Best weights are marked as cross in the graph.

Linknet model results
Predictions of Linknet model

Observation

It was observed that for segmentation of tumor in the MR images, Linknet was able to produce less loss than the UNet model. Although Linknet had less accuracy. Overall, it was seen that both the models work good in medical imaging and can be tested on bigger datasets and thus can be implemented in the field of Medical Science to help experts in segmentation of tumor and further helping in faster treatment of cancer patients. The study can also implemented on MR images of other body parts to detect tumors.

References

  1. https://doi.org/10.1016/j.media.2016.05.004
  2. https://doi.org/10.1016/j.mri.2013.05.002
  3. https://arxiv.org/abs/1505.04597
  4. https://doi.org/10.1109/VCIP.2017.8305148
  5. https://www.kaggle.com/mateuszbuda/lgg-mri-segmentation

--

--

Saksham Checker
Saksham Checker

Written by Saksham Checker

Hi there! I am Saksham Checker from Delhi, India. I am currently pursuing Bachelor of Technology in Engineering Physics from Delhi Technological University

No responses yet