# Automatic Outdoor Patrol Robot Based on Sensor Fusion and Face Recognition Methods
## 2 Materials and Methods
### Face Recognition
#### 2.5.3 Convolutional Neural Network  
In 2006, the article by [PERSON] and [PERSON] in Science ushered in the wave of deep learning in the academic and industrial world [43]. Their paper has two key points. The first is the multi-layer hidden artificial neural network that has excellent feature learning capabilities, and the learned features have more characterization of the data, which is conducive to visualization or classification. The other key point is deep neural network training, the difficulty of which can be effectively overcome by layer-wise pre-training. The current basic structure of the CNN consists of the input layer, convolutional layer, pooling layer, full connectivity, and output layers (classifiers). For many existing classic deep learning networks such as YOLOv4, the computing resources required from data labeling to training classification are becoming larger and larger. The process of training neural networks and adjusting hyperparameters has become very time-consuming. If we want to rely on an ordinary notebook computer to be the processor of the robot, we need to hypothesize and challenge the problem of insufficient computing power of the robot in the outdoors and minimize the demand for computing resources. The CNN model established in this experiment attempts to use only a single convolutional layer and a single pooling layer plus three full-connection layers (hidden layer, multi-layer perceptron) to reduce computing time, as shown in Figure 13. The output layer is the classifier and uses the Softmax regression. Consider a \(5\times 5\) image size and a \(3\times 3\) convolution kernel. There are nine parameters for the convolution kernel here, which is denoted as (Theta=[theta[ij]][3\times 3]). In this case, the convolution kernel has nine neurons, and their outputs form a \(3\times 3\) matrix called a feature map. The first neuron is connected to the first \(3\times 3\) part of the image, and the second neuron is connected to the second part (with overlap), as shown in Figure 14 [44]. \[\Theta=[\theta ij]\,3\times 3 \tag{11}\]  
Figure 12: Image clipping ratio diagram. Figure 13: The structure of CNN. A matrix of (\(m\)\(\times\)\(n\)) is convoluted with a matrix of (\(u\)\(\times\)\(v\)) to obtain a matrix of (\((m+u-1)\)\(\times\)\((n+v-1)\)). Apply the discrete convolution operation, assuming a two-dimensional discrete function (\(f(m,n)\), \(g(u,v)\)), then their convolution is defined as\(f(m,n)\), \(g(u,v)\), and their convolution is defined as:  
\[A(m,n)=f(m,n)*g(u,v)=\sum_{i}^{m}\sum_{j}^{n}f(m-u,n-v)g(u,v). \tag{12}\]  
The top of Figure 14 is the output of the first neuron, and the bottom is the output of the second neuron. The operation of each neuron is:  
\[A_{(1+q)(1+p)}=act\left(\sum_{i}^{u}\sum_{j}^{v}a_{(i+q)(j+p)}\theta_{ij}+b \right). \tag{13}\]  
In Equations (11)-(13), \(\Theta\) is the 9 parameters for the convolution kernel, \(A(m,\ n)\) is the convolution output, \(f(m,n)\) is the convolution input, and \(g(u,v)\) is the convolution kernel, \(u\)\((\)and \(v)\) is the length (and width) of the matrix of the convolution kernel, \(m\)\((\)and \(n)\) is the length (and width) of the matrix of the convolution input, \(act\) is the activation function, \(b\) is the bias value, \(i\) and \(j\) are the position subscript of the matrix, \(q\) is a positive integer and the range is less than or equal to \((m-u)\), and \(p\) is a positive integer and the range is less than or equal to \((n-v)\). The purpose of pooling is to reduce the feature map. The pool size is generally 2 \(\times\) 2 [39]. Commonly used pooling methods are:  
* Max Pooling, take the maximum inside of the 4 points. This pooling method is used in this study, as shown in Figure 15.
* Mean Pooling, take the average for the 4 points. * Gaussian pooling, learn from Gaussian fuzzy methods, uncommonly used. * It can be pooled, the training function (\(f\)) accepts 4 points as input and 1 point as output, uncommonly used.