Micro-expression recognition method and system based on sparse self-attention mechanism

Through the sparse self-attention mechanism and motion amplification network, the motion change characteristics of micro-expressions are extracted, which solves the problems of amplifying noise and deformation in the existing technology and improves the accuracy and adaptability of micro-expression recognition.

CN114743235BActive Publication Date: 2024-10-18SOUTHEAST UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202210196086.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-01
Publication Date
2024-10-18
Estimated Expiration
2042-03-01

AI Technical Summary

Technical Problem

Existing micro-expression recognition technology easily introduces noise and deformation during the amplification process, resulting in low recognition accuracy. Moreover, traditional methods are difficult to adapt to individual differences, resulting in insufficient or excessive amplification, which affects the recognition results.

Method used

A micro-expression recognition method based on the sparse self-attention mechanism is adopted to amplify the intensity of micro-expressions through the motion amplification network, and the sparse self-attention module is used to extract motion change features from spatial features, combined with resnet-18, feature splicing layer and full The connection layer performs identification and reduces hyperparameter settings.

Benefits of technology

It improves the accuracy of micro-expression recognition, reduces artificially set hyperparameters, has stronger adaptability, and more accurate recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114743235B_ABST
    Figure CN114743235B_ABST
Patent Text Reader

Abstract

The present invention discloses a micro-expression recognition method and system based on a sparse self-attention mechanism, the method comprising: (1) obtaining a micro-expression database; (2) converting a micro-expression video into a micro-expression image sequence and preprocessing it; (3) amplifying the micro-expression intensity of the preprocessed micro-expression image sequence using a motion amplification network to obtain an enhanced micro-expression image sequence; (4) establishing a micro-expression recognition network, the micro-expression recognition network comprising a resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer; (5) training the micro-expression recognition network; (6) processing the micro-expression video to be recognized in accordance with steps (2) and (3) in sequence, and inputting the trained micro-expression recognition network to obtain the corresponding micro-expression category. The present invention has a higher recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to expression recognition technology, and in particular to a micro-expression recognition method and system based on a sparse self-attention mechanism. Background Art

[0002] Micro-expressions are facial expressions that humans inadvertently reveal when they try to hide or suppress their true inner emotions. They are not controlled by human subjective consciousness. Micro-expressions are important non-verbal signals for detecting hidden emotions in humans. They can usually effectively reveal a person's true psychological state. They are considered to be key clues for identifying lies and play an important role in better understanding human emotions. Therefore, the effective use of micro-expressions plays an important role in social production and life. In criminal investigation, interrogators who have undergone certain micro-expression recognition training can better identify the lies of criminal suspects; in social security, by observing micro-expressions, dangerous elements lurking in daily life can be judged to prevent terrorism and riots; in clinical medicine, through micro-expressions, doctors can better understand the patient's true thoughts, such as hiding the disease, etc., so as to communicate with the patient more effectively, analyze the disease more accurately, and improve the treatment plan. However, the training cost of manual recognition of micro-expressions is high and it is difficult to promote on a large scale. Therefore, in recent years, the demand for micro-expression recognition using computer vision technology and artificial intelligence methods has increased.

[0003] Since micro-expressions involve low-intensity motion, traditional recognition tasks use amplification methods to amplify the intensity of micro-expressions before feature extraction, such as Euler video amplification, Lagrangian amplification, etc. These methods easily introduce noise and spots during the amplification process, and the restoration effect on other areas of the image is not ideal. In recent years, the development of deep networks has entered various aspects such as image, speech, and natural language processing, and learning-based motion amplification methods have gradually increased. Compared with traditional manual methods, deep learning methods have better image reconstruction effects.

[0004] Both the traditional magnification method and the deep learning-based magnification method face the following problem: the facial structures of people vary greatly, and the muscle movements involved in the presentation of expressions are also different. If a uniform magnification intensity is applied to all samples, it is likely that some micro-expressions will not be magnified sufficiently, and some will be magnified too much, resulting in facial deformation. The magnified image obtained in this way is likely to affect the subsequent recognition results, and the recognition accuracy needs to be improved. Summary of the invention

[0005] Purpose of the invention: In view of the problems existing in the prior art, the present invention provides a micro-expression recognition method and system based on a sparse self-attention mechanism with higher recognition accuracy.

