Facial expression recognition method and device based on multi-modal and multi-scale feature fusion
Through multi-modal and multi-scale feature fusion methods, attention and self-attention mechanisms are used to extract deep and shallow features, which solves the shortcomings of feature learning in deep learning models at a single resolution and improves the classification accuracy and accuracy of facial expression recognition. Positioning capabilities.
Patent Information
- Application Number
- CN202410699999.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-31
AI Technical Summary
The facial expression features extracted by deep learning models lack interpretability, and conventional deep learning networks cannot effectively pay attention to detailed features of different scales when learning features at a single resolution, resulting in limited classification capabilities.
The multi-modal and multi-scale feature fusion method is adopted to extract deep features through the attention mechanism and shallow features through the self-attention mechanism, and fuse and classify them to reduce the information loss of the original image and improve the classification accuracy and positioning ability of the network.
It improves the classification accuracy of facial expression recognition and the positioning ability of the network, enhances the auxiliary guidance role in extracting abstract expression features, and reduces the loss of original image information.
Smart Images

Figure CN118609183A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of facial expression recognition, and in particular relates to a facial expression recognition method and device based on multimodal and multiscale feature fusion. Background Art
[0002] In recent years, with the development of artificial intelligence (AI), particularly deep learning, a growing number of researchers are using deep learning to extract discriminative facial expression features, enabling expression recognition. Compared to manually designed facial features, features extracted by deep learning are generally more abstract, discriminative, and applicable.
[0003] However, models trained using deep learning often contain a large number of learnable parameters, and the updates to these parameters require a large amount of data. Therefore, the features extracted by deep learning techniques generally lack interpretability. On the other hand, conventional deep learning networks only introduce a single handcrafted feature: the location of facial landmarks. Learning and updating parameters for features at a single resolution lacks shallow surface features, and their auxiliary guidance for extracting abstract expression features is insufficient. Therefore, learning only features at a single resolution fails to encourage the network to focus on detailed features at different scales. Furthermore, conventional deep learning networks extract features from images of varying scales by first reducing the original image and then using super-resolution technology to construct magnified images of varying sizes. However, the magnification process results in a loss of information in the original image. Furthermore, the network's feature extraction capabilities, derived solely from deep learning, are unable to accurately locate key areas highly correlated with expression, thus impacting the network's ultimate classification capabilities. Summary of the Invention
[0004] In order to solve the above problems existing in the prior art, the present invention provides a facial expression recognition method and device based on multimodal and multiscale feature fusion. The technical problem to be solved by the present invention is achieved through the following technical solutions:
[0005] In a first aspect, the present invention provides a facial expression recognition method based on multimodal and multiscale feature fusion, comprising:
[0006] S100, obtaining an expression picture to be recognized and a trained facial expression recognition network;
[0007] S200, input the expression picture to be recognized into a trained facial expression recognition network, so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the expression picture to be recognized; uses an attention mechanism to extract deep features from abstract features and facial key point features of the same scale, and uses a self-attention mechanism to extract shallow features from facial edge features and facial texture features of the same scale, and fuses and classifies the deep features and shallow features to obtain the expression category to which the expression picture to be recognized belongs.
[0008] In a second aspect, the present invention provides a facial expression recognition device based on multimodal and multiscale feature fusion, comprising:
[0009] An acquisition module is configured to acquire an expression picture to be recognized and a trained facial expression recognition network;
[0010] The recognition module is configured to input the expression picture to be recognized into a trained facial expression recognition network so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the expression picture to be recognized; uses an attention mechanism to extract deep features from abstract features and facial key point features of the same scale, and uses a self-attention mechanism to extract shallow features from facial edge features and facial texture features of the same scale, and fuses and classifies the deep features and shallow features to obtain the expression category to which the expression picture to be recognized belongs.
[0011] Beneficial effects:
[0012] Compared with the existing technology 1, the present invention constructs a multimodal feature extraction method to fuse four facial features, namely abstract features, key point features, texture features and edge features, which can improve the auxiliary guiding role of artificial features in the extraction of abstract expression features in more dimensions, thereby improving the classification accuracy of the network to a greater extent.
[0013] Compared with prior art 2, this method extracts deep and shallow features by performing multi-scale feature fusion on the feature images of various resolutions output by the convolutional neural network, which can reduce the loss of original image information. At the same time, the attention mechanism enables the network to accurately locate key areas highly correlated with expressions, thereby improving the network's classification capabilities.
[0014] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of a facial expression recognition method based on multimodal and multiscale feature fusion provided by the present invention;
[0016] Figure 2It is a schematic diagram of the process of training a facial expression recognition network provided by the present invention;
[0017] Figure 3 It is a schematic diagram of the structure of the facial expression recognition network provided by the present invention;
[0018] Figure 4 Schematic diagram of the processing process of the deep attention feature extraction network provided by the present invention;
[0019] Figure 5 This is a schematic diagram of the processing process of the shallow self-attention feature extraction network provided by the present invention. DETAILED DESCRIPTION
[0020] The present invention will be further described in detail below with reference to specific examples, but the embodiments of the present invention are not limited thereto.
[0021] like Figure 1 As shown, the present invention provides a facial expression recognition method based on multimodal and multiscale feature fusion, including:
[0022] S100, obtaining an expression picture to be recognized and a trained facial expression recognition network;
[0023] S200, input the expression picture to be recognized into a trained facial expression recognition network, so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the expression picture to be recognized; uses an attention mechanism to extract deep features from abstract features and facial key point features of the same scale, and uses a self-attention mechanism to extract shallow features from facial edge features and facial texture features of the same scale, and fuses and classifies the deep features and shallow features to obtain the expression category to which the expression picture to be recognized belongs.
[0024] As a specific embodiment of the present invention, refer to Figure 2 The training process of the trained facial expression recognition network of the present invention includes:
[0025] a. Obtain an expression recognition dataset, wherein the expression recognition dataset includes multiple expression pictures carrying real category labels;
[0026] b. Selecting a training set and a test set from the facial expression recognition dataset;
[0027] c. performing data preprocessing on each expression picture in the training set and the test set to stretch the resolution of each expression picture to 224×224 to obtain a preprocessed expression picture;
[0028] d. Inputting the preprocessed expression picture into a preset facial expression recognition network, so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features, and facial texture features of the preprocessed expression picture; using an attention mechanism to extract deep features from the abstract features and facial key point features of the same scale, and using a self-attention mechanism to extract shallow features from the facial edge features and facial texture features of the same scale; fusing and classifying the deep features and shallow features extracted from the preprocessed expression picture to obtain a predicted expression category of the preprocessed expression picture;
[0029] e. comparing the predicted expression category of each pre-processed expression image with the true category label carried, and adjusting the internal parameters of the facial expression recognition network according to the comparison result;
[0030] f. Repeat d to e until the maximum number of training times is reached to obtain a trained facial expression recognition network.
[0031] The embodiment of the present invention obtains a training data set and a test data set from an expression recognition data set, and then constructs an abstract feature extraction network based on a convolutional neural network, a facial key point feature extraction network based on MobileFaceNet, a facial edge feature extraction network based on an edge detection method, and a facial texture feature extraction network based on a local binary pattern, respectively. Then, a deep attention feature extraction network is used to extract deep features composed of abstract features and facial key point features, and a shallow self-attention feature extraction network is used to extract shallow features composed of facial edge features and facial texture features. Finally, the fused features are classified through a multi-scale feature fusion network to obtain a classification result of the expression picture.
[0032] refer to Figure 3 The facial expression recognition network of the present invention includes a deep feature extraction branch, a shallow feature extraction branch and a multi-scale feature fusion classification network; the deep feature extraction branch includes an abstract feature extraction network based on a convolutional neural network, a facial key point feature extraction network based on MobileFaceNet and a deep attention feature extraction network; the shallow feature extraction branch includes a facial edge feature extraction network based on an edge detection method, a facial texture feature extraction network based on a local binary pattern and a shallow self-attention feature extraction network; the multi-scale feature fusion classification network includes a fusion module and a classification module;
[0033] Among them, the deep feature extraction branch is parallel to the shallow feature extraction branch, and the outputs are both connected to the multi-scale feature fusion classification network; the output of the fusion module is connected to the input of the classification module; the abstract feature extraction network is parallel to the facial key point feature extraction network, and the outputs are both connected to the deep attention feature extraction network; the facial edge feature extraction network and the facial texture feature extraction network are parallel, and the outputs are both connected to the shallow self-attention feature extraction network.
[0034] Combine Figure 2 and Figure 3 The present invention is divided into three parts, namely, four facial feature extraction networks based on multimodality, an attention feature extraction network, and a multi-scale feature fusion classification network. In the abstract feature extraction network part, the abstract expression feature network extracted based on the convolutional neural network utilizes a convolutional neural network based on the residual and squeeze excitation module. The network is mainly composed of three feature extraction modules. The structure of each feature extraction module is basically the same, except that the feature resolutions output by the three modules are different. Each attention feature extraction network first extracts the features through convolution operations and batch normalization operations, then performs nonlinear mapping through parameterized corrected linear units, and then uses the squeeze excitation module to extract attention features for each dimension of the features. Finally, the original input features are added to the calculated features using residual mapping to further improve performance. The multi-scale feature extraction network part includes a deep feature extraction branch and a shallow feature extraction branch. The deep features are the abstract features and key point features output by the attention extraction module, and the shallow features are the facial edge features and facial texture features output by the self-attention extraction module. The deep feature extraction branch extracts high-significance features from the abstract features and key point features at three different scales extracted by the previous network through the attention feature extraction network. The structure of the attention feature extraction network is similar to the self-attention mechanism in Transformer. Figure 4 , the difference is that its query (Qurry, Q), key (Key, K) and value (Value, V) are obtained by linear mapping different features. Among them, through the linear mapping matrix W Q , map the key point features into query Q, through the linear mapping matrix W K and W V , mapping the abstract features into keys K and values V. The shallow feature extraction branch uses facial edge features and facial texture features as input. Unlike the deep feature branch, facial edge features and facial texture features are extracted by traditional methods and have only a single resolution. Therefore, the convolutional neural network is first used to pre-operate the features to obtain features at three different scales. Figure 5The two are fused at different scales by averaging, and then the attention feature extraction network is used to extract highly significant features. For the multi-scale feature fusion classification network, the multi-scale features output by the deep feature extraction branch and the shallow feature extraction branch are first linearly mapped to features at the same scale. The deep features and shallow features at the same scale are then fused by multiplying and adding the features and weights. Finally, the features at each scale are concatenated and used as the final fused features for classification prediction and calculating the network's classification loss.
[0035] exist Figure 3 In the network structure diagram, the abstract feature extraction network can use networks of different structures to obtain the feature map of the image. Although the structures of the networks are different, the essence of the two is the same. Regarding the deep attention feature extraction network, its structure is similar to the self-attention mechanism in Transformer. The difference is that its query (Qurry, Q), key (Key, K) and value (Value, V) are obtained by linear mapping of different features. However, the mapping relationship may be different, which may have a certain impact on the accuracy of the network, but this does not affect the final prediction result. Regarding the method of multi-scale feature fusion, the present invention uses features and attention weights to multiply and add them. An alternative solution may be to obtain the final fusion feature through a convolutional layer or a fully connected layer.
[0036] As a specific embodiment of the present invention, Figure 1 、 Figure 4 and Figure 5 , S200 includes:
[0037] The expression picture to be recognized is input into a trained facial expression recognition network, and the abstract features and facial key point features of the expression picture to be recognized are extracted respectively through the abstract feature extraction network and the facial key point feature extraction network to obtain corresponding abstract features and facial key point features of multiple scales, and the facial edge features and facial texture features of the expression picture to be recognized are extracted respectively through the facial edge feature extraction network and the facial texture feature extraction network to obtain corresponding facial edge features and facial texture features of multiple scales; the deep attention feature extraction network is used to extract deep features of the abstract features and facial key points of the same scale of the expression picture to be recognized using an attention mechanism; the shallow self-attention feature extraction network is used to extract shallow features of the facial edge features and facial texture features of the same scale of the expression picture to be recognized using a self-attention mechanism; the multi-scale feature fusion classification network is used to fuse and classify the deep features and shallow features of the multiple scales of the expression picture to be recognized to obtain the expression category to which the expression picture to be recognized belongs.
[0038] As a specific embodiment of the present invention, Figure 1 、 Figure 4 and Figure 5 , through the deep attention feature extraction network, the abstract features and facial key points of the same scale of the expression picture to be recognized are extracted using the attention mechanism to perform deep feature extraction, including:
[0039] The abstract features and facial key point features of the same scale of the expression picture to be recognized are input into the deep attention feature extraction network, so that the deep attention feature extraction network can be transformed into the deep attention feature extraction network through the linear mapping matrix W. Q , map the key point features into query Q, through the linear mapping matrix W K and W V , map the abstract features into keys K and values V, multiply Q and K and scale the multiplication result, then use the softmax function to normalize the scaled result to obtain the self-attention weight, multiply the self-attention weight by V to obtain deep features at multiple scales;
[0040] By using the shallow self-attention feature extraction network, extracting shallow features of the facial edge features and facial texture features of the same scale of the expression picture to be recognized using the self-attention mechanism includes:
[0041] The face edge features and face texture features of the same scale are input into the shallow self-attention feature extraction network, so that the shallow self-attention feature extraction network calculates the average value of the face edge features and the face texture features, and the linear mapping matrix W is used to extract the face edge features and the face texture features. Q 、W K and W V , map the average value into query Q, key K and value V respectively, multiply Q and K and scale the multiplication result, then use the softmax function to normalize the scaled result to obtain the self-attention weight, and multiply the self-attention weight with V to obtain shallow features at multiple scales.
[0042] As a specific embodiment of the present invention, the multi-scale feature fusion classification network is used to fuse and classify the deep features and shallow features of the expression picture to be recognized at multiple scales, and the expression category to which the expression picture to be recognized belongs includes:
[0043] The deep features and shallow features of multiple scales of the expression picture to be recognized are input into the multi-scale feature fusion classification network, so that the fusion module uses the method of multiplying and adding features and weights to first fuse the deep features and shallow features at the same scale, and then connect the features at each scale to obtain the fused features; the fused features are input into the classification module for classification to obtain the expression category to which the expression picture to be recognized belongs.
[0044] As a specific embodiment of the present invention, Figure 1 、 Figure 4 and Figure 5 ,d include:
[0045] The preprocessed expression picture is input into a trained facial expression recognition network, and the abstract features and facial key point features of the preprocessed expression picture are extracted respectively through the abstract feature extraction network and the facial key point feature extraction network to obtain corresponding abstract features and facial key point features of multiple scales, and the facial edge features and facial texture features of the preprocessed expression picture are extracted respectively through the facial edge feature extraction network and the facial texture feature extraction network to obtain corresponding facial edge features and facial texture features of multiple scales; the deep attention feature extraction network is used to extract deep features of the abstract features and facial key points of the same scale of the preprocessed expression picture using an attention mechanism; the shallow self-attention feature extraction network is used to extract shallow features of the facial edge features and facial texture features of the same scale of the preprocessed expression picture using a self-attention mechanism; the multi-scale feature fusion classification network is used to fuse and classify the deep features and shallow features of the multiple scales of the preprocessed expression picture to obtain the predicted expression category of the preprocessed expression picture.
[0046] As a specific embodiment of the present invention, Figure 2-Figure 5 The deep attention feature extraction network is used to extract the abstract features and facial key points of the pre-processed expression image at the same scale using the attention mechanism to perform deep feature extraction, including:
[0047] The abstract features and facial key point features of the same scale of the pre-processed expression picture are input into the deep attention feature extraction network, so that the deep attention feature extraction network can be transformed into the deep attention feature extraction network through the linear mapping matrix W. Q , map the key point features into query Q, through the linear mapping matrix W K and W V , map the abstract features into keys K and values V, multiply Q and K and scale the multiplication result, then use the softmax function to normalize the scaled result to obtain the self-attention weight, multiply the self-attention weight by V to obtain deep features at multiple scales;
[0048] Using the shallow self-attention feature extraction network, extracting shallow features of the face edge features and face texture features of the same scale of the pre-processed expression image using the self-attention mechanism includes:
[0049] The face edge features and face texture features of the same scale are input into the shallow self-attention feature extraction network, so that the shallow self-attention feature extraction network calculates the average value of the face edge features and the face texture features, and the linear mapping matrix W is used to extract the face edge features and the face texture features. Q 、W K and W V , map the average value into query Q, key K and value V respectively, multiply Q and K and scale the multiplication result, then use the softmax function to normalize the scaled result to obtain the self-attention weight, and multiply the self-attention weight with V to obtain shallow features at multiple scales.
[0050] As a specific embodiment of the present invention, Figure 2 and Figure 3 , through the multi-scale feature fusion classification network, the deep features and shallow features of the pre-processed expression picture at multiple scales are fused and classified to obtain the predicted expression category of the pre-processed expression picture. Including:
[0051] The deep features and shallow features of multiple scales of the preprocessed expression picture are input into the multi-scale feature fusion classification network, so that the fusion module uses the method of multiplying and adding features and weights to first fuse the deep features and shallow features at the same scale, and then connect the features at each scale to obtain the fused features; the fused features are input into the classification module for classification to obtain the predicted expression category of the preprocessed expression picture.
[0052] In a second aspect, the present invention provides a facial expression recognition device based on multimodal and multiscale feature fusion, comprising:
[0053] An acquisition module is configured to acquire an expression picture to be recognized and a trained facial expression recognition network;
[0054] The recognition module is configured to input the expression picture to be recognized into a trained facial expression recognition network so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the expression picture to be recognized; uses an attention mechanism to extract deep features from abstract features and facial key point features of the same scale, and uses a self-attention mechanism to extract shallow features from facial edge features and facial texture features of the same scale, and fuses and classifies the deep features and shallow features to obtain the expression category to which the expression picture to be recognized belongs.
[0055] The present invention provides a facial expression recognition method and device based on multimodal and multi-scale feature fusion. The facial expression picture to be recognized is input into a trained facial expression recognition network to extract abstract features, facial key point features, facial edge features, and facial texture features. The attention mechanism is used to extract deep features from abstract features and facial key point features of the same scale, and the self-attention mechanism is used to extract shallow features from facial edge features and facial texture features of the same scale. The deep features and shallow features are fused and classified. When extracting deep features and shallow features, the present invention performs multi-scale feature fusion on feature images of various resolutions output by the convolutional neural network, which can reduce the loss of original image information. The fusion of four facial features can improve the auxiliary guiding role of artificial features in the extraction of abstract expression features in more dimensions, thereby greatly improving the classification accuracy of the network. At the same time, the attention mechanism is used to prompt the network to accurately locate key areas that are highly relevant to expressions, thereby improving the classification ability of the network.
[0056] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0057] Although the present application is described herein with reference to various embodiments, those skilled in the art will be able to understand and implement other variations of the disclosed embodiments in practicing the claimed application by reviewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality.
[0058] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should be considered to fall within the scope of protection of the present invention.
Claims
1. A facial expression recognition method based on multi-modal and multi-scale feature fusion, characterized in that: include: S100, obtaining an expression picture to be recognized and a trained facial expression recognition network; S200, inputting the expression picture to be recognized into a trained facial expression recognition network, so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the expression picture to be recognized; The attention mechanism is used to extract deep features from abstract features and facial key point features of the same scale, and the self-attention mechanism is used to extract shallow features from facial edge features and facial texture features of the same scale. The deep features and shallow features are fused and classified to obtain the expression category to which the expression picture to be identified belongs.
2. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 1, characterized in that: The training process of the trained facial expression recognition network includes: a. Obtain an expression recognition dataset, wherein the expression recognition dataset includes a plurality of expression pictures carrying real category labels; b, selecting a training set and a test set from the facial expression recognition dataset; c. performing data preprocessing on each expression picture in the training set and the test set to stretch the resolution of each expression picture to 224×224 to obtain a preprocessed expression picture; d. Input the pre-processed expression picture into a preset facial expression recognition network, so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the pre-processed expression picture; extracts deep features from the abstract features and facial key point features of the same scale using an attention mechanism, and extracts shallow features from the facial edge features and facial texture features of the same scale using a self-attention mechanism; fuses and classifies the deep features and shallow features extracted from the pre-processed expression picture to obtain a predicted expression category of the pre-processed expression picture; e. comparing the predicted expression category of each pre-processed expression image with the carried true category label, and adjusting the internal parameters of the facial expression recognition network according to the comparison result; f. Repeat d to e until the maximum number of training times is reached to obtain a trained facial expression recognition network.
3. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 2, characterized in that: The facial expression recognition network includes a deep feature extraction branch, a shallow feature extraction branch and a multi-scale feature fusion classification network; the deep feature extraction branch includes an abstract feature extraction network based on a convolutional neural network, a face key point feature extraction network based on MobileFaceNet and a deep attention feature extraction network; the shallow feature extraction branch includes a face edge feature extraction network based on an edge detection method, a face texture feature extraction network based on a local binary pattern and a shallow self-attention feature extraction network; the multi-scale feature fusion classification network includes a fusion module and a classification module; Among them, the deep feature extraction branch is parallel to the shallow feature extraction branch, and the outputs are both connected to the multi-scale feature fusion classification network; the output of the fusion module is connected to the input of the classification module; the abstract feature extraction network is parallel to the face key point feature extraction network, and the outputs are both connected to the deep attention feature extraction network; the face edge feature extraction network and the face texture feature extraction network are parallel, and the outputs are both connected to the shallow self-attention feature extraction network.
4. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 3, characterized in that: S200 includes: The expression picture to be recognized is input into the trained facial expression recognition network, and the abstract features and facial key point features of the expression picture to be recognized are respectively extracted through the abstract feature extraction network and the facial key point feature extraction network to obtain corresponding abstract features and facial key point features of multiple scales, and the facial edge features and facial texture features of the expression picture to be recognized are respectively extracted through the facial edge feature extraction network and the facial texture feature extraction network to obtain corresponding facial edge features and facial texture features of multiple scales; the deep attention feature extraction network is used to extract deep features of the abstract features and facial key points of the same scale of the expression picture to be recognized by using the attention mechanism; the shallow self-attention feature extraction network is used to extract shallow features of the facial edge features and facial texture features of the same scale of the expression picture to be recognized by using the self-attention mechanism; the multi-scale feature fusion classification network is used to fuse and classify the deep features and shallow features of the expression picture to be recognized at multiple scales to obtain the expression category to which the expression picture to be recognized belongs.
5. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 4, characterized in that: The deep attention feature extraction network uses the attention mechanism to extract deep features of the same scale of the abstract features and facial key points of the expression picture to be identified, including: The abstract features and facial key point features of the same scale of the expression picture to be recognized are input into the deep attention feature extraction network, so that the deep attention feature extraction network can be transformed into the deep attention feature extraction network through the linear mapping matrix W Q , map the key point features into query Q, through the linear mapping matrix W K and W V , map the abstract features into keys K and values V, multiply Q and K and scale the result, then use the softmax function to normalize the scaled result to get the self-attention weight, multiply the self-attention weight by V to get deep features at multiple scales; Using the shallow self-attention feature extraction network, extracting shallow features of the face edge features and face texture features of the same scale of the expression picture to be recognized by using the self-attention mechanism includes: The face edge features and face texture features of the same scale are input into the shallow self-attention feature extraction network, so that the shallow self-attention feature extraction network calculates the average value of the face edge features and the face texture features, and the linear mapping matrix W is used to calculate the average value of the face edge features and the face texture features. Q , W K and W V , map the average values into query Q, key K and value V respectively, multiply Q and K and scale the multiplication result, and then use the softmax function to normalize the scaled result to obtain the self-attention weight, and multiply the self-attention weight with V to obtain shallow features at multiple scales.
6. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 4, characterized in that: Through the multi-scale feature fusion classification network, the deep features and shallow features of multiple scales of the expression picture to be recognized are fused and classified to obtain the expression category to which the expression picture to be recognized belongs, including: The deep features and shallow features of multiple scales of the expression picture to be recognized are input into the multi-scale feature fusion classification network, so that the fusion module uses the method of multiplying and adding features and weights to first fuse the deep features and shallow features at the same scale, and then connect the features at each scale to obtain the fused features; the fused features are input into the classification module for classification to obtain the expression category to which the expression picture to be recognized belongs.
7. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 3, characterized in that: dIncludes: Inputting the preprocessed expression picture into a trained facial expression recognition network, respectively extracting abstract features and facial key point features of the preprocessed expression picture through the abstract feature extraction network and the facial key point feature extraction network, and obtaining corresponding abstract features and facial key point features at multiple scales, and respectively extracting facial edge features and facial texture features of the preprocessed expression picture through the facial edge feature extraction network and the facial texture feature extraction network, and obtaining corresponding facial edge features and facial texture features at multiple scales; Through the deep attention feature extraction network, the abstract features and facial key points of the same scale of the pre-processed expression picture are extracted using the attention mechanism for deep features; through the shallow self-attention feature extraction network, the facial edge features and facial texture features of the same scale of the pre-processed expression picture are extracted using the self-attention mechanism for shallow features; through the multi-scale feature fusion classification network, the deep features and shallow features of multiple scales of the pre-processed expression picture are fused and classified to obtain the predicted expression category of the pre-processed expression picture.
8. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 7, characterized in that: Through the deep attention feature extraction network, the abstract features of the same scale and the key points of the face of the preprocessed expression picture are extracted using the attention mechanism for deep feature extraction, including: The abstract features and facial key point features of the same scale of the preprocessed expression picture are input into the deep attention feature extraction network, so that the deep attention feature extraction network can be transformed into the deep attention feature extraction network through the linear mapping matrix W Q , map the key point features into query Q, through the linear mapping matrix W K and W V , map the abstract features into keys K and values V, multiply Q and K and scale the result, then use the softmax function to normalize the scaled result to get the self-attention weight, multiply the self-attention weight by V to get deep features at multiple scales; Through the shallow self-attention feature extraction network, the face edge features and face texture features of the same scale of the pre-processed expression picture are extracted using the self-attention mechanism to perform shallow feature extraction, including: The face edge features and face texture features of the same scale are input into the shallow self-attention feature extraction network, so that the shallow self-attention feature extraction network calculates the average value of the face edge features and the face texture features, and the linear mapping matrix W is used to calculate the average value of the face edge features and the face texture features. Q , W K and W V , map the average values into query Q, key K and value V respectively, multiply Q and K and scale the multiplication result, and then use the softmax function to normalize the scaled result to obtain the self-attention weight, and multiply the self-attention weight with V to obtain shallow features at multiple scales.
9. The facial expression recognition method based on multi-modal and multi-scale feature fusion according to claim 8, characterized in that: Through the multi-scale feature fusion classification network, the deep features and shallow features of multiple scales of the pre-processed expression picture are fused and classified to obtain the predicted expression category of the pre-processed expression picture. The deep features and shallow features of multiple scales of the pre-processed expression picture are input into the multi-scale feature fusion classification network, so that the fusion module uses the method of multiplying and adding features and weights to first fuse the deep features and shallow features at the same scale, and then connect the features at each scale to obtain the fused features; the fused features are input into the classification module for classification to obtain the predicted expression category of the pre-processed expression picture.
10. A facial expression recognition device based on multi-modal and multi-scale feature fusion, characterized in that: include: An acquisition module is configured to acquire an expression picture to be recognized and a trained facial expression recognition network; A recognition module is configured to input the expression picture to be recognized into a trained facial expression recognition network so that the facial expression recognition network extracts abstract features, facial key point features, facial edge features and facial texture features of the expression picture to be recognized; The attention mechanism is used to extract deep features from abstract features and facial key point features of the same scale, and the self-attention mechanism is used to extract shallow features from facial edge features and facial texture features of the same scale. The deep features and shallow features are fused and classified to obtain the expression category to which the expression picture to be identified belongs.
Citation Information
Patent Citations
Facial expression recognition method based on fusion of traditional features of facial key point regions and face global depth features
CN107729835A
Facial expression recognition method based on mixed attention convolutional network
CN117475490A
Face key point detection method based on high and low resolution fusion model
CN117831107A
Expression recognition method based on attention-modulated contextual spatial information
WO2023185243A1
Cited By
Micro-expression recognition method and device, electronic equipment, storage medium and program product
CN121884413A
Micro-expression recognition method and device, electronic equipment, storage medium and program product
CN121884413B
