Package: segmenter-model-zoo
segmenter_model_zooBatch processing script and functions for running deep learning based segmentation models released by Allen Institute for Cell Science.FeaturesReproducing deep learning based segmentation results in Allen Cell Data CollectionPulling models from Allen Cell quilt buckets automaticallySupporting both command line batch processing and python API callable in other functionsServing as a starting point for iterative deep learning on your own dataAdding more models continously when readySystem requirementMost of the models can run at any Linux or Windows machine with NVIDIA GPU properly
setup up. The only exception is the full version of cells and nuclei segmentation used
in Allen Cell Data Collection, which uses an object detection model that requires
compiling certain CUDA code in Linux. So the full version is only supported in Linux, but
we provide a simplified version without object detection that can run on both Windows and Linux, which will also be useful for most users. See more details in the list of models below.Note: If you are using Windows and see the an error likeerror: Microsoft Visual C++ 14.0 or greater is required. Get it with Microsoft C++ Build Tools, then juse follow the detailed intruction in the error message to download Microsoft Build Tools. The specific version we used isMSVC v142 - VS 2019 C++ x64/x86 build tools (v14.27)InstallationStep 1: Install PyTorch from official websiteSeeofficial instruction. We have tested on 1.3.1, 1.4.0, 1.6.0, 1.7.0 on CUDA 10.1 and CUDA 10.2Step 2: Install segmenter_model_zooInstall stable release and use as it:pip install segmenter_model_zooInstall nightly development head and make customization:gitclonegit@github.com:AllenCell/segmenter_model_zoo.gitcdsegmenter_model_zoo
pipinstall-e.[all]Step 3 (Optional): Install pytorch-fnet and cell-detector if you want to use the full version of cells and nuclei segmentation (for Linux only)Install pytorch-fnet for running label-free modelgitclonehttps://github.com/AllenCellModeling/pytorch_fnet.gitcdpytorch_fnet
gitcheckoutad_customization
pipinstall.Install cell-detectorgitclonessh://git@aicsbitbucket.corp.alleninstitute.org:7999/assay/cell_detector.gitcdcell_detector
pipinstall.cd./cell_detector/bin/apex
pythonsetup.pyinstall--cuda_ext--cpp_extcd..# assume you are under /cell_detector/cell_detector/binrm-rfbuild
pythonsetup.pybuilddevelopNote: Depending on your CUDA version and different generations of your GPU, you may need different pytorch version to make cell-detector working properly. We foundpytorch==1.3.1andtorchvision==0.4.2is a stable version for both CUDA 10.1 and CUDA 10.2 and working well for NVDIA titanx, titanxp, gtx1080, v100 GPUs. So, if you find installation failed on your current environment, you may switch topytorch==1.3.1andtorchvision==0.4.2.DocumentationIn general there two types of models: basic models and super models. Basic model is just a trained neural network. Super model can be multiple basic models + certain preprocesisng and post processing steps to generate the final output.Current basic models:[v] DNA_mask_production: from nuclei images (via DNA dye) to the semantic segmentation mask of DNA[v] DNA_seed_production: from nuclei images (via DNA dye) to genearate one seed per DNA[v] CellMask_edge_production: from cell membrane images (via CellMask dye) to semantic cell membrane segmentation[v] CAAX_production: from CAAX images to semantic CAAX segmentation[v] LMNB1_all_production: from lamin B1 images to the semanic lamin b1 segmentation[v] LMNB1_fill_production: from lamin B1 images to the mask of nuclei (filled shapes) except mitotic cells[v] LMNB1_seed_production: from lamin B1 images to generate one seed per nucleus[v] H2B_coarse: from H2B images to coarse H2B segmentation. NOTE: this is not the H2B segmentation provided in the
Allen Cell Data Collection. This is a coarse version, which can be roughly considered as equivelant to nuclear
segmentationCurrent super models:[v] DNA_MEM_instance_plus_LF: full version of cells and nuclei segmentaiton for images in Allen Cell Data Collection that
were acquired with old single camera pipeline[v] DNA_MEM_instance_plus_LF_two_camera: full version of cells and nuclei segmentaiton for images in Allen Cell Data Collection that
were acquired with current two-camera pipeline[v] DNA_MEM_instance_basic: simplified version of cells and nuclei segmentaiton applicable for all images in Allen Cell Data
Collection. Comparing to the full version, labelfree and cell pair correction were excluded for simplicity.[v] LMNB1_morphological_production_alpha: lamin B1 morphological segmentation for the lamib B1 cell line in Allen Cell Data
Collection. Comparing to basic semantic lamib B1 segmentation, the morphological segmentation refers that the lamin shells are fully closed
(i.e. topologically fillable in 3D)[v] structure_AAVS1_100x_hipsc: from CAAX images for final binary results of semantic CAAX segmentation[v] structure_H2B_100x_hipsc: from H2B images for final binary results of coarse H2B segmentationThere are a few auxillary models available as part of the full version of cells and nuclei segmentation[v] LF_DNA_mask: label-free model predicting DNA segmentation mask from bright field[v] LF_DNA_mask_two_camera: label-free model predicting DNA segmentation mask from bright field, but only for images acquired uisng two-camera pipeline (slightly different bright field images)[v] LF_mem_edge: label-free model predicting cell membrane segmentation from bright field[v] LF_mem_edge_two_camera: label-free model predicting cell membrane segmentation from bright field, but only for images acquired uisng two-camera pipeline (slightly different bright field images)[v] cell_pair_det_prod: a 2D object detection model to identify the pair of daughter cells during late mitosisNOTE: the terms used here, e.g. nuclei images, cell membrane images, two-camera pipeline and single camera pipeline, etc., omit more bioloigical and imaging details which could be important to the success of applying our models on images not from Allen Cell Data Collection. Please refer Allen Cell Data Collection for details (e.g., the imaging modality or the z step size could be important).To use these models:(1) You can prepare a yaml configuration file (see examplesHERE, just specify which super model to use and input/output path) and then runrun_model_zoo--config/path/to/your/config.yaml--debug(2) You can run basic models or super models using provided python API. See the demo jupyter notebooksHERE.For full package documentation please visitAllenCell.github.io/segmenter_model_zoo.DevelopmentSeeCONTRIBUTING.mdfor information related to developing the code.Questions?If you have any questions, feel free to leave a comment in our Allen Cell forum:https://forum.allencell.org/.Free software: Allen Institute Software License