Utilization of Telegram application as an Information Media Face Mask Detection Result

To know the results of the face mask detection system, one must be near a computer. This problem makes it difficult to reprimand and provide face masks to violators. One of the ways to prevent the spread of the virus is to wear a mask. This study focuses on making a face mask detection system connected to a cellular device. This study aims to make obtaining information more effortless, and monitoring officers can find out from a smartphone. As a medium of communication, we use the telegram application. Smartphone users widely use this application compared to existing messaging media applications. This study uses the YoloV4 algorithm to detect face mask and JSON to send information to the telegram application. The test consists of two stages, the first stage is to determine the accuracy of the face mask detection system and the second stage is to determine the average time required until the information is sent. The two tests performed obtained 97.57% and 0.255 seconds, respectively. The test results show that the system created can solve the existing problems. The researcher can do further research by increasing the number of datasets to increase the accuracy of face mask detection.


Introduction
A face mask is a device to cover the mouth and nose. Wearing a face mask can prevent the entry of viruses or bacteria. Since the spread of COVID-19 in early 2020, the use of face face mask has become something that must be done, especially in a crowd. As reported by the WHO's official website [1], there were around 210 thousand new cases of COVID-19 in mid-2020. This number is lower than new cases in 2020 and 2021. The public is advised to continue to wear face mask even though the number of cases has decreased. Unfortunately, many people think using face mask is no longer necessary. About 50% to 70% of people infected with the COVID-19 virus are found to be asymptomatic [2]. That indicates that people who appear healthy may have contracted COVID-19. Therefore, monitoring the use of face mask should still be carried out.
The problem is that it is difficult to monitor the use of face mask manually, especially if the monitoring location has many people over a long period. Humans carry out manual monitoring, not with the help of technology. Manual monitoring requires large amounts of human resources and costs. Another problem is that the monitoring officer can only know the information on the detection results from the monitoring computer. The officer must be close to the computer to see the detection results. The two existing problems resulted in slower preventive measures, such as reprimands and giving face mask to violators.
This research uses an object detection method and a message broadcast platform. The YoloV4 algorithm is used to detect face mask. The use of the YoloV4 algorithm to see the benefit of face mask obtains a higher MAP (Mean Average Precision) than other object detection algorithms [3]. At the same time, the Telegram application is used to broadcast information. This application can be used easily and for free. In addition, the Telegram application also supports Android and iOS operating systems. The number of active users of the Telegram application worldwide has reached 55.2 billion [4]. The Telegram application has an account that can be operated by non-human software. This account is a telegram bot. One of the features of telegram bots is broadcast [5], the ability to send messages automatically and provide information to many people simultaneously. Thus, the use of the telegram application should be a solution to the existing problems.

Literature Review
Several studies related to face mask detection systems using different algorithms. The main function of the system is to detect whether someone is wearing a face mask or not. Research conducted by S. Sethi, M. Kathuria, and T. Kaushik [6] uses deep learning to detect the use of face mask. The study carried out obtained an accuracy of 98.2% when implemented with ResNet50. The number of datasets used is 9194. After detection, the system will display people identifying information. Another study conducted by S. Singh, U. Ahuja, M. Kumar, K. Kumar, and M. Sachdeva [7] used Yolov3 to detect the use of face mask. Previously, they conducted a test by comparing the YoloV3 and the faster R-CNN model. The results of tests that have been carried out using the hard API on Open-CV show that the YoloV3 algorithm is better for real-time detection.
Several studies related to sending information using the telegram application. As did C. Huda, F. A. Bachtiar, and A. A. Supianto [8], reported sleepy drivers via telegram. They were using a Laravel framework to communicate with telegram API. Testing this research using a black box. "success" result for data upload parameter. Some of the tests carried out also showed the success of sending data. Further research was carried out by A. Rahmatulloh, R. Gunawan, H. Sulastri, I. Pratama, and I. Darmawan [9]. This study uses the haar cascade algorithm to detect the use of face mask. The detection results are sent by broadcast with the help of the telegram bot. This research test found that the average time speed is about 0.001695977 seconds at a maximum detection distance of 1.2 meters.
Research conducted by A. Bochkovskiy, C.-Y. Wang, and H.-Y. M. Liao [10], compared YoloV3 and YoloV4 to detect objects. The results show that the accuracy of YoloV4 is two times faster than that of YoloV3. In addition, YoloV4 has excellent performance for very high FPS. There is an increase in high speed or high inference speed. Figure 1 shows a graph of the differences between the YoloV4 and various state-of-the-art object detectors [11].

Figure 1. Differences YoloV4 algorithm with other algorithms
Previous research references related to face mask detection systems and conveying information gave mixed results, so they did not always provide excellent and effective results according to the problem conditions and the data. Based on previous research on the accuracy of YoloV4, this study applies the algorithm to create a face mask detection system. As the primary goal, the detection system is combined with JSON (JavaScript Object Notation) to be able to communicate and send its output via the telegram application.

Methodology
This research consists of three stages. The first stage is to detect the use of face mask. The second stage is status determination or counting the real objects that use and do not use face mask. Then the calculation is carried out to obtain the "status" of the detection results. The third stage is sending information about the status to the telegram application. A general picture of the research method of this system is shown in Figure 2.

