Skip to content

napolun279/dcan-tensorflow

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dcan-tensorflow

Objective

Results

Model Output

iter-12650

After 12,650 iterations, the output of the model is on the rightmost column (labels in the middle column).

TensorBoard Plots

dice-coefs.png

As shown in the dice coefficient plots above, the model continues to improve beyond the results shown above. Left plot is for contours, right for segments.

Instructions

All code within tf-dcan/ was written for the Broad Institute human U2OS cells image set referenced above. This image set contains 34 images at 32 different z-indices (from an automated microscope), and are of size 692 x 520.

For running on your own images, you must:

  1. Generate a set of ground truth contours and segments as described in the DCAN paper.
    1. Use tf-dcan/traceBounds.m as a starting point.
  2. Customize bbbc006.py and bbbc006_input.py in dcan-tensorflow/ according to your data (e.g., image dimensions, file type decoding).

To run the code on the U2OS image set, follow all steps in the sections below.

Preprocessing

The fm-prep/ directory contains MATLAB scripts to automatically select the optimal focal plane for each image.

  1. Move all directories from the U2OS image set to the repo's root.
  2. Run fmeasureAll() in MATLAB to compute each the focus measure of each image.
    1. Make sure to install the fmeasure function and change line 10 of fmeasureAll.m to point to the directory.
  3. Run saveImgsAll() in MATLAB to save the detected in-focus images to an output directory called BBBC006_v1_focused/.
    1. Change line 6 of saveImgs.m if you want to rename the output directory.

Training

The tf-dcan/ contains all TensorFlow code, which uses the CIFAR-10 tutorial code as a skeleton.

  1. Using virtualenv, run the following to install all dependencies.
virtualenv venv --distribute
source venv/bin/activate
pip install -r requirements.txt
  1. Run bbbc006_train.py (or bbbc006_multi_gpu_train.py for multiple GPUs) to train the network.
  2. Run bbbc006_eval.py for evaluation using dice coefficient.
  3. Use TensorBoard to visualize the results in /tmp/bbbc006_train and/or /tmp/bbbc006_eval for training and evaluation results, respectively.

About

Deep Contour-Aware Networks in Tensorflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 93.6%
  • MATLAB 6.4%