Research Article

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Hindawi

Scientific Programming
Volume 2021, Article ID 8340779, 21 pages
https://doi.org/10.1155/2021/8340779

Research Article
Real-Time Implementation of AI-Based Face Mask Detection and
Social Distancing Measuring System for COVID-19 Prevention

Safa Teboulbi ,1 Seifeddine Messaoud ,1 Mohamed Ali Hajjaji ,1,2


and Abdellatif Mtibaa 1
1
Université de Monastir, Laboratoire d’Electronique et de Microélectronique, LR99ES30, 5000, Monastir, Tunisia
2
Higher Institute of Applied Sciences and Technology, Sousse University, Sousse, Tunisia

Correspondence should be addressed to Mohamed Ali Hajjaji; [email protected]

Received 25 May 2021; Revised 3 August 2021; Accepted 19 August 2021; Published 27 September 2021

Academic Editor: Shah Nazir

Copyright © 2021 Safa Teboulbi et al. This is an open access article distributed under the Creative Commons Attribution
License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is
properly cited.

Since the infectious coronavirus disease (COVID-19) was first reported in Wuhan, it has become a public health problem in China
and even around the world. This pandemic is having devastating effects on societies and economies around the world. The increase
in the number of COVID-19 tests gives more information about the epidemic spread, which may lead to the possibility of
surrounding it to prevent further infections. However, wearing a face mask that prevents the transmission of droplets in the air
and maintaining an appropriate physical distance between people, and reducing close contact with each other can still be
beneficial in combating this pandemic. Therefore, this research paper focuses on implementing a Face Mask and Social Distancing
Detection model as an embedded vision system. The pretrained models such as the MobileNet, ResNet Classifier, and VGG are
used in our context. People violating social distancing or not wearing masks were detected. After implementing and deploying the
models, the selected one achieved a confidence score of 100%. This paper also provides a comparative study of different face
detection and face mask classification models. The system performance is evaluated in terms of precision, recall, F1-score, support,
sensitivity, specificity, and accuracy that demonstrate the practical applicability. The system performs with F1-score of 99%,
sensitivity of 99%, specificity of 99%, and an accuracy of 100%. Hence, this solution tracks the people with or without masks in a
real-time scenario and ensures social distancing by generating an alarm if there is a violation in the scene or in public places. This
can be used with the existing embedded camera infrastructure to enable these analytics which can be applied to various verticals, as
well as in an office building or at airport terminals/gates.

1. Introduction pandemic. In addition, many sectors such as maintenance


projects and infrastructure construction have not been
Since the end of 2019, infectious coronavirus disease suspended owing to their significant effect on people’s
(COVID-19) has been reported for the first time in routine life [4, 5].
Wuhan, and it has become a public damage fitness issue in By now, the virus has rapidly spread to the majority of the
China and even worldwide. This pandemic has devastating countries worldwide [2]. The last statistics (04/05/2021)
effects on societies and economies around the world provided by the World Health Organization (WHO) show
causing a global health crisis [1]. It is an emerging re- 152,543452 confirmed cases and 3198528 deaths. According
spiratory infectious disease caused by Severe Acute Re- to the centers for Disease Control and Prevention (CDC),
spiratory Syndrome Coronavirus 2 (SARS-CoV-2) [2]. All coronavirus infection is transmitted predominantly by re-
over the world, especially in the third wave, COVID-19 spiratory droplets produced when people breathe, talk, cough,
has been a significant healthcare challenge [3]. Many or sneeze [3] with common droplet size 5–10’m but aerosol
shutdowns in different industries have been caused by this emission increases when humans speak and shout loudly [6].
2 Scientific Programming

