学术常识—EMD(earth mover distance)距离

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 distributions are interpreted as two different ways of piling up a certain amount of dirt over the region D, the EMD is the minimum cost of turning one pile into the other; where the cost is assumed to be amount of dirt moved times the distance by which it is moved [1].

在计算机科学与技术中,地球移动距离(EMD)是一种在D区域两个概率分布距离的度量,就是被熟知的Wasserstein度量标准。不正式的说,如果两个分布被看作在D区域上两种不同方式堆积一定数量的山堆,那么EMD就是把一堆变成另一堆所需要移动单位小块最小的距离之和。

The above definition is valid only if the two distributions have the same integral (informally, if the two piles have the same amount of dirt), as in normalized histograms orprobability density functions. In that case, the EMD is equivalent to the 1st Mallows distance or 1st Wasserstein distance between the two distributions [2] [3].

上述的定义如果两个分布有着同样的整体(粗浅的说,就像两个堆有着同样的数量),在规范化的直方图或者概率密度函数上。在这基础上,EMD等同于两个分布的第一Mallows距离或者第一Wasserstein距离。

 

Extensions

Some applications may require the comparison of distributions with different total masses. One approach is to allow for a partial match, where dirt from the most massive distribution is rearranged to make the least massive, and any leftover "dirt" is discarded at no cost. Under this approach, the EMD is no longer a true distance between distributions. Another approach is to allow for mass to be created or destroyed, on a global and/or local level, as an alternative to transportation, but with a cost penalty. In that case one must specify a real parameter σ, the ratio between the cost of creating or destroying one unit of "dirt", and the cost of transporting it by a unit distance. This is equivalent to minimizing the sum of the earth moving cost plus σ times the L1 distance between the rearranged pile and the second distribution.

一些应用需要比较不同总量的分布。一种方法是允许部分匹配,从最大分布上重新安排一些颗粒去产生最少的量,剩下多余的颗粒就被忽视不需要代价。这样的方法,EMD就不是真正两个分布间的距离。另外的方法允许块产生或销毁,在全局或局部范围,可以选择性的转变,但需要花费代价。那样的花,需要指定实数参数σ,这个σ表示产生或销毁一个单位一个距离颗粒所需要的花费。这就等同于最小化地球移动距离总和,花费σ倍重新堆和第二个分布的L1距离。

Computing the EMD

If the domain D is discrete, the EMD can be computed by solving an instance transportation problem, which can be solved by the so-called Hungarian algorithm. In particular, ifD is a one-dimensional array of "bins" the EMD can be efficiently computed by scanning the array and keeping track of how much dirt needs to be transported between consecutive bins.

如果D域是离散的,那么EMD可以用运输问题的Hungarian算法来计算他们的距离。特别的,如果D是一维的数组格子,你们EMD可以有效的通过扫描数组并记录有多少颗粒需要传送于两个连续格子来计算。

External links

§                     C code for the Earth Mover's Distance

§                     C++ and Matlab and Java wrappers code for the Earth Mover's Distance, especially efficient for thresholded ground distances

References

1.                             ^ Formal definition

2.                             ^ Elizaveta Levina; Peter Bickel (2001). "The EarthMover’s Distance is the Mallows Distance: Some Insights from Statistics". Proceedings of ICCV 2001 (Vancouver, Canada): 251–256.

3.                             ^ C. L. Mallows (1972). "A note on asymptotic joint normality". Annals of Mathematical Statistics 43 (2): 508–515. doi:10.1214/aoms/1177692631.

4.                             a b S. Peleg; M. Werman, and H. Rom (1989). "A unified approach to the change of resolution: Space and gray-level". IEEE Transactions on Pattern Analysis and Machine Intelligence 11: 739–742.doi:10.1109/34.192468.

5.                             ^ "Mémoire sur la théorie des déblais et des remblais". Histoire de l’Académie Royale des Science, Année 1781, avec les Mémoires de Mathématique et de Physique. 1781.

6.                             ^ J. Stolfi, personal communication to L. J. Guibas, 1994

7.                             ^ Yossi Rubner; Carlo Tomasi, Leonidas J. Guibas (1998). "A Metric for Distributions with Applications to Image Databases". Proceedings ICCV 1998: 59–66.

 

 

