Showing posts with label instance segmentation. Show all posts
Showing posts with label instance segmentation. Show all posts

Sunday, January 21, 2024

Resolving overlapping chromosomes is an amodal instance segmentation problem

 Just aware of Li and Malik paper "Amodal Instance Segmentation" https://arxiv.org/pdf/1604.08202.pdf. Just as Monsieur Jourdain was unaware that he was speaking prose, resolving overlapping chromosomes is an amodal segmentation, a task that instance segmentation algorithms are specifically designed to handle. A segmentation algorithm such an instance segmentation should be capable of generating overlapping masks by definition, for example:

COCO format overlapping masks (hand made).
 
In our pre-print from 2017, the ground truth masks were of three kind: one for each chromosome and one for overlapping pixels:
 
 

Minor progress

  • Masks simplification: one mask per chromosomes, no mask for overlapping domains.
  • Use standardized grayscale images (mean and standard deviation inside the masks reunion)
     

As converting binary masks into coco format is a pain in the ass, we'll try to perform instance segmentation only with binary mask images. Making explicit masks corresponding to overlapping domain should not be necessary. So that  one data looks like:

Standardized gray-scaled image (left) and its densitometric plot along a column. The two corresponding instances masks (M2 or M1) on the right. No binary mask for the overlapping domain of the two masks. The dataset used here is the 82146 dataset containing very low resolution images (52x52).


Thursday, September 1, 2022

First instance segmentation training and prediction with lightning flash

Making an annotated Dataset:

125 grey-scaled images of overlapping pairs of chromosomes were annotated with makesense.ai. Annotation was saved in a single json file in COCO format:

Each image has two instances of a single "chromosome" label.

Loading and training a maskrcnn model

Lightning-flash was used to load and train a mask-rcnn model over the dataset:


Possible issue with the dataset.

The dataset has two instances of the same kind labeled as chromosome. The prediction yields only one mask:



Thursday, October 14, 2021

Installation of lightning-flash

Having anaconda installed on a ubuntu 20.04 box:

Create a virtual environment, specifying the disk:

conda create --prefix /mnt/stockage/Developp/EnvPLFlash

and activate the env with:

conda activate /mnt/stockage/Developp/EnvPLFlash

Then install the libs  starting with pytorch with cuda support:

To have pytorch 1.8 with cuda support:

conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-lts

 then 

pip install icedata

pip install lightning-flash

pip install notebook

pip install voila

Without forgetting to install lightning-flash[image] to get the instance segmentation algorithms

pip install 'icevision' 'lightning-flash[image]'

The installation can be checked running the following notebook: