# How to move from some arbitrary “distance” to a probability distribution?

I'm doing some object recognition, and when I compare two images, I get some unbounded "distance" between the two images, representing how similar they are. This is somewhat useful, but it seems like it would be more useful if I could move from this "distance" space into a probability space, where instead of " The distance between image A and image B is X ", I could get " P(image is of class B | image A) = X' ".

What is a reasonable way to move from a distance space to a probability space?

-

Distance immediately makes me think of multivariate Gaussian variables because the probability density is a function of the norm of the vector $(x_1, x_2, ..., x_n)$. But I guess in your case it seems that you want to associate a probability with a distance $d$ and not an $n$-tuple of coordinates.

I am afraid there is not a single solution. As @Emre points out, you only need a one-to-one mapping from $R^+$ to $(0,1)$, which will be your cmulative density function, but you won't know how well that mapping will discriminate your object/images.

Here are a couple of suggestions:

1. The exponential distribution
2. The symmetrized Gaussian
3. The Gamma, log-Normal or Weibull distribution (the mode is away from 0, so this assumes that there is a typical distance between two random images).
-
If you want to merely constrain the output to a bounded range, use a continuous transformation like $d \to 1-\exp(-d)$, where $d$ is the distance.