Deep Learning based Cell Segmentation
Project description
cytounet: Deep Learning Based Cell Segmentation
Background
This project was largely done as a summer 2020 intern in Dr. Mikael Bjorklund's
lab, whose guidance, resources, and time I am grateful for.
The aim was to automate a549 and rpe cancer cell segmentation and size determination.
Sample data(10 random images each of train, validate, test sets) is provided in original_data.
A complete a549 cancer cell segmentation notebook is also provided.
Finally, pre-trained weights are provided that can be used for transfer learning. These were trained on considerably more data and for more epochs. For more pre-trained weights and/or data, please contact the author.
Note
-
To generate masks(labels) provided here
a549
cancer cells were stained and imaged with fluorescence microscopy. These fluorescent images were then thresholded withthreshold_images
with a threshold value of 83. The images were then saved withsave_images
. The original fluorescent images are not provided here mainly due to the already huge size of the project. -
This project is not limited to cancer cells. The model can be trained on almost any object, living and non-living. More examples are given below.
Installation
From PyPI
:
pip install cytounet
From source or to use without installing locally:
git clone https://github.com/Nelson-Gon/cytounet.git
# proceed with usual source build procedure
Or:
pip install git+https://github.com/Nelson-Gon/cytounet.git
Import
from cytounet.model import *
from cytounet.data import *
from cytounet.augmentation import *
from cytounet.post_model import *
Detailed Sample Usage
Script mode
python -m cytounet -t "examples/original_data/a549/train" -i "images" -m "masks" -v
"examples/original_data/a549/validation" -l "1e-8" -s 512 -ep 5 -se 250 -b 8 -tt "examples/original_data/a549/test/"
-w "models/a549_test/test_model" -o "Adam" -mt "dice_coef" -ls "dice_coef_loss" -sd 2 -f 0 -p 0
To get help:
python -m cytounet -h
Notebooks
Please see the following examples:
Visually:
Sample Object Area Visualization(see the typical usage notebook above for detailed usage)
For more examples or to add your own, please see the examples folder.
Experiments/Benchmarks
This section shows some experimental results based on publicly available data.
- Comparison of low vs high quality masks on the model's output
This notebook shows the effects of "filled holes"(outlines whose area is filled with some colour e.g. white) on the model's quality. The results in general show that filled masks which are also better seen by the human eye result in better quality output.
The notebook can be accessed via this link.
TODO List
A checked box indicates support. You can either add more feature requests here or tackle unchecked boxes and make a pull request to add such support.
-
Single class segmentation
-
Grayscale images
-
Model Validation
-
Determining areas of objects in an image
-
Custom Number of Layers
-
Multi-class segmentation
-
Colored image input
-
COCO Datasets
-
CSV Based Annotations
-
XML Based Annotations
Frequently Asked Questions
Please read our Wiki Pages
To raise an issue or question
If the wiki does not answer your question, please raise a new issue. You can also open an issue if you have any discussion, criticism, or bug reports.
Thank you very much.
References
-
Mouse Embryos Dataset from Broad Bioimage Benchmark.
-
Red Blood Cell Images provided by Anne Carpenter and Roger Wiegand, available here.
Credits
- This repository started out as a clone of zhixuhao's original unet implementation.
This repository has considerably diverged from the original implementation hence the need to distribute it separately.
This decision was taken in part due to the relative inactivity of the original implementation which would have made it harder to collaborate. Please take a look at the list of changes from the original implementation.
- The Unet algorithm was introduced by Ronneberger et al. in their paper.
If you would like to cite this work, please use:
Nelson Gonzabato(2020) cytounet: Deep Learning Based Cell Segmentation, https://github.com/Nelson-Gon/cytounet
BibTex
@misc{Gonzabato2021,
author = {Gonzabato, N},
title = {cytounet: Deep Learning Based Cell Segmentation},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/Nelson-Gon/cytounet}},
commit = {58bd951ef4417fc8542f8f3e277071e6cd6980ea}
}
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
Built Distribution
File details
Details for the file cytounet-0.2.2.tar.gz
.
File metadata
- Download URL: cytounet-0.2.2.tar.gz
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb851e80d816780d1da45a3a199fa7d88c88096da205d73f4858fa5efe69b3a1 |
|
MD5 | 11514cccfd7b2b2196e6890956f89641 |
|
BLAKE2b-256 | d7cbf8dc8f0a4c5230a677a3be8a1775b5885fdf782ce7a05679574310282291 |
File details
Details for the file cytounet-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: cytounet-0.2.2-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc8b232c82313ff5df5e4fc6787b6fb2caa1f71b7a03a7e9d0ed58566a7536e5 |
|
MD5 | 0fac722bf010689e68edb4122c1a2834 |
|
BLAKE2b-256 | 10e681e9158af157c13aa7e21a860f7d638e8d384e7a4d48cba27f3a3d82e596 |