Sparse cubical complexes for efficient topology-preservation in image data
Authors: Alexander H. Berger, Marco Fontana, Daniel Rueckert, Johannes C. Paetzold, Laurin Lux, Ulrich Bauer
Organizations: Weill Cornell Medicine, New York, USA · Technical University of Munich, Munich, Germany · Department of Computing, Imperial College London, UK · Munich Center for Machine Learning (MCML), Munich, Germany · Cornell Tech, New York, USA · Munich Data Science Institute, Technical University of Munich, Munich, Germany
Persistent homology (PH) is a frequently used tool for extracting and preserving topological information from image data, particularly in image segmentation, where preservation of topological structures is important. However, despite its general applicability across dimensionality, domains, and target structures, the runtime cost of PH-based methods often makes their practical use infeasible. In this work, we argue that this runtime cost is largely driven by processing information that is unimportant for downstream application (e.g. as optimization objective). We propose sparse cubical filtrations as an alternative foundation for PH computation, reducing subsequent computational costs by factors of up to 100 on real datasets. We show close agreement with the optimization signal of the dense counterpart and empirically evaluate our solution's effectiveness as an optimization objective in realistic training regimes where other PH-based objectives can practically not operate (i.e., 3D data with large patch sizes). We show how our solution improves topological accuracy by up to 80% across six diverse datasets while maintaining pixel- and region-based accuracy.
Figures & tables
Figure 1: Our approach, PH-based loss functions with sparse cubical complexes, significantly reduces topological errors in image segmentation at a fraction of the cost, making PH-based loss functions usable with large patch sizes and state-of-the-art training paradigms. (a) In realistic 3D training settings (here, on ATM’26), sparseBM is orders of magnitude faster than classical PH-based loss functions and its runtime is substantially less sensitive to patch size in the sparse regime considered here. (b) sparseBM significantly reduces topological error across domains with diverse topological targets and across 2D and 3D (lower is better).
Figure 2: Core idea of the sparse construction. A common retained cubical subcomplex S=Cτ is selected from the comparison filtration, while retained cells keep their original filtration values. The omitted region is represented implicitly rather than instantiated as the full cubical grid.
Figure 3: Exemplary comparison between a sparse and dense barcode. Corresponding dense intervals are indicated in grey. The intervals are: (a) kept with shifted death, (b) exact, (c) kept via label with shifted birth and death, (d) omitted, (e) kept exact via label
Figure 4: Barcode extraction time using dense and sparse cubical complexes on outputs of segmentation models.
dataset
loss
Dice ↑
BM err. ↓
clDice ↑
VOI ↓
NSD ↑
Train. time ↓
ATM’26 airway lumen 1283
Dice+CE
.9446 ± .0032
102 ± 12 ∗
.900 ± .002
.0064 ± .0003
.955 ± .004
1.00 ×
clDice
.9421 ± .0048
84.8 ± 9.3 ∗
.906 ± .006
.0065 ± .0004
.953 ± .004
1.29 ×
Skel. Recall
.9437 ± .0022
96.4 ± 6.5 ∗
.896 ± .003 ∗
.0065 ± .0001 ∗
.953 ± .001
1.03 ×
warping †
.9413 ± .0038
94.6 ± 12.3 ∗
.896 ± .008
.0066 ± .0003
.951 ± .006
1.40 ×
sparse BM (ours)
.9449 ± .0017
18.8 ± .5
.906 ± .006
.0061 ± .0001
.956 ± .004
1.15 ×
NISB-B cell interfaces 1282×64
Dice+CE
.7847 ± .0001
367.3k ± 3.3k ∗
.766 ± .000
4.521 ± .000
.929 ± .000
1.00 ×
Table 1: Test-set results in 2D and 3D. Three seeds each, scored once on held-out data; mean ± sd over seeds. Bold: best arm of the dataset. ∗ : sparse BM is significantly better than that arm on that metric (paired t -test over seeds, p<0.05 ). Train. time: wall clock of the whole training, as a multiple of Dice+CE. † : Runtime improved version of the authors’ released code.
Figure 5: SparseBM closely reproduces the optimization signal of dense Betti Matching. (a) shows the cosine similarity between their update steps, together with baseline comparisons to ComboLoss and to a different batch with the same loss. (b) shows the corresponding difference in persistence diagrams. Most affected features have very small persistence and lie in the background. Both plots are created from real samples during training on the ATM’26 dataset.
patch
loss
Dice ↑
BM err. ↓
clDice ↑
VOI ↓
NSD ↑
Train. time ↓
1283
Dice+CE
.9446 ± .0032
102 ± 12 ∗
.900 ± .002
.0064 ± .0003
.955 ± .004
1.00 ×
sparse BM (ours)
.9449 ± .0017
18.8 ± .5
.906 ± .006
.0061 ± .0001
.956 ± .004
1.15 ×
643
Dice+CE
.9299 ± .0124
129 ± 20 ∗
.878 ± .014 ∗
.0075 ± .0011
.939 ± .013
1.00 ×
DMT
.9407 ± .0013
66.5 ± 1.8 ∗
.906 ± .004
.0065 ± .0001
.957 ± .002
5.38 ×
dense BM
.9358 ± .0062
25.1 ± 1.8 ∗
.904 ± .002 ∗
.0069 ± .0005
.949 ± .004
1.88 ×
sparse BM (ours)
.9412 ± .0023
20.2 ± 2.1
.909 ± .000
.0063 ± .0001
.954 ± .001
1.19 ×
Table 2: Comparison to PH-based losses in a training setting with reduced patch size on the ATM’26 dataset. Same annotation as in Table 1 .
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: Ablation on the weight parameter on the NISB-B dataset (validation set, individual patches). Betti Matching error (left axis, blue) and Dice (right axis, orange) against the topology weight. The dashed line is the Dice+CE baseline, the dotted line the admissibility floor (reference −0.010 ) for model selection. The selected weight is the last point above the floor.
Figure 7: We observe that sparseBM’s optimal weight can be chosen based on the ratio between the gradient norm of sparseBM and ComboLoss.
τ
kept (%)
runtime (ms) ↓
BM err. ↓
Dice ↑
0.5
1.26
48.6 ± 6.2
4.40
.9724
0.6
1.26
49.1 ± 7.0
4.06
.9734
0.7
1.26
49.1 ± 7.1
4.09
.9740
0.8 (default)
1.27
49.3 ± 6.7
3.96
.9732
0.9
1.28
49.1 ± 6.7
4.14
.9720
0.95
1.29
50.0 ± 7.4
3.92
.9733
Appendix
Table 3: Kept fraction, runtime, validation BM error and Dice with varying τ on ATM’26 (validation). Bold: best τ ; the runtime differences between τ values are within 2% (paired per micro-batch).
Figure 8: Fraction of included voxels as the sparsification threshold τ increases. The y-axis is logarithmic.
dataset
modality
target
train / val / test
resolution
patch
ATM’26
chest CT
airway tree
193 / 50 / 53 volumes
native, 0.51–0.92 mm in-plane
1283
NISB-B
synthetic EM
neuron boundaries
5 / 1 / 1 volumes a
4.5×4.5×10 nm (lifted)
1282×64
BraTS-METS
brain MRI
metastases (tumour core)
733 / 181 / 162 cases
1 mm isotropic
1283
MMWHS
cardiac CT
LV myocardium
12 / 4 / 4 volumes b
1.25 mm isotropic
1283
FIVES
fundus photography
retinal vessels
478 / 120 / 200 images
native
20482
ACDC
cine MRI
LV myocardium
1506 / 396 / 1076 slices
native, 1.37–1.92 mm
2242
Appendix
Table 4: Datasets. Train/val = fold 0 of the cross-validation split; test = held-out cases, scored once.
Figure 9: We interleave forward/backward passes with the loss calculation of two subsequent micro-batches to maximize GPU utilization and reduce runtime.
Figure 10: Runtime comparison for metric calculation between sparse and dense betti matching error. The runtime decrease translates to application on binary inputs.
loss
Δ Dice
Δ clDice
Δ TLD
Δ BD
Dice+CE
−0.53
−1.51
+2.75
+4.32
clDice
−0.70
−1.13
+2.55
+4.15
Skeleton Recall
−0.71
−1.68
+2.20
+3.51
Appendix
Table 5: Results on the use of sparse cubical complexes as a post-processing tool. Each cell describes the improvements after post-processing compared to the respective base model.
We present Flash Cubical, a highly efficient computation of cubical persistence on a V-filtration for 2D and 3D images over F2. The implementation is built around three core ideas. First, cubical complexes satisfy properties that allow for the computation of persistence of the highest dimension via union-find and duality. Second, pruning of certain edges allows for a fast and efficient implementation of union-find. Third, the use of a lookup table, which exploits the regularity of cubical complexes to pre-compute local information. This avoids the need to compute local information at run time. To the best of our knowledge, this is the most efficient implementation of cubical persistence with a V-filtration, both in terms of time and memory costs. Although the paper focuses on persistence for V-filtration cubical complexes, the underlying ideas generalise naturally to T-filtrations on cubical complexes and suggest promising directions for other complexes.
Titouan Le Breton, Karol Szustakowski, Marie Piraud
1Helmholtz AI, Helmholtz Munich, Neuherberg, Germany · 2École des Ponts ParisTech, ENS Paris-Saclay · Institute of AI for Health, Helmholtz Munich, Neuherberg, Germany
When computing sub/super-level-set persistent homology (PH), the effect of noise may introduce millions of (short-lived) topological generators, presenting an obstacle to both the computation of PH of large 3D images, and any analysis of PH that incorporates the number of generators. As such, it is often necessary to denoise the data before computing its PH. We analyze the PH of synthetic 3D images of porous media in the presence of spatially uncorrelated noise, and perform a comparative analysis of various topological measures (e.g. bottleneck distance, Wasserstein distance, persistence statistics and persistence images) to assess their robustness to both noise and the denoising process (i.e. adding spatially uncorrelated Gaussian noise, and denoising by either a Gaussian convolution or a machine learning approach).
Ebru Dagdelen, Aakash Karlekar, Manav Arora +4
Department of Mathematical Sciences, New Jersey Institute of Technology, Newark, NJ 07102, USA
Persistence-based topological optimization deforms a point cloud X⊂Rd by minimizing objectives of the form L(X)=ℓ(Dgm(X)), where Dgm(X) is a persistence diagram. In practice, optimization is limited by two coupled issues: persistent homology is typically computed on subsamples, and the resulting topological gradients are highly sparse, with only a few anchor points receiving nonzero updates. Motivated by diffeomorphic interpolation, which extends sparse gradients to smooth ambient vector fields via Reproducing Kernel Hilbert Space (RKHS) interpolation, we propose a more scalable pipeline that improves both subsampling and gradient extension. We introduce subsampling via random slicing, a lightweight scheme that promotes iteration-wise geometric coverage and mitigates density bias. We further replace the costly kernel solve with a fast Nadaraya-Watson (NW) Gaussian convolution, producing a globally defined smooth update field at a fraction of the computational cost, while being more suited for topological optimization tasks. We provide theoretical guarantees for NW smoothing, including anchor approximation bounds and global Lipschitz estimates. Experiments in 2D and 3D show that combining random slicing with NW smoothing yields consistent speedups and improved objective values over other baselines on common persistence losses.