Learning Cost Functions for Optimal Transport

Haodong Sun, Haomin Zhou, Hongyuan Zha, Xiaojing YearXiv 2020

Introduction

Optimal Transport (OT) has emerged as a fundamental mathematical framework for finding efficient mappings between probability distributions. Whether matching workers to job openings or transferring color palettes between digital images, OT provides a principled way to move mass. However, the efficacy of OT is entirely dependent on a predefined cost function, which quantifies the "expense" of matching one point to another. In practice, this function is often a heuristic guess—typically standard Euclidean distance—which can lead to biased results if it fails to capture the true underlying structure of the data.

This research addresses the "Inverse OT" problem: given observed optimal matchings, how can we learn the hidden cost function that generated them? Traditionally, this is a computationally grueling task. This paper introduces a novel framework that transforms Inverse OT from a slow, bi-level optimization problem into a single, efficient convex optimization, enabling fast and scalable cost learning for both discrete and high-dimensional continuous data.

The Computational Bottleneck

Historically, Inverse OT has been formulated as a bi-level optimization problem. To update the cost function, one must solve a complete "forward" OT problem in every iteration. This nested structure is prohibitively slow. Furthermore, existing methods are largely restricted to discrete data (matrices). When applied to continuous, high-dimensional spaces, these methods suffer from the "curse of dimensionality," as discretizing the space into grids becomes computationally intractable.

A Unified Framework for Inverse OT

The authors bypass these limitations by leveraging the dual formulation of entropy-regularized OT. Their approach is built on three key pillars:

1. Mathematical Reformulation

The core breakthrough is a mathematical proof showing that the nested bi-level optimization problem is equivalent to a single, unconstrained convex optimization problem. By incorporating customizable regularization on the cost function, the researchers collapse the complexity of Inverse OT to roughly that of a single forward OT problem.

2. Discrete Cost Learning (Algorithm 1)

For discrete datasets, the authors developed a fast matrix scaling algorithm. This method combines proximal gradient descent with techniques similar to the Sinkhorn-Knopp algorithm to efficiently learn cost matrices from observed matchings.

3. Continuous Cost Learning (Algorithm 2)

To handle high-dimensional continuous data, the framework utilizes deep neural networks. Because the new formulation is unconstrained, the cost function and dual variables can be parameterized as deep networks. This "mesh-free" approach allows for the learning of continuous cost functions without the need for space discretization, making it the first viable method for continuous Inverse OT.

Experimental Evaluation

The framework was tested across synthetic and real-world datasets to validate its speed and accuracy.

  • Synthetic Data: The algorithms successfully recovered exact mathematical rules (e.g., hidden exponents in $|x-y|^p$) from generated matching pairs, proving the model's ability to identify underlying cost structures.
  • Dutch Household Survey (DHS): Using data from 4,553 couples, the researchers learned an "affinity matrix" based on features like education, height, and personality. Their discrete method (Algorithm 1) achieved a near-perfect Root Mean Square Error (RMSE) of $2.46 \times 10^{-11}$ in just 0.04 seconds—outperforming the state-of-the-art RIOT model, which took over 7 seconds.
  • Image Color Transfer: In a continuous OT task, the model treated images as 3D RGB point clouds. Learning the cost function from data resulted in a significantly more faithful color mapping compared to standard Euclidean costs, which often produced noticeable color fading.

Insights and Limitations

A significant contribution of this work is the formal characterization of the ambiguity inherent in Inverse OT. The problem is fundamentally ill-posed; multiple cost functions can often produce the same transport plan. However, the authors demonstrate that by applying mild convex constraints—such as assuming cost symmetry—one can guarantee a unique, ground-truth solution.

While the neural network approach is powerful, its success depends on the user's ability to provide appropriate constraints. Without prior knowledge (e.g., whether the cost should be symmetric), the network might find a cost function that fits the data perfectly but lacks physical or logical meaning.

Conclusion

By collapsing bi-level optimization into a single convex objective and integrating deep learning for continuous spaces, this work provides a scalable and efficient solution to the Inverse OT problem. This framework opens new doors for understanding complex matching markets and improving data-driven transport tasks across various scientific domains.

Summary updated

BibTeX
@misc{sun2020learning,
  author = {Haodong Sun and Haomin Zhou and Hongyuan Zha and Xiaojing Ye},
  title = {{Learning Cost Functions for Optimal Transport}},
  year = {2020},
  eprint = {2002.09650},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.09650},
}
Figure