Micro-expression recognition method, system, device and storage medium based on KNN and DSN

Through the micro-expression recognition method based on KNN and DSN, the spatio-temporal features of micro-expressions are extracted and reconstructed, which solves the problem of low micro-expression recognition accuracy in the existing technology and achieves higher recognition accuracy and automatic feature extraction.

CN114140848BActive Publication Date: 2024-09-17CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111434496.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-29
Publication Date
2024-09-17
Estimated Expiration
2041-11-29

AI Technical Summary

Technical Problem

Existing micro-expression recognition methods have problems with low accuracy in feature extraction and classification, especially because they rely on a single feature dimension and cannot fully represent the rich features of micro-expressions, resulting in low recognition accuracy.

Method used

Micro-expression recognition methods based on KNN and DSN are used to extract the spatio-temporal features of micro-expression images, and use the nearest neighbor module and deep stacking network module to reconstruct and classify features. Combining spatio-temporal features and adjacent matrices, the micro-expression features are achieved Deep analysis and correlation feature extraction.

Benefits of technology

It improves the accuracy of micro-expression recognition, reduces the influence of human subjective factors, is suitable for applications in different scenarios, and enhances the accuracy of recognition through fully automated feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140848B
    Figure CN114140848B
Patent Text Reader

Abstract

The present invention designs artificial intelligence technology and proposes a micro-expression recognition method, system, device and storage medium based on KNN and DSN, including: extracting features from a micro-expression image to be recognized and obtaining the spatiotemporal features of micro-expressions; inputting the micro-expression image to be recognized into the nearest neighbor module of the micro-expression recognition model, obtaining the adjacent matrix corresponding to the micro-expression sample points in the micro-expression image to be recognized, and reconstructing with the spatiotemporal features of the micro-expressions to obtain the reconstructed features; inputting the reconstructed features into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expressions in the micro-expression image to be recognized. The present invention fully utilizes the characteristics of the micro-expression image that the micro-expression image has large changes in time and space and contains rich information by extracting the spatiotemporal features of the micro-expression image, which is beneficial to the subsequent micro-expression recognition; reconstructing features through the spatiotemporal features of the micro-expression and the adjacent matrix of the micro-expression sample points, realizing the correlation features between the sample data and improving the recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a micro-expression recognition method, system, device and storage medium based on KNN and DSN. Background Art

[0002] As a direct reflection of human emotions, facial expressions have always been one of the most important research directions in the field of computer vision. In the past few decades of research, academia and industry have achieved great success in the field of expression recognition. In expression recognition, spontaneous expressions are irrepressible and cannot be forged. They reflect the true thoughts of human beings. They have great application value in risk control and claims, judicial interrogation and psychological information, and have gradually become a research hotspot this year.

[0003] Compared with general facial expressions, micro-expressions have many characteristics, last for a short time, have small fluctuations in facial texture changes, and generally only appear on the upper and lower faces. Therefore, it is very difficult to classify and identify micro-expressions. The feature extraction and classification algorithms generally used for micro-expressions include the facial action coding system, which uses pre-defined codes to represent facial action units for identification and classification; based on the time-frequency domain of micro-expressions, based on the triangulated time domain coding model, and annotated through the main performance model for further identification.

[0004] These traditional micro-expression methods usually rely on a large number of positive specimens, add subjective factors, cannot actively extract features, and will consume a lot of manpower and material resources. In addition, due to the complex features of micro-expressions, they cannot achieve good classification results. In recent years, thanks to the great breakthroughs made by deep learning in pattern recognition, image classification and other fields, it has also been applied to the classification and recognition of micro-expressions. Based on the characteristics of micro-expressions with temporal features, temporal networks such as long short-term memory networks (LSTM) and temporal convolutional networks (TCN) are used to extract their temporal features for classification and recognition. Based on facial texture features, action unit amplification is used to enhance the spatial features of micro-expressions, and convolutional neural networks (CNN) are combined for classification and recognition. Expression recognition based on deep learning can automatically extract multi-dimensional features, but the current model only uses a single feature dimension and cannot fully represent the rich features of micro-expressions, resulting in low accuracy in subsequent micro-expression recognition. Summary of the invention

[0005] The present invention provides a micro-expression recognition method, system, device and storage medium based on KNN and DSN, the main purpose of which is to extract rich features in micro-expression images and effectively improve the micro-expression recognition accuracy.

[0006] In a first aspect, an embodiment of the present invention provides a micro-expression recognition method based on KNN and DSN, comprising:

[0007] Extract features from the micro-expression images to be identified and obtain the spatiotemporal features of micro-expressions;

[0008] Input the micro-expression image to be recognized into the nearest neighbor module of the micro-expression recognition model, obtain the adjacent matrix corresponding to the micro-expression sample points in the micro-expression image to be recognized, and reconstruct it with the micro-expression spatiotemporal features to obtain the reconstructed features;

[0009] The reconstructed features are input into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expression in the micro-expression image to be recognized, wherein the micro-expression recognition model is trained by samples and labels, and the micro-expression recognition model is composed of the nearest neighbor module and the deep stacked network module connected in sequence.

[0010] Preferably, the deep stacked network module is composed of several layers of deep stacked networks connected in series, wherein the deep stacked network is composed of an input layer, a hidden layer and an output layer connected in sequence, and for the current deep stacked network, the input of the current deep stacked network is the reconstructed feature concatenated with the output of all deep stacked networks before the current deep stacked network.

[0011] Preferably, the input of the current deep stacked network is obtained by concatenating the reconstructed features with the outputs of all deep stacked networks before the current deep stacked network, including:

[0012] When i>2, the input of the i-th deep stacked network input layer is the reconstructed features and the output of the first i-2 deep stacked networks, and the input of the i-th deep stacked network hidden layer is the output of the i-th deep stacked network input layer and the output of the i-1-th deep stacked network;

[0013] When i=2, the input of the second deep stacked network input layer is the reconstructed feature, and the input of the second deep stacked network hidden layer is the output of the second deep stacked network input layer and the output of the first deep stacked network;

[0014] When i=1, the input of the first deep stacked network input layer is the reconstructed feature, and the input of the first deep stacked network hidden layer is the output of the first deep stacked network input layer.

[0015] Preferably, the specific training method of the micro-expression recognition model is a gradient descent method in batch mode.

[0016] Preferably, the step of extracting features from the micro-expression image to be identified and obtaining the spatiotemporal features of micro-expressions specifically includes:

[0017] Dividing the micro-expression image to be recognized into a plurality of image blocks;

[0018] Based on the local binary pattern algorithm of three orthogonal planes, the local binary pattern features of each image block are calculated;

[0019] The local binary pattern features of all image blocks are spliced ​​to obtain the micro-expression spatiotemporal features.

[0020] Preferably, the micro-expression spatiotemporal features are reconstructed to obtain the reconstructed features, and the calculation formula is as follows:

[0021]

[0022]

[0023] in, represents the reconstructed feature, i and j are positive integers, x i represents the i-th sample of the spatiotemporal feature of the micro-expression, x j represents the jth sample of the adjacent matrix, k represents the preset dimension of the adjacent matrix, w(x j , x i ) represents the weight function, Z represents the standardized score, d represents the k-nearest distance calculation function, and K is the preset value.

[0024] Preferably, the step of extracting features from the micro-expression image to be identified and obtaining the spatiotemporal features of micro-expressions further comprises:

[0025] Extracting features from the micro-expression image to be identified and normalizing it;

[0026] The features extracted after normalization are used as the micro-expression spatiotemporal features.

[0027] In a second aspect, an embodiment of the present invention provides a micro-expression recognition system based on KNN and DSN, comprising:

[0028] A feature extraction module is used to extract features from the micro-expression image to be identified and obtain the spatiotemporal features of the micro-expression;

[0029] A feature reconstruction module, used for inputting the micro-expression image to be identified into the nearest neighbor module of the micro-expression recognition model, obtaining the adjacent matrix corresponding to the micro-expression sample points in the micro-expression image to be identified, and reconstructing it with the micro-expression spatiotemporal features to obtain the reconstructed features;

[0030] The recognition module is used to input the reconstructed features into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expression in the micro-expression image to be recognized, wherein the micro-expression recognition model is trained by samples and labels, and the micro-expression recognition model is composed of the nearest neighbor module and the deep stacked network module connected in sequence.

[0031] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned micro-expression recognition method based on KNN and DSN when executing the computer program.

[0032] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned micro-expression recognition method based on KNN and DSN are implemented.

[0033] The present invention proposes a micro-expression recognition method, system, device and storage medium based on KNN and DSN, which extracts the temporal and spatial features of the micro-expression image to be recognized, fully utilizes the characteristics of the micro-expression image that the micro-expression image varies greatly in time and space and contains rich information, realizes in-depth analysis of the micro-expression features, effectively extracts useful features, and is conducive to subsequent micro-expression recognition; and reconstructs features through the micro-expression spatiotemporal features and the adjacent matrix of micro-expression sample points, which can realize the correlation features between sample data to further improve the recognition accuracy; and the method is a fully automatic micro-expression recognition method, which can automatically extract expression features, reduce the influence of human subjective factors, and has stronger application in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 An application scenario diagram of a micro-expression recognition method based on KNN and DSN provided in an embodiment of the present invention;

[0035] Figure 2 A flowchart of a micro-expression recognition method based on KNN and DSN provided in an embodiment of the present invention;

[0036] Figure 3 Schematic diagram of the connection structure of three deep stacked networks in an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of the structure of a micro-expression recognition system based on KNN and DSN provided in an embodiment of the present invention;

[0038] Figure 5The present invention is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.

[0039] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0040] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0041] Figure 1 An application scenario diagram of a micro-expression recognition method based on KNN and DSN provided in an embodiment of the present invention, such as Figure 1 As shown, the user inputs a micro-expression image to be recognized on the client, and after the client extracts the micro-expression image to be recognized, it transmits the micro-expression image to be recognized to the server. After the server receives the micro-expression image to be recognized, it executes the micro-expression recognition method based on KNN and DSN to recognize the micro-expressions in the micro-expression image to be recognized.

[0042] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0043] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0044] It should be noted that the server can be implemented by an independent server or a server cluster composed of multiple servers. The client can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The client and the server can be connected via Bluetooth, USB (Universal Serial Bus) or other communication connection methods, which is not limited in the embodiments of the present invention.

[0045] Figure 2 A flowchart of a micro-expression recognition method based on KNN and DSN is provided in an embodiment of the present invention, such as Figure 2 As shown, the method includes:

[0046] S210, extracting features of the micro-expression image to be recognized to obtain spatiotemporal features of the micro-expression;

[0047] First, multiple frames of video images that need to be recognized are obtained, and each frame of video image is used as a micro-expression image to be recognized. The micro-expression image to be recognized is a three-dimensional image. Micro-expression images, as a kind of high-dimensional data, contain multiple complex features such as time or space. Micro-expressions generally last for a short time, and facial features change greatly over time and space. Extracting the spatiotemporal features of the micro-expression image to be recognized can make full use of the characteristics of micro-expression images that vary greatly over time and space and contain rich spatiotemporal information, and realize in-depth analysis of expression features.

[0048] The temporal features and spatial features of the micro-expression image are extracted, specifically: according to different time granularities, a time axis is generated, and then the temporal features are extracted according to the changes in micro-expressions at different time points; the spatial features of the image refer to the relationship between a pixel point or a target in the image and other pixels or targets in space, including relative spatial position relationship and absolute spatial position relationship, etc. In the embodiment of the present invention, the temporal and spatial features can be extracted by LBP_TOP (local binary patterns from three orthogonal planes, referred to as local binary patterns based on three orthogonal planes) algorithm, or by a neural network method in machine learning, specifically including extraction of temporal and spatial features based on a convolutional long short-term memory network (convolutional Long Short-Term Memory, referred to as ConvLSTM) model, extraction of temporal and spatial features based on a 3D convolutional neural network (Convolutional Neural Networks, referred to as CNN), etc. The specific extraction method is determined according to the actual situation, and the embodiment of the present invention will not be repeated here.

[0049] In the embodiment of the present invention, by extracting the spatiotemporal features of the micro-expression image to be identified, the characteristics of the micro-expression image that vary greatly over time and space and contain rich spatiotemporal characteristics are fully utilized, thereby achieving in-depth analysis of the expression features, effectively extracting useful features, and facilitating the subsequent improvement of the recognition effect of micro-expressions.

[0050] S220, inputting the micro-expression image to be recognized into a nearest neighbor module of a micro-expression recognition model, obtaining a neighbor matrix corresponding to micro-expression sample points in the micro-expression image to be recognized, and reconstructing the matrix with the micro-expression spatiotemporal features to obtain a reconstructed feature;

[0051] The micro-expression image to be identified is input into the nearest neighbor module of the micro-expression recognition model. The nearest neighbor module is specifically implemented by KNN (K-NearestNeighbor, referred to as K nearest neighbor algorithm). First, the micro-expression image to be identified is sampled to obtain micro-expression sample points, and all distances between the micro-expression sample points and other sample points are calculated. The K sample points closest to the micro-expression sample point are taken out. The specific value of K can be determined according to the actual situation. Then, the classification ratios to which the K sample points belong are counted, that is, which categories the K sample points belong to, and the sample ratio corresponding to each category is how much, so as to judge the specific category of the micro-expression sample point. In the embodiment of the present invention, the micro-expression categories may include happiness, disgust, depression, surprise, etc., which are specifically determined according to the actual situation. For the same micro-expression sample point, its category is calculated in different frames of micro-expression images to be identified, so as to obtain the adjacent matrix Ωi={xj,…,xk} of the micro-expression sample point, x j Represents the micro-expression sample point x i The coordinates of the category, x k Indicates the coordinates of the category to which the micro-expression sample point in the subsequent frame micro-expression image belongs.

[0052] When calculating the distance between a micro-expression sample point and other sample points, the distance calculation formula used may be the Euclidean distance, the Mahalanobis distance, etc. In the embodiment of the present invention, the Euclidean distance calculation method is selected to obtain the adjacent matrix Ωi.

[0053] Then, the micro-expression spatiotemporal features and the adjacent matrix are reconstructed, and the adjacent matrix and the micro-expression spatiotemporal features are combined to obtain the reconstructed features. The specific reconstruction method can be to fuse the micro-expression spatiotemporal features and the adjacent matrix, or to splice the micro-expression spatiotemporal features and the adjacent matrix, which is not specifically limited in the embodiment of the present invention.

