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.
Jun 3, 2026·Titouan Le Breton, Karol Szustakowski, Marie PiraudPersistent Homology
1Helmholtz AI, Helmholtz Munich, Neuherberg, Germany · 2École des Ponts ParisTech, ENS Paris-Saclay · Institute of AI for Health, Helmholtz Munich, Neuherberg, Germany