Skip to main content

A Deep learning pipeline for segmentation of fluorescent labels in microscopy images

Project description

Title

deepflash2

Official repository of deepflash2 - a deep-learning pipeline for segmentation of ambiguous microscopic images.

CI PyPI PyPI - Downloads Conda (channel only) Build fastai images GitHub stars GitHub forks


The best of two worlds: Combining state-of-the-art deep learning with a barrier free environment for life science researchers.

Read the paper, watch the tutorials, or read the docs.

  • No coding skills required (graphical user interface)
  • Ground truth estimation from the annotations of multiple experts for model training and validation
  • Quality assurance and out-of-distribution detection for reliable prediction on new data
  • Best-in-class performance for semantic and instance segmentation

Kaggle Gold Medal and Innovation Price Winner: The deepflash2 Python API built the foundation for winning the Innovation Award a Kaggle Gold Medal in the HuBMAP - Hacking the Kidney challenge. Have a look at our solution

Quick Start and Demo

Get started in less than a minute. Watch the tutorials for help. For a quick start, run deepflash2 in Google Colaboratory with free access to graphics processing units (GPUs).

Colab

To try the functionalities of deepflash2, open the deepflash2 GUI in [Colab]((https://colab.research.google.com/github/matjesg/deepflash2/blob/master/deepflash2_GUI.ipynb) or follow the installation instructions below. The GUI provides a build-in use for sample data. After starting the GUI, select the task (GT Estimation, Training, or Prediction) and click Load Sample Data. For futher instructions watch the tutorials.

We provide an overview of the tasks below:

Ground Truth (GT) Estimation Training Prediction
Main Task STAPLE or Majority Voting Ensemble training and validation Semantic and instance segmentation
Sample Data 5 masks from 5 experts each 5 image/mask pairs 5 images and 2 trained models
Expected Output 5 GT Segmentation Masks 5 models 5 predicted segmentation masks (semantic and instance) and uncertainty maps
Estimated Time ~ 1 min ~ 150 min ~ 4 min

Times are estimated for Google Colab (with free NVIDIA Tesla K80 GPU). You can download the sample data here.

Paper and Experiments

We provide a complete guide to reproduce our experiments using the deepflash2 Python API here. The data is currently available on Google Drive.

The preprint of our paper is available on arXiv. Please cite

@misc{griebel2021deepflash2,
    title={Deep-learning in the bioimaging wild: Handling ambiguous data with deepflash2}, 
    author={Matthias Griebel and Dennis Segebarth and Nikolai Stein and Nina Schukraft and Philip Tovote and Robert Blum and Christoph M. Flath},
    year={2021},
    eprint={2111.06693},
    archivePrefix={arXiv}
}

System requirements

Works in the browser an on your local pc/server

deepflash2 is designed to run on Windows, Linux, or Mac (x86-64) if pytorch is installable. We generally recommend using Google Colab as it only requires a Google Account and a device with a web browser. To run deepflash2 locally, we recommend using a system with a GPU (e.g., 2 CPUs, NVIDIA Tesla K80 GPU or better).

Software dependencies are defined in the settings.ini file. Additionally, the ground truth estimation functionalities are based on the simpleITK>=2.0 and the instance segmentation capabilities are complemented using cellpose with commit hash 316927eff7ad2201391957909a2114c68baee309.

deepflash2 is tested on Google Colab (Ubuntu 18.04.5 LTS) and locally (Ubuntu 20.04 LTS, Windows 10 (tbd), MacOS 12.0.1 (tbd)).

Installation Guide

Typical install time is about 1-5 minutes, depending on your internet connection

The GUI of deepflash2 runs as a web application inside a Jupyter Notebook, the de-facto standard of computational notebooks in the scientific community. The GUI is built on top of the deepflash2 Python API, which can be used independently (read the docs).

Google Colab

Excute the Set up environment cell or follow the pip instructions.

Colab

Other systems

conda

We recommend installation into a new, clean environment.

conda install -c conda-forge -c fastchan -c matjesg deepflash2 
pip

You should install PyTorch first by following the installation instructions of pytorch.

pip install deepflash2

If you want to use the GUI, make sure to download the GUI notebook and start a Jupyter server.

curl -o deepflash2_GUI.ipynb https://raw.githubusercontent.com/matjesg/deepflash2/master/deepflash2_GUI.ipynb
jupyter notebook

Then, open deepflash2_GUI.ipynb within Notebook environment.

Docker

Docker images for deepflash2 are built on top of the latest pytorch image.

  • CPU only

docker run -p 8888:8888 matjes/deepflash2 ./run_jupyter.sh

  • For training, we recommend to run docker with GPU support (You need to install Nvidia-Docker to enable gpu compatibility with these containers.)

docker run --gpus all --shm-size=256m -p 8888:8888 matjes/deepflash2 ./run_jupyter.sh

All docker containers are configured to start a jupyter server. To add data, we recomment using bind mounts with /workspace as target. To start the GUI, open deepflash2_GUI.ipynb within Notebook environment.

For more information on how to run docker see docker orientation and setup.

Creating segmentation masks with Fiji/ImageJ

If you don't have labelled training data available, you can use this instruction manual for creating segmentation maps. The ImagJ-Macro is available here.

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

deepflash2-0.1.6.tar.gz (56.7 kB view details)

Uploaded Source

Built Distribution

deepflash2-0.1.6-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file deepflash2-0.1.6.tar.gz.

File metadata

  • Download URL: deepflash2-0.1.6.tar.gz
  • Upload date:
  • Size: 56.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.12

File hashes

Hashes for deepflash2-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7ea9e614d539e074681f205145e64048eecd59128931b4168cfefa1d8f2600cc
MD5 089bad07bf78921690faa36ade0b10bc
BLAKE2b-256 a2ba72fd56d0985b3a590a140b18347435c3cd46811c70078f20e2cbf2baab91

See more details on using hashes here.

File details

Details for the file deepflash2-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: deepflash2-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 65.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.12

File hashes

Hashes for deepflash2-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9041b94ad863c53c93750a4f813de1518a5e8e57e7cb0a8bf97aff5ce0240419
MD5 98681ea0891c8f24493f51c7d28a834e
BLAKE2b-256 ce5e8b1f47048f802910db522c1a14cf7bfa88cad93d4951c34490ea6e4a516a

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