Design and Build a Smart Door Lock Using the Deep Learning Convolutional Neural Network Method

. The world is currently being hit by the COVID-19 virus. In this New Normal era, a rule is enforced that everyone must wear a mask wherever we are. Checking masks and body temperature is still done manually or by human observation, thus allowing for inaccuracies in observing and checking temperature. The problem occurred at Trunojoyo Madura University which still uses a manual mask and body temperature checking system. So, for accuracy and to reduce the risk of contracting officers. A tool was created to detect the mask and temperature automatically. In this study using a camera, temperature sensor MLX90614, and proximity sensor using Raspberry Pi. This research uses a machine learning system with the Deep Learning Convolutional Neural Network (CNN) Single Shot Detector (SSD) method. From this study, the results of mask detection obtained a success percentage of 93.4% and an error percentage of 6.6% from the entire test and obtained an average detection time of 2.63 seconds. And the average time of the whole system is 3.8 seconds. In this study, there was a delay during detection due to the heavy computational load on the system, so for further research, use a mini pc that has better performance.


Introduction
The world is currently being hit by a new virus outbreak that has claimed many lives. And when this research was made, the increase in Covid-19 cases in Bangkalan district was increasing. And the latest data when this journal was made Covid-19 cases in Bangkalan increased by 3,280 confirmed Covid-19.
[1] This increase occurred due to low awareness of maintaining health protocols.
In addition, currently the implementation of the new normal makes everyone have to wear a mask wherever we go and always do body temperature testing and wash hands before entering a room. However, this is still done manually, allowing for omissions and inaccuracies in checking.
Based on the above background, the author uses machine learning technology to detect whether a mask is used or not with the convolutional neural network (CNN) method using the Single Shot Detector (SSD) algorithm. And to check the temperature using the MLX90614 sensor and also using the proximity sensor to detect hand objects as input for automatic hand sanitizer.
This study aims to detect accuracy and reduce the risk of infection by officers. To find out the design of a smart door lock based on image processing, mask detection, body temperature and automatic hand sanitizer. And to find out the application of the CNN SSD method on the door lock. And the aim is to determine the accuracy of mask detection using the CNN SSD method, body temperature, and automatic hand sanitizer and hand sanitizer.
The use of Neural Networks has been carried out in various fields such as for writing detection [2], batik classification [3], facial recognition [5], images [6], single short method is used on assistive devices for the blind [4]. Research on COVID detection has also been carried out [7].

Deep Learning
Deep Learning is one form of machine learning where deep learning is the development of a neural network or artificial neural network that uses multilayer in its architecture. Deep Learning techniques make architecture very powerful for Supervised Learning. Supervised Learning in this case means that the system learning data includes a predetermined output or output so that it refers to the error value later. [8] 2.1.1 Convolutional Neural Network (CNN)

Convolutional Neural Network (CNN) is a Deep
Learning algorithm that is supervised learning. The principle of supervised learning is an algorithm that requires a set of paired data sets, namely a data set that has an input variable and an output variable. Generally, this dataset is used in the training process to identify the characteristics of a labeled image. [9] In CNN there are two general layers in detecting images, namely the feature detection layer and the classification layer. And here is the feature detection layer on CNN:

Fig. 1. Fitur Layer Detection
In this feature detection layer, there is a basic layer, namely the convolution layer. Where in this layer the image goes through a convolution filter which will later carry out the image convolution process. [10] And at this layer, dot operations are performed between the input and the value of the filter passed which will produce a linear transformation output called an activation map or feature map. The convolution operation can be written as follows: The next layer is ReLu. ReLu is one of the activation layers that functions to limit the selected input data only according to the expected classification. [11] ReLu activation is an activation layer in the CNN model that applies functions such as the following functions: Then the pooling layer is the layer where the image size reduction process occurs. In the pooling layer there are 2 types, namely max pooling and average pooling. And in this study using max pooling where in this layer is to take the maximum value from the data to be used as a smaller grid. And here is the second CNN layer, namely the classification layer: The results obtained from the convolution process in the convolution layer will be input to the fullyconnected layer. Where the fully connected layer, all neurons become active from the previous layer, all neurons in the previous layer are connected, this is like an artificial neural network in general. Each activation needs to be converted into one-dimensional data before entering the fully connected layer before everything is activated on all neurons. This fully connected layer aims to process data so that later the data obtained can be classified. The difference between the fully connected layer and the convolution layer is that the neurons in the convolution layer are connected only to certain areas of the input, while the fully connected have neurons that are all connected according to their name. However, the two layers still operate the dot product operation so that the functions of the two are not much different. This layer has produced a feature extraction value from the previous process from the feature detection layer which obtained a multi-dimensional array value which in the result of the features obtained will be stacked by converting it into a vector value to be able to be input to the fully connected layer. So that before entering the fully connected layer, the feature extraction value must go through a "flatten" or Reshape process into a vector value to be used as input to the fully connected layer which will be classified later.

