Code Monkey home page Code Monkey logo

dcan-tensorflow's Introduction

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.

dcan-tensorflow's People

Contributors

lisjin avatar

Watchers

 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.