A Multi-stream Convolutional Neural Network for Micro-expression Recognition Using Optical Flow and EVM

Micro-expression (ME) recognition plays a crucial role in a wide range of applications, particularly in public security and psychotherapy. Recently, traditional methods rely excessively on machine learning design and the recognition rate is not high enough for its practical application because of its short duration and low intensity. On the other hand, some methods based on deep learning also cannot get high accuracy due to problems such as the imbalance of databases. To address these problems, we design a multi-stream convolutional neural network (MSCNN) for ME recognition in this paper. Specifically, we employ EVM and optical flow to magnify and visualize subtle movement changes in MEs and extract the masks from the optical flow images. And then, we add the masks, optical flow images, and grayscale images into the MSCNN. After that, in order to overcome the imbalance of databases, we added a random over-sampler after the Dense Layer of the neural network. Finally, extensive experiments are conducted on two public ME databases: CASME II and SAMM. Compared with many recent state-of-the-art approaches, our method achieves more promising recognition results.


I. INTRODUCTION
Micro-expression refers to a rapid, unconscious, spontaneous facial movement that occurs when experiencing a strong emotion. It usually has a short maintenance time, between 0.2s to 0.04s. Unlike ordinary expressions, spontaneous expressions cannot be faked or suppressed but can reflect people's real emotions so that the reliability of micro-expression in emotion recognition task is very high. Therefore there are many applications of micro-expressions, such as lie detection, negotiating, marketing, distance learning, and so on. However, its duration is short, and change is subtle, usually appearing only either the upper or lower half of the face, but not the whole face [1]. Because of these problems, it is difficult to observe microexpressions correctly.
In the past, methods based on Local Binary Pattern (LBP), optical flow, and machine learning were the main means of micro-expression recognition. They usually use LBP-based or optical flow methods to extract features and then classify them by Support Vector Machine (SVM). Most existing databases [2] [3] use LBP with Three Orthogonal Planes (LBP-TOP) [4] as their primary baseline feature extractor. Wang et al. [5] proposed LBP-SIP that provided a lightweight representation based on three intersecting lines crossing over the center point of LBP-TOP. In addition to the LBP-TOP based approach, there are other approaches, such as, Xu et al. [6] took the optical flow field as the basic feature to describe the motion pattern of micro-expressions and further extracted more simplified expression forms to propose facial dynamic map (FDM).
Additionally, not just traditional machine learning, but deep learning can also be used for micro-expressions. In recent years, CNN has made great achievements in the fields of computer vision. Of course it could also be used for microexpression recognition. Patel et al. [7] proposed a method based on temporal interpolation and CNN. Khor et al. [8] proposed a three-stream neural network and an enrichment method to fuse various features. However, compared with traditional machine learning, deep learning is less used to recognize micro-expression. And there are some problems to be solved in these CNN models, such as the imbalance of databases, and the inputs need to be more effective features rather than just video sequences or optical flows (dynamic features) or grayscale images (static features).
To solve these problems, in this paper, we propose a method based on deep learning for micro-expression recognition. Firstly, we use EVM to magnify micro-expression. And then we use the optical flow calculation method [9] proposed by Bob et al. to get the optical flow that contain information about the movements of facial muscles. After that, the optical flow images obtained are binarized with 50 as the threshold to obtain masks. After this step, we add the masks to the grayscale images to get the local areas of the face that have motion changes. At last, we input optical flow images (dynamic features), original gray images (static features) and the gray images which are covered by the masks (local features) into the multi-stream convolutional neural network proposed by ourselves. Different from the previous multi-stream neural network [8], we add an over-sampler after the network's final Dense Layer to deal with the problem of imbalanced databases.
Our main contributions are summarized as follows: • We combine EVM and optical flow method to process micro-expression. Comparing to using only one of the  two, our method has higher accuracy. • We propose a method to extract local features of motion and reduce data redundancy. • We attempt to deal with the imbalance problem by adding an over-sampler inside the neural network The rest of this paper is organized as follows. Section II presents our proposed method, and it is divided into two subsections to describe two modules: preprocessing and CNN. The preprocessing module includes steps such as extracting features and extending databases, while the other module determines some parameters of the deep network. Then we discuss two related databases and the experimental results for algorithm evaluation in Section III. Finally, Section IV concludes this work.

II. PROPOSED METHOD
In this section, we will introduce our proposed method of recognizing micro-expressions. Figure 1 summarizes the proposed framework with the preprocessing module and learning module.

A. Pre-processing
The micro-expression videos are first preprocessed using Eulerian Video Magnification (EVM), which could magnify the expression, makes it easier to recognize. However, the linear EVM method will amplify the noise while amplifying the changes in the movement so that we need a reasonable amplification factor α, and we will discuss this parameter in Section III.
After using EVM to magnify expressions, we used the optical flow calculation method proposed by Liu et al. [9] to calculate optical flow. They calculate dense optical flow, which computes the motion of each pixel, and the objective function shows in (1). The image lattice is represented as p = (x, y, t) and flow is w(p) = (u(p), v(p), 1), ψ(·) and φ(·) are robust functions.
Then we will get the optical flow of Figure 2(b) and Figure  2(a), the visual image is shown in Figure 2(c). In our proposed method, we use the onset frame, apex frame, and apex frame to generate optical flow.
Xia et al. [10] proposed a method to extract mask based on the heatmap. The mask produced by this method included both the upper and lower parts of the face, whereas ME usually appeared on only half the face [1]. So we binarized the optical flow image with a threshold value of 50 to get a mask, this method will only extract the moving part, as the Figure 2(d) shows. This mask is used to be added to the apex frame of a video sequence, and it can extract the effective areas of motion in the image and remove some redundancy. The result is shown in Figure 2(e).
Due to the small number of ME database samples will lead to bad robustness, to improve the robustness of the model and the reliability of the results, in the last step of preprocessing, we expand the training samples, using horizontal inversion and clockwise/counterclockwise rotation of 5°/10°to expand the number of samples by 10 times.

B. Convolutional Neural Network (CNN)
In this paper, we use Resnet-18 [11] to learn training data. It takes images size of 224 × 224 and batch normalization is carried out before each convolutional layer for faster training convergence. All convolutional and fully connected layers adopt Rectified Linear Unit (ReLU) as the activation function. Micro-expressions often overfit because of its small databases, so here we use Early Stopping to mitigate these overfitting  problems. The classifier we used is Softmax, then we used a mini-batch size of 64, and the maximum epoch is 200. The learning rate is 10 −3 , and momentum is 0.9. The weight decay is 5 × 10 −4 , and optimizer is SGD. The network's three inputs are optical flow images (O ∈ R 3 ), gray-scale raw images (G ∈ R 2 ) and gray-scale images that are covered by masks (M ∈ R 2 ).

A. Databases and experiment setting
At present, the commonly used databases of ME are CASME-II [2] from Chinese academy of sciences and SAMM database [3]. CASME-II is a comprehensive spontaneous ME database containing 247 video samples, elicited from 26 Asian participants, and it is obtained using a high-speed camera of 200 frames per second. In order to ensure the reliability of the data set, CASME-II induced the subjects' emotions by watching videos, and if the subjects successfully suppressed their emotions without being noticed by the record, they could receive a cash reward.
The SAMM database has 159 micro-expressions from 29 subjects. It has the same frame rate as CASME-II, and its induction mechanism is also similar to that of CASME-II. CASME-II and SAMM have coded both emotions and FACS for each expression. CASME-II is divided into five emotion classes while SAMM is divided into eight emotion classes, but in order to be consistent with CASME-II, we only select the five classes with the largest number of samples for the experiment. Information about these two databases can be seen in TableI.
In order to avoid too much distortion, we need to set a reasonable amplification factor α. To find the best α for EVM, we tried several different sets of values and calculated the optical flow of the CASME-II database under this value. The final results are shown in Figure 3(a). As we can see, the best result is obtained when the parameter is 8.

B. Comparison Results on CASME-II and SAMM
We evaluated our approach on two spontaneous facial ME databases: CASME-II and SAMM using the Leave-One-Subject-Out (LOSO) cross validation as this protocol prevents subject bias during learning. Table II, III compares the performance of our proposed approach with the baseline LBP-TOP approach and some recent and related works. The confusion matrix is shown in Figure 4. It can be seen that our method has the highest accuracy and F1-Score among these methods, which is not only superior to some of the previously mentioned deep learning methods but also higher than some traditional machine learning methods. And for the SAMM database, we got a result that is lower than CASME-II, and the result of the multi-stream neural network is not as good as that of single-stream optical flow, and this may be because the SAMM database is relatively small, resulting in poor results of the other two streams, which will also lower the performance of optical flow after feature fusion. However, since this oversampler is a random over-sampler, it may cause overfitting, so it does not perform well in the SAMM database.
To overcome the imbalance of databases, we added the oversampler, to verify the validity of this step, we compared the results obtained by no sampler with those obtained by a threeflow neural network adding a sampler based on CASME-II, as is shown in the Figure 3(b). However, since this over-sampler is a random over-sampler, it may cause overfitting, so it does not perform well in the SAMM database.
For further analysis, we also analyzed the different singlestream and double-stream inputs. These are carried out using both the CASME-II database and SAMM database, and are shown in Figure 3(c), 3(d), 3(e), 3(f).

IV. CONCLUSION
In this paper, we propose a MSCNN for ME recognition using optical flow and EVM. Firstly, the architecture of MSCNN is suitable for dealing with MEs recognition problem, because it can fuse different features, get more effective information. Secondly, it is clear that we use EVM, optical flow and a mask to extract feature, when α is 8, which benefit distinguishing MEs as well. Finally, we add an oversampler to reduce the effect of imbalanced database. Through experiments, we find that MSCNN has better performance than other methods mentioned. In the future, we will try to use some other oversamplers, such as SMOTE, ADASYN over-sampler and so on. In addition, we will focus on a network structure more suitable for ME recognition than the residual network.