Topology-Preserving Deep Image Segmentation

Xiaoling Hu, Fuxin Li, Dimitris Samaras, Chao Chen

Abstract

Standard deep learning models for image segmentation often prioritize pixel-wise accuracy at the expense of topological correctness. In domains like neurobiology or infrastructure mapping, a single-pixel error can lead to catastrophic structural failures, such as disconnected roads or merged neurons. We present TopoNet, which introduces a novel, differentiable loss function based on persistent homology. By bridging the gap between discrete topological properties and continuous gradient-based optimization, TopoNet ensures segmentations maintain correct connectivity and structural fidelity.

Introduction

Deep learning models like U-Net have become the standard for image segmentation, typically trained using pixel-wise loss functions such as Cross-Entropy or Dice loss. While these models achieve high per-pixel accuracy, they are fundamentally "topology-agnostic." They do not explicitly account for the connectivity of objects or the presence of holes.

In critical applications—such as tracing thin neuron membranes in electron microscopy or identifying road networks in satellite imagery—functional accuracy is more important than pixel accuracy. A tiny gap in a membrane might merge two distinct neurons, rendering the output useless for downstream connectivity analysis. The challenge lies in the fact that topological features (Betti numbers) are discrete, making them traditionally incompatible with the differentiable nature of backpropagation.

Methodology

The core innovation of TopoNet is the incorporation of a "topological loss" ($L_{topo}$) into the training process, leveraging Persistent Homology from computational topology.

The TopoNet training pipeline. The model computes a topological loss by matching persistence diagrams of the likelihood map and the ground truth, identifying critical pixels for gradient updates.

Persistent Homology and Differentiable Loss

Instead of evaluating a segmentation at a fixed threshold, persistent homology tracks how topological features (connected components and loops) appear ("birth") and disappear ("death") across all possible likelihood thresholds. These events are mapped onto a 2D Persistence Diagram. The topological loss is defined as the distance between the predicted and ground truth persistence diagrams.

Gradient-Based Optimization

The authors demonstrate that topological changes are governed by specific "critical pixels," such as saddle points or local extrema. By identifying these pixels, the network can calculate gradients that specifically "push" likelihood values at these locations to close gaps or eliminate false connections. This allows for "surgical" updates to the model's weights.

Patch-based Training

To manage the $O(n^3)$ computational complexity of persistent homology, TopoNet utilizes patch-based training (65x65 pixels). It employs relative homology to ensure that structures crossing patch boundaries are handled correctly, maintaining global consistency from local computations.

Experimental Results

TopoNet was evaluated on several challenging benchmarks, including neuron mapping (CREMI, ISBI12/13), road extraction (CrackTree, Massachusetts Roads), and retinal vessel segmentation (DRIVE).

Qualitative comparison on the ISBI dataset. (a) Input EM image, (b) Ground truth, (c) Baseline U-Net result showing broken membranes and merged regions, (d) TopoNet result preserving the correct topology.

Key Metrics

The method consistently outperformed state-of-the-art baselines in topology-specific metrics. On the ISBI12 dataset, TopoNet reduced the Betti Number Error from 3.187 to 0.429. It also achieved superior results in the Adjusted Rand Index (ARI) and Variation of Information (VOI), which measure how effectively a segmentation partitions the image into distinct objects.

Discussion and Conclusion

TopoNet demonstrates that optimizing for structural integrity can be more vital than optimizing for individual pixel labels. By treating topology as a continuous landscape rather than a set of discrete values, the model can sacrifice minor pixel accuracy to ensure functional connectivity.

While the approach is computationally more intensive than standard training and requires careful hyperparameter tuning for the loss weight ($\lambda$), it represents a significant step toward functionally reliable automated segmentation. Future work involves scaling these differentiable topological methods to 3D volumes, which remains a substantial computational challenge.

Summary updated

BibTeX
@inproceedings{hu2019topology,
  author = {Xiaoling Hu and Fuxin Li and Dimitris Samaras and Chao Chen},
  title = {{Topology-Preserving Deep Image Segmentation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=vpYtVd_S76p},
}
Figure