neuralet icon indicating copy to clipboard operation
neuralet copied to clipboard

Face mask detection detector

Open mhejrati opened this issue 4 years ago • 12 comments

Curate a dataset and build a facemask detection model.

A sample dataset can be found here: https://github.com/VirajDeshwal/mask-detection-dataset

mhejrati avatar Apr 26 '20 21:04 mhejrati

@mhejrati Hi.

I have a face mask detection model (trained on tfod 1.x) which will give good fps on cpu.

if you want i can share the same. if satisfied then you can integrate this option into the main repo.

thanks.

SaddamBInSyed avatar Apr 30 '20 13:04 SaddamBInSyed

There is one face mask detection model available on padddlehub

linux-devil avatar May 01 '20 02:05 linux-devil

@SaddamBInSyed yes, it will be great to test it. What dataset did you train and test it on?

mhejrati avatar May 01 '20 04:05 mhejrati

@linux-devil can you please provide the link?

mhejrati avatar May 01 '20 04:05 mhejrati

@mhejrati

The dataset prepared locally with 10k images by my known person. This was tested with both webcam and CCTV footage and seems works fine.

Mainly this was developed bcz this model works fine with CPU.

Also I came across this below repo who has model for face mask detection

https://github.com/AIZOOTech/FaceMaskDetection

Please have a look and let me know your comments.

Thanks

SaddamBInSyed avatar May 01 '20 07:05 SaddamBInSyed

@mhejrati There you go : https://www.paddlepaddle.org.cn/hub/scene/maskdetect Its pretty good and lightweight , I already tested this model . Not sure how to integrate it here. Above repo was open sourced by Baidu .

linux-devil avatar May 01 '20 18:05 linux-devil

@SaddamBInSyed @linux-devil Thanks a lot for the pointers. Please keep your suggestions about new datasets here.

I am hoping we can crowdsource an open and free large facemask dataset for the community. Looking for help and partners there, please let me know if you have any thoughts.

mhejrati avatar May 08 '20 05:05 mhejrati

Thanks to @mrn-mln for submitting a PR for this :) I will review.

BTW, we should start looking to crowdsource some larger scale dataset for it. Does anyone have thoughts?

mhejrati avatar May 10 '20 05:05 mhejrati

You Can create a page in neuralet.com and invite people to send their own images with mask. Also the user should sign an agreement that confirms that the images are their own images and by signing this he/she give the community the right to use these images for mask detection.

alpha-carinae29 avatar May 11 '20 19:05 alpha-carinae29

@mhejrati , I implemented a Mobilenet-SSD version for face detection and integrate it with a face-mask classifier . The detector detects faces and the detected face is cropped from the original image, and the classifier classifies it to face and mask-face class. I also used a fine-tune Mobilenet-SSD face detector[1]. For both models WIDERFACE dataset is used for training. Moreover, another Mobilenet-SSD has trained with a composed dataset of WIDER Face and MAFA. I evaluated all models and this is the result

` Model | Detector Classes | |BBox Confidence Threshold| | IOU | | mAP |

Mobilenet_SSD_V1_Face | Face | | 0.50 | | 0.50 | | 67.93% |
SSD_MobileNet_V1_Face [1] | Face | | 0.50 | | 0.50 | | 64.71% | Mobilenet_SSD_V1_Face_Mask | Face, Mask | | 0.50 | | 0.50 | | 76.74% | Mobilenet_SSD_V1 + Face_Mask Classifier[2] | Face | | 0.50 | | 0.50 | | 68.87% | SSD_MobileNet_V1 [1] + Face_Mask Classifier[2] | Face | | 0.50 | | 0.50 | | 67.26% |

Evaluation Set: Total Number of Images = 2818 Total Number of Faces = 2020 Total Number of FaceMask = 798

[1] https://github.com/yeephycho/tensorflow-face-detection [2] https://github.com/neuralet/neuralet-models/tree/master/amd64/face_mask_classifier ` Based on the results Mobilenet_SSD_V1_Face_Mask has the best results within all implemented models.

mrn-mln avatar May 15 '20 19:05 mrn-mln

@mhejrati I sent a PR including detector models frozen graph for x86 devices and a quantized tflite model for edgetpu devices at the neuralet-model repo.

mrn-mln avatar May 24 '20 17:05 mrn-mln

I have prepared a face mask dataset with three classes: no_mask, improper_mask, proper_mask

The improper_mask class represents the examples where the mask does not fully cover the nose and/or mouth. The dataset also includes bandanas and untypical masks for training more accurate models.

I will contribute the dataset to the repo after finalizing a few things.

keivan68 avatar Jun 22 '20 09:06 keivan68