Giter Site home page Giter Site logo

bodysegmentation's Introduction

Body Segmentation Using Fully Convolutional Networks

Introduction

This project is to use fully convolutional networks to do object segmentation from images. This project is primarily used for organ segmentations from CT images, but it could also transfer to do general object segnmentations from any type of images based on given labeled images.

This project is written by Python 2.7 and tensorflow 0.12.

Instruction

Enviroment Setup

Suport files

This project uses the weights used in VGG16. The weights and pretrained parameters are stored in a numpy file.The .npy file for [VGG16] to be downloaded before using this needwork. You can find the file here: ftp://mi.eng.cam.ac.uk/pub/mttt2/models/vgg16.npy

Required Packages

Install Python 2 / Install annaconda 2
Install tensorflow 0.12

Data preprocessing

git https://github.com/yya007/BodySegmentation.git
cd BodySegmentation
python setup.py

Then, move the VGG16.npy to the bigfile folder
The network folder is for storing trained network with different settings and epoch number.
The res folder is for storing results by evaluating the performance of network
The Data3D folder is for storing train and test data. In test and train folder, all input images are divided into two category: seg and img. Each subject should in .mat form and named as sub_[four digit index with 1 indexing].mat with dimension 512,512,512
For exmaple, the label of first train object should in /Data3D/test/Seg/sub_0001.mat and in this mat file ['seg'] has dimension of 512,512,512.

Run the code

python run.py train [random/norandom] [number_of_classes]

will keep train from last trained networks with same parameters

Evaluate results

Evaluate the performance of network
python run.py evaluate [random/norandom] [number_of_classes]

will evaluate the last unevaluate network with same parameters

Plot the box plot
python plot.py [corresponding result address]

For example, if you want to plot the box plot of randomrun_0 (the model after first epoch with random shuffle) under res folder

python plot.py ../res/randomrun_0

Then you will get the box plot of dice similarity of each organs between ground truth and predication made by model.

For Vanderbilt User

For ACCRE User

Step 1 ssh to accre

Step 2 load tensorflow 0.12

setpkgs -a tensorflow_0.12

Step 3 setup your anaconda envrioment

First setup:

setpkgs -a anaconda2
conda create --name FCN python=2.7
source activate FCN
pip install keras
pip install protobuf
pip install matplotlib
pip install pillow

If already setup environment:

source activate FCN

Step 4 (Optional) download from github

setpkgs -a git
git https://github.com/yya007/BodySegmentation.git

Step 5 (Optinonal) copy from other machine

scp -r [your machine address]:[folder in local machine]   [target folder on ACCRE]

Step 6 (Optinonal) visualize testing

request GPU node:

salloc --account=p_masi_gpu  --partition=maxwell --ntasks=4 --nodes=1 --gres=gpu:2 --time=5:00:00 --mem=40G
cd /scatch/...
python run.py

Step 7 (Optinonal) submit slurm jobs

sample slurm files are in ACCRE folder

For Future Developer

Email [email protected]

bodysegmentation's People

Contributors

yya007 avatar

Watchers

James Cloos avatar

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.