Face Recognition Using the Convolutional Neural Network for Barrier Gate System

—The implementation of face recognition technique using CCTV is able to prevent unauthorized person enter the gate. Face recognition can be used for authentication, which can be implemented for preventing of criminal incidents. This re-search proposed a face recognition system using convolutional neural network to open and close the real-time barrier gate. The process con-sists of a convolutional layer, pooling layer, max pooling, flattening, and fully connected layer for detecting a face. The information was sent to the microcontroller using Internet of Thing (IoT) for controlling the barrier gate. The face recognition results are used to open or close the gate in the real time. The experimental results obtained average error rate of 0.320 and the accuracy of success rate is about 93.3%. The average response time required by microcontroller is about 0.562ms. The simulation result show that the face recognition technique using CNN is highly recommended to be implemented in barrier gate system.


Introduction
Nowadays, the development of technology has been well integrated, like a face recognition based application to detect an object and perform data scanning based on image [1], like face recognition or fingerprint on digital devices to security, identification, etc., [2]. Digital components use to identify and classify an object is the camera. This component functions to take images or objects to be identified [3]. The binary data from the image could be parameter input to the classification process using CNN.
This research using CNN algorithm. This algorithm is a network of a group of small processing units that are modelled based on human neural networks and inspired by the natural visual perception mechanism [1]. CNN is the basic form of Neural Networks. Some of CNN's application areas of interest include Face recognition, Image classification and segmentation, object detection, video processing, natural language processing, and speech recognition. CNN's ability to carry out the feature extraction process and perform large data calculations can be used as a reference in developing a face recognition-based biometric authentication system [2]. Development of a face recognition system using CNN could be applied to various models [2]. The integrated system has been developed with IoT can be innovation to authentication systems with high security and ease of usage.
Face recognition currently active research areas regarding biometric authentication systems. It was emphasized by the development of a detection system for the prevention of crime using CCTV. According to several types of research, this system's development is on an increasing trend. The implementation of this system can be applied in car and motorcycle parking lots. However, continuous and careless monitoring of people events does not render the CCTV function useless for crime incident prevention [4].
Several years ago this development provided good capabilities supported by an algorithm that was able to identify data when recognition of multiple persons and cluttered backgrounds, etc., [3]. The biometric authentication system, it is classified into two parts, psychological biometrics, and behavioral biometrics. Physiological biometric traits such as face, iris, fingerprint, DNA, etc., have constant characteristics. Behavioral biometric traits such as signature, gait, voice, keystroke etc. The biometric system model used in this study is the face recognition model because face recognition is one of the better physiological biometric traits to recognize a person for several activities [5]. Face recognition focus select who this person is in the existing data set [6].
The process of combining biometric authentication based on facial recognition and IoT, can be connected as a biometric authentication system using the CNN algorithm to implement a barrier gate system. The example technology that operates in parking facilities and entrances to restricted areas that require specific permits is the automatic parking barrier [7].
Barrier gate is an automatically controlled parking control system computed by computers in parking facilities to the entrance to restricted areas that require certain permits [5]. Many technology development of the barrier gate system such as icarus automatic barrier for both residential and intensive use, falcon is the barrier plate using recognition system, and centurion is a real automatic bollards with security barrier consisting of automatic rising bollards operations. The main components datasheet in this research are NodeMCU ESP 8266, microcontroller board, motors, camera, and internet.
This research emphasize to implement a prototype automatic barrier gate system controlled by a biometric-based authentication face recognition using the CNN algorithm, False Acceptance Ratio (FAR), False Rejection Ratio (FRR), and Equal Error Rate (EER) using Receive Operating Characteristic (ROC) testing [8]. This testing technique is analysis focused on the system's accuracy in recognizing all facial image data. In the ROC testing process, there is a presentation value of True positive rate (TPR), True negative rate (TNR), False Positive Rate (FPR), and False Negative Rate (FNR). TPR is true; if the result of the testing is the same as the actual condition.
TNR is true; if the result is wrong, and the real condition is false. FPR is true; the result is correct, and the real situation is incorrect, FNR is true; the result is wrong, and the actual is true [9].
This research is arranged as the follows. Section I regarding visualization related to authentication, face recognition, CNN, barrier gate system, and IoT. Section II, describe the CNN algorithm process, the face recognition analysis process, and the deep learning calculation process, the results and evaluation are shown in sections III, and the conclusions we show in section IV.

