• Stars
    star
    180
  • Rank 213,097 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 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

Fully automatic brain tumour segmentation using Deep 3-D convolutional neural networks

DeepBrainSeg

PyPI version Downloads Documentation Status License: MIT

This repo utilizes an ensemble of 2-D and 3-D fully convoultional neural networks (CNNs) for segmentation of the brain tumor and its constituents from multi modal Magnetic Resonance Images (MRI). The dense connectivity pattern used in the segmentation network enables effective reuse of features with lesser number of network parameters. On the BraTS validation data, the segmentation network achieved a whole tumor, tumor core and active tumor dice of 0.89, 0.76, 0.76 respectively.

Features

  • Brain Tumor Segmentation
  • Brain Mask Generation SkullStripping (currently using HD-BET and ANTs)
  • Radiomic Features
  • Coregistration
  • Dcm and nifty support (converts dcm to nifty and works)
  • UI based inference framework
  • Finetuning
    • Hardmining
    • Gradual Unfreezing
  • Custom netwrok Training Framework
  • Whole Brain Segmentation

Installation

PyPi based installation:

Required Python version: 3.5

installation: pip install DeepBrainSeg

or

git clone https://github.com/koriavinash1/DeepBrainSeg.git
cd DeepBrainSeg
python3 setup.py install

Citation

If you use DeepBrainSeg, please cite our work:

@inproceedings{kori2018ensemble,
  title={Ensemble of Fully Convolutional Neural Network for Brain Tumor Segmentation from Magnetic Resonance Images},
  author={Kori, Avinash and Soni, Mehul and Pranjal, B and Khened, Mahendra and Alex, Varghese and Krishnamurthi, Ganapathy},
  booktitle={International MICCAI Brainlesion Workshop},
  pages={485--496},
  year={2018},
  organization={Springer}
}

Pipeline for Segmentation

pipeline

Results for Segmentation

Results

UI

We also provide a UI based tool for tumor segmentation visualization. It can be used by running the following commands after cloning the repo.

cd ui
python3 DeepBrainSegUI.py

normal overlay2

Python API usage

Brain tumor segmentation

for data in BraTs format

from DeepBrainSeg import deepSeg
segmentor = deepSeg(quick=True)
segmentor.get_segmentation_brats(path)

for other formats

from DeepBrainSeg import deepSeg
t1_path = 
t2_path = 
t1ce_path = 
flair_path = 

segmentor = deepSeg(quick=True)
segmentor.get_segmentation(t1_path, t2_path, t1ce_path, flair_path, save = True)

brain seq coregistration to t1c

from DeepBrainSeg.registration import Coregistration
coreg = Coregistration()

moving_imgs = {'t1': t1path,
               't2': t2path,
               'flair': flairpath}
fixed_img =  os.path.join(t1cpath)
coreg.register_patient(moving_images    = moving_imgs,
                            fixed_image = fixed_img,
                            save_path   = pathtosave)

brain mask extraction (skull stripping)

from DeepBrainSeg.brainmask.hdbetmask import get_bet_mask
from DeepBrainSeg.brainmask.antsmask import get_ants_mask

get_bet_mask(vol_path, savepath)

or 

get_ants_mask(vol_path, savepath)

Radiomics feature exctractor

from DeepBrainSeg.radiomics import ExtractRadiomicFeatures

extractor = ExtractRadiomicFeatures(input_mask=None, 
                                    save_path=None, 
                                    seq='Flair',
                                    class_ = 'ET')
extractor.first_order()
extractor.glcm_features()
extractor.gldm_features()

or

extractor.all_features()

Steps followed for tumor segmentation inference:

  • Our algorithm makes use of ANTs framework for mask generation. First call deepSeg class build ANTs framework locally in ~/.DeepBrainSeg
  • First call deepSeg downloads all pretrained models locally in ~/.DeepBrainSeg
  • Final segmentation is the result of ensemble of 4 different models:
    • ABLNet (modelABL.py, Air brain Lesion Network)
    • 3DBrainNet (model3DBNET.py, 3D multiresolution CNN)
    • Tiramisu2D (modelTis2D.py, 57 layered 2D CNN)
    • Tiramisu 3D (modelTir3D.py, 57 layered 3D CNN)
  • Extensive documentation will be uploaded soon, along with transfer learning framework
  • More details about network architecture and training procedure can be found here

