Giter VIP home page Giter VIP logo

johnson's Introduction

Neuron Segmentation

This repository contains various algorithms implemented on neurons images segmentation which are completed on CSCI 8360, Data Science Practicum at the University of Georgia, Spring 2018.

This project uses the time series image datasets of neurons from CodeNeuro. Each folder of training and testing images is a single plan, and the images are numbered according to their temporal ordering. The neurons in the images will flicker on and off as calcium is added. In this repository, we are offering three main algorithms as follows using different packages to locate the neurons and segment them out from the surrounding image.

  1. Non-negative Matrix Factorization by thunder-extraction
  2. Convolutional Neural Network by Unet
  3. Constrained Non-negative Matrix Factorization by CaImAn

Read more details about each algorithm and their applications in our WIKI tab.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Environment Setting

  1. Clone this repository.
$ git clone https://github.com/dsp-uga/Johnson.git
$ cd Johnson
  1. Create conda environment based on environments.yml offered in this repository.
$ conda env create -f environments.yml -n neuron python=3.6
$ source activate neuron

Note that tf_unet works best in python 2.7, which is also the environment we used for it. (All other experiments are done in Python 3.6). So if you want to use tf_unet, create a conda environment as follows:

$ conda env create -f environments.yml -n neuron python=2.7
$ source activate neuron
  1. (for Unet) Clone the source repository by tf_unet, go into tf_unet repository, and set up tf_unet in the conda environment, then delete tf_unet repository.
$ git clone https://github.com/jakeret/tf_unet
$ cd tf_unet
$ python setup.py install
$ rm -rf tf_unet
  1. (for CNMF) Clone the sources repository by CaImAn, go into CaImAn repository, and set up caiman in the conda environment, then delete CaImAn repository.
$ git clone https://github.com/flatironinstitute/CaImAn
$ cd CaImAn
$ python setup.py install
$ rm -rf CaImAn

Add sudo before the command if you encounter the permission problems.

Running the tests

python -m [option-name] [args-for-the-option]
Options
  • ThunderNMF: Running NMF by thunder-extraction
  • UNET: Running CNN by unet
  • CNMF: Running CNMF by caiman

Each module provides their own arguments. Use help() to know more details when running the algorithms.

Evaluation

Based on the neurons coordinates, five related scores to determine the results will be generated as follows:

  • Recall: (number of matched regions)/(number of ground-truth regions)
  • Precision: (number of matched regions)/(number of our regions)
  • Inclusion: (number of intersecting pixels)/(number of total pixels in the ground-truth regions)
  • Exclusion: (number of intersecting pixels)/(number of total pixels in our regions)
  • Combined:

Test Results

Module arguments Total Score Avg Precision Avg Recall Avg Inclusion Avg Exclusion
ThunderNMF percentile=99, max_iter=50, overlap=0.1, chunk=32 2.94815 0.78606 0.84156 0.56725 0.75328
ThunderNMF percentile=99, max_iter=50, overlap=0.1, chunk=128, padding=15 2.852 0.663 0.93048 0.67249 0.58641
Unet (only running on 00 sets) train_iter=120, epoch=500, layer=4, features=64 2.93394 1.0 0.9446 0.41857 0.57077
CNMF k=1000, g=5, merge=0.8 2.60321 0.860 0.645 0.790 0.309

Tensorboard Records for Unet training

Accuracy

Loss

TODO

Training tf_unet with padded images, because tf_unet with shrink the image size. Our results from tf_unet is not as good as we expected. We used scaling, but that may not work so well here. See Issues #13 and #18.

We also tried implementing the image segmentation problem using the spectral clustering method. Due to lack of time, we were not able to test our results for this method. We used the scikit-learn package of spectral clustering in order to implement this.

Authors

(Ordered alphabetically)

See the CONTRIBUTORS file for details.

License

This project is licensed under the MIT License - see the LICENSE file for details

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.