  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.
