Cellstitch: 3D cellular anisotropic image segmentation via optimal transport

Yining Liu, Yinuo Jin, Elham Azizi, Andrew J. Blumberg · DOI

Abstract

Spatial mapping of transcriptional states provides valuable biological insights into cellular functions and interactions. Accurate 3D cell segmentation is critical for understanding diseases and development in situ. However, existing methods struggle with inaccurate segmentations along non-stitching dimensions, lack of 3D training data, and image anisotropy. We present CellStitch, a novel pipeline that formulates cell correspondence across layers as an optimal transport (OT) problem. CellStitch segments 3D images without requiring extensive 3D training data and includes an interpolation module to recover isotropic morphology from highly anisotropic images. Evaluated on eight 3D plant microscopic datasets, CellStitch significantly outperforms state-of-the-art methods on anisotropic images while maintaining competitive performance in isotropic settings.

Introduction: The Challenge of 3D Segmentation

In developmental biology and spatial transcriptomics, 3D segmentation—identifying individual cell boundaries within a volume—is essential but difficult. The authors identify three primary roadblocks:

  1. Data Scarcity: High-quality, manually labeled 3D training data is rare and expensive.
  2. Anisotropy: Microscopes often have higher resolution in the horizontal plane ($X, Y$) than in vertical depth ($Z$), creating a "stretching" effect that confuses standard 3D neural networks.
  3. Stacking Ambiguity: Traditional "stitching" methods often merge distinct cells positioned vertically, leading to under-segmentation.

Methods: Optimal Transport for Cell Stitching

CellStitch addresses these challenges by treating 3D segmentation as a series of 2D problems followed by a mathematically rigorous stitching phase.

The CellStitch pipeline: (a) 2D segmentation and stitching, (b) Optimal Transport matching between layers, and (c) boundary matching and interpolation.

2D Backbone and OT Stitching

The pipeline first utilizes mature 2D models (e.g., Cellpose) to segment horizontal slices. To link these masks across layers, CellStitch employs Optimal Transport (OT). Rather than matching cell centers, it treats each cell's pixels as a distribution of mass.

Mathematical definition of the probability distributions $P(x)$ and $P'(y)$ used for OT matching between layers $z$ and $z+1$.

IoU Cost Matrix and Voting

Unlike traditional OT using Euclidean distance, CellStitch uses a cost matrix based on Intersection-over-Union (IoU), making matching sensitive to shape and overlap. To prevent accidental merging of vertically stacked cells, a voting scheme incorporates 2D segmentations from side views ($XZ$ and $YZ$ planes).

Wasserstein Interpolation

For low-resolution $Z$-stacks, an interpolation module uses OT to "hallucinate" missing internal slices, recovering smooth, isotropic cell shapes.

Results and Discussion

CellStitch was evaluated on eight Arabidopsis thaliana datasets, including Ovules (high anisotropy) and the 3D Digital Tissue Atlas (diverse organs).

  • Superiority in Anisotropy: On the Ovules dataset, CellStitch achieved an Average Precision (AP) of 0.41, significantly outperforming Cellpose3D (0.15) and PlantSeg (0.12).
  • Robustness: While Cellpose3D excels on perfectly isotropic data, its performance drops sharply with anisotropy. CellStitch remains stable, becoming the top performer as $Z$-resolution decreases.
  • Generalization: Across diverse organs (Anther, Leaf, Sepal, etc.), CellStitch consistently provided the highest precision and recall.

Conclusion

CellStitch demonstrates that leveraging mature 2D segmentation models with a sophisticated OT-based integration strategy can overcome the limitations of data-hungry 3D networks. By treating anisotropy as a feature to be modeled rather than a bug, it provides high-fidelity recovery of 3D cell morphology from microscopic images.

Summary updated

BibTeX
@article{liu2023cellstitch,
  author = {Yining Liu and Yinuo Jin and Elham Azizi and Andrew J. Blumberg},
  title = {{Cellstitch: 3D cellular anisotropic image segmentation via optimal transport}},
  journal = {BMC Bioinformatics},
  year = {2023},
  doi = {10.1186/s12859-023-05608-2},
}
Figure