Unveiling unmasked faces: a novel model for improved mask detection using haar cascade technique

ABSTRACT


INTRODUCTION
The "Face Mask Detection" project addresses a crucial problem related to the enforcement of maskwearing compliance during the COVID-19 pandemic.Wearing masks makes it imperative to develop effective technologies for identifying individuals not wearing masks in public spaces.The last few years have shown humankind a lot of events amongst which COVID-19 has a lot of impact on the world [1]- [2].Now with COVID-19, there are also serious viral respiratory diseases that have spread in the past few years, similar to SARS and MERS [3].Amidst the prevailing circumstances, a significant number of individuals harbor heightened concerns regarding their well-being, while governments are likewise placing paramount emphasis on public health.The arsenal of indispensable tools essential for combating the Corona pandemic encompasses crucial elements such as masks, sanitizers, the practice of social distancing, and adherence to quarantine protocols.Among these pivotal tools, the one that stands out as both essential and universally recognized is the face mask [4].
The World Health Organization (WHO) issued guidelines stipulating [5]- [6] that individuals caring for patients with symptoms, or those encountering respiratory distress, should wear face masks as a preventative measure.Within this context, a multitude of service providers catering to the public welfare expect their patrons to exercise responsibility by donning face masks-a practice safeguarding not only their safety but also those in close proximity.Numerous studies in reputable international journals have explored various aspects of face mask detection and computer vision techniques [7]- [13].For all respiratory diseases, the Face mask is the ultimate savior for our world."Face mask detection model as the name suggests detects whether a person has a mask on or not.Face mask detection is also like object detection i.e., the approach to detect the face mask is similar to the approach of object detection.For face mask detection a smarter approach is needed [4], [14], [15].
One of many approaches would be to find the objects in the video by analyzing the features or specific structures.Still, there will be a problem with this approach.If we work only with the image's intensities, then it makes the platform slow because it is expensive to calculate the RGB pixel values in the image pixels [16]- [18].This particular problem was resolved by Viola and Jones by developing the Haar-like feature.A Haarlike feature constructs a boxlike region with a border at a specific position in a detection window and then aggregates all the pixel intensities in a boxlike region.After that find the difference between these aggregates.Then the subsection of an image is further classified with the help of difference.This paper proposes a "face mask detection" model which is based on a haar-Like feature for detection of the face mask.The face detection model can be integrated with any public or private CCTV cameras, and it can also be used to stop the entry of people in the building who are not wearing masks [19].The model detects masks by placing a rectangular subwindow over the image.The detected current region location of the rectangular sub-window is labeled as positive or negative by the classifier-positive label shows that an object was found and the meaning of negative label means that an object wasn't present in the image [2], [20].If the result label is negative, then the further classification of that specific region will stop, and the rectangular sub-window location is moved to the new location.If the result label is positive, then the further classification of that region sub-window is performed as seen in Figure 1.

Figure 1. Steps of cascade classifier
The true positive is a situation which means that the required object is present in the image and the classifier does not make a mistake and labels it correctly i.e., a positive result.The false positive is the situation in which the object is present in the image according to the labeling, but actually the object is not present in the image.The false negative is the situation which means that the object in the image was unable to detect by the classifier and the true negative is the situation which occurs when a nonobjective was correctly classified as not being the object in question.For better performance, every cycle of cascade must have less amount of false negative because if an actual object is classified as a non-object, then the classification of that location stops and moves to new location, with no way to correct the mistake.While previous research has proposed methods for face mask detection using different algorithms such as Convolutional Neural Networks (CNN), Principal Component Analysis (PCA) combined with Support Vector Machines (SVM), and AdaBoost, this project focuses on leveraging the Haar Cascade technique.This creates a notable gap in the research landscape as Haar Cascade presents a distinct approach that enables rapid and accurate face detection within video streams for mask assessment.Major objectives of this work are as follows ( 1 A Matlab-based approach utilizing the Faster R-CNN [21] algorithm for complex image mask detection, incorporating facial recognition packages.The methodology involves Faster R-CNN for security and medical systems, addressing challenges like face restriction, color and brightness changes, and contrast adjustments.The study [10] presents a smart face mask detection system utilizing machine learning techniques.By employing ML algorithms, the system is designed to accurately identify the presence or absence of face masks in real time.This technology holds potential for various applications, particularly in scenarios requiring mask compliance, such as public spaces and crowded environments.The work done in [22] focuses on implementing deep learning techniques for face mask detection, aiming to mitigate the risk of Coronavirus transmission.The study proposes an approach that utilizes advanced neural networks to identify whether individuals are wearing face masks or not.This system holds promise in promoting public health and safety measures by enabling automated and efficient monitoring of mask compliance.The study [23] introduces a face mask detection system that combines the strengths of SSDNET (Single Shot MultiBox Detector Network) and a lightweight custom CNN (Convolutional Neural Network).By leveraging these techniques, the proposed system achieves accurate and efficient detection of face masks in real-time scenarios.Although deep learning has proved to be an effective solution for other classification problems [15], [16] as well that motivates us to use it for face mask detection as well.The deep-learning-based solutions for face mask detection have become a major area of focus recently [4], [26]- [32].

METHOD 2.1. Dataset
This model uses two datasets.The First dataset consists of 1600 images without a mask can be seen in Figure 2. The second dataset consists of 1600 images with a mask is shown in Figure 3.

Approach
The research outcomes presented here provide an overview of the face mask detection process utilizing the Haar Cascade classifier.This classifier operates within an algorithm designed to identify specific facial features.The detection process relies on the concept of haar-like features, which can be categorized into three fundamental types, as visually demonstrated in Figure 4: edge features (depicted by the two leftmost images), line features (represented by the two middle images), and four-rectangle features (illustrated by the rightmost image).

Figure 4. Haar-like features
When the haar-like classifier is applied to an image, it doesn't directly analyze the image.Instead, it seeks out essential features through a sliding window approach.This sliding window systematically scans the image, searching for these features.Should a feature not be located within the current window, the sub-window shifts to a new location in the image detection of subsequent features occurs similarly.Summing the pixel intensities within lighter and darker regions of the sub-window.Lighter pixels correspond to whiter areas in grayscale images, while darker pixels relate to areas such as eyebrows.By comparing the sums of pixels in these regions, the algorithm determines the presence of features.If the calculated value is close to 1, it signifies the presence of a feature; a value near 0 indicates its absence.If only certain facial features like eyebrows and eyes are detected, while others such as the nose, cheeks, and chin are missing, the algorithm interprets this as the person wearing a mask.
Within each sub rectangular window, the haar cascade algorithm functions by recognizing facial characteristics like the nose, eyes, and eyebrows through haar-like features.These features are identified by in a grayscale image like eyebrows.The sum of pixels values in the darker region will be smaller than the sum of pixels and then subtract the sums of two regions to find that there is feature or not.With the help of these information, it will find whether the required feature is present in the window or not.If the calculation is near to 1 then it means that it is sure that it is feature and if it is near to 0 then it means it is not feature.If only some face feature is found like eyebrows and eyes, and the features like nose, cheek, chin etc is absent then it means that person is wearing mask.All the process is show in flowchart 1 (See Figure 5) and flowchart 2 (see Figure 6).

Flowchart
Flowchart 1 as can be seen in Figure 5 describes the algorithm which draws a rectangular box on the discovered face and detects if it is wearing the mask or not.Flowchart 2 as shown in Figure 6 gives the overview of the various stages involved in the detection of the face mask by the model.

RESULTS AND DISCUSSIONS
The model gives the result that we were expecting.The model detects whether a person is wearing a mask or not.If a person is not wearing the mask, then a "NO MASK" message is written on the rectangular sub window frame as seen in figure 7. If a person is wearing the mask, then a "MASK" message is written on the rectangular sub-window frame as seen in figure 8.
There may be some cases where the face mask detection predicted the mask to be a no mask.The reason for the wrong prediction is due to some situation in which face mask detection model confuse between mask and human features, and that type of situations occur when there are folds in the mask or when mask has different patterns which is similar to the human features i.e., mouth/lips.This type of problem can be solved by increasing the amount of data in the dataset such that the model can easily differentiate between mask and human features.Table 1 shows the performance comparison of the various algorithms which were used to developed the face mask detection model.In the given table, the "Detection Rate" refers to the percentage of correctly detected face masks, and the "False Rate" indicates the percentage of incorrectly identified face masks.The "Missed Rate" represents the percentage of undetected face masks.The "Detection time" refers to the time taken by each algorithm to process and detect face masks.From a technical perspective, the criticality of the results can be assessed based on the values of these metrics.A higher detection rate is desirable as it indicates the algorithm's ability to accurately identify individuals wearing masks.The goodness of the results is evaluated based on the trade-off between the detection rate, false rate, and missed rate, along with the detection time.The proposed algorithm outperforms the other methods, exhibiting a high detection rate of 98.4% while maintaining a relatively low false rate of 8.72% and a very low missed rate of 2.19%.Additionally, the algorithm's detection time of 0.48 seconds is relatively fast, indicating efficient real-time performance.

CONCLUSION
The future scope of the "Face Mask Detection" model is promising, as the use of face masks is likely to remain a crucial preventive measure in controlling the spread of respiratory diseases.The development of more powerful and efficient models for the detection of face masks can help ensure compliance with the usage of face masks, especially in high-risk areas such as hospitals, airports, and public transportation.Additionally, face mask detection can be integrated with other technologies such as contactless temperature screening, enabling more efficient and accurate screening of individuals.Future research can focus on developing models that can detect face masks in real-world scenarios with more accuracy, including when faces are partially obscured, or the lighting conditions are challenging.Moreover, face mask detection can be extended to the detection of other personal protective equipment such as gloves and face shields, enabling more comprehensive monitoring of individuals in high-risk settings.Overall, the future scope of the "Face Mask Detection" model is vast, and continued research in this area can help improve public health and safety.With an impressive detection rate of 98.4%, it surpasses the other methods, signifying its superior ability to accurately identify individuals wearing face masks.The relatively low false rate of 8.72% and remarkably low missed rate of 2.19% further reinforce its effectiveness in striking a balance between minimizing false positives and avoiding missed detections.
) Develop a robust model for identifying individuals not wearing face masks in videos.(2) Utilize the Haar Cascade technique to achieve rapid and accurate face detection within video streams.(3) Facilitate accurate assessment of mask usage.(4) Address the challenge of precise mask detection.(5) Contribute to public health efforts by promoting mask compliance and mitigating COVID-19 risks.

Figure 2 .Figure 3 .
Figure 2. Sample image of dataset without mask

Figure 5 .
Figure 5. Flowchart of the process to draw rectangular box on face

Figure 6 .
Figure 6.Flowchart of face detection

Figure 7 .
Figure 7. Testing without mask Figure 8. Testing with mask

Table 1 .
Performance comparison