Skip to main content

cell segmentation algorithm improving on the Cellpose framework

Project description

bacteria omnipose

Why use Omnipose

Omnipose solves the over-segmentation problems of Cellpose on large, ansiotropic cells. This is particularly relevant for bacterial cells, but Omnipose is suitable for aribtrary cell shapes.

How to use Omnipose

To use Omnipose on bacterial cells, use model_type=bact_omni. For other cell types, try model_type=cyto2_omni. You can also use your own Cellpose models with omni=True to use the Omnipose mask reconstruction algorithm to alleviate over-segmentation.

We trained our bact_omni model using the following command, and you can train custom Omnipose models similarly:

python -m cellpose --train --use_gpu --dir <bacterial dataset directory> --mask_filter _masks --n_epochs 4000 --pretrained_model None --learning_rate 0.1 --diameter 0 --batch_size 16 --omni

Notably, while we found that while Cellpose does not benefit much from more than 500 epochs, Omnipose continues to improve until around 4000 epochs. Omnipose outperforms Cellpose at 500 epochs but is significantly better at 4000. You can use --save_every <n> and save_each to store intermediate model training states to explore this behavior.

More about Omnipose

Omnipose builds on Cellpose in a number of ways described in our paper. It turns out that cell 'centers' are not well-defined, and this is a huge problem for any cells that are long and curved - generally leading to over-segmentation.

To fix this, we turned to the distance field (also known as the distance transform). This morphology-independent field replaces the uniform cell probability field of Cellpose, and its gradient replaces the heat-derived flow field of Cellpose.

The distance field works the same way as cell probability output, meaning it can be thresholded (with the same values!) to seed cell masks. However, it carries a lot more information and we use it to refine the mask recontruction parameters when cells get too thin.

The flow field points towards the skeleton of the cell, and we built a new mask recontruction algorithm to leverage this fact. While cellpose tends to over-segement long cells, Omnipose can segment cells of any morphology whatsoever.

Omnipose has a fourth ouput class (as opposed to three in Cellpose). This extra output is a boundary probability field, which we found helped the network to make better predictions at cell boundaries. It is also useful in mask recontruction.

Licensing

See LICENSE.txt for details. This license does not affect anyone using Cellpose/Omnipose for noncommerical applications.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omnipose-0.1.1.tar.gz (29.8 MB view details)

Uploaded Source

Built Distribution

omnipose-0.1.1-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file omnipose-0.1.1.tar.gz.

File metadata

  • Download URL: omnipose-0.1.1.tar.gz
  • Upload date:
  • Size: 29.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for omnipose-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ca727627ee14333967a8bf74493a5dfd2209d7f2f0e8bf4325f1b0fe6c79e4dc
MD5 2e1ba6d74b2803758e103141da12f9a2
BLAKE2b-256 1c9f0468383166fe951f2d9aa330aa0570b888b5caad6acb7cbc4f6a2db5c98a

See more details on using hashes here.

File details

Details for the file omnipose-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: omnipose-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.1

File hashes

Hashes for omnipose-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 34b3c2df27224d5b6fd7922cdbedb7918a08d6de9b82bdcf9b9a94683e4c897b
MD5 12b3b037c255a0be112c4168cdebce15
BLAKE2b-256 67b2c7cfb977041aa95e45e72426d1c45d7d3e338a96d0a84ad2df68c0568de5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page