How to pick sameness threshold for face recognition?

For face recognition networks trained with triplet loss, the loss enforces a margin alpha between d(A, P) and d(A, N). But at inference time I believe we need a threshold beta where we say two images X1, X2 are the same person if d(X1, X2) <= beta and different if d(X1, X2) > beta.

How is the threshold chosen? Can the threshold depend on the person?

The triplet loss doesn’t favour any particular threshold, so I imagine after training there could be some people A where d(A, P) can be high (but d(A, N) is much higher) and other people B where d(B, N) is low (but d(B, P) is much lower).

1 Like

It’s good to keep background and other factors similar across faces to avoid this sort of surprise. Thresholds are chosen based on the application and the distribution the images. For example, for a bank entrance door, we’d want to have a high level of confidence for identifying an employee coming in. This level of accuracy might not be required for a classroom since the teacher is likely to do a roll call before end of class.

While playing with the threshold is one way, a better technique might be to fine-tune your model based on a mix of old and more recent data.

1 Like