Single Shoty Detector
Single Shot Detector (SSD) is one method where the SSD architecture is one type of Convolutional Neural Network (CNN) where CNN in the SSD method is used as an introduction to image features obtained from the convolution process and this is contained in the feature layer. [12] The stages of image processing using the SSD method are divided into several stages. The first stage is the convolution process. Where in this process is used to obtain image features? In this process, we will create a filter with the length and height in pixels. The next step is to resize the image to reduce the size of the image with a depth of 3 channel images or RGB (Red, Green, Blue) images. This layer will later be formed by running filters that are used to find patterns that will later be used to detect. And then the convolution process will be carried out until the smallest part of an image is obtained so that later accurate image features are obtained.
For the next process is pooling which this process is done to reduce the size of the image after the convolution process. And in this study using the type of max pooling pooling where this type of search is carried out for the maximum value on each input value that has gone through the convolution process with the filter that has been used.
The third process is fully connected. This stage functions to connect the convolution and pooling layers and in this process the pixel value that is considered blocking will be the output value of one of the label classes. And at this stage, it is known the classification results that determine the part of the pixel that has a pattern. In this process, image retrieval is done in real time to detect an object. The image obtained from the camera will later be processed which later the results will be used as the result of object detection. In this study, this processing uses Tensorflow. In this SSD method, the process to get object detection is carried out by three processes where in the first process this determines the bounding box used to measure how far the box will be predicted and the coordinates of the E3S Web of Conferences 328, 0 (2021) ICST 2021 detected object where this is often called the bounding box. And the next process is to get class results that can be classified from objects that have been detected. And then it will get a score value as the probability value of an object that has been detected.

Hardware Design
There are several components that will be used in this hardware design. At the input there is a camera, MLX90614 temperature sensor and proximity sensor. The three inputs will be processed with the Raspberry pi and will produce output data. In this study, the outputs are speakers, LCD, DC mini pump, Selenoid door lock, and servo. And here is a single line for the design of the hardware used: The front view of the device in the picture shows a miniature door similar to a cupboard which will later be used as a thesis research which will be used as a door lock which has a length of 90 cm, a width of 50 cm and a height of 100 cm. (Fig 5).

Result and Discussion
In this study, several tests were carried out, namely the detection of masks, body temperature, and proximity.

Mask Detection Test
The first test is a test with a face without a mask. For this test carried out by people who do not wear masks, the results are in table 1. In this first test with the condition of not using a mask, the detection time is 2.95 seconds.
The second test was carried out using plain masks with different types of masks and the color of the masks. The following is the result of testing the mask detection system using a mask (table 2). In this test using a plain mask, the average test time was 2.96 seconds. And in this second test, the longest test is in the second experiment using a black mask, this is because the camera is difficult to detect whether a mask is used or not because it is black, therefore it takes a long time to detect.
In the third study, it was carried out using a patterned mask. And the following is the data on the results of the patterned mask testing which can be presented in table 3. From the data obtained, the percentage of success is 93.75% and the percentage value of failure is 6.25%. And in this third study, the average mask detection time was 3.14 seconds. And in this third study, the longest testing time was 3.62 seconds which in this test was carried out testing batik masks with complex patterns so that the old system in detecting due to complicated batik patterns was detected and for testing the 16th data could not be detected perfectly. due to the complicated pattern of black and white boxes that confuses the system to detect whether it is a mask or not.
In further research, namely testing using accessories. And the following are the data obtained during the study in table 4. From the four experiments carried out, the results of system testing were as expected so that the percentage of success was 100% and the failure rate was 0%. From the above test, the average mask detection time is 2.66 seconds.
The next research is to do a test with the face position that is facing down, up and sideways right and left. And here are the test results data based on the position of the face (table 5). From the four experiments above, the percentage of success for detection is 50% and the percentage of failure is 50%. And from these data, the average detection time is 1.245 seconds.
The next test is to test the effective detection distance of this tool so that the maximum results are obtained at the time of detection. The following is the data from the detection distance test when not using a mask (table 6).  -41  True  2,43  100  True  2,65  150  True  3,01  200  True  5,11  239  True  5,32  240 False -From the test data without using a mask, the percentage of success is 71.4% and the percentage of failure is 28.6%. And also, from the data above, the average detection time is 2.64 seconds.
The next research is to test the detection effectiveness distance from the tool when using a mask. This test is carried out to test how far the system works when using a mask. And here are the detection test data using masks (table 7).  -16  True  2,50  100  True  2,71  150  True  4,03  200  True  5,52  229  True  6,01  230 False -From the data above, the percentage of success is 71.4% and the percentage of failure is 28.6%. And from the data above, the average detection rate is 2.96 seconds.

