# Face Recognition Based on Deep Learning and FPGA for Ethnicity Identification
## 4 The Deep Learning-Based Ethnicity Identification Proposal  
### Ethnicity Identification  
Our model proposal uses twelve DL layers. Initially, four convolutional layers are employed, each followed by a max-pooling layer. In addition, some of these convolutional layers have a dropout layer inserted after the max-pooling layer for extracting facial features. Next to these convolutional layers, there are two fully connected layers and a drop connect layer as a separator to rid the overfitting problem through the training process. After the drop-connect layer, a flattening layer is inserted to flatten the output before it passes to the fully connected layer. An additional dropout layer is inserted between the two fully connected layers. Finally, a SoftMax output layer is employed to recognize the classes. The total network architecture is shown in Figure 3. Note that it is possible to enlarge the recognized classes (n) to include more nationalities.  
However, the input image has a size of 128 \(\times\) 128 \(\times\) 3 since (3) can be feature maps. In addition, the patch size is 3 \(\times\) 3 with unchanged padding in each convolutional layer. In contrast, the stride has a value (1) to make the convolutional layer output nearly similar to the input size. The input size is minimized, bypassing the co  
Figure 3: Our proposal system for ethnicity identification based on deep learning.  
to a max-pooling layer and then to the ReLU activation function. The equation of the convolutional layer with the feature map is:  
\[f(x)^{i(r)}=max\left(0,b^{i(r)}\sum_{n=1}^{\infty}k^{ij(r)}*x^{i(r)}\right) \tag{1}\]  
Within a specific area \(r\), \(f(x)^{j(r)}\) is the \(j^{th}\) output patch of the convolution layer, \(b^{j(r)}\) is the bias of the \(j^{th}\) output patch, \(k^{ij(r)}\) is the kernel of the convolutional layer between the \(i^{th}\) input and \(j^{th}\) output patch, the multiplication sign (\(*\)) means the convolution, and \(x^{i(r)}\) is the \(i^{th}\) input patch within a specific area \(r\) to the convolution layer. Figure 3 shows that the input image is partitioned into small areas; each area has a size of \(3\times 3\) based on the window patch size.  
As mentioned earlier, the max-pooling layer receives the convolutional layer output. The equation of the max-pooling layer is:  
\[f(x)^{i}_{jk}=\underset{0\leq m,n<sz}{max}\left(x^{i}_{j:sz+m,k\cdot sz+n}\right) \tag{2}\]  
The neurons in the \(i^{th}\) output patch of \(f(x)^{i}\) pool over a local area of \(sz\times sz\) in the \(i^{th}\) input patch (\(x^{i}\)). The nonlinearity function ReLU keeps all positive values constant, whereas all negative values are set to zero. As compared to the sigmoid function, the RELU has a better fitting performance [45].  
In this work, three dropout layers were used, one separating the two fully-connected layers and the other two are after the second and the third convolutional layers, respectively. The equation of the two fully connected layers is:  
\[fc=max\left(0,\sum_{i}x^{i-1}\cdot w^{i-1,j-1}\right)+max\left(0,\sum_{i}DOut _{rate}\left(x^{i}\cdot w^{i,j}\right)\right) \tag{3}\]  
Regarding the previous layer, \(x^{i-1}\) refers to the neurons, and \(w^{i-1}\) refers to the weights. The \(DOut_{rate}\) separates the two fully connected layers where the rate is 0.5. Regarding the first connected layer, \(x^{i}\) refers to the neurons, and \(w^{i}\) refers to weights.  
Among \(n\) different ethics, the \(n\)-way softmax predicts the face ethic based on the ConvNet output. The equation of the softmax is:  
\[y_{i}=\frac{\exp(x_{i})}{\sum_{j=1}^{n}\exp(x_{j})} \tag{4}\]  
where \(x\) is the output index in \(n\), which means, for example, the number of classes, and \(x_{i}\) is the input vector that refers to the very significant features utilized for FR to the output layer.