Material and Method
This section describes a literature review of relevant previous research and explains the CNN algorithm in the biometric authentication classification process based on face recognition.

Related research
Scientific proponent of this research refer to research about CNN for face recognition focusing on application development using CNN algorithm and evaluate from the results of systems that have been developed using different light intensity [10]. Then a literature review that supports the control system using a barrier gate which is implemented in the IoT model is research focuses on developing a light traffic system using barrier gates and GSM, which models the traffic light system by combining cameras, motor, buzzers, traffic lights, and microcontrollers to produce a vehicle control simulation that can help the police at a relatively low cost [11].
Literature review regarding face recognition based on CNN is research that focuses on the development of the deep learning algorithm based on CNN and the research On the identification of face image-based CNN algorithm that has the result that the algorithm is part of the face recognition process used for training data and for optimizing system performance [12]. In implementing face recognition based on CNN, which uses a mobile application to control it by sending signal data visualized in research focuses on developing control parking using a mobile device combined with a wireless remote. This study's results are a prototype parking gate control that can be accessed using a smartphone by sending data using the internet of things [7].
Research about CNN for efficient face recognition this research is more likely to prove that CNN's algorithms are instrumental in the performance efficiency of the face image detection system, results gained by integrated of a HOG with SVM and getting results can detect even in a blurry state, can detect even in expressions and still produce high accuracy [13]. Developments that can be done to increase the level of accuracy of the face recognition-based biometric authentication system are shown in research about authentication using face verification and ID image recognition focuses on the development authentication on mobile devices using face recognition that has the result ID recognition and face recognition procedure MTFM provides an accurate information extraction result to improve identity verification accuracy [6].
Nowadays development of a biometric authentication system with the highest accuracy in the image classification process is research about iris recognition for image authentication. The development iris recognition for image authentication using IWT and getting result that authentication can be implement and get the accuracy of 98.9% with the average execution time of 1.03 sec that is better than DWT and previous reported algorithms. FAR, FRR and EER have also improved [14]. The development of iris recognition-based biometric authentication systems can increase the level of accuracy and security by combing with machine learning, artificial intelligence, and blockchain technology described in the research focuses on using the internet of things and getting results by combining can improve security quality [15].
Based on the literature review, the research that has been done can be a reference for this research to develop a face recognition-based biometric authentication system using the CNN algorithm to control the barrier gate system.

Convolutional layer
This process involves the convolution process in the input feature map by combining the convolutional kernel to create a different feature map [16].   [17] Where N is the length and width of digital image input, F is the process of filtering. How to take binary by way of (N-F)/Stride + 1, where the technique of taking matrix F, total amount N=7 and total amount F=3, for the depiction of Stride+1, if the process of matrix 3x3 is finished it will be shifted on 1 pixel next to it [18].
The equation of convolution layer as follow: Where 1 is feature map-1, 1 is index number of feature pattern 1, 1 is line index feature of 1st layer map, 1 is index line feature map layer 1 is 1st layer convolution bias, 1 is1 line of convolution layer filter length Index, 1 is column length Index of the convolution layer 1, 1 is 1st convolution filter, and is input.
Convolutional layer has parameters. The parameters are the size of the maps feature, skipping factors, kernel size, and the layer layout at the time of the process. The description of the equation convolutional layer as follows: Where , is feature size map, , is skipping factors, , is kernel size, and is location of layers in a process.

