NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Topological Autoencoders

Michael Moor, Max Horn, Bastian Rieck, Karsten M. Borgwardt

TL;DR

This paper introduces Topological Autoencoders (TopoAE), a method that forces the latent representations of an autoencoder to preserve the "shape" and connectivity of the original data. By making persistent homology—a tool from algebraic topology—differentiable, the authors create a loss term that aligns multi-scale topological signatures between the input and latent spaces. This results in more interpretable and structurally faithful dimensionality reduction.

What Problem Does This Paper Address?

When compressing high-dimensional data into a low-dimensional latent space (like a 2D plot), we typically care about two things: reconstructing the data accurately and preserving its internal structure. Standard autoencoders excel at the former but often fail at the latter. Because their loss functions focus on pixel-wise or point-wise reconstruction rather than the global "geometry" of the data, they might "tear" a continuous cluster apart or collapse distinct topological features (like holes or nested structures).

Existing topological methods, such as Persistent Homology (PH), are excellent at describing these global structures. However, PH is inherently discrete and combinatorial, making it notoriously difficult to integrate into deep learning because you cannot easily calculate gradients for backpropagation. This paper bridges that gap, allowing topology to act as a direct, differentiable constraint during training.

Methods

The core innovation of the paper is the Topological Loss term ($L_t$), which operates alongside the standard reconstruction loss to ensure structural fidelity.

Topological Autoencoder Architecture

Here is how the topological constraint is calculated:

  1. Vietoris–Rips Complexes: For a mini-batch of data, the algorithm builds a "simplicial complex"—essentially a multi-scale graph where points are connected if they are within a certain distance $\epsilon$.
  2. Persistent Homology: As $\epsilon$ grows, new connections form and "holes" appear or disappear. PH tracks these events across different scales, creating a "topological signature" (often visualized as a persistence diagram) of the data.
Persistent Homology and Vietoris-Rips Complexes
  1. Differentiable Selection: The authors identify the specific pairs of points (edges) responsible for creating or destroying topological features. Crucially, they show that while the choice of these points is discrete, the distances between them are differentiable. By focusing on these "topologically relevant" distances, they can backpropagate through the PH calculation.
  2. The Loss Function: The loss is "directed." $L_{X \to Z}$ ensures that important connectivity in the input space ($X$) is maintained in the latent space ($Z$). Conversely, $L_{Z \to X}$ prevents the latent space from creating "fake" topological structures that weren't in the original data.

The authors also provide a theoretical proof that this approach is stable when using mini-batches, ensuring that the topology of a small sample is a reliable proxy for the topology of the entire dataset.

Key Insights and Ideas

  • The "Union" Strategy: To get informative gradients right from the start of training (when the latent space is random), the authors calculate the loss based on the union of topologically relevant edges from both the input and latent spaces. This prevents the "vanishing gradient" problem that occurs if the two spaces have zero overlapping features initially.
  • Preserving Multi-scale Connectivity: Unlike some previous work that enforced a single fixed scale, TopoAE preserves features across all scales identified by the filtration process.
  • Structure over Separation: While methods like t-SNE are designed to "pull apart" clusters to make them look distinct, TopoAE focuses on how those clusters are actually arranged relative to one another, leading to a more "truthful" representation of the underlying manifold.

Datasets and Key Results

The authors evaluate TopoAE on several datasets, including standard image benchmarks (MNIST, Fashion-MNIST, CIFAR-10) and a custom synthetic dataset called SPHERES (ten high-dimensional spheres nested inside one larger sphere).

  • Qualitative Superiority: On the SPHERES "torture test," TopoAE was the only method capable of capturing the nested relationship. Baselines like t-SNE and UMAP "tore" the enclosing sphere into fragments to minimize local distance, losing the global context entirely.
  • Quantitative Performance: TopoAE consistently outperformed standard autoencoders and other dimensionality reduction techniques on metrics like KL Divergence (density preservation) and Continuity.
  • Reconstruction Fidelity: Importantly, adding the topological constraint did not significantly hurt the reconstruction error (MSE). The model learned to be "topologically aware" without losing its ability to reconstruct the original pixels.

Limitations and Future Work

  • Computational Complexity: Calculating the Vietoris–Rips complex is computationally expensive ($O(m^3)$ in the worst case for a batch of size $m$). While mini-batching helps, scaling to very large batches or higher-order topological features remains a challenge.
  • 0-Dimensional Focus: The experiments primarily focused on 0-dimensional homology (connected components/clusters). While the framework generalizes to higher dimensions (cycles, tunnels), the authors noted that 1D features significantly increased runtime in their current implementation.
  • Classification vs. Topology: The authors suggest that in some classification tasks, you might actually want to remove certain topological structures to increase class separability. Exploring this "topology-removing" loss is an interesting path for future research.

Summary updated

BibTeX
@inproceedings{moor2020topological,
  author = {Michael Moor and Max Horn and Bastian Rieck and Karsten M. Borgwardt},
  title = {{Topological Autoencoders}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
}
Figure