Topology Distance: A Topology-Based Approach For Evaluating Generative Adversarial Networks

Danijela Horak, Simiao Yu, Gholamreza Salimi Khorshidi

Abstract

Automatic evaluation of the goodness of Generative Adversarial Networks (GANs) has been a challenge for the field of machine learning. In this work, we propose a distance complementary to existing measures: Topology Distance (TD), the main idea behind which is to compare the geometric and topological features of the latent manifold of real data with those of generated data. More specifically, we build Vietoris-Rips complex on image features, and define TD based on the differences in persistent-homology groups of the two manifolds. We compare TD with the most commonly used and relevant measures in the field, including Inception Score (IS), Frechet Inception Distance (FID), Kernel Inception Distance (KID) and Geometry Score (GS), in a range of experiments on various datasets. We demonstrate the unique advantage and superiority of our proposed approach over the aforementioned metrics. A combination of our empirical results and the theoretical argument we propose in favour of TD, strongly supports the claim that TD is a powerful candidate metric that researchers can employ when aiming to automatically evaluate the goodness of GANs' learning.

Introduction

The "Manifold Hypothesis" posits that high-dimensional data, such as images, resides on a lower-dimensional manifold. Evaluating a GAN effectively requires determining if the generated manifold matches the real data manifold. Existing metrics like the Inception Score (IS) and Fréchet Inception Distance (FID) have notable limitations. IS is tied to specific classifier performance, while FID assumes a multivariate Gaussian distribution of features, potentially failing to distinguish between distributions with identical first and second moments but different underlying structures.

Methodology: Topology Distance (TD)

Topology Distance (TD) leverages tools from algebraic topology, specifically persistent homology, to create a structural "fingerprint" of the data.

  1. Feature Extraction: Rather than using raw pixels, TD operates on features extracted from a pre-trained neural network (e.g., Inception or ResNet).
  2. Vietoris-Rips Complex: A simplicial complex is constructed by connecting points within a radius $\epsilon$. As $\epsilon$ increases, topological features (like connected components) appear and eventually merge.
  3. Longevity Vectors: The algorithm records the "living times" of these features. For 0-dimensional homology, it tracks how long components exist before merging. These sorted times form a longevity vector.
  4. Distance Calculation: TD is defined as the $L_2$ distance between the longevity vectors of the real and generated data.
Illustration of Vietoris-Rips complex construction and the resulting persistence diagram used to derive longevity vectors.

Experimental Results

The authors evaluated TD across several benchmarks, including Fashion-MNIST, CIFAR10, CelebA, and the corrupted CIFAR100-C dataset.

Robustness and Structural Awareness

A key advantage of TD is its sensitivity to structural integrity. In experiments comparing pixel noise to patch exchanges (which destroy image structure), TD correctly identified patch exchange as more detrimental. In contrast, FID and KID sometimes showed the opposite trend, failing to align with human perception of quality.

Comparison of TD, FID, and KID performance across different types of image degradation.

Consistency with Corruption Severity

On the CIFAR100-C dataset, TD exhibited a monotonic increase in distance as corruption severity increased, outperforming Geometry Score (GS) in consistency. Furthermore, monitoring GAN training on CelebA showed that TD steadily decreases as image quality improves, whereas IS can become erratic.

Conclusion

Topology Distance provides a "shape-aware" metric that complements existing moment-based approaches. By analyzing the persistent homology of learned features, TD offers a robust and semantically meaningful evaluation of GAN performance. Future work may explore higher-order homology (loops and voids) and more sophisticated distance measures between persistence diagrams to further refine this topological approach.

Summary updated

Abstract

Automatic evaluation of the goodness of Generative Adversarial Networks (GANs) has been a challenge for the field of machine learning. In this work, we propose a distance complementary to existing measures: Topology Distance (TD), the main idea behind which is to compare the geometric and topological features of the latent manifold of real data with those of generated data. More specifically, we build Vietoris-Rips complex on image features, and define TD based on the differences in persistent-homology groups of the two manifolds. We compare TD with the most commonly used and relevant measures in the field, including Inception Score (IS), Frechet Inception Distance (FID), Kernel Inception Distance (KID) and Geometry Score (GS), in a range of experiments on various datasets. We demonstrate the unique advantage and superiority of our proposed approach over the aforementioned metrics. A combination of our empirical results and the theoretical argument we propose in favour of TD, strongly supports the claim that TD is a powerful candidate metric that researchers can employ when aiming to automatically evaluate the goodness of GANs' learning.
BibTeX
@inproceedings{horak2021topology,
  author = {Danijela Horak and Simiao Yu and Gholamreza Salimi Khorshidi},
  title = {{Topology Distance: A Topology-Based Approach For Evaluating Generative Adversarial Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  url = {https://openreview.net/forum?id=Z5Si0fat8W},
}
Figure