GithubHelp home page GithubHelp logo

sergivalverde / cnn-ms-lesion-segmentation Goto Github PK

View Code? Open in Web Editor NEW
42.0 11.0 24.0 4.89 MB

MS lesion segmentation using cascaded 3D convolutional neural networks

License: GNU General Public License v3.0

Python 80.92% Jupyter Notebook 19.08%

cnn-ms-lesion-segmentation's Introduction

WARNING:

DEPRECATED: This repository is not maintained anymore. For a new version of the toolbox, see nicMSlesions.

Multiple Sclerosis (MS) lesion segmentation of MRI images using a cascade of two 3D convolutional neural networks

This repository implements the method proposed in the NeuroImage publication, but an electronic preprint is available from Arxiv:

Valverde, S., Cabezas, M., Roura, E., González-Villà, S., Pareto, D., Vilanova, J. C., … Lladó, X. (2017).
Improving automated multiple sclerosis lesion segmentation with a cascaded 3D convolutional neural network approach.
NeuroImage, 155, 159–168. https://doi.org/10.1016/j.neuroimage.2017.04.034

Overview:

Convolutional neural networks (CNN) are being increasingly used in brain MRI image analysis for segmentation of brain tumors, tissue or pathological lesions. We have developed a novel Multiple Sclerosis (MS) white matter (WM) lesion segmentation method based on a cascade of two 3D patch-wise convolutional neural networks (CNN). The first network is trained to be more sensitive revealing possible candidate lesion voxels while the second network is trained to reduce the number of misclassified voxels coming from the first network. This cascaded CNN architecture tends to learn well from small sets of training data, which can be very interesting in practice, given the difficulty to obtain manual label annotations and the large amount of available unlabeled MRI data.

The method accepts a variable number of MRI image sequences for training (T1-w, FLAIR, PD-w, T2-w, ...), which are stacked as channels into the model. However, so far, the same number of sequences have to be used for testing. In contrast to other proposed methods, the model is trained using two cascaded networks: for the first network, a balanced training dataset is generated using all positive examples (lesion voxels) and the same number of negative samples (non-lesion voxels), randomly sampled from the entire training voxel distribution. The first network is then used to find the most challenging examples of the entire training distribution, ie. non-lesion voxels which have being classified as lesion with a high probability. From this set of challenging voxels, the second CNN is trained using a new balanced dataset composed by again all positive examples and the same number of randomly sampled voxels from the set of challenging examples.

training_pipeline

The method has been evaluated on different MS lesion segmentation challenges such as the MICCAI 2008 and MICCAI 2016. On both challenges, the proposed approach yields an excellent performance, outperforming the rest of participating strategies. The method has been also tested on clinical MS data, where our approach exhibits a significant increase in the accuracy segmenting of WM lesions when compared with other two state-of-the-art tissue segmentation methods such as SLS and LST, highly correlating with the expected lesion volume.

Install:

The method works on top of Lasagne and Theano. If the method is run using GPU, please be sure that the Theano cuda* backend has been installed correctly. In the case of CPU, be sure that the fast linear algebra libraries are also installed.

Once these requirements are met, the rest of python libraries may be easily installed using pip:

pip install -r requirements.txt

How to use it:

The main funtionality of the method can be tested using this notebook. For leave-one-out experiments, the custom script used in our experiments can be also used. More complex examples and database related noteboks (MICCAI2008, MICCAI2016) are coming soon.

Citing this work:

Please cite this work as:

@article{Valverde2017,
author = {Valverde, Sergi and Cabezas, Mariano and Roura, Eloy and Gonz{\'{a}}lez-Vill{\`{a}}, Sandra and Pareto, Deborah and Vilanova, Joan C. and Rami{\'{o}}-Torrent{\`{a}}, Llu{\'{i}}s and Rovira, {\`{A}}lex and Oliver, Arnau and Llad{\'{o}}, Xavier},
doi = {10.1016/j.neuroimage.2017.04.034},
issn = {10538119},
journal = {NeuroImage},
pages = {159--168},
title = {{Improving automated multiple sclerosis lesion segmentation with a cascaded 3D convolutional neural network approach}},
url = {http://www.sciencedirect.com/science/article/pii/S1053811917303270},
volume = {155},
year = {2017}
}

cnn-ms-lesion-segmentation's People

Contributors

sergivalverde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cnn-ms-lesion-segmentation's Issues

I have a problem with filetypes

Hi @sergivalverde

I want to get data to use to run the program. I use data from MICCAI2008 (filetype *.nhdr). But the filetype does not match the specified code (filetype *.nii.gz). Where can I get it?
If you know, please answer me.

Thank you

MemoryError

Dear professor:
I use your kears "cnn-ms-lesion-sg", my computer :NVIDIA-GT1070 8GB ,32GB RAM, cpu i7 6700.
In test, I use 5 group images as train and 5 group images as test. When epoch finish than DEBUG will memoryerror, I don't why ,can you help me ? thanks
3

I can't get a good result

Dear professor, when I use CHB and UNC data training , I can't get a good result .
about data pre-processing , I use BET skull-stripped ,but no N3 intensity normalized and smoothing ,also no resampled to 256256256 , then i train it , so because pre-processing and other?
Can you give me a suggestion.

pickle isse - NameError: global name 'pickle' is not defined

Hi,
anyone ended up with a problem of this sort - NameError: global name 'pickle' is not defined
See below for details:

model = train_cascaded_model(model, train_x_data, train_y_data, options)
File "/udd/fgalassi/base.py", line 38, in train_cascaded_model
model[0].fit(X, Y)
File "/udd/fgalassi/myenv/lib/python2.7/site-packages/nolearn/lasagne/base.py", line 700, in fit
self.train_loop(X, y, epochs=epochs)
File "/udd/fgalassi/myenv/lib/python2.7/site-packages/nolearn/lasagne/base.py", line 839, in train_loop
func(self, self.train_history_)
File "/udd/fgalassi/myenv/lib/python2.7/site-packages/nolearn_utils/hooks.py", line 60, in call
pickle.dump(train_history, f, -1)
NameError: global name 'pickle' is not defined

Thank you!

MemoryError

Dear professor:
I use your kears "cnn-ms-lesion-sg", my computer :NVIDIA-GT1070 8GB ,32GB RAM, cpu i7 6700.
In test, I use 5 group images as train and 5 group images as test. When epoch finish than DEBUG will memoryerror, I don't why ,can you help me ? thanks
3

program

Dear Dr. Sergi Valverde, I download your program, my environment is ubuntu 16.04, but I use jupyter notebook cell example_1.pynb always error. I also install requirements.txt , can your help me. Thank you very much.

FileNotFoundError ,How i get it *.nii.gz?

---> cnn1 loading training data
Traceback (most recent call last):
File "train_leave_one_out.py", line 79, in
model = train_cascaded_model(model, train_x_data, train_y_data, options)
File "C:\Users\MAGARA\Downloads\Compressed\cnn-ms-lesion-segmentation-master\base.py", line 35, in train_cascaded_model
X, Y = load_training_data(train_x_data, train_y_data, options)
File "C:\Users\MAGARA\Downloads\Compressed\cnn-ms-lesion-segmentation-master\base.py", line 134, in load_training_data
x_patches, y_patches = load_train_patches(x_data, y_data, selected_voxels, options['patch_size'])
File "C:\Users\MAGARA\Downloads\Compressed\cnn-ms-lesion-segmentation-master\base.py", line 205, in load_train_patches
lesion_masks = [load_nii(name).get_data().astype(dtype=np.bool) for name in y_data]
File "C:\Users\MAGARA\Anaconda2\lib\site-packages\nibabel\loadsave.py", line 40, in load
raise FileNotFoundError("No such file: '%s'" % filename)
nibabel.py3k.FileNotFoundError: No such file: 'C:\Users\MAGARA\Downloads\Compressed\cnn-ms-lesion-segmentation-master\VH_all\im3\lesion_bin.nii.gz'

requirements.txt errors

Hello,

I was not able to simply run pip install on the requirements file because some versions were not found. Maybe they have been updated or changed and thus not available anymore?

I have now latest version for Lasagne, etc. However, as you may expect, some issues come out. It says that theano.sandobox... gives error. I'm not really capable to find out where and what to change to make it work. Any idea what to do? Thank you very much in advance.

config.py

Hello Sergi,

could you please confirm us the parameters setting (e.g. modalities, epochs, batch size,...) to reproduce the MICCAI 2016 data challenge results (15 patients)? We are using the keras version of your method.

Many thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.