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

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

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.


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

查看所有标签

猜你喜欢:

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

程序员的呐喊

程序员的呐喊

[美]Steve Yegge / 徐旭铭 / 人民邮电出版社 / 2014-5-1 / 45.00元

《程序员的呐喊》的作者是业界知名的程序员—来自google的steve yegge,他写过很多颇富争议的文章,其中有不少就收录在这本书中。本书是他的精彩文章的合集。 《程序员的呐喊》涉及编程语言文化、代码方法学、google公司文化等热点话题。 对工厂业界的各种现象、技术、趋势等,作者都在本书中表达了自己独特犀利的观点。比如java真的是一门优秀的面向对象语言吗?重构真的那么美好吗?强......一起来看看 《程序员的呐喊》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具