Professional Documents
Culture Documents
Abstract— Since the outbreak of the COVID-19 virus, In several studies of making automatic mask recognition
various technologies have developed as an alternative to systems, one of them is the Mask Usage Detection System
preventing the spread of the COVID-19 virus; one of them is Using the CNN method[5], with Viola-Jones-based system as
face mask detection. Many methods are used, such as an image detection method and CNN as a classification of
Convolutional Neural Network, Haar cascade classifier, and images. The research does not discuss the performance against
more. This paper discusses how the system will work with
other parameters besides distance and the performance
face mask detection and the performance result while
running the system against the parameters that can occur comparison between the CNN method and other methods such
during training or direct testing by comparing several as the Haar cascade classifier on the mask detection system.
different methods. The test results display in the form of a Based on some research that uses the same method[1], [5], [6],
line graph, and the Haar Cascade Classifier method will be [7], [8] this paper made to design a mask detection system
displayed in tabular form, with the highest accuracy in the using two different methods. Then it directly compares the
CNN method being 93%, while the Haar Cascade Classifier performance of both and comparing them. It aims to determine
method is 96% how far the performance comparison of the two methods in
Keywords— COVID-19, mask detection, Convolutional mask detection is. So, in future research and development,
Neural Network, HAAR Cascade, image processing. selecting the most suitable method can be considered.
74
Fig. 1. Stride on CNN
2. Padding
The convolution step has a weakness, the information
that may be within the limits of the image because when
the filter performs a scan, these limits are not visible. To
solve the not visible problem, then zero padding can use to
adjust the output size. Fig.2 explains the scanning of a 3x3
through the input, with the padding size is 1.
C. Digital Image
The digital image is an array containing real or complex
values, represented by a row of bits by computer
processing. Digital image sampling represents by a two-
dimensional matrix (x, y) consisting of columns and
rows, where the intersection between columns and rows is
called the pixel or the smallest element of an image[12].
Within these array containing values on an image, the
image processing itself runs by counting the pixel value,
the number of pixels, and others. It depends on which
method is used. Fig. 4. Haar cascade classifier flowchart
III. RESULT AND DISCUSSION
CNN method of image acquisition obtains through a GUI
Fig. 3 and Fig. 4 represent you the flow system of how (graphical user interface) containing several Pushbuttons, one
the process of both method taking picture using camera functioning as a camera acquisition button. After the image is
could obtained the image to be used on both acquired, the next step taken is preprocessing by using the
different preprocessing.
Viola-Jones method to obtain a bounding box on the image,
75
cropping process based on the existing bounding box on the
image to remove objects or backgrounds no need in the
mask detection process, the bounding box size itself
determines to be a 256x256 pixels image. Meanwhile, if
the bounding box does not appear in this process, the re-
acquisition process is carried out until it is successful, and
the final result saves in the image database. An
explanation of the GUI will be in Fig.5
In the Haar Cascade Classifier method, the
image acquisition process carries out by the same GUI as
CNN but has a different process. After the camera
acquires images, there is no cropping process. Instead, the
image will be saved into the database and will be labeled
using the ROI label application as the preprocessing Fig. 6. ROI label
stage; the ROI label explanation will be in Fig.6.
76
CascadeStages in the system which each stage requires From table II the accuracy of CNN night condition for face
double samples from validation data to train or 150 images mask detection is on average 83.06%, with a peak
per stage. accuracy is 87.78%, and the most suitable range is 30cm
with good light conditions from the lamp, and the wrong
IV. DISCUSSION position of wearing the mask, with more than ten times
For the first proposed method, the first step is to determine wrong detection on each range. It seems to impact the
the convolutional layer and size of the input image. At this testing, and it signifies that the light conditions might affect
point, input images were set 256x256x3 (3 is for the lower accuracy in this method.
RGB picture) and maxEpoch set into 60 epochs. Based on table I and II, wrong detection shows the
Experiment done 10 times for both daytime and night amount of incorrect detection occur during each test with
condition to get more data for an accurate analysis. each range tested and accuracy shows the total accuracy of
the system obtained by dividing training data with number
TABLE I. CNN MASK DETECTION DAYTIME ACCURACY of element in the dataset array. Meanwhile, counting the
accuracy of wrong detection for each range obtained by
Wrong detection
calculating total dataset used minus total wrong detection
Accuracy occurred devided by total dataset used and then multiplied
Test
(%)
30 cm 60 cm 100 cm
by 100%.
1 4 1 3 92.5 Second method using Haar Cascade Classifier, using the
2 6 5 6 89.63 same input image size with CNN 256x256 pixels and labeled
using ROI label, and the maxStages set to 50 stages.
3 4 2 4 92.22
4 5 4 6 90.56 TABLE III. HAAR CASCADE CLASSIFIER DAYTIME ACCURACY
5 4 3 2 93.89
Wrong detection Accuracy
6 7 2 5 91.67 Test
(%)
7 2 5 7 91.67 30 cm 60 cm 100 cm
8 7 3 7 88.89 1 0 2 1 96.00%
9 6 1 5 92.78
TABLE IV. HAAR CASCADE CLASSIFIER NIGHT ACCURACY
10 8 4 5 90
77
Haar Cascade itself giving a consistent result no [12] K. RD and A. N. Tompunu, “Pengolahan Citra Digital Untuk
matter how much the test is taken. Another weakness Mendeteksi Obyek Menggunakan Pengolahan Warna Model
of CNN is that this method uses convolutional Normalisasi Rgb,” Semin. Nas. Teknol. Inf. Komun. Terap. 2011
layers, these layers match the input image size, so this will (Semantik 2011), vol. 17, no. C, pp. 329–332, 2011.
need some time to understand and create suitable layers
settings. On the other hand, the CNN method with
fullyConnectedLayer feature can divide the data with each
parameter, train all of this data at once, and validate the result,
while Haar Cascade Classifier needs to validate all the
labeled images one by one.
VI. ACKNOWLEDGMENT
The first special thanks to Mercu Buana University which
has supported in domestic collaborative research and the our
partner to Lembaga Ilmu Pengetahuan Indonesia with
Universitas Pertahanan for their assistance and cooperation
during this research. Hopefully there will always be papers in
future research.
REFERENCES
[1] S. Meivel, K. Indira Devi, S. Uma Maheswari, and J. Vijaya Menaka,
“Real time data analysis of face mask detection and social distance
measurement using Matlab,” Mater. Today Proc., no. March, 2021,
doi: 10.1016/j.matpr.2020.12.1042.
[2] D. Wang, H. Yu, D. Wang, and G. Li, “Face recognition system based
on CNN,” Proc. - 2020 Int. Conf. Comput. Inf. Big Data Appl. CIBDA
2020, pp. 470–473, 2020, doi: 10.1109/CIBDA50819.2020.00111.
[3] Y. Su, S. Shan, X. Chen, and W. Gao, “Hierarchical ensemble of global
and local classifiers for face recognition,” IEEE Trans. Image Process.,
vol. 18, no. 8, pp. 1885–1896, 2009, doi: 10.1109/TIP.2009.2021737.
[4] L. Shi and J. H. Lv, “Face detection system based on AdaBoost
algorithm,” Appl. Mech. Mater., vol. 380–384, no. 4, pp. 3917–3920,
2013, doi: 10.4028/www.scientific.net/AMM.380-384.3917.
[5] F. A. Hermawati and R. A. Zai, “Sistem Deteksi Pemakaian Masker
Menggunakan Metode Viola-Jones dan Convolutional Neural
Networks (CNN),” Proceeding KONIK (Konferensi Nas. Ilmu
Komputer), vol. 5, pp. 182–187, 2021.
[6] N. Heryana, Rini Mayasari, and Kiki Ahmad Baihaqi, “Penerapan Haar
Cascade Classification Model Untuk Deteksi Wajah, Hidung, Mulut,
dan Mata Menggunakan Algoritma Viola-Jones,” Techno Xplore J.
Ilmu Komput. dan Teknol. Inf., vol. 5, no. 1, pp. 21–25, 2020, doi:
10.36805/technoxplore.v5i1.1064.
[7] G. Aprilian Anarki, K. Auliasari, and M. Orisa, “Penerapan Metode
Haar Cascade Pada Aplikasi Deteksi Masker,” JATI (Jurnal Mhs. Tek.
Inform., vol. 5, no. 1, pp. 179–186, 2021, doi: 10.36040/jati.v5i1.3214.
[8] M. S. Ejaz, M. R. Islam, M. Sifatullah, and A. Sarker, “Implementation
of Principal Component Analysis on Masked and Non-masked Face
Recognition,” 1st Int. Conf. Adv. Sci. Eng. Robot. Technol. 2019,
ICASERT 2019, vol. 2019, no. Icasert, pp. 1–5, 2019, doi:
10.1109/ICASERT.2019.8934543.
[9] S. Albawi, T. A. M. Mohammed, and S. Alzawi, “Layers of a
Convolutional Neural Network,” Ieee, p. 16, 2017.
[10] R. Yustiawati et al., “Analyzing of Different Features Using Haar
Cascade Classifier,” Proc. 2018 Int. Conf. Electr. Eng. Comput. Sci.
ICECOS 2018, vol. 17, pp. 129–134, 2019, doi:
10.1109/ICECOS.2018.8605266.
[11] M. Jones, “Robust Real-time Object Detection,” no. January 2001,
2014.
78