Giter VIP home page Giter VIP logo

instance_segmentation_with_pixel_embeddings's Introduction

Instance Segmentation with Pixel Embeddings

Institute of Imaging & Computer Vision, RWTH Aachen University

This repository (InstSegv1) contains the implementation of instance segmentation approach described in the papers:

  • Long Chen, Martin Strauch and Dorit Merhof.
    Instance Segmentation of Biomedical Images with an Object-Aware Embedding Learned with Local Constraints [Paper]
    International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI) 2019.

Please cite the paper(s) if you are using this code in your research.

Check instSeg for reconstructed code (tensorflow 2.x) and improved work.

Overview:

To decouple the embedding branch and the distance regression branch, we construct a decode path for each. Compared to the sturcture in the paper (two branches on the same feature map), the training is of decoupled path is more robust.

Prerequisites

Python dependencies:

  • tensorflow (programmed with tf 1.14)
  • scikit-image
  • opencv

Data dependencies:

In the paper, we tested the network with two datasets:

  • BBBC006: a hunman U2OS cell dataset bbbc006
  • CVPPP: leaf segmentation dataset cvppp2017

Usage

convert your dataset to tfrecords

You can use the function def create_tf_record() in utils/tfrecords_convert.py to convert your dataset to tfrecords. Images will be resized to the same, distance map and neighbor relationship will be computed and saved in tfrecord files.

The function requirs two python dictionary image_dict and gt_dict as inputs. Dictionary values are the path of input images and label images, respectively. Dictionary keys are only used to determine which label image corresponds to which input image, so any kind of identifier can be used as the key.

Other arguments:

  • neighbor_distance_in_percent: [0, 1], the distance to determine neighborhood, in percentage of image width
  • resize: to form a training batch, images should be resized to the same
  • dist_map: boolen, compute distance map or not
  • gt_type: 'label' for label map / 'indexed' for indexed png

Example scripts for converting tfrecords are provided:

  • BBBC006 dataset: prepare_U2OScell_tfrecords.py
  • CVPPP2017 dataset: prepare_cvppp_tfrecords.py

Note:

  • label images are saved as uint16: objects in one image should not more than 216 - 1 = 65535 (0 is reserved for background)
  • the distance map is normalized per object and saved as uint8

train the model

To train your own model, run: python train.py --phase=train

other options of main.py are provided to config the training, refer to main.py for details.

prediction

python train.py --phase=test --test_dir=../.. --test_res=../..

Images in test_dir will be read and segmented, with the segmentation mask saved under test_res. Segmentations will be also saved as indexed png for visualization purpose.

evaluation

python train.py --phase=evaluation Since the file structure varies from dataset to dataset, we only provide a Evaluator class, which can report precision and recall under different IoU/F-score. You can use it to implement your own evaluation easily. Refer to utils/evaluation.py for details.

Results

Comparision with other methods

How to cite


@inproceedings{LongMACCAIInstance,  
  author = {Long Chen, Martin Strauch, Dorit Merhof},  
  title = {Instance Segmentation of Biomedical Images with an Object-Aware Embedding Learned with Local Constraints},  
  booktitle = {MICCAI 2019},  
  year = {2019},  
}

instance_segmentation_with_pixel_embeddings's People

Contributors

looooongchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

instance_segmentation_with_pixel_embeddings's Issues

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.