arXiv:2611.01078cs.CVOct 2026

Manuscript Offprint

arXiv:2611.01078

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

Guangyu Meng, Pengfei Gu, Erin Wolf Chambers, Danny Z. Chen

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)\Theta(n) parallel depth for an nn-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)\Theta(n) to O(Llog⁡n)O(L \log n) for an image with LL 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× faster than the existing GPU baseline (CMP). As a drop-in PH backend, CuPH accelerates topology-aware classification (4.2–16.7×) and segmentation (8.3–44×) 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×.

1 Introduction

In image segmentation and classification, preserving topological structures (e.g., connected components and loops) is often as important as pixel-wise features. For example, a vessel-segmentation prediction may well overlap with ground-truth pixels but break a single capillary into multiple segments [30]; a road-extraction model may correctly label the road pixels but sever a highway at an intersection [27]; an organ-segmentation prediction may achieve high pixel agreement but introduce a phantom hole in the organ wall [5]. Such errors violate the topology of the target, which standard objectives such as cross-entropy and Dice [25] do not explicitly constrain. Persistent homology (PH) [10, 34], a tool from computational topology, fills this gap by providing a principled measure of these structural properties. PH has motivated a growing body of topology-aware learning methods that use persistence-based features or losses to penalize broken vessels, fragmented road networks, leaky membranes, and spurious components [14, 32, 22, 28, 16].

Despite the theoretical advantages, applying PH in deep learning (DL) remains computationally expensive. Standard cubical PH operates at the cell level (Figure 1a): it constructs all ∼4n\sim 4n cubical cells (vertices, edges, and squares) of an nn-pixel image, imposes a filtration order, and reduces them

Preprint.

(a) Pipeline comparison.

Figure

(b) Throughput comparison.

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.

sequentially via union-find or matrix reduction methods [23, 15]. This serial reduction has Θ(n)\Theta(n) parallel depth, which limits within-image parallelism on GPU. Consequently, even on 2242224^2-size images, the fastest CPU algorithm, Cripser [15], reaches only 458 images/s, and the GPU baseline CMP [16] requires batch ≥1,024\geq 1,024 to match Cripser, reaching 56 images/s at batch 64 and 1,441 images/s only at batch 4,096 (Figure 1b). Thus, researchers rely on three workarounds. Offline pre-computation extracts PH features first and freezes them as model input [28]; this avoids training-time computation but cannot adapt to a learned representation. Patch-local PH restricts topological signals to small patches [14, 32] (typically sizes 65265^2 or 1282128^2) in images that are often 100021000^2 or larger. This fits within the backend's per-image cost limits but cannot represent a global road network, membrane sheet, or organ boundary whose topological support extends beyond a single patch. Component-graph topology replaces PH by a graph-theoretic proxy [22], gaining speed but losing PH's theoretical guarantee that zero loss implies matching Betti numbers [14]. A fast exact PH backend will change not only the runtime, but also the class of topology-aware objectives that DL models can use.

To address this computational bottleneck, we propose CuPH, a GPU algorithm for cubical PH. Our observation is that the cost of standard cubical PH is not inherent: it stems from cell-level formulations that do not exploit the bounded level structure of image filtrations. Specifically, for an image, the filtration parameter value is bounded and discrete, with L=256L = 256 intensity levels for an 8-bit image and L≪nL \ll n in general. CuPH avoids constructing the full cubical complex (Figure 1a). It comprises two stages supported by a component-tracking primitive: Level Bucketing groups pixels by intensity; Level Sweeping processes levels sequentially, activating pixels at each level in parallel; Component Tracking maintains connected components and emits persistence pairs under the Elder Rule [10]. CuPH thus reduces the parallel depth from Θ(n)\Theta(n) to O(Llog⁡n)O(L \log n), and achieves 18.6–99.6× speedup over the GPU baseline (CMP) across batch sizes (Figure 1b).

Our contributions are as follows. (i) Algorithm: A new level-synchronous GPU cubical PH algorithm for 2D images; CuPH operates directly on pixels, avoids explicit construction of the full cubical complex, and is implemented as a batched CUDA algorithm that can serve as a drop-in backend for existing topology-aware DL pipelines. (ii) Theory: We prove that CuPH produces persistence diagrams (PDs) identical to standard cubical PH on integer inputs, with a stability bound for floating-point inputs. The algorithm has O(nlog⁡n+L)O(n \log n + L) total work and O(Llog⁡n)O(L \log n) parallel depth for an nn-pixel image with LL intensity levels. (iii) Empirical results: We evaluate CuPH as a standalone PH algorithm and as a drop-in backend for topology-aware classification, segmentation, and PH-based losses. CuPH is 18.6–99.6× faster than the existing GPU baseline (CMP) across batch sizes. As a drop-in backend, it accelerates topology-aware classification by 4.2–16.7× and segmentation by 8.3–44× 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 (whose losses are computed only on local patches) and accelerating training by 25–31×.

References (29)