How do I convert an L2 norm to a probability? I am using the dot product as a way to measure the similarly of two facial-model vectors extracted by a ML algorithm (OpenFace in fact).

I would like to convert the L2 norm to a probability U[0,1] in order to compare with other solutions from other providers that map directly to probabilities but in a blackbox fashion.

By probability I mean the probability that the two vectors represent the same person. So an identical image would give a probability of 1; images of the same person would give a high probability; and orthogonal images (different people, or some suitable toy case) would in the limit have such a probability of zero.

I'd like a uniform distribution for comparison with other providers, but this boils down to knowing what the underlying probability distribution of the feature vectors is.

How do I do this?


Rayleigh distribution CDF
Cosine similarity
(1) is the same as (2)
Draw from a simulated distribution
Arbitrarily scale to U[0,1]
Train into the comparison probability space directly (skipping the feature-vector step)
None of the above
Something else?


Some useful links are:

Cosine similarity versus dot product as distance metrics

http://blog.christianperone.com/2013/09/machine-learning-cosine-similarity-for-vector-space-models-part-iii

http://houseofjeff.com/2015/05/10/using-probability-distribution-and-cosine-similarity-to-automatically-detect-data-contents - this one is almost there?
I guess you either need to train directly into probability space, or train another model on top of the feature vectors to learn the probability of two vectors belonging to the same person.

All the other metrics you could use on top of the feature vectors are a bit arbitrary, as they were not considered by the cost function used when training the original model.