Coder Social home page Coder Social logo

cardiac-segmentation's Introduction

A Fully Convolutional Neural Network for Cardiac Segmentation

A Keras re-implementation of the original Caffe FCN model in the arXiv paper A Fully Convolutional Neural Network for Cardiac Segmentation in Short-Axis MRI .

FCN_schematic

Care was taken to reproduce the results reported in the original paper, particularly Tables 2-4. However, there are key differences between this Keras implementation and the original Caffe implementation:

  • Caffe has the Net::Reshape method that "allows networks to change their input sizes in-place." This method is very useful for defining a fully convolutional network that can process inputs with variable shapes. Some Keras layers (such as Cropping2D or Flatten) require shape information, and thus do not work with such variable input shapes. For this Keras FCN model, we standardize all inputs to a fixed shape, and then transform them back to their original shapes during post-processing. Caffe FCN models can process any variable input shape.
  • The Caffe implementation uses cross entropy loss as the training signal, whereas this Keras implementation uses the Dice coefficient as the training loss.
  • The Caffe implementation uses a slightly different strategy for data augmentation than this Keras implementation. The following tables summarize the data augmentation and training protocol for each dataset:

table_keras

table_caffe

Results

Below are the Keras results as compared to the original Caffe results reported in the paper:

results_sunnybrook

results_lvsc

results_rvsc

For all metrics, larger values are better, except for distance metrics (APD and Hausdorff), where smaller values indicate better results.

Requirements

The code is tested on Ubuntu 14.04 with the following components:

Software

  • Python 2.7
  • Keras 2.0.2 using TensorFlow GPU 1.0.1 backend
  • CUDA 8.0 with CuDNN 5.1
  • OpenCV 3.1
  • h5py 2.7
  • NumPy 1.11
  • PyDicom 0.9.9
  • Scikit-Image 0.13

Datasets

Usage

For training and evaluation, execute the following in the same directory where the datasets reside:

# Train the FCN model on the Sunnybrook dataset
$ python train_sunnybrook.py <i/o> <gpu_id>

# Train the FCN model on the LVSC dataset
$ python train_lvsc.py <i/o/myo> <gpu_id>

# Train the FCN model on the RVSC dataset
$ python train_rvsc.py <i/o> <gpu_id>

The flag <i/o/myo> indicates inner endocardium, outer epicardium, and myocardium contours, respectively, and <gpu_id> denotes the GPU device ID.

To create submission files for the test sets, execute the following:

# Create submission files for the Sunnybrook dataset
$ bash create_submission_sunnybrook.sh <gpu_id>

# Create submission files for the LVSC dataset
$ bash create_submission_lvsc.sh <gpu_id>

# Create submission files for the RVSC dataset
$ bash create_submission_rvsc.sh <gpu_id>

Note: The LVSC and RVSC submission files must be submitted to the respective LVSC and RVSC challenge organizers for the official results evaluation. The Sunnybrook submission files can be evaluated using the MATLAB code provided as part of the data download.

cardiac-segmentation's People

Contributors

vuptran 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  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  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

cardiac-segmentation's Issues

Regarding Downloading Dataset

Can you please check the dataset download link is not working.
Also please update the Read me regarding sax file.
How you are segregating Training and Validation Dataset.

Run your code on Mac OS X?

Wonder if it's possible to run your code on Mac OS X? I don't have
an Ubuntu 14.04 installed now.

Or do you see some changes to be done in your code to do so?

Thanks

David

Failed to get the number of CUDA devices

hi,bro,
when i use this code,it occurs problems like this:
"Failed to get the number of CUDA devices: CUDA driver version is insufficient for CUDA runtime version"

what should i do to solve this matter?
thks!

about the MICCAI 2009 dataset

Hello,I want to know that whether you need to submit the results of the segmentation of the MICCAI 2009 dataset online, just like RVSC dataset.

how did you perform multi scale center cropping

hi
you have mentioned in your paper in data preparation section,'' we choose multi resolution approach to crop ROI at multiple size that wholly contain ventricles."
where had you performed this in your code, if not how i can do this multi scale cropping of ROI.

package not found

While trying to run the project, i am unable to install the following packages:

  1. CUDA 8.0 with CuDNN 5.1
  2. OpenCV 3.1

Please suggest course of action.

What do I need to know after change crop size to 96?

Hello, if I change the crop size from 100 to 96 in train_sunnybrook.py, fcn_model.py, and submist_sunnybrook.py, will it cause any problem? I can get the codes working well, so the question is not about if there would be execution error. I am not sure if you guys choose crop size of 100 for some reasons specific to this Sunnybrook image data?

How to implement your method in pytorch

Since your method had got excellent result, I tried to implement your method in pytorch framework. But my result is much worse than you especially in dice coef. If you have time, could you please read my code and give me some advice

How to train the demo?

Hello, I have reead your paper, and I try to train the sunnybrook dataset in my conputer after reading your tutorial, but after 40 epochs, the loss, accuracy and the jaccard coefficient are the same as 1 epoch, how can I do to increase my accuracy by train the Sunnybrook dataset?
Thank you very much for your paper and tutorial, and I am looking forward to get your reply.

i/o/myo explain

Hello, I would like to take your code as a starting point for LVSC. There is something that is not clear to me and it is the meaning of i/o/ myo and exactly how the works in the submission -> tmp = otmp - itmp.

Why is not myo used? I really do not have much idea... Could not you unify all the segmentations of the same image and learn them all together or?

Thank you

The conversion between pixel and millimeter units

Hello, I find the SAX_series, but I can't display the corresponding contour coordinates on the DICOM file correctly. 
From the official document, it shows that each (Xi,Yi) pair representing the coordinates of i pixel in the contour in pixel unites. The conversion factor between pixel and millimeter units can be found by reading the PixelSpacing parameter of a DICOM file.

I obtain the PixelSpacing which is 1.367188, I don't know how to convert.
I am looking forward to your reply.

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.