[0006] Technical solution: The micro-expression recognition method based on the sparse self-attention mechanism described in the present invention includes:

[0007] (1) obtaining a micro-expression database, wherein the micro-expression database contains a plurality of micro-expression videos and corresponding micro-expression category labels;

[0008] (2) Convert each micro-expression video in the database into a micro-expression image sequence and pre-process the micro-expression image sequence;

[0009] (3) A motion amplification network is used to amplify the intensity of micro-expressions in the preprocessed micro-expression image sequence to obtain an enhanced micro-expression image sequence;

[0010] (4) establishing a micro-expression recognition network, the micro-expression recognition network comprising resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer, wherein the resnet-18 is used to extract spatial features from the enhanced micro-expression image sequence, the sparse self-attention module is used to obtain motion change features from the spatial features, the feature splicing layer is used to splice the spatial features and the motion change features into comprehensive features and then input them into the first fully connected layer, the first fully connected layer and the second fully connected layer are used to reduce the dimension of the comprehensive features in turn, and the softmax layer is used to identify and classify according to the comprehensive features after the dimension reduction to obtain the micro-expression category;

[0011] (5) taking each enhanced micro-expression image sequence and the corresponding micro-expression category label as a sample and inputting it into the micro-expression recognition network for training to obtain a trained micro-expression recognition network;

[0012] (6) For the micro-expression video to be recognized, process it according to steps (2) and (3) in sequence, and input it into the trained micro-expression recognition network to obtain the corresponding micro-expression category.

[0013] Furthermore, the preprocessing in step (2) includes face registration and facial region clipping.

[0014] Furthermore, step (3) specifically includes:

[0015] Extract the starting frame I of the preprocessed micro-expression image sequence onset and peak frame I apex , and according to the starting frame I onset and peak frame I apex Use the motion amplification network to amplify the intensity of micro-expressions and obtain the enhanced micro-expression image sequence I mag :

[0016] I mag = {I mag,i}

[0017] I mag,i =f(I onset +(1+α i )|I apex -I onset |)

[0018] I mag,i is the image after the i-th frame image in the preprocessed micro-expression image sequence is enlarged, f(·) is the motion enlargement network, α i is the magnification of the i-th frame image, and the magnification increases from front to back according to the arrangement order of the micro-expression image sequence.

[0019] Furthermore, the sparse self-attention module specifically includes:

[0020] The basic matrix generation unit is used to generate the spatial feature F T The query matrix Q, key matrix K, and value matrix V of the self-attention matrix are calculated using the following formula:

[0021] Q=F T ×W Q

[0022] K=F T ×W K

[0023] V=F T ×W V

[0024] Where W Q , W K , W V are the corresponding weight matrices respectively;

[0025] Hyperplane generation unit, used to randomly generate n_rounds hyperplanes {h (1) ,h (2) ,…,h (n _rounds)}, n_rounds is a positive integer greater than 2; h (*) is the *th hyperplane;

[0026] The feature hash unit is used to divide the space into 2 (n_rounds) hash buckets based on the hyperplane, and the following formula is used to calculate the hash bucket into which each feature vector in Q and K falls respectively;

[0027]

[0028]

[0029]

[0030]

[0031] In the formula, q u , k v represents the uth and vth feature vectors in Q and K, length represents the number of frames of the enhanced micro-expression image sequence, h(q u )、h(k v ) indicates q u , k v The binary label of the hash bucket it falls into, a (j) 、b (j) It means h(q u )、h(k v )’s j-th bit value;

[0032] The feature sparse unit is used to retain only the index numbers of the feature vectors in Q and K that fall into the same hash bucket and store them in the sparse feature index set Ω u,v middle:

[0033] Ω u,v ={(u, v)|h(q u )=h(k v )}, u, v=1, 2,...,length

[0034] Sparse attention matrix calculation unit, used to index the feature set Ω i,j Calculate the sparse attention matrix Attention(Q, K, V):

[0035]

[0036] Where, d l The dimensions are Q, K, and V, and Attention(Q, K, V) is the feature of motion change.

[0037] Furthermore, the loss function used in training in step (5) is:

[0038]

[0039] Where C is the number of categories, c = 1, 2, ..., C, y c is the category label of micro-expression, p c is the probability of belonging to category c.

[0040] The micro-expression recognition system based on the sparse self-attention mechanism of the present invention comprises:

[0041] Micro-expression database, including several micro-expression videos and corresponding micro-expression category labels;

[0042] A preprocessing module, used to convert each micro-expression video in the database into a micro-expression image sequence, and preprocess the micro-expression image sequence;

[0043] An intensity amplification module is used to amplify the intensity of micro-expressions of the pre-processed micro-expression image sequence using a motion amplification network to obtain an enhanced micro-expression image sequence;

[0044] A micro-expression recognition network establishment module is used to establish a micro-expression recognition network, wherein the micro-expression recognition network includes resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer, wherein the resnet-18 is used to extract spatial features from an enhanced micro-expression image sequence, the sparse self-attention module is used to obtain motion change features from spatial features, the feature splicing layer is used to splice spatial features and motion change features into comprehensive features and then input them into the first fully connected layer, the first fully connected layer and the second fully connected layer are used to reduce the dimensionality of the comprehensive features in turn, and the softmax layer is used to identify and classify according to the comprehensive features after dimensionality reduction to obtain micro-expression categories;

[0045] A network training module is used to take each enhanced micro-expression image sequence and the corresponding micro-expression category label as a sample, input it into the micro-expression recognition network for training, and obtain a trained micro-expression recognition network;

[0046] The micro-expression recognition module is used to pre-process and amplify the micro-expression video to be recognized, and input it into the trained micro-expression recognition network to obtain the corresponding micro-expression category.

[0047] Furthermore, the preprocessing module is specifically used to convert each micro-expression video in the database into a micro-expression image sequence, and perform face registration and facial region clipping.

[0048] Furthermore, the intensity amplification module is specifically used to extract the starting frame I of the preprocessed micro-expression image sequence. onset and peak frame I apex , and according to the starting frame I onset and peak frame I apex Use the motion amplification network to amplify the intensity of micro-expressions and obtain the enhanced micro-expression image sequence I mag :

[0049] I mag = {I mag,i}

[0050] I mag,i =f(I onset +(1+α i )|I apex -I onset|)

[0051] I mag,i is the image after the i-th frame image in the preprocessed micro expression image sequence is enlarged, f(·) is the motion enlargement network, e i is the magnification of the i-th frame image, and the magnification increases from front to back according to the arrangement order of the micro-expression image sequence.

[0052] Furthermore, the sparse self-attention module specifically includes:

[0053] The basic matrix generation unit is used to generate the spatial feature F T The query matrix Q, key matrix K, and value matrix V of the self-attention matrix are calculated using the following formula:

[0054] Q=F T ×W Q

[0055] K=F T ×W K

[0056] V=F T ×W V

[0057] Where W Q , W K , W V are the corresponding weight matrices respectively;

[0058] Hyperplane generation unit, used to randomly generate n_rounds hyperplanes {h (1) ,h (2) ,…,h (n _rounds)}, n_rounds is a positive integer greater than 2; h (*) is the *th hyperplane;

[0059] Feature hashing unit, used to divide the space into two based on the hyperplane (n_rounds ) hash buckets, and use the following formula to calculate the hash bucket that each feature vector in Q and K falls into;

[0060]

[0061]

[0062]

[0063]

[0064] In the formula, q u , k vrepresents the uth and vth feature vectors in Q and K, length represents the number of frames of the enhanced micro-expression image sequence, h(q u )、h(k v ) indicates q u , k v The binary label of the hash bucket it falls into, a (j) 、b (j) It means h(q u )、h(k v )’s j-th bit value;

[0065] The feature sparse unit is used to retain only the index numbers of the feature vectors in Q and K that fall into the same hash bucket and store them in the sparse feature index set Ω u,v middle:

[0066] Ω u,v ={(u, v)|h(q u )=h(k v )}, u, v=1, 2,...,length

[0067] Sparse attention matrix calculation unit, used to index the feature set Ω i,j Calculate the sparse attention matrix Attention(Q, K, V):

[0068]

[0069] Where, d l The dimensions are Q, K, and V, and Attention(Q, K, V) is the feature of motion change.

[0070] Furthermore, the loss function used in the training of the network training module is:

[0071]

[0072] Where C is the number of categories, c = 1, 2, ..., C, y c is the category label of micro-expression, p c is the probability of belonging to category c.

