Abstract
Solving optimization tasks based on functions and losses with a topological flavor is a very active, growing field of research in data science and Topological Data Analysis, with applications in non-convex optimization, statistics and machine learning. However, the approaches proposed in the literature are usually anchored to a specific application and/or topological construction, and do not come with theoretical guarantees. To address this issue, we study the differentiability of a general map associated with the most common topological construction, that is, the persistence map. Building on real analytic geometry arguments, we propose a general framework that allows us to define and compute gradients for persistence-based functions in a very simple way. We also provide a simple, explicit and sufficient condition for convergence of stochastic subgradient methods for such functions. This result encompasses all the constructions and applications of topological optimization in the literature. Finally, we provide associated code, that is easy to handle and to mix with other non-topological methods and constraints, as well as some experiments showcasing the versatility of our approach.
Introduction
Persistent homology is a cornerstone of Topological Data Analysis (TDA), providing a way to quantify the "shape" of data—such as holes, loops, and voids—through descriptors known as persistence diagrams. Despite their utility in machine learning, integrating these diagrams into loss functions has been challenging. The mapping from raw data to a persistence diagram is combinatorial, non-convex, and generally non-differentiable. Previous efforts to optimize topological losses often relied on ad-hoc methods tailored to specific tasks, lacking rigorous theoretical convergence guarantees. This work establishes a general mathematical framework to move topological optimization toward a grounded, reliable field.
Theoretical Framework and Methodology
The authors propose a novel perspective on the persistence map, viewing it as a re-indexing or permutation of input filtration values. By leveraging o-minimal geometry, they prove that the persistence map is semi-algebraic. This "tameness" ensures that the functions derived from persistence diagrams are well-behaved, possessing well-defined gradients almost everywhere.
Consequently, standard optimization techniques like Stochastic Subgradient Descent (SGD) can be applied with guaranteed convergence to critical points. The framework is implemented in the GUDHI library, facilitating seamless integration with modern deep learning libraries like PyTorch and TensorFlow. This allows for automatic differentiation where gradients are efficiently computed as coordinate permutations.
Experimental Validation
The framework was tested across diverse domains:
- Synthetic Point Clouds: Nested circles in 3D space, non-linearly embedded into 9D.
- MNIST: Handwritten digits used for optimizing topological filter directions.
- Graph Benchmarks: Ten standard datasets (e.g., PROTEINS, MUTAG, IMDB) for graph classification.
Key Insights and Results
A primary insight is that topological functions, while abstract, are mathematically "tame," allowing the use of standard neural network optimizers. However, topological losses alone can be unstable; for instance, point clouds might expand indefinitely to maximize a hole. The authors demonstrate that incorporating spatial regularization significantly improves robustness.
In dimension reduction tasks, an autoencoder with a 1D topological loss successfully separated nested circles in latent space, a task where standard autoencoders often fail. In MNIST classification, optimizing the topological filter direction led to dramatic performance gains, such as increasing accuracy from 61.3% to 99.0% on specific digit pairs. Furthermore, the framework consistently improved baseline performance across all tested graph datasets.
Limitations and Future Outlook
While powerful, the approach faces computational hurdles. Calculating persistence and Wasserstein distances is expensive, potentially slowing training for large-scale data. Certain filtrations, like alpha-complexes, require specific technical adjustments to fit the Lipschitz requirements of the framework. Future work includes exploring "vineyards" for faster diagram updates and applying the framework to enhance classifier robustness.
Summary updated