项目作者: naivete5656

项目描述 :
Weakly Supervised Cell Instance Segmentation by Propagating from Detection Response, in MICCAI2019.
高级语言: Python
项目地址: git://github.com/naivete5656/WSISPDR.git
创建时间: 2019-08-19T04:42:17Z
项目社区:https://github.com/naivete5656/WSISPDR

开源协议:MIT License

下载


Weakly Supervised Cell Instance Segmentation
by Propagating from Detection Response

by Kazuya Nishimura, Ker Dai Fei Elmer, Ryoma Bise

[Home] [Project] [Paper]



Illustration

Prerequisites

Installation

Python setting

Conda user

  1. conda env create -f=requirement.yml
  2. conda activate pytorch

Docker user

  1. docker build ./docker
  2. sh run_docker.sh

Graph-cut installation

Graph-cut setting

We use following code.

https://jp.mathworks.com/matlabcentral/fileexchange/38555-kernel-graph-cut-image-segmentation

  1. mkdir graphcut
  2. cd graphcut
  3. wget http://www.wisdom.weizmann.ac.il/~bagon/matlab_code/GCmex1.9.tar.gz
  4. tar -zxvf GCmex1.9.tar.gz
  5. matlab -nodesktop -nosplash -r 'compile_gc; exit'
  6. cd ..

Demo

This demo is only one image’s demo.
If you want to apply this method to your dataset, you should prepare the likelihood map.

  1. python main.py -g

Back propagate from each cell

Use cuda

  1. python propagate_main.py -g

Use cpu

  1. python detection_train.py

Optins:

-i :input path(str)

-o :output path(str)

-w :weight path want to load

-g :whether use CUDA

Graph-cut

  1. matlab -nodesktop -nosplash -r 'graphcut; exit'


This is a sample code.

We don’t provide dataset.

If you want to apply your dataset, you should prepare the original image and point level annotation(cell centroid).
The attached text file (sample_cell_position.txt) contains a cell position(frame,x,y) as each row.
Prepare the same format text file for your dataset.

Generate likelyfood map

Set the variance to a value sufficiently larger than the target object.
The guided backpropagation depends on variance size.

  1. python likelymapgen.py

Option:

-i :txt_file_path (str)

-o :output_path (str)

-w :width (int)

-h :height (int)

-g :gaussian variance size (int)

Train cell detection CNN

Use cuda

  1. python detection_train.py -g

Use cpu

  1. python detection_train.py

Optins:

-t :train path(str)

-v :validation path(str)

-w :save path of weight(str)

-g :whether use CUDA

-b :batch size (default is 16)

-e :epochs (default is 500)

-l :learning rate(default is 1e-3)

Predict cell detection

Use cuda

  1. python detection_predict.py -g

Use cpu

  1. python detection_predict.py

Optins:

-i :input path(str)

-o :output path(str)

-w :weight path want to load

-g :whether use CUDA

citation

If you find the code useful for your research, please cite:

  1. @inproceedings{nishimura2019weakly,
  2. title={Weakly Supervised Cell Instance Segmentation by Propagating from Detection Response},
  3. author={Nishimura, Kazuya and Bise, Ryoma and others},
  4. booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  5. pages={649--657},
  6. year={2019},
  7. organization={Springer}
  8. }