Mask Detection Using Convolutional Neural Network Algorithm

  • Rizky Amalia Universitas Bina Darma
  • Febriyanti Panjaitan Universitas Bina Darma
Keywords: Mask detection , Convolutional Neural Network, MobileNetV2, CNN optimizations


The World Health Organizations and the Ministry of Health of the Republic of Indonesia have required the use of masks to suppress the spread of COVID-19. WHO provides guidance on how to use a good mask to cover the mouth and nose. This study aims to detect the correct use of masks using the Convolutional Neural Network. CNN is a popular Deep Learning algorithm for image data classification problems. The Mask Usage Detector is built with the help of a pre-trained MobileNetV2 model with an architecture that supports media that has minimum computations. This study will also compare the performance of three optimization methods from CNN, namely Adam, SGD, and RMSprop in detecting the use of masks. Performance will be seen from the test results by analyzing the values of accuracy, precision, and recall. The dataset used is in the form of image data of 2,029 images for 2 categories, namely "masked" and "unmasked". A total of 1,623 images were used as training data and 406 images for test data. Based on the testing process, the accuracy of each optimization is 93.84% with Adam optimization, 84.48% with SGD optimization, and 93.10% with RMSprop optimization. With the proposed model, this study obtains the performance results of the three CNN optimizations, and it is concluded that adam's optimization gives better performance results than the other two optimizations.



Download data is not yet available.


“WHO Director-General’s opening remarks at the media briefing on COVID-19 - 11 March 2020.” (accessed Jul. 02, 2021).

Kemenkes, “SE-PENGGUNAAN-MASKER-2020-(2)_1562.pdf.” 2020, [Online]. Available:

world health Organization, “Mask use in the context of COVID-19,” Who, no. December, pp. 1–10, 2020, [Online]. Available:

P. Nyoman and Putu Kusuma Negara, “Deteksi Masker Pencegahan Covid19 Menggunakan Convolutional Neural Network Berbasis Android,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 5, no. 3, pp. 576–583, 2021, doi: 10.29207/resti.v5i3.3103.

B. Budiman, “Pendeteksian Penggunaan Masker Wajah Dengan Metode Convolutional Neural Network,” J. Ilmu Komput. dan Sist. Inf., vol. Vol.9 No.1, 2021.

H. Wang, W. Li, Q. Wan, H. Yan, and R. Xiang, “Research and Application of Facial recognition Algorithm in Audit Investigation,” J. Phys. Conf. Ser., vol. 1865, no. 4, p. 42061, 2021, doi: 10.1088/1742-6596/1865/4/042061.

L. Abraham, S. Davy, M. Zawish, R. Mhapsekar, J. A. Finn, and P. Moran, “Preliminary Classification of Selected Farmland Habitats in Ireland Using Deep Neural Networks,” Sensors , vol. 22, no. 6. 2022, doi: 10.3390/s22062190.

A. Alsayed, A. Alsabei, and M. Arif, “Classification of Apple Tree Leaves Diseases using Deep Learning Methods,” IJCSNS Int. J. Comput. Sci. Netw. Secur., vol. 21, no. 7, p. 324, 2021, [Online]. Available:

C. Basha, B. N. Pravallika, and E. B. Shankar, “An efficient face mask detector with pytorch and deep learning,” EAI Endorsed Trans. Pervasive Heal. Technol., vol. 7, no. 25, p. e4, 2021.

G. S. Jayalakshmi and V. S. Kumar, “Performance analysis of convolutional neural network (CNN) based cancerous skin lesion detection system,” in 2019 International Conference on Computational Intelligence in Data Science (ICCIDS), 2019, pp. 1–6.

O. N. Putri, “Implementasi Metode Cnn Dalam Klasifikasi Gambar Jamur Pada Analisis Image Processing (Studi Kasus: Gambar Jamur Dengan Genus Agaricus Dan Amanita),” 2020.

“Labeled Mask Dataset (PASCAL_VOC) | Kaggle.” (accessed Jun. 15, 2022).

“MobileNet, MobileNetV2, and MobileNetV3.” (accessed Jun. 15, 2022).

M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen, “Mobilenetv2: Inverted residuals and linear bottlenecks,” in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 4510–4520.

S. Lasniari, J. Jasril, S. Sanjaya, F. Yanto, and M. Affandes, “Pengaruh Hyperparameter Convolutional Neural Network Arsitektur ResNet-50 Pada Klasifikasi Citra Daging Sapi dan Daging Babi,” J. Nas. Komputasi dan Teknol. Inf., vol. 5, no. 3, pp. 474–481, 2022.

A. Putri, B. S. Negara, and S. Sanjaya, “Penerapan Deep Learning Menggunakan VGG-16 untuk Klasifikasi Citra Glioma,” J. Sist. Komput. dan Inform., vol. 3, no. 4, pp. 379–383, 2022.

A. Mikołajczyk and M. Grochowski, “Data augmentation for improving deep learning in image classification problem,” in 2018 International Interdisciplinary PhD Workshop (IIPhDW), 2018, pp. 117–122, doi: 10.1109/IIPHDW.2018.8388338.

M. F. Naufal and S. F. Kusuma, “Pendeteksi Citra Masker Wajah Menggunakan CNN dan Transfer Learning,” J. Teknol. Inf. dan Ilmu Komput., vol. 8, no. 6, pp. 1293–1300, 2021.

“CS231n Convolutional Neural Networks for Visual Recognition.” (accessed Jun. 11, 2022).

T. Ahmed, P. Das, M. Ali, and M. Mahmud, A Comparative Study on Convolutional Neural Network Based Face Recognition. 2020.

U. Ruby and V. Yendapalli, “Binary cross entropy with deep learning technique for image classification,” Int. J. Adv. Trends Comput. Sci. Eng, vol. 9, no. 10, 2020.

A. Wikarta, A. S. Pramono, and J. B. Ariatedja, “Analisa Bermacam Optimizer Pada Convolutional Neural Network Untuk Deteksi Pemakaian Masker,” Semin. Nas. Inform. 2020 (SEMNASIF 2020), vol. 2020, no. Semnasif, pp. 69–72, 2020.

G. Hinton, “Dropout : A Simple Way to Prevent Neural Networks from Overfitting,” vol. 15, pp. 1929–1958, 2014.

T. Shafira, “Implementasi Convolutional Neural Networks Untuk Klasifikasi Citra Tomat Menggunakan Keras.” Universitas Islam Indonesia, 2018.

D. P. Kingma and J. L. Ba, “Adam: A method for stochastic optimization,” 3rd Int. Conf. Learn. Represent. ICLR 2015 - Conf. Track Proc., pp. 1–15, 2015.

S. Ruder, “An overview of gradient descent optimization,” pp. 1–14, 2016.

B. While, N. Stochastic, and F. Imagenet, “W a b sgd,” pp. 1–19, 2020.

How to Cite
Rizky Amalia, & Panjaitan, F. (2022). Mask Detection Using Convolutional Neural Network Algorithm. Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), 6(4), 639 - 647.
Artikel Teknologi Informasi