🤖 AI Summary
Preserving critical topological structures—such as extrema and monotonicity transitions—in the latent space remains challenging in representation learning. To address this, we propose Directional Sign Loss (DSL), a differentiable and computationally efficient topology-preserving loss function that, for the first time, models sign-level finite-difference consistency as a gradient-compatible supervisory signal. DSL leverages tanh-smoothed sign approximation, per-dimension directional weighting, and finite-difference computation, supporting arbitrary-dimensional arrays and seamless integration into architectures such as autoencoders. Experiments on 1D–3D topologically sensitive data demonstrate that DSL, when combined with standard reconstruction losses, significantly improves topological fidelity of reconstructions: Betti number errors decrease by 37–62% compared to baselines, while computational overhead remains substantially lower than persistent homology-based methods.
📝 Abstract
Preserving critical topological features in learned latent spaces is a fundamental challenge in representation learning, particularly for topology-sensitive data. This paper introduces directional sign loss (DSL), a novel loss function that approximates the number of mismatches in the signs of finite differences between corresponding elements of two arrays. By penalizing discrepancies in critical points between input and reconstructed data, DSL encourages autoencoders and other learnable compressors to retain the topological features of the original data. We present the mathematical formulation, complexity analysis, and practical implementation of DSL, comparing its behavior to its non-differentiable counterpart and to other topological measures. Experiments on one-, two-, and three-dimensional data show that combining DSL with traditional loss functions preserves topological features more effectively than traditional losses alone. Moreover, DSL serves as a differentiable, efficient proxy for common topology-based metrics, enabling its use in gradient-based optimization frameworks.