Face Mask Detection System Using Artificial Intelligence

Page 1

Face Mask Detection System Using Artificial Intelligence

Abstract - In current situation , Covid-19 has not totally go out same cause is arrving is day by day made us realize the importance of Face Masks and we need to understand the lots of effects of not wearing the face mask, now more than at that time. Right now, there are no mask detectors installed at the crowded places. But we have confidence in that it is of extreme significance that at transportation link, crowded populated domestic place, markets, educational institutions and healthcare areas, it is now very neccessary to take place face mask detectors model to make sure the protect to the public. We have take effortes to develop a two phased for face mask detector in this pepar which will be simple to implement at the discribe outlets. According to the Computer Vision, so now it is happend to detect and observe this on large scale. We have used CNN for the implementation of our model. The development process is completed in Python, and the python code implementation will help to train our face mask detector on our training dataset with the help of Keras and Tensorflow. We have added more robust features and trained our model on various variations, we made sure to have large various and make large dataset so this system is capable to clearly determine and detection in real time videos to identify the face mask. The trained model was tested on both real-time videos and stable image and in that both the cases system was more accurate as compared to other models.

Key Words: Traning Model, Object Detection, Face Detection, Mask Detection, Email Alert System.

1. INTRODUCTION

Inthelastfewyears,wehaveseenScienceandTechnology advancing so much that now we are at a stage where, we knowthatwiththerightknowledgeofthetechnology,the humanscanachievethingsthatseemednearlyimpossible just a few decades ago. Now, we have the advancing technologies and knowledge of Machine Learning and Artificial Intelligence, which has been proven to ease our livesfromthemicrolevelstobigimpossibletasks.Inthelast fewyears,therehasbeena riseintheonsetofalgorithms thathavebeenproventobethesolutiontoourcomplex,life threateningproblems.Onesuchfieldistheimageandobject detection, which has helped us find and spot people and thingswithjustoneclick.Computer Vision plays a crucial roleinourlivesnow. Who wouldhavethoughtthat while sittinginonecityyoucaneasilyspotthepeopleintheother cities? It's almost unimaginative how Computer vision is nowaveryinnovativeaspectofthetechnology.In2019,the wholeworldwitnessedtheonsetofthedeadlyCoronaVirus,

whichnow,stillafteralmostayearhasnotleftusandisstill makingthehumanracefightforits.

Inthelastfewyears,wehaveseenScienceandTechnology advancing so much that now we are at a stage where, we knowthatwiththerightknowledgeofthetechnology,the humanscanachievethingsthatseemednearlyimpossible just a few decades ago. Now, we have the advancing technologies and knowledge of Machine Learning and Artificial Intelligence, which has been proven to ease our livesfromthemicrolevelstobigimpossibletasks.Inthelast fewyears,therehasbeena riseintheonsetofalgorithms thathavebeenproventobethesolutiontoourcomplex,life threateningproblems.Onesuchfieldistheimageandobject detection, which has helped us find and spot people and thingswithjustoneclick.Computer Vision plays a crucial roleinourlivesnow. Who wouldhavethoughtthat while sittinginonecityyoucaneasilyspotthepeopleintheother cities? It's almost unimaginative how Computer vision is nowaveryinnovativeaspectofthetechnology.In2019,the wholeworldwitnessedtheonsetofthedeadlyCoronaVirus, whichnow,stillafteralmostayearhasnotleftusandisstill makingthehumanracefightforits“FACEMASKDETECTION SYSTEM USING AI” “AVCOE, Department of Electronics & Telecommunication Engineering 2022-23” 2 existence. In between the survival fights, we have realized how technologyisverymuchouronlylifesaver.Fromextensive internet facilities to 24/7 services online, technology has beenourtruecompanioninthesehardtimes.Butevenwhen wehave everythingpresent atoneclick,therecan'tbe no livesoutside.Inthepastfewmonths everycountry,every statehasfound itsown new normstofightthe pandemic. Andnomatterwhat wedo, wedo need tostep outside to survive.Schools,Offices,Colleges,Markets,Transportation, arethefewcrucialcheckpointsforanycountry.Asmuchas weaskthepublictobesafe,thepeoplemisstheir[without any restrictions lives. And so, it is now very important to closely watch the public and make them understand the importanceofthetinyandsmalldetailsofsurvivalkit.One suchcrucialfactoristheextensiveusageoffacemasksinour lives.Studieshaveproventhatwiththehelpofuseofface masks, we can lower the chances of catching the Corona Virusby80to85%,ifit'susedproperly.But,evenso,itis nearlyimpossibletoenforcethefacemaskscompletelyon thehumanrace.WiththehelpofAIandComputerVision,we have the best chance at enforcing the mask policy on the humans.Withthehelpofoursystem,weaimondetecting the presence of face masks on static images and real time videos. Object detection, Classification, Regression, image

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 04 | Apr 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page966
5
***
Aute Sayali.S1 , Bhalerao Pooja.B2 , Chaudhari Dipak.S3 , Shermale Rahul.R4 , Prof.kawade.S.B
1,2,3,4,5Department of E&TC Engineering Amrutvahini Engineering, Sangamner, India

andobjecttrackingandanalysisareourkeyaspectsofthe paper. We are aiming at a two phased CNN face mask detector. Thefirstphaseisthetrainingphase wherein we have trained our model and the second phase the application, where the masks are detected with "with" or "withoutmasks"tags.Otherthantheimageswealsoaimto implementthisontherealtimevideos,wheretherealtime facesaredetected,trackedandthedataaboutthefaceswith or without masks is returned. Our paper can be of crucial help at the Stations, airports, Markets, Hospitals, Offices, Schoolsandmanymore,wherethecrowdcanbemonitored inrealtime.

2. LITERATURE SURVEY

Theexistingmodelshaveuseddeeplearningbuttheylack thevariationinthedatasetwhichmeansthattheirmodelis not that efficient when it comes to real time images and videos.Deeplearningtechniquehasbeenusefulforbigdata analysisworkfocusesonsomecommonlyimplementeddeep learningarchitecturesandtheirapplications.Deeplearning canbeusedinunsupervisedlearningalgorithmstoprocess the unlabeled data.. Our model is a trained custom deep learningandcomputervisionmodelwhichcandetectthis modelifapersonisusingamaskornot.Ourmodelhasnot usedmorphedorunrealmaskedpicturesinthedataset.Our model is very accurate as we have used MobileNetV2 architecture,ithasmadethemodelcomputationallyefficient too.Thismadeiteasiertodeploythemodel toembedded system.Wecanusethisfacemaskdetectionsysteminplaces that require face mask detection in view of the current pandemic.ThemodelcanbedeployedatAirports,Railway Stations,Offices,Schoolsandotherpublicplaces.

3. PROPOSED WORK

Firstlythereareonecamerauseforcapturingpersonimage orvideothenpreprocessingonthatimagethenusingsome algorithmlikeCNN,SVMandKerasandusetosomedataset likekaggle&tocheckpersonwearingmaskornotandcheck alsopersonputhandsonface.Aftercheckpersonwearing maskthenapplicationisterminate,ifpersonisnotwearing themaskthensystemtocheckdetailsinorganizationand pop-up notification on that person cellphone and due. If personputhandsonfacethensirengoeson

CNN stands for Convolutional Neural Network, which is a type of deep learning algorithm commonly used for image and video recognition, analysis, and processing. ThebasicarchitectureofaCNNincludesconvolutionallayers, pooling layers, and fully connected layers. Convolutional layers apply a set of filters to the input image to extract relevant features, while pooling layers downsample the feature maps to reduce their size and increase their computationalefficiency.Fullyconnectedlayersthenusethe extracted features to classify the image into one or more categorizeCNNsaretrainedusinglargedatasetsoflabeled imagesandusebackpropagationtoupdatetheweightsofthe networktominimizethedifferencebetweenthepredictedan actual output Some popular applications of CNNs include imageclassification,objectdetection,facialrecognition,and autonomousdriving.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 04 | Apr 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page967
Fig.1 System Architecture. 3. CNN ALGORITHM Fig.2 CNN Algorithm.

3.1 Convolutional Layer

ThefirstlayerofaCNNistypicallyaconvolutionallayer.In this layer, the network applies a set of filters to the input image,eachofwhichcapturesdifferentpatternsorfeatures. Thefiltersaresmallmatricesofweightsthatareconvolved withtheinputimagetoproduceasetoffeaturemaps.The sizeofthefiltersandthenumberoffilterscanbeadjusted dependingonthespecifictask.Aftertheconvolutionallayer, theoutputistypicallypassedthroughanon-linearactivation function, such as ReLU (Rectified Linear Unit), which introduces non-linearity into the network and helps to improveitsperformance.

3.2 Pooling Layer

A pooling layer is a type of layer commonly used in convolutionalneuralnetworks(CNNs)toreducethespatial dimensions (height and width) of the input tensor, while retaining the most important features. Pooling layers are oftenusedafterconvolutionallayersinCNNs,andtheyhelp toreducethenumberofparametersinthenetwork,which can prevent overfitting and reduce computational complexity. There are several types of pooling layers, includingmaxpooling,averagepooling,andglobalpooling. Maxpoolingisthemostcommontypeofpoolinglayer,which selectsthemaximumvaluefromeachsubregionoftheinput tensor. Average pooling, on the other hand, computes the averagevalueofeachsubregionoftheinputtensor.Global pooling computes a single value by taking the average or maximumoftheentirefeaturemap.Poolinglayerstypically havetwohyperparameters:thepoolingsize(thesizeofthe subregion used for pooling) and the stride (the step size usedtomovethepoolingwindowacrosstheinputtensor).A larger pooling size will result in greater spatial reduction, butmayalsoresultinloss of information, whilea smaller pooling size may preserve more detail but lead to greater computationalcomplexity.Thestrideparameterdetermines theamountofoverlapbetweenadjacentsubregions.

3.3 Flatten Layer

Inconvolutionalneuralnetworks(CNNs),afilteringlayer, alsoknownasaconvolutionallayer,isatypeoflayerthat applies a set of filters to an input tensor. The filters are learnedduringthetrainingprocessandareusedtoextract featuresfromtheinputtensor.Thefilteringlayerworksby performing a convolution operation between the input tensorandthelearnedfilters.Thisoperationinvolvessliding the filters over the input tensor and computing the dot product between the filter and the portion of the input tensoritiscurrentlycovering.Theresultoftheconvolution operationisafeaturemapthatrepresentsthepresenceor absence of certain features in the input tensor. The filters usedinafilteringlayercanhavedifferentsizesandshapes, andthenumberoffilterscanalsovary.Thesizeandshapeof the filters determine the spatial resolution of the output

feature maps, while the number of filters determines the depthoftheoutputfeaturemaps.Filteringlayersareoften followed by activation layers, such as ReLU or sigmoid, to introducenonlinearityintothenetwork.Theymayalsobe followedbypoolinglayerstoreducethespatialdimensions oftheoutputfeaturemapsandcontroloverfitting.

3.4 Dataset

Thecollectionismadeupof3918photosseparatedintotwo categories:faceswithmasksandfaceswithoutmasks.Faces withoutmasksisaKaggledatasetthatcomprisesfaceswith diverseskincolours,angles,occlusion,andotherfeatures. Faceswithmaskscomprisesmaskswithhands,masks,and otheritemsthatcovertheface,givingusanadvantagewhen itcomestoimprovingdatasetvariants.Thesecondcollection contains photographs of persons associated with the organisation where our project is installed. This data is essentialforfacialrecognitionandsendingemailstocertain individuals.

4. MATHEMATICAL MODEL

Wearetakeasmallmatrixofthenumbersthatmeanscalled kernel or filter, pass it over our image, and transform it basedonthevaluesfromthefilter.

G[m,n]=(f×h)[m,n]=ΣjΣih[j,k]f[m−j,n−k]

So let our image shrinks every time, we perform convolution, only a limited number of times we can do it earlyourimageremovedcompletely.

P=(f−1)/2 hence of shifting the kernel by one pixel, so number of steps we can increase. than, step length is also treated the convolution layer hyper parameters. nout= floor(1+(n+2p-f)/s)Youwanttoapplyfilterandimageto themusthavethesamenumberofchannels.

[��, ��, ����] × [��, ��, ����] = [���������� (�� + (�� + ���� – ��)/8 ) , ���������� (�� + ( �� + ���� − �� )/�� ) ,����]

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 04 | Apr 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page968

This systemhelpstoidentifytheorganizationalpersonifhe orsheiswearingornotwearingmask

The figure above helps to identify whether the person is wearingamaskornot.Andemailalertsaresenttopeople whodon'twearmasks.

IntheabovefigSystemidentifythepersonisnotwearing mask and show the output by using red frame, Name of person,accuracyofwearingmaskornot

Theabovefigureshowsane-mailalertthathasbeensentto apersonwhoisnotwearingamask.

Theuseofartificialintelligenceforfacemaskdetectionhas been a promising approach in the fight against COVID-19. The system uses computer vision techniques to analyze video feeds and identify individuals who are not wearing facemasksinpublicplacessuchasairports,hospitals,and schools. The technology has the potential to reduce the spreadofthevirusandhelptokeepcommunitiessafe.

There are various approaches to building a face mask detectionsystem,includingmachinelearningalgorithmsand deeplearningmodels.Thesesystemscanbetrainedonlarge datasets of images and videos of people wearing and not wearing masks, allowing them to recognize patterns and makeaccuratepredictions.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 04 | Apr 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page969
Fig.3 Dataset With mask without mask face mask. 5. MODEL TESTING Fig.4 Face recognition of organizational person Fig.5 Mask Detection Fig.6 Email Alert System 6. CONCLUSION

REFERENCES

1]Rahman, Mohammad Marufur; Manik, Md. Motaleb Hossen; Islam, Md. Milon; Mahmud, Saifuddin; Kim, JongHoon(2020).[IEEE2020IEEEInternationalIOT,Electronics andMechatronicsConference(IEMTRONICS) -Vancouver, BC,Canada(2020.9.9-2020.9.12)]2020IEEEInternational IOT, Electronics and Mechatronics Conference (IEMTRONICS)-AnAutomatedSystemtoLimitCOVID-19 UsingFacialMaskDetectioninSmartCityNetwork.,(),1–5. doi:10.1109/IEMTRONICS51293.2020.9216386

2]Sakshi,S.,Gupta,A.K.,SinghYadav,S.,&Kumar,U.(2021). FaceMaskDetectionSystemusingCNN.2021International Conference on Advance Computing and Innovative Technologies in Engineering (ICACITE). doi:10.1109/icacite51222.2021.940

3]Islam, M. S., Haque Moon, E., Shaikat, M. A., & Jahangir Alam, M. (2020). A Novel Approach to Detect Face Mask usingCNN.20203rdInternationalConferenceonIntelligent Sustainable Systems (ICISS). doi:10.1109/iciss49785.2020.9315

4]Suresh,K.,Palangappa,M.,&Bhuvan,S.(2021).FaceMask DetectionbyusingOptimisticConvolutionalNeuralNetwork. 2021 6th International Conference on Inventive Computation Technologies (ICICT). doi:10.1109/icict50816.2021.9358

5]Jiang, X.; Gao, T.; Zhu, Z.; Zhao, Y. Real-Time Face Mask DetectionMethodBasedonYOLOv3.Electronics2021,10, 837.https://doi.org/10.3390/electronics10070837

6]Kumar,G.andShetty,S.ApplicationDevelopmentforMask Detection and Social Distancing Violation Detection using Convolutional Neural Networks. DOI: 10.5220/0010483107600767

7]Z. Wang, P. Wang, P. C. Louis, L. E. Wheless, and Y. Huo, “Wearmask:fastInbrowserfacemaskdetectionwithserver less edge computing for COVID-19,” 2021, https://arxiv.org/abs/2101.00784

BIOGRAPHIES

Aute Sayali Santosh.Fourth year BE(E&TC). Interested electronic sectorandITsector,ML

Bhalerao Pooja Bhagwan.Fourth year BE(E&TC).Interseted IT sector as well as electronic sector,Machinelearning.

Chaudhari Dipak Sitaram. Fourth year BE(E&TC).Interseted IT sector as well as electronic sector,Machinelearning

Shermale Rahul Ramdas. Fourth year BE(E&TC).Interseted IT sector as well as electronic sector,MachineLearnig.

KawadeSudhirB.M.EE&TC (VLSI &EmbeddedSystem) SpecializationinAnlogcircuit& VLSI,PhDPursunig ,International levelPeparPublication-4

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 04 | Apr 2023 www.irjet.net p-ISSN: 2395-0072 © 2023, IRJET | Impact Factor value: 8.226 | ISO 9001:2008 Certified Journal | Page970

Turn static files into dynamic content formats.

Create a flipbook