Facial micro-expression recognition method, device, electronic device and storage medium
Through stride sampling and local spatial differential feature stacking blocks, combined with a lightweight spatio-temporal combination neural network, the resource and computational complexity problems of micro-expression recognition methods in the existing technology are solved, and the recognition accuracy and efficiency are improved.
Patent Information
- Application Number
- CN202111589200.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-12-23
AI Technical Summary
Existing facial micro-expression recognition methods do not consider the optimization of the model combination structure when using combined neural networks, resulting in the inability to accurately focus on the micro-expression area of interest, and high resource costs and computational complexity.
The stride sampling method is used to expand the sample, combined with Euler video amplification and local spatial differential feature stacking blocks, and a lightweight spatiotemporal combination neural network is used to reduce resource occupation and improve recognition accuracy.
It effectively avoids the over-fitting problem in deep learning, improves the accuracy and efficiency of micro-expression recognition, and reduces computational complexity.
Smart Images

Figure CN114241573B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a facial micro-expression recognition method, device, electronic equipment and storage medium. Background Art
[0002] Micro-expression is a concept in the field of psychology. Facial micro-expressions have the characteristics of low intensity, fast occurrence, and not easily suppressed by humans. Therefore, facial micro-expression features can better represent real emotions than general facial expressions. In recent years, micro-expression recognition methods have played a vital role in criminal investigation, psychotherapy and finance, but how to accurately identify facial micro-expressions from long videos is still a challenge.
[0003] At present, facial micro-expression recognition methods can be mainly summarized into two categories: keyframe-based micro-expression recognition methods and video-based micro-expression recognition methods.
[0004] 1. The keyframe-based micro-expression recognition method uses only the keyframe images marked in the micro-expression video sequence as the recognition object, where the keyframe represents the start, peak and end position of the micro-expression in the video. This type of method uses methods such as two-dimensional convolutional networks to identify the micro-expression features expressed in a single image.
[0005] 2. The video-based micro-expression method uses a complete video sequence of micro-expressions as the recognition object, and recognizes the changes in the spatial and temporal features of the video by using a convolutional and recurrent combination of neural networks.
[0006] The problems with these methods are: on the one hand, the optimization of the model combination structure is not considered when using the combined neural network structure, resulting in the inability of the neural network to focus more accurately on the micro-expression interest areas when extracting the spatial and temporal features of the video; on the other hand, these methods use multiple micro-expression image features to superimpose, which undoubtedly increases the resource cost and computational complexity. Summary of the invention
[0007] Based on this, the purpose of the present invention is to provide a facial micro-expression recognition method, device, electronic device and storage medium, and design a stride sampling method to achieve sample expansion, effectively avoiding the overfitting problem caused by deep learning during the training process, and effectively improving the accuracy of micro-expression recognition.
[0008] In a first aspect, the present invention provides a method for recognizing facial micro-expressions, the method comprising the following steps:
[0009] Obtain the video of the micro-expression to be recognized;
[0010] Preprocessing the video to obtain a long video sequence after motion magnification and resolution normalization;
[0011] Performing stride sampling on the long video sequence to obtain a sub-video sequence of a preset length;
[0012] The sub-video sequence is input into a trained micro-expression recognition network to obtain a classification result of the facial micro-expression corresponding to the video.
[0013] Further, the micro-expression recognition network includes a local spatial differential feature stacking block and a spatiotemporal feature extraction network;
[0014] Inputting the sub-video sequence into a trained micro-expression recognition network to obtain a classification result of facial micro-expressions corresponding to the video includes:
[0015] Inputting the sub-video sequence into the local spatial differential feature stacking block to obtain a spatial feature after local spatial enhancement;
[0016] The spatial feature sequence after the local space enhancement is input into the spatiotemporal feature extraction network to obtain the classification result of the facial micro-expression of the video.
[0017] Furthermore, the local spatial differential feature stacking block includes a stacking block, an average pooling layer, a first convolution layer, a first residual block, and an upsampling layer connected in sequence, and an output result of the upsampling layer and an output result of the second convolution layer are weighted and input into the second residual block;
[0018] Inputting the sub-video sequence into the local spatial differential feature stacking block to obtain the spatial features after local spatial enhancement, including:
[0019] Input each frame in the sub-video sequence into the second convolutional layer to extract the original spatial feature map sequence corresponding to the sub-video sequence;
[0020] Input each frame in the sub-video sequence into the stacking block to obtain differential features of the sub-video sequence;
[0021] Inputting the differential features into the average pooling layer to obtain reduced-dimensional differential features;
[0022] Inputting the dimension-reduced differential features into the first convolutional layer and the residual block in sequence to obtain differential spatial feature parameters;
[0023] Inputting the differential spatial feature parameters into the upsampling layer to obtain differential spatial features of the same dimension as the original spatial features;
[0024] The original spatial feature and the differential spatial feature are summed and weighted;
[0025] The weighted spatial features are input into the second residual block to obtain spatial features after local spatial enhancement.
[0026] Furthermore, the spatiotemporal feature extraction network includes a VGGFace network, a temporal convolutional network and a classification layer connected in sequence, and the classification layer uses a central loss function and a regularization method to calculate the classification results of the facial micro-expressions of the video;
[0027] Inputting the spatial feature sequence after the local space enhancement into the spatiotemporal feature extraction network to obtain the classification result of the facial micro-expression of the video, including:
[0028] The spatial feature sequence after local spatial enhancement is input into the VGGFace network, and the output feature vector X representing the spatial information is X=[x1, x2, ...x s ], whose dimension size is (s,512):
[0029] The feature vector X = [x1, x2, ... x s ] Input the temporal convolutional network to extract temporal features and obtain the spatial temporal information Eigenvector;
[0030] The spatial temporal information The feature vector is input into the classification layer and is calculated by the central loss function to obtain the classification result of the facial micro-expression of the video.
[0031] Furthermore, the training steps of the micro-expression recognition network include:
[0032] Get micro-expression video data;
[0033] Preprocessing and striding sampling the micro-expression video data to obtain a sub-video sequence data set of a preset length;
[0034] Dividing the data set into a training set, a validation set and a test set, and training the micro-expression recognition network;
[0035] The validation set is used to select parameters of the micro-expression recognition network, and the test set is used to test the performance of the micro-expression recognition network corresponding to different parameters to obtain a trained micro-expression recognition network.
[0036] Further, performing stride sampling on the sub-video sequence includes:
[0037] Take the trimmed long video sequence as input, obtain the length L of the sequence, and divide the sequence into s segments of equal length, so that the length of each segment is T.
[0038] Set a random seed according to the range of T and randomly select a frame from each fragment;
[0039] and / or, extracting peak frames from peak frame occurrence segments of the video;
[0040] Arrange the image frames extracted from each segment in the order of the segments to obtain a sub-video sequence of length s;
[0041] Repeat the above steps to get T s-1 sub-video sequences of equal length s.
[0042] Further, preprocessing the video includes:
[0043] Input the video into the Euler video magnification algorithm model for action magnification, wherein the magnification factor is 10, the cutoff wavelength is 80, and the color attenuation is 0.1;
[0044] The motion-amplified video is fed into a multi-task convolutional neural network for face recognition.
[0045] For the sub-video sequence where a face is recognized, facial feature points are detected to obtain the coordinate positions of 24 pixel points including eyes, nose, mouth and face contour;
[0046] The human face is cropped out based on the feature points of the first frame image of the sub-video sequence, and the frame image resolution is normalized to 224 pixels*224 pixels.
[0047] In a second aspect, the present invention further provides a facial micro-expression recognition device, comprising:
[0048] A video acquisition module is used to acquire the video of the micro-expression to be recognized;
[0049] A preprocessing module, used for preprocessing the video to obtain a long video sequence after motion amplification and resolution normalization;
[0050] A stride sampling module, used for performing stride sampling on the long video sequence to obtain a sub-video sequence of a preset length;
[0051] The classification module is used to input the sub-video sequence into a trained micro-expression recognition network to obtain a classification result of the facial micro-expression corresponding to the video.
[0052] In a third aspect, the present invention further provides an electronic device, comprising:
[0053] at least one memory and at least one processor;
[0054] The memory is used to store one or more programs;
[0055] When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of a facial micro-expression recognition method as described in any one of the first aspects of the present invention.
[0056] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a facial micro-expression recognition method as described in any one of the first aspects of the present invention are implemented.
[0057] The present invention provides a facial micro-expression recognition method, device, electronic device and storage medium, which use the Euler video magnification method to achieve action magnification, effectively enhancing the action characteristics of micro-expression videos; design a stride sampling method to achieve sample expansion, effectively avoiding the overfitting problem caused by deep learning in the training process; use a lightweight spatiotemporal combined neural network as the backbone spatiotemporal network to reduce the resource occupation of the model; design a local spatial difference stacking block to assist the neural network to pay attention to the facial area expressed by micro-expressions, effectively improving the accuracy of micro-expression recognition, and the method only needs to use micro-expression RGB features to reduce the calculation complexity of the model.
[0058] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A schematic diagram of a process flow of a facial micro-expression recognition method provided by the present invention;
[0060] Figure 2 A schematic diagram of the structure of a micro-expression recognition network used in one embodiment of the present invention;
[0061] Figure 3 A schematic diagram of a process of performing stride sampling on video data in one embodiment of the present invention;
[0062] Figure 4 A schematic diagram of the use process of the model of the present invention in one embodiment of the present invention;
[0063] Figure 5 The present invention provides a structural schematic diagram of a facial micro-expression recognition device. DETAILED DESCRIPTION
[0064] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0065] It should be clear that the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0066] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0067] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0068] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0069] In view of the problems in the background technology, the present application provides a facial micro-expression recognition method, such as Figure 1 As shown, the method comprises the following steps:
[0070] S01: Obtain a video of micro-expressions to be recognized.
[0071] S02: Preprocess the video to obtain a long video sequence after motion magnification and resolution normalization.
[0072] In a preferred embodiment, preprocessing the video includes:
[0073] S021: inputting the video into an Euler video magnification algorithm model to perform motion magnification, wherein the magnification factor is 10, the cutoff wavelength is 80, and the color attenuation is 0.1;
[0074] S022: Input the motion-amplified video into a multi-task convolutional neural network for face recognition;
[0075] S023: For the sub-video sequence in which a face is recognized, facial feature points are detected to obtain the coordinate positions of 24 pixel points including eyes, nose, mouth and facial contour;
[0076] S024: Cut out the face based on the feature points of the first frame image of the sub-video sequence as a standard, and normalize the frame image resolution to 224 pixels*224 pixels.
[0077] S03: Perform stride sampling on the long video sequence to obtain a sub-video sequence of a preset length.
[0078] In a preferred embodiment, performing stride sampling on the sub-video sequence comprises:
[0079] S031: Take the trimmed long video sequence as input, obtain the length L of the sequence, and divide the sequence into s segments of equal length, so that the length of each segment is T.
[0080] S032: Set a random seed according to the range of T and randomly select a frame from each fragment;
[0081] S033: and / or, extracting a peak frame from a segment where a peak frame appears in the video;
[0082] S034: Arrange the picture frames extracted from each segment in the order of the segments to obtain a sub-video sequence of length s;
[0083] S035: Repeat the above steps to get T s-1 sub-video sequences of equal length s.
[0084] S04: Inputting the sub-video sequence into a trained micro-expression recognition network to obtain a classification result of the facial micro-expression corresponding to the video.
[0085] In a preferred embodiment, Figure 2 As shown, the micro-expression recognition network includes a local spatial differential feature stacking block and a spatiotemporal feature extraction network.
[0086] Inputting the sub-video sequence into a trained micro-expression recognition network to obtain a classification result of facial micro-expressions corresponding to the video includes:
[0087] S041: inputting the sub-video sequence into the local spatial differential feature stacking block to obtain spatial features after local spatial enhancement;
[0088] S042: Inputting the spatial feature sequence after the local space enhancement into the spatiotemporal feature extraction network to obtain the classification result of the facial micro-expression of the video.
[0089] Preferably, the local spatial differential feature stacking block includes a stacking block, an average pooling layer, a first convolution layer, a first residual block, and an upsampling layer connected in sequence, and the output result of the upsampling layer is weighted with the output result of the second convolution layer and then input into the second residual block.
[0090] Inputting the sub-video sequence into the local spatial differential feature stacking block to obtain the spatial features after local spatial enhancement, including:
[0091] S0411: Input each frame in the sub-video sequence into the second convolutional layer to extract an original spatial feature map sequence corresponding to the sub-video sequence;
[0092] S0412: Input each frame in the sub-video sequence into the stacking block to obtain differential features of the sub-video sequence;
[0093] S0413: Inputting the differential features into the average pooling layer to obtain reduced-dimensional differential features;
[0094] S0414: inputting the dimension-reduced differential features into the first convolutional layer and the first residual block in sequence to obtain differential spatial feature parameters;
[0095] S0415: Inputting the differential spatial feature parameters into the upsampling layer to obtain differential spatial features of the same dimension as the original spatial features;
[0096] S0416: summing and weighting the original spatial feature and the differential spatial feature;
[0097] S0417: Input the weighted spatial features into the second residual block to obtain spatial features after local spatial enhancement.
[0098] Preferably, the spatiotemporal feature extraction network includes a VGGFace network, a temporal convolutional network and a classification layer connected in sequence, and the classification layer uses a central loss function and a regularization method to calculate the classification results of the facial micro-expressions of the video.
[0099] S0421: Inputting the spatial feature sequence after the local space enhancement into the spatiotemporal feature extraction network to obtain the classification result of the facial micro-expression of the video, including:
[0100] S0422: Input the spatial feature sequence after the local spatial enhancement into the VGGFace network, and output feature vector X=[x1, x2, ...x s ], whose dimension size is (s,512):
[0101] S0423: The feature vector X=[x1,x2,...x s ] Input the temporal convolutional network to extract temporal features and obtain the spatial temporal information Eigenvector;
[0102] S0424: The spatial time sequence information The feature vector is input into the classification layer and is calculated by the central loss function to obtain the classification result of the facial micro-expression of the video.
[0103] The present invention provides a facial micro-expression recognition method, which designs a stride sampling method to achieve sample expansion, effectively avoiding the overfitting problem caused by deep learning in the training process, and effectively improving the accuracy of micro-expression recognition.
[0104] In a specific embodiment, Figure 4 As shown, a facial micro-expression recognition method provided by the present invention includes a stride sampling design, a local spatial difference stacking block design and a spatiotemporal feature extraction network framework design.
[0105] 1. Stride sampling design.
[0106] 1.1 Video Action Zoom
[0107] Through the Euler video magnification method, when the magnification factor is 10, the cutoff wavelength is 80, and the color attenuation is 0.1, the action rules are weighted calculated based on the video motion trajectory, thereby increasing the video data after the facial motion intensity.
[0108] 1.2 Face Recognition
[0109] The multi-task convolutional neural network is used to perform face recognition on the motion-amplified video data. If the face is not recognized during the recognition process, the sample needs to be cleaned before the next sample is recognized. The video data that successfully recognizes the face needs to detect the facial feature points. The facial feature points are the coordinate positions of 24 pixel points including the eyes, nose, mouth and facial contour.
[0110] 1.3 Face cropping
[0111] After obtaining the facial feature points, the video data must be cropped according to the coordinates of the feature points. To avoid the displacement of the face position in the video, each segment of video data is always cropped out based on the feature points of the first frame image, and the frame image resolution is normalized to 224 pixels * 224 pixels.
[0112] 1.4 Stride Sampling
[0113] like Figure 3 As shown, Figure 3 The implementation process of stride sampling is to take the trimmed long video sequence as input, obtain the length L of the sequence, and evenly divide the sequence into s segments of equal length, and let the length of each segment be T. Then the relationship between L, s, and T is:
[0114]
[0115] The stride sampling method sets a random seed according to the range of T, randomly selects a frame from each segment to represent the motion characteristics of the segment, and only extracts the peak frame in the segment where the peak frame of the video appears to form a new subsequence. The stride sampling method designed by the present invention can split a long video sequence into a maximum of T s-1 subsequences of equal length s.
[0116] 2. Local spatial differential stacking block design.
[0117] The implementation process of the local spatial difference stacking block is as follows Figure 2 As shown, the input long video sequence is v j =[I1,I2...,I s ], each frame in the sequence is first extracted through the convolution layer to the corresponding original spatial feature map sequence F j =[F1,F2...,F s ], and then the spatial features of each frame are enhanced through the spatial difference stacking block, the formula is:
[0118] F i '=R(F i +H(I i )) (2)
[0119] R(x)=Activation(resblock(x)+x) (3)
[0120] The R(x) function described by formula (3) represents the residual calculation, and the H(I i ) function is the working principle of the local spatial feature stacking block, H(I i ) is defined as follows:
[0121] Diff i =concate(I i -I i-1 ,I i+1 -I i ) (4)
[0122] Q(I i )=R(Conv(DownSample(Diff i ))) (5)
[0123] H(I i )=Upsample(Q(I i )) (6)
[0124] Formula (4) indicates that in the local spatial difference stacking block, each frame must calculate the difference between the RGB features of the two adjacent frame images before and after it, where i represents the index number of the frame in the video sequence, I i represents the RGB features of the corresponding frame, concate represents the channel stacking function, and the difference between two adjacent frames is obtained by stacking the number of channels. i The parameter represents the local area where the image has undergone motion changes. i The parameter uses the DownSample function representing the average pooling layer in formula (5) to reduce the feature dimension of the difference. The difference feature after dimension reduction will continue to be deeply understood through the Conv function representing the first convolutional layer and the R(x) function representing the first residual block to obtain the spatial feature parameter Q(I i ). Finally, Q(I i ) is reshaped into the original image spatial feature F through the upsampling layer Upsample i The same dimension is then used to sum and weight the original image spatial features. The weighted spatial features are finally passed through a layer of residual blocks to obtain the spatial features F that enhance the local spatial features. i '.
[0125] 3. Design of spatiotemporal feature extraction network framework.
[0126] The network framework for spatiotemporal feature extraction is designed to extract the spatial feature sequence F' after local spatial enhancement j =[F1',F2',...F s '] as input, and then further complete spatial and temporal feature extraction is performed through a lightweight backbone spatiotemporal network model composed of VGGFace and temporal convolutional network, as shown in the attached figure. Figure 2 shown.
[0127] 3.1 Spatial feature extraction
[0128] Spatial feature extraction is to use the VGGFace network model to obtain the feature sequence F' j =[F1',F2',...F s '] spatial feature map parameters. In the process of spatial feature extraction, input feature sequence F' j =[F1',F2',...F s '] is specified by the convolutional neural network with a feature dimension of (112,112,3). VGGFace is pre-trained on a large-scale face dataset, and two fully connected layers with dimensions of 1028 and 512 are added to the tail of the network, and a dropout layer with a sampling threshold of 0.5 is fine-tuned so that the final output of each frame is a 512-dimensional feature vector containing spatial information. Finally, the spatial feature extraction network outputs the output feature vector X=[x1,x2,...x s ], whose dimension size is (s,512).
[0129] 3.2 Temporal feature extraction
[0130] Time series feature extraction uses a time series convolutional network to obtain the feature vector X = [x1, x2, ...x s ] of the temporal feature map parameters. After spatial feature extraction, the backbone network framework selects a temporal convolutional network to learn the feature vector X = [x1, x2, ... x s ] The temporal convolutional network includes causal convolution, dilated convolution and residual block. When processing the entire feature sequence in parallel, weight sharing is implemented for each unit, thereby reducing the number of parameters of the entire network. For the input vector X of the temporal convolutional network, the output formula is as follows:
[0131]
[0132] Among them, Y represents the output vector of the last hidden layer of the temporal convolutional network. In formula (7) is the last feature unit output by the temporal convolutional network if and only if Contains the timing information of the entire sequence, so the output feature c of the timing feature extraction network uses The feature value of is 2048 in dimension, and the formula is as follows:
[0133]
[0134] 3.3 Center Loss Function
[0135] Contains spatial temporal information The feature vector is passed through the central loss function to obtain the classification result of the model for the micro-expression video features. After extracting the spatiotemporal features, the backbone network uses the central loss function to predict the feature category of the micro-expression. The general loss function L of the multi-classification method cross_entropy The equation is as follows:
[0136]
[0137] In formula (9), m and n represent the batch size and number of categories of video data under the same category, respectively, and i and j represent the batch index and category index of video data, respectively. i represents the eigenvector of the input loss function, e represents a natural constant, the log function represents logarithmic calculation, and y i is the true label provided by the dataset for the current sample, y i ∈{1,2,...n}, W represents the weight of the fully connected layer, and b is the bias. In the implementation process, n is set to 5. The central loss function L is used to increase the class distance between different categories of data. Then, the central feature L is added to the multi-classification function. center , the formula is as follows:
[0138]
[0139] L=L cross_entropy +λL center (11)
[0140] In formula (10), c yi Represents y i The central feature position of the category data during the model training process. λ in formula (11) is the weighted correlation coefficient of the central loss. Finally, all video data are trained according to the central loss function until the loss value converges. Finally, the network model outputs the best results for the five classifications of facial micro-expression videos: happiness, surprise, sadness, fear, and disgust.
[0141] Based on the above-designed stride sampling method and the designed micro-expression recognition network, the training steps of the micro-expression recognition network used in the present invention include:
[0142] S21: Obtain micro-expression video data;
[0143] S22: Preprocessing and striding sampling the micro-expression video data to obtain a sub-video sequence data set of a preset length;
[0144] S23: dividing the data set into a training set, a validation set and a test set, and training the micro-expression recognition network;
[0145] S24: using the validation set to select parameters of the micro-expression recognition network, and using the test set to verify the performance of the micro-expression recognition network corresponding to different parameters, to obtain a trained micro-expression recognition network.
[0146] Based on the above-trained micro-expression recognition network, in a specific embodiment, the step of identifying the classification result of the facial micro-expression corresponding to a micro-expression video includes:
[0147] 1. Action amplification: Input a micro-expression video into the Euler video amplification algorithm model and perform action amplification with a magnification factor of 10.
[0148] 2. Face alignment and cropping: Input a sub-video sequence into the face detection model for detection and cropping to 224 pixels * 224 pixels.
[0149] 3. Video frame sampling: Use the stride sampling model to sample the amplified motion video to obtain a sub-video sequence of length 8.
[0150] 4. Model inference: Input the processed sub-video sequence into the trained model to obtain the five-category results of facial micro-expressions.
[0151] The present application also provides a facial micro-expression recognition device. Figure 5 As shown, the Chinese fine-grained entity recognition device 400 includes:
[0152] Video acquisition module 401, used to acquire a video of a micro-expression to be recognized;
[0153] A preprocessing module 402 is used to preprocess the video to obtain a long video sequence after motion magnification and resolution normalization;
[0154] A stride sampling module 403 is used to perform stride sampling on the long video sequence to obtain a sub-video sequence of a preset length;
[0155] The classification module 404 is used to input the sub-video sequence into the trained micro-expression recognition network to obtain the classification result of the facial micro-expression corresponding to the video.
[0156] The present application also provides an electronic device, including:
[0157] at least one memory and at least one processor;
[0158] The memory is used to store one or more programs;
[0159] When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of the facial micro-expression recognition method as described above.
[0160] The present application also provides a computer-readable storage medium.
[0161] The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the facial micro-expression recognition method as described above are implemented.
[0162] The present invention provides a facial micro-expression recognition method, device, electronic device and storage medium, which use the Euler video magnification method to achieve action magnification, effectively enhancing the action characteristics of micro-expression videos; design a stride sampling method to achieve sample expansion, effectively avoiding the overfitting problem caused by deep learning in the training process; use a lightweight spatiotemporal combined neural network as the backbone spatiotemporal network to reduce the resource occupation of the model; design a local spatial difference stacking block to assist the neural network to pay attention to the facial area expressed by micro-expressions, effectively improving the accuracy of micro-expression recognition, and the method only needs to use micro-expression RGB features to reduce the calculation complexity of the model.
[0163] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A facial micro-expression recognition method, It is characterized in that The following steps are involved: Obtain the video of the micro-expression to be recognized; Preprocessing the video to obtain a long video sequence after motion magnification and resolution normalization; Performing stride sampling on the long video sequence to obtain a sub-video sequence of a preset length; Inputting the sub-video sequence into a trained micro-expression recognition network, the micro-expression recognition network includes a local spatial differential feature stacking block and a spatiotemporal feature extraction network, and obtaining a classification result of the facial micro-expression corresponding to the video, including: Inputting the sub-video sequence into the local spatial differential feature stacking block to obtain a spatial feature after local spatial enhancement; Inputting the spatial feature sequence after the local space enhancement into the spatiotemporal feature extraction network to obtain the classification result of the facial micro-expression of the video; The local spatial differential feature stacking block includes a stacking block, an average pooling layer, a first convolutional layer, a first residual block, and an upsampling layer connected in sequence, and the output result of the upsampling layer and the output result of the second convolutional layer are weighted and input into the second residual block; Inputting the sub-video sequence into the local spatial differential feature stacking block to obtain the spatial features after local spatial enhancement, including: Input each frame in the sub-video sequence into the second convolutional layer to extract the original spatial feature map sequence corresponding to the sub-video sequence; Input each frame in the sub-video sequence into the stacking block to obtain differential features of the sub-video sequence; Inputting the differential features into the average pooling layer to obtain reduced-dimensional differential features; Inputting the dimension-reduced differential features into the first convolutional layer and the first residual block in sequence to obtain differential spatial feature parameters; Inputting the differential spatial feature parameters into the upsampling layer to obtain differential spatial features of the same dimension as the original spatial features; The original spatial feature and the differential spatial feature are summed and weighted; Inputting the weighted spatial features into the second residual block to obtain spatial features after local spatial enhancement; The spatiotemporal feature extraction network includes a VGGFace network, a temporal convolutional network and a classification layer connected in sequence, and the classification layer uses a central loss function and a regularization method to calculate the classification result of the facial micro-expression of the video; Inputting the spatial feature sequence after the local space enhancement into the spatiotemporal feature extraction network to obtain the classification result of the facial micro-expression of the video, including: The spatial feature sequence after local spatial enhancement is input into the VGGFace network, and the output feature vector X representing the spatial information is [x 1 ,x 2 ,...x s ], whose dimension size is (s,512): The feature vector X = [x 1 ,x 2 ,...x s ] Input the temporal convolutional network to extract temporal features and obtain the spatial temporal information Eigenvector; The spatial temporal information The feature vector is input into the classification layer and is calculated by the central loss function to obtain the classification result of the facial micro-expression of the video.
2. A facial micro-expression recognition method according to claim 1, It is characterized in that The training steps of the micro-expression recognition network include: Get micro-expression video data; Preprocessing and striding sampling the micro-expression video data to obtain a sub-video sequence data set of a preset length; Dividing the data set into a training set, a validation set and a test set, and training the micro-expression recognition network; The validation set is used to select parameters of the micro-expression recognition network, and the test set is used to test the performance of the micro-expression recognition network corresponding to different parameters to obtain a trained micro-expression recognition network.
3. A facial micro-expression recognition method according to claim 1, It is characterized in that The step sampling of the sub-video sequence includes: Take the trimmed long video sequence as input, obtain the length L of the sequence, and divide the sequence into s segments of equal length, so that the length of each segment is T. Set a random seed according to the range of T and randomly select a frame from each fragment; and / or, extracting peak frames from a peak frame occurrence segment of the video; Arrange the image frames extracted from each segment in the order of the segments to obtain a sub-video sequence of length s; Repeat the above steps to get T s-1 sub-video sequences of equal length s.
4. A facial micro-expression recognition method according to claim 3, It is characterized in that Preprocessing the video includes: Input the video into the Euler video magnification algorithm model for action magnification, wherein the magnification factor is 10, the cutoff wavelength is 80, and the color attenuation is 0.1; The motion-amplified video is fed into a multi-task convolutional neural network for face recognition. For the sub-video sequence where a face is recognized, facial feature points are detected to obtain the coordinate positions of 24 pixel points including eyes, nose, mouth and face contour; The human face is cropped out based on the feature points of the first frame image of the sub-video sequence, and the frame image resolution is normalized to 224 pixels*224 pixels.
5. A facial micro-expression recognition device for executing a facial micro-expression recognition method as claimed in any one of claims 1 to 4, It is characterized in that include: A video acquisition module is used to acquire the video of the micro-expression to be recognized; A preprocessing module, used for preprocessing the video to obtain a long video sequence after motion amplification and resolution normalization; A stride sampling module, used for performing stride sampling on the long video sequence to obtain a sub-video sequence of a preset length; The classification module is used to input the sub-video sequence into a trained micro-expression recognition network to obtain a classification result of the facial micro-expression corresponding to the video.
6. An electronic device, It is characterized in that include: at least one memory and at least one processor; The memory is used to store one or more programs; When the one or more programs are executed by the at least one processor, the at least one processor implements the steps of a facial micro-expression recognition method as described in any one of claims 1-4.
7. A computer-readable storage medium, Features: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a facial micro-expression recognition method as described in any one of claims 1 to 4 are implemented.
