DaCapo: a modular deep learning framework for scalable 3D image segmentation

William Patton, Jeff L. Rhoades, Marwan Zouinkhi, David G. Ackerman, Caroline Malin-Mayor, Diane Adjavon, Larissa Heinrich, Davis Bennett, Yurii Zubov, CellMap Project Team, Aubrey V. Weigel, Jan FunkearXiv 2024 · DOI

Introduction

Modern volume electron microscopy (vEM), such as Focused Ion Beam Scanning Electron Microscopy (FIB-SEM), generates near-isotropic 3D images of biological structures at unprecedented scales. As researchers move from megabyte-sized samples to terabyte and petabyte-scale "teravoxel" volumes, standard deep learning tools face significant challenges. These include the inability of 2D-centric architectures to capture 3D context, memory constraints leading to edge artifacts during chunked processing, and the immense infrastructure complexity required to scale from local workstations to distributed cloud environments.

DaCapo is an open-source, modular framework designed to address these bottlenecks, bridging the gap between model development and massive-scale deployment.

The DaCapo Framework

DaCapo (Italian for "from the beginning") is built on a modular philosophy where data, training configurations, model architectures, and tasks are decoupled. This separation allows researchers to experiment with different components independently, facilitating rapid iteration and scalability.

Overview of the DaCapo framework, detailing the training and application modules.

Modular Components

As shown in the figure above, the framework is divided into two primary phases:

  • DaCapo Train: This phase handles data splitting (training/validation), data augmentation via Gunpowder, model architecture selection (e.g., Attention UNET, Cellpose UNET), and task definition (e.g., LSDs, semantic segmentation).
  • DaCapo Apply: This phase focuses on inference and post-processing. It utilizes blockwise processing to handle massive datasets and integrates with tools like Empanada for specific biological structures.

Core Methodologies

Blockwise Processing and Scalability

Using the Daisy library, DaCapo processes data in overlapping blocks. This approach allows the framework to distribute computation across massive clusters while seamlessly stitching results back together, effectively eliminating edge artifacts that often plague chunked 3D processing.

Task Versatility

The framework supports a wide array of segmentation strategies. Users can switch between semantic segmentation, boundary distances, and advanced instance segmentation targets like Local Shape Descriptors (LSDs) or pixel-wise affinities with minimal code changes.

Automated Parameter Sweeps

To optimize performance, DaCapo automatically runs "parameter sweeps" on validation data during training. This process tests various post-processing thresholds to identify optimal settings without manual trial and error.

Infrastructure Abstraction

DaCapo supports "Compute Contexts," enabling the same code to run seamlessly across local machines, LSF-managed clusters, or cloud environments like AWS. It natively supports cloud-native storage protocols such as S3 and Google Storage, as well as chunked file formats like Zarr and N5.

Key Insights and Results

  • Modularity as a Catalyst: By separating the Task from the Model, researchers can adopt state-of-the-art prediction targets without rewriting entire pipelines.
  • Starter Models: DaCapo encourages the use of pretrained 3D UNets (e.g., from the COSEM Project) as backbones, significantly accelerating the time-to-insight for new biological samples.
  • Seamless Integration: The framework integrates established tools like Gunpowder for augmentation and Cellpose for specialized architectures, creating a unified ecosystem for vEM analysis.

Limitations and Future Directions

While DaCapo provides a robust foundation for scalable segmentation, the authors identify several areas for improvement. Current efforts are focused on enhancing the user interface for non-programmers and removing technical limits on the number of unique object IDs for instance segmentation. Additionally, the team plans to expand the "Model Zoo" to include a broader range of biological structures and imaging modalities.

Availability: The codebase is open-source and available on GitHub at github.com/janelia-cellmap/dacapo.

Summary updated

BibTeX
@misc{patton2024dacapo,
  author = {William Patton and Jeff L. Rhoades and Marwan Zouinkhi and David G. Ackerman and Caroline Malin-Mayor and Diane Adjavon and Larissa Heinrich and Davis Bennett and Yurii Zubov and CellMap Project Team and Aubrey V. Weigel and Jan Funke},
  title = {{DaCapo: a modular deep learning framework for scalable 3D image segmentation}},
  year = {2024},
  eprint = {2408.02834},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.02834},
}
Figure