Pooling layer
The pooling layer is the process of filling out the calculations and reducing the dimensions of each image input from the identifying process using the matrix filter [19]. Descriptions of the equation pooling layer as follows: Where 2 is feature map-2, 1 is index number of feature pattern 1, 2 is line index feature of 2st layer map, 2 is index line feature map layer 2, 2 is 1st layer convolution bias 2, 2 is filter pooling layer 2, 2 is feature line length map 2, and 2 is column length feature map 2.

Max pooling
Max pooling is an advanced process of the matrix binary 3x3 that through the filtering process, which takes the value with the highest number of variables. The method of making binary results by finding the highest number of variable results. And the equation of max pooling show in equation (3).

Flattening
Flattening in this research is the process by which the command to change from the results of max pooling starting from 2 dimensions (2D), is aligned into onedimensional form (1D) which aims to transfer data, into a linear form to facilitate the classification process [20].

Fully connected layer
Fully connected layer is an advanced process of flatten result, in this research used for data transformation into linear form, then linking between neurons using forward propagation and backpropagation in doing classification [21]. Forward propagation For the first stage will determine with the process of forward propagation calculation with the equation model as follows [22] [23].
Where is output, is sigma, is weight, is input, and is bias. The next process is to activate the activation of each result using one of the activation calculations named softmax. The softmax equation below [24].
Where is constant (2.7), is output results from , and ∑ is the summation result of . The softmax activation function in the forward propagation process, find the error value with the equation as follows: Where is the main target of binary determination, and is the results of the fully connected layer process. Backpropagation is second stage to optimize NN processes on fully connected layers. In the algorithm's research specifies the weighted and the bias based on the error value. The equation process as the follow: And optimize the process as the follow: Where is constat (0.5), / is partial derivative of , is weight, and is bias. The process in determining the / value in the calculation process in determining the weight and bias value uses the equation as follows: ( 1 − 1 ) . 1 (1 − 1 ) . 1 (10) Where is partial derivative, is error, is weight, is predicted value, is total ∑( . 1 + ⋯ + ), and is input flattening matrix. In the process of backpropagation has the main goal is to do all the updates weight and bias that will be forwarded to do the next calculation.

Result
The results of this research, tested 100 training data and random data. Data collection to be used must meet the criteria according to the system development design contained table1. Photo slightly to the right and with a flat expression.

Smile
Photo slightly to the right and with a smiling expression.

Neutral
Photo slightly to the left and with a flat expression.

Smile
Photo slightly to the left and with a smiling expression.

Neutral
Photo slightly upwards and with a flat expression.

Smile
Photo slightly upwards and with a smiling expression.

Neutral
Photo slightly downward and with a flat expression.

Smile
Photo down slightly and with a smiling expression.
The table describes the data collection technique using the researcher's image based on an application designed using two expressions, namely neutral and happy with each face facing forward, right tilt, left tilt, up leaning, and down leaning. a visualization of the system diagram is shown in the image below:  The technology used in this research is to develop a biometric authentication system based on face recognition using face-API.js. face-API.js is a module of Javascript that is built on top of tensorflow.js.
Tensorflow.js is a library developed from the deeplearn.js platform. Focused on creating modules that are integrated with deep learning, which is part of artificial intelligence. In this research, tensorflow.js is used to implement CNN for the classification process. The results of the face recognition-based biometric authentication system using the CNN algorithm are as follows:

Fig. 4. Result face recognition
The results obtained are that this system can detect objects in real-time even though the face position is not frontal facing the camera. This much advantage of this algorithm which can't implementation using other face recognition algorithms such as Viola-Jones, which only able to detect if the face has to look frontally at the camera [25].
This research, to exchange data from face recognition output to the NodeMCU ESP8266 microcontroller using XmlHttpRequest, which is a part of AJAX technology that works asynchronously.
To perform the process of simulation barrier gate system that integrated with IoT will be simulated using datasheet components that are assembled following basic electronics. Fig.5 how datasheet model of the barrier gate system simulation.