Therefore, to prevent rapid COVID-19 infection, many tomography (CT) and X-ray) can lead to a more accurate
solutions, such as confinement and lockdowns, are suggested detection of the COVID-19 and can help to control the
by the majority of the world’s governments. However, this problem of loss of specialized physicians in isolated villages
COVID-19 management inefficacy can be additionally ex- [18]. In this context, authors in [13] suggested a novel
plored with game-theoretic scenarios beyond the public convolutional neural network (CNN)-based method for
goods game. In particular, some researchers have focused on detecting COVID-19, with analyzing chest X-ray (CXR)
the hesitancy of governments in enacting difficult but images. This method allows to detect patients with COVID-
necessary virus containment measures (e.g., stay-at-home 19 at an accuracy of 91.34%. In [18], the authors introduced a
orders and lockdowns), as well as noncooperation for rea- new automatic COVID-19 detection model using CXR
sons other than free riding. For instance, authors in [7] images. The model is called “DarkCovidNet.” For binary
argued that because strict stay-at-home measures can greatly classes (COVID-19 VS no findings), the classification ac-
impact people’s livelihoods, the cost of staying home curacy produced by this model is 98.08%, but, for multiclass
(coupled with lockdown fatigue) can end up outweighing the cases (COVID-19 VS pneumonia VS no findings), the ac-
risk of infection from going out. As individual-level deci- curacy is 87.02%. The main objective is to use such models to
sions have a direct impact on the society-level effectiveness diagnose supplementary chest-related diseases such as tu-
of stay-at-home orders, governments may refrain from berculosis and pneumonia. For the COVID-19 case detec-
implementing them because of anticipated low rates of tion from X-ray images, a deep CNN model is proposed in
compliance, especially from socioeconomically disadvan- [19]. This model, denoted COVID-Net, is open source and
taged individuals who do not have the luxury of staying accessible to the general public. The detection accuracy
home [8]. Some governments may have also been hopeful achieved by this model (93.3%) proves that the model makes
that herd immunity from recoveries and vaccinations would good predictions in improved screening. In [20], distinct
allow them to avoid imposing such unpopular measures deep learning techniques are introduced to differentiate CT
altogether [9]. scan images of both COVID-19 and non-COVID-19. From
With rising numbers of cases and stretched health fa- the different techniques, we list a self-developed model
cilities, as well as the lack of a vaccine throughout 2020 and (CTnet-10), VGG-16, ResNet-50, InceptionV3, VGG-19,
difficulties associated with achieving herd immunity for and DenseNet-169, which have, respectively, accuracy values
COVID-19 [10], government inaction became increasingly of about 82.1%, 89%, 60%, 53.4%, 94.52%, and 93.15%. The
unviable. Hence, to increase people’s adherence to strict accuracy of VGG-19 is the highest one as compared to other
regulations, authors in [7] suggested using social programs models. The CTnet-10 method is a well-organized model,
such as emergency relief funds and unemployment insur- which is useful for doctors, especially in mass screening.
ance to lower the costs of compliance, particularly for lower- In [21], two deep learning models are suggested: a CNN
paid workers [11]. As vaccines became available at the end of and a convolutional long short-term memory (ConvLSTM).
2020, authors in [12] argued that programs driving vacci- To simulate them, two datasets are assumed. A dataset in-
nation uptake will surpass other aspects such as vaccine cludes CT images, and the other includes X-ray images. The
efficacy and isolation procedures in importance. Using EGT, models are tested four times. When they are examined on
social network analysis, and agent-based modeling, the CT images, the dataset is split into 70% for the training set
authors proposed that individuals’ vaccination decision- and 30% testing set. The accuracy value for the CNN model
making will be influenced by “demographics, physical lo- and for the ConvLSTM is the same, equal to 99%. When
cation, the level of interaction, the health of the vaccine, tested on the augmented dataset A, the testing accuracy of
epidemic parameters, and perceptions about the vaccine the CNN is 99%, but it is 100% for the ConvLSTM. When
being introduced, and similarly, the decision-making of the tested on the augmented dataset B, the testing accuracy of
government will be influenced by epidemic parameters, the the CNN is 100%, but it is 99% for the ConvLSTM. When
nature of the vaccine being introduced, logistics, the both models are tested on the combined dataset, containing
management of human resources needed for the vaccination both X-ray and CT images, the testing accuracy is 99% for
effort, and the number of vaccine doses available” [12]. In the CNN and 98% for the ConvLSTM. Finally, when they are
summary, holistic COVID-19 management would involve tested on the radiography dataset, the testing accuracy is 95%
an appreciation of the many factors that calibrate payoffs so and 88% for the CNN and the ConvLSTM, respectively. We
that both individual and governmental decisions shift to- can consider this scenario as a challenging one, because it is
ward safety. called to distinguish between two diseases (COVID-19 and
It is true that COVID-19 is a global pandemic and affects pneumonia) with a high closeness in features.
several domains. Nevertheless, it created a path for re- Before coronavirus, some people put masks to protect
searchers in computer science. We have seen multiple re- themselves from air pollution, while other people put face
search topics, such as creating new automatic detection masks to hide their faces and their emotions from others.
methods of COVID-19 and detecting people with or without Protection against coronavirus is a mandatory counter
masks. Considering that there are some errors in the results measure, according to the WHO [1]. Indeed, wearing a mask
of the early laboratory tests and their delays, researchers is an effective method of blocking 80 of all respiratory in-
focused on different options [13]. Therefore, the application fections [3]. Also, the WHO recommends practising
of advanced artificial intelligence (AI) techniques [14–17] physical distancing to mitigate the spread of the virus. All
coupled with chest radiological imaging (computed over the world, governments are struggling against this type
Scientific Programming 3

of virus. Many organizations enforce face mask rules for the backlash. Considering AI legal concerns and benefits in
personal protection. Checking manually if individuals en- combating COVID-19 pandemic, AI technique-based
tering an organisation are wearing masks is cumbersome solutions are still an open window for development and
and possibly conflicting [1]. In this context, authors in [6] legal interpretation [24].
proposed a deep learning-based model, named MobileNet The reminder of this paper is organized as follows: Section
Mask, to prevent human-to-human transmissions of the 2 summarizes the recent related work in the proposed context.
SARS-CoV-2 and detect faces with or without mask. Two Section 3 presents the proposed framework. After that, a
different datasets (IDS1 and IDS2) with over 5200 images preliminary study is given in Section 4. Section 5 denotes the
are used to train and test the model. All the experimental dataset collection. Thereafter, we introduce the evaluation
cases are controlled on Google Colab that runs in the metrics in Section 6, while the numerical result is discussed in
cloud. In IDS1, the proposed model achieved a testing Section 7. Finally, we conclude this paper in Section 8.
accuracy of 93%. However, in IDS2, the accuracy achieved
is almost 100%. 2. Related Works
In [22], the authors aim to detect and delimit medical
face masks in real images. The proposed model is composed Deep learning is an important breakthrough in the AI field.
of YOLO-V2 and ResNet-50. In the training phase, the It has recently shown enormous potential for extracting tiny
authors used two optimizers which are Adam and SGDM. features in image analysis. Due to the COVID-19 epidemic,
During this process, SGDM is better than Adam on vali- some deep learning approaches have been proposed to
dation root mean square error (RMSE), time, and validation detect patients infected with coronavirus. In this context,
loss. However, Adam is better than SGDM in loss and and unlike bacterial pneumonia, many other types of lung
minibatch RMSE. The average precision (AP) of the Adam infections caused by viruses are called viral pneumonia.
optimizer is 0.81, which is better than the AP of SGDM that These viruses, such as the COVID-19, infect the lungs by
is equal to 0.61. Moreover, the log-average miss rates of the blocking the oxygen flow, which can be life-threatening. This
Adam optimizer are 0.4, which are better than the log-av- motivated researchers to develop many frameworks and
erage miss rates of the SGDM optimizer (0.6), in all the recall schemes based on AI tools in the fight against this dangerous
levels. From these studies, we found also, in [23], a system virus. Hence, we divide this section into two sections to
which triggers an alarm in the operating room when the provide an in-depth overview of the proposed techniques.
healthcare personnel do not wear face masks. The system
combines two detectors, for faces and for masks. In the 2.1. COVID-19 Detection Methods
testing phase, by utilizing images from the BAO dataset and
from an own image dataset, above 95% of true positive and 2.1.1. Deep Learning Tools and CXR Image-Based COVID-19
below 5% of false positive rates are achieved. Detection. Radiography is a technique used to quantify the
Authors in [1] proposed a hybrid model utilizing deep functional and structural consequences of chest diseases, to
learning with classical machine learning to detect masked provide high-resolution images on disease progression.
faces. The proposed model consists of two components: Several works have been carried out in this context. Echtioui
the feature extraction applying ResNet-50 and the clas- et al., in [13], proposed a new CNN-based method for
sification process. The three classifiers used are the de- COVID-19 recognition, through analyzing radiographic
cision trees (DTs), support vector machine (SVM), and images of a patient’s lungs. The aim of this scheme is to
ensemble algorithm. The Real-World Masked Face provide clinical decision support for healthcare workers and
Dataset (RMFD), the Simulated Masked Face Dataset also for researchers. Hence, performance results, as well as
(SMFD), and the Labeled Faces in the Wild (LFW) are the the accuracy value of about 91.34%, and the other metrics in
three face masked datasets, selected for examination. The terms of recall, precision, and F1-score, prove the efficiency
SVM classifier is greater than the other classifiers. It of the method. In the same context, Ozturk et al., in [18],
reached 99.64%, 99.46%, and 100% of testing accuracy, introduced a new automatic COVID-19 detection model
respectively, in RMFD, SMFD, and LFW. using CXR images denoted by the “DarkCovidNet.” It is
In summary and without forgetting the legal side of AI, used to provide correct diagnosis for both a binary classi-
the deep learning technique inherently touches upon a full fication (COVID-19 VS no findings) and a multiclass
spectrum of legal fields, from legal philosophy, human classification (COVID-19 VS pneumonia VS no findings).
rights, contract law, tort law, labor law, criminal law, tax For binary classes, the classification accuracy produced by
law, procedural law, etc. While in practice, AI is just be- this model is about 98.08%, but, for multiclass cases, the
ginning to come into its own in terms of its use by lawyers, accuracy is 87.02%. To validate their initial screening, ra-
and within the legal industry, legal scholars have been diologists can use the model to assist them. This model can
occupied with AI for a long time. Furthermore, as col- be employed also via cloud to screen patients immediately.
lecting and analyzing data is progressively spreading from As a solution to the shortage of radiologists, this method can
software companies to manufacturing companies, which be used in remote places especially in countries affected by
have started to exploit the possibilities arising from col- COVID-19. The most important advantage of this method is
lection and exploitation of potential data, so that added that such models can be used to diagnose supplementary
value can be created, this information deluge unlocks chest-related diseases such as tuberculosis and pneumonia.
various legal concerns that could stimulate a regulatory However, the proposed work fits well into the COVID-19
4 Scientific Programming

detection phase, but to ensure its efficiency and model re- Matthews correlation coefficient (MCC), and F1-score. The
liability, the authors may augment the dataset and retrain the specificity, negative predictive value (NPV), sensitivity, and
proposed model. With the same idea, Wang et al. proposed a positive predictive value (PPV) are considered also in the
deep CNN model which is presented in [19]. Their model, evaluation process.
called COVID-Net, is open source and accessible to the The models were tested four times: firstly, on the dataset
general public. The test accuracy achieved by this model is containing CT images with 288 COVID-19 and 288 normal
93.3%. Therefore, this model makes predictions which can images, this dataset is augmented by diverse rotations and
assist clinicians in improving screening, transparency, and operations of scaling, and the number of COVID-19 and
trust. normal images becomes 2880 and 2880, respectively; sec-
ondly, on the dataset containing X-ray images, this dataset
includes two distinct augmented subsets, and each subset,
2.1.2. Deep Learning Tools and CT Image-Based COVID-19
named “augmented dataset A” and “augmented dataset B,”
Detection. Computed tomography scan or CT scan is a
contains 304 COVID-19 and 304 normal images; thirdly, on
medical imaging technique utilized in radiology in order to
the dataset, named COVID-19 radiography dataset, con-
get detailed images of the body for diagnosis purposes.
taining COVID-19 and viral pneumonia X-ray images; and
Accurate and fast COVID-19 screening is achievable using
fourthly, on a combined dataset, which combines both X-ray
CT scan images. Various works have been carried out in this
and CT images in the two cases, normal and COVID-19.
context. In [20], Shah et al. proposed distinct deep learning
When the models were examined on CT images, the
techniques to differentiate CT scan images of both COVID-
dataset is split into a training set (70%) and a testing set
19 and non-COVID-19, which helps in diagnosis. In the
(30%). They were trained on 40 epochs. The testing accuracy
dataset, we find 349 images corresponding to patients with
for the CNN model and for the ConvLSTM was the same,
COVID-19 and 463 images corresponding to patients
equal to 99%. This is due to their methodical design and the
without COVID-19. These images were divided into three
nature of images. And when they are tested on the aug-
sets: 80% of them for training set, 10% for validation, and
mented dataset A, the testing accuracy was 99% for the first
10% for testing. From the different techniques presented in
model and 100% for the second. However, when they were
this work, we cite CTnet-10, which is a self-developed model
tested on the augmented dataset B, the testing accuracy was
having an accuracy of 82.1%. We can also cite VGG-16,
100% for the first model and 99% for the second model. As
ResNet-50, InceptionV3, VGG-19, and DenseNet-169,
for testing on the combined dataset, containing both X-ray
having an accuracy of 89%, 60%, 53.4%, 94.52%, and 93.15%,
and CT images, the testing accuracy was 99% for the first
respectively. The accuracy of VGG-19 is the best as com-
model and 98% for the second model. Finally, when they
pared to other models. To predict the results, CTnet-10 takes
were tested on the radiography dataset, the testing accuracy
only 12.33 ms. This method is well-organized. It is useful for
of the first model was 95%, but 88% for the second model.
doctors, especially in mass screening. All the automatic
We can consider this scenario as a challenging one,
diagnosis methods presented previously can be used by
because it is called for differentiating between two diseases
doctors for COVID-19 screening.
(COVID-19 and pneumonia) with a high closeness in fea-
tures. The proposed models achieved the same accuracy of
2.1.3. Methods Using CXR and CT Images. Combining two 99% when they were tested on X-ray and CT images, while,
types of images in one dataset is an effective method to detect in previous works, they achieved a range of 95% to 98% and a
a disease. In this context, in [21], Sedik et al. presented two range of 83% to 90.1%, for X-ray and CT images, respec-
deep learning models: CNN and ConvLSTM. To simulate tively. Therefore, the two proposed models can be consid-
the models, two datasets are assumed. The first dataset in- ered as efficient COVID-19 detection systems. Table 1
cludes CT images while the second set includes X-ray im- presents a comparison of different COVID-19 methods.
ages. Each dataset contains COVID-19 and non-COVID-19
image categories. The image categories, COVID-19 and
2.2. Face Mask Detection. Another task in research is
pneumonia, were classified to certify the proposed models.
detecting people with or without mask, to prevent the
The first model based on CNN includes five convolu-
transmission of SARS-CoV-2 between humans.
tional layers (CNVLs) accompanied by five pooling layers
(PLs). Two layers (fully connected layer (FC) and classifi-
cation layer) make up the classification network. The second 2.2.1. MobileNet Mask Model. All governments around the
model is a hybrid one. It combines ConvLSTM and CNN at world are struggling against COVID-19, which causes se-
the same time. rious health crises. Therefore, the use of face masks regu-
The classification network, too, is in the first model. To latory can slow down the high spread of this virus. In this
reduce the complexity of the planed deep learning structure, context, Dey et al. proposed in [6] a deep learning-based
training, validation, and testing are the three phases that model for detecting face mask. This model named “Mobi-
make up the two modalities. An optimization methodology leNet Mask” is multiphase. A pretrained model of the
is necessary in the training. To minimize the errors between ResNet-10 architecture is utilized to find faces in video
the real and the estimated targets, Sedik et al. used the Adam stream. Also, numerous steps are used such as charging the
optimizer. This type of model needs to be held carefully. The classifier (MobileNet), building the FC layer, and testing
proposed models are evaluated by measuring accuracy, phase. All the experimental cases are supervised on Google
Scientific Programming 5

Table 1: Comparison of different coronavirus detection methods.


Accuracy
Ref Model used Image type Advantages Disadvantages
(%)
A simple but effective CNN model
[13] CNN-based model Chest X-ray 91.34
for the detection of COVID-19
Able to perform binary and
multiclass tasks can be used to
[18] DarkCovidNet Chest X-ray 87.02 diagnose other chest-related
diseases including tuberculosis and
pneumonia
An open source and accessible to A limited number of images
[19] COVIDX-Net Chest X-ray 93.3
general public available
Self-developed model
82.1
(CTnet-10) All the automatic diagnosis
VGG-16 89 presented previously can be used
[20] ResNet-50 CT 60 by doctors as an efficient and quite
InceptionV3 53.4 method for coronavirus disease
VGG-19 94.52 screening
DenseNet-169 93.15
CT 99
Augmented dataset A 99
Augmented dataset B 100
CNN modality
Radiography X-ray 95 The proposed modalities achieve
The proposed modalities can be
Combined dataset poor performance in some cases
99 considered in an efficient diagnosis
(CT scan and X-ray) especially for the ConvLSTM
[21] system for the detection of
CT 99 modality due to the dependency on
COVID-19 and other relevant
Augmented dataset A 100 the previous states in the structure
infections
Augmented dataset B 99 of the ConvLSTM modality
ConvLSTM
Radiography X-ray 88
Combined dataset
99
(CT scan and X-ray)

Colab that runs in the cloud and is provided with over 12 GB delimit the objectives of the medical face masks, especially in
of RAM. Different performance metrics (accuracy, F1-score, real images. They proposed a model consisting of two steps:
precision, and recall) are used to judge the performance of medical face masks and feature extraction.
the proposed model. The two public datasets of medical face masks are
Two distinct face mask datasets are used to train and test merged in one dataset to be explored in their research. The
the model. The first dataset, named IDS1, consists of 3835 first one is Medical Masks Dataset (MMD). It contains 682
images, divided into two classes: 1916 images of faces with images with more than 3000 faces wearing masks. The
masks and 1919 images without masks. Kaggle dataset, second one is Face Mask Dataset (FMD), which contains 853
RMFD, and Bing Search API are the source of the typical images. Combining both datasets resulted in a dataset of just
images of this dataset. The second dataset, named IDS2, 1415 pictures after deleting bad quality pictures.
consists of 1376 images, divided into two classes: 690 Three main components compose the introduced model:
images of faces with masks and 686 images without masks. the number of anchor boxes, data augmentation, and the
The sample images of this dataset are gathered from the detector. To evaluate the performance of the YOLO-V2 with
SMFD. the ResNet-50 in noticing and isolating masked faces, Loey
For all experiments, 80% of the datasets are dedicated for at al. conducted different experiments. The model was ex-
training and 20% for testing. When testing the model, it ecuted on the system which has specifications such as
achieved an accuracy of 93% in IDS1, but almost 100% in CuDNN that is a library of the deep neural network for GPU
IDS2. Comparing the results of their model with those of learning. 70% of the dataset is dedicated for the training
state-of-art models available in the literature, Dey et al. phase, 10% for the validation phase, and 20% for the testing
found that the accuracy of theirs is higher. The main ad- phase. Learning rate is initialized with σ � 0.001, the number
vantage is that their model can be implemented on light- of epochs with 60, and the minibatch size with 64. To
weight embedded computing devices. ameliorate detector performance, they used Adam and
Stochastic Gradient Descent with Momentum (SGDM)
optimizers.
2.2.2. ResNet-50 with YOLO-V2 Model. Annotating and In the training, SGDM took less time than Adam. When
localizing medical face masks in real-life images is among the comparing the performance of Adam and SGDM, in the
most important object detection applications. In this con- process of training and validation, Loey et al. found that
text, the main objective of Loey et al. in [22] is to explain and SGDM is better in time, validation loss, and validation
6 Scientific Programming

RMSE. However, Adam is better in loss and minibatch machine learning (ML) to detect masked faces is presented
RMSE. AP and log-average miss rate scores are performance by Loey et al. in [1]. The model proposed by the authors
metrics studied for both Adam and SGDM optimizer ex- includes two phases: the feature extraction process applying
periments. In all the recall levels, the AP of the Adam op- ResNet-50, and the classification process. The ResNet-50
timizer (0.81) is better than the AP of SGDM (0.61) and the model used like a feature extraction is composed of 50 deep
log-average miss rates of the Adam optimizer (0.4) are better layers. A convolutional layer (CNVL) is the start of the
than the log-average miss rates of the SGDM optimizer (0.6). model, a fully connected layer (FCL) is the end of the model,
Therefore, the proposed model is powerful in detecting and 16 residual bottleneck blocks are in between them.
masked faces. To improve the performance of the model, three tra-
ditional classifiers replaced the last layer of the ResNet-50
during the classification process. The classification of face
2.2.3. Detecting Masks in the Operating Room. Wearing
masks is released by three algorithms: the DT, the SVM, and
medical masks in an operating room is mandatory, to
the ensemble algorithm. The SVM is a machine learning
prevent the transmission of viruses from human to human. In
algorithm designed for classification. It is one of the most
this context, in [23], Nieto-Rodrı́guez et al. introduced a system
popular supervised learning techniques. The DT is a model
which detects the existence or the absence of the medical masks
of classification based on information gain and entropy
in hospitals especially in the operating rooms. The system
function. Ensemble methods are a combination of algo-
triggers an alarm for only the healthcare personnels who do not
rithms of machine learning which generate a collection of
put on surgical masks. It consists of four components: two
classifiers. The most adopted ensemble methods are linear
detectors, one for unmasked faces and one for masked faces,
regression, K-nearest neighbors (K-NNs) algorithm, and
and also two color filters, one filter for each detector.
logistic regression (LR).
The well-known face detector, named “Viola and Jones,”
Three datasets are selected for examination: RMFD,
is the base of the face detector. Generally, face detectors
SMFD, and LFW. The RMFD dataset contains 5000 masked
utilize a succession of classifiers. In this paper, a form of
faces with 90000 unmasked faces. However, Loey et al. used
AdaBoost, named LogitBoost, is used. The same strategy is
just 5000 masked face images and 5000 unmasked face
followed by mask detectors. However, instead of LogitBoost,
images to stabilize the dataset. The SMFD dataset contains
Gentle AdaBoost is used.
785 simulated masked face images and 785 unmasked face
The two types of detectors work only on gray images.
images. As for the LFW dataset, it consists of 13000 masked
Reducing the number of false positives and trying to keep
face images for celebrities all over the world. It is used only in
away from the false negative number is the objective of the
the testing phase. During the training and the testing phase,
stage of color filters. All the detections produced by the
the RMFD is referred to as DS1, SMFD is referred to as DS2,
detectors which proceeded the color filters are then classified
a combination of DS1 and DS2 is referred to as DS3, and
in the identical category. The face detectors include two
LFW is referred to as DS4 which is used only for the testing
stages: one stage on gray scale and the other stage with color.
process. The datasets used for the training and the testing are
For the gray-case sample, the training phase is accom-
divided into 70%, 10%, and 20%, for training, validation, and
plished in the LFW image dataset. 10000 positive images
testing, respectively. The most frequent performance mea-
with 5000 negative images are used during the training
sures used to judge the performance of the three classifiers
process. The test process is run on the CMU Frontal Face Set.
are accuracy, recall, precision, and F1-score.
A succession of 20 classifiers is present in the face detector.
Table 2 shows the performance of validation accuracy of
Each one is a decision tree accompanied with two depth
98%, achieved by the DT classifier. The highest testing ac-
levels escorted by 0.999 threshold and 0.5 as false positive
curacy is achieved by the DT classifier when the training is
threshold. The color filter used for the face detection is built
completed over DS3. On DS4, which is used for testing only,
in the color space of HSV, for over 13000 pictures from
a competitive accuracy of 99.89% is achieved. The validation
LFW. More than 4000 images are used in the training phase.
accuracy achieved by the SVM classifier for the different
Images from the BAO dataset are used for testing.
datasets exceeds the accuracy of the DT classifier.
In the training phase, on gray scale images, 4000 positive
Additionally, while the training is above DS2, the top
with 15000 negative images are used. The color filter for
validation accuracy possible reached by the SVM is 100%,
masks finds the position, definitions, threshold, and size of
while the highest validation accuracy achieved by the DT
the features. The detectors, for face and for mask, are
classifier in DS3 was 98%.
combined by the face classifier. Images with unmasked faces
Another essential factor to evaluate the performance of a
from the BAO dataset and images with masked faces from an
classifier is the time it takes to perform a task. For all the
own dataset are used in the test phase. As a result, the true
datasets, the time taken by the SVM classifier is shorter than
positive ratio is throughout 95% and the false positives are
that taken by the DT classifier. In terms of validation ac-
under 40. The main objective of this system is working in
curacy, testing accuracy, consumed time, and performance
real-time especially on a conventional PC.
metrics, the SVM classifier is better than the DT classifier.
The same experimental cases conducted on the previous
2.2.4. Hybrid Model. All over the world, the trend of wearing classifiers (DT and SVM) are performed on the ensemble
masks is rising because of COVID-19 pandemic. In this algorithms classifier. During the validation on DS3, the
context, a hybrid model utilizing deep learning with classical ensemble achieved an accuracy of 100%. According to the
Scientific Programming 7

Table 2: Validation accuracy and testing accuracy of the three into the algorithm and also an output to calculate the errors.
classifiers for different datasets. The batch size defines the number of trials to work along
Validation Testing before updating the parameters of the internal model. In
Classifier Datasets other words, it is the number of trials that will be proceeded
accuracy (%) accuracy (%)
DS1 92 to 94 96.78 across the network at the same time.
DS2 96 95.64 A training dataset could be dissected into just one or
DT supplemental batches. The number of epochs is a hyper-
DS3 98 96.5
DS4 — 99.89 parameter defining the number of times the learning al-
DS1 98 99.64 gorithm will labor through the full training dataset.
DS2 100 99.49 Optimizers are assisted to minimize the loss function. They
SVM
DS3 99 99.19 update the model in regard to the loss function output. The
DS4 — 100 loss function is also called error function. We can say that the
DS1 97 99.28 heart of the different algorithms of the ML is the loss
Ensemble algorithms
DS2 94 99.49 functions. The loss function could be used to estimate the
DS3 100 99.35 model’s loss. Thus, the weights can be renovated to minimize
DS4 — 100 the loss of the following evaluation. In the testing phase, our
seven various models will be scanned to choose the best one
to be exploited in the next step.
obtained results, the ensemble classifier is better than the DT The second block, which is the testing framework phase,
and the SVM classifier with regard to the validation accu- was developed to operate with the best model. The best
racy, testing accuracy, and performance metrics, only when loaded model is used to confirm the face mask detection
the training is on DS1 and DS3. Contrarily, when the technique. In addition, the pairwise distance algorithm was
training process is on DS2, the SVM classifier outperforms evolved to calculate social distance between peoples.
the other classifiers. Moreover, the time consumed by the However, the distance between the centers of the bounding
SVM while the training process is the short one. box of detected people will be calculated. The center point
C(x, y) of bounding boxes is measured using the equation as
3. Proposed Face Mask Detection Framework seen in
Based on Deep Learning Models Xmin + Xmax
C(x, y) � ,
2
Figure 1 depicts the whole proposed framework, in this (1)
paper, which consists of two principal blocks. The first block Y + Ymax
includes the training and the testing models, whereas the · min ,
2
second block consists of the whole framework testing (the
best model with social distancing step). For the first block, where C is the center point of the bounding box. Xm in and
our labeled dataset was divided into three classes. The first Xm ax are the minimum and maximum values for the
class is focused on the training and represents 70% of the corresponding width of the bounding box. Ymin and Ymax are
dataset images. However, the validation step required only the minimum and maximum values for the corresponding
10% to validate the performance for the trained models. 20% height of the bounding box. To measure the distance C1
of the dataset was devoted to the testing phase. For each (Xmax − Xmin ) and C2 (Ymax − Ymin ), between the center of
epoch, each model is trained on the training dataset. The each bounding box, we used the Euclidean formula, see
training results, as well as the training accuracy and the equation (2), where the distance between pixels is translated
training loss, are presented in the form of curves in figures of in a metric distance (knowing the range and field of view
“accuracy in terms of epoch” and “loss in terms of epoch,” covered by the camera) and then compared to a threshold
respectively. After training, each model is validated on the value:
validation dataset. Like the training results, the obtained 􏽱���������������������������
validation results are the validation accuracy and the vali- 2 2 (2)
D C1 , C2 􏼁 � Xmax − Xmin 􏼁 + Ymax − Ymin 􏼁 .
dation loss. Then, the two results are compared with the loss
function. An error function value tending toward zero In case of finding color function detects two bounding
means a well-trained model. Otherwise, the hyper- boxes and the distance is less than the threshold value, these
parameters are tuned to train the model in another epoch. boxes will have a red color. If this function detects two
The process of calculating errors and updating the network’s bounding boxes and the distance is more than the threshold
parameters is called backward propagation, which is the value, the color will be green for these boxes. Figure 2
second important process elaborated in the training phase of provides the measured distance (D) between the center of
any neural network, after the forward propagation process. each bounding box for a detected person, where D is the
The hyperparameters, as well as learning rate, batch size, distance between the centers of bounding boxes [25].
number of epochs, optimizer, anchor boxes, and loss After that, the proposed framework with the best trained
function, are tuned to build an optimal model. However, the deep learning model will be implemented on an embedded
learning rate is denoted as the learning step where the model vision system that consists of Raspberry Pi 4 board and
updates its learned weights. It contains inputs which are fed webcam.
8 Scientific Programming

Hyper-parameters
Tuning

Training Phase
Training Build Models Training Results

Dataset split Validation Models Validation Results


Labeled

Testing Phase
Dataset

Test Test Results Compare Models

Whole Test Face Mask + Face mask


Load Best Model Detection
Framework Test Social distancing
Detection

People's Distance Pairwise Distances

Testing Framework Phase


Matrix between Centroid
Determination Determination

With mask

Without mask
Soacial Distancing
Detection
Distance Violated

Distance
Maintained

Outputs

Implementation of the Face


mask and Social Distancing
Detection Framework
Raspberry Pi Raspberry Pi

Webcam

Figure 1: Proposed framework for the face mask and social distancing.

4. Preliminary Study from the image’s data (the input) [26]. In a considerable
image, a small section is taken and passed throughout all
There are many categories of neural networks such as CNNs, points in the big image (the input). At the time of passing at
which have proven very powerful in areas such as classification every point, they are convoluted within a single position (the
and face recognition. CNNs are a sort of feedforward neural output). Each small section which passes over the big image
networks which consists of many layers. The structure of is called kernel or filter [27]. This creates an activation map
CNNs mostly accommodates CNVLs, PLs, rectified linear unit or a feature map in the output image. After that, the acti-
(ReLU) layers, and FC layers. Other structures contain batch vation maps are sustained like input data to the following
normalization layers and softmax and classification layer [26]. CNVL [26].
A typical convolution operation, shown in Figure 3,
denotes the input image by X (nH , nW , and nC ), where nH ,
4.1. Convolutional Layer. Figure 3 represents the CNVL nW , and nC are the height, the width size of the feature map,
which is the key construction block of any convolutional and the number of channels, respectively, while K(f, f, nC )
networks. The main goal of CNVL is to take out features is the filter kernel, where f × f is the size of the convolution
Scientific Programming 9

Figure 2: The measured distance (D) between the center of each bounding box.

Image
Sum of Elementwise
Multiplication

Filter Output (4,4,1)


(f = 3, f = 3, nC = 3)

Same number of channels


(nH = 6, nW = 6, nC = 3)
(p = 0, s = 1,)
Figure 3: Convolutional layer.

kernel. Thus, the CONV formula is denoted in equation (3),


and the output dimension is given by equation (4), where s
designates the stride parameter [27, 28]:

nH nW nC
CONV(X, K)x,y � 􏽘 􏽘 􏽘 Ki,j,k Xx+i−1,y+j−1,k , (3)
i j k

nH + 2 p − f nW + 2p − f
Dim􏼐CONV(X, K)x,y � 􏼠􏼢 + 1􏼣, 􏼢 + 1􏼣􏼡; s > 0,
s s (4)
� 􏼐nH + 2p − f, nW + 2p − f􏼑; s � 0.

4.2. Pooling Layer. Figure 4 depicts an example of max- dimension of each activation map but keeps the most
pooling operation [27]. The pooling layer or subsampling necessary information [26]. Therefore, a single output is
means simply downsampling each image. It reduces the produced by subsampling a small region of convolutional
10 Scientific Programming

s=2 Image

s=2

Average pooling
(f,p,s) = (2,0,2)

Output

Figure 4: Pooling layer.

output. The max pooling, the average pooling, and the mean 1-dimension vector having the dimension (n[i−1]
H × n[i−1]
W ×
[i−1]
pooling are pooling techniques. Max pooling takes the nC , 1); thus,
biggest pixel value of the region [27]. Equations (5) and (6)
present how to calculate the max pooling and the average ni−1 � n[i−1]
H × n[i−1]
W × n[i−1]
C . (9)
pooling, respectively [29]. The main advantage of this layer is However, the learned parameters at the lth layer are the
achieving faster convergence, better generalization, robust to weights wj,l × nl parameters and the bias with nl parameters.
distortion, and translation and is habitually placed in the
middle of convolution layers [26]:
4.5. The Batch Normalization Layers. To reduce the training
Maxi � max (X), (5) time of any CNN and the sensitivity to initialize the network,
1⟶f×s
we used the batch normalization layers.
f×s
The input (xi ), the minibatch mean (mb ), and also
1 minibatch variance (vb ) are the three variables to compute
Avgi � 􏽘 X. (6)
f×s 1 the normalized activations. The formula is presented in the
following equation:
There are alternatives to CNNs which allow to further x −m
decrease the parameters. Among these options, one can cite x􏽢i � 􏽱i�����b , (10)
stride [30]. v2b + θ

where θ is a constant which develops the numerical state if


4.3. Rectified Linear Unit Layer. The rectified linear unit layer, the vb is small. Equations (11) and (12) present the calcu-
known as the ReLU layer, is a nonlinearity activation operation, lation of mb and vb , respectively:
applied in feature maps produced by the convolutional layers.
1 n
Equation (7) presents how to calculate the ReLU [31]: mb � 􏽘x , (11)
n i�1 i
Relu(g(x) � max(0, x)). (7)

It is an operation which replaces all the negative values in 1 n 2


vb � 􏽘 x − mb 􏼁 . (12)
each feature map by zero [26]. n i�1 i

In the batch normalization layers, the activations are


4.4. Fully Connected Layer. Figure 5 depicts the FCL [26, 27]. calculated as shown in
However, it is a finite number of neurons that takes one yi � a ∗ x􏽢i + b, (13)
vector as input and return another. Let us consider a jth node
of an ith layer, and the output Zij is defined as equation (9): where a is a balance factor and b is a scale factor. During the
ni−1 training process, these factors are two learnable factors
Z[i] [i] [i−1]
j � 􏽘 Wj,l al + b[i]
j . (8) renovated to the most suitable values [31].
l�1

The a[i− 1] is denoted as a convolution or a pooling 4.6. Softmax and Classification Layer. The classification
result with a dimension of (n[i−1] [i−1] [i−1]
H , nW , nC ). Therefore, layer is habitually the last layer in a CNN. Softmax
to plug the fully connected layer, we flatten the tensor to a function is utilized generally in CNNs, in order to match
Scientific Programming 11

ni–1
[i] [i–1] + [i]
a bj
Layer a[i-1] Z[i]
j = j,1 1
1=1

Layer a[i]
a1[i-1]

a1[i]

a2[i-1]

a2[i]

a3[i-1]

.....

.....

ani–1[i]

ani–1–1[i–1]

ani[i]

ani–1[i–1]

Figure 5: Fully connected layer.

nonnormalized values of the previous layer to allow between two individuals will be estimated (violated distance
distribution of above-predicted class scores. Equation alert or not) [32].
(14) designs the softmax function:
exi 6. Evaluation Metrics
σ xi 􏼁 � j�1 , j � 1, . . . , K, (14)
􏽐K exj
Accuracy is the overall number of the correct predictions
where σ refers to the softmax output corresponding to each fractionated by the whole number of predictions created for
xi and xj denotes the input vector values [31]. a dataset. It can inform us immediately if a model is trained
correctly and by which method it may perform in general.
5. Dataset Collection Nevertheless, it does not give detailed information con-
cerning its application to the issue. Precision, called PPV, is a
Figure 6 illustrates an example of faces wearing and not satisfactory measure to determination, whereas the false
wearing masks. The experiments of this research are con- positives cost is high. Recall is the model metric used to
ducted on one original dataset. It consists totally of 3835 select the best model when there is an elevated cost linked
images. This is a balanced dataset containing two categories, with false negative. Recall helps while the false negatives’ cost
faces with masks (1919 images) and without masks (1916 is high. F1-score is required when you desire to seek
images) with a mean height of 283.68 and mean width of symmetry between both precision and recall. It is a general
278.77. It comprises two categories. This dataset is used not measure of the accuracy of the model. It combines precision
only for training and validation, but also for testing, and if an and recall. A good F1-score is explained by having low false
individual is wearing a mask or not, then the social distance positives and also low false negatives.
12 Scientific Programming

Figure 6: Dataset example.

Equations (15), (16), (17), and (18) present how to cal- specificity is 92%, then the rate of the false negatives is equal
culate the accuracy, precision, recall, and F1-score, re- to 2% and the rate of the false positives is equal to 8%.
spectively [1]: Macro-averaging is used for models with 2 targets and
TP + TN more. Some macro-averaged measures are described [33].
accuracy � , (15) First, macro-averaged precision computes the average
(TP + FP) +(TN + FN)
precision per each class. It is known as macro-precision.
TP Macro-precision score can be determined arithmetically by
precision � , (16) the mean of all the precision scores of the different classes. It
(TP + FP)
is defined in equation (19) by
TP 􏽐ni�1 Precisioni
recall � , (17) macro − precision � . (19)
(TP + FN) number of classes

2 ∗ Precision ∗ Recall Macro-precision is low for models which not only ac-
F1 − score � , (18) complish well on common classes but also accomplish
(Precision + Recall)
poorly on rare classes. Thus, it is a harmonious metric to the
with TP being the computation of the samples of true all-inclusive accuracy. Second, macro-average recall is the
positives, TN is the calculation of the samples of true mean of recall scores of all different classes. It is known as
negatives, FP is the counting of the samples of false positives, macro-recall. We can compute the macro-recall as
and FN is the enumeration of the samples of false negatives, 􏽐ni�1 Recalli
from a confusion matrix. The sensitivity and specificity are macro − recall � . (20)
number of classes
two statistical measures of the binary classification test
performance which are largely used in medicine. Sensitivity, Third, the macro-averaged F1-score, also called the
known as true positive rate, measures the proportion of macro F1-score, represented the harmonic mean of the
positives which are correctly identified. The specificity, macro-precision and the macro-recall. Equation (21) shows
known as true negative rate, measures the proportion of how to calculate macro F1-score:
negatives which are correctly identified. MAP ∗ MAR
The terms “TP,” “FP,” “TN,” and “FN” refer to the test macro F1 − score � 2 ∗ , (21)
MAP− 1 + MAR− 1
result and the classification correctness. As a sample, if a
disease is the condition, “TP” signifies “correctly diagnosed where MAP denotes macro average precision and MAR
as diseased,” “FP” refers to “incorrectly diagnosed as dis- refers to the macro-average recall.
eased,” “TN” means “correctly diagnosed as not diseased,” Weighted average (weighted avg) is a computation that
and “FN” denotes “incorrectly diagnosed as not diseased.” accounts for the varying degrees of the numbers’ importance
Therefore, if the sensitivity of the test is 98% and the in a dataset. When a weighted avg is calculated, each number
Scientific Programming 13

in the dataset is multiplied by a prearranged weight before detection of COVID-19 from CXR or CT images. In [34], a
the final calculation. A weighted avg can be more accurate DenseNet-121 model used a promising technique to predict
than a simple average in which all numbers in a dataset are COVID-19 patients from 2482 CT images using CNN. It
assigned an identical weight. achieved a total accuracy of 92%, a precision of 84%, a recall
To explain in depth the formula of the weighted avg, we of 95%, an F1-score of 89%, and a macro-precision, F1-score,
follow these steps: determine the weight of all data point, recall, and weighted-precision of 92%. All parameters are
multiply the weight by every value, and the results of step over 84%. Therefore, DenseNet-121 is an efficient model to
two are added together. Among weighted avg scores, we find detect COVID-19. In [35], an approach used DenseNet-121
weighted avg precision, weighted avg recall, and weighted to detect COVID-19 patients from radiology images. The
avg F1-score. model was trained and tested on a COVIDx dataset of 13800
images corresponding to 13725 patients. It achieved 96.49%
7. Numerical Results and 93.71% accuracies for two-class and three-class classi-
fications. These results outperformed the robustness of the
In this section, the numerical results will be introduced. For model. In [36], an automated method was used to classify CT
all simulated deep learning models, as well as DenseNet, and X-ray images into coronavirus, bacterial pneumonia,
InceptionV3, MobileNet, MobileNetV2, ResNet-50, VGG- and normal classes using DenseNet-201 architecture. Re-
16, and VGG-19, the TensorFlow-GPU is used as a deep garding coronavirus class, specificity and precision were
learning framework to train the deep learning models. The satisfactory, with rates of 96.10% and 90.33%, respectively.
hyperparameters used in our experiments are summarized As the sensitivity, it was equitable and reached 75.14%. We
as follows: the batch size is set to 32, the training epochs are can explain these values by the fact that the sum of the TNs
from 20 to 40, and the learning rate is set to 0.0001, with the was high, the sum of the FPs was low, and the sum of the FNs
Adam optimizer used to update network weights. The was low, respectively. For bacteria class, the sum of FNs was
low, which justifies the acceptable sensitivity (92.95%). The
i7-3770 @3.4 GHz CPU and 16 GB RAM and an NVIDIA
®
training platform uses Windows 10 OS with Intel Core TM
sum of TNs was relatively high, and the sum of the FPs was
GeForce RTX 2070 GPU. relatively low, which justifies the reasonability of specificity
and precision values. For normal class, the sum of FNs was
low, the sum of FPs was low, and the sum of TNs was high,
7.1. DenseNet Results. DenseNet is a contemporary archi- which justifies the good sensitivity (95.88%), precision
tecture of CNN. Among distinct DenseNet (DenseNet-201, (92.59%), and specificity (96.28%), respectively. Here, FNs,
DenseNet-160, DenseNet-121, etc.), in our study we TNs, and FPs mean false negatives, true negatives, and false
employed DenseNet-201. Our DenseNet model was trained positives, respectively.
to classify images into masked faces and unmasked faces for In the end, we can say that the family of DenseNet is a
20 epochs. The training and validation loss and accuracy methodical architecture to detect COVID-19 patients and
graphs of DenseNet-201 are shown in Figures 7(a) and 7(c), faces with or without mask.
respectively. Figure 7(a) shows that after inputting the data
of our algorithm, this model nearly tends to maintain a high
accuracy greater than 80% without overfitting. 7.2. InceptionV3 Results. InceptionV3 is one of the CNNs
A confusion matrix is a particular table layout which dedicated for classification. It contains 48 deep layers and
allows to visualise the performance of the algorithm. For the employs inception modules, which requires a connected
trained model, we can compute a plenty of parameters, based layer with 1 × 1, 3 × 3, and 5 × 5 convolutions. It is referred to
on TP, FP, FN, and TN. In our case, TP means that a human as a GoogleNet architecture. Figure 8(a) shows the training
is wearing a mask and the system shows a person wearing a and validation loss for our InceptionV3 model, as it de-
mask, FN means that a human is not wearing a mask but the creases with the continuous epochs, to achieve 0.4.
system shows a person not wearing a mask, FP means that a Figure 8(c) depict the training and validation accuracy of our
human is wearing a mask but the system shows a person not model as it upgrades with the successive epochs achieving a
wearing a mask, and TN means that the human is not high accuracy greater than 80% without overfitting.
wearing a mask and the system shows that person not Figure 8(b) shows the confusion matrix of testing data of the
wearing a mask. Figure 7(b) illustrates the confusion matrix InceptionV3 model.
for the DenseNet model in the testing phase. Table 3 shows When discussing the evaluation parameters in Table 3,
all the evaluation parameters: precision, recall, F1-score, we note that precision, recall, F1-score, and support, ob-
support, accuracy, sensitivity, and specificity, for masked tained in “masked faces” case, are higher than “unmasked
faces and unmasked faces cases, macro avg precision, macro faces” case. The accuracy and the sensitivity are over 80%. To
avg recall, macro avg F1-score, macro avg support, weighted conclude, InceptionV3 learned the information well, but
avg precision, weighted avg recall, weighted avg F1-score, DenseNet is better.
and weighted avg support. For the cases of masked faces, the Among works which interested in detecting and ana-
resulted surpassed 0.92 accuracy and F1-score, with 0.91 lyzing COVID-19 on chest X-ray images, we cite the work
recall, accuracy, and sensitivity. in [37], which utilized a method based on the InceptionV3
Different DenseNet architectures have been used in model. 6432 images collected from the Kaggle repository
research. In this context, numerous works focused on were used for training, validation, and testing phases. Three
14 Scientific Programming

<DenseNet201>: Training and Validation Loss Confusion matrix <DenseNet201>: Training and Validation Accuracy
1.0 1.0
450

0.8 400 0.8


with_mask 477 47
350

Accuracy
0.6 0.6
300
Loss

0.4 250 0.4


200
0.2 0.2
without_mask 39 351 150
0.0 100 0.0
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Epoch 50 Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 7: DenseNet evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

Table 3: Performance evaluation of the proposed models.


Precision Recall F1-score Support Accuracy Sensitivity Specificity
With mask 0.92 0.91 0.92 524
0.91 0.91 0.99
Without mask 0.88 0.90 0.89 390
DensNet
Macro avg 0.90 0.91 0.90 914 — — —
Weighted avg 0.91 0.91 0.91 914 — — —
With mask 0.83 0.85 0.84 524
0.88 0.86 0.77
Without mask 0.80 0.77 0.78 390
InceptionV3
Macro avg 0.81 0.81 0.81 914 — — —
Weighted avg 0.82 0.82 0.82 914 — — —
With mask 0.98 0.98 0.98 524
0.98 0.98 0.98
Without mask 0.97 0.98 0.98 390
MobileNet
Macro avg 0.98 0.98 0.98 914 — — —
Weighted avg 0.98 0.98 0.98 914 — — —
With mask 0.95 0.96 0.96 524
0.95 0.96 0.94
Without mask 0.95 0.94 0.94 390
MobileNetV2
Macro avg 0.95 0.95 0.95 914 — — —
Weighted avg 0.95 0.95 0.95 914 — — —
With mask 0.99 0.98 0.99 524
0.99 0.98 0.99
Without mask 0.97 0.99 0.98 390
ResNet-50
Macro avg 0.98 0.99 0.99 914 — — —
Weighted avg 0.99 0.99 0.99 914 — — —
With mask 0.99 0.98 0.99 524
0.99 0.98 0.99
Without mask 0.98 0.99 0.99 390
VGG-16
Macro avg 0.99 0.99 0.99 914 — — —
Weighted avg 0.99 0.99 0.99 914 — — —
With mask 0.99 0.99 0.99 524
0.99 0.99 0.99
Without mask 0.98 0.99 0.99 390
VGG-19
Macro avg 0.99 0.99 0.99 914 — — —
Weighted avg 0.99 0.99 0.99 914 — — —

classes of classification (normal, COVID-19, and pneu- whose respective values were 75.88%, 88.06%, and 95.01%.
monia) are discussed. The highest precision (0.97) is ob- These values are explained as follows: the sum of FNs is
tained for detecting COVID-19. The highest recall (0.97) practically low, the sum of FPs is relatively low, and the sum
and F1-score (0.95) are obtained for detecting pneumonia. of TNs is high, respectively. Bacteria class is distinguished
And the overall accuracy of this model is 0.93. We can say well since specificity and sensitivity are equivalent to
that InceptionV3 is a satisfactory model. Also, in [36], an 90.00% and 92.42% and with the tolerable precision
automated method aimed to classify CT and X-ray images (83.06%). The high value of the sum of TNs and the low
into coronavirus, bacterial pneumonia, and normal classes value of the sum of FNs explain the values of specificity and
using InceptionV3 architecture. Regarding coronavirus sensitivity, respectively. On the other hand, the low value of
class, it was identified quite well because of the reasonable the sum of TNs justifies the value of precision (83.06%). The
sensitivity and precision values and the good specificity normal class is well identified since sensitivity, precision,
Scientific Programming 15

<InceptionV3>: Training and Validation Loss Confusion matrix <InceptionV3>: Training and Validation Accuracy
1.0 1.0
400
0.8 0.8
with_mask 448 76 350

Accuracy
0.6 0.6
300
Loss

0.4 250 0.4

0.2 200 0.2


without_mask 91 299
150
0.0 0.0
0 5 10 15 20 25 30 35 40 100 0 5 10 15 20 25 30 35 40
Epoch Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 8: InceptionV3 evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

and specificity attained 95.51%, 93.76%, and 96.91%, re- can be performed by operating the MobileNet model. The
spectively. The low values of the sum of FNs and FPs and MobileNetV2 model is developed from the MobileNetV1.
the high value of the sum of TNs explain the performance Figure 10(a) presents the MobileNetV2 training and validation
of the evaluation parameters, respectively. loss. Also, Figure 10(c) shows the graphs of training and
To conclude, we can affirm that the InceptionV3 is a validation accuracy. Then, after seven training epochs, the
systematic architecture to detect COVID-19, pneumonia, or graph shows that this model is prone to overfit but still gives a
normal patients as well as masked and unmasked faces. high accuracy close to 100%. Figure 10(b) illustrates the
confusion matrix of the MobileNetV2 model in the testing
phase. In Table 3, we note that all evaluation parameters except
7.3. MobileNet Results. MobileNets are one of CNN-based for the support are over 0.94. This means that the MobileNetV2
networks, which are primarily built from depthwise sepa- is well trained and is an efficient model in detecting faces with
rable convolutions. Figures 9(a) and 9(c) analyze the results and without masks. Comparing this model with the previous
of the training and validation loss and accuracy of the ones, we see that it is a little bit less efficient than MobileNet,
MobileNet model, respectively. After inputting the data of but more coherent than DenseNet and InceptionV3.
our algorithm, the graphs of loss nearly tended to zero and Many studies are focused on detecting COVID-19 using
the graphs of accuracy showed that after five training epochs, MobileNetV2 as a classifier. Among them, we cite the
the model maintained a high accuracy close to 100% without classifier presented in [39]. The principal aim of the authors
overfitting. The confusion matrix of the MobileNet model is to distinguish between people who are normal, people who
during the testing phase is shown in Figure 9(c). Table 3 have pneumonia, and people having COVID-19 (with
shows that all the evaluation parameters values, especially damaged lungs), from CXR images. The overall testing
support, are over 0.97. Therefore, the MobileNet is a me- accuracy of this model is 96.32%. The testing F1-score,
thodical model to detect masked faces and unmasked faces. sensitivity, specificity, precision, and accuracy obtained
In fact, MobileNet outperforms previous models. when classifying COVID-19 data are, respectively, 99.43%,
Among the several works interested in detecting 100%, 97.72%, 98.87%, and 99.24%. The values of these
COVID-19, a DNN named RAM-Net is presented in [38]. metrics in the classification of normal and pneumonia in-
The RAM-Net is a combination of MobileNet with DDSC dividuals are all over 89%.
which is a dilated depthwise separable convolution, three It is obvious that the MobileNetV2 model could con-
residual blocks and two attention augmented convolution. tribute to detecting not only COVID-19 disease efficiently
One of the most popular public datasets containing CXR but also faces with or without masks.
images is used to learn and validate the network. This dataset
is called COVIDx. Thanks to this network, positive COVID-
19 cases can be identified. While testing the network on the 7.5. ResNet-50 Results. ResNet is the abbreviation of Re-
COVIDx dataset, the overall accuracy, precision, and sen- sidual Networks. It is a network employed as a backbone for
sitivity achieved are, respectively, 95.33%, 99%, and 92%. countless computer vision tasks and a winner of the Image
In conclusion, we can say that when using MobileNet Net challenge in 2015. It is a variant of the ResNet model
architecture solely or combined with other blocks for object family. It consists of 48 convolutional layers with 1 max
detection, we always achieve high performances. Moreover, pooling and also 1 average pooling layer. As Figures 11(a)
it is useful for a lot of object detection. and 11(c) of the training and validation accuracy, and loss,
respectively, show, the loss nearly tends to zero and the
accuracy is high close to 100%. The confusion matrix after
7.4. MobileNetV2 Results. MobileNet is one of the deep testing is given in Figure 11(b). When evaluating the pa-
learning models intended to be utilized in low-hardware cost rameters in Table 3 of the ResNet-50 model, we note that all
gadgets. Classification, segmentation, and object identification parameters’ values except for “support” are over 0.97.
16 Scientific Programming

<MobileNet>: Training and Validation Loss Confusion matrix <MobileNet>: Training and Validation Accuracy
1.0 500 1.0

0.8 0.8
with_mask 514 10 400

Accuracy
0.6 0.6
300
Loss

0.4 0.4
200
0.2 0.2
without_mask 9 381
100
0.0 0.0
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Epoch Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 9: MobileNet evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

<MobileNetV2>: Training and Validation Loss Confusion matrix <MobileNetV2>: Training and Validation Accuracy
500
0.30
0.98
0.25 505 19 400
with_mask 0.96

Accuracy
0.20 0.94
300
Loss

0.15 0.92

0.10 200 0.90

0.05 without_mask 24 366 0.88


100 0.86
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Epoch Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 10: MobileNetV2 evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

<ResNet50>: Training and Validation Loss Confusion matrix <ResNet50>: Training and Validation Accuracy
1.0 500 1.0

0.8 0.8
with_mask 514 10 400
Accuracy

0.6 0.6
300
Loss

0.4 0.4
200
0.2 0.2
without_mask 3 387
100
0.0 0.0
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Epoch Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 11: ResNet-50 evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

Compare ResNet-50 with the other four preceding models, dataset. The sources of the created dataset are as follows:
and we note that ResNet is the best. SIRM, which is the Italian Society of Medical Radiology,
In AI, many research works are focused on detecting dataset generated by assembling diagnosed images from
objects using the ResNet-50 model as a classifier. In [40], the different articles, coronavirus open-source shared dataset,
authors are concentrated on detecting and classifying and CXR image dataset. Augmentation techniques are
COVID-19 individuals with the ResNet CNN architecture. elaborated due to the tiny dataset. The dataset consists of two
The used CXR images are created with more than one classes: people having COVID-19 and normal people. By
Scientific Programming 17

appealing 5-fold-cross-validation, the results are evaluated. accuracy close to 100% without overfitting, after seven
As a result, a classification accuracy of 99.5% is achieved. training epochs. Figure 13(b) illustrates the confusion matrix
Therefore, the obtained results are encouraging regarding for the VGG-19 model in the testing phase. It shows that the
the exploitation of computer-aided models, especially in the VGG-19 performance is satisfactory on the test set. Table 3
pathology field. It can be also operated in situations when the expresses the evaluation metrics of the VGG-19 model. All
possibilities are deficient, such as RT-PCR tests, radiologist, the metric values, except for the support, are over 0.98.
and doctor. Compare the performance of this model with the previous
ones, and we note that the VGG-19 is the best one.
Many researchers applied nonidentical deep learning
7.6. VGG-16 Results. VGG-16 is a CNN proposed by
algorithms for detecting COVID-19 automatically, and many
A. Zisserman and K. Simoniyan. They utilized small con-
of these algorithms reported a significant accuracy. In [42], a
volutional filters and a stride of 1. This CNN has 16 layers.
current deep learning framework is proposed to identify the
Figure 12(a) shows that both the training loss and validation
presence or absence of COVID-19. The main purpose of the
loss are reduced ensuing each epoch for the VGG-16 model.
authors is to judge the effectiveness of the pretrained VGG-19
The graph nearly tends to zero after 10 epochs. Moreover,
architecture in detecting COVID-19 cases using CXR images.
Figure 12(c) shows the overall training and validation ac-
The used dataset is gathered from different hospitals in
curacy throughout each epoch for the VGG-16 model. Then,
Tehran, Iran. It includes 464 high quality images; 345 of them
after six training epochs, the graph shows that this model
are for COVID-19 cases, and 119 are for normal cases.
maintains a high accuracy close to 100% at epochs 6 to 20. The
Posterior-anterior (PA) projection is used to train the model.
confusion matrix for the VGG-16 model in the testing phase
5-fold-cross-validation is applied to use all images in the
is presented in Figure 12(b). Table 3 reveals all the evaluation
training phase. In each fold, 20% of all images are used for
measures of VGG-16. It shows over 0.98 performance beyond
testing and 80% for both training and validation.
all measures except for the “support.” These values are in-
The network’s weights are initialized with the pre-
dicative of strong performance of VGG-16. Compared with
trained model’s weights on the ImageNet database. The
other models, we can say that VGG-16 and ResNet-50 have
Adam optimizer with two standard parameters β1 � 0.9 and
the same effectiveness and outperformed the DenseNet,
β2 � 0.999 and the batch size equal to 16 are used in the
InceptionV3, MobileNet, and MobileNetV2 models.
training phase of the model. The learning rate is initialized
VGG-16 is exploited in many research works. In [41], a
at 1e-5. After that, it decreased by 0.2. 1e-7 is the minimum
deep CNN method “VGG-16” is demonstrated not only to
learning rate. If the accuracy of validation does not boost
detect but also to diagnose COVID-19 cases using CXR
after 20 epochs, the training will stop. Furthermore, a
images. Three separate studies in this article with three dif-
heatmap is created to aid radiologists in refining decision-
ferent datasets are used. According to study one, a miniature
making. A PC, with Intel Core i9 CPU and NVIDIA
and balanced dataset is used. It contains CXR images of 50
GeForce GTX 2070 with 8 GB of RAM, is used to conduct
patients acquired from an open-source repository given by
the experiment. Many metrics, such as accuracy, specificity,
Dr. Joseph Cohen. The performance of the VGG-16 is
sensitivity, F1-score, and AUROC [43], are calculated in
weighted on both the training and the test sets. It showed a
order to estimate the model’s effectiveness. The heatmaps
100% performance covering all measures (accuracy, precision,
are plotted to confirm that the VGG-19 is extracting the
recall, and F1-score) in the two sets. Concerning study two, an
valid features in order to distinguish COVID-19 versus
imbalanced and a larger dataset is elaborated. It includes 1845
normal cases. A high AUROC equal to 0.91(0.03) is
CXR images of patients, obtained from the Kaggle COVID-19
achieved by the neural network in 2-class classification.
dataset. VGG-16 achieves 99% across all metrics in the
When classifying COVID-19 VS normal cases, VGG-19
training phase. However, the performance results of accuracy,
achieved different sensitivities equal to 94.21%, 87.18%, and
precision, recall, and F1-score are, respectively, 99%, 100%,
71.91% when the specificities are equal to 60%, 75%, and
97%, and 98%. During stage three, the VGG-16 is imple-
90%. Therefore, the VGG-19 is a model structured to detect
mented on the multiclass dataset with 2637 images procured
COVID-19 cases, in addition to masked and nonmasked
also from the Kaggle COVID-19 X-ray dataset. The accuracy
faces.
remained over and above 90% on the training and test runs.
Therefore, VGG-16 shows an extremely high performance
with both binary and multiclass datasets.
7.8. Comparative Study between the Proposed Models.
Table 3 shows the performance of the different models
7.7. VGG-19 Results. VGG-19 is a CNN also proposed by network. These metrics are as follows: precision, recall,
A. Zisserman and K. Simoniyan. It has 19 layers. As a result F1-score, support, accuracy, sensitivity, and specificity,
of the three more layers than VGG-16, the number of pa- for masked and unmasked cases, macro avg precision,
rameters in VGG-19 is greater than VGG-16. Therefore, it is macro avg recall, macro avg F1-score, macro avg support,
more costly to train. Figure 13(a) provides evidence that weighted avg precision, weighted avg recall, weighted avg
both training and validation losses were minimized fol- F1-score, and weighted avg support. We note that the
lowing each epoch for the VGG-19 model. It shows that the highest precision in detecting masked faces case is for
graph nearly tends to zero. Moreover, Figure 13(c) suggests ResNet-50, VGG-16, and VGG-19 models. The highest
that the overall training and validation maintain a high precision in detecting unmasked faces case, highest
18 Scientific Programming

<VGG16>: Training and Validation Loss Confusion matrix <VGG16>: Training and Validation Accuracy
1.0 500 1.0

0.8 0.8
with_mask 516 8 400

Accuracy
0.6 0.6
300
Loss

0.4 0.4
200
0.2 0.2
without_mask 3 387
100
0.0 0.0
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Epoch Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 12: VGG-16 evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

<VGG19>: Training and Validation Loss Confusion matrix <VGG19>: Training and Validation Accuracy
1.0 500 1.0

0.8 0.8
with_mask 517 7 400

Accuracy
0.6 0.6
300
Loss

0.4 0.4
200
0.2 0.2
without_mask 3 387
100
0.0 0.0
0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5
Epoch Epoch
with_mask without_mask
train_loss Predicted label train_acc
val_loss val_acc

(a) (b) (c)

Figure 13: VGG-19 evaluation metrics, (a) training and validation loss, (b) confusion matrix, and (c) training and validation accuracy.

macro avg precision, and weighted avg precision are for the proposed embedded vision system that consists of a
VGG-16 and VGG-19 models. The highest recall in Raspberry Pi 4 platform coupled with a webcam and
detecting people wearing mask is for the VGG-19 model. touchscreen and sounds a buzzer when someone is not
The highest recall in detecting people not wearing mask wearing their face mask (green or red LED) or social dis-
case, the highest macro avg recall, and the highest tancing is violated.
weighted avg recall are for ResNet-50, VGG-16, and VGG- Thus, after installing Raspberry Pi OS and all libraries,
19 models. The highest F1-score in wearing mask case, the such as TensorFlow, OpenCV, and imutils, the embedded
highest macro avg F1-score, and the highest macro vision system will be able to detect if a user is wearing a face
weighted F1-score are for ResNet-50, VGG-16, and VGG- mask or not and if the distance between peoples is main-
19 models. However, the highest F1-score in not wearing tained or violated. Figure 15 shows the implementation
mask case is only for VGG-16 and VGG-19 models. The results. Hence, when someone is not wearing a face mask, it
support in wearing and not wearing mask cases, macro will be designated with a red box around their face with the
avg support, and weighted avg support have the same text, “No Face Mask Detected,” and when wearing a face
values for the different models. The highest accuracy and mask, it will be seen a green box around their face with the
specificity are for ResNet-50, VGG-16, and VGG-19 text, “Thank you. Mask On.” The same thing is depicted by
models. Finally, the highest sensitivity is for the VGG-19. Figures 15(a) and 15(b). On the other hand, the proposed
Therefore, we can say that the VGG-19 is the best trained model with social distancing task detects peoples and
model, when we compared it with the other models. provides the bounding box information. After that, the
Euclidean distance between each detected centroid pair is
computed using the detected bounding box and its centroid
7.9. Embedded Face Mask and Social Distancing Detection: information based on (x, y) dimensions for each bounding
Raspberry Pi Implementation. After evaluating the proposed box. Figure 15(c) illustrates the social distancing detection
face mask detection models, in this step, the best model with task where an alert message displayed with a red box for
high accuracy rate (ResNet-50, VGG-16, and VGG-19) will violated distance and a green box for the maintained
be applied to the embedded vision system. Figure 14 depicts distance.
Scientific Programming 19

(a) (b)

Figure 14: Embedded vision system for face mask and social distancing detection.

(a) (b)

(c)

Figure 15: Test of the proposed framework on the embedded vision system.

8. Conclusion Raspberry Pi board and webcam where efficient real-time


deep learning-based techniques are implemented with a
Due to the urgency of controlling COVID-19, the appli- social distancing task to automate the process of detecting
cation value and importance of real-time mask and social masked faces and violated or maintained distance between
distancing detection are increasing. This work reviewed, peoples.
firstly, many research works that seek to surround COVID- This embedded vision-based application can be used in
19 outbreak. Then, it clarified the basic concepts of deep any working environment such as public place, station,
CNN models. After that, this paper reproduced the training corporate environment, streets, shopping malls, and ex-
and testing of the most used deep pretrained-based CNN amination centers, where accuracy and precision are highly
models (DenseNet, InceptionV3, MobileNet, MobileNetV2, desired to serve the purpose. It can be used in smart city
ResNet-50, VGG-16, and VGG-19) on the face mask dataset. innovation, and it would boost up the development process
Finally and after evaluated the numerical results, best models in many developing countries. Our framework presents a
are tested on an embedded vision system consisted of chance to be more ready for the next crisis or to evaluate the
20 Scientific Programming

effects of huge scope social change in respecting sanitary [12] M. Piraveenan, S. Sawleshwarkar, M. Walsh et al., “Optimal
protection rules. governance and implementation of vaccination programmes
In future works, we will exploit this methodology on to contain the COVID-19 pandemic,” Royal Society Open
smart sensors or connected RP nodes that will be considered Science, vol. 8, no. 6, Article ID 210429, 2021.
as an Edge Cloud to collect multimedia data, e.g., an au- [13] A. Echtioui, W. Zouch, M. Ghorbel, C. Mhiri, and H. Hamam,
tonomous drone system, which can provide capture (by the “Detection methods of COVID-19,” SLAS TECHNOLOGY:
Translating Life Sciences Innovation, vol. 25, no. 6, pp. 566–
camera) of the detected objects from different angles and
572, 2020.
send them to the Edge Cloud system to be analyzed.
[14] N. Abbassi, R. Helaly, M. A. Hajjaji, and A. Mtibaa, “A deep
learning facial emotion classification system: a VGGNet-19
Data Availability based approach,” in Proceedings of the 2020 20th International
Conference on Sciences and Techniques of Automatic Control
The data in the study are available from the corresponding and Computer Engineering (STA), pp. 271–276, IEEE,
authors on reasonable request. Monastir, Tunisia, December 2020.
[15] R. Helaly, M. A. Hajjaji, F. M’Sahli, and A. Mtibaa, “Deep
convolution neural network implementation for emotion
Conflicts of Interest recognition system,” in Proceedings of the 2020 20th Inter-
national Conference on Sciences and Techniques of Automatic
The authors declare that they have no conflicts of interest. Control and Computer Engineering (STA), pp. 261–265, IEEE,
Monastir, Tunisia, December 2020.
References [16] S. Bouaafia, S. Messaoud, R. Khemiri, and F. E. Sayadi,
“COVID-19 recognition based on deep transfer learning,” in
[1] M. Loey, G. Manogaran, M. H. N. Taha, and N. E. M. Khalifa, Proceedings of the 2021 IEEE International Conference on
“A hybrid deep transfer learning model with machine learning Design & Test of Integrated Micro & Nano-Systems (DTS),
methods for face mask detection in the era of the COVID-19 pp. 1–4, IEEE, Sfax, Tunisia, July 2021.
pandemic,” Measurement, vol. 167, Article ID 108288, 2021. [17] l. Khriji, A. Ammari, S. Messaoud, S. Bouaafia, A. Maraoui,
[2] B. Qin and D. Li, “Identifying facemask-wearing condition and M. Machhout, “COVID-19 recognition based on patient’s
using image super-resolution with classification network to coughing and breathing patterns analysis: deep learning ap-
prevent COVID-19,” Sensors, vol. 20, no. 18, p. 5236, 2020. proach,” in Proceedings of the 2021 29th Conference of Open
[3] Z. Wang, P. Wang, P. C. Louis, L. E. Wheless, and Y. Huo, Innovations Association (FRUCT), pp. 185–191, IEEE, Tam-
“Wearmask: fast In-browser face mask detection with serv- pere, Finland, May 2021.
erless edge computing for COVID-19,” 2021, https://arxiv. [18] T. Ozturk, M. Talo, E. A. Yildirim, U. B. Baloglu, O. Yildirim,
org/abs/2101.00784. and U. Rajendra Acharya, “Automated detection of COVID-
[4] X. Zhang, H. Saleh, E. M. Younis, R. Sahal, and A. A. Ali, 19 cases using deep neural networks with X-ray images,”
“Predicting coronavirus pandemic in real-time using machine Computers in Biology and Medicine, vol. 121, Article ID
learning and big data streaming system,” Complexity, 103792, 2020.
vol. 2020, Article ID 6688912, 10 pages, 2020. [19] L. Wang, Z. Q. Lin, and A. Wong, “Covid-net: a tailored deep
[5] M. Razavi, H. Alikhani, V. Janfaza, B. Sadeghi, and convolutional neural network design for detection of covid-19
E. Alikhani, “An automatic system to monitor the physical cases from chest x-ray images,” Scientific Reports, vol. 10,
distance and face mask wearing of construction workers in
no. 1, pp. 1–12, 2020.
COVID-19 pandemic,” 2021, https://arxiv.org/abs/2101.
[20] V. Shah, R. Keniya, A. Shridharani, M. Punjabi, J. Shah, and
01373.
N. Mehendale, “Diagnosis of COVID-19 using CT scan im-
[6] S. K. Dey, A. Howlader, and C. Deb, “MobileNet mask: a
ages and deep learning techniques,” Emergency Radiology,
multi-phase face mask detection model to prevent person-to-
vol. 49, pp. 1–9, 2021.
person transmission of SARS-CoV-2,” in Proceedings of In-
[21] A. Sedik, M. Hammad, F. E. Abd El-Samie, B. B. Gupta, and
ternational Conference on Trends in Computational and
Cognitive Engineering, pp. 603–613, Springer, Dhaka, Ban- A. A. Abd El-Latif, “Efficient deep learning approach for
gladesh, December 2021. augmented detection of Coronavirus disease,” Neural Com-
[7] K. M. A. Kabir and J. Tanimoto, “Evolutionary game theory puting & Applications, vol. 18, pp. 1–18, 2021.
modelling to represent the behavioural dynamics of economic [22] M. Loey, G. Manogaran, M. H. N. Taha, and N. E. M. Khalifa,
shutdowns and shield immunity in the COVID-19 pan- “Fighting against COVID-19: a novel deep learning model
demic,” Royal Society Open Science, vol. 7, no. 9, Article ID based on YOLO-v2 with ResNet-50 for medical face mask
201095, 2020. detection,” Sustainable Cities and Society, vol. 65, Article ID
[8] R. Blundell, M. Costa Dias, R. Joyce, and X. Xu, “COVID-19 102600, 2021.
and inequalities∗,” Fiscal Studies, vol. 41, no. 2, pp. 291–319, [23] A. Nieto-Rodrı́guez, M. Mucientes, and V. M. Brea, “System
2020. for medical mask detection in the operating room through
[9] J. S. Weitz, S. J. Beckett, A. R. Coenen et al., “Modeling shield facial attributes,” in Proceedings of the Iberian Conference on
immunity to reduce COVID-19 epidemic spread,” Nature Pattern Recognition and Image Analysis, pp. 138–145,
Medicine, vol. 26, no. 6, pp. 849–854, 2020. Springer, Santiago de Compostela, Spain, June 2015.
[10] D. Sridhar and D. Gurdasani, “Herd immunity by infection is [24] M. Perc, M. Ozer, and J. Hojnik, “Social and juristic challenges
not an option,” Science, vol. 371, no. 6526, pp. 230-231, 2021. of artificial intelligence,” Palgrave Communications, vol. 5,
[11] J. Wong and N. Wong, “The economics and accounting for no. 1, pp. 1–7, 2019.
COVID-19 wage subsidy and other government grants,” [25] S. Saponara, A. Elhanashi, and A. Gagliardi, “Implementing a
Pacific Accounting Review, vol. 33, no. 2, pp. 199–211, 2021. real-time, AI-based, people detection and social distancing
Scientific Programming 21

measuring system for Covid-19,” Journal of Real-Time Image [41] M. M. Ahsan, M. T. Ahad, F. A. Soma et al., “Detecting SARS-
Processing, vol. 11, pp. 1–11, 2021. CoV-2 from chest X-ray using artificial intelligence,” IEEE
[26] M. Coşkun, A. Uçar, O. Yildirim, and Y. Demir, “November). Access, vol. 9, pp. 35501–35513, 2021.
Face recognition based on convolutional neural network,” in [42] S. S. Paima, N. Hasanzadeh, A. Jodeiri, and &H. Soltanian-
Proceedings of the 2017 International Conference on Modern Zadeh, “Detection of COVID-19 from chest radiographs:
Electrical and Energy Systems (MEES), pp. 376–379, IEEE, comparison of four end-to-end trained deep learning
Kremenchuk, Ukraine, November 2017. models,” in Proceedings of the 2020 27th National and 5th
[27] F. Sultana, A. Sufian, and P. Dutta, “Advancements in image International Iranian Conference on Biomedical Engineering
classification using convolutional neural network,” in Pro- (ICBME), pp. 217–221, IEEE, Tehran, Iran, November 2020.
ceedings of the 2018 Fourth International Conference on Re- [43] A. P. Bradley, “The use of the area under the ROC curve in the
evaluation of machine learning algorithms,” Pattern Recog-
search in Computational Intelligence and Communication
nition, vol. 30, no. 7, pp. 1145–1159, 1997.
Networks (ICRCICN), pp. 122–129, IEEE, Kolkata, India,
November 2018.
[28] S. M. Jameel, M. A. Hashmani, M. Rehman, and A. Budiman,
“Adaptive CNN ensemble for complex multispectral image
analysis,” Complexity, vol. 2020, Article ID 83561989,
21 pages, 2020.
[29] Q. Zhao, S. Lyu, B. Zhang, and W. Feng, “Multiactivation
pooling method in convolutional neural networks for image
recognition,” Wireless Communications and Mobile Com-
puting, vol. 2018, Article ID 8196906, 15 pages, 2018.
[30] S. Albawi, T. A. Mohammed, and S. Al-Zawi, “Understanding
of a convolutional neural network,” in Proceedings of the 2017
International Conference on Engineering and Technology
(ICET), pp. 1–6, Ieee, Antalya, Turkey, August 2017.
[31] F. Demir, D. A. Abdullah, and A. Sengur, “A new deep CNN
model for environmental sound classification,” IEEE Access,
vol. 8, pp. 66529–66537, 2020.
[32] https://drive.google.com/drive/folders/1IPwsC30wNAc74_
GTXuEWX_F8m2n-ZBCH.
[33] M. Grandini, E. Bagli, and G. Visani, “Metrics for multi-class
classification: an overview,” 2020, https://arxiv.org/abs/2008.
05756.
[34] N. Hasan, Y. Bao, A. Shawon, and Y. Huang, “Densenet
convolutional neural networks application for predicting
COVID-19 using CT image,” SN Computer Science, vol. 2,
no. 5, 2020.
[35] L. Sarker, M. M. Islam, T. Hannan, and Z. Ahmed, “Covid-
densenet: a deep learning architecture to detect Covid-19
from chest radiology images,” vol. 21, 2020.
[36] K. El Asnaoui and Y. Chawki, “Using X-ray images and deep
learning for automated detection of coronavirus disease,”
Journal of Biomolecular Structure and Dynamics, pp. 1–12,
2020.
[37] R. Jain, M. Gupta, S. Taneja, and D. J. Hemanth, “Deep
learning based detection and analysis of COVID-19 on
chest X-ray images,” Applied Intelligence, vol. 51, pp. 1–11,
2020.
[38] M. A. R. Ratul, M. T. Elahi, K. Yuan, and W. Lee, “RAM-Net: a
residual attention MobileNet to detect COVID-19 cases from
chest X-ray images,” in Proceedings of the 2020 19th IEEE
International Conference on Machine Learning and Applications
(ICMLA), pp. 195–200, IEEE, Miami, FL, USA, December 2020.
[39] M. Toğaçar, B. Ergen, and Z. Cömert, “COVID-19 detection
using deep learning models to exploit Social Mimic Opti-
mization and structured chest X-ray images using fuzzy color
and stacking approaches,” Computers in Biology and Medi-
cine, vol. 121, Article ID 103805, 2020.
[40] Z. Karhan and F. Akal, “Covid-19 classification using deep
learning in chest X-ray images,” in Proceedings of the 2020
Medical Technologies Congress (TIPTEKNO), pp. 1–4, IEEE,
Antalya, Turkey, November 2020.

You might also like