# Facial Expression Recognition Based on Convolutional Neural Network Fusion SIFT Features of Mobile Virtual Reality

Authors: Fuguang Yao; Liudong Qiu
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

Facial expression recognition computer technology can obtain the emotional information of the person through the expression of the person to judge the state and intention of the person. The article proposes a hybrid model that combines a convolutional neural network (CNN) and dense SIFT features. This model is used for facial expression recognition. First, the article builds a CNN model and learns the local features of the eyes, eyebrows, and mouth. Then, the article features are sent to the support vector machine (SVM) multiclassifier to obtain the posterior probabilities of various features. Finally, the output result of the model is decided and fused to obtain the final recognition result. The experimental results show that the improved convolutional neural network structure ER2013 and CK+ data sets’ facial expression recognition rate increases by 0.06% and 2.25%, respectively.


---

## Body

## 1. Introduction

Facial expression recognition computer technology can obtain the emotional information of the person through the expression of the person to judge the state and intention of the person. It is of great significance in human-computer interaction, safe driving, and intelligent advertising systems. The CK+ data set is a classic facial expression library, which contains expression images of anger, disgust, fear, happiness, sadness, surprise, and contempt. The expressions are video sequences [1]. It contains a series of images with the same expression ranging from calm to violent. We can extract neutral expression images from it.Affected by factors such as distance, the image will have the problem of blurred faces and fewer face pixels. The facial expression recognition of low-pixel facial images is to recognize facial images with low quality and inconspicuous facial features [2]. The image size obtained by sampling is 32pixel×32pixel, which is in line with the low-pixel characteristics. The complexity of facial expression images is high. When the facial features are not obvious, it is difficult for us to identify by extracting specific feature information. For facial expression images with a size of 32pixel×32pixel, some scholars have proposed a facial expression recognition method based on the improved LeNetG5 convolutional neural network (CNN). Some scholars have proposed a CNN facial expression recognition method based on the local binary pattern (LBP). Research shows that CNN has a better effect on facial expression recognition in low-pixel facial images. This paper improves the CNN model on this basis. We propose an expression recognition method for low-pixel facial images and compare it with several other methods. The results show that this method has a better recognition effect.


## 2. Expression Recognition Method for Low-Pixel Facial Images

### 2.1. Facial Expression Image Reprocessing

General expression recognition methods include image reprocessing, facial feature extraction, and expression recognition. The reprocessing stage of image expression recognition performs face detection to obtain facial region images [3]. The recognition of expressions in low-pixel facial images also requires image enhancement or image superresolution during reprocessing. Image enhancement is to enhance the existing information of the image by changing the distribution of pixels, and image superresolution are to restore some missing pixel information by adding pixels.The image reprocessing of this method includes face detection and cropping, gray processing, downsampling, data enhancement, and image enhancement. The purpose of face detection is to accurately calibrate the position and size of the face in the image. We use the D-lib model for face detection. The D-lib model can automatically estimate the coordinates of the facial feature points in the image and process the data in the OpenCV library. We use this to crop the image so that the image features are concentrated on the face. Grayscale processing is the process of converting a colour image into a gray image. Downsampling is to standardize the image size in the input CNN model. We use bilinear interpolation to ensure that the face position of the resampled image is the same as the original image. We use CNN for image recognition. The amount of training data directly affects the final recognition effect. The larger the amount of data, the better the effect [4]. Commonly used data enhancement methods include mirroring, rotating, and adding noise. These methods mirror the original data and rotate it in different angles and directions, enhancing the data to 13 times the original data. We then add different noise coefficients (salt and pepper noise, Gaussian noise, Poisson noise, and speckle noise) to the existing data, and the final data is enhanced to 130 times the original data. We perform histogram equalization on the image and use the local binary mode to obtain the enhanced image. Among them, histogram equalization is also called histogram flattening. The essence of this method is to stretch the image nonlinearly and redistribute the image pixel values. In this way, the number of pixel values in a certain grayscale range is roughly equal. The local binary mode is an operator that describes the local texture characteristics of the image. It has the advantages of rotation and gray invariance. It can be used to extract local texture features of the image. The specific reprocessing process is shown in Figure 1.Figure 1
Facial expression reprocessing process.


### 2.2. Improved Convolutional Neural Network Model

