deface icon indicating copy to clipboard operation
deface copied to clipboard

Limit mask size to filter out unrealistic false positives

Open pradhole opened this issue 2 years ago • 3 comments
trafficstars

  • 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 avatar Jul 21 '23 11:07 pradhole

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.

mdraw avatar Aug 18 '23 19:08 mdraw

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.

pradhole avatar Aug 21 '23 08:08 pradhole

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.

mdraw avatar Oct 06 '23 13:10 mdraw