Introduction
In unsupervised learning, acquiring "good" representations of data without explicit labels is a fundamental challenge. While autoencoders excel at compressing data, their latent spaces are not inherently structured in a way that benefits specific downstream tasks. This paper tackles this by introducing a novel, differentiable "connectivity loss" based on persistent homology to actively shape the latent space of autoencoders.
The authors specifically focus on one-class learning (anomaly detection)—the challenge of identifying whether a new sample belongs to a target class when only training examples from that specific class are available. Traditional methods often struggle to define optimal structural priors or require massive amounts of data to model the distribution accurately. By forcing latent representations to follow specific topological structures, the proposed model excels at one-class learning, outperforming state-of-the-art methods, particularly in data-scarce environments.
Shaping the Latent Space with Connectivity Loss
The core innovation of this work is the Connectivity Loss ($\mathcal{L}_\eta$). It leverages tools from algebraic topology to analyze and optimize the "connectivity" of points in the latent space.
- Persistent Homology: The method utilizes 0-dimensional persistent homology, which tracks the number of connected components as "balls" of increasing radius $r$ are grown around each data point.
- The Loss Function: The loss penalizes latent points if they fail to merge into a single connected component at a predefined target distance ($\eta$). Essentially, it encourages every point in a mini-batch to have at least one neighbor at roughly distance $\eta$.
- Differentiability: Crucially, the authors prove this topological loss is differentiable, allowing standard backpropagation to "push" latent points into the desired topological arrangement during training.
- Branching Architecture: To combat the "curse of dimensionality"—where distances become less meaningful in high-dimensional spaces—the latent space is split into multiple independent, low-dimensional "branches," each governed by its own connectivity loss.
- One-Class Scoring: Post-training, a simple, non-parametric Kernel Density Estimator (KDE) is applied in the latent space. Because the space is topologically regularized, a fixed-radius kernel ($\eta$) can be used without complex parameter tuning.
Key Insights and Performance
The application of topological regularization yields several powerful advantages for representation learning:
- Densification: Theoretical analysis shows that enforcing connectivity on small mini-batches causes the entire dataset to become "denser" in the latent space. This regularization makes simple density estimators significantly more powerful.
- Transferability: A surprising finding is that a latent space shaped on one set of images (e.g., CIFAR-100) provides a robust structure that generalizes to completely unrelated classes on other datasets (like ImageNet). The encoder does not need to be retrained for every new anomaly detection task.
- Efficiency in the "Low-Sample" Regime: Because the method imposes a strong topological prior, it requires far less data to "see" the shape of a class. On CIFAR-10, with only 120 training samples per class, the proposed method achieved an AUC of 0.76, significantly beating the previous state-of-the-art (0.69).
- Scalability and Computational Efficiency: The method scales effectively to massive datasets like ImageNet, maintaining a consistent AUC of around 0.72. Furthermore, unlike competing methods that require training thousands of models (one for every class), this approach requires training the autoencoder only once. The subsequent one-class models are non-parametric and require zero additional training.
Limitations and Future Directions
While highly effective, the approach has limitations. Despite the branching strategy, the method still relies on $p$-norm distances, which can remain problematic in extremely high-dimensional spaces. Additionally, the current framework only evaluates connected components (0-D homology). Future work could explore higher-order topological features, such as "loops" (1-D) or "voids" (2-D), to capture even more complex underlying data structures. Finally, while the target distance $\eta$ was fixed to 2 in these experiments, the optimal choice may vary depending on the specific dataset and norm utilized.
Summary updated