Face Mask Detection System
The first step is to detect face mask. Detection is done to determine the total number of objects that use and do not use face mask. The detection process will match the existing dataset. Currently, facial recognition datasets are being developed to provide an impression of the face mask detection model [12]. In addition, the use of face detection systems is also increasing in several applications [13]. In the current era of big data, facial image modeling and analysis is a reasonably active research field [14]. The dataset is in the form of images of objects that use and do not use face mask. Dataset obtained through Google image, Bing Images, and Kaggle Dataset. The total training data is 700 photos. Some photos in the dataset contain more than one object (more than one face). Figure 3 shows an image that has many things in it.

Figure 3. Dataset
Some photos with many objects will go through the image annotation process to separate several things. The separation process uses the labelimg tool. These tools are written using the python programming language [15]. After separation, these objects will be grouped into "no_mask" and "mask". The total division is 868 objects without face mask and 3047 objects using face mask. Figure  4 shows a dataset that has been grouped from the labelimg tool.

Status Determination
Status is information about the condition of the detection results. Determination of status is based on the ratio of the total use of face mask to the total number of objects (humans). The calculation to obtain Ratio is shown in equation (1).
There are three states in this detection system. The determination of status is shown in Table 1.

Table 1. Status Determination Status
The formula Danger!! Rt>=0.1 and nMc>=3 Warning!! Rt!=0 Safe!! -Status "Danger!!" if the ratio is greater than or equal to 0.1 and the total detected not wearing a face mask is greater than or equal to 3. "Warning!!" if the ratio is not equal to 0. "Safe!!" if all of the above conditions are not met or all objects monitored by the system are detected wearing face mask.

Send Information
This system's final stage is sending information from the face mask detection system. The system will send the data obtained by the detection system via the telegram application with the help of JSON. JSON is a format for storing and exchanging information to making it easier for humans to understand. JSON is famous for the JavaScript programming language [16]. JSON is a very lightweight data interchange [17] and is a ubiquitous file [18]. JSON is widely used in several applications such as big data, IoT, soft computing ,and intelligent cities [19].
The Telegram application is used because it has several advantages, one of which is encrypted chats that self-destruct [20] and the ability to ensure the safety and security of our data [21]. In contrast to SMS (Short Message Service) security, third parties can send messages [22]. Figure 5 shows a script for communication between the detection system and the telegram application.

Results and Analysis
Testing was carried out in two scenarios to determine of system accuracy based on the three stages discussed in the previous chapter. The first scenario, testing the "face mask detection system", detects and counts the total number of violators who do not wear face mask. The second scenario tests "send information" to determine how long it takes for the system to send information to the telegram application. Tests were carried out with the same computer. Here are the specifications of the test computer, Intel core i5-7200, 8GB RAM, 256GB NVMe SSD.

Testing for Face Mask Detection System
Testing is done to determine the system's accuracy using the confusion matrix method. The confusion matrix is a numerical structure that handles the distribution of errors between different classes or categories in the classification process [23]. In this method, we can evaluate the classification model [24] to know the percentage of system accuracy. The calculation of accuracy with the confusion matrix method is shown in equation (2) [25]. The TP parameter represents true positive, FP represents false positive, TN represents true negative, and FN represents false negative [26]. An explanation of TP, FP, TN, and FN is presented in Table 2. The confusion matrix table explains that the rows represent the actual class results and the columns represent the predicted class results [27]. The confusion matrix of this face mask detection system is shown in Table 3. After knowing all the variables, the calculation is used to obtain the percentage of system accuracy. These calculations are shown in equations (3) and (4). (3) Accuracy= 97.57 % The calculation obtained an accuracy of 97.57%. That shows the accuracy obtained by the YoloV4 algorithm for the face mask detection system is very good. Next, we compare the accuracy between the algorithms used and those applied in previous studies. For the YoloV3 and YoloV4 algorithms, our tests were carried out using the same dataset and test data. However, for the Resnet 50 and Haar Cascade algorithms, the dataset is only based on previous studies [6], [9]. Overall the results of the comparison of accuracy obtained from each algorithm are shown in Table 3. ResNet 50 obtains the highest accuracy, but the dataset is quite large. At the same time, the haar cascade algorithm does not get accuracy because previous research [9] only states that this algorithm is perfect for 12-60 fps video.

Testing for time
Testing is carried out to determine how long the detection result information takes to be sent. The test was carried out 21 times with the number of objects (faces) consisting of 1 to 40 people, all of which used face mask.
The table regarding the length of time required consists of 4 columns. The first column shows the number of individuals tested. The second column shows the time taken to detect. The third column is the time it took from the catch to send the message. And the fourth column is the difference between the third and second columns. The calculation of the difference is presented in equation (5).
Information about the test results regarding the total time required is displayed in Table 4. All units of time users are in seconds. The average time it takes the system to send information about the detection results is 0.255 seconds. From the experimental table, we found that the longest information delivery time was 1 second, and the fastest was 0.01 seconds. The Telegram app has sync capabilities, super-fast service, reliable backups, and more security features. The Telegram app is better than other messaging apps [28].

Conclusion
YoloV4 algorithm to detect face masks obtains an accuracy of 97.57% with a dataset of 3915. The average time to convey information with JSON is 0.255 seconds. Both tests indicate that the system is reliable enough to help the existing problems. Monitoring officers can receive information quickly, even if they are far from the computer so that we can take preventive measures immediately. Is means that this system can solve the problems discussed in chapter 1.
This system still has limitations, such as slightly reduced accuracy when monitoring a location with poor lighting. Furthermore, the system can be developed so that the detection obtains better accuracy. The researcher can do that by increasing the number of datasets, using the latest of the Yolo algorithm, or combining the YoloV4 algorithm with other methods.