• Stars
    star
    262
  • Rank 156,136 (Top 4 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Brain Tumor Segmentation done using U-Net Architecture.

Brain Tumor Segmentation

forthebadge forthebadge forthebadge forthebadge
License: MIT Maintenance GitHub issues

This project uses U-Net Architecture to create segmentation masks for brain tumor images.

Overview

Dataset Used

Dataset used in this project was provided by Jun Cheng.
This dataset contains 3064 T1-weighted contrast-enhanced images with three kinds of brain tumor. For a detailed information about the dataset please refer to this site. Version 5 of this dataset is used in this project. Each image is of dimension 512 x 512 x 1 , these are black and white images thus having a single channel.
Some Data Samples

Original Image Mask Image

Data Augmentation

The basic forms of data augmentation are used here to diversify the training data. All the augmentation methods are used from Pytorch's Torchvision module.

Code Responsible for augmentation
Augmentation Code
Each augmentation method has a probability of 0.5 and the order of application is also random. For Rotation Augmentation the degree of rotation is chosen randomly between 75°-15°.

Model Architecture

The model architecture is depicted in this picture. Model Architecture

Training Process

The model was trained on a Nvidia GTX 1050Ti 4GB GPU. Total time taken for model training was 6 hours and 45 minutes. We started with an initial learning rate of 1e-3 and reduced it by 85% on plateauing, final learning rate at the end of 100 epochs was 2.7249e-4.
Some graphs indicating Learning Rate & Loss Value over 100 epochs are given below.

LR Graph Learning Rate Graph in Tensorboard.

Loss Graph Loss Graph Plotted in Matplotlib
Loss Graph Loss Graph Plotted in Tensorboard

To see the complete output produced during the training process check this

Installation

This project uses python3.

Clone the project.

git clone https://github.com/Jeetu95/Brain-Tumor-Segmentation.git

Install Pytorch from this link
Use pip to install all the dependencies

pip install -r requirements.txt

To open the notebook

jupyter lab

To see logs in Tensorboard

tensorboard --logdir logs --samples_per_plugin images=100

To setup the project dataset

python setup_scripts/download_dataset.py
python setup_scripts/unzip_dataset.py
python setup_scripts/extract_images.py

Usage

python api.py --file <file_name> --ofp <optional_output_file_path>
python api.py --folder <folder_name> --odp <optional_output_folder_path>
python api.py -h
Available api.py Flags
--file  : A single image file name.
--ofp   : An optional folder location only where the output image will be stored. Used only with --file tag.

--folder: Path of a folder containing many image files.
--odp   : An optional folder location only where the output images will be stored. Used only with --folder tag.

-h, --help : Shows the help contents.

Some results generated by API are here

Results

The mean Dice Score our model gained was 0.74461 in testing dataset of 600 images.
From this we can conclude that in our testing dataset our constructed mask has a similarity of about 74% with the original mask.
Some samples from our training dataset output are below. The top best results are here.To see all the results click on this Google Drive link

. .

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT License

More Repositories

1

Rocket_Lander_Gym

💥💥 This is a easy installable extension for OpenAi Gym Environment. This simulates SpaceX Falcon landing.
Python
53
star
2

Dogs-Vs-Cats-Kaggle

Dogs Vs Cats Classifier for Kaggle Competition
Jupyter Notebook
8
star
3

MNIST-Autoencoder

Generating & Denoising MNIST Data using FC Autoencoder Architecture.
Jupyter Notebook
6
star
4

Image-Locker

Encryption & Decryption tool for images.
Python
6
star
5

Practice-Problems

Codes of the problems I solve. Codes include the question URL
Java
5
star
6

Q-Learning-with-Gym

A simple Q-Learning Algorithm which works on some gym environments.
Python
5
star
7

Employee-Management-System

Project for my B.Tech 5th Semester DBM subject
HTML
4
star
8

Decision-Tree

A decision tree program following the ID3 algorithm
Python
4
star
9

My-Tensorflow

A small experiment to recreate how basic Tensorflow works and in the process fully understand the working of Tensorflow.
Python
4
star
10

Multi-Label-Image-Classification-Demo

B.Tech Final year project demo
Python
4
star
11

Knapsack-Problem

Knapsack Problem Using Genetic & Greedy Algorithm
Python
3
star
12

CodeHub

Download CodeHub V2.0 from out website
Java
3
star
13

Google-India-Challenge-Scholarship

This repository contains the list of videos which I learnt as a part of Google India Challenge Scholarship Android Developer Intermediate Track
3
star
14

Compiler-Design-Assignment

Codes for Compiler Design Assignment
C
3
star
15

Central-Inventory-System

4th Semester project for Software Tools Lab using Visual Basic 6.0
Visual Basic
2
star
16

My-Website

My website live at www.subhajitdas.info
HTML
2
star
17

Algorithm-Collection

A collection of various algorithms I am working on
Python
2
star
18

sdsubhajitdas

👀
1
star
19

React-Todo-App

Learning React by making a simple TODO app
JavaScript
1
star
20

Anonymous-Sender

Anonymous message sending application.
JavaScript
1
star
21

Emaily

Simple survey email sending application
JavaScript
1
star