Neural approximation of Wasserstein distance via a universal architecture for symmetric and factorwise group invariant functions

Samantha Chen, Yusu Wang

Abstract

Learning distance functions between complex objects, such as point sets, is a fundamental challenge in machine learning. These functions must satisfy specific invariance properties: they must be invariant to the ordering of elements within each set and symmetric with respect to the input pair. We formalize these as Symmetric and Factor-wise Group Invariant (SFGI) functions. This paper introduces $N_{ProductNet}$, a novel neural network architecture designed to universally approximate SFGI functions. By integrating geometric sketching techniques, we demonstrate that $N_{ProductNet}$ can approximate the $p$-th Wasserstein distance with a model complexity that remains independent of the input point set size. Theoretically, this represents the first proof of a neural network's capacity to approximate Wasserstein distance with bounded complexity. Empirically, our architecture demonstrates superior generalization and significantly faster training times compared to state-of-the-art Siamese autoencoder approaches.

Introduction

In domains ranging from 3D computer vision to drug discovery, comparing "complex objects" like point clouds or molecular graphs is a critical task. The Wasserstein distance (or Earth Mover’s Distance) is the gold standard for such comparisons due to its ability to capture the underlying geometry of distributions. However, its exact calculation is computationally expensive, typically scaling at $O(N^3 \log N)$, where $N$ is the number of points.

While deep learning offers a path toward faster approximations, existing architectures face two primary hurdles. First, they must satisfy SFGI (Symmetric and Factor-wise Group Invariant) requirements: the distance $D(A, B)$ must remain unchanged regardless of how points are ordered within set $A$ or set $B$, and it must satisfy $D(A, B) = D(B, A)$. Second, most "universal" architectures, such as DeepSets, require the network's internal dimensions to scale with $N$ to maintain theoretical guarantees, making them brittle when applied to point sets larger than those seen during training.

The $N_{ProductNet}$ Architecture

The core innovation of this work is the decoupling of model complexity from the number of input points. This is achieved through a synthesis of neural networks and geometric sketching.

Geometric Sketching

Rather than processing every point in a way that scales linearly or quadratically with $N$, the proposed method maps a point set into a fixed-dimensional Euclidean space. This "sketch" represents the distribution to a specific precision ($\epsilon$). Crucially, the dimension of this sketch depends on the "covering number" of the underlying space (the number of balls required to fill the space) rather than the cardinality of the point set. This allows the network to treat the input as a continuous measure rather than a discrete list of coordinates.

Architecture Design

The $N_{ProductNet}$ architecture follows a specific functional pipeline:

  1. Point-wise Processing: A shared MLP ($h_{\theta1}$) processes individual points.
  2. Aggregation: A sum-pooling layer aggregates these representations into a fixed-length "sketch."
  3. Symmetric Comparison: A second shared MLP ($\phi_{\theta2}$) processes the sketches of set $A$ and set $B$. The results are summed to ensure the final output is symmetric ($D(A, B) = D(B, A)$).
  4. Final Estimation: A final MLP ($\rho_{\theta3}$) maps the combined representation to the scalar distance value.

Empirical Results

The authors evaluated $N_{ProductNet}$ against synthetic data, the ModelNet40 3D point cloud dataset, and high-dimensional RNAseq gene expression data.

Generalization to Unseen Scales

One of the most striking findings involves the model's ability to generalize to different point set sizes. On the noisy-sphere-3 dataset, the model was trained on sets containing 100–300 points. When tested on larger sets (300–500 points), $N_{ProductNet}$ maintained a mean relative error of 0.158. In contrast, the state-of-the-art (SOTA) Siamese Autoencoder (WPCE) failed to generalize, yielding a significantly higher error of 0.356.

Computational Efficiency

The architecture provides massive gains in training and inference speed. On the high-dimensional RNAseq dataset—where each object consists of over 4,000 points in a 2,000-dimensional space—$N_{ProductNet}$ reached convergence in just 15 minutes. The SOTA WPCE model required over 14 hours on identical hardware to reach a comparable state. Furthermore, the model performs inference faster than the standard Sinkhorn approximation, the traditional iterative algorithm for Wasserstein distance.

Discussion and Future Work

A key insight of this research is that for a fixed underlying space (e.g., $\mathbb{R}^3$), a distribution can be represented to a specific precision using a fixed number of parameters. This theoretical grounding prevents the model from overfitting to specific point counts.

However, the "curse of dimensionality" remains a factor. While complexity is independent of $N$, it is dependent on the covering number of the space, which grows exponentially with dimension. While the "manifold hypothesis"—the idea that high-dimensional data often lies on a lower-dimensional manifold—mitigates this in practice (as seen in the RNAseq results), it remains a theoretical boundary.

Future research may extend this SFGI framework to more complex metrics, such as the Gromov-Wasserstein distance, which incorporates invariance to rigid transformations like rotation and translation. This would further expand the utility of neural distance approximations in structural biology and shape analysis.

Summary updated

BibTeX
@inproceedings{chen2023neural,
  author = {Samantha Chen and Yusu Wang},
  title = {{Neural approximation of Wasserstein distance via a universal architecture for symmetric and factorwise group invariant functions}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=4JB42GBxGs},
}
Figure