Sunday, 20 September 2020

FACE MASK DETECTOR









Introduction to Project - 


The world is fighting with Covid19 pandemic. There are so many essential equipments needed to fight against Corona virus. One of such most essential is Face Mask. Firstly face mask was not mandatory but as the day progresses scientist and Doctors have recommended everyone to wear face mask. Now to detect whether a person is wearing Face Mask or not, we can use Face Mask Detection Technique. Face Mask Detection technique we can detect f a person does/doesn’t wear a mask. The application can be associated with any current or new IP cameras to identify individuals with/without a mask. In this blog we will see many important aspect of face mask detection not only for Covid19 cases but also for other regular cases.


I’ve created a project using technologies like Machine Learning and DevOps approach, Titled as “Mask Detector”. As it’s very difficult to every time sit in front of computer screen and indentify that a person is with or without mask. This project can help as it can automatically detect the person is without mask. Also it can be used with an alarm system.

 

 

Technologies Used: I’ve used Deep Learning approch to train the CNN model. Also Haar cascade to detect the face of person in camera.

 

Technologies Used- Machine learning concepts:

Ø  Deep Learning:- It helps to predict my model with good accuracy.

Ø  CNN(Convolutional Neural Networks):- It is used during training of models and helps to increase the accuracy of models.

 

Training of model:

Ø  Supervisely:- It helps in annotations for my dataset and also increasing my Dataset.

Ø  AWS(Amazon Web Services):- In this I launch the Deep Learning AMI instance for training my model.

 

Also, I’ve created a Docker environment using the concept of containerization we can create a separate environment where we train our machine learning model. So that we don’t face any dependencies issue. I’ve also used Jenkins for CI/CD as it pulls the ML code and data from GitHub and does the further automatic process.

 

Conclusion:  The whole process is when the developer pushes the ML model with the dataset to GitHub, Jenkins being a CI/CD tool pulls the code automatically as soon as it senses the code has been uploaded to some Source Control Management System and perform the task i.e building Docker images and run our ML code in a docker environment.

 

Future Scope: The future scope of this project as it can be installed with CCTV cameras also with Web-camera, there will be no need for a person to watch the people all the time. It can be used with an alarm system as it can alarm if someone is detected without mask.

 

Building The Project - 


  • A dataset of over 4000 photos is used to train the project. The directories are saperated in with_mask or without_mask (train and test) folder.
  • CNN Deep learning concept is used to train the model.
  • The Model is trained on AWS by using RDP protocol.

Training the Model - 

Importing layers - 




Architecture of the Model - 








Model Summary - 



 Image generator - 



Loading The Dataset - 




Training and Saving Our Model - 





Using Our Trained Model




We can use this model by 2 ways, we can predict through live stream of video, or we can predict with image.



Loading Our trained model -



 


Function to Draw prediction On image -



 Detecting the face to Prediction - 




Using Model To predict live - 



Using Model To predict from Image -


Function to get Random Image - 


Predicting From Image - 
  

Final Output - 





with mask



without mask




Application Of the Project - 
    
    The appication of this project as it can be installed with CCTV cameras also with Web-camera, there will be no need for a person to watch the people all the time. It can be used with an alarm system as it can alarm if someone is detected without mask.

    It can be used in Hospitals, Educational Institutions, Airports, Offices. As it's strictly recommend to wear mask, or it  may lead to spreading of virus, using this project method it'll be easy to identify a person without mask.

Project Team : 
    Tushar Sharma
    Vishal Kumar


FACE MASK DETECTOR

Introduction to Project -  The world is fighting with Covid19 pandemic. There are so many essential equipments needed to fight ag...