CompreFace icon indicating copy to clipboard operation
CompreFace copied to clipboard

Always detects unfamiliar people as someone i've trained

Open dodgeboy opened this issue 4 years ago • 5 comments

Face recognition is working great for me, with one huge exception. It detects everyone (package delivery people, mail man, etc.) as one of the faces I've trained. Even if the person looks nothing like one of the trained subjects, it seems to pick the closest one and match it. Is there a way to configure it so that unknown people don't match as one of the subjects I've trained?

dodgeboy avatar Nov 11 '22 15:11 dodgeboy

All machine learning systems work in a way where it predicts one of the known classes with a certain probability. The idea here is the same - we always return the closest match, but we return the similarity with it, so you need to decide if it's big enough to trust. Here you can find considerations of how to choose this threshold: https://github.com/exadel-inc/CompreFace/blob/master/docs/Face-Recognition-Similarity-Threshold.md

pospielov avatar Nov 16 '22 20:11 pospielov

That link does a good job of describing how to determine what the threshold should be set to, but I cannot figure out where to set it. Which file is it in?

dodgeboy avatar Nov 22 '22 21:11 dodgeboy

Hi @pospielov, I am also wondering, if the system always predicts one of the known classes with a certain probability then why is there a "No known faces" in the webcam demo? Sometimes it would show unknown faces with a known face but with very low similarity and other times it would just out "No known faces".

abuelgasimsaadeldin avatar Nov 23 '22 03:11 abuelgasimsaadeldin

That link does a good job of describing how to determine what the threshold should be set to, but I cannot figure out where to set it. Which file is it in?

@dodgeboy, this should be your custom logic on your side. CompreFace always will return you result, but on your side, you need to write something like this: if result_similarity < threshold: return "No known faces"

Hi @pospielov, I am also wondering, if the system always predicts one of the known classes with a certain probability then why is there a "No known faces" in the webcam demo? Sometimes it would show unknown faces with a known face but with very low similarity and other times it would just out "No known faces".

I don't remember how it is implemented, but this is definitely custom logic of the demo, you can look at the implementation and write something similar

pospielov avatar Nov 23 '22 11:11 pospielov

Thank you for the responses!

dodgeboy avatar Nov 23 '22 11:11 dodgeboy