CuPH: Parallel Cubical Persistent Homology via Level-Synchronous Component Tracking

Guangyu Meng, Pengfei Gu, Erin Wolf Chambers, Danny Z. ChenarXiv 2026 · arXiv

Deep learning models are incredibly good at identifying textures and patterns, but they often struggle with the "big picture" of structure. In medical imaging, a model might correctly identify 99% of the pixels in a blood vessel but fail to connect two segments, rendering the segmentation useless for clinical analysis. Persistent Homology (PH) is a mathematical tool that tracks these topological features (like connected components and loops), but it has historically been too slow to use effectively during the training of deep neural networks.

CuPH (pronounced "cup-H") changes this by introducing a highly parallel GPU algorithm that makes topological computations up to 100x faster, finally making full-image topological losses practical for high-resolution data.

TL;DR

CuPH is a new GPU-based algorithm that parallelizes the computation of cubical persistent homology for 2D images. By operating directly on pixels and using a level-synchronous sweep, it achieves nearly 100x speedups over previous GPU baselines, allowing deep learning models to maintain global structural integrity (like connected road networks or blood vessels) during training.

What Problem Does This Paper Address?

Standard deep learning loss functions, like Cross-Entropy or Dice, operate pixel-by-pixel. They don't "know" if a predicted vessel is a single continuous tube or a series of broken fragments. Persistent Homology can measure these structural properties, but standard algorithms are inherently sequential.

For an image with $n$ pixels, traditional methods have a "parallel depth" of $\Theta(n)$, meaning they have to process elements one after another. This makes them a massive bottleneck on GPUs, which thrive on doing thousands of things at once. Because of this, researchers previously had to rely on "patch-local" PH—calculating topology only on tiny sub-sections of an image—which misses global connectivity patterns.

Methods

The authors introduce CuPH, which shifts the paradigm from processing individual "cells" (vertices, edges, and squares) to processing pixel levels in parallel.

  1. Level Bucketing: Instead of sorting all $4n$ cells of a cubical complex, CuPH groups pixels into buckets based on their intensity levels ($L$). Since an 8-bit image only has 256 levels, this drastically reduces the number of sequential steps.
  2. Level-Synchronous Sweep: The algorithm processes these levels one by one. However, within each level, all pixels are activated and merged into connected components in parallel.
  3. Lock-Free Component Tracking: To handle the "merging" of components on the GPU without slowing down, CuPH uses a lock-free union-find structure. It employs atomic "compare-and-swap" (CAS) operations to ensure that multiple threads can update the connectivity map simultaneously without data corruption.
Figure 1: (a) Existing cubical PH methods construct ∼4n cubical cells (vertices, edges, and squares) and reduce them sequentially via union-find or matrix reduction. CUPH operates directly on pixels in parallel. (b) CUPH achieves 18.6–99.6× speedup over the GPU baseline (CMP) across batch sizes on the ISIC 2018 dataset [6]; CPU methods plateau below 500 img/s.

This approach reduces the parallel depth from $\Theta(n)$ to $O(L \log n)$. For a million-pixel image, this is the difference between a million sequential steps and a few hundred.

Datasets

The authors evaluated CuPH across a wide range of domains:

  • Classification: ISIC 2018 (Skin lesions), CBIS-DDSM (Mammography), Prostate Cancer histology, and APTOS 2019 (Retinopathy).
  • Segmentation: ISIC 2018, CREMI (Electron microscopy of neurons), and Synapse (Abdominal CT).
  • Topology-Aware Loss: Massachusetts Roads (aerial imagery) and Platelet (EM) datasets.

Key Insights and Ideas

  • Exploiting Discrete Intensity: The "aha moment" is realizing that image filtrations are naturally bounded by the number of intensity levels ($L$). We don't need to process every pixel as a unique event; we can process all pixels of the same "brightness" simultaneously.
  • Pixel-Centricity: By operating directly on pixels and using Alexander Duality to handle loops ($H_1$), the algorithm avoids the memory overhead of explicitly building a complex of vertices, edges, and squares.
  • Single-Kernel Execution: The entire level sweep is implemented in a single CUDA kernel. This eliminates the overhead of launching thousands of tiny kernels, which is often what kills performance in other GPU-based topological methods.
Figure 2: Illustrating the CuPH pipeline on a 4 × 4 image with L = 4 intensity levels. (a) Pixels are partitioned into buckets by intensity value. (b) Levels are processed in order: at level 0, components C1 and C2 are born; at level 1, C3 is born, and one pixel joins C1; at level 2, C2 merges into C1, emitting a non-diagonal pair (0, 2); at level 3, C3 merges into C1, emitting (1, 3). (c) The resulting persistence diagram, with C1 giving an essential pair (0, +∞).

Key Results

  • Raw Speed: CuPH is 18.6x to 99.6x faster than the previous state-of-the-art GPU baseline (CMP). Compared to the fastest CPU-based methods, it is over 10x faster at standard resolutions.
  • Training Acceleration: When used as a "drop-in" replacement for topological backends in deep learning, it accelerates training by 25x to 31x.
  • Better Accuracy: Because CuPH is fast enough to run on full high-resolution images (rather than small patches), it improved segmentation accuracy (Dice score) by 2.2 to 4.6 points. It captures global structures that patch-based methods simply cannot see.
Table 1: Throughput comparison on ISIC 2018. (a) Throughput (img/s) at varying resolutions (batch size = 64). (b) Throughput, memory (MB), and speedup at varying batch sizes (resolution = 2242).

Limitations and Future Work

  • 2D Constraint: Currently, CuPH is optimized for 2D images. Extending this to 3D (like MRI or CT volumes) is more complex because the mathematical trick used to find loops (Alexander Duality) doesn't simplify the middle dimensions of 3D data as easily.
  • Quantization: For floating-point data, CuPH requires quantizing values into discrete levels. While the authors prove this is stable, very high-precision scientific data might require a large $L$, which could slow the algorithm down.
  • Future Directions: The authors suggest exploring adaptive quantization (focusing levels where the data is most dense) and extending the parallel reduction techniques to 3D homology.

Summary updated

Abstract

Persistent homology (PH) is a mathematically principled multi-scale topological descriptor of shape and connectivity in data. It is widely applied in image classification, segmentation, and shape analysis across medical and aerial imaging, providing structural information that pixel-wise deep learning may overlook. Standard cubical PH decomposes an image into cubical cells (vertices, edges, and squares) and reduces them sequentially in filtration order. This sequential reduction has $Θ(n)$ parallel depth for an $n$-pixel image, limiting within-image GPU parallelism and constraining its use in topology-aware deep learning. We introduce CuPH, a GPU-based parallel algorithm for computing cubical PH on 2D images that operates directly on pixels rather than cubical cells. CuPH buckets pixels by filtration values, activates them with a level-synchronous sweep, and tracks connected components with a lock-free union-find method. We prove that CuPH produces persistence diagrams identical to standard cubical PH on integer inputs, with a stability bound for floating-point inputs. CuPH reduces parallel depth from $Θ(n)$ to $O(L\log n)$ for an image with $L$ intensity levels. We implement the level sweep as a single CUDA kernel, eliminating cross-level kernel-launch overhead. Empirically, CuPH is $18.6$--$99.6\times$ faster than the existing GPU baseline (CMP). As a drop-in PH backend, CuPH accelerates topology-aware classification ($4.2$--$16.7\times$) and segmentation ($8.3$--$44\times$) while preserving accuracy. It also enables computing full-image PH losses on high-resolution images, improving segmentation Dice by $2.2$--$4.6$ points over patch-local PH baselines and accelerating training by $25$--$31\times$.
BibTeX
@misc{meng2026cuph,
  author = {Guangyu Meng and Pengfei Gu and Erin Wolf Chambers and Danny Z. Chen},
  title = {{CuPH: Parallel Cubical Persistent Homology via Level-Synchronous Component Tracking}},
  year = {2026},
  eprint = {2611.01078},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.01078},
}
Figure