Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit mask size to filter out unrealistic false positives #43

Open
pradhole opened this issue Jul 21, 2023 · 3 comments · May be fixed by #44
Open

Limit mask size to filter out unrealistic false positives #43

pradhole opened this issue Jul 21, 2023 · 3 comments · May be fixed by #44

Comments

@pradhole
Copy link

  • In typical face anonymization use cases, the camera typically is stably mounted to view a scene.
  • Minimizing false negatives is more important than false positives since anonymization takes higher preference. Therefore, selection of lower --thresh value is preferable.
  • Variable lighting conditions also generate false positives which are unrealistic to the scene.

Solution

  • Implement --scorethresh that can be tuned to throw out masks with lower scores.
  • Implement --scalelim that can be tuned to throw out masks unrealistically large for the scene in consideration.
pradhole added a commit to pradhole/deface that referenced this issue Jul 21, 2023
@mdraw
Copy link
Member

mdraw commented Aug 18, 2023

Can you please give an example where these new options would be helpful, preferably with example images? I'm not sure if I understand the advantage over just tuning the --thresh value.

@pradhole
Copy link
Author

Hi @mdraw ,

  • The --scalelim argument is super helpful for face anonymization where there is certainty that faces do not become larger than a particular size in the mounted camera field of view (camera at a traffic signal). I cannot upload the images from project I am working on due to CDA; but there have been cases where large anonymization masks were created (false positives) which obscured large portion of field of view. These are created due to sensitive and variable lighting conditions where background is seen as face. I was able to prevent these large masks from being applied just by setting this optional value.
  • The --scorethresh argument is used to tune applications of masks quicker as a second level of adjustment. The --thresh argument can be compounded with --scorethresh to drop masks with very low confidence to reduce amount of false positives in camera field of view.
    I used these two additional arguments to make my anonymizations cleaner and as much as possible only applied to faces.

@mdraw
Copy link
Member

mdraw commented Oct 6, 2023

Thanks for the explanation and sorry for the late reply. I understand that the --scalelim argument can be useful but it is still not clear to me what --scorethresh can achieve that --thresh can't. --thresh is applied directly on the heatmap output of the neural network model to filter out candidates with low scores here, before applying non-maximum-suppression (NMS): https://github.com/ORB-HD/deface/blob/master/deface/centerface.py#L138
--scorethresh is applied after NMS, so it doesn't have exactly the same effect, but to my understanding, everything that --scorethresh can filter can also be filtered by tuning the --thresh value, which also trades off the false positive/false negative ratio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants