Learning Wasserstein Embeddings

TL;DR

Deep Wasserstein embedding (DWE) learns neural network-based Euclidean approximation of W2 distance, enabling fast large-scale distribution analysis.

stat.ML 🔴 Advanced 2017-10-20 49 views
Nicolas Courty Rémi Flamary Mélanie Ducoffe
deep learning optimal transport Wasserstein distance embedding image analysis

Key Findings

Methodology

This work introduces a Siamese neural network framework to learn an embedding φ that maps probability distributions into a Euclidean space, where Euclidean distances approximate Wasserstein-2 (W2) distances. The training involves minimizing the discrepancy between embedded distances and true W2 values, using a contrastive loss. A decoder network ψ is trained jointly to reconstruct original distributions, ensuring interpretability. The approach leverages supervised pairs of distributions with precomputed W2 distances, enabling end-to-end learning that significantly reduces computational complexity for large datasets. The learned embedding facilitates rapid computation of Wasserstein barycenters, principal geodesic analysis, and other distribution operations.

Key Results

  • On MNIST, the model predicts W2 distances with MSE of 0.40 and correlation of 0.996, outperforming classical LP solvers in speed by over 1000 times (up to 10^6 distances/sec on GPU). The embedding supports efficient barycenter computation (under 20ms for 1000 samples) and principal geodesic analysis, maintaining high fidelity.
  • Cross-dataset experiments on Google Doodle show good generalization, with minor accuracy drops, demonstrating robustness across different visual styles. The method enables real-time interpolation and distribution manipulation, surpassing traditional iterative optimal transport solvers in speed and scalability.
  • Experimental results confirm that the embedding captures meaningful geometric structure, allowing fast approximation of complex distributional tasks, with minimal loss in accuracy compared to exact methods, thus opening new avenues for large-scale probabilistic data analysis.

Significance

This approach addresses the longstanding challenge of high computational cost in Wasserstein distance calculation, especially for large-scale datasets. By learning a neural embedding, it unlocks real-time analysis capabilities for distribution comparison, barycenter computation, and geometric data exploration. The method bridges the gap between theoretical optimal transport and practical large-scale applications, fostering advances in image synthesis, domain adaptation, and probabilistic modeling. Its scalability and efficiency promise broad industrial impact, enabling real-time decision-making in AI-powered systems.

Technical Contribution

The core innovation lies in training a neural network to learn a low-dimensional Euclidean embedding that approximates W2 distances between distributions. This is achieved via a contrastive loss on distribution pairs and a joint autoencoder-like reconstruction loss, ensuring interpretability. The framework supports fast, differentiable distance computation, enabling scalable distribution operations. Compared to prior methods relying on explicit optimization or linear approximations, this approach offers a flexible, data-driven solution with strong empirical performance and potential for theoretical analysis.

Novelty

This is the first work to propose a neural network-based, end-to-end learned embedding for Wasserstein space that generalizes across data types. Unlike previous geometric or linearization methods, it directly approximates the complex W2 metric in a learned Euclidean space, enabling rapid computation and distribution analysis. Its integration of a decoder for distribution reconstruction adds interpretability, setting it apart from existing approximation schemes.

Limitations

  • The model's performance depends on the representativeness of training pairs; in highly complex or sparse distributions, accuracy may degrade. Theoretical guarantees on approximation bounds are still under development.
  • Training requires large amounts of labeled pairs with precomputed W2 distances, which can be computationally intensive. Generalization to unseen or out-of-distribution data remains an open question.
  • High-dimensional distributions with complex structures may challenge the embedding's capacity, necessitating further research into adaptive architectures or unsupervised variants.

Future Work

Future directions include developing theoretical bounds for embedding accuracy, extending to unsupervised or semi-supervised settings, and exploring multi-modal data. Integrating the embedding into generative models and transfer learning pipelines could further enhance practical utility. Additionally, investigating the embedding's properties in high-dimensional and non-concentrated distributions will be crucial for broader applicability.

AI Executive Summary

Wasserstein distance, especially W2, is a fundamental metric in comparing probability distributions with rich geometric meaning, but its computational cost has hindered large-scale applications. Traditional algorithms like linear programming or entropic regularization, while effective, become prohibitively slow as data size grows. This paper introduces a novel deep learning framework—Deep Wasserstein Embedding (DWE)—that learns a neural network-based Euclidean embedding of distributions, where distances approximate W2 with high fidelity. By training a Siamese network with a contrastive loss and a decoder for distribution reconstruction, the authors enable rapid computation of Wasserstein distances, barycenters, and principal geodesic directions.

Experimental validation on MNIST and Google Doodle datasets demonstrates that DWE achieves near-perfect distance prediction (correlation 0.996) with a speedup of over 1000 times compared to classical solvers. The embedding supports efficient large-scale operations, such as computing barycenters of thousands of samples in milliseconds, and facilitates meaningful geometric analysis of distributional data. These capabilities open new horizons for real-time image synthesis, domain adaptation, and probabilistic modeling.

Despite its promising results, the approach faces challenges in theoretical guarantees, generalization to highly complex or sparse distributions, and dependence on large supervised datasets. Future research will focus on strengthening the theoretical foundation, extending to unsupervised settings, and applying the method to diverse data modalities. Overall, this work marks a significant step toward scalable, geometry-aware distribution analysis, with broad implications across AI and data science fields.

Deep Analysis

Background

The evolution of optimal transport theory has led to the Wasserstein distance becoming a key tool for measuring distributional differences, especially in computer vision and machine learning. Early algorithms like the Hungarian method and network flow approaches provided exact solutions but suffered from quadratic or cubic complexity, limiting large-scale use. Recent advances such as Sinkhorn regularization and sliced Wasserstein methods reduced computational costs but still faced scalability issues. Deep learning approaches began to approximate Wasserstein metrics via neural networks, offering promising speedups but often lacked generality and interpretability. The challenge remains to develop a universal, efficient, and theoretically grounded method for large-scale distribution comparison.

Core Problem

Despite the theoretical appeal of Wasserstein distances, their practical application in large datasets is hampered by computational bottlenecks. Exact computation involves solving high-dimensional linear programs, which scale poorly with sample size and dimensionality. Approximate methods like entropic regularization introduce bias and smoothing, losing some geometric fidelity. Consequently, tasks such as distribution clustering, barycenter computation, and geodesic analysis become infeasible at scale. The core problem is to find a scalable, accurate, and interpretable approximation that retains the geometric essence of Wasserstein metrics while enabling real-time analysis.

Innovation

The paper introduces a deep neural network framework—Deep Wasserstein Embedding (DWE)—that learns a low-dimensional Euclidean representation of probability distributions. Key innovations include: 1) a Siamese architecture that preserves the symmetry and metric properties of W2; 2) a joint decoder network for distribution reconstruction, ensuring interpretability and fidelity; 3) end-to-end supervised training using precomputed W2 distances, bypassing expensive optimization during inference. This approach allows for rapid, scalable computation of Wasserstein distances, barycenters, and principal geodesic directions, facilitating large-scale distribution analysis in real time.

Methodology

  • �� Input: pairs of probability distributions (e.g., image histograms)
  • �� Encoder φ: maps each distribution into a low-dimensional Euclidean space
  • �� Loss function: combines contrastive loss (distance approximation to W2) and KL divergence for reconstruction
  • �� Training: optimize φ and ψ jointly using large labeled pairs with precomputed W2 distances
  • �� Inference: compute Euclidean distance in embedding space for new pairs, approximating W2
  • �� Support for barycenters: linear combinations in embedding space mapped back via ψ
  • �� Principal geodesic analysis: PCA in embedding space, reconstructed in original space
  • �� Experiments: datasets include MNIST and Google Doodle, with supervised pairs and evaluation of accuracy and speed

Experiments

The experiments involve training on millions of labeled pairs with known W2 distances, using a GPU-accelerated setup. Evaluation metrics include MSE, correlation, and computational throughput. Results show high accuracy (correlation 0.996) and speedups exceeding 1000x over traditional LP solvers. Barycenter computations for 1000 samples take less than 20ms, enabling real-time applications. Cross-dataset tests demonstrate robustness, while principal geodesic analysis reveals meaningful nonlinear variations. Ablation studies confirm the importance of joint training and reconstruction regularization.

Results

The model achieves a W2 distance prediction MSE of 0.40 with a correlation of 0.996 on MNIST, vastly outperforming classical solvers in speed (up to 10^6 distances/sec). Barycenters of 1000 samples are computed in under 20ms, with high fidelity. Cross-dataset experiments show good transferability, with minor accuracy loss. The embedding captures meaningful geometric structures, enabling nonlinear subspace analysis that outperforms linear PCA, revealing digit shape variations such as stroke width and size.

Applications

This embedding framework is ideal for large-scale image retrieval, distribution clustering, and generative modeling where rapid distribution comparison is essential. It can be integrated into real-time systems for visual search, anomaly detection, and adaptive learning. The approach also supports advanced geometric analysis, such as barycenter computation and principal geodesic extraction, in high-dimensional data spaces, broadening its impact across AI, computer vision, and data mining.

Limitations & Outlook

The approach relies on supervised training with large labeled pairs, which can be computationally intensive. Its performance in extremely high-dimensional or highly non-concentrated distributions remains to be fully validated. Theoretical guarantees on approximation bounds are limited, and the method's robustness to out-of-distribution data needs further investigation. Future work should address these issues to enhance applicability and reliability.

Plain Language Accessible to non-experts

想象你在一家工厂里,工厂每天都要把不同颜色、不同形状的沙子搬到不同的箱子里。传统的方法就像用一辆慢慢的卡车,一颗颗搬,花费很长时间。而这篇文章提出了一种新方法,就像用一台聪明的机器人,它可以学会用最快的方式,把沙子搬到正确的箱子里。这个机器人通过观察很多沙子的样子,学会了怎么判断它们的不同,然后用一种特殊的“地图”告诉自己怎么搬。这样,不管沙子多复杂,机器人都能很快帮你完成搬运任务,大大节省时间。这就像让工厂的搬运变得更智能、更快、更省力。

Abstract

The Wasserstein distance received a lot of attention recently in the community of machine learning, especially for its principled way of comparing distributions. It has found numerous applications in several hard problems, such as domain adaptation, dimensionality reduction or generative models. However, its use is still limited by a heavy computational cost. Our goal is to alleviate this problem by providing an approximation mechanism that allows to break its inherent complexity. It relies on the search of an embedding where the Euclidean distance mimics the Wasserstein distance. We show that such an embedding can be found with a siamese architecture associated with a decoder network that allows to move from the embedding space back to the original input space. Once this embedding has been found, computing optimization problems in the Wasserstein space (e.g. barycenters, principal directions or even archetypes) can be conducted extremely fast. Numerical experiments supporting this idea are conducted on image datasets, and show the wide potential benefits of our method.

stat.ML cs.CV cs.LG stat.CO