Skip to content

vrai-group/infant-dnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infant segmentation with Deep Neural Networks

The aim of the project is to extract the shape of infants from a set of depth images. First of all it was created a dataset of labelled images taken from several recordings. Secondly the U-Net was appositely configured to train itself on the dataset previous mentioned. Lastly the U-Net trained model should predict, getting new depth images as input, the shape of infants.

Prerequisites

This project was developed on Python 3.6 and needs the following libraries:

  • numpy
  • scipy
  • scikit-image
  • scikit-learn
  • Theano/Tensorflow and Keras

Download link: Libraries

How to use

Prepare the data

In order to obtain *.npy files from data.py script, you have to create the following directory structure. The positive and partial folders contain 8-bit images, 16-bit images and mask images.

-raw
 |
 ---- train
 |    |
 |    ---- positive
 |    |    |
 |    |    ---- image.png
 |    ---- partial
 |         |
 |         ---- image_partial.png

Now run python data.py. This script randomly splits all images in training and testing set through the variable test_percentage, that represents the relationship between test and total images. Running this script will create train and test images and save them to .npy files.

Training the model

Once the npy files was created, train.py must be runned in order to create the model of the U-net and to train the neural network. The specific parameters of the U-net (epochs, batch_size) can be configured before the running. After that it will be created weights.h5 file (containing the weighted values that synthesize the trained model) that will we be used in the model.predict function in order to produce the masks associated with *_test.npy images. A value named "accuracy" will show the success percentage of the prediction.

Testing the model

Once the U-net was trained, you can move *_train.npy and weights.h5 files into the trained model folder in order to achieve a faster prediction using the script test.py without training the model again. The previous described test.py script get as input the *_test.npy files created by data.py and the *_train.npyfiles moved in the mentioned folder.

 |
 ---- trained model
 |    |
 |    ---- *_train.npy
 |    |
 |    ---- weights.h5

Contributing

Please, read this repository for more detailed information about the U-net architecture.

Authors

Supervisors

About

Infant segmentation with Deep Neural Networks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages