Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time




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 and 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.


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.


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 (or for multiple GPUs) to train the network.
    1. Adjust the parameters lines 54-60 of to fit your training data (especially lines 59-60, which deal with class imbalance).
  2. Run 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.


Deep Contour-Aware Networks in TensorFlow



No releases published


No packages published