What is confidence in OpenCV FaceRecognizer?

I am working on a face recognition project using OpenCV FaceRecognizer, making gender differentiation. The algorithm works very well, but I wanted to implement some additional functions in my program, such as confidence in prediction.

The prediction function can output a confidence level, but I'm not sure what that means. What really measures this confidence, and can I convert it to percent?

int predictedLabel = -1; double confidence = 0.0; model->predict(face_resized, predictedLabel, confidence); string result_message = format("Predicted class = %d / Confidence = %d.", predictedLabel, confidence); cout << result_message << endl; 

This is what the output looks like. https://www.dropbox.com/s/65h1n5180ulz3hl/facerecConfidence%20.jpg

+7
source share
1 answer

Here is a brief discussion of how this distance is indeed in the OpenCV user list here .

To summarize, the function is used:

 distance = 1.0f - sqrt( distSq / (float)(nTrainFaces * nEigens) ) / 255.0f 

However, the author of the function says that this is a very rough guide, not a complete guide to the proof. See Link to a discussion of the user list for a link to a document and an alternative metric suggestion.

+7
source

All Articles