Package: deepflash2
Welcome toOfficial repository of deepflash2 - a deep-learning pipeline for segmentation of ambiguous microscopic images.The best of two worlds:Combining state-of-the-art deep learning with a barrier free environment for life science researchers.Read thepaper, watch thetutorials, or read thedocs.No coding skills required(graphical user interface)Ground truth estimationfrom the annotations of multiple experts for model training and validationQuality assurance and out-of-distribution detectionfor reliable prediction on new dataBest-in-class performancefor semantic and instance segmentationKaggle Gold Medal and Innovation Price Winner:Thedeepflash2Python API built the foundation for winning theInnovation Awarda Kaggle Gold Medal in theHuBMAP - Hacking the Kidneychallenge.
Have a look at oursolutionQuick Start and DemoGet started in less than a minute. Watch thetutorialsfor help.Demo on Hugging Face SpacesGo to thedemo space-- inference only (no training possible).Demo usage with Google ColabFor a quick start, rundeepflash2in Google Colaboratory (Google account required).The GUI provides a build-in use for oursample data.Starting the GUI (inColabor follow the installation instructions below)Select the task (GT Estimation, Training, or Prediction)Click theLoad Sample Databutton in the sidebar and continue to the next sidebar section.For futher instructions watch thetutorials.We provide an overview of the tasks below:Ground Truth (GT) EstimationTrainingPredictionMain TaskSTAPLE or Majority VotingEnsemble training  and validationSemantic and instance segmentationSample Data5 masks from 5 experts each5 image/mask pairs5 images and 2 trained modelsExpected Output5 GT Segmentation Masks5 models5 predicted segmentation masks  (semantic and instance) and uncertainty mapsEstimated Time~ 1 min~ 150 min~ 4 minTimes are estimated for Google Colab (with free NVIDIA Tesla K80 GPU).Paper and ExperimentsWe provide a complete guide to reproduce our experiments using thedeepflash2 Python APIhere. The data is currently available onGoogle DriveandZenodo.Our Nature Communications article is availablehere. Please cite@article{Griebel2023,
  doi = {10.1038/s41467-023-36960-9},
  url = {https://doi.org/10.1038/s41467-023-36960-9},
  year = {2023},
  month = mar,
  publisher = {Springer Science and Business Media {LLC}},
  volume = {14},
  number = {1},
  author = {Matthias Griebel and Dennis Segebarth and Nikolai Stein and Nina Schukraft and Philip Tovote and Robert Blum and Christoph M. Flath},
  title = {Deep learning-enabled segmentation of ambiguous bioimages with deepflash2},
  journal = {Nature Communications}
}System requirementsWorks in the browser or on your local pc/serverdeepflash2is designed to run on Windows, Linux, or Mac (x86-64) ifpytorchis installable.
We generally recommend using Google Colab as it only requires a Google Account and a device with a web browser.
To rundeepflash2locally, we recommend using a system with a GPU (e.g., 2 CPUs, 8 GB RAM, NVIDIA GPU with 8GB VRAM or better).deepflash2requires Python>3.6 and the software dependencies are defined in thesettings.inifile. Additionally, the ground truth estimation functionalities are based on simpleITK>=2.0 and the instance segmentation capabilities are complemented using cellpose v0.6.6.dev13+g316927e.deepflash2is tested on Google Colab (Ubuntu 18.04.5 LTS) and locally (Ubuntu 20.04 LTS, Windows 10, MacOS 12.0.1).Installation GuideTypical install time is about 1-5 minutes, depending on your internet connectionThe GUI ofdeepflash2runs 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 thedeepflash2Python API, which can be used independently (read thedocs).Google ColabOpenColaband excute theSet up environmentcell or follow thepipinstructions. Colab provides free access to graphics processing units (GPUs) for fast model training and prediction (Google account required).Other systemsWe recommend installation into a clean Python 3.7, 3.8, or 3.9 environment (e.g., usingconda).mamba/condaInstallation with mamba (installatoninstructions) allows a fast and realiable installation process (you can replacemambawithcondaand add the--update-allflag to do the installation with conda).mambainstall-cfastchan-cconda-forge-cmatjesgdeepflash2pipIf you want to use your GPU and install with pip, we recommend installing PyTorch first by following theinstallation instructions.pipinstall-Udeepflash2Using the GUIIf you want to use the GUI, make sure to download the GUI notebook, e.g., usingcurlcurl-odeepflash2_GUI.ipynbhttps://raw.githubusercontent.com/matjesg/deepflash2/master/deepflash2_GUI.ipynband start a Jupyter server.jupyternotebookThen, opendeepflash2_GUI.ipynbwithin Notebook environment.DockerDocker images fordeepflash2are built on top ofthe latest pytorch image.CPU onlydocker run -p 8888:8888 matjes/deepflash2 ./run_jupyter.shFor training, we recommend to run docker with GPU support (You need to installNvidia-Dockerto enable gpu compatibility with these containers.)docker run --gpus all --shm-size=256m -p 8888:8888 matjes/deepflash2 ./run_jupyter.shAll docker containers are configured to start a jupyter server. To add data, we recomment usingbind mountswith/workspaceas target. To start the GUI, opendeepflash2_GUI.ipynbwithin Notebook environment.For more information on how to run docker seedocker orientation and setup.Creating segmentation masks with Fiji/ImageJIf you don't have labelled training data available, you can use thisinstruction manualfor creating segmentation maps.
The ImagJ-Macro is availablehere.