In the context of face recognition I have the following histogram:
blue bins count the comparison distances for "self matches" (comparing two images of the same person). Orange bins count the distances for cross matches (different persons).
The distance is the value returned by the neural networks as the result of a comparison between two faces, how much two "faces vectors" (embeddings) differ.
I'm looking for a function that, given a distance, can tell how likely it is for two pictures to be from the same person.
This function should be look like this red line (with a different y-scale):
So with distance 0.5 it is extremely likely, with distance 1.4 it is close to a 50% chance.
Is there such a function? How is it called?
It is similar to this question but also very different. In my case a very small z-value (distance) still means high confidence even if it is many standard deviations away from the mean. The same is true for a value like 1.0.
This question is very similar too but I'd like to extract the distance to probability mapping function from actual measurements, on a reference dataset, and not from the distance by itself. So this should not depend on the loss or distance definition but on the data distribution alone.
EDIT: I think I could compute the AUC at different thresholds like shown here. But this will give me a single bell centered in the middle of the two peaks, quite different from what I'm looking for.