————罗方炜译

载自:http://en.wikipedia.org/wiki/Earth_mover's_distance

http://en.wikipedia.org/wiki/Transportation_problem

  • 0
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
### 回答1: emd距离是指两个概率分布之间的差异度量,专门用于衡量两个分布之间需要通过最小代价转移来匹配的差异程度。而Matlab是一种常用的编程软件,可以用于进行数据处理、算法开发等工作。 在Matlab中,计算emd距离可以借助一些工具箱或自定义函数来实现。例如,可以使用Matlab自带的Statistics and Machine Learning Toolbox中的`emd`函数来计算emd距离。这个函数可以接受两个输入参数,分别为表示两个概率分布的向量,并返回它们之间的emd距离。 在使用`emd`函数时,需要首先确保数据的格式正确。通常可以将概率分布转化为一维向量,其中每个元素表示对应的概率值。然后将这两个向量作为输入传递给`emd`函数,即可得到它们之间的emd距离。 此外,还可以使用第三方函数包来计算emd距离,如`pyemd`包。这个包可以通过调用Python解释器来实现。首先需要在Matlab中调用Python解释器,并安装`pyemd`包。然后,可以通过调用`pyemd`中的函数来计算emd距离,传入对应的概率分布作为参数。 综上所述,Matlab提供了多种方法和工具来计算emd距离。不论是使用自带的函数还是第三方函数包,都可以满足计算emd距离的需求。通过使用Matlab的强大功能,我们可以方便地进行emd距离的计算和应用。 ### 回答2: emd距离全称为Earth Mover's Distance,又称为汉明顿距离,是一种用于度量两个概率分布之间差异的算法。它可以用于解决一些图像处理、机器学习和计算机视觉等领域的问题。 EMD距离Matlab中有多种实现方式。其中一个常用的方法是通过调用Image Processing Toolbox中的emd函数来计算。该函数基于最小距离算法,使用线性编程技术求解两个分布之间的最小距离,返回值为两个分布之间的EMD距离。 在Matlab中计算EMD距离的步骤如下: 1. 首先,需要准备两个概率分布作为输入。可以使用Matlab中的统计工具对数据进行统计分析得到概率分布,也可以直接输入已有的概率分布数据。 2. 然后,调用emd函数并传入两个概率分布作为参数,即可计算得到它们之间的EMD距离。 3. 最后,根据实际需要对距离结果进行解释和应用。 Matlabemd函数还支持其他可选参数,比如可以指定两个分布之间的距离矩阵,以及在计算中考虑约束条件等。此外,Matlab中还有其他一些函数可以进行EMD距离的计算,如pdist2和emd_hat等等。 总之,EMD距离是一种用于衡量两个概率分布差异的重要指标,Matlab提供了方便的工具来计算和应用这个距离。 ### 回答3: emd距离Earth Mover's Distance)是一种用于衡量两个概率分布之间差异的指标。它在计算机视觉、图像处理等领域广泛应用。 Matlab是一种面向科学与工程计算的高级编程语言和环境,能够进行数值计算、数据可视化和算法开发等任务。 在Matlab中,可以使用一些函数来计算emd距离。其中,emd函数是一个常用的用于计算两个概率分布之间的emd距离的函数。它的基本用法是首先构建两个概率分布的直方图,并将它们作为输入传递给emd函数,然后该函数会返回这两个分布之间的emd距离。 具体而言,使用emd函数时,需要提供两个直方图向量作为输入,这些直方图向量表示待比较的两个概率分布。同时,还需要指定其他参数,比如距离矩阵。距离矩阵是用于计算两个直方图之间的距离的,它通常根据直方图元素之间的欧氏距离或者其他定义好的距离计算方法进行构建。 通过调用emd函数,可以得到两个概率分布之间的emd距离。这个距离值越小,表示两个分布越相似;反之,距离值越大,表示两个分布越不同。 总之,通过Matlab中提供的emd函数,我们可以方便地计算两个概率分布之间的emd距离,用于度量它们之间的差异。这对于分析、比较和处理不同的概率分布具有重要意义。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值