fibremint / cm-software_segmentation-predict

Cytomine software which predicts a medical slide image based on the U-Net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation Predict

This software is Cytomine extension software that provides prediction of bladder cancer on a medical slide image that uploaded on Cytomine.

Prediction is accomplished with image segmentation with 2 classes (positive or negative), and find indpendent area on a result images represented as WKT polygon. The WKT format data would be coverted into Cytomine compatible data (Annotation), and then uploaded to the Cytomine server.

Pre-processing of the data

A medical slide image is quite big (over 100M pixels). The input that provided to deep learning model is prepared by crop (2k * 2k px., overlap 512px.) and resize (0.25) in sequential order.

Improvement

With the introduction of the Ray, make improvement on the spended time in inference by the process of pre-processing is running as concurrently.

In previous implementation of the inference process, the inference code have to wait until pre-processing is done and input batch is ready. But with this improvement, pre-processing can be run as asynchronoulsy and concurrently while the inference is ongoing and the inference doesn't have to wait for the pre-processing.

The class SlideActor in slide.py is Ray remote task that retrieving a value from invocation with .remote() that provided by @ray.remote decorator can be evaluated asynchronously. In this case, when invoke the method that in this class remotely with .crop.remote(), the cropping task starts asynchronously and stores its results in Ray object store memory. And a number of SlideActor instances are created with given arguments and the tasks that cropping the slide image with specific region are allocated to each of them. This created instances are running on available resources (CPU threads) and it is an answer for how cropping can be run as concurrently. In the process of inference, pre-processed data can be provided with ray.get() that reads Ray objects that already evaluated and stored.

Requirements

Requirements (dev)

Reference

About

Cytomine software which predicts a medical slide image based on the U-Net


Languages

Language:Python 96.6%Language:Dockerfile 3.4%