搬土距离(Earth Mover's Distance)

搬土距离(The Earth Mover‘s Distance,EMD)最早由Y. Rubner在1999年的文章《A Metric for Distributions with Applications to Image Databases》中提出,它是归一化的从一个分布变为另一个分布的最小代价,因此可用于表征两个分布之间的距离。

例如,对于图像而言,它可以看做是由色调、饱和度、亮度三个分量组成,每个分量的直方图就是一个分布。不同的图像对应的直方图不同,因此图像之间的距离可以用直方图的距离表征,这时就可以用EMD进行计算。

EMD需要求解运输问题,其运算复杂度较高,平均而言至少是二次方级别。但是它作为距离函数,有一个非常好的特点是存在下界——两个分布的质心之间的距离,因此在粗略计算时,可以考虑用分布质心之间的距离代替EMD。

The Earth Mover‘s Distance

The Earth Mover‘s Distance (EMD) is a method to evaluate dissimilarity between two multi-dimensional distributions in some feature space where a distance measure between single features, which we call the ground distance is given. The EMD ``lifts‘‘ this distance from individual features to full distributions.

Intuitively, given two distributions, one can be seen as a mass of earth properly spread in space, the other as a collection of holes in that same space. Then, the EMD measures the least amount of work needed to fill the holes with earth. Here, a unit of work corresponds to transporting a unit of earth by a unit of ground distance.

A distribution can be represented by a set of clusters where each cluster is represented by its mean (or mode), and by the fraction of the distribution that belongs to that cluster. We call such a representation the signature of the distribution. The two signatures can have different sizes, for example, simple distributions have shorter signatures than complex ones.

Computing the EMD is based on a solution to the well-known transportation problem [1]. Suppose that several suppliers, each with a given amount of goods, are required to supply several consumers, each with a given limited capacity. For each supplier-consumer pair, the cost of transporting a single unit of goods is given. The transportation problem is then to find a least-expensive flow of goods from the suppliers to the consumers that satisfies the consumers‘ demand. Matching signatures can be naturally cast as a transportation problem by defining one signature as the supplier and the other as the consumer, and by setting the cost for a supplier-consumer pair to equal the ground distance between an element in the first signature and an element in the second. Intuitively, the solution is then the minimum amount of ``work‘‘ required to transform one signature into the other.

This can be formalized as the following linear programming problem: Let  be the first signature with m clusters, where pi is the cluster representative and wpi is the weight of the cluster;  the second signature with n clusters; and  the ground distance matrix where dij is the ground distance between clusters pi and qj.

We want to find a flow , with fij the flow between pi and qj, that minimizes the overall cost

subject to the following constraints:

The first constraint allows moving ``supplies‘‘ from P to Q and not vice versa. The next two constraints limits the amount of supplies that can be sent by the clusters in P to their weights, and the clusters in Q to receive no more supplies than their weights; and the last constraint forces to move the maximum amount of supplies possible. We call this amount the total flow. Once the transportation problem is solved, and we have found the optimal flow , the earth mover‘s distance is defined as the work normalized by the total flow:

The normalization factor is introduced in order to avoid favoring smaller signatures in the case of partial matching.

The EMD has the following advantages

  • Naturally extends the notion of a distance between single elements to that of a distance between sets, or distributions, of elements.
  • Can be applied to the more general variable-size signatures, which subsume histograms. Signatures are more compact, and the cost of moving ``earth‘‘ reflects the notion of nearness properly, without the quantization problems of most other measures.
  • Allows for partial matches in a very natural way. This is important, for instance, for image retrieval and in order to deal with occlusions and clutter.
  • Is a true metric if the ground distance is metric and if the total weights of two signatures are equal. This allows endowing image spaces with a metric structure.
  • Is bounded from below by the distance between the centers of mass of the two signatures when the ground distance is induced by a norm. Using this lower bound in retrieval systems significantly reduced the number of EMD computations.
  • Matches perceptual similarity better than other measures, when the ground distance is perceptually meaningful. This was shown by [2] for color- and texture-based image retrieval.

More details on the EMD can be found in [2].

1 F. L. Hitchcock.

The distribution of a product from several sources to numerous localities.
J. Math. Phys., 20:224-230, 1941.

2 Y. Rubner, C. Tomasi, and L. J. Guibas.
A metric for distributions with applications to image databases.
In IEEE International Conference on Computer Vision, pages 59-66, January 1998.

From:http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/RUBNER/emd.htm

搬土距离(Earth Mover's Distance)

时间: 2024-10-10 00:29:35

搬土距离(Earth Mover's Distance)的相关文章

图像检索之EMD距离(Earth Mover's Distance)

在理解EMD距离模型时,需要先对<运筹学>中运输问题,做一下了解.下面给出几个运输问题的小例子,作为补充知识: 那么,对于上述问题我们发现是一个 产量=销量=500 ,即产销平衡的问题,可以提出这样的数学模型: 假设运到物品的个数为,用代表运到单个物品的运费(在上述表格中都有),用表示产地的产量,表示销地的销量,则总运费为,使总运费最小的数学模型为: 还有令两种可能就是 产量>销量 或者 产量<销量,这里不做模型的讨论,上面三种运输问题都可以用单纯形法进行求解.因为只有当"

[转][译]一种度量准则:推土机距离Earth Mover&#39;s Distance(EMD)

以下内容为罗方炜译: Earth mover's distance In computer science, the earth mover's distance (EMD) is a measure of the distance between two probability distributions over a region D. In mathematics, this is known as the Wasserstein metric. Informally, if the di

Distributed Sentence Similarity Base on Word Mover&#39;s Distance

Algorithm: Refrence from one ICML15 paper: Word Mover's Distance. 1. First use Google's word2vec tool to get distributed word representing aka. word vectors. 2. Then use earth mover's distance as similarity measure metric. 3. Solve the EMD problem as

反距离权重插值inverse distance weighting,IDW

反距离权重 (IDW) 插值显式假设:彼此距离较近的事物要比彼此距离较远的事物更相似.当为任何未测量的位置预测值时,反距离权重法会采用预测位置周围的测量值.与距离预测位置较远的测量值相比,距离预测位置最近的测量值对预测值的影响更大.反距离权重法假定每个测量点都有一种局部影响,而这种影响会随着距离的增大而减小.由于这种方法为距离预测位置最近的点分配的权重较大,而权重却作为距离的函数而减小,因此称之为反距离权重法.

如何使用SAS计算Word Mover的距离

Word Mover的距离(WMD)是用于衡量两个文档之间差异的距离度量,它在文本分析中的应用是由华盛顿大学的一个研究小组在2015年引入的.该小组的论文" 从Word嵌入到文档距离"发表了在第32届国际机器学习大会(ICML)上.在本文中,他们证明了WMD度量导致8个真实世界文档分类数据集中前所未有的低k-最近邻文档分类错误率. 他们利用单词嵌入和WMD对文档进行分类,这种方法相对于传统方法的最大优点是它能够将单个单词对(例如总统和奥巴马)之间的语义相似性合并到文档距离度量中.以传统

概率分布之间的距离度量以及python实现

1. 欧氏距离(Euclidean Distance)       欧氏距离是最易于理解的一种距离计算方法,源自欧氏空间中两点间的距离公式.(1)二维平面上两点a(x1,y1)与b(x2,y2)间的欧氏距离:(2)三维空间两点a(x1,y1,z1)与b(x2,y2,z2)间的欧氏距离:(3)两个n维向量a(x11,x12,-,x1n)与 b(x21,x22,-,x2n)间的欧氏距离:(4)也可以用表示成向量运算的形式: python中的实现: 方法一: import numpy as np x=

概率分布之间的距离度量以及python实现(四)

1.f 散度(f-divergence) KL-divergence 的坏处在于它是无界的.事实上KL-divergence 属于更广泛的 f-divergence 中的一种. 如果P和Q被定义成空间中的两个概率分布,则f散度被定义为: 一些通用的散度,如KL-divergence, Hellinger distance, 和total variation distance,都是f散度的一种特例.只是f函数的取值不同而也. 在python中的实现 : import numpy as np imp

直方图 陆地移动距离 cvCalcEMD2 基于HSV的HS

程序: HSize=30,SSize=32:比例为2.89 HSize=20,SSize=20:比例为2.88 HSize=50,SSize=50:比例为2.87 代码: #include "cv.h" #include "cxcore.h" #include "highgui.h" #include <iostream> CvHistogram* histogram(IplImage* src,int HSize,int SSize

W-GAN系 (Wasserstein GAN、 Improved WGAN)

习总结于国立台湾大学 :李宏毅老师 Wasserstein GAN  .  Improved Training of Wasserstein GANs 本文outline 一句话介绍WGAN: Using Earth Mover's Distance to evaluate two distribution    Earth Mover's Distance(EMD) = Wasserstein Distance 一. WGAN 1.  Earth Mover's Distance(EMD) E