[0054] In the embodiment of the present invention, by combining the spatiotemporal features of micro-expressions with the adjacent matrix, the correlation features between sample data can be realized, which is convenient for subsequent training and learning, and further improves the recognition accuracy.

[0055] S230, inputting the reconstructed features into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expression in the micro-expression image to be recognized, wherein the micro-expression recognition model is trained by samples and labels, and the micro-expression recognition model is composed of the nearest neighbor module and the deep stacked network module connected in sequence.

[0056] The reconstructed features are input into the deep stacking network module of the micro-expression recognition model. The deep stacking network module is a deep learning network. Through the previous training process, the DNN (Deep Stacking Network) can realize the classification and recognition of micro-expressions based on the reconstructed features, and finally output the category through the softmax classifier.

[0057] Specifically, the micro-expression recognition model in the embodiment of the present invention is composed of a nearest neighbor module and a deep stacked network module connected in sequence. Before use, the micro-expression recognition model is trained with samples and labels, and the parameters of the micro-expression recognition model are continuously adjusted. When the recognition error meets the preset expectations, the training can be stopped to finally obtain the optimal model parameters.

[0058] The micro-expression recognition model in the embodiment of the present invention is a type of neural network. Before using the micro-expression recognition model, it also needs to be trained. The micro-expression recognition model is trained through pre-acquired samples and labels. The training process of the micro-expression recognition model can be divided into three steps: defining the structure of the micro-expression recognition model and the output results of the forward propagation; defining the loss function and the back-propagation optimization algorithm; and finally generating a session and repeatedly running the back-propagation optimization algorithm on the training data.

[0059] Among them, neurons are the smallest units that constitute neural networks. A neuron can have multiple inputs and one output. The input of each neuron can be the output of other neurons or the input of the entire neural network. The output of the neural network is the weighted sum of the inputs of all neurons. The weights of different inputs are the neuron parameters. The optimization process of the neural network is the process of optimizing the values ​​of neuron parameters.

[0060] The effect of the neural network and the optimization goal are defined by the loss function, which gives the calculation formula for the difference between the output of the neural network and the true label. Supervised learning is a way of training neural networks. The idea is that the results given by the neural network should be as close to the true answer (i.e., label) as possible on the labeled data set with known answers. The training data is fitted by adjusting the parameters in the neural network, so that the neural network can provide prediction capabilities for unknown samples.

[0061] The back propagation algorithm implements an iterative process. At the beginning of each iteration, a portion of the training data is first taken and the prediction result of the neural network is obtained through the forward propagation algorithm. Because the training data has the correct answer, the gap between the predicted result and the correct answer can be calculated. Based on this gap, the back propagation algorithm will update the value of the neural network parameters accordingly to make it closer to the real answer.

[0062] After completing the training process through the above method, the trained micro-expression recognition model can be used for application.

[0063] The embodiments of the present invention can be applied in an intelligent damage assessment system, which can achieve intelligent injury quotation and refined management and control of personal injury costs through intelligent information acquisition and intelligent loss determination. In the intelligent damage assessment system, by combining micro-expression recognition technology, the acceptance degree of the current compensation plan and emotional fluctuations of the negotiating parties can be accurately identified, and timely and flexible adjustments can be made to facilitate the signing of a mediation plan.

[0064] The embodiment of the present invention proposes a micro-expression recognition method based on KNN and DSN, which extracts the temporal and spatial features of the micro-expression image to be recognized, fully utilizes the characteristics of the micro-expression image that the micro-expression image varies greatly in time and space and contains rich information, realizes in-depth analysis of micro-expression features, effectively extracts useful features, and is conducive to subsequent micro-expression recognition; and reconstructs features through the micro-expression spatiotemporal features and the adjacent matrix of micro-expression sample points, which can realize the correlation features between sample data to further improve the recognition accuracy; and this method is a fully automatic micro-expression recognition method, which can automatically extract expression features, reduce the influence of human subjective factors, and has stronger application in different scenarios.

[0065] Based on the above embodiments, preferably, the deep stacked network module is composed of several layers of deep stacked networks connected in series, wherein the deep stacked network is composed of an input layer, a hidden layer and an output layer connected in sequence, and for the current deep stacked network, the input of the current deep stacked network is the reconstructed feature concatenated with the output of all deep stacked networks before the current deep stacked network.

[0066] Specifically, the deep stacked network module is composed of several deep stacked networks connected in series, each of which includes an input layer, a hidden layer and an output layer, which are connected in sequence. In the input layer of the deep stacked network, a group of linear neurons are included to correspond to the input samples, and the hidden layer is based on a nonlinear function to realize the feature mapping from the input layer to the hidden layer, which is mathematically expressed as:

[0067]

[0068] Among them, w1 represents the weight matrix from the input layer to the hidden layer. For the input vector matrix x i , add a bias term at the end, its value is 1, f represents a nonlinear function, and takes RULE.

[0069] The output layer is a linear combination of the hidden layers, and its mathematical expression is:

[0070]

[0071] Among them, U is the weight matrix from the hidden layer to the output layer.

[0072] The input dimension Dm of the input layer of the current deep stacked network module can be expressed as:

[0073] D m =D+C(m-1), m=1...3,

[0074] Where C is the number of neuron nodes in the output layer, and m represents the number of stacked blocks. The training parameters corresponding to the neurons in the current hidden layer will also expand as the input dimension expands, and its mathematical expression is:

[0075] W=(D+C(m-1))×L,

[0076] Among them, L represents another dimension of the training weight matrix.

[0077] In an embodiment of the present invention, the input of the current deep stacked network is obtained by splicing the reconstructed features with the outputs of all deep stacked networks before the current deep stacked network. Such a structure can achieve maximum retention of micro-expression spatiotemporal features, thereby completing forward propagation, which is beneficial to improving the subsequent micro-expression recognition accuracy.

[0078] Based on the above embodiment, preferably, the input of the current deep stacked network is obtained by concatenating the reconstructed feature with the outputs of all deep stacked networks before the current deep stacked network, including:

[0079] When i>2, the input of the i-th deep stacked network input layer is the reconstructed features and the output of the first i-2 deep stacked networks, and the input of the i-th deep stacked network hidden layer is the output of the i-th deep stacked network input layer and the output of the i-1-th deep stacked network;

[0080] When i=2, the input of the second deep stacked network input layer is the reconstructed feature, and the input of the second deep stacked network hidden layer is the output of the second deep stacked network input layer and the output of the first deep stacked network;

[0081] When i=1, the input of the first deep stacked network input layer is the reconstructed feature, and the input of the first deep stacked network hidden layer is the output of the first deep stacked network input layer.

[0082] Specifically, the embodiment of the present invention takes the deep stacking network module including three deep stacking networks as an example for explanation. Figure 3 Schematic diagram of the connection structure of three deep stacked networks in an embodiment of the present invention. Figure 3As shown, for the deep stacked network, the first layer is the input layer, the middle layer is the hidden layer, and the last layer is the output layer. For multiple deep stacked networks in the deep stacked network module, the reconstructed features are transmitted backward from the first deep stacked network. Generally speaking, as the position of the deep stacked network becomes more and more backward, the deep stacked network forgets more and more information contained in the reconstructed features. However, in the embodiment of the present invention, by splicing the reconstructed features and the output of the previous deep stacked network and inputting them into the subsequent deep stacked network, the spatiotemporal features of micro-expressions can be guaranteed to the maximum extent, thereby improving the subsequent micro-expression recognition accuracy.

[0083] Based on the above embodiments, preferably, the specific training method of the micro-expression recognition model is a gradient descent method in batch mode.

[0084] The parameter update of the deep stacked network module in the embodiment of the present invention is based on the gradient descent method in batch mode, which is different from the general neural network. The deep stacked network module adopts independent supervised training for each deep stacked network. After the current deep stacked network training is completed, the next deep stacked network training learning is carried out. No global fine-tuning is required to achieve feature training of the entire deep stacked network module network.

[0085] At the beginning of the deep stacked network module, the weight matrix is ​​randomly initialized. According to the error between the actual output and the target output, the weight matrix of each stacked block is adjusted by back propagation. The loss function is:

[0086] E=Tr[(YT)(YT) T ],

[0087] Among them, Tr is the trace of the matrix, T is the target output, and Y is the actual output.

[0088] Based on the above embodiment, preferably, the step of extracting features from the micro-expression image to be identified and obtaining the spatiotemporal features of micro-expressions specifically includes:

[0089] Dividing the micro-expression image to be recognized into a plurality of image blocks;

[0090] Based on the local binary patterns from three orthogonal planes (LBP_TOP) algorithm, the local binary pattern features of each image block are calculated;

[0091] The local binary pattern features of all image blocks are spliced ​​to obtain the micro-expression spatiotemporal features.

[0092] The embodiment of the present invention extracts micro-expression spatiotemporal features based on local binary patterns of three orthogonal planes. In order to better extract the micro-expression spatiotemporal features, the micro-expression image to be identified is divided into several image blocks. In the embodiment of the present invention, the image blocks are divided into b*b image blocks.

[0093] And create three-dimensional feature coordinates xy, xt and yt, where xy represents the texture features of the image, xt represents the time features, and yt represents the spatial features. The LBP value is calculated for each coordinate plane of each image block, and then all LBP histograms are spliced. The specific splicing method is to splice the LBP values ​​of each surface to obtain the final micro-expression spatiotemporal features.

[0094] The specific calculation formula of the LBP_TOP algorithm is as follows:

[0095]

[0096] Wherein, j represents the coordinate dimension, j=0 represents xy, j=1 represents xt, and j=2 represents yt; n j represents the number of binary patterns obtained by LBP on the jth orthogonal plane, f j represents the LBP value of the center point of the region on the jth orthogonal plane, and I is the preset threshold.

[0097] Based on the above embodiment, preferably, the micro-expression spatiotemporal features are reconstructed to obtain the reconstructed features, and the calculation formula is as follows:

[0098]

[0099]

[0100] in, represents the reconstructed feature, i and j are positive integers, x i represents the i-th sample of the spatiotemporal feature of the micro-expression, x j represents the jth sample of the adjacent matrix, k represents the preset dimension of the adjacent matrix, w(x j , x i ) represents the weight function, Z represents the standardized score, d represents the k-nearest distance calculation function, and K is the preset value.

[0101] In the embodiment of the present invention, a Gaussian kernel function is used as a weight function to smooth the kernel, remove smooth data and details, and realize expression data noise reduction. The Gaussian kernel function is specifically as follows:

[0102]

[0103] Among them, Ω irepresents the adjacent matrix of the i-th micro-expression sample point in the micro-expression image to be identified, and σ represents the bandwidth of the Gaussian kernel function.

[0104] Based on the above embodiment, preferably, the step of extracting features from the micro-expression image to be identified and obtaining the spatiotemporal features of micro-expressions further includes:

[0105] Extracting features from the micro-expression image to be identified and normalizing it;

[0106] The features extracted after normalization are used as the micro-expression spatiotemporal features.

[0107] In order to better calculate, the spatiotemporal features of micro-expressions are normalized. The specific calculation formula is as follows:

[0108]

[0109] Among them, X ij Represents the spatiotemporal characteristics of micro-expressions.

[0110] Normalization can turn data into decimals between (0, 1) or (1, 1). It is mainly proposed for the convenience of data processing. Mapping data to the range of 0 to 1 for processing is more convenient and faster.

[0111] In summary, the micro-expression recognition method based on KNN and DSN proposed in the embodiment of the present invention, by extracting the temporal and spatial features of the micro-expression image to be identified, fully utilizes the characteristics of micro-expression images that vary greatly in time and space and contain rich information, realizes in-depth analysis of micro-expression features, and effectively extracts useful features, which is conducive to subsequent micro-expression recognition; and reconstructs features through the micro-expression spatiotemporal features and the adjacent matrix of micro-expression sample points, which can realize the correlation features between sample data to further improve the recognition accuracy; and this method is a fully automatic micro-expression recognition method, which can automatically extract expression features, reduce the influence of human subjective factors, and has stronger application in different scenarios.

[0112] Moreover, in the embodiment of the present invention, by splicing the reconstructed features and the output of the previous deep stacked network and inputting them into the subsequent deep stacked network, the spatiotemporal characteristics of micro-expressions can be guaranteed to the greatest extent, thereby improving the subsequent micro-expression recognition accuracy.

[0113] Finally, the parameter update of the deep stacked network module in the embodiment of the present invention is based on the gradient descent method in batch mode, which is different from the general neural network. In the gradient descent method based on batch mode, the deep stacked network module adopts independent supervision training for each deep stacked network. After the current deep stacked network training is completed, the next deep stacked network training learning is carried out. There is no need for global fine-tuning to achieve feature training of the entire deep stacked network module network, thereby improving the training speed and reducing the time required for training.

[0114] Figure 4 A schematic diagram of a micro-expression recognition system based on KNN and DSN is provided in an embodiment of the present invention, as shown in FIG. Figure 4 As shown, the system includes a feature extraction module 410, a feature reconstruction module 420 and a recognition module 430, wherein:

[0115] The feature extraction module 410 is used to extract features from the micro-expression image to be identified and obtain the spatiotemporal features of the micro-expression;

[0116] The feature reconstruction module 420 is used to input the micro-expression image to be identified into the nearest neighbor module of the micro-expression recognition model, obtain the adjacent matrix corresponding to the micro-expression sample points in the micro-expression image to be identified, and reconstruct it with the micro-expression spatiotemporal features to obtain the reconstructed features;

[0117] The recognition module 430 is used to input the reconstructed features into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expression in the micro-expression image to be recognized, wherein the micro-expression recognition model is trained by samples and labels, and the micro-expression recognition model is composed of the nearest neighbor module and the deep stacked network module connected in sequence.

[0118] This embodiment is a system embodiment corresponding to the above method embodiment, and its specific implementation process is the same as the above method embodiment. For details, please refer to the above method embodiment, and this system embodiment will not be repeated here.

[0119] On the basis of the above embodiments, preferably, in the recognition module, the deep stacked network module is composed of several layers of deep stacked networks connected in series, wherein the deep stacked network is composed of an input layer, a hidden layer and an output layer connected in sequence, and for the current deep stacked network, the input of the current deep stacked network is the reconstructed feature concatenated with the output of all deep stacked networks before the current deep stacked network.

[0120] Based on the above embodiment, preferably, in the recognition module, the input of the current deep stacked network is obtained by concatenating the reconstructed feature with the outputs of all deep stacked networks before the current deep stacked network, including:

[0121] When i>2, the input of the i-th deep stacked network input layer is the reconstructed features and the output of the first i-2 deep stacked networks, and the input of the i-th deep stacked network hidden layer is the output of the i-th deep stacked network input layer and the output of the i-1-th deep stacked network;

[0122] When i=2, the input of the second deep stacked network input layer is the reconstructed feature, and the input of the second deep stacked network hidden layer is the output of the second deep stacked network input layer and the output of the first deep stacked network;

[0123] When i=1, the input of the first deep stacked network input layer is the reconstructed feature, and the input of the first deep stacked network hidden layer is the output of the first deep stacked network input layer.

[0124] On the basis of the above embodiment, preferably, in the recognition module, the specific training method of the micro-expression recognition model is a gradient descent method in batch mode.

[0125] On the basis of the above embodiment, preferably, the feature extraction module includes a segmentation unit, a local binary unit and a splicing unit, wherein:

[0126] The segmentation unit is used to divide the micro-expression image to be identified into a plurality of image blocks;

[0127] The local binary unit is used to calculate the local binary pattern features of each image block based on the local binary patterns from three orthogonal planes (local binary patterns from three orthogonal planes, referred to as LBP_TOP) algorithm;

[0128] The splicing unit is used to splice the local binary pattern features of all image blocks to obtain the micro-expression spatiotemporal features.

[0129] Based on the above embodiment, preferably, in the feature reconstruction unit, the micro-expression spatiotemporal feature is reconstructed with the micro-expression spatiotemporal feature to obtain the reconstructed feature, and the calculation formula is as follows:

[0130]

[0131]

[0132] in, represents the reconstructed feature, i and j are positive integers, x i represents the i-th sample of the spatiotemporal feature of the micro-expression, x j represents the jth sample of the adjacent matrix, k represents the preset dimension of the adjacent matrix, w(x j, x i ) represents the weight function, Z represents the standardized score, d represents the k-nearest distance calculation function, and K is the preset value.

[0133] Based on the above embodiment, preferably, in the feature extraction unit, the feature extraction of the micro-expression image to be identified to obtain the spatiotemporal features of the micro-expression also includes

[0134] Extracting features from the micro-expression image to be identified and normalizing it;

[0135] The features extracted after normalization are used as the micro-expression spatiotemporal features.

[0136] In summary, the micro-expression recognition system based on KNN and DSN proposed in the embodiment of the present invention, by extracting the temporal and spatial features of the micro-expression image to be identified, fully utilizes the characteristics of micro-expression images that vary greatly in time and space and contain rich information, realizes in-depth analysis of micro-expression features, effectively extracts useful features, and is conducive to subsequent micro-expression recognition; and reconstructs features through the micro-expression spatiotemporal features and the adjacent matrix of micro-expression sample points, which can realize the correlation features between sample data to further improve the recognition accuracy; and this method is a fully automatic micro-expression recognition method, which can automatically extract expression features, reduce the influence of human subjective factors, and has stronger application in different scenarios.

[0137] Moreover, in the embodiment of the present invention, by splicing the reconstructed features and the output of the previous deep stacked network and inputting them into the subsequent deep stacked network, the spatiotemporal characteristics of micro-expressions can be guaranteed to the greatest extent, thereby improving the subsequent micro-expression recognition accuracy.

[0138] Finally, the parameter update of the deep stacked network module in the embodiment of the present invention is based on the gradient descent method in batch mode, which is different from the general neural network. In the gradient descent method based on batch mode, the deep stacked network module adopts independent supervision training for each deep stacked network. After the current deep stacked network training is completed, the next deep stacked network training learning is carried out. There is no need for global fine-tuning to achieve feature training of the entire deep stacked network module network, thereby improving the training speed and reducing the time required for training.

[0139] Each module in the above-mentioned micro-expression recognition system based on KNN and DSN can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0140] Figure 5FIG. 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the computer storage medium. The database of the computer device is used to store data generated or obtained during the execution of the micro-expression recognition method based on KNN and DSN, such as micro-expression images to be recognized, reconstructed features, and micro-expression categories. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a micro-expression recognition method based on KNN and DSN is implemented.

[0141] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the micro-expression recognition method based on KNN and DSN in the above embodiment are implemented. Alternatively, when the processor executes the computer program, the functions of each module / unit in the embodiment of the micro-expression recognition system based on KNN and DSN are implemented.

[0142] In one embodiment, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the micro-expression recognition method based on KNN and DSN in the above embodiment are implemented. Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above embodiment of the micro-expression recognition system based on KNN and DSN are implemented.

[0143] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0144] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0145] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A micro-expression recognition method based on KNN and DSN, characterized in that: include: Extract features from the micro-expression images to be identified and obtain the spatiotemporal features of micro-expressions; Input the micro-expression image to be recognized into the nearest neighbor module of the micro-expression recognition model, obtain the adjacent matrix corresponding to the micro-expression sample points in the micro-expression image to be recognized, and reconstruct it with the micro-expression spatiotemporal features to obtain the reconstructed features; Inputting the reconstructed features into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expression in the micro-expression image to be recognized, wherein the micro-expression recognition model is trained by samples and labels, and the micro-expression recognition model is composed of the nearest neighbor module and the deep stacked network module connected in sequence; The deep stacked network module is composed of several layers of deep stacked networks connected in series, wherein the deep stacked network is composed of an input layer, a hidden layer and an output layer connected in sequence, and for the current deep stacked network, the input of the current deep stacked network is the concatenation of the reconstructed features and the outputs of all the deep stacked networks before the current deep stacked network; The input of the current deep stacked network is obtained by concatenating the reconstructed features with the outputs of all deep stacked networks before the current deep stacked network, including: When i>2, the input of the i-th deep stacked network input layer is the reconstructed features and the output of the first i-2 deep stacked networks, and the input of the i-th deep stacked network hidden layer is the output of the i-th deep stacked network input layer and the output of the i-1-th deep stacked network; When i=2, the input of the second deep stacked network input layer is the reconstructed feature, and the input of the second deep stacked network hidden layer is the output of the second deep stacked network input layer and the output of the first deep stacked network; When i=1, the input of the first deep stacked network input layer is the reconstructed feature, and the input of the first deep stacked network hidden layer is the output of the first deep stacked network input layer.

2. The micro-expression recognition method based on KNN and DSN according to claim 1, characterized in that: The specific training method of the micro-expression recognition model is the gradient descent method in batch mode.

3. The micro-expression recognition method based on KNN and DSN according to claim 1, characterized in that: The step of extracting features from the micro-expression image to be identified and obtaining the spatiotemporal features of the micro-expression specifically includes: Dividing the micro-expression image to be recognized into a plurality of image blocks; Based on the local binary pattern algorithm of three orthogonal planes, the local binary pattern features of each image block are calculated; The local binary pattern features of all image blocks are spliced ​​to obtain the micro-expression spatiotemporal features.

4. The micro-expression recognition method based on KNN and DSN according to any one of claims 1 to 3, characterized in that: The micro-expression spatiotemporal features are reconstructed to obtain the reconstructed features, and the calculation formula is as follows: in, represents the reconstructed feature, i and j are positive integers, x i represents the i-th sample of the spatiotemporal feature of the micro-expression, x j represents the jth sample of the adjacent matrix, k represents the preset dimension of the adjacent matrix, w(x j , x i ) represents the weight function, Z represents the standardized score, d represents the k-nearest distance calculation function, and K is the preset value.

5. The micro-expression recognition method based on KNN and DSN according to any one of claims 1 to 3, characterized in that: The step of extracting features from the micro-expression image to be identified and obtaining the spatiotemporal features of micro-expressions also includes: Extracting features from the micro-expression image to be identified and normalizing it; The features extracted after normalization are used as the micro-expression spatiotemporal features.

6. A micro-expression recognition system based on KNN and DSN, characterized in that: include: A feature extraction module is used to extract features from the micro-expression image to be identified and obtain the spatiotemporal features of the micro-expression; A feature reconstruction module, used for inputting the micro-expression image to be identified into the nearest neighbor module of the micro-expression recognition model, obtaining the adjacent matrix corresponding to the micro-expression sample points in the micro-expression image to be identified, and reconstructing it with the micro-expression spatiotemporal features to obtain the reconstructed features; A recognition module, used for inputting the reconstructed features into the deep stacked network module of the micro-expression recognition model to obtain the category of the micro-expression in the micro-expression image to be recognized, wherein the micro-expression recognition model is trained by samples and labels, and the micro-expression recognition model is composed of the nearest neighbor module and the deep stacked network module connected in sequence; The deep stacked network module is composed of several layers of deep stacked networks connected in series, wherein the deep stacked network is composed of an input layer, a hidden layer and an output layer connected in sequence, and for the current deep stacked network, the input of the current deep stacked network is the concatenation of the reconstructed features and the outputs of all the deep stacked networks before the current deep stacked network; The input of the current deep stacked network is obtained by concatenating the reconstructed features with the outputs of all deep stacked networks before the current deep stacked network, including: When i>2, the input of the i-th deep stacked network input layer is the reconstructed features and the output of the first i-2 deep stacked networks, and the input of the i-th deep stacked network hidden layer is the output of the i-th deep stacked network input layer and the output of the i-1-th deep stacked network; When i=2, the input of the second deep stacked network input layer is the reconstructed feature, and the input of the second deep stacked network hidden layer is the output of the second deep stacked network input layer and the output of the first deep stacked network; When i=1, the input of the first deep stacked network input layer is the reconstructed feature, and the input of the first deep stacked network hidden layer is the output of the first deep stacked network input layer.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the micro-expression recognition method based on KNN and DSN are implemented as described in any one of claims 1 to 5.

8. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the micro-expression recognition method based on KNN and DSN as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Human intention understanding method based on deep stacking Bi-LSTM for man-machine cooperation

    CN110717381A

  • Method for identifying drug addiction attack of a drug addict based on facial expression feature analysis

    CN113128387A