Package: cyto-dl
CytoDLDescriptionAs part of theAllen Institute for Cell Science'smission to understand the principles by which human induced pluripotent stem cells establish and maintain robust dynamic localization of cellular structure,CytoDLaims to unify deep learning approaches for understanding 2D and 3D biological data as images, point clouds, and tabular data.The bulk ofCytoDL's underlying structure bases thelightning-hydra-templateorganization - we highly recommend that you familiarize yourself with their (short) docs for detailed instructions on running training, overrides, etc.Our currently available code is roughly split into two domains: image-to-image transformations and representation learning. The image-to-image code (denoted im2im) contains configuration files detailing how to train and predict using models for resolution enhancement using conditional GANs (e.g. predicting 100x images from 20x images), semantic and instance segmentation, and label-free prediction. We also provide configs for Masked Autoencoder (MAE) pretraining using a Vision Transformer (ViT) backbone (currently only supported for 3D images) and for training segmentation decoders from these pretrained features. Representation learning code includes a wide variety of Variational Auto Encoder (VAE) architectures. Due to dependency issues, equivariant autoencoders are not currently supported on Windows.As we rely on recent versions of pytorch, users wishing to train and run models on GPU hardware will need up-to-date NVIDIA drivers. Users with older GPUs should not expect code to work out of the box. Similarly, we do not currently support training/predicting on Mac GPUs. In most cases, cpu-based training should work when GPU training fails.For im2im models, we provide a handful of example 3D images for training the basic image-to-image tranformation-type models and default model configuration files for users to become comfortable with the framework and prepare them for training and applying these models on their own data. Note that these default models are very small and train on heavily downsampled data in order to make tests run efficiently - for best performance, the model size should be increased and downsampling removed from the data configuration.How to runInstall dependencies. Dependencies are platform specific, please replacePLATFORMwith your platform - eitherlinux,windows, ormac# clone projectgitclonehttps://github.com/AllenCellModeling/cyto-dlcdcyto-dl# [OPTIONAL] create conda environmentcondacreate-nmyenvpython=3.9
condaactivatemyenv

pipinstall-rrequirements/PLATFORM/requirements.txt# [OPTIONAL] install extra dependencies - equivariance relatedpipinstall-rrequirements/PLATFORM/equiv-requirements.txt

pipinstall-e.#[OPTIONAL] if you want to use default experiments on example datapythonscripts/download_test_data.pyAPIfromcyto_dl.apiimportCytoDLModelmodel=CytoDLModel()model.download_example_data()model.load_default_experiment("segmentation",output_dir="./output",overrides=["trainer=cpu"])model.print_config()model.train()# [OPTIONAL] async trainingawaitmodel.train(run_async=True)Train model with chosen experiment configuration fromconfigs/experiment/#gpupythoncyto_dl/train.pyexperiment=im2im/experiment_name.yamltrainer=gpu#cpupythoncyto_dl/train.pyexperiment=im2im/experiment_name.yamltrainer=cpuYou can override any parameter from command line like thispythoncyto_dl/train.pytrainer.max_epochs=20datamodule.batch_size=64