[0073] Beneficial effect: Compared with the prior art, the present invention has the following significant advantages: the present invention has a higher recognition accuracy, reduces artificially set hyperparameters, and is more convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a flow chart of an embodiment of a micro-expression recognition method based on a sparse self-attention mechanism provided by the present invention;

[0075] Figure 2 It is a schematic diagram of micro-expression recognition;

[0076] Figure 3 It is a schematic diagram of the attention matrix sparsification process;

[0077] Figure 4 It is a schematic diagram of the locality sensitive hashing algorithm dividing the hyperplane and assigning hash buckets. DETAILED DESCRIPTION

[0078] This embodiment provides a micro-expression recognition method based on a sparse self-attention mechanism. Figure 1 As shown, the following steps are included:

[0079] (1) Obtain a micro-expression database, wherein the micro-expression database contains a plurality of micro-expression videos and corresponding micro-expression category labels.

[0080] Among them, the database can adopt three commonly used databases: CASME II, SAMM, and SMIC-HS.

[0081] (2) Convert each micro-expression video in the database into a micro-expression image sequence and preprocess the micro-expression image sequence.

[0082] Wherein, the preprocessing includes face registration and facial region clipping.

[0083] (3) The preprocessed micro-expression image sequence is amplified using a motion amplification network to obtain an enhanced micro-expression image sequence.

[0084] This step extracts the starting frame I of the preprocessed micro-expression image sequence onset and peak frame I apex , and according to the starting frame I onset and peak frame I apex Use the motion amplification network to amplify the intensity of micro-expressions and obtain the enhanced micro-expression image sequence I mag :

[0085] I mag = {I mag,i}

[0086] I mag,i =f(I onset +(1+α i )|I apex -I onset |)

[0087] I mag,i is the image after the i-th frame image in the preprocessed micro-expression image sequence is enlarged, f(·) is the motion enlargement network, α iis the magnification of the i-th frame image. The magnification increases from front to back according to the arrangement order of the micro-expression image sequence. In this way, the motion change will be more obvious, such as α1 = 1, α2 = 1.375, α3 = 1.75, ..., α 32 =13, we can get an enhanced micro-expression image sequence of 32 images.

[0088] (4) Establish a micro-expression recognition network, such as Figure 2 As shown, the micro-expression recognition network includes resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer, wherein the resnet-18 is used to extract spatial features from the enhanced micro-expression image sequence, the sparse self-attention module is used to obtain motion change features from the spatial features, the feature splicing layer is used to splice the spatial features and the motion change features into comprehensive features and then input them into the first fully connected layer, the first fully connected layer and the second fully connected layer are used to reduce the dimension of the comprehensive features in turn, and the softmax layer is used to identify and classify according to the comprehensive features after dimensionality reduction to obtain micro-expression categories.

[0089] The original self-attention mechanism mainly consists of three feature matrices: Q is used to match other information, K is used as the matched key value, and V is used to calculate the final information obtained. The acquisition of the attention matrix can be expressed as follows:

[0090]

[0091] in are the dimensions of the three feature vectors Q, K, and V.

[0092] However, due to the problem that the degree of magnification cannot be unified due to individual differences, using a consistent degree of magnification for all sequences will inevitably result in severe deformation of the facial image. In order to solve this problem, the present invention abandons the traditional attention mechanism algorithm, introduces sparseness restrictions when calculating the attention matrix, and uses a sparse self-attention module to extract motion change features, treating severe deformation as noise information, such as Figure 3 As shown. The sparse self-attention module extracts the spatial features F T The motion change features are obtained from the , including:

[0093] The basic matrix generation unit is used to generate the spatial feature F T The query matrix Q, key matrix K, and value matrix V of the self-attention matrix are calculated using the following formula:

[0094] Q=F T ×W Q

[0095] K=F T ×WK

[0096] V=F T ×W V

[0097] Where W Q , W K , W V are the corresponding weight matrices respectively;

[0098] Hyperplane generation unit, used to randomly generate n_rounds hyperplanes {h (1) ,h (2) ,…,h (n _rounds)}, n_rounds is a positive integer greater than 2; h (*) is the *th hyperplane; for example, when n rounds =3, use the random number generation function in Python, such as np.random.randn(3, 1024), which means generating three vectors of size 1×1024;

[0099] Feature hashing unit, used to divide the space into two based on the hyperplane (n_rounds) Hash buckets, such as Figure 4 As shown, the following formula is used to calculate the hash bucket into which each feature vector in Q and K falls respectively;

[0100]

[0101]

[0102]

[0103]

[0104] In the formula, q u , k v represents the uth and vth feature vectors in Q and K, with a size of 1×1024, and length represents the number of frames of the enhanced micro-expression image sequence. u )、h(k v ) indicates q u , k v The binary label of the hash bucket it falls into, a (j) 、b (j) It means h(q u )、h(k v )’s j-th bit value; for example, when n rounds =3, there are 8 hash buckets in total, if q u T h1>0,q uT h2<0,q u T h3>0, then h(q u ) can be recorded as 101;

[0105] The feature sparse unit is used to retain only the index numbers of the feature vectors in Q and K that fall into the same hash bucket and store them in the sparse feature index set Ω u,v middle:

[0106] Ω u,v ={(u, v)|h(q u )=h(k v )}, u, v=1, 2,...,length

[0107] The sparse feature index set is used to form a sparse attention matrix QK T , only the calculation results that fall into the same hash bucket are calculated. According to the characteristics of the local sensitive hashing algorithm, in this process, the similarity between the noise generated by amplification and other feature vectors carrying motion information is very low, which can be expressed as the distance between the two feature vectors being far in space. Therefore, the feature vector of the noise is likely to be hashed into a discrete hash bucket. If there is no corresponding vector in the hash bucket, it will appear as a zero value in the final attention matrix. Therefore, the index number of the feature vector that falls into the same hash bucket is finally retained;

[0108] Sparse attention matrix calculation unit, used to index the feature set Ω i,j Calculate the sparse attention matrix Attention(Q, K, V):

[0109]

[0110] Where, d l The dimensions are Q, K, and V, and Attention(Q, K, V) is the feature of motion change.

[0111] After obtaining the motion change features, the feature concatenation layer concatenates the spatial features and the motion change features into comprehensive features. Note that the motion change features are directly added after the spatial features, and then input into the first fully connected layer. The first and second fully connected layers successively reduce the dimensions of the comprehensive features. Then the softmax layer identifies and classifies them according to the comprehensive features after dimensionality reduction to obtain the micro-expression category.

[0112] (5) Each enhanced micro-expression image sequence and the corresponding micro-expression category label are taken as a sample and input into the micro-expression recognition network for training to obtain a trained micro-expression recognition network.

[0113] The loss function used during training is:

[0114]

[0115] Where C is the number of categories, c = 1, 2, ..., C, y c is the category label of micro-expression, p c is the probability of belonging to category c.

[0116] (6) For the micro-expression video to be recognized, process it according to steps (2) and (3) in sequence, and input it into the trained micro-expression recognition network to obtain the corresponding micro-expression category.

[0117] This embodiment also provides a micro-expression recognition system based on a sparse self-attention mechanism, including:

[0118] Micro-expression database, including several micro-expression videos and corresponding micro-expression category labels;

[0119] A preprocessing module, used to convert each micro-expression video in the database into a micro-expression image sequence, and preprocess the micro-expression image sequence;

[0120] An intensity amplification module is used to amplify the intensity of micro-expressions of the pre-processed micro-expression image sequence using a motion amplification network to obtain an enhanced micro-expression image sequence;

[0121] A micro-expression recognition network establishment module is used to establish a micro-expression recognition network, wherein the micro-expression recognition network includes resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer, wherein the resnet-18 is used to extract spatial features from an enhanced micro-expression image sequence, the sparse self-attention module is used to obtain motion change features from spatial features, the feature splicing layer is used to splice spatial features and motion change features into comprehensive features and then input them into the first fully connected layer, the first fully connected layer and the second fully connected layer are used to reduce the dimensionality of the comprehensive features in turn, and the softmax layer is used to identify and classify according to the comprehensive features after dimensionality reduction to obtain micro-expression categories;

[0122] A network training module is used to take each enhanced micro-expression image sequence and the corresponding micro-expression category label as a sample, input it into the micro-expression recognition network for training, and obtain a trained micro-expression recognition network;

[0123] The micro-expression recognition module is used to pre-process and amplify the micro-expression video to be recognized, and input it into the trained micro-expression recognition network to obtain the corresponding micro-expression category.

[0124] Furthermore, the preprocessing module is specifically used to convert each micro-expression video in the database into a micro-expression image sequence, and perform face registration and facial region clipping.

[0125] Furthermore, the intensity amplification module is specifically used to extract the starting frame I of the preprocessed micro-expression image sequence. onset and peak frame I apex , and according to the starting frame I onset and peak frame I apex Use the motion amplification network to amplify the intensity of micro-expressions and obtain the enhanced micro-expression image sequence I mag :

[0126] I mag = {I mag,i}

[0127] I mag,i =f(I onset +(1+α i )|I apex -I onset |)

[0128] I mag,i is the image after the i-th frame image in the preprocessed micro-expression image sequence is enlarged, f(·) is the motion enlargement network, α i is the magnification of the i-th frame image, and the magnification increases from front to back according to the arrangement order of the micro-expression image sequence.

[0129] Furthermore, the sparse self-attention module specifically includes:

[0130] The basic matrix generation unit is used to generate the spatial feature F T The query matrix Q, key matrix K, and value matrix V of the self-attention matrix are calculated using the following formula:

[0131] Q=F T ×W Q

[0132] K=F T ×W K

[0133] V=F T ×W V

[0134] Where W Q , W K , W V are the corresponding weight matrices respectively;

[0135] Hyperplane generation unit, used to randomly generate n_rounds hyperplanes {h (1) ,h (2) ,…,h (n _rounds)}, n_rounds is a positive integer greater than 2; h(*) is the *th hyperplane;

[0136] Feature hashing unit, used to divide the space into two based on the hyperplane (n_rounds) hash buckets, and use the following formula to calculate the hash bucket that each feature vector in Q and K falls into;

[0137]

[0138]

[0139]

[0140]

[0141] In the formula, q u , k v represents the uth and vth feature vectors in Q and K, length represents the number of frames of the enhanced micro-expression image sequence, h(q u )、h(k v ) indicates q u , k v The binary label of the hash bucket it falls into, a (j) 、b (j) It means h(q u )、h(k v )’s j-th bit value;

[0142] The feature sparse unit is used to retain only the index numbers of the feature vectors in Q and K that fall into the same hash bucket and store them in the sparse feature index set Ω u,v middle:

[0143] Ω u,v ={(u, v)|h(q u )=h(k v )}, u, v=1, 2,...,length

[0144] Sparse attention matrix calculation unit, used to index the feature set Ω i,j Calculate the sparse attention matrix Attention(Q, K, V):

[0145]

[0146] Where, d l The dimensions are Q, K, and V, and Attention(Q, K, V) is the feature of motion change.

[0147] Furthermore, the loss function used in the training of the network training module is:

[0148]

[0149] Where C is the number of categories, c = 1, 2, ..., C, y c is the category label of micro-expression, p c is the probability of belonging to category c.

[0150] To verify the effectiveness of the present invention, micro-expression recognition was performed between the CAME2 micro-expression database, the SAMM micro-expression database, and the HS sub-database of the SMIC database. The verification results and the comparison with other state-of-the-art methods are shown in Table 1:

[0151] Table 1

[0152] method years CASME2 SAMM SMIC-HS LBP-SIP 2014 45.36 36.76 42.12 MagGA 2018 63.30 N / A N / A DSSN 2019 70.78 57.35 63.41 TSCNN-I 2020 74.05 63.53 72.74 <![CDATA[LBPA CC P u2 ]]> 2021 69.03 N / A 76.59 This method 2021 81.06 77.61 79.88

[0153] In Table 1, N / A means there are no related records.

[0154] The expressions in the CASME2 database are processed as follows: categories with less than 10 samples are omitted to avoid serious sample imbalance. The recognition tasks of 5 categories are completed, namely happiness, regression, disgust, fear and surprise. The expressions in the SAMM database are processed as follows: categories with less than 10 samples are omitted to avoid serious sample imbalance. The recognition tasks of 5 categories are completed, namely happiness, anger, disgust, fear and surprise. The categories of the SMIC database itself are positive, negative and surprise, and the recognition tasks of three categories are completed.

[0155] The experimental results show that the micro-expression recognition method proposed by the present invention achieves a higher micro-expression recognition rate. Compared with the traditional micro-expression amplification method, the present invention can avoid the tedious manual setting of some hyperparameters, and is more adaptable and convenient to individuals.

[0156] The above disclosure is only a preferred embodiment of the present invention, which cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.

Claims

1. A micro-expression recognition method based on sparse self-attention mechanism, Features The method includes: (1) obtaining a micro-expression database, wherein the micro-expression database contains a plurality of micro-expression videos and corresponding micro-expression category labels; (2) Convert each micro-expression video in the database into a micro-expression image sequence and pre-process the micro-expression image sequence; (3) A motion amplification network is used to amplify the intensity of micro-expressions in the preprocessed micro-expression image sequence to obtain an enhanced micro-expression image sequence; (4) establishing a micro-expression recognition network, the micro-expression recognition network comprising resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer, wherein the resnet-18 is used to extract spatial features from the enhanced micro-expression image sequence, the sparse self-attention module is used to obtain motion change features from the spatial features, the feature splicing layer is used to splice the spatial features and the motion change features into comprehensive features and then input them into the first fully connected layer, the first fully connected layer and the second fully connected layer are used to reduce the dimension of the comprehensive features in turn, and the softmax layer is used to identify and classify according to the comprehensive features after the dimension reduction to obtain the micro-expression category; The sparse self-attention module specifically includes: The basic matrix generation unit is used to generate the spatial feature F T The query matrix Q, key matrix K, and value matrix V of the self-attention matrix are calculated using the following formula: Q=F T ×W Q K=F T ×W K V=F T ×W V Where W Q , W K , W V are the corresponding weight matrices respectively; Hyperplane generation unit, used to randomly generate n_rounds hyperplanes {h (1) ,h (2) ,…,h (n _rounds) }, n_rounds is a positive integer greater than 2; h (*) is the *th hyperplane; Feature hashing unit, used to divide the space into two based on the hyperplane (n_rounds) hash buckets, and use the following formula to calculate the hash bucket that each feature vector in Q and K falls into; In the formula, q u , k v represents the uth and vth feature vectors in Q and K, length represents the number of frames of the enhanced micro-expression image sequence, h(q u )、h(k v ) indicates q u , k v The binary label of the hash bucket it falls into, a (j) , b (j) It means h(q u )、h(k v )’s j-th bit value; The feature sparse unit is used to retain only the index numbers of the feature vectors in Q and K that fall into the same hash bucket and store them in the sparse feature index set Ω u,v middle: Ω u,v ={(u,v)|h(q u )=h(k v )},u,v=1,2,…,length Sparse attention matrix calculation unit, used to index the feature set Ω i,j Calculate the sparse attention matrix Attention(Q,K,V): Where, d l The dimensions are Q, K, and V. Attention (Q, K, V) is the feature of motion change. (5) taking each enhanced micro-expression image sequence and the corresponding micro-expression category label as a sample and inputting it into the micro-expression recognition network for training to obtain a trained micro-expression recognition network; (6) For the micro-expression video to be recognized, process it according to steps (2) and (3) in sequence, and input it into the trained micro-expression recognition network to obtain the corresponding micro-expression category.

2. The micro-expression recognition method based on the sparse self-attention mechanism according to claim 1, Features: The preprocessing in step (2) includes face registration and facial region clipping.

3. The micro-expression recognition method based on the sparse self-attention mechanism according to claim 1, Features: Step (3) specifically includes: Extract the starting frame I of the preprocessed micro-expression image sequence onset and peak frame I apex , and according to the starting frame I onset and peak frame I apex Use the motion amplification network to amplify the intensity of micro-expressions and obtain the enhanced micro-expression image sequence I mag : I mag ={I mag,i } I mag,i =f(I onset +(1+α i )|I apex -I onset |) I mag,i is the image after the i-th frame image in the preprocessed micro-expression image sequence is enlarged, f(·) is the motion amplification network, α i is the magnification of the i-th frame image, and the magnification increases from front to back according to the arrangement order of the micro-expression image sequence.

4. The micro-expression recognition method based on the sparse self-attention mechanism according to claim 1, Features: The loss function used in training in step (5) is: Where C is the number of categories, c = 1, 2, ..., C, y c is the category label of micro-expression, p c is the probability of belonging to category c.

5. A micro-expression recognition system based on sparse self-attention mechanism, Features include: Micro-expression database, including several micro-expression videos and corresponding micro-expression category labels; A preprocessing module, used to convert each micro-expression video in the database into a micro-expression image sequence, and preprocess the micro-expression image sequence; An intensity amplification module is used to amplify the intensity of micro-expressions of the pre-processed micro-expression image sequence using a motion amplification network to obtain an enhanced micro-expression image sequence; A micro-expression recognition network establishment module is used to establish a micro-expression recognition network, wherein the micro-expression recognition network includes resnet-18, a sparse self-attention module, a feature splicing layer, a first fully connected layer, a second fully connected layer and a softmax layer, wherein the resnet-18 is used to extract spatial features from an enhanced micro-expression image sequence, the sparse self-attention module is used to obtain motion change features from spatial features, the feature splicing layer is used to splice spatial features and motion change features into comprehensive features and then input them into the first fully connected layer, the first fully connected layer and the second fully connected layer are used to reduce the dimensionality of the comprehensive features in turn, and the softmax layer is used to identify and classify according to the comprehensive features after dimensionality reduction to obtain micro-expression categories; The sparse self-attention module specifically includes: The basic matrix generation unit is used to generate the spatial feature F T The query matrix Q, key matrix K, and value matrix V of the self-attention matrix are calculated using the following formula: Q=F T ×W Q K=F T ×W K V=F T ×W V Where W Q , W K , W V are the corresponding weight matrices respectively; Hyperplane generation unit, used to randomly generate n_rounds hyperplanes {h (1) ,h (2) ,…,h (n _rounds) }, n_rounds is a positive integer greater than 2; h (*) is the *th hyperplane; Feature hashing unit, used to divide the space into two based on the hyperplane (n_rounds) hash buckets, and use the following formula to calculate the hash bucket that each feature vector in Q and K falls into; In the formula, q u , k v represents the uth and vth feature vectors in Q and K, length represents the number of frames of the enhanced micro-expression image sequence, h(q u )、h(k v ) indicates q u , k v The binary label of the hash bucket it falls into, a (j) , b (j) It means h(q u )、h(k v )’s j-th bit value; The feature sparse unit is used to retain only the index numbers of the feature vectors in Q and K that fall into the same hash bucket and store them in the sparse feature index set Ω u,v middle: Ω u,v ={(u,v)|h(q u )=h(k v )},u,v=1,2,…,length Sparse attention matrix calculation unit, used to index the feature set Ω i,j Calculate the sparse attention matrix Attention(Q,K,V): Where, d l The dimensions are Q, K, and V. Attention (Q, K, V) is the feature of motion change. A network training module is used to take each enhanced micro-expression image sequence and the corresponding micro-expression category label as a sample, input it into the micro-expression recognition network for training, and obtain a trained micro-expression recognition network; The micro-expression recognition module is used to pre-process and amplify the micro-expression video to be recognized, and input it into the trained micro-expression recognition network to obtain the corresponding micro-expression category.

6. The micro-expression recognition system based on the sparse self-attention mechanism according to claim 5, Features: The preprocessing module is specifically used to convert each micro-expression video in the database into a micro-expression image sequence, and perform face registration and facial region clipping.

7. The micro-expression recognition system based on the sparse self-attention mechanism according to claim 5, Features: The intensity amplification module is specifically used to extract the starting frame I of the preprocessed micro-expression image sequence. onset and peak frame I apex , and according to the starting frame I onset and peak frame I apex Use the motion amplification network to amplify the intensity of micro-expressions and obtain the enhanced micro-expression image sequence I mag : I mag ={I mag,i } I mag,i =f(I onset +(1+α i )|I apex -I onset |) I mag,i is the image after the i-th frame image in the preprocessed micro-expression image sequence is enlarged, f(·) is the motion amplification network, α i is the magnification of the i-th frame image, and the magnification increases from front to back according to the arrangement order of the micro-expression image sequence.

8. The micro-expression recognition system based on the sparse self-attention mechanism according to claim 5, Features: The loss function used in the training of the network training module is: Where C is the number of categories, c = 1, 2, ..., C, y c is the category label of micro-expression, p c is the probability of belonging to category c.

Citation Information

Patent Citations

  • Deep convolutional neural network end-to-end based image retrieval method by layered deep searching

    CN106227851A

  • Modified local sensitive hash vehicle retrieval method based on multitask deep learning

    CN108108657A

  • Cross-library micro-expression recognition method and device based on optical flow attention neural network

    CN110516571A

  • Self-adaptive micro-expression recognition method based on attention mechanism

    CN113449661A

  • Facial expression recognition method and device based on capsule network

    CN113642540A