Optimizing Deep Networks with Differentiable Topology

67 concepts49 papers1 proposal

Standard deep learning models excel at optimizing local geometric properties, such as pixel-wise distances or smooth coordinate boundaries. However, they possess a fundamental blind spot when it comes to global structure. Consider a neural network segmenting a blood vessel or a road network: if the model predicts a mask with a single-pixel gap, standard losses like cross-entropy treat it as a negligible, minor error. Topologically, however, it is a catastrophic failure—a continuous path has been severed into two disconnected components.

As noted by Xiaoling Hu et al. in Topology-Preserving Deep Image Segmentation, global properties like the number of connected components ($\beta_0$) or loops ($\beta_1$) are inherently discrete integers. If you slightly perturb an image's pixels, these counts do not change smoothly; they jump abruptly. Consequently, their derivatives are zero almost everywhere and undefined at the boundaries. This non-differentiability historically prevented structural connectivity from being integrated directly into gradient-based optimization frameworks.

The breakthrough that resolves this deadlock is differentiable persistent homology. By shifting the focus from static topological counts to continuous structural timelines, this framework allows deep networks to backpropagate gradients directly through global shapes.

The Core Mechanism: Gradient Routing via Filtrations

To understand why topology can be made differentiable, we must look at how persistent homology measures shape through a process called a filtration.

Imagine a grayscale image or a scalar field output by a neural network. Instead of analyzing a single binary threshold of this image, we sweep a threshold parameter $t$ continuously from 0 to 1. As $t$ increases, we track the birth and death of topological features:

  • A new connected component is born when a local maximum appears.
  • Two components merge together—causing one to die—at a saddle point.
  • A loop is born when a boundary closes, and it dies when the hole is completely filled in.

We can plot each feature's birth and death times as coordinates on a 2D plane known as a persistence diagram.

  Death ↑
        |       • (Long-lived, robust feature)
        |     
        |   • •  (Short-lived noise)
        | /
        +-------------> Birth

Here lies the crucial insight: while the total count of features is a discontinuous step function, the birth and death coordinates themselves are continuous functions of the input data.

More importantly, every single birth and death event is triggered by a specific, critical element in the input. For example, a loop dies at the exact threshold where a specific pixel fills the remaining gap. If we want to force that loop to close sooner during training, the optimization framework needs to know which pixel to modify.

By tracking the combinatorial sorting and pairing operations that map the input data to the persistence diagram, the system establishes a direct mathematical link between diagram coordinates and input elements. Locally, this mapping behaves like a simple linear assignment. As Christoph D. Hofer et al. demonstrate in Graph Filtration Learning, differentiating through these sorting and pairing operations allows gradients to flow backwards from a topological loss function directly to the exact critical pixels, edge weights, or point coordinates that caused the structural feature to exist.

Topological Loss Functions and Regularization

This gradient-routing mechanism allows researchers to design loss terms that penalize structural defects. Instead of treating the network's output as a collection of independent pixels, the loss function optimizes the global "skeleton" of the data.

In generative modeling, models often suffer from topological artifacts, such as generating a 3D chair with a detached leg. The authors of TopoGAN: A Topology-Aware Generative Adversarial Network overcome this by introducing a differentiable topological loss that penalizes discrepancies between the persistence diagrams of real and generated images, forcing the generator to respect global connectivity.

Similarly, Michael Moor and Max Horn introduce Topological Autoencoders, which utilize a differentiable persistence loss to align multi-scale connectivity profiles between the high-dimensional input space and the low-dimensional latent space. This ensures that the embedding preserves the global clusters and voids of the original data.

In classification, Chao Chen et al. present TopoReg in A Topological Regularizer for Classifiers via Persistent Homology. TopoReg measures the topological complexity of a classifier's decision boundary. If noise in the training data causes the boundary to form tiny, spurious "islands," the regularizer identifies these short-lived topological features and backpropagates gradients to flatten them, improving generalization without over-smoothing the global boundary.

End-to-End Learnable Topological Layers

Rather than merely using topology as a passive regularizer on network outputs, differentiability enables the construction of architectural layers that learn task-specific topological features end-to-end.

Traditionally, topological data analysis relied on fixed, hand-crafted filtration functions, such as computing standard Euclidean distance fields. However, a fixed filtration may not capture the structural nuances required for a specific downstream task. By embedding persistent homology into a differentiable layer, the network can use backpropagation to optimize the filtration function itself.

In Topological Graph Neural Networks, the authors introduce TOGL, a layer that adaptively learns filtration functions over graph structures. This allows the network to dynamically prioritize global structural features—like cycles and multi-scale components—making standard Graph Neural Networks (GNNs) strictly more expressive.

To feed these topological summaries into standard neural network layers, the persistence diagrams must be vectorized. Kwangho Kim et al. address this in PLLay: Efficient Topological Layer based on Persistent Landscapes by formulating a fully differentiable mapping from filtrations to persistence landscapes. This allows the network to co-optimize feature representation and topological scale selection simultaneously.

Smoothing Alternative Invariants

While persistent homology relies on tracking critical points through filtrations, other areas of algebraic topology are being adapted for deep learning by directly smoothing traditionally discrete invariants.

The Euler Characteristic Transform (ECT) is a powerful shape descriptor that works by counting discrete combinatorial elements (vertices, edges, and faces) along different directional projections. Because it relies on raw counts, it behaves as a non-differentiable step function.

To integrate this tool into deep networks, Ernst Röell and Bastian Rieck develop a smooth approximation of this process in Differentiable Euler Characteristic Transforms for Shape Classification. By replacing the discrete counting steps with continuous, differentiable approximations, they unlock the ability to optimize input geometries directly based on topological constraints.

This mathematical smoothing is further utilized by Juan P Garcia Amboage et al. in LEAP: Local ECT-Based Learnable Positional Encodings for Graphs, which maps graph connectivity and local neighborhood geometry into a continuous representation space, allowing standard architectures to learn complex structural properties without relying on rigid, hand-engineered topological features.

Key Foundational Work

PHom-WAE: Persitent Homology for Wasserstein Auto-Encoders (2019) — contributed 1 concept elements to this direction.
Stochastic Multiresolution Persistent Homology Kernel (2016) — contributed 1 concept elements to this direction.
A Topological Regularizer for Classifiers via Persistent Homology (2019) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_differentiable_persistent_homology_3b93a8ce,
  title = {differentiable persistent homology},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/differentiable-persistent-homology/rdr_3b93a8ceb4cf48069a1ee9cd68437f99},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_differentiable_persistent_homology_3b93a8ce_v1,
  title = {differentiable persistent homology},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/differentiable-persistent-homology/rdr_3b93a8ceb4cf48069a1ee9cd68437f99/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake