[AIoT] Mask Detection using Face Detection
We have implemented an LED blinking when the person is not wearing a mask is detected during the screening.
Newark - LED (generic)
Adafruit - Solderless Breadboard Half Size
"Prevention is better than cure" is one of the effective measures to prevent the spreading of COVID-19 and to protect mankind. Many researchers and doctors are working on medication and vaccination for corona. COVID-19 spreads mostly by droplet infection when people cough or if we touch someone who is ill and then to our face (i.e rubbing eyes or nose). Ongoing pandemic shows that it is much more contagious and spreads fast. Thus wearing a mask is helpful in preventing the infection and spreading of the virus. But the monitoring of mask wearing is a tiresome process and could even lead to infection of the person monitoring. Thus a camera device attached to a door or gate or screening center can detect whether the person is wearing a mask or not and could initiate a response automatically. This could prove to be very helpful in reduction of the spread of virus.
Iot -Internet of Things is used almost everywhere now. It gives us the capability to monitor certain actions remotely and at times even without human interference. This Project aims at providing a solution to the mask monitoring problem that can be seen at various institutions and organizations where a large number of people usually study or work. The entry of the people can be monitored by the use of IOT devices and Face recognition through AI that can then give instructions to the IOT device to perform certain actions. In this project we have implemented an LED blinking when the person is not wearing a mask is detected during the screening.
The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them.
- Arduino IDEThe Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them.
2.Raspberry pi Pico board
RP2040 Designed by Raspberry Pi, RP2040 features a dual-core Arm Cortex-M0+ processor with 264KB internal RAM and support for up to 16MB of off-chip Flash. A wide range of flexible I/O options includes I2C, SPI, and — uniquely — Programmable I/O (PIO). These support endless possible applications for this small and affordable package.
MQTT is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. MQTT today is used in a wide variety of industries, such as automotive, manufacturing, telecommunications, oil and gas, etc.
Led bulb to indicate whether the person is wearing a mask or not.
5.Jumper wires and Breadboard
To connect the node mcu board and pico board.
1. Facemask detection using open-cv
There are two main steps.-Identify human Face and Mouth in each frame of input video-Identify Person is using Mask or notThe video is analyzed for facemask and the data after detecting whether the mask is on or off is generated.
2. Ethernet connection to MQTT
The ethernet connection to the pico board is established using ethernet libraries. Establish an MQTT connection to publish the data obtained from the face detection file i.e facedetection.py using ethernet. After connection establishment, send the data as a message.
3. LED blinking using pico board
The data subscribed from the MQTT server is fetched to the pico board and the code in the pico board turns on/off the LED bulb based on whether the person is wearing the mask or not.
Facemask detection using open-cv in python
Haar Cascade classifiers are an effective way for object detection. This method was proposed by Paul Viola and Michael Jones in their paper Rapid Object Detection using a Boosted Cascade of Simple Features.Haar Cascade is a machine learning-based approach where a lot of positive and negative images are used to train the classifier.
Positive images – These images contain the images which we want our classifier to identify. Negative Images – Images of everything else, which do not contain the object we want to detect.
Data passing using MQTT through ethernet and LED blinking code - Arduino C
To explain the working of MQTT protocol we will divide the MQTT session into 4 stages such as connection, authentication, communication, and termination.
First of all, a TCP / IP connection is initiated from client to broker by using a standard or custom port which is defined by a broker’s operation.While establishing a connection, it’s important to recognize whether the server has continued an old session or a new session.
The old session continues if reused client identity is provided to the broker.