Automatic Face Mask Detection system In Public Place

Page 1


International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 11 Issue: 10 | Oct 2024 www.irjet.net p-ISSN: 2395-0072

Automatic Face Mask Detection system In Public Place

Nikita Meshram1, Prof. Sujata Patil2

1 Student, ME, E&TC Engineering (Signal Processing), ICOER, Pune, India. 2 Proessor, Electronics and Telecommunication Engineering, ICOER, Pune, India.

Abstract - COVID-19 pandemic spreading continuously everywhere in the world. COVID-19 affects all the sector .Many precautions are taking place to reduce spreading of this disease that is social distancing, proper sanitization, wearing mask etc. This project present automatic face mask detection system in public place to help government and public to reduce COVID-19 cases. In this project we find whether people wearing mask or not as well as we find temperature of the person. If people without mask occur then immediately give alert signal and stop entry of that person in that place. After entering the building/place we contiously monitoring person through camera If that person identify without wearing mask then we send email to that person through database. In this project we use Python to build face mask detector also we use Arduino IDE to control the Appliances. We use Temperature sensor, Servo Motor, Buzzer etc.

Key Words: COVID-19, face mask detector, Arduino, python, Temperature Sensor , Servo Motor, Buzzer, Speaker .

1.INTRODUCTION

Novel coronavirus is a new strain that has never been seen in humans before (nCoV). Coronaviruses (CoV) are a familyofvirusesthatcauseillnessesrangingfromcoldsto life-threatening diseases such as Middle East Respiratory Syndrome(MERS)andSevereAcuteRespiratorySyndrome (SARS)[9].Asaresultofthepandemic,peopleallaroundthe worldareexperiencingdifficultsituations.Ahighnumberof peopleareinfectedanddieeveryday. COVID-19isspread mostlythroughdropletsthatareproducedwhenaninfected personcoughs,sneezes,orexhales. Thesedropletsaretoo heavy to float in the air and fall to the ground or other surfaces.Ifyouareincloseproximitytosomeonewhohas COVID-19,youcanbeinfectedbybreathinginthevirus,orby touchinga contaminatedsurface andthencontactingyour eyes, nose, or mouth. The WHO gave few guidelines to preventthespreadofnovelcorona virus.Manyprotection andsafetymeasureswereimplementedbygovernmentsto reduce disease spread, including mandatory indoor mask wear, social distancing, quarantine, self-isolation, limiting citizensmovementwithincountrybordersandabroad,and prohibitingorcancellinglargepubliceventsandgatherings [12].

Despitethefactthatthepandemicappearedtobe weakeningattimes,duetotheuncertaincircumstances,most safety restrictions are still in place. Coronavirus sickness

causes various changes in our daily routines, habits, and activities, ranging from professional conduct to social interactions,sport,andactivities.Toavoidgettinginfectedor spreadingit,Itisessentialtowearafacemaskwhilegoing outfromhomeespeciallytopublicplacessuchasmarketsor hospitals.Thispromptedeveryoneinthesocietytoputona facemaskinordertoprotectthemselvesfromthespreadof thecoronavirus.Toavoidtheabovesituation,weneedtodo whatwecantoturnthisintoaslowpandemic.Apandemic canbesloweddownonlybytherightresponses,mainlyin theearlyphase.Inthisphase,everyonewhoissickcanget treatment and there is no emergency point with flooded hospitals.Thedevicewascreatedtoensurethateveryonein societywearafacemask.

Face recognition has gotten a lot of attention in recent yearsasoneofthemostpromisingapplicationsinthefieldof image analysis. Facial detection can make up a significant portion of face recognition procedures. Its strength is to concentratecomputationalresourcesonthepartofapicture that contains a face. There are several approaches for detecting faces, and we can recognise faces with greater accuracy using these strategies. These techniques, such as OpenCV,NeuralNetworks,MATLAB,pythonandothers,have asameapproachforFaceDetection.

Arduinoisanopen-sourceplatformthatmaybeusedto createelectroniccreations.Arduinoismadeupofahardware programmable circuit board (also known as a microcontroller)andsoftware(calledanIDE)thatrunson yourcomputerandisusedtocreateanduploadcomputer codetothephysicalboard.[13].

Thedeviceisdesignedtodetectfacesandassesswhether or not the person is wearing a face mask, allowing us to determine whether or not the individual can enter public spaces such as a building or a hospital etc. The hospital, Offices,market,busterminals,restaurants,andotherpublic gatheringswheremonitoringisrequiredcanallbenefitfrom this project. We also monitor then person activities inside the particular place whenever person remove there mask thenwegivethemthealertsignal.

2. PROPOSED METHOD

Infig.1weshowcomponentweareusedinfacemask detection.InthatweusedTemperaturesensortodetectthe Temperatureattheentranceofbuildingiftemperatureislow thenbuzzerremainoffotherwiseinon,whencameracapture

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 11 Issue: 10 | Oct 2024 www.irjet.net p-ISSN: 2395-0072

thepersonimageandprocesstheimageifpersonwithmask occur then it open the door otherwise it closed the door. Insidethebuildingprocessormonitorthepersoneverytime whenwithoutmaskpersonoccuritwillidentifythepersonin databasethenturnontheBuzzer,onthespeakerandsend theEmailtothatperson.

2.1 Methodology

Inthispaperweperformfollowingmethod:-

1. FaceDetection

2. Facemaskdetection

Face Detection:-

Inthissection,wewilldiscussaboutthealgorithm,which isusedtodetectthehumanfaces.

Toperformthisfunction,firstperformfacedetectionto locatethefaceintheimage.TheOpenCVmethodisacommon method for face recognition. First extracts the images featuresintoalargesamplesetbyextractingthefaceHaar features in the image and then it used the AdaBoost algorithm as the face detector. In face recognition, the algorithm can effectively adapt to complex environments such as poor lighting and background blur, which greatly improvestheaccuracyofrecognition.

A. Haar Feature Cascade classifier

This is an object detection algorithm used to identify facesinimagesorreal-timevideos.Thealgorithmuses edgeorlinedetectionfeatures.Thealgorithmisprovided witha largenumberofpositiveimages withfacesand negativeimageswithoutfacestotrainon.Theseimage featureshelpidentifyedgesandlinesinanimage,aswell asareaswithsuddenchangesinpixelintensity.

Thesecanbebroadlydividedintothreecategoriesbased on the feature each one is seeking. The first pair of rectangularfeaturesisinchargeofdeterminingwhether anedgeishorizontalorvertical.Determinewhethera lighterzoneisborderedbydarkersectionsoneachside, orviceversa,usingthesecondsetofthreerectangular attributes. The determination of changes in pixel intensitiesacrossdiagonalsistheresponsibilityofthe thirdgroupoffourrectanglefeatures.Thedarkerareas in the haar feature are pixels with values 1, and the lighter areas are pixels with values 0. Each of these is responsibleforfindingoutoneparticularfeatureinthe image. Such as an edge, a line or any structure in the imagewherethereisasuddenchangeofintensities

The objective here is to find out the sum of all the image pixels lying in the darker area of the haar feature and the sum of all the image pixels lying in the lighter area of the haarfeature. byusinghaarfeatureweconvertoriginalimage intointegralimage.

B. AdaBoost algorithm

AdaBoost, also known as Adaptive Boosting, is a machine learning method used in an ensemble setting.In basically, that there are a number of features that would capturespecificfacestructures,suchasthelips,thebridge connectingthetwoeyes,ortheeyebrows.However,thiswas not the feature set's sole focus at first. About 180,000 of thesemadeupthefeatureset,whichwasthenreducedto 6000.In this situation, they need a feature selection technique to pick a small subset of characteristics from a largesetthatwouldnotonlypickfeaturesthatperformed betterthantheothersbutwouldalsoremovetheirrelevant ones.Theycreatedweaklearnersbyapplyingeachofthese 180,000 characteristics to the images separately using a techniquecalledAdaBoostSomeofthem,however,produced lowerrorratesbecausetheydistinguishedbetweenPositive andNegativeimagesmoreeffectivelythantheothers.These weak learners are created so that they would incorrectly classifyaminimumnumberofimages.Theyarecapableof doingbetterthanarandomguess.Theirfinalcollectionof featureswasreducedusing thismethodtoa total of6000 features

Fig.1 Blockdiagramofautomaticfacemaskdetection system
Fig.2 sampleofHaarfeatures

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 11 Issue: 10 | Oct 2024 www.irjet.net p-ISSN: 2395-0072

Face Mask Detection:-

TodevelopFacemaskdetectionsystemweuseOpenCV, TenserFlowandKeras.

A.OpenCV:-

OpenCVisalargeopensourcelibraryforimageprocessing, machinelearning,andcomputervision.Itnowplaysavital role in real-time operations, which is crucial in modern systems.Itcanbeusedtoanalyzeimagesandvideostofind faces,objects,andevenhumanhandwriting WhenPythonis integrated with various libraries such as NumPy, it can processOpenCVarraystructuresforanalysis.Weusevector spacesandapplymathematicaloperationsonthesefeatures toidentifyvisualpatternsandtheirvariouscharacteristics

B.Keras

Keras is an open source software library that provides a Pythoninterfaceforartificialneuralnetworks.ATensorFlow library interface is provided by Keras. Keras is an open source,Python-based,high-levelneuralnetworkframework

that can run on top of Theano, TensorFlow, or CNTK. It is user-friendly,extensible,andmodulartoenablemorerapid experimentation with deep neural networks. It supports both convolutional and recurrent networks, either individuallyorincombination.

C.TenserFlow

An open source library called TensorFlow has a large number of pre designed models that are helpful for deep learningandmachinelearningingeneral.Tenser,whichis considered of as an array of N-dimensional elements, and flow,whichisconsideredofasagraphofoperations,make up the word TenserFlow. Data flow graphs are used in TensorFlow,anopen-sourcesoftwarelibraryfornumerical computing.TensorFlowismadefordistributedtrainingand inference on a big scale. The graph's nodes stand in for mathematical processes, while its edges stand in for the multidimensionaldataarrays(tensors)thataretransmitted betweenthem.TheGoogleBrainteam,adivisionofGoogle's machineintelligence research department, developed and maintainsTensorFlowformachinelearning(ML)anddeep learning(DL).Thedistributedmasterandworkerservices with kernel implementations are part of the TensorFlow distributedarchitecture.Thereare200standardoperations in all, including C++-written operations for manipulating arrays, controlling flow, and managing state. Systems for research, development, and production can all use TensorFlow.Itcanfunctiononsystems witha singleCPU, GPUs, mobile devices, and massively distributed systems withahugenumberofnodes.PythonandC++programming interfaces for TensorFlow are available, while Java, GO, R, and Haskell are also being developed. In the cloud environments of Google and Amazon, TensorFlow is also supported.

3. RESULT &DISCUSSION

Below Fig.4 & 5 show the scenario entrance of the buildingwhencameracapturetheimage,thiscaptureimage isprocessthenfindwhetherpersonwearingmaskornot.If personwearthemaskandthenimmediatelyopenthedoor i.e turn on the motor. If person not wearing a mask then buzzerisOn,doorwillnotopenandthroughspeakerinform towearthemask.IfTemperatureishighthenbuzzerisOn.

Fig.3 MathematicalrepresentationofAdaBoostAlgorithm

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 11 Issue: 10 | Oct 2024 www.irjet.net p-ISSN: 2395-0072

AboveFig.6 showthehowthefacemaskdetector work inside the building. Camera continuously monitor activitiesofpersonandfacemaskdetectorcontinuouslyfind the mask. Person wear the mask then camera will not showedanyresponse.

Abovefig.7shownifpersonwithoutmaskoccurthen thenprocessorfindthatpersonindatabaseifpersonshown indatabasethenshownnameofthatpersonincheckbox, speaker will tell that person to wear the mask with name ,sendtheemailtorespectiveperson&buzzerwillon.Ifthat personnotshownindatabasethenonlyspeakerwilltellthat person to wear mask without name & buzzer will on .OtherwisebuzzerwillremainOff.Ifmorethanoneperson occurincamerathenspeakerwillannouncetowearmask butwithoutname.

InFig.8showscurveofaccuracy&lossoftrainingand testing/validationphaseforabout20epoch.Inthatgraphit showstheaccuracyoftraining andaccuracyofvalidation differenceislow.Bothtrainingandvalidationaccuracyvalue is above 90%. In terms of loss training loss is lower than validationloss.

Fig. 8 GraphicalrepresentationofAccuracy&lossin trainingandtestingphase

BelowTable1Showtheaccuratedetectionofpersonwith and without mask. In this table we individually calculate detectionofpersonwithmaskandwithoutmask.

Fig.4 Personwithmaskatentrance
Fig.5 Personwithoutmaskattheentrance
Fig.6 Personwithmaskinsidethebuilding
Fig.7 personwithoutmaskinsidethebuilding&Email

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 11 Issue: 10 | Oct 2024 www.irjet.net p-ISSN: 2395-0072

Table 1 successpercentageofdetectingperson Sr.

Table2showsdifferenttypeof performanceparameterof system.

Table 2 Performanceparameterofsystem

8

10

Fig. 9 graphofconfusionmatrixdevelopsystem

InTable3showscomparisonbetweenproposedmodelwith differentfacemaskdetectionmodel.Wecheckperformance ofsystemusingprecisionandrecall.BelowTableIIshowsF1 scoreof4differentmodel.ThehighertheF1scorebetterthe performance of system. In Table II shows that out of this differentmodelourproposedmodelgivehigherF1scorei.e 97.98meansperformanceofthisproposedmodelisbetter thanothermodel.

Table 3 Comparisonbetweenproposedmodelwith differentmodel

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056

Volume: 11 Issue: 10 | Oct 2024 www.irjet.net p-ISSN: 2395-0072

3. LIMITATION & CONCLUSIONS

In this system, the camera has a direct impact on video quality .Excellent cameras should be utilised to capture images from real-time video streaming that are higher qualityandnoisefree.Themodeloftheservomotormight varydependingonthesize,angularposition,andweightof the camera. It is evident from the analysis's findings that lighting conditions have an impact on a system's performance. This technique should therefore satisfy the criterionfordaylightratherthanfordarkness.

Thispaperpresentautomaticfacemaskdetection systeminpublicplace.Thissystemisdesigntoreducethe spreadofCOVID-19pandemic,measuresmustbetaken.We use Arduino IDE & python software to simulate the code. ThispaperwillhelptolimitspreadingofCOVID-19virusin offices, mall, hospital etc. Itwill monitor the people wear maskornotthebuilding.

REFERENCES

[1]MohammadMarufurRahman,Md.MotalebHossenManik etc.”AnAutomatedSystemtoLimitCOVID-19UsingFacial Mask Detection in Smart City Network” 2020 IEEE InternationalIOT,ElectronicandMechatronicsConference (IEMTRONICS).

[2]Saman M. Almufti , Ridwan B. Marqas, Zakiya A. Nayef, TamaraS.Mohamed1”RealTimeFace-maskDetectionwith ArduinotoPreventCOVID-19Spreading”QubahanAcademic JournalDoi:10.48161/Issn.2709-8206,April2021.

[3]Mohammad Ashraful Hoque, Thouhidul Islam etc “AutonomousFaceDetectionSystemfromReal-timeVideo Streaming for Ensuring the Intelligence Security System” 20206thInternationalconferenceonAdvancedComputing& communicationSystem(ICACCS).

[4]NenadPetrovićandĐorđeKocić “IoT-basedSystemfor COVID-19IndoorSafetyMonitoring”in2020.

[5]S.Balaji etc “A brief Survey on AI Based Face Mask Detection Systemfor Public Places“Irish Interdisciplinary JournalofScience&Research(IIJSR)Vol.5,Iss.1,Pages108117,January-March2021

[6]E.Dong,H.DuandL.Gardner,"Aninteractiveweb-based dashboard to track COVID-19 in real time", The Lancet Infectious Diseases, vol. 20, no. 5, pp. 533-534, 2020. Available: 10.1016/s1473- 3099(20)30120-1 [Accessed 6 April2021].

[7]ToshanlalMeenpal,AshutoshBalakrishnan,AmitVerma“ FacialMaskDetectionusingSemanticSegmentation”2019 4th International Conference on Computing, CommunicationsandSecurity(ICCCS).

[8]BorutBatagelj,PeterPeer,VitomirŠtruc,SimonDobrišek “ How to Correctly Detect Face-Masks for COVID-19 from Visual Information?” 2021 by the authors. Licensee MDPI, Basel,Switzerland.

[9]L.Liuetal.,“DeepLearningforGenericObjectDetection: ASurvey,”Int.J.Comput.Vis.,vol.128,no.2,pp.261–318, Sep.2018

[10]J.WonSonnandJ.K.Lee,“Thesmartcityastime-space cartographerinCOVID-19control:theSouthKoreanstrategy anddemocraticcontrolofsurveillancetechnology,”Eurasian Geogr.Econ.,pp.1–11,May.2020.

[11]Chandana S; , “Real Time Video Surveillance System Using Motion Detection” Dept of Electronics and Communication Engineering, DayanandaSagar College of EngineeringBangalore,India.

[12]BiparnakRoy.,Nandy,S.,Ghosh,D.,Dutta,D.,Biswas,P. et al. (2020). MOXA: “A deep learning based unmanned approach for real-time monitoring of people wearing medical masks.” Transactions of the Indian National Academy of Engineering, 5(3), 509–518. DOI 10.1007/s41403-020-00157-z.

[13] KaurG,SinhaR,TiwariPK,YadavSK,PandeyP,RajR, et al. “Face mask recognition system using CNN model.” Neurosci Inform. (2021) 2:100035. doi: 10.1016/j.neuri.2021.100035.

[14]MuhammadZubairAsghar,FahadR.Albogamy etal.“ Facial Mask Detection Using Depthwise Separable Convolutional Neural Network Model During COVID-19 Pandemic” Digital Public Health, a section of the journal FrontiersinPublicHealth.07March2022.

[15]WHO EMRO | About COVID-19 | COVID-19 | Health topics.[Online].Available:http://www.emro.who.int/healthtopics/coronavirus/about-covid-19.html.

[16]Arduino.https://www.arduino.cc/

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.