# What are the numerical methods for testing for dissimiliarity between image based probability histograms?

I have several probability distribution histograms of images that I am comparing to test for dissimilarity. Each histogram has 256 bins, the bins are common for all histograms.

The images are taken in very low light conditions, using narrow bandpass filters and illuminated by the same light source (with any other light source excluded). Each image is to be compared to the 'dark noise' histograms to determine (if any) dissimilarities exist between the low light image and dark noise distributions.

What is an effective numerical method to determine for testing for dissimiliarity between image based probability histograms?

## 2 Answers

Sounds like a job for the Earth Mover's Distance (or Wasserstein metric).

In computer science, the earth mover's distance (EMD) is a measure of the distance between two probability distributions.

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.

Here's a link to a Python+C implementation (strictly speaking a Python wrapper).

And here's the original implentation by Yossi Rubner: http://ai.stanford.edu/~rubner/emd/default.htm

• Better known as the "Wasserstein metric"; computing such a transport plan is known as "optimal transport". If the cost is proportional to the distance, there's a very efficient algorithm based on the Sinkhorn-Knopp algorithm. @dirk has a nice write-up on his blog. Oct 7 '15 at 17:27
• @ChristianClason yep, removed that from the Wiki quotation (not sure why I did...), thanks though!! Oct 7 '15 at 17:31

You can also use the Bhattachariyya distance, which is very easy to compute.

https://en.m.wikipedia.org/wiki/Bhattacharyya_distance