Skip to content

CellSMB/MitoMimics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MitoMimics Logo

Synthetic Microscopy Timelapse Data Generation for Zero-Annotation AI Mitochondrial Segmentation and Tracking


MitoMimicsDemo.mp4

Introduction

MitoMimics is designed to simulate temporal mitochondrial dynamics-based microscopy data. MitoMimics employs a Python-based rendering pipeline to generate synthetic widefield microscopy datasets of mitochondrial dynamics events. Our algorithmic toolset provides researchers a means for testing and validating AI-based models, providing both ease of use and flexibility.

Timeline.2.mp4

Features

  • Simulates mitochondrial motility, fission, and fusion in 2D space.
  • Generates synthetic time-lapse microscopy data.
  • Generates synthetic instance masks along with a JSON file that registers instances between frames, which can be used to validate segmentation and/or tracking models.
  • Allows customization of simulation parameters, such as:
    • Mitochondrial Density
    • Mitochondrial Speed
    • Fission and Fusion Rates
    • Simulation Time Scale
    • Dimensions of the Simulation Space
  • Allows customization of microscopy parameters, such as:
    • Point Spread Function (2D Gaussian PSF)
    • Noise (Background Offset, Camera Readout Noise, Poisson Noise)

Installation

To install MitoMimics, follow these steps (tested on macOS Sequoia - Tahoe, and Ubunutu 20.04 - 22.04) (Install time 5-15 minutes):

  1. Clone the repository: git clone https://github.com/aidanpcquinn/mito_sim_pack.git
  2. Navigate to the project directory: cd MitoMimics/envs
  3. Install environment: conda env create -f environment.yml
  4. Activate the conda environment with conda activate mitodynamicsim

Using the Simulation

To use MitoMimics for dataset generation, follow these steps (Run time: <10 minutes per simulated image stack with default parameters):

  1. Navigate to the MitoMimicsGeneration folder and run the simulation script: python sim.py --seed 42
    • This generates the underlying simulation of the mitochondria morphology and dynamics
    • Parameters can be modified in parameters.yaml or with python parametes_gui.py
    • The files are saved in MitoMimicsGeneration/sim_output/42
    • batch scripts for running multiple jobs gen_multi_batch_sim.sh
  2. Run the rendering script with python renderer.py --seed 42 --gpu 0
    • This renders the simulation into the synthetic microscopy stacks
    • Parameters can be modified in parameters.yaml or with python parametes_gui.py
    • The files are saved in MitoMimicsGeneration/render_output/42
    • batch scripts for running multiple jobs gen_multi_batch_render.sh
    • Note: on CUDA accelerated systems the cupy library can be installed, the flag --cupy True may speed up rendering.
  3. To view the simulated data, run python sim_napari_viewer.py --loc render_output/42
    • The user can vary the timescale indefinitely by changing the save_data or sim_length_seconds variables.
image

Training With Simulated Data

To use MitoMimics for training on generated synthetic data, follow these steps (Run Time: 24 hours, on 4x NVIDIA H100s)

  1. Download a processed synthetic training dataset (Training_Data.tar.gz) from https://zenodo.org/uploads/19603477 REVIEWER TEMP LINK
  2. Install Umamba (https://github.com/bowang-lab/U-Mamba) and follow instructions for dataset preperation and training
    • We trained with nnUNetv2_train DATSET_ID 3d_fullres 0 -tr nnUNetTrainerUMambaEnc -num_gpus 4 and otherwise default parameters
  3. Note: you will need to process and train on a dataset for both fullmasks and centerlines
  4. To use your own tiff stacks, see 2_1_raw_to_intermediary_demo.ipynb and 2_2_intermediary_prepro.ipynb in /RealDataProcessing

Inference and Post Processing

  1. Download demo unlabaled photogentle sequences (Unlabelled_Photogentle_Sequences.tar.gz) from https://zenodo.org/uploads/19603477 REVIEWER TEMP LINK
  2. Run inference with both trained models on real dataset
    • nnUNetv2_predict -i raw_unlabaled_photogentle_sequences/ -o fullmask_out_location/ -d DATASET_ID_fullmask -c 3d_fullres -f 0 -tr nnUNetTrainerUMambaEnc --disable_tta
    • nnUNetv2_predict -i raw_unlabaled_photogentle_sequences/ -o centerline_out_location/ -d DATASET_ID_centerline -c 3d_fullres -f 0 -tr nnUNetTrainerUMambaEnc --disable_tta
  3. Run Post processing scripts 3_1 to 5_3 in /RealDataProcessing. Use python 3_1...py --help to view arguments
    • post processing needs the raw nifti stacks from step 1, and the outputs of both segmentation models in 2

Inference with pretrained model

  1. Download demo unlabaled photogentle sequences (Unlabelled_Photogentle_Sequences.tar.gz) from https://zenodo.org/uploads/19603477 REVIEWER TEMP LINK
  2. Download the trained model weights ('Trained_UMamba_Models.zip') from https://zenodo.org/uploads/19603477 REVIEWER TEMP LINK
  3. Place the unziped folders in your UMamba install at U-Mamba/data/nnUNet_results/
  4. Run inference with both trained models on real dataset
    • nnUNetv2_predict -i raw_unlabaled_photogentle_sequences/ -o fullmask_out_location/ -d 901 -c 3d_fullres -f 0 -tr nnUNetTrainerUMambaEnc --disable_tta
    • nnUNetv2_predict -i raw_unlabaled_photogentle_sequences/ -o centerline_out_location/ -d 902 -c 3d_fullres -f 0 -tr nnUNetTrainerUMambaEnc --disable_tta
  5. Run Post processing scripts 3_1 to 5_3 in /RealDataProcessing. Use python 3_1...py --help to view arguments
    • post processing needs the raw nifti stacks from step 1, and the outputs of both segmentation models in 2

Citation

License

MitoMimics © 2026 by Aidan Quinn, Volkan Ozcoban & Vijay Rajagopal is licensed under GPL-3.0

Contact

For any questions, feedback, or potential collaborations, please contact the original authors of MitoMimics:

Please include “MitoMimics” in the subject line when contacting us.

CellSMB lab

See more from our lab at our github: https://github.com/CellSMB

About

MitoMimics - Microscopy Data Generation Tuning for Deep Learning Tracking and Segmentation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors