On the Computation of Kantorovich-Wasserstein Distances between 2D-Histograms by Uncapacitated Minimum Cost Flows

Federico Bassetti, Stefano Gualandi, Marco Veneroni
4/2/2018
13 citations
math.OCstat.ML

Official code: stegua/dotlib (7 stars, C++, MIT, last commit 2023-03-03).

Abstract

In this work, we present a method to compute the Kantorovich-Wasserstein distance of order one between a pair of two-dimensional histograms. Recent works in Computer Vision and Machine Learning have shown the benefits of measuring Wasserstein distances of order one between histograms with $n$ bins, by solving a classical transportation problem on very large complete bipartite graphs with $n$ nodes and $n^2$ edges.

Show full abstract

The main contribution of our work is to approximate the original transportation problem by an uncapacitated min cost flow problem on a reduced flow network of size $O(n)$ that exploits the geometric structure of the cost function. More precisely, when the distance among the bin centers is measured with the 1-norm or the $\infty$-norm, our approach provides an optimal solution. When the distance among bins is measured with the 2-norm: (i) we derive a quantitative estimate on the error between optimal and approximate solution; (ii) given the error, we construct a reduced flow network of size $O(n)$. We numerically show the benefits of our approach by computing Wasserstein distances of order one on a set of grey scale images used as benchmark in the literature. We show how our approach scales with the size of the images with 1-norm, 2-norm and $\infty$-norm ground distances, and we compare it with other two methods which are largely used in the literature.

View on arXivView PDF

Code Implementations(1)

stegua/dotlibOfficial100%
MIT

Dot Lib

70C++, Jupyter NotebookApr 7, 20173 years agoMIT
cpp11earth-movers-distanceoptimal-transportpythonwasserstein

Similar Papers

Cite this paper

@article{bassetti2018computation,
  title  = {On the Computation of Kantorovich-Wasserstein Distances between 2D-Histograms by Uncapacitated Minimum Cost Flows},
  author = {Federico Bassetti and Stefano Gualandi and Marco Veneroni},
  year   = {2018},
  eprint = {1804.00445},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1804.00445}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1804.00445.svg)](https://codeofpaper.com/paper/1804.00445)

Discussion