Giter VIP home page Giter VIP logo

josedolz / hyperdensenet Goto Github PK

View Code? Open in Web Editor NEW
148.0 11.0 41.0 840 KB

This repository contains the code of HyperDenseNet, a hyper-densely connected CNN to segment medical images in multi-modal image scenarios.

License: MIT License

Python 100.00%
cnn fcn 3d-cnn convolutional-neural-networks hyperdensenet medical-image-processing segmentation image-segmentation deep-learning deep-neural-networks

hyperdensenet's Introduction

HyperDenseNet

  • A new pytorch version has been implemented here

This repository will contain the code of HyperDenseNet, a hyper-densely connected CNN to segment medical images in multi-modal image scenarios.

Among others, this network is ranked first in the MRBrainS MICCAI Challenge http://mrbrains13.isi.uu.nl/results.php

If you find that this work has been useful for your research, please consider citing the following works:

A detail of a section of the proposed HyperDenseNet.

Content

Requirements

  • The code has been written in Python (2.7) and requires Theano
  • You should also have installed scipy
  • (Optional) The code allows to load images in Matlab and Nifti formats. If you wish to use nifti formats you should install nibabel
  • Since, as you might now, sharing medical data is not a good-practice, I did not include any sample in the corresponding folders. To make your experiments you must include your data in the repositories indicated in the config file (LiviaNET_Config.ini and LiviaNET_Segmentation.ini)

Running the code

Running the code actually works in the same way that LiviaNet. Just a reminder if you do not want to check the documentation from that net :)

Training

How do I train my own architecture from scratch?

To start with your own architecture, you have to modify the file "LiviaNET_Config.ini" according to your requirements.

Then you simply have to write in the command line:

THEANO_FLAGS='device=cuda0,floatX=float32,lib.cnmem=1' python ./networkTraining.py ./HyperDenseNet_Config.ini 0

This will save, after each epoch, the updated trained model.

If you use GPU, after nearly 5 minutes you will have your trained model from the example.

Can I re-start the training from another epoch?

Imagine that after two days of training your model, and just before you have your new model ready to be evaluated, your computer breaks down. Do not panic!!! You will have only to re-start the training from the last epoch in which the model was saved (Let's say epoch 20) as follows:

python ./networkTraining.py ./HyperDenseNet_Config.ini 1 ./outputFiles/HyperDenseNet/Networks/HyperDenseNet_Epoch20

Ok, cool. And what about employing pre-trained models?

Yes, you can also do that. Instead of loading a whole model, which limits somehow the usability of loading pre-trained models, this code allows to load weights for each layer independently. Therefore, weights for each layer have to be saved in an independent file. In its current version (v1.0) weights files must be in numpy format (.npy).

For that you will have to specify in the "LiviaNET_Config.ini" file the folder where the weights are saved ("weights folderName") and in which layers you want to use transfer learning ("weights trained indexes").

Testing

How can I use a trained model?

Once you are satisfied with your training, you can evaluate it by writing this in the command line:

python ./networkSegmentation.py ./HyperDenseNet_Segmentation.ini ./outputFiles/HyperDenseNet/Networks/HyperDenseNet_EpochX

where X denotes the last (or desired) epoch in which the model was saved.

Versions

  • Version 1.0.
    • April,17th. 2018
      • HyperDenseNet processes multi-modal data in different branches which are densely connected (so far only two-modalities).

Results

These images depicts some results included in the HyperDenseNet papers.

  • Some qualitative results of the proposed HyperDenseNet compared to some baselines.


  • Analysis of features reuse in the case of two image modalities.


hyperdensenet's People

Contributors

josedolz 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  avatar  avatar  avatar

hyperdensenet's Issues

When will the code be available?

Dear Jose Dolz,
Thanks for your excellent work, it is great and insightful!
Would it be possible for you to tell me when the code can be available?

Looking forward to your reply.
Edward

About feature concatenation

Hi @josedolz, Thanks for the codes. I may miss something but am wondering, how the feature maps with different shapes are concatenated, since no padding was used? Did you crop them? Thanks.

Questions about data sets

Hello, thank you very much for the disclosure of your code.
Because I am a student and do not have a team email, I cannot download the data sets. Can you send me the data set?If possible, you can send it to this email number: [email protected] ,Thank you very much. Looking forward to your reply!

What is the BatchNormEpochs

Hello

I am reading the paper about HyperDenseNet and its codes.

My question is the role of BatchNormEpochs.

What does the number of BatchNormEpochs mean?

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.