MLX90614. Temperature Sensor Testing
Testing this temperature sensor is done by checking the temperature in four conditions. And here is the data from the temperature sensor readings MLX90614 (table 8). From the four temperature measurements with different objects, it was found that the MLX90614 temperature sensor can read the object's temperature and ambient temperature. This can be seen from the comparison of the temperature sensor readings and the thermogun, the largest error value is obtained in the Forehead test. And this sensor reading must be placed stably or there is no movement or shaking either from the sensor or from the object being measured so that the temperature reading is more accurate.

Proximity Sensor Test
This test is carried out by detecting the distance from a distance of 1 cm -10 cm and the response of the DC mini pump in draining the hand sanitizer. And the following is the data from the proximity sensor readings along with the response from the mini pump (table 9). From the results of this proximity sensor test, the effectiveness of the proximity sensor was tested in detecting hand distance as input for the mini pump to drain the handsanitizer. This test was carried out with 5 experiments with different distances, namely from a distance of 1cm -5 cm and also this test was carried out by observing the response of the mini pump to determine the performance between proximity and mini pump. From the test results above, it is found that the proximity sensor used can work well at a distance of 3 cm. And from the sensor readings, the results show that the system can work well at a maximum distance of 3 cm.

Overall System Test
In this test, it is carried out in a room with various types of masks, from plain masks or patterned masks. And the following is the system test data in a room with sufficient light (table 10). This test is carried out to determine the performance of the system when carried out in open space conditions. And the test this time was carried out by five people wearing masks and being outside the room. And from the data obtained from testing the system in the room, the average time in mask detection is 3.25 seconds. And also the average temperature detected by this system has an average temperature measurement of 36.80C. And from the existing error values, an average error value of 1.19% is obtained.
For further research is to test the entire system outside the room. And the following is the result of testing the overall system outside the room (table 11). From the data obtained, the average detection time outside the room is 3.8 seconds. And from this test, it was found that in outdoor testing the mask detection time tends to be long due to the back light that affects the camera to detect so that the image capture is less than optimal because the camera used is relatively low in pixels so that with excess light or back light the system works less than optimally.

Conclusion
Based on the test results of mask detection, body temperature, and automatic hand sanitizer with proximity sensor, it can be concluded that: 1. In mask testing, masks that have patterns will take longer to detect. The detection of masks greatly affects the intensity of the light around them. So that if the test is carried out with the appropriate light, the resulting test is more accurate. And obtained an average detection of 2.63 seconds. Mask detection E3S Web of Conferences 328, 0 (2021) ICST 2021 will work either when the front face or frontal face position. 2. The mask detection test has a minimum and maximum detection distance. And when not wearing a mask, it has an accurate detection distance of 41 cm to 239 cm. and for testing using a mask, the accurate detection distance is between 16 cm to 229 cm. 3. The MLX90614 temperature sensor is placed near the object closely so that there is no shift either from the sensor or from the detection object so that the sensor reading is more stable. 4. For testing the entire system, the percentage of success was 93.4% and the error percentage was 6.6% from 76 detection tests as a whole.