Can your face model handle masks prevalent due to COVID-19?

栏目: IT技术 · 发布时间: 3年前

Can your face model handle masks prevalent due to COVID-19?

Yesterday, I was talking to a friend regarding developing a model that could detect masks on faces. Based on some insights she gave me, I started looking for datasets with masks. But then a question struck my mind!

Will we have to update all our face models to accommodate face detection with masks on?

I was intrigued to find the answer and honestly expected that my previous model would probably fail at this. Let’s see what I found in my research.

iPhone Face ID

Can your face model handle masks prevalent due to COVID-19?

Photo by Harpal Singh on Unsplash

If you have one of the latest iPhones that has a Face ID detection system to unlock your phone, you would be having trouble just like me while wearing a mask. Because most of the face is covered, the system is unable to decipher the exact face and hence, fails to unlock the device.

I try to go out for a walk and have to keep track of the time, next song to be played and steps taken. I have to constantly keep unlocking my device to check these stats. This gets very annoying as I always have a mask on and it takes an extra 5–10 seconds for it to ask for a passcode rather than Face ID and then for me to type it in.

Apple recently released a new iOS version 13.5 which detects a face with a mask and directly prompts the passcode option, which makes it super easy and saves time too.While this is great, the original system is still broken as I can no longer use Face ID with my mask. It’s understandable that it cannot rely on just half of the face but it is just an extra overhead that we’d like to avoid.

Security triumphs always!

Face detection model

While systems such as Face ID cannot compromise security, what about other models that just detect face and are not intended for security. One possible scenario could be counting the number of people (faces) in a gathering to get a rough estimate of the people that showed up.

To test this, I decided to use a model that I had used previously for detecting faces. The code is available below:

Honestly, I expected that the model is also likely to fail given that most of the face covered with a mask, doesn’t clearly resemble a face. Furthermore, the model is not trained on faces with masks.

However, the results are surprising.

The model was accurately able to detect faces even when they had their masks on and that too with a very high confidence.

I can think of two reasons why the model worked:

  • Firstly, the model analyzes the change in pixel values to detect the face. Even with the mask on, the change in intensity of pixel values between background and face is noticeable.
  • The general structure of the face is still the same even when the mask is on the face and hence, the model is probably able to identify the face.

Below are a few images I tested. All images are taken from https://unsplash.com/

Also note the face detector file expects a PNG file, so I had to update the code such that it accepts a JPG file.

Images with no face masks

Can your face model handle masks prevalent due to COVID-19?

Can your face model handle masks prevalent due to COVID-19?

Can your face model handle masks prevalent due to COVID-19?

Can your face model handle masks prevalent due to COVID-19?

Notice how the model is performing exceptionally well with faces without masks. A confidence value of above 90% for all images.

Images with face masks

Can your face model handle masks prevalent due to COVID-19?

Can your face model handle masks prevalent due to COVID-19?

Can your face model handle masks prevalent due to COVID-19?

Can your face model handle masks prevalent due to COVID-19?

We notice that the model still identifies the faces correctly and for the most part, the confidence is pretty high too (not 100% in any case).

Conclusion

Contrary to what I originally expected, not all models need to be updated. We need to carefully identify all the use cases where face detection models are currently used and might need re-training.

We note that face detection models may need to be updated to accommodate the new trends introduced by COVID-19, which is the frequent use of masks when going out or in gatherings.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

C++ Primer 中文版(第 4 版)

C++ Primer 中文版(第 4 版)

Stanley B.Lippman、Josée LaJoie、Barbara E.Moo / 李师贤、蒋爱军、梅晓勇、林瑛 / 人民邮电出版社 / 2006 / 99.00元

本书是久负盛名的C++经典教程,其内容是C++大师Stanley B. Lippman丰富的实践经验和C++标准委员会原负责人Josée Lajoie对C++标准深入理解的完美结合,已经帮助全球无数程序员学会了C++。本版对前一版进行了彻底的修订,内容经过了重新组织,更加入了C++ 先驱Barbara E. Moo在C++教学方面的真知灼见。既显著改善了可读性,又充分体现了C++语言的最新进展和当......一起来看看 《C++ Primer 中文版(第 4 版)》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试