Source-linked AI summary
A Topological Loss Function for Deep-Learning based Image Segmentation using Persistent Homology
James R. Clough, Nicholas Byrne, Ilkay Oksuz, Veronika A. Zimmer, Julia A. Schnabel, Andrew P. King
TL;DR
CNN segmentation commonly relies on costly pixelwise labels, while global topology can be crucial and difficult to encode in standard losses. The paper introduces a persistent-homology loss that compares predicted topology with specified Betti-number priors and back-propagates the resulting gradient without ground-truth labels. Across MNIST denoising, cardiac MR, and 3D placental ultrasound, the approach improves pixelwise and topological accuracy, while its usefulness depends on meaningful topological priors and incurs additional computation.
Problem
Pixelwise ground-truth labels are costly, particularly for expert-annotated 3D medical volumes, motivating methods that can use available anatomical topology instead.
Method
The method applies persistent homology directly to predicted segmentations, compares their topology with desired Betti numbers, and back-propagates a differentiable loss.
Results
Across 2D and 3D imaging tasks, including CMR and ultrasound, the approach improves both pixelwise and topological segmentation accuracy.
Takeaways & Limitations
The approach is most useful when topology is known but training data are limited, and topological accuracy can be traded against pixelwise accuracy through loss weighting.
Takeaways & Limitations
Persistent-homology computation adds application-dependent training time, taking approximately 10 seconds for 100 80x80 images and 6 seconds for one 96x240x256 volume.
Abstract
from arXiv · showhide
We introduce a method for training neural networks to perform image or volume segmentation in which prior knowledge about the topology of the segmented object can be explicitly provided and then incorporated into the training process. By using the differentiable properties of persistent homology, a concept used in topological data analysis, we can specify the desired topology of segmented objects in terms of their Betti numbers and then drive the proposed segmentations to contain the specified topological features. Importantly this process does not require any ground-truth labels, just prior knowledge of the topology of the structure being segmented. We demonstrate our approach in three experiments. Firstly we create a synthetic task in which handwritten MNIST digits are de-noised, and show that using this kind of topological prior knowledge in the training of the network significantly improves the quality of the de-noised digits. Secondly we perform an experiment in which the task is segmenting the myocardium of the left ventricle from cardiac magnetic resonance images. We show that the incorporation of the prior knowledge of the topology of this anatomy improves the resulting segmentations in terms of both the topological accuracy and the Dice coefficient. Thirdly, we extend the method to 3D volumes and demonstrate its performance on the task of segmenting the placenta from ultrasound data, again showing that incorporating topological priors improves performance on this challenging task. We find that embedding explicit prior knowledge in neural network segmentation tasks is most beneficial when the segmentation task is especially challenging and that it can be used in either a semi-supervised or post-processing context to extract a useful training gradient from images without pixelwise labels.
1 INTRODUCTION
The paper introduces a differentiable persistent-homology loss that incorporates known topology into CNN segmentation without requiring ground-truth labels. Experiments on MNIST, cardiac MR, and 3D placental ultrasound show improved denoising or segmentation quality when topological priors are available.
- Motivation: Ground-truth segmentation labels are expensive to acquire, especially for expert-annotated 3D medical volumes that can take several hours per case.This scarcity limits the availability of large datasets for learning global shape and topological features.
- Method: Persistent homology provides a differentiable topological loss whose gradient can be back-propagated through CNN weights.The loss compares predicted topology with prior knowledge and supports segmentations that are both pixel-wise and topologically accurate.
- Experiments: Topological priors allow ambiguous MNIST images to be denoised differently according to the expected digit’s topology.The experiments also report improved denoising performance when the network matches the topology of the digit.
- Experiments: Adding the prior that left-ventricle myocardium is ring-shaped improves both Dice score and topological accuracy in short-axis cardiac MR segmentation.A separate experiment also applies the method to a publicly available cardiac MR challenge dataset.
- Experiments: In 3D ultrasound, incorporating the prior that the placenta is one connected component without handles or cavities improves Dice score and topological accuracy.This extends the method beyond 2D images to volumetric segmentation.
2 RELATED WORK
Prior work used shape representations, persistent homology, or learned features to influence neural-network training, but often retained dependence on ground-truth labels or applied topology away from predicted segmentations. This paper instead applies persistent homology directly to candidate segmentations so user-specified topology can provide a differentiable training signal.
- Shape constraints: Pixelwise losses such as binary cross-entropy or Dice measure overlap but may not adequately reflect globally important shape or topology.The relevant concern is that errors affecting interpretation or downstream modeling can vary across image regions.
- Shape constraints: Feature-based shape losses can capture anatomy-related representations, but their learned shape or topological features are difficult to identify precisely.Such approaches also require ground-truth segmentations during training, unlike the proposed method.
- Shape constraints: Deformable-shape approaches begin from a topologically correct candidate and train the network to deform it toward the ground truth.This differs from directly regularizing the topology of a network’s predicted segmentation.
- Persistent homology: Persistent homology measures the persistence of topological features across filtration values, and its differentiability enables gradient-based optimization.This makes PH applicable to neural-network decision boundaries, weights, activations, representations, and generated datasets.
- Persistent homology for segmentation: Unlike earlier segmentation uses that derive features from input images, this method applies persistent homology to candidate segmentations produced by the network.The resulting topological information can be compared with user-specified prior features, including features that are difficult to extract from image intensities.
3 THEORY AND METHODS
The method represents image or volume predictions as cubical complexes, uses persistent homology to track topology across thresholds, and defines a differentiable loss against desired Betti numbers. It can incorporate topology through post-processing or semi-supervised training without requiring ground-truth labels for every case.
- Persistent homology: Persistent homology measures the robustness of topological features across filtration values, with persistent features represented by long barcode intervals.Birth and death thresholds describe when features appear and disappear as the filtration changes.
- Cubical complexes: For images and volumes, pixels or voxels are represented naturally as cells in a cubical complex rather than as a point cloud.In two dimensions, each pixel is modeled as the product of elementary intervals.
- Super-level sets: Predicted probabilities define super-level sets that grow as the threshold decreases, allowing persistent homology to count features created and destroyed across thresholds.The predicted segmentation is produced by a CNN, with each pixel probability determining membership in a super-level set.
- Topological priors: Betti numbers count connected components, loops or holes, and hollow voids, corresponding to β0, β1, and β2 in the considered 2D and 3D settings.These quantities specify the desired topology of the segmented object.
- Differentiable topology: Birth and death values are differentiable with respect to predicted probabilities because each threshold equals the value of a particular pixel or voxel.This provides gradients that can change the predicted segmentation toward the desired topology.
- Topological loss and training frameworks: The topological loss is minimized when the barcode contains exactly β∗k bars of length 1 for each dimension and no additional bars.The framework supports both per-item post-processing and semi-supervised training that combines labeled-case segmentation loss with topological loss on unlabeled cases.
4 EXPERIMENTS
The experiments apply topological priors to MNIST denoising and cardiac MRI segmentation, using persistent-homology information to improve reconstruction or segmentation quality. Results show benefits in recognition, topological correctness, and Dice performance, especially for challenging inputs.
- 4.1 Experiment 1: MNIST denoising corrupts digits by randomly removing Fourier-domain lines, then trains a U-net-like CNN to reconstruct the original images.The corrupted images are normalized to [0, 1], and reconstruction is initially trained with mean squared error.
- 4.1 Experiment 1: Topological post-processing makes reconstructed MNIST digits more recognizable and reaches the desired topology, producing different reconstructions for different priors.The experiment was designed to demonstrate the approach rather than achieve state-of-the-art denoising results.
- 4.2 Experiment 2: The cardiac MRI experiment models left-ventricle myocardium as one connected component with one hole or loop and evaluates Dice score alongside topological correctness.Image quality is varied by removing Fourier-transform lines, with larger m producing more severe corruption.
- 4.2 Experiment 2: Topological training removes extra components and gaps in ring-shaped myocardium segmentations, generally improving Dice scores, particularly when the images are heavily degraded.The authors interpret the use of topological information from unlabelled images as regularizing the CNN when few manual labels are available.
- 4.2 Experiment 2: The method remained robust for highly corrupted cardiac images, including cases with 60 of 80 Fourier lines removed and a median signal-to-noise ratio of 3.3dB.The corresponding original-image median signal-to-noise ratio was 4.22dB.
- 4.3 Experiment 3: The challenge-dataset cardiac MRI experiment achieved mean Dice scores of 0.8994 at end-diastole and 0.9068 at end-systole.Topological correctness could not be assessed because ground-truth test-set segmentations were not publicly available.
5 DISCUSSION
The discussion presents persistent-homology topology as a useful complement to pixelwise segmentation losses, especially when prior topology is available and data are limited. It also identifies practical and optimization limits, including computational cost and failures when predictions are already correct or far from the target topology.
- Method and benefits: Persistent homology enables a topological loss that improves both pixelwise and topological segmentation accuracy when combined with traditional losses.The method is demonstrated for image and volume segmentation using a U-net-like architecture.
- Limitations: The method has limits: it may add little when topology is already correct, may fail when predictions are far from the ground truth, and adds computational cost.The paper reports approximately 10 seconds for 100 80x80 images and approximately 6 seconds for one 96x240x256 volume; real-time 3D use may be prohibitive.
- Method and benefits: The method is particularly suited to medical imaging because datasets are often small or noisy while anatomical topology provides informative prior knowledge.The approach is intended for settings with limited training data and available topological properties.
- Experimental findings: The topological prior consistently improved placenta Dice scores by an average of 0.024 in post-processing across 13 folds.Each fold contained 5 or 6 volumes, and segmentation difficulty varied substantially between folds.
- Experimental findings: The loss can suppress small false-positive or false-negative regions and encourage globally correct connectivity even when local label smoothness is not preserved.Unlike morphological or CRF-based methods, the PH-based approach represents global topology and can encourage separate large components to connect.
- Limitations: Compared with deformable shape models, the approach does not depend on deforming a fixed initial shape and may better accommodate unusually shaped but topologically correct anatomy.Deformable models are limited by how far the initial shape can deform.
6 CONCLUSION
The proposed topological loss uses persistent homology to make topology-informed CNN segmentation trainable by gradient descent. Experiments across 2D and 3D medical-imaging settings show improved pixelwise and topological accuracy.
- Persistent homology computes the robustness of topological features, enabling gradient descent on CNN weights.
- The loss assesses how closely a proposed segmentation adheres to prior knowledge about the target topology.
- The approach applies to both 2D images and 3D volumes, including CMR imaging and ultrasound.
- The experiments show improved pixelwise and topological accuracy in the resulting segmentations.