- The paper introduces Flash Cubical, a C++ implementation that combines dual union-find, local pruning, and lookup tables to compute cubical persistence efficiently over mathbb{F}_2.
- The method outperforms CubicalRipser and GUDHI on tested V-filtration data, delivering roughly 314 speedups and 28 memory reductions, especially for 3D volumes.
- The approach remains specialized to regular 2D and 3D cubical images, with 3D H_1 matrix reduction, incomplete general duality proofs, and open opportunities for GPU, higher-dimensional, and alpha-complex extensions.
Overview
This paper presents Flash Cubical, a C++ implementation of cubical persistent homology over F2 for 2D and 3D images under the V-filtration (the lower-star filtration assigning pixel values to vertices). The implementation rests on three ideas: (1) computing top-dimensional persistence via union-find on a dual graph, justified by a cohomology duality argument; (2) pruning zero-persistence and already-classified edges before union-find; and (3) precomputing local lower-star information in lookup tables that exploit the regularity of cubical grids. Benchmarks against CubicalRipser and GUDHI show Flash Cubical is the fastest and most memory-efficient option for V-filtrations across all tested cases, with the largest gains on 3D volumes.
Background: filtrations and tie-breaking
The paper distinguishes the V-filtration, where fV(σ)=maxv∈σfV(v), from the T-filtration, where pixel values attach to top-dimensional cells and fT(σ) is the minimum over incident top cells. Since persistence requires a fully refined filtration with exactly one cell per step, two tie-break levels are introduced: a first-order tie-break for equal pixel values, and a second-order tie-break ordering cells within a vertex's lower star L(v). A key definitional choice is that pruning decisions refer to zero-persistence in the semi-refined filtration (first-order tie-break only); pairs arising from first-order ties are not removed by local simplification because they are harder to detect locally. The final algorithm still reports pairs against the original V-filtration values, omitting any pair whose birth and death coincide there.
Dual union-find for top-dimensional persistence
The central theoretical observation is that when every (d−1)-dimensional facet has one or two d-dimensional co-facets — true of all cubical complexes built from images — top-dimensional persistence reduces to union-find on a dual graph. Top cells become dual vertices; facets become dual edges; facets with a single co-facet connect to an added "infinite" vertex. Processing dual edges in reverse filtration order places the computation in the cohomology setting, where union-find yields the same persistence pairs as matrix reduction but at near-linear cost.
The appendix sketches a proof over Z/pZ: coboundary vectors of facets have at most two nonzero entries (Vr−Vs or Vr), and an injective linear embedding into one extra dimension converts single-cofacet vectors into the same two-sparse form. Linear dependence of such vectors is then exactly connectivity in the dual graph, so the span test becomes a find operation, and pairing follows by taking the youngest dual vertex of a negative edge. The authors note this argument is grounded in prior work on dual cubical complexes (Garin et al., 2020), but claim it plausibly extends beyond cubical complexes — e.g., to alpha filtrations — while providing only elements of a proof rather than a complete general theorem.
In 2D this means both H0 and fV(σ)=maxv∈σfV(v)0 are computed entirely by union-find; in 3D, fV(σ)=maxv∈σfV(v)1 and fV(σ)=maxv∈σfV(v)2 use union-find, leaving only a reduced fV(σ)=maxv∈σfV(v)3 problem for matrix reduction.
Pruning and lookup tables
Before union-find runs, two edge classes are eliminated: direct zero-persistence negative edges (paired locally within a lower star) and positive edges, which would otherwise trigger fruitless find operations. In 2D an additional "cross-pruning" step removes all fV(σ)=maxv∈σfV(v)4-negative edges from the fV(σ)=maxv∈σfV(v)5 dual computation, since both dimensions operate on the same edge set; fV(σ)=maxv∈σfV(v)6 is computed first because it produces the most pairs.
The lookup table exploits grid regularity: a vertex's entire lower star and second-order tie-break order are determined by which of its neighbours (8 in 2D, 26 in 3D) precede it in the semi-refined filtration. Although a naive count gives fV(σ)=maxv∈σfV(v)7 configurations in 3D, collapsing configurations where absent adjacent vertices make diagonal presence irrelevant reduces this to 15,935 precomputed entries covering classification (locally positive/negative, zero-persistence, direct) and tie-break order. This is the one component that does not generalize beyond cubical complexes; the authors also note that for simplicial complexes, apparent pairs (Kaji et al., 2020) offer a cheaper analogue of the pruning criterion.
Algorithms
The 2D pipeline is: lookup table query → local pruning → fV(σ)=maxv∈σfV(v)8 union-find → cross-pruning → fV(σ)=maxv∈σfV(v)9 dual union-find. The 3D pipeline is: lookup → pruned fT(σ)0 union-find → pruned fT(σ)1 dual union-find → pruned fT(σ)2 matrix reduction, where edges paired in fT(σ)3 and squares paired in fT(σ)4 are removed from the row and column sets respectively before reduction.
Experimental results
Benchmarks (single-threaded, Intel i7-12650H, 16 GB RAM) compare Flash Cubical against CubicalRipser 0.0.33 and GUDHI 3.12.0 on synthetic uniform noise, Lena, DIV2K, and the Fuel, Bonsai, and Aneurism volumes. Representative results:
| Case |
Flash time (s) / MB |
GUDHI |
CRipser |
| Synthetic 2D large (fT(σ)5) |
0.11 / 23 |
1.95 / 266 |
0.34 / 208 |
| Synthetic 3D large (fT(σ)6) |
2.21 / 239 |
13.79 / 958 |
8.29 / 783 |
| Bonsai (fT(σ)7) |
0.53 / 194 |
7.28 / 1384 |
2.94 / 440 |
| Aneurism (fT(σ)8) |
0.28 / 189 |
6.16 / 1519 |
2.62 / 437 |
Flash Cubical is fastest and leanest in every tested case, with speedups of roughly 3–14× over CubicalRipser and memory reductions of 2–8×; gains are largest on 3D real data. Two reference comparisons temper these claims. First, in reduced modes that sacrifice a dimension (Flash skipping fT(σ)9, CubicalRipser skipping L(v)0), Flash drops from 2.21 s to 0.7 s on synthetic L(v)1 data, but gains on Bonsai and Aneurism are modest — indicating much of the runtime on real volumes lies outside L(v)2. Second, GUDHI's dedicated T-filtration module computes 2D persistence roughly twice as fast as Flash Cubical at comparable memory (e.g., 0.06 s vs 0.11 s on synthetic L(v)3). The authors state plainly that for 2D images where either filtration is acceptable, GUDHI's T-filtration module is the more efficient choice; Flash Cubical's advantage is specific to V-filtrations and to 3D.
Limitations and open questions
Several caveats bear directly on the results. The duality-based union-find argument is supported only by "elements of a proof"; a full proof, particularly for settings beyond cubical complexes, is not given. Zero-persistence detection operates in the semi-refined filtration, so pairs created by first-order tie-breaks are not pruned locally. The lookup-table approach requires strong regularity and does not transfer to point-cloud-derived complexes. The 3D L(v)4 computation remains standard matrix reduction on a reduced problem, and the authors identify it as needing a better algorithm. Whether the combination of duality, pruning, and apparent-pair detection yields practical gains for alpha filtrations is explicitly left open, as are higher-dimensional cubical extensions, GPU parallelization of the lookup and union-find phases, and multithreaded computation of the top and bottom dimensions.
Conclusion
Flash Cubical demonstrates that combining cohomological duality, aggressive local pruning, and precomputed lower-star tables yields substantial time and memory improvements for V-filtration cubical persistence, particularly on 3D volumes, where it outperforms existing tools by large margins. Its scope is deliberately narrow — 2D/3D image data over L(v)5 under the V-filtration — and the paper is candid that GUDHI's T-filtration module remains preferable for 2D users indifferent to filtration type. The main open problems are a complete proof of the duality-to-union-find reduction in general, an efficient 3D L(v)6 method, and extension of the framework to T-filtrations and alpha complexes.