Fig. 5. Datasheet model
The circuit's work process is the initial input received by NodeMCU ESP8266 of 5 Volt DC, which is obtained through the charger adapter output. The output from NodeMCU ESP8266 is 3.3 volt DC on each pinout 3v3 / VCC. Servo motors can operate if get a voltage of 4.8 Volt DC, then it takes MT3608 2A to increase the voltage from the 3.3 Volt DC to 6 Volt DC. Pinout Vout (-) on the MT3608 2A component is connected to the SG90 micro servo motor as input (+). Pinout Vout (-) of MT3608 2A DC Step Up Boost, and input (-) of micro servo motor SG90 connected to ground (GND) of NodeMCU ESP8266 pinout. After assembling the datasheet, perform the barrier gate simulation process as follow. The describe of the image, (a) is a condition where the SG90 servo motor does not receive waves from GPIO2 TXD1 / D4 or the results equal as false, (b) is a condition where the SG90 servo motor receives waves from GPIO2 TXD1 / D4 when the face recognition result is true.
The testing process in this research using static math models, receiver operating characteristic, and confusion matrix. Math static test aims to determine the speed performance of the application face recognition in recognizing an input image by identifying the time second and error rate generated from the fully connected layer process, Fig.7 shows the static math test results presented using a line chart. Receive operating characteristic testing technique where the analysis focusing on the accuracy of the system in recognizing all facial image data that has been carried out the process of training or training process. Fig.8 show the ROC test results on the true value model as follow:

Fig. 8. Result ROC true value
The diagram illustrates the results of a ROC test in an actual value, which means testing with already trained data. The TPR model has a total number value of 95 data that is predicted to be correct on face identification and a total of 96 data that is said to be accurate on the face expression. The test is divided into face identification and face expression, the conclusions in the following table.  The results of ROC accuracy on face identification are 95% with an error rate of 5%, and face expression is 96% with an error rate of 4%. Fig.9 show the ROC test results on the true false model as follow: Testing with untrained data on FNR models has the highest level that shows the number 98 data is mispredicted on face identification and 100 The data is said to be wrong on the face expression. Table 4 show results from ROC testing in false value for face recognition and Table 5 show results from ROC testing in false value for face expression. The test is divided into face identification and face expression, the conclusions in the following table.  The test is divided into face identification and face expression, the conclusions in the following table. From the test results based on 6 model scenarios using the confusion matrix get an average accuracy of 93.4%. If with these results and categorized according to the grouping of accuracy results, It can be said that the face recognition-based biometric authentication system using the CNN algorithm can carry out the identification and classification process, which has a high level of accuracy, efficiency, and security in the predicted result according to the actual result [26] however, the results generated from the testing process affect several factors such as light intensity, camera quality, and the type of device used.

Conclusion
This research implements a face recognition-based biometric authentication system using the CNN algorithm combined with the barrier gate control system by sending data in signals and utilizing IoT technology. The average overall experimental result is 0.1327 s, and the error rate obtained is 0.3031. The resulting test results were obtained from using the CNN algorithm and got better results than using a similar algorithm.
The implementation of the CNN algorithm, which is supported by video streams in real-time, and uses a high-resolution camera and bright light intensity, can detect images with the face not facing the camera, can detect moving or blurry images, and be able to detect images at a distance of up to 2 meters.
The test results from combining the output of a facial recognition-based biometric authentication system with the CNN algorithm and a microcontroller for the barrier gate system using a confusion matrix to measure the system's accuracy value using 6 test scenario models an average accuracy of 93.4%. With these results prove that the CNN algorithm can carry out the identification and classification process, which has a high level of accuracy, efficiency, and security in the predicted result according to the actual result.
Future research is better to develop the CNN algorithm and other algorithms and combine face recognition, iris recognition, and fingerprint to get optimal results for the biometric authentication process.