TOPOLOGICALLY FAITHFUL IMAGE SEGMENTATION VIA INDUCED MATCHING OF PERSISTENCE BARCODES

Abstract

Image segmentation is a largely researched field where neural networks find vast applications in many facets of technology. Some of the most popular approaches to train segmentation networks employ loss functions optimizing pixel-overlap, an objective that is insufficient for many segmentation tasks. In recent years, their limitations fueled a growing interest in topology-aware methods, which aim to recover the correct topology of the segmented structures. However, so far, none of the existing approaches achieve a spatially correct matching between the topological features of ground truth and prediction. In this work, we propose the first topologically and feature-wise accurate metric and loss function for supervised image segmentation, which we term TopoMatch. We show how induced matchings guarantee the spatially correct matching between barcodes in a segmentation setting. Furthermore, we propose an efficient algorithm to compute TopoMatch for images. We show that TopoMatch is an interpretable metric to evaluate the topological correctness of segmentations, which is more sensitive than the well-established Betti number error. Moreover, the differentiability of the TopoMatch loss enables its use as a loss function. It improves the topological performance of segmentation networks across six diverse datasets while preserving the volumetric performance.

1. INTRODUCTION

Topology studies properties of shapes that are related to their connectivity and that remain unchanged under deformations, translations, and twisting. Some topological concepts, such as cubical complexes, homology and Betti numbers, form interpretable descriptions of shapes in space that can be efficiently computed. Naturally, the topology of physical structures is highly relevant in machine learning tasks, where the preservation of its connectivity is crucial, a prominent example being image segmentation. Recently, a number of methods have been proposed to improve topology preservation in image segmentation for a wide range of applications. However, none of the existing concepts take the spatial location of the topological features (e.g. connected components or cycles) within their respective image into account. Evidently, spatial correspondence of these features is a critical property of segmentations, see Fig. 1 . We match cycles between label and prediction for a CREMI image and denote matched pairs in the same color. We visualize only six (randomly selected out of the total 23 matches for both methods) matched pairs for presentation clarity. Note that TopoMatch always matches spatially correctly while the Wasserstein matching gets most matches wrong. Our contribution In this work, we introduce a rigorous framework for faithfully quantifying the preservation of topological properties in the context of image segmentation, see Fig. 2 . Our method builds on the concept of induced matchings between persistence barcodes from algebraic topology, introduced by Bauer & Lesnick (2015) . The introduction of these matching to a machine learning setting allows us to precisely formulate spatial correspondences between topological features of two grayscale images. We achieve this by embedding both images into a common comparison image. Put in simple terms, our central contribution is an efficient, differentiable solution for localized topological error finding, which serves as: • a topological loss to train segmentation networks, which guarantees to correctly, in a spatial sense, emphasize and penalize the topological structures during training (see Sec 3.2); • an interpretable topological quality metric for image segmentation, which is not only sensitive to the number of topological features but also to their location within the respective images (see Sec. 3.3). Experimentally, our TopoMatch construction proves to be an effective loss function, leading to vastly improved topology across six diverse datasets. 



Figure 1: Motivation -comparison of our TopoMatch and Wasserstein matching (Hu et al. (2019)).We match cycles between label and prediction for a CREMI image and denote matched pairs in the same color. We visualize only six (randomly selected out of the total 23 matches for both methods) matched pairs for presentation clarity. Note that TopoMatch always matches spatially correctly while the Wasserstein matching gets most matches wrong. Our contribution In this work, we introduce a rigorous framework for faithfully quantifying the preservation of topological properties in the context of image segmentation, see Fig.2. Our method

Figure 2: (a) and (c) show two predictions for ground truth (b). Volumetric metrics, e.g., Dice favor (a) over (c), and even Betti number error can not differentiate between (a) and (c) while only TopoMatch detects the spatial error in (a) and favors (c). Topology aware segmentation Multiple works have highlighted the importance of topologically correct segmentations in various computer vision applications. Persistent homology is a popular tool from algebraic topology to address this issue. A key publication by Hu et al. (2019) introduced the Wasserstein loss as a variation of the Wasserstein distance to improve image segmentation. They match points of dimension 1 in the persistence diagramsan alternative to barcodes as descriptor of persistent homolgy -of ground truth and prediction by minimizing the squared distance of matched points. However, this matching has a fundamental limitation, in that it cannot guarantee that the matched structures are spatially related in any sense (see Fig. 1 and App. A). Put succinctly, the cycles are matched irrespective of the location within the image, which frequently has an adverse impact during training (see App. F). Clough et al. (2020) follows a similar approach and train without knowing the explicit ground truth segmentation, but only the Betti numbers it ought to have. Persistent homology has also been used by Abousamra et al. (2021) for crowd localization and by Waibel et al. (2022) for reconstructing 3D cell shapes from 2D images. Other methods incorporate pixel-overlaps of topologically relevant structures. For example, the clDice score, introduced by Shit et al. (2021), computes the harmonic mean of the overlap of the predicted skeleton with the ground truth volume and vice versa. Hu & Chen (2021) and Jain et al. (2010) use homotopy warping to identify critical pixels and measure the topological difference between grayscale images. Hu et al. (2021) utilizes discrete Morse theory (see Delgado-Friedrichs