For training code please refer this repo

Windows 10 Installation Guide

image Figure_0: DeepBrainSeg starting up on Windows 10.

image

Figure_1: DeepBrainSeg used to get brain segmentation on Windows 10. (Note: Ensemble segmentation/inference takes ~2 hours via torch_cpu, on my i7 6700 intel cpu. Torch cuda/gpu on the other hand, is much faster, with ensemble segmentation/inference taking only ~10 minutes, on my gtx 1060 3gb)

Installation Guide: here

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

More Repositories

1

Optic-Disk-Cup-Segmentation

Optic Disc and Optic Cup Segmentation using 57 layered deep convolutional neural network
Jupyter Notebook
50
star
2

BioExp

Explainability of Deep Learning Models
Python
29
star
3

Stock-Price-Forecasting-Using-Artificial-Intelligence

Stock price prediction using Bidirectional LSTM and sentiment analysis
JavaScript
29
star
4

DigitalHistoPath

Jupyter Notebook
23
star
5

BraTs2018

Brats segmentation pytorch
Jupyter Notebook
14
star
6

Fetal-Brain-Segmentation

Fully automatic technique for fetal brain segmentation using deep convolutional neural network
Jupyter Notebook
10
star
7

Brain_Tumor_Localization_using_RL_agent

Deep Reinforcement learning based tumour localisation
Python
6
star
8

HyperbolicReasoning

Python
5
star
9

pgm

Graph: Representation, Learning, and Inference Methods
Python
4
star
10

PAC18

sMRI based depression classification using 3D volumetric convolutional networks
Python
4
star
11

Dynamic-Programming-and-Reinforcement-Learning

Jupyter Notebook
3
star
12

nfm

neural field models
Python
3
star
13

VisualDebates

Python
2
star
14

Paper-a-week

Initiative to improve the habit of litreture survey
2
star
15

CIFAR10

Python
2
star
16

habitat-research

test script to analyse facebookresearch/habitat environment
Shell
2
star
17

Numerical-Optimization

Jupyter Notebook
2
star
18

CHAOS_CT-MRI

Python
2
star
19

OscillatoryNetworks

Oscillatory models of FHN
Python
2
star
20

Diabetic-Retinopathy

DRGrade classification code for ISBI 2018
Python
2
star
21

TextWorld

Reinforcement learning for NLP
2
star
22

BioExp_Experiments

To check causality framework end2end
Jupyter Notebook
2
star
23

Manuscript-Generator

Using GAN's to generate scientific manuscripts
Python
2
star
24

Cataract-2018

Surgical tools classification
Jupyter Notebook
1
star
25

LITS

Jupyter Notebook
1
star
26

Complex_Domain_DL_model_analysis-

Python
1
star
27

MathematicalModelling

Involves various case studies, in mathematical modelling
Jupyter Notebook
1
star
28

StockNest_static

Python
1
star
29

position_based_network

Python
1
star
30

Bayesian-Deep-Learning

Python
1
star
31

electron-test

JavaScript
1
star
32

SVHN_with_BBox_RNN

1
star
33

CASTLE

Python
1
star
34

Network-Games-for-Coupled-Neuron-Model

Application of game theory in designing coupled neuronal oscillator
Python
1
star
35

T2w_to_BOLD

Distortion field estimation using deep neural networks
Python
1
star
36

SVHN_with_5_digits

Python
1
star
37

Granger-Causality

Model to find out Granger causality in the given data
1
star
38

datascience_bowl2018

Python
1
star
39

exploration-of-spacefilling-curves-in-deep-learning

implementing concepts of space filling curves in energy efficient ML
Python
1
star
40

Chronnectome

https://www.sciencedirect.com/science/article/pii/S0896627314009131
1
star
41

Convolutional-Variational-AutoEncoders

Multiscale CVAE on highres natural and biomedical images
Python
1
star
42

NASASpaceAppChallenge

Fortran
1
star