Generating Nuclei Segmentations for vEM datasets using Cellpose v1

E. Avetissian, Alyson Petruncio, Jeff L. Rhoades, Aubrey V. Weigel, CellMap Project Team2024

Abstract

This protocol details the process of generating nucleus segmentations in FIB-SEM (Focused Ion Beam Scanning Electron Microscopy) image stacks of cells and tissues using Cellpose. These segmentations are crucial for gaining biological insights and training deep learning models on cell and organelle segmentation. The protocol covers the application of Cellpose for fine-tuning 2D models specifically for nuclei segmentation. Once fine-tuned, the model is used to generate 3D predictions for the entire dataset. These segmentations can be further refined through manual approaches, utilized for visualization, or employed in training other machine learning models.

Introduction

Volume Electron Microscopy (vEM), particularly Focused Ion Beam Scanning Electron Microscopy (FIB-SEM), produces high-resolution 3D views of cells and tissues. However, these datasets are often terabytes in size, containing thousands of individual slices. Manually segmenting every nucleus in such a volume is a Herculean task that would take months of human labor. While generalist deep learning models like Cellpose have revolutionized image segmentation, they often require specific fine-tuning to handle the unique textures and contrasts of EM data compared to light microscopy. This paper addresses the practical challenge of how to efficiently train a model on a tiny fraction of a dataset to accurately predict the rest of the volume in 3D.

Methodology

The authors outline a hybrid workflow involving data management, iterative training, and volumetric inference:

Data Acquisition and Preprocessing

Using Fiji (ImageJ), researchers pull data from the cloud (S3 buckets via OpenOrganelle.org). The data is converted from high-dimensional formats (N5/Zarr) into local 2D TIFF slices for training and a 3D TIFF for final prediction.

Iterative Fine-Tuning and the "38-Slice" Rule

Instead of training from scratch, the protocol starts with a pre-existing model (cyto2_cp3). Users annotate a few slices, train a custom model, use that model to predict the next few slices, and correct the errors. This "human-in-the-loop" approach significantly speeds up the creation of ground-truth data. The authors found that approximately 38 high-quality annotated slices are often sufficient to create an adequate model for a specific volume. This moves the bottleneck from months of manual labor to a few days of focused work.

3D Prediction and Refinement

Once the 2D performance is satisfactory, the protocol utilizes the --Zstack flag in Cellpose v3.0.9. This allows the model to interpret the data as a continuous volume rather than independent slices, ensuring better consistency across the Z-axis. The final output is saved as a 3D mask which can be manually proofread or used to train even more complex machine learning models.

Results and Discussion

The protocol demonstrates its effectiveness using several high-resolution datasets curated by the Janelia CellMap Project Team, including mouse pancreas tissue (jrc_mus-pancreas-1), mouse kidney tissue (jrc_mus-kidney-2), and fruit fly mushroom body (jrc_fly-mb-z0419-20). These datasets represent a variety of biological textures and nuclear morphologies, proving the workflow's versatility.

3D visualization of segmented nuclei generated using the Cellpose workflow.

Key performance metrics include:

  • Efficiency: Training a custom model on the annotated slices typically takes less than 15 minutes.
  • Scalability: Once fine-tuned, the model can process an entire 3D volume (often tens of gigabytes) in roughly tens of minutes.
  • Accuracy: The protocol results in clean, separated nuclei across different tissue types, suitable for biological quantification.

Conclusion and Limitations

While the automation is powerful, the authors acknowledge that segmentations still require manual proofreading to "tidy up the edges" and correct mistaken predictions. Additionally, running Cellpose on large 3D volumes requires significant GPU resources. While optimized for nuclei, applying this to other organelles (like mitochondria or endoplasmic reticulum) may require different base models or more extensive training data due to higher structural complexity and lower contrast.

Summary updated

BibTeX
@misc{avetissian2024generating,
  author = {E. Avetissian and Alyson Petruncio and Jeff L. Rhoades and Aubrey V. Weigel and CellMap Project Team},
  title = {{Generating Nuclei Segmentations for vEM datasets using Cellpose v1}},
  year = {2024},
  doi = {10.17504/protocols.io.n2bvjnq8pgk5/v1},
}
Figure