• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    Jupyter Notebook
  • License
    Other
  • Created over 4 years ago
  • Updated 7 months ago

Reviews

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

Repository Details

A Multi-Class Brain Tumor Classifier using Convolutional Neural Network with 99% Accuracy achieved by applying the method of Transfer Learning using Python and Pytorch Deep Learning Framework

neuralBlack

Note: I have completely changed the POC for this project, and have not updated it over here since I'm publishing it as a paper.

neuralBlack is a complete brain tumor detection, classification, and diagnosis system with high accuracy (99.3%) that uses state of the art Deep Learning methods.

ResNet50 Neural Network Architecture

NN image

Dataset

We have used brain tumor dataset posted by Jun Cheng on figshare.com.

This brain tumor dataset containing 3064 T1-weighted contrast-inhanced images from 233 patients with three kinds of brain tumor: meningioma (708 slices), glioma (1426 slices), and pituitary tumor (930 slices).

Modules

  • brain_tumor_dataset_preparation.ipynb - An IPython notebook that contains preparation and preprocessing of dataset for training, validation and testing.

  • torch_brain_tumor_classifier.ipynb - An IPython notebook that contains all the steps, processes and results of training, validating and testing our brain tumor classifier.

  • test.py - A python script which accepts path to an image as input, which then classifies the image into one of the three classes.

  • deploy.py - A python script integrated with Flask server, that starts the Web Interface on local server where user can upload MRI image of brain and get classification results.

Note: We have included few images for testing under test_images directory.

Running the classifier

Download the classifier model '.pt' file from this drive link and place it under a folder named 'models' in the same directory where the files of this repository are present.

Before running the programs, kindly install the requirements as given in Requirements section of this README.

  • Use the test.py script for running the script in Terminal, Powershell or Command Prompt.

    • python test.py
  • Use deploy.py script to access the classifier as an interactive web interface.

    • python deploy.py

Screenshots (Results & Web Interface)

Web Interface

Home Page

index

Classification Results via Web Interface

class 1

class 2

class 3

Classifier Evaluation

Loss Graph

Loss Metrics

Accuracy Graph

Accuracy Metrics

Confusion Matrix on Test set

Confusion Matrix

Requirements

Python 3 is required.

Computational Specifications

Project done using Google Colab with follwing specifications:

  • Ubuntu 18.04 64-bit OS
  • 12 GB DDR4 RAM
  • 16 GB NVidia Tesla P100 GPU
  • 40 GB of Non-Persistent Storage

Library Requirements

We'll be using the following libraries to complete our classification problem:

  • Numpy - For linear algebra operations
  • Torch - Pytorch Deep Learning Framework
  • OS - To use Operating System methods
  • Random - To set random seed at specific places where random operations take place just so it happens the same way everytime it is executed
  • Pandas - To create DataFrame, CSV files, etc
  • Time - To perform date time operations
  • Seaborn - For sophisticated visualization
  • Pickle - To save and load binary files of our training data
  • Scikit-Learn - Machine learning framework. We have used this for evaluating our Classifier and for cross-validation split
  • Matplotlib - To visualize images, losses and accuracy
  • Google Colab Drive - To mount Google Drive so we can perform storage and loading operations using it (Only available on Google Colab)

The above mentioned libraries comes pre-installed and pre-configured with Google Colab.

Install the required libraries on your computer using the pip package manager.

For pip version 19.1 or above:

pip install -r requirements.txt --user

or

pip3 install -r requirements.txt --user

Pytorch

Follow the steps for installation given in the official website of Pytorch.

About

This project was done by Akshay Kumaar M. Paper is in progress. All the references papers have been included at the end of this repository's README.

References

Thanks to Vinoth Arjun for giving ideas for custom dataset class with different real-time augmentations.

License

Copyright 2020 Akshay Kumaar M

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Research Papers

Documentations

Future Scopes

  • Brain Tumor segmentation using GANs.
  • Brain Tumor detection using Object Detection for localization of tumor in a given MRI image of the brain.
  • Improve existing classification model and web interface

More Repositories

1

stock_bot

A simple stock trading bot using Reinforcement Learning (Deep Q Learning).
Jupyter Notebook
5
star
2

pe_malware_prediction

To predict portable executable malware using Neural Networks with Tensorflow
Jupyter Notebook
4
star
3

image-super-resolution

Photo-Realistic single image super-resolution using Generative Adversarial Network (SRGAN) implemented using PyTorch.
Python
4
star
4

drive-ai

A complete Warning System for Drivers using Artificial Intelligence and Computer Vision for India.
3
star
5

revshell-dev

A simple exploit programmed in C, Assembly and Python that uses crafted shellcode with multiple stages to understand the practices as well as the concepts of shellcodes, reverse shells and exploit development.
Assembly
3
star
6

tofu

Tofu is a framework for Machine Learning and Deep Learning supporting Python, C, and C++ programming languages. It is still in its very early development stages.
Python
3
star
7

style-transfer

Simple Style Transfer using PyTorch
Jupyter Notebook
3
star
8

time_series

Time series prediction using LSTM implemented with Pytorch
Jupyter Notebook
2
star
9

third-eye-ids

Third Eye is a Hybrid Intrusion Detection System that uses Deep Learning
Python
2
star
10

naive_article_spinner

Simple article spinner using Python & NLP techniques
Python
2
star
11

museum-sentiment-analysis-BERT

A simple sentiment analysis based text classification using Google BERT for museum tweets with HuggingFace Transformers and PyTorch.
Jupyter Notebook
2
star
12

github-copilot-demo

A test and demo repository for GitHub copilot preview
Python
1
star
13

cipher_decryptor

A cipher decryption algorithm using Natural Language Processing techniques and Genetic Algorithm
Python
1
star
14

DCGAN

Deep Convolutional Generative Adversarial Network (DCGAN) for generating human faces using Neural Networks with Tensorflow
Jupyter Notebook
1
star
15

beacon-rd

Product developed for Ministry of Coal (Government of India) aiming Coal mine Rescue. Β© Rogue Daemons.
Python
1
star
16

taxi_fare

A simple taxi fare prediction and classification using a Tabular Neural Network model implemented with Pytorch
Jupyter Notebook
1
star
17

deep-dream

Dream with Neural Networks - An implementation of Deep Dream using Tensorflow.
Jupyter Notebook
1
star
18

exploit_and_tools_dev

Projects and tools based on Exploitation/Penetration Testing techniques to use for my workshops and e-learning live streams.
Python
1
star
19

airline-reservation-system-C

Simple airline reservation system using C.
C
1
star