With the development of computer processing capabilities, CNN has achieved amazing results in image recognition. The efficiency of CNN-based image recognition methods has also been continuously improved and has gradually replaced the traditional facial expression image recognition methods. In the 2012 ImageNet Object-Oriented Recognition Challenge (ILSVRC), some scholars used the CNN model Alex Net to win the championship. In the 2014 ILSVRC competition, the CNN model Google Net architecture won first place in the classification. Some scholars proposed CNN-VGG Net. The second place in the classification group and the first place in the positioning project group. VGG-Net deepens the number of network layers while avoiding too many parameters, all layers use a3×3 small convolution kernel, and the convolution layer step size is set to 1. The alternating structure of multiple convolutional and nonlinear activation layers makes extracting deeper and better features than a single convolutional layer structure. In the ILSVRC2015 competition, ResNet, proposed by scholars, won the championship [5]. A connection method called short cut connection in ResNet can theoretically keep the network in an optimal state while the network layer is constantly deepening. There is enough feature information in facial expressions to optimize model parameters to obtain a good recognition effect. Low-pixel face images need to make full use of inconspicuous feature information. On this basis, the article proposes a CNN model for expression recognition of low-pixel facial images to extract facial features better.The image size of the input CNN model is32pixel×32pixel. We increase the number of CNN layers to increase the nonlinearity of the network model. This makes the recognition ability of the decision function stronger. To avoid gradient disappearance and gradient explosion caused by deepening the number of network layers, the network needs to have a more complex structure [6]. Some scholars have proposed a network connection structure high way networks. Some of the features in this structure can pass through certain network layers directly without processing, which makes the structure easier to optimize. Combining this structure and the short cut connection, a short method avoids the gradient disappearance and gradient explosion problems when using deeper networks. The experiment the CNN model used is shown in Figure 2. The number before @ is the number of feature maps, and the number after @ is the size of the feature map (pixel×pixel).Figure 2
CNN model.We input the size of the feature map, the size of the kernel of the convolution and pooling operation, the step size, and the size of the output feature map in the convolution operation and the pooling operation. Its mathematical relationship is(1)ω2=ω1−f+2ps+1,whereω2 is the feature map size after convolution or pooling operation, ω1 is the size of the feature map before convolution or pooling, f is the size of the kernel for convolution and pooling operations, p is the number of pixels filled with zero, and s is the step size. We added the output tensor of the third layer of the model and the output tensor of the fifth layer to obtain 128 feature maps with a size of 14pixel×14pixel. Then, we pass the ReLU activation function as the input of the sixth layer. The article adds the output tensors of the seventh and ninth layers of the model to obtain 256 feature maps with a size of 6pixel×6pixel. Then, we pass the ReLU activation function as the input of the tenth layer. The twelfth layer is fully connected. We take the output of the tenth and eleventh layers through the ReLU activation function and then concatenate the obtained tensors as the input of the twelfth layer. The output is 160 neurons [7]. The last layer is the SoftMax classifier. The output is eight network nodes, representing the probability that the input image is indifferent expression states. Table 1 is the specific description of the model. The content includes the type of each layer of the model, the corresponding kernel size and step size, and the size of the output feature map of each layer. The CNN includes three basic operations: convolution, pooling, and full connection. Among them, convolution is also divided into inner convolution and outer convolution. In other words, it is the convolution without 0 paddings and the convolution with 0 paddings. The article assumes that the input is the matrix A of M×N. The convolution kernel is moment B, and M≥m,N≥n of m×n; then, the output of the inner convolution operation is C=A∗B. The pixel cij at the corresponding position can be expressed as
(2)cij=∑s=1m∑t=1nai+m−s,j+n−t×bst.Table 1
Convolutional network parameters.
LayerTypeKernel size (pixel×pixel)StrideOutput numberOutput size (pixel×pixel)Layer1Convolution3×316430×30Layer2Convolution3×3112828×28Layer3Max pooling2×2212814×14Layer4Convolution3×3112814×14Layer5Convolution3×3112814×14Layer6Convolution3×3125612×12Layer7Max pooling2×222566×6Layer8Convolution3×312566×6Layer9Convolution3×312566×6Layer10Average pooling3×332562×2Layer11Convolution2×215121×1Layer12Fully connected———160×1OutputSoftMax———8×11≤i≤M−m+1,1≤j≤N−n+1 is the corresponding multiplication with the rows and columns of matrix A. Suppose the pixel at the corresponding position of matrix B is bst, and the pixel at the corresponding position of matrix A is ai+m−s,j+n−t. Outer convolution is defined as filling A with 0, and the rows and columns of the filled matrix are related to the number of rows and columns of the B matrix. The article makes it an M+2m−2×N+2n−2 matrix and then performs inner convolution with B. The formula can be expressed as
(3)A∗∩B=A∩B∗∪B.We pool matrixA. Suppose it is divided into nonoverlapping blocks, and the size of each block is λ×τ. The matrix Gλ,τAij of block ij can be expressed as
(4)Gλ,τAi,j=astλ×τ,whereast is the element in row s and column t in matrix A, astλ×τ is a matrix block composed of λ×τ elements in matrix A, and i−1×λ+1≤s≤i×λ,j−1×τ+1≤t≤j×τ. Maximum pooling is defined as
(5)dGλ,τAi,j=max∑s=i−1×λ+1i×λ∑t=j−1×τ+1j×τast.Average pooling is defined as(6)aGλ,τAi,j=1λ×τ∑∑s=i−1×λ+1i×λ∑t=j−1×τ+1j×τast.We use overlapping blocks of sizeλ×τ to downsample the maximum pooled Amax and the average pooled Amean, respectively. The formula can be expressed as
(7)Dλ,τAmax=dGλ,τAi,j,Dλ,τAmean=aGλ,τAi,j.Each outputA of the fully connected layer can be seen as the r node ar in the previous layer multiplied by its weight coefficient ωr, plus a bias value bh. For example, the input of the fully connected layer is 256×2×2 nodes. That is, the input feature map is 256@2×2, and the output has 80 nodes. A total of 256×2×2×80=81920 weight coefficients and 80 offset parameters are required. Then, a single element dh in its output vector D can be expressed as
(8)dh=∑r=1kωr×ar+bh.In the formula,k is the number of input feature maps.


## 2.1. Facial Expression Image Reprocessing

General expression recognition methods include image reprocessing, facial feature extraction, and expression recognition. The reprocessing stage of image expression recognition performs face detection to obtain facial region images [3]. The recognition of expressions in low-pixel facial images also requires image enhancement or image superresolution during reprocessing. Image enhancement is to enhance the existing information of the image by changing the distribution of pixels, and image superresolution are to restore some missing pixel information by adding pixels.The image reprocessing of this method includes face detection and cropping, gray processing, downsampling, data enhancement, and image enhancement. The purpose of face detection is to accurately calibrate the position and size of the face in the image. We use the D-lib model for face detection. The D-lib model can automatically estimate the coordinates of the facial feature points in the image and process the data in the OpenCV library. We use this to crop the image so that the image features are concentrated on the face. Grayscale processing is the process of converting a colour image into a gray image. Downsampling is to standardize the image size in the input CNN model. We use bilinear interpolation to ensure that the face position of the resampled image is the same as the original image. We use CNN for image recognition. The amount of training data directly affects the final recognition effect. The larger the amount of data, the better the effect [4]. Commonly used data enhancement methods include mirroring, rotating, and adding noise. These methods mirror the original data and rotate it in different angles and directions, enhancing the data to 13 times the original data. We then add different noise coefficients (salt and pepper noise, Gaussian noise, Poisson noise, and speckle noise) to the existing data, and the final data is enhanced to 130 times the original data. We perform histogram equalization on the image and use the local binary mode to obtain the enhanced image. Among them, histogram equalization is also called histogram flattening. The essence of this method is to stretch the image nonlinearly and redistribute the image pixel values. In this way, the number of pixel values in a certain grayscale range is roughly equal. The local binary mode is an operator that describes the local texture characteristics of the image. It has the advantages of rotation and gray invariance. It can be used to extract local texture features of the image. The specific reprocessing process is shown in Figure 1.Figure 1
Facial expression reprocessing process.


## 2.2. Improved Convolutional Neural Network Model

With the development of computer processing capabilities, CNN has achieved amazing results in image recognition. The efficiency of CNN-based image recognition methods has also been continuously improved and has gradually replaced the traditional facial expression image recognition methods. In the 2012 ImageNet Object-Oriented Recognition Challenge (ILSVRC), some scholars used the CNN model Alex Net to win the championship. In the 2014 ILSVRC competition, the CNN model Google Net architecture won first place in the classification. Some scholars proposed CNN-VGG Net. The second place in the classification group and the first place in the positioning project group. VGG-Net deepens the number of network layers while avoiding too many parameters, all layers use a3×3 small convolution kernel, and the convolution layer step size is set to 1. The alternating structure of multiple convolutional and nonlinear activation layers makes extracting deeper and better features than a single convolutional layer structure. In the ILSVRC2015 competition, ResNet, proposed by scholars, won the championship [5]. A connection method called short cut connection in ResNet can theoretically keep the network in an optimal state while the network layer is constantly deepening. There is enough feature information in facial expressions to optimize model parameters to obtain a good recognition effect. Low-pixel face images need to make full use of inconspicuous feature information. On this basis, the article proposes a CNN model for expression recognition of low-pixel facial images to extract facial features better.The image size of the input CNN model is32pixel×32pixel. We increase the number of CNN layers to increase the nonlinearity of the network model. This makes the recognition ability of the decision function stronger. To avoid gradient disappearance and gradient explosion caused by deepening the number of network layers, the network needs to have a more complex structure [6]. Some scholars have proposed a network connection structure high way networks. Some of the features in this structure can pass through certain network layers directly without processing, which makes the structure easier to optimize. Combining this structure and the short cut connection, a short method avoids the gradient disappearance and gradient explosion problems when using deeper networks. The experiment the CNN model used is shown in Figure 2. The number before @ is the number of feature maps, and the number after @ is the size of the feature map (pixel×pixel).Figure 2
CNN model.We input the size of the feature map, the size of the kernel of the convolution and pooling operation, the step size, and the size of the output feature map in the convolution operation and the pooling operation. Its mathematical relationship is(1)ω2=ω1−f+2ps+1,whereω2 is the feature map size after convolution or pooling operation, ω1 is the size of the feature map before convolution or pooling, f is the size of the kernel for convolution and pooling operations, p is the number of pixels filled with zero, and s is the step size. We added the output tensor of the third layer of the model and the output tensor of the fifth layer to obtain 128 feature maps with a size of 14pixel×14pixel. Then, we pass the ReLU activation function as the input of the sixth layer. The article adds the output tensors of the seventh and ninth layers of the model to obtain 256 feature maps with a size of 6pixel×6pixel. Then, we pass the ReLU activation function as the input of the tenth layer. The twelfth layer is fully connected. We take the output of the tenth and eleventh layers through the ReLU activation function and then concatenate the obtained tensors as the input of the twelfth layer. The output is 160 neurons [7]. The last layer is the SoftMax classifier. The output is eight network nodes, representing the probability that the input image is indifferent expression states. Table 1 is the specific description of the model. The content includes the type of each layer of the model, the corresponding kernel size and step size, and the size of the output feature map of each layer. The CNN includes three basic operations: convolution, pooling, and full connection. Among them, convolution is also divided into inner convolution and outer convolution. In other words, it is the convolution without 0 paddings and the convolution with 0 paddings. The article assumes that the input is the matrix A of M×N. The convolution kernel is moment B, and M≥m,N≥n of m×n; then, the output of the inner convolution operation is C=A∗B. The pixel cij at the corresponding position can be expressed as
(2)cij=∑s=1m∑t=1nai+m−s,j+n−t×bst.Table 1
Convolutional network parameters.
LayerTypeKernel size (pixel×pixel)StrideOutput numberOutput size (pixel×pixel)Layer1Convolution3×316430×30Layer2Convolution3×3112828×28Layer3Max pooling2×2212814×14Layer4Convolution3×3112814×14Layer5Convolution3×3112814×14Layer6Convolution3×3125612×12Layer7Max pooling2×222566×6Layer8Convolution3×312566×6Layer9Convolution3×312566×6Layer10Average pooling3×332562×2Layer11Convolution2×215121×1Layer12Fully connected———160×1OutputSoftMax———8×11≤i≤M−m+1,1≤j≤N−n+1 is the corresponding multiplication with the rows and columns of matrix A. Suppose the pixel at the corresponding position of matrix B is bst, and the pixel at the corresponding position of matrix A is ai+m−s,j+n−t. Outer convolution is defined as filling A with 0, and the rows and columns of the filled matrix are related to the number of rows and columns of the B matrix. The article makes it an M+2m−2×N+2n−2 matrix and then performs inner convolution with B. The formula can be expressed as
(3)A∗∩B=A∩B∗∪B.We pool matrixA. Suppose it is divided into nonoverlapping blocks, and the size of each block is λ×τ. The matrix Gλ,τAij of block ij can be expressed as
(4)Gλ,τAi,j=astλ×τ,whereast is the element in row s and column t in matrix A, astλ×τ is a matrix block composed of λ×τ elements in matrix A, and i−1×λ+1≤s≤i×λ,j−1×τ+1≤t≤j×τ. Maximum pooling is defined as
(5)dGλ,τAi,j=max∑s=i−1×λ+1i×λ∑t=j−1×τ+1j×τast.Average pooling is defined as(6)aGλ,τAi,j=1λ×τ∑∑s=i−1×λ+1i×λ∑t=j−1×τ+1j×τast.We use overlapping blocks of sizeλ×τ to downsample the maximum pooled Amax and the average pooled Amean, respectively. The formula can be expressed as
(7)Dλ,τAmax=dGλ,τAi,j,Dλ,τAmean=aGλ,τAi,j.Each outputA of the fully connected layer can be seen as the r node ar in the previous layer multiplied by its weight coefficient ωr, plus a bias value bh. For example, the input of the fully connected layer is 256×2×2 nodes. That is, the input feature map is 256@2×2, and the output has 80 nodes. A total of 256×2×2×80=81920 weight coefficients and 80 offset parameters are required. Then, a single element dh in its output vector D can be expressed as
(8)dh=∑r=1kωr×ar+bh.In the formula,k is the number of input feature maps.


## 3. Expression Recognition Experiment of Low-Pixel Facial Images

### 3.1. Data Set Preparation

The experiment uses the CK+ data set. This data set is used to evaluate the facial expression recognition (FER) system, and it is also a relatively common data set for facial expression recognition. The content contains 593 video sequences from 123 subjects. The duration ranges from 10 to 60 frames [8]. The data set shows a series of images ranging from calm to violent. The number of original images on different expressions is unevenly distributed. The neutral expression image is the image at the beginning or end of the expression. According to the original number distribution, we select the last 1 ~ 3 expression images of each expression sequence. A total of 686 images were used for modeling. 80% is used as the training set, and 20% is used as the test set. The peak images of the same person with the same expression will not appear in the training set and the test set simultaneously.The article adds data to the training set. We will test the data gained and ungained test sets in the same trained model. Since the research found that the difference in recognition accuracy is small, no data gain processing is done on the test set. The final image size of the training set is 71370, and the image size of the test set is 137. We perform histogram equalization and local binary mode on all images to obtain three data sets of the same size, including the original image [9]. Table 2 shows the number of images of 8 expressions in each test set and training set. The original image of the eight expressions, the image after the histogram equalization, and the image with the local binary mode are shown in Figure 3.Table 2
Facial expression database.
CategoryTrain databaseTest databaseAngry1404027Disgust1222024Fearful780015Happy1430028Sad897015Surprised858016Scorn546012Neutral897015Figure 3
Sample images of 8 emoticons.


### 3.2. Evaluation Criteria

The main evaluation criteria of facial expression recognition methods are recognition accuracy and recognition speed. The recognition accuracy rate is the ratio of correctly recognized expression samples in the test set to the number of samples in all the test sets. Recognition speed is when it takes to recognize each test set sample after the recognition model is established. The time it takes is the ratio of the time it takes to identify the test set to the number of samples in the test set.(9)A=1p∑1pgfxb=yb,td=Tp,whereA is the recognition accuracy rate, p is the total number of samples in the test set, g is the indicator function, xb is the given sample, fxb is the output after the sample passes the model, yb is the label of a given sample, td is the recognition speed [10], and T is the total time spent. We can get it by subtracting the time before the first test sample was recognized by the time after the last test sample was recognized.


### 3.3. Experimental Process

Because the input CNN image pixels are low, the output recognition effect will fluctuate slightly, so we introduce the decision fusion and final image recognition. In the testing phase, we use five trained network models to judge the test set data, respectively. Then, we use the SoftMax average voting (SAV) method to fuse the judgment results of the five models. Finally, we get the final result to improve the recognition effect. The test steps are shown in Figure4.Figure 4
Schematic diagram of SoftMax average voting.It can be seen from Section2.2 that the output of CNN is a 1-dimensional vector. The value of each element in the vector is the probability that the image may be a certain category. SoftMax average voting is to average the output results of five trained CNNs. Take the average of three experiments from the most likely result at the end of the article. The graphics card is NVIDAGe Force 940MX. The main frequency is 1122 MHz, and the memory is 2.00 GB. The operating system is Linux Ubuntu 16.04. The software is Python 3.6, NVIDIA CUDA, and cuDNN libraries. We adopted the training strategy to improve the recognition accuracy is to add batch normalization (BN) and ReLU activation functions after each convolutional and pooling layer. This can overcome the disappearance of the gradient and speed up the training speed.We selectively add L2 regularization and dropout to alleviate overfitting. The learning rate decay strategy is adopted. We choose a larger value at the beginning of the learning rate. AfterN rounds of iteration, the attenuation is 1/10 of the initial learning rate [11]. We use the Adam optimization algorithm during optimization, which enables the network to find the global best advantage faster. The data sets are the original image, the image with the histogram enhancement, and the local two. The CNN model is trained when the value pattern feature map is used, and at the same time, we adjust the parameters of the network.According to the accuracy of the test, we first determine whether we need to add the L2 regularization and dropout layer and then determine which layer to place. We determine the approximate range of the learning rate according to the loss during training, training loss, and test accuracy. Two dichotomies obtain the learning rate.


### 3.4. Result Analysis

To find the optimal situation of the facial expression recognition system, we input the original image data set, the local binary pattern feature map data set, and the histogram equalized data set in the CNN model. The average recognition accuracy and speed obtained as a result are shown in Table3. The experiment is the average of three experiments.Table 3
Comparison of recognition accuracy and time.
ModelOriginal databaseLocal binary pattern databaseHistogram equalization databaseAccuracy (%)89.586.990.5Time (s)1.541.271.56It can be found that the accuracy of the input data set after histogram equalization is better than that of the original image data set. The accuracy of the data set the input as the local binary pattern feature map is the worst. There is no obvious difference in speed between the three. The recognition speed of the data set the input as the local binary pattern feature map is slightly faster, but the speed of 0.29 s has a small advantage compared with the accuracy of 3.6%. Analysing the different data sets in Figure3, we believe that certain data enhancements will strengthen the image information and improve the recognition accuracy. Because the original pixels of the data are too low, we directly extract the feature map of its local binary mode, which will enhance the texture information while losing more information [12]. Therefore, the speed is the fastest when the accuracy is the lowest. The experiment finally selects the data set enhanced by histogram equalization to input the CNN model. We add L2 regularization and dropout after the twelfth layer. The dropout parameter is 0.7, and the initial value of the learning rate is 0.0001. After 1000 iterations, it decays to 1/10 of the initial learning rate. Table 4 shows the three experimental results of the improved CNN model on the CK+ data set for the eight-expression recognition.Table 4
The recognition accuracy of the improved CNN model.
Category accuracyFirst experimentSecond experimentThird experimentTotalAngry96.388.996.393.8Disgust91.791.795.893.1Fearful6086.76068.9Happy100100100100Sad86.78086.784.5Surprised10010093.897.9Scorn83.383.37580.5Neutral93.393.393.393.3Total90.591.289.890.5It can be seen from Table4 that the recognition rates of happy and surprised expressions are higher. Fearful’s recognition rate is low and fluctuates greatly. On the one hand, it may be that the first two characteristics are more distinct, while fearful and sad have similar characteristics to some extent. On the other hand, in the CK+ data set, the amount of raw data of the first two expressions is abundant, and the amount of fearful data is small. A total of 15 images were in the fearful test set. There are only five different expression images in the original data. This leads to unequal training times. To verify the effect of the established recognition model, we input the JAFFE data set as the test set to identify other expressions except for the contempt expression. The average recognition accuracy of the three results is 82.4%.To prove that the proposed method and decision fusion method are pertinent to the expression recognition of low-pixel facial images, we conduct experiments in two cases, respectively [13]. One is to replace the improved CNN model with the classic shallow convolutional neural network LeNetG5. The second is to experiment without using decision fusion. Table 5 shows the average recognition accuracy and comparison of the three experiments in the two cases above.Table 5
Comparison of recognition accuracy and time between the two models.
ModelLeNet-5Without decision levelAccuracy (%)74.687.9Time (s)0.590.31It can be seen from Table3 that the improved CNN model has an increase of 15.9% in recognition accuracy compared with the LeNetG5 network. This proves that this method is more suitable for expression recognition of low-pixel face images [14]. The recognition accuracy after decision fusion is 2.6 percentage points higher than that of the network without decision fusion. The main reason is that the experimental effects in the three experiments are unstable, and the recognition accuracy of the two experiments is about 90.0%. The result of one experiment was 83.9%. However, each experiment result of this method is obtained by averaging five trained network models, and its overall stability is relatively high. This proves that this method is effective and feasible in practice.In recent years, facial expression recognition methods for face images with a size of32pixel×32pixel have been proposed one after another. On the CK+ data set, some scholars have proposed a cross-connect LeNetG5 CNN. We perform seven classifications of images that do not include neutral expressions, and the recognition accuracy rate is 83.74%. Some scholars have proposed a shallow CNN to achieve a seven-class recognition accuracy of 97.38%. This is higher than the recognition accuracy of this method.


## 3.1. Data Set Preparation

The experiment uses the CK+ data set. This data set is used to evaluate the facial expression recognition (FER) system, and it is also a relatively common data set for facial expression recognition. The content contains 593 video sequences from 123 subjects. The duration ranges from 10 to 60 frames [8]. The data set shows a series of images ranging from calm to violent. The number of original images on different expressions is unevenly distributed. The neutral expression image is the image at the beginning or end of the expression. According to the original number distribution, we select the last 1 ~ 3 expression images of each expression sequence. A total of 686 images were used for modeling. 80% is used as the training set, and 20% is used as the test set. The peak images of the same person with the same expression will not appear in the training set and the test set simultaneously.The article adds data to the training set. We will test the data gained and ungained test sets in the same trained model. Since the research found that the difference in recognition accuracy is small, no data gain processing is done on the test set. The final image size of the training set is 71370, and the image size of the test set is 137. We perform histogram equalization and local binary mode on all images to obtain three data sets of the same size, including the original image [9]. Table 2 shows the number of images of 8 expressions in each test set and training set. The original image of the eight expressions, the image after the histogram equalization, and the image with the local binary mode are shown in Figure 3.Table 2
Facial expression database.
CategoryTrain databaseTest databaseAngry1404027Disgust1222024Fearful780015Happy1430028Sad897015Surprised858016Scorn546012Neutral897015Figure 3
Sample images of 8 emoticons.


## 3.2. Evaluation Criteria

The main evaluation criteria of facial expression recognition methods are recognition accuracy and recognition speed. The recognition accuracy rate is the ratio of correctly recognized expression samples in the test set to the number of samples in all the test sets. Recognition speed is when it takes to recognize each test set sample after the recognition model is established. The time it takes is the ratio of the time it takes to identify the test set to the number of samples in the test set.(9)A=1p∑1pgfxb=yb,td=Tp,whereA is the recognition accuracy rate, p is the total number of samples in the test set, g is the indicator function, xb is the given sample, fxb is the output after the sample passes the model, yb is the label of a given sample, td is the recognition speed [10], and T is the total time spent. We can get it by subtracting the time before the first test sample was recognized by the time after the last test sample was recognized.


## 3.3. Experimental Process

Because the input CNN image pixels are low, the output recognition effect will fluctuate slightly, so we introduce the decision fusion and final image recognition. In the testing phase, we use five trained network models to judge the test set data, respectively. Then, we use the SoftMax average voting (SAV) method to fuse the judgment results of the five models. Finally, we get the final result to improve the recognition effect. The test steps are shown in Figure4.Figure 4
Schematic diagram of SoftMax average voting.It can be seen from Section2.2 that the output of CNN is a 1-dimensional vector. The value of each element in the vector is the probability that the image may be a certain category. SoftMax average voting is to average the output results of five trained CNNs. Take the average of three experiments from the most likely result at the end of the article. The graphics card is NVIDAGe Force 940MX. The main frequency is 1122 MHz, and the memory is 2.00 GB. The operating system is Linux Ubuntu 16.04. The software is Python 3.6, NVIDIA CUDA, and cuDNN libraries. We adopted the training strategy to improve the recognition accuracy is to add batch normalization (BN) and ReLU activation functions after each convolutional and pooling layer. This can overcome the disappearance of the gradient and speed up the training speed.We selectively add L2 regularization and dropout to alleviate overfitting. The learning rate decay strategy is adopted. We choose a larger value at the beginning of the learning rate. AfterN rounds of iteration, the attenuation is 1/10 of the initial learning rate [11]. We use the Adam optimization algorithm during optimization, which enables the network to find the global best advantage faster. The data sets are the original image, the image with the histogram enhancement, and the local two. The CNN model is trained when the value pattern feature map is used, and at the same time, we adjust the parameters of the network.According to the accuracy of the test, we first determine whether we need to add the L2 regularization and dropout layer and then determine which layer to place. We determine the approximate range of the learning rate according to the loss during training, training loss, and test accuracy. Two dichotomies obtain the learning rate.


## 3.4. Result Analysis

To find the optimal situation of the facial expression recognition system, we input the original image data set, the local binary pattern feature map data set, and the histogram equalized data set in the CNN model. The average recognition accuracy and speed obtained as a result are shown in Table3. The experiment is the average of three experiments.Table 3
Comparison of recognition accuracy and time.
ModelOriginal databaseLocal binary pattern databaseHistogram equalization databaseAccuracy (%)89.586.990.5Time (s)1.541.271.56It can be found that the accuracy of the input data set after histogram equalization is better than that of the original image data set. The accuracy of the data set the input as the local binary pattern feature map is the worst. There is no obvious difference in speed between the three. The recognition speed of the data set the input as the local binary pattern feature map is slightly faster, but the speed of 0.29 s has a small advantage compared with the accuracy of 3.6%. Analysing the different data sets in Figure3, we believe that certain data enhancements will strengthen the image information and improve the recognition accuracy. Because the original pixels of the data are too low, we directly extract the feature map of its local binary mode, which will enhance the texture information while losing more information [12]. Therefore, the speed is the fastest when the accuracy is the lowest. The experiment finally selects the data set enhanced by histogram equalization to input the CNN model. We add L2 regularization and dropout after the twelfth layer. The dropout parameter is 0.7, and the initial value of the learning rate is 0.0001. After 1000 iterations, it decays to 1/10 of the initial learning rate. Table 4 shows the three experimental results of the improved CNN model on the CK+ data set for the eight-expression recognition.Table 4
The recognition accuracy of the improved CNN model.
Category accuracyFirst experimentSecond experimentThird experimentTotalAngry96.388.996.393.8Disgust91.791.795.893.1Fearful6086.76068.9Happy100100100100Sad86.78086.784.5Surprised10010093.897.9Scorn83.383.37580.5Neutral93.393.393.393.3Total90.591.289.890.5It can be seen from Table4 that the recognition rates of happy and surprised expressions are higher. Fearful’s recognition rate is low and fluctuates greatly. On the one hand, it may be that the first two characteristics are more distinct, while fearful and sad have similar characteristics to some extent. On the other hand, in the CK+ data set, the amount of raw data of the first two expressions is abundant, and the amount of fearful data is small. A total of 15 images were in the fearful test set. There are only five different expression images in the original data. This leads to unequal training times. To verify the effect of the established recognition model, we input the JAFFE data set as the test set to identify other expressions except for the contempt expression. The average recognition accuracy of the three results is 82.4%.To prove that the proposed method and decision fusion method are pertinent to the expression recognition of low-pixel facial images, we conduct experiments in two cases, respectively [13]. One is to replace the improved CNN model with the classic shallow convolutional neural network LeNetG5. The second is to experiment without using decision fusion. Table 5 shows the average recognition accuracy and comparison of the three experiments in the two cases above.Table 5
Comparison of recognition accuracy and time between the two models.
ModelLeNet-5Without decision levelAccuracy (%)74.687.9Time (s)0.590.31It can be seen from Table3 that the improved CNN model has an increase of 15.9% in recognition accuracy compared with the LeNetG5 network. This proves that this method is more suitable for expression recognition of low-pixel face images [14]. The recognition accuracy after decision fusion is 2.6 percentage points higher than that of the network without decision fusion. The main reason is that the experimental effects in the three experiments are unstable, and the recognition accuracy of the two experiments is about 90.0%. The result of one experiment was 83.9%. However, each experiment result of this method is obtained by averaging five trained network models, and its overall stability is relatively high. This proves that this method is effective and feasible in practice.In recent years, facial expression recognition methods for face images with a size of32pixel×32pixel have been proposed one after another. On the CK+ data set, some scholars have proposed a cross-connect LeNetG5 CNN. We perform seven classifications of images that do not include neutral expressions, and the recognition accuracy rate is 83.74%. Some scholars have proposed a shallow CNN to achieve a seven-class recognition accuracy of 97.38%. This is higher than the recognition accuracy of this method.


## 4. Conclusion

Aiming at the expression recognition of low-pixel face images, the paper proposes an improved CNN expression recognition method. The article increases the nonlinearity of the network model by adding a convolutional layer. We can learn from extract image features in more layers and reflect image information.



---

*Source: 5763626-2021-10-14.xml*