Efficient Betti Matching Enables Topology-Aware 3D Segmentation via Persistent Homology
Nico Stucki, Vincent Bürgin, Johannes C. Paetzold, Ulrich Bauer
TL;DR
The paper tackles the computational bottleneck of topology-aware 3D segmentation by introducing an efficient Betti matching algorithm and a highly optimized C++ implementation (Betti-matching-3D) with Python bindings. It builds a robust 3D persistent-homology pipeline based on cubical complexes, image barcodes, and induced matchings to define the Betti matching loss, enabling training of segmentation networks with topological awareness. The authors implement several algorithmic innovations (dimension-separation reductions, implicit reduction, union-find for $H_0$ and $H_2$, emergent-pair optimizations, and memory-efficient cube representations) and cache-friendly data structures, achieving speedups over Cubical Ripser and enabling parallel barcode computations. Empirical results on multiple 3D datasets show that DiceBetti losses improve topological correctness and can outperform several topological baselines across diverse domains, highlighting the practical impact for topology-aware 3D segmentation. The work also provides a pathway to GPU-friendly extensions and further study of loss-component interactions, underscoring its significance for scalable, topology-preserving medical image analysis.
Abstract
In this work, we propose an efficient algorithm for the calculation of the Betti matching, which can be used as a loss function to train topology aware segmentation networks. Betti matching loss builds on techniques from topological data analysis, specifically persistent homology. A major challenge is the computational cost of computing persistence barcodes. In response to this challenge, we propose a new, highly optimized implementation of Betti matching, implemented in C++ together with a python interface, which achieves significant speedups compared to the state-of-the-art implementation Cubical Ripser. We use Betti matching 3D to train segmentation networks with the Betti matching loss and demonstrate improved topological correctness of predicted segmentations across several datasets. The source code is available at https://github.com/nstucki/Betti-Matching-3D.
