symbac

Accurate segmentation of bacterial microscope images using deep learning synthetically generated image data.

https://github.com/georgeoshardo/symbac

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: plos.org
  • Committers with academic emails
    2 of 7 committers (28.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords

biology deep-learning image-processing machine-learning microscopy segmentation synthetic-biology synthetic-data synthetic-dataset-generation
Last synced: 6 months ago · JSON representation ·

Repository

Accurate segmentation of bacterial microscope images using deep learning synthetically generated image data.

Basic Info
Statistics
  • Stars: 21
  • Watchers: 2
  • Forks: 10
  • Open Issues: 12
  • Releases: 0
Topics
biology deep-learning image-processing machine-learning microscopy segmentation synthetic-biology synthetic-data synthetic-dataset-generation
Created about 5 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License Citation

README.md

SyMBac: Synthetic Micrographs of Bacteria

Update 2025 Please see the SyMBac_2 repo. There is currently a big update coming which will feature lineage tracking ability, full texture generation within cells, spatial fluorescence (membrane, nucleoid, ribosome, etc), and more advanced image simulation models, and BENDY cells! It will also (hopefully) bring about full modularity of SyMBac so you can plug in individual parts of the pipeline to your own workflows.

Read the paper: Synthetic Micrographs of Bacteria (SyMBac) allows accurate segmentation of bacterial cells using deep neural networks , Georgeos Hardo, Maximillian Noka, Somenath Bakshi

Read the docs

New! Try the Colab version Open In Colab

What is it?

SyMBac is a tool to generate synthetic phase contrast or fluorescence images of bacteria. Currently the tool only supports bacteria growing in the mother machine, however support for bacteria growing in monolayers (and maybe even biofilms!) is coming.

comparisons

Why would I want to generate synthetic images?

Because you're sick of generating your own training data by hand! Synthetic images provide an instant source of high quality and unlimited training data for machine learning image segmentation algorithms!

The images are tuned to perfectly replicate your experimental setup, no matter what your microscope's objective is (we have tested 20x air all the way to 100x oil), no matter your imaging modality (phase contrast/fluorescence), and no matter the geometry of your microfluidic device.

Additionally,

  • SyMBac is very fast compared to humans:

comparisons

  • The image generation process uses a rigid body physics model to simulate bacterial growth, 3D cell geometry to calculate the light's optical path, and a model of the phase contrast/fluorescence optics (point spread function), with some post-rendering optimisation to match image similarity:

comparisons

How do I use these synthetic images?

That is up to you. SyMBac is not a machine learning tool. It is a tool to generate unlimited free training data which accurately represents your experiment. It is up to you to train a machine learning network on these synthetic images. We do however provide example notebooks for how to train a U-net (as implemented by DeLTA).

comparisons

Prerequisites

Please make sure you have an NVIDIA GPU and a working installation of CUDA and cudNN. If you don't have an NVIDIA GPU then the convolution will default to the CPU, and be very slow.

SyMBac is meant to be run interactively (in a notebook + with a small Qt/GTK intWWerface), so make sure that you are running this on a local machine (you should have access to the machine's display).

Installation

sh pip install SyMBac

Or to install the development version, run:

sh pip install git+https://github.com/georgeoshardo/SyMBac

Activate the Jupyter widgets extension. This is needed to interact with slides in the notebooks to optimise images.

sh jupyter nbextension enable --py widgetsnbextension

If you're using a GPU:

Check the version of CUDA you have installed using nvcc --version and install the appropriate version of cupy. For example, if you have CUDA 11.4 you would install as follows:

sh pip install cupy-cuda114

If you installed CUDA on Ubuntu 18.04+ using the new Nvidia supplied repositories, it is a real possibility that nvcc won't work. You need to run nvcc from the binary folder of where your cuda installation is.

If you aren't using a GPU:

See FAQs "Do I need to have a GPU?"

Usage

Read the docs

FAQs

  • Do I need to have a GPU?
    • No, although image synthesis will be around 40x slower on the CPU. SyMBac will detect that you do not have CuPy installed and default to using CPU convolution.
    • Interactive image optimisation will be very painful on the CPU. By default I turn off slider interactivity if you are using the CPU, so that you can move a slider without the CPU being maxed out. This means that every time you move a slider you must click the button to update the image (do a convolution).
  • Can I generate fluorescence images as well?
    • Yes, you can do fluorescence image generation, just make sure that in the interactive image generation part of the code, you select fluorescence.
    • Since our fluorescence kernel is defined to be a subset of the phase contrast kernel, you can choose any condenser, and your fluorescence kernel should be correct. Just ensure that the imaging wavelength, numerical aperture, refractive index, and pixel size are set correctly.
  • What format do my images need to be in?
    • The real images you are trying to replicate should be in the format of single-trench timeseries images. If you are unsure what this is, you can call get_sample_images()["E. coli 100x"] from SyMBac.miscfor an example image.
  • I'm getting libGL MESA-LOADER errors
    • See https://unix.stackexchange.com/questions/655495/trying-to-run-pygame-on-my-conda-environment-on-my-fresh-manjaro-install-and-ge
  • I'm getting ContextException: Could not create GL context when trying to visualise my simulation in real time
    • Try conda install -c conda-forge libstdcxx-ng, and if you're on Ubuntu/Debian sudo apt install libgl1-mesa-dri

Owner

  • Name: Georgeos Hardo
  • Login: georgeoshardo
  • Kind: user
  • Location: Cambridge
  • Company: University of Cambridge

Systems biology PhD student

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Hardo
    given-names: Georgeos
    orcid: https://orcid.org/my-orcid?orcid=0000-0003-0037-1293
title: "SyMBac"
version: 0.2.0
date-released: 2022-10-31
url: https://github.com/georgeoshardo/SyMBac

GitHub Events

Total
  • Issues event: 2
  • Watch event: 2
  • Issue comment event: 10
  • Push event: 29
  • Pull request event: 2
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 2
  • Watch event: 2
  • Issue comment event: 10
  • Push event: 29
  • Pull request event: 2
  • Fork event: 2
  • Create event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 314
  • Total Committers: 7
  • Avg Commits per committer: 44.857
  • Development Distribution Score (DDS): 0.143
Past Year
  • Commits: 18
  • Committers: 3
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.222
Top Committers
Name Email Commits
Georgeos Hardo g****o@p****m 269
georgeoshardo g****o@g****m 29
erezli 6****i 8
Georgeos Hardo g****4@c****k 5
Daoxin Zhong d****g@h****k 1
Charlie Wedd 5****3 1
LGTM Migrator l****r 1
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 38 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 13
  • Total maintainers: 1
pypi.org: symbac

A package for generating synthetic images of bactera in phase contrast or fluorescence. Used for creating training data for machine learning segmentation and tracking algorithms.

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 38 Last month
Rankings
Dependent packages count: 10.1%
Forks count: 11.9%
Stargazers count: 14.2%
Average: 18.7%
Dependent repos count: 21.6%
Downloads: 35.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

docs/source/requirements.txt pypi
  • matplotlib *
  • sphinx_automodapi *
setup.py pypi
  • elasticdeform ==0.4.9
  • ipywidgets *
  • joblib *
  • jupyterlab *
  • matplotlib ==3.4.3
  • napari *
  • natsort ==7.1.1
  • pandas ==1.3.4
  • scikit-image ==0.18.3
  • tensorflow ==2.8.0
  • tifffile ==2021.10.12
  • tqdm *
.github/workflows/codeql.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite