Scalable Computation of Monge Maps with General Costs

Jiaojiao Fan, Shu Liu, Shaojun Ma, Yongxin Chen, Haomin Zhou

Abstract

Monge map refers to the optimal transport map between two probability distributions and provides a principled approach to transform one distribution to another. Neural network based optimal transport map solver has gained great attention in recent years. Along this line, we present a scalable algorithm for computing the neural Monge map between two probability distributions. Our algorithm is based on a weak form of the optimal transport problem, thus it only requires samples from the marginals instead of their analytic expressions, and can accommodate optimal transport between two distributions with different dimensions. Our algorithm is suitable for general cost functions, compared with other existing methods for estimating Monge maps using samples, which are usually for quadratic costs. The performance of our algorithms is demonstrated through a series of experiments with both synthetic and realistic data, including text-to-image generation and image inpainting tasks.

1. Introduction

Optimal Transport (OT) provides a mathematically principled framework for morphing one probability distribution into another with minimal "effort" or cost. The deterministic routing plan that achieves this is known as the Monge map. Historically, computing these maps in high-dimensional spaces has been difficult due to the curse of dimensionality. Traditional discrete solvers do not scale to massive datasets and fail to generalize to new, unseen samples. This paper introduces a scalable, neural network-based algorithm that computes the Monge map using only unpaired samples, accommodating general cost functions and unequal dimensions.

2. Methodology

The authors reformulate the Monge problem by treating the requirement that the source distribution must map to the target distribution as a hard constraint. By introducing a Lagrange multiplier ($f$), the problem is cast as a minimax (saddle point) game:

$$\max_f \min_T \mathcal{L}(T, f)$$

Both the transport map $T$ and the dual variable $f$ are parameterized by deep neural networks and trained via alternating gradient descent. This approach offers several advantages:

  • General Cost Functions: Unlike methods restricted to squared Euclidean distance, this framework supports arbitrary cost functions tailored to specific tasks.
  • Unpaired Data: The algorithm learns complex mappings using only marginal, unpaired samples, which is critical for real-world scenarios where paired data is scarce.
  • Dimensional Flexibility: It naturally supports mapping between spaces of different dimensions, such as from latent spaces to high-dimensional manifolds.

3. Applications and Results

The flexibility of the neural Monge map is demonstrated across several high-dimensional generative tasks.

3.1 Unpaired Text-to-Image Generation

By using negative cosine similarity between CLIP embeddings as the transportation cost, the model learns to map text embeddings to image embeddings without any paired training data. When passed through a frozen decoder, the generated images show high semantic alignment with the input prompts.

Text-to-image generation results comparing the proposed Monge map approach (our embedding) against text embeddings and real images.

3.2 Image Inpainting and Class Preservation

In image inpainting tasks on the CelebA dataset, the method achieved a Fréchet Inception Distance (FID) score of 3.71, significantly outperforming the WGAN-GP baseline (6.74). For class-preserving mapping (e.g., MNIST to KMNIST), the algorithm achieved over 99.5% accuracy in maintaining the semantic identity of the digits, demonstrating superior performance over stochastic map baselines.

4. Conclusion

This neural Monge map estimator provides a scalable, continuous solution for high-dimensional optimal transport. By moving beyond specific cost functions and paired data requirements, it opens new avenues for domain adaptation and generative modeling. Future work will focus on adapting the algorithm for structured data types such as time series and graphs.

Summary updated

BibTeX
@misc{fan2021scalable,
  author = {Jiaojiao Fan and Shu Liu and Shaojun Ma and Yongxin Chen and Haomin Zhou},
  title = {{Scalable Computation of Monge Maps with General Costs}},
  year = {2021},
  eprint = {2106.03812},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.03812},
}
Figure