Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

dcan-tensorflow

Objective

Instructions

All code within tf-dcan/ was written for the Broad Institute human U2OS cells image set referenced above. This image set contains 384 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 fm-prep/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 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.
    1. Adjust the parameters lines 54-60 of bbbc006.py to fit your training data (especially lines 59-60, which deal with class imbalance).
  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

Releases

No releases published

Packages

No packages published