Research
cubic: CUDA-accelerated 3D Bioimage Computing
cubic: CUDA-accelerated 3D Bioimage Computing Overview Research area: Computational bioimage analysis / computer vision for microscopy, specifically GPU-accelerated image processing for multidimension

- arXiv
- 2510.14143
- Published
- 2025-10-15
- Authors
- Alexandr A. Kalinin, Anne E. Carpenter, Shantanu Singh, Matthew J. O'Meara
AI summary
cubic: CUDA-accelerated 3D Bioimage ComputingOverview
Research area: Computational bioimage analysis / computer vision for microscopy, specifically GPU-accelerated image processing for multidimensional biological images.
Technical level: Intermediate. The paper is written for readers comfortable with Python scientific computing (NumPy, SciPy, scikit-image), image processing concepts such as deconvolution and segmentation, and basic GPU/CUDA terminology.
Scope: The paper introduces cubic, an open-source Python library that wraps SciPy and scikit-image APIs alongside their CUDA-accelerated counterparts in CuPy and RAPIDS cuCIM behind a single device-agnostic interface, and benchmarks it on 3D microscopy processing tasks.
What This Paper Is About
Modern microscopy produces ever-larger 2D and 3D image datasets, but the software tools biologists use for quantitative image analysis are largely CPU-bound, hard to script into automated pipelines, and poorly interoperable with the modern Python scientific computing stack. Meanwhile, GPU acceleration exists for deep learning but has not translated into comparable gains for classical image processing routines such as filtering, segmentation, and deconvolution. The paper's goal is a library that lets existing scikit-image/SciPy-based bioimage workflows run on GPU with minimal code change, while remaining fully functional on CPU-only systems.
Key Contributions
-
A device-agnostic image processing API.
cubicmirrors SciPy and scikit-image function signatures, but dispatches each call to a GPU implementation (via CuPy and RAPIDS cuCIM) when the input array resides on the GPU, and to the CPU implementation otherwise. Existing scikit-image code can be accelerated by changing imports and adding a single array-transfer call. -
Broad coverage of bioimage operations in one library. The authors state the library provides access to near-complete scikit-image functionality—color space conversions, feature detection, filtering, morphological operations, segmentation, geometric transformations, image registration, deconvolution, and feature extraction—plus SciPy's lower-level signal and n-dimensional processing operations.
-
Custom algorithms not covered by existing libraries. These include Fourier Ring Correlation (FRC) and Fourier Shell Correlation (FSC) for resolution assessment, scale-invariant Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index Measure (SSIM), the Average Precision (AP) segmentation quality metric, alternative implementations of Lucy-Richardson deconvolution, and specialized image utility operations.
-
End-to-end validation on three representative 3D microscopy tasks, with both individual operation benchmarks and reproduction of existing pipelines, reporting speedups while maintaining algorithmic fidelity. The library is openly available at https://github.com/alxndrkalinin/cubic.
Main Findings
-
3D image rescaling benchmark: For upscaling operations, GPU speedup ranges from approximately 10× (order 0) for the original image size to over 1600× (order 5) for the larger upsampled input, with higher-order interpolation methods showing dramatically greater acceleration. Downscaling operations show 50–300× speedup across interpolation orders. Even nearest-neighbor interpolation (order 0) shows speedups of 10–170×.
-
Speedup generally scales with image size: The authors report that the GPU consistently achieves a speedup of at least 100× across both operations and both input sizes tested.
-
CellProfiler 3D monolayer segmentation: Reproducing a hierarchical nuclei-then-cell segmentation pipeline on the BBBC034v1 image set yielded a total pipeline acceleration of 25× on GPU compared to CPU (5.62 vs 133.43 sec). Morphological operations and image filtering achieved the largest gains due to their parallel nature. Visual comparison in XY and XZ views showed high-fidelity reproduction; differences were attributed to CellProfiler internally setting some default parameter values differently from scikit-image without exposing them in the GUI.
-
Richardson-Lucy deconvolution: Performance benchmarks on a 30×2160×2560 volume reveal GPU acceleration of ~50× depending on the metric, with the FRC taking too long to measure on CPU. The authors implemented automatic stopping criteria that monitor image quality improvement between consecutive iterations, avoiding manual iteration-count selection.
-
Overall reported range: In the discussion, the authors summarize speed-ups of 10–1500× over CPU-only workflows across each major processing stage in their example benchmarks.
-
Interoperability:
cubicsupports zero-copy data exchange with PyTorch, allowing GPU-resident image processing operations to feed directly into deep learning models without extra memory copies.
Methodology in Plain English
The authors did not invent new image-processing algorithms. Instead, they built a thin software layer that unifies two existing pairs of libraries: SciPy/scikit-image on the CPU and CuPy/cuCIM on the GPU. Because cuCIM mostly mirrors scikit-image's API, the main obstacle for users is bookkeeping—knowing where the data lives (CPU or GPU memory) and importing the matching device-specific function. cubic removes that bookkeeping: the user writes the same call regardless of device, and the library inspects the array to decide which underlying implementation to invoke. If no GPU is detected or a CUDA implementation is missing, it falls back to the CPU version. The authors illustrate this with a Gaussian filter example on a 3D nuclei image, showing how device-specific imports produce runtime type errors unless the data is explicitly moved, whereas cubic requires only one import per submodule and called the same function on either device.
They then validated the approach in three ways: (1) benchmarking 2× upscaling followed by 0.5× downscaling of the scikit-image cells3d dataset at 60×256×256 and at a 2× XY-upsampled 60×512×512, across all SciPy interpolation orders 0–5 with anti-aliasing enabled for downscaling; (2) reimplementing a CellProfiler v4 pipeline for 3D cell monolayer segmentation on BBBC034v1, keeping identical parameter values and processing steps where possible, and comparing segmentation quality using average precision, PSNR, and SSIM on masked intensity images; and (3) running Richardson-Lucy deconvolution with metric-guided automatic iteration stopping on a 30×2160×2560 Hoechst-stained astrocyte nuclei volume with a modeled point spread function of the same ZYX size.
Why This Matters
Impact on research: Much of the bioimage analysis ecosystem (including CellProfiler v4, which packages core routines from scikit-image) is built on CPU-bound libraries. A drop-in wrapper that accelerates those routines on GPU means existing, trusted pipelines can gain large speedups without being rewritten or replaced with unfamiliar tools. This matters for reproducibility, since the underlying algorithms stay the same.
Real-world applications:
- High-throughput drug discovery screens, where thousands to millions of images must be segmented and profiled, and pipeline runtime is a practical bottleneck.
- Functional genomics and image-based profiling, where linking molecular perturbations to cellular phenotypes requires processing terabytes of multidimensional data.
- 3D and volumetric microscopy, including confocal imaging of cell monolayers, organoids, and tissues, where CPU-bound tools struggle with data volume.
- Deconvolution-based image restoration, where the choice of iteration count affects both quality and compute cost, and where GPU-resident metrics can automate that choice.
Industry relevance: The library targets the Python scientific computing stack directly, which lowers adoption friction for pharma, biotech, and imaging core facilities already scripting in Python. Zero-copy interoperability with PyTorch positions it to feed classical image processing results into deep learning models within a single GPU-resident workflow.
Future Directions
-
Expanding the set of validated pipelines. The paper demonstrates three example tasks (rescaling, CellProfiler-style segmentation, and Richardson-Lucy deconvolution); how well the device-agnostic approach holds across the full space of bioimage routines the authors claim to support is not established in this paper.
-
Characterizing the limits of the CPU-to-GPU boundary. The design localizes device transfers to explicit calls such as
ascupyandasnumpy, but the paper does not report how transfer overhead affects workloads where data must move back and forth frequently. -
Deeper integration with GPU-accelerated deep learning. The paper mentions zero-copy exchange with PyTorch as a capability, but no benchmark of a combined classical-plus-deep-learning pipeline is reported.
-
Broader benchmarking across hardware and higher-dimensional data. The paper does not report results on multiple GPU models, nor on data beyond the 2D and 3D settings exercised here, leaving open how performance scales for time-lapse or higher-dimensional stacks.
-
Reproducing full production pipelines rather than analogous ones. The authors explicitly state their CellProfiler example was not intended to perfectly reproduce the original pipeline, so exact numerical equivalence in real deployed workflows remains an open question.
Target Audience
Computational biologists and bioimage analysts who run quantitative microscopy pipelines in Python; software engineers and imaging core facility staff maintaining high-throughput image analysis infrastructure; method developers building on scikit-image or SciPy who need GPU acceleration without rewriting code; and machine learning researchers in the life sciences who need fast classical preprocessing and feature extraction upstream of deep learning models. Readers primarily interested in biological findings rather than tooling would not be the intended audience.
Authors’ abstract
Quantitative analysis of multidimensional biological images is useful for understanding complex cellular phenotypes and accelerating advances in biomedical research. As modern microscopy generates ever-larger 2D and 3D datasets, existing computational approaches are increasingly limited by their scalability, efficiency, and integration with modern scientific computing workflows. Existing bioimage analysis tools often lack application programmable interfaces (APIs), do not support graphics processing unit (GPU) acceleration, lack broad 3D image processing capabilities, and/or have poor interoperability for compute-heavy workflows. Here, we introduce cubic, an open-source Python library that addresses these challenges by augmenting widely used SciPy and scikit-image APIs with GPU-accelerated alternatives from CuPy and RAPIDS cuCIM. cubic's API is device-agnostic and dispatches operations to GPU when data reside on the device and otherwise executes on CPU, seamlessly accelerating a broad range of image processing routines. This approach enables GPU acceleration of existing bioimage analysis workflows, from preprocessing to segmentation and feature extraction for 2D and 3D data. We evaluate cubic both by benchmarking individual operations and by reproducing existing deconvolution and segmentation pipelines, achieving substantial speedups while maintaining algorithmic fidelity. These advances establish a robust foundation for scalable, reproducible bioimage analysis that integrates with the broader Python scientific computing ecosystem, including other GPU-accelerated methods, enabling both interactive exploration and automated high-throughput analysis workflows. cubic is openly available at https://github$.$com/alxndrkalinin/cubic