Face expression recognition method, device, medium and product based on lightweight network

By improving the structure of lightweight neural networks and adopting inverse depthwise separable convolution and attention mechanisms, the problems of feature loss and low accuracy in facial expression recognition of lightweight neural networks are solved, achieving higher recognition accuracy and lower parameter count.

CN118486060BActive Publication Date: 2026-11-20ENG UNIV OF THE CHINESE PEOPLES ARMED POLICE FORCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410650232.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2026-11-20
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

Existing lightweight neural networks suffer from drawbacks in facial expression recognition, such as easy loss of feature information, poor real-time performance, and low recognition accuracy.

Method used

An improved lightweight neural network is adopted, including a standard convolutional module, an inverse depthwise separable convolutional module, an inverse residual module with an attention mechanism, and an output module. Negative features are preserved through inverse fusion, thereby improving the retention rate of feature information.

Benefits of technology

It improves the accuracy of facial expression recognition, reduces the number of model parameters, and maintains real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118486060B_ABST
    Figure CN118486060B_ABST
Patent Text Reader

Abstract

The application discloses a face expression recognition method and system based on a lightweight network, a medium and a product, and relates to the technical field of image processing.The face expression recognition method comprises the following steps: acquiring a face image to be recognized; inputting the face image to be recognized into a face expression recognition model to obtain a corresponding face expression recognition result; the face expression recognition model is obtained by training an improved lightweight neural network and a classifier; the improved lightweight neural network has a reverse depth separable convolution module; the reverse depth separable convolution module comprises a plurality of reverse depth separable convolution units connected in sequence; and the reverse depth separable convolution unit is used for performing a fusion operation on a depth separable convolution feature map and a feature map retaining negative features.In the application, the improved lightweight neural network retains negative features by adopting a reverse fusion mode, so that information is not prone to being lost, and the accuracy of face expression recognition is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, device, medium, and product for facial expression recognition based on a lightweight network. Background Technology

[0002] Facial expression recognition refers to the process of analyzing facial images or videos to identify the emotional state displayed on a face. Currently, facial expression recognition technology has wide applications in many fields, including human-computer interaction, sentiment analysis, entertainment, and security.

[0003] Facial expression recognition technology typically involves computer vision and deep learning. The rapid development of deep convolutional neural networks (DCNNs) in recent years has led to their widespread application in facial recognition tasks, often outperforming traditional methods. However, DCNNs generally suffer from problems such as excessive depth, complex structure, large number of parameters, and long processing times. To address these issues, lightweight neural networks are frequently used as alternatives for facial expression recognition. However, using existing lightweight neural networks for facial expression recognition has revealed drawbacks such as easy loss of feature information, poor real-time performance, and low recognition accuracy. Summary of the Invention

[0004] The purpose of this invention is to provide a facial expression recognition method, device, medium, and product based on a lightweight network. Because the inverse depthwise separable convolutional module in the improved lightweight neural network adopts an inverse fusion method, it retains negative features, making information less likely to be lost and improving the accuracy of facial expression recognition.

[0005] To achieve the above objectives, the present invention provides the following solution:

[0006] In a first aspect, the present invention provides a facial expression recognition method based on a lightweight network, comprising:

[0007] Obtain the face image to be identified;

[0008] The face image to be identified is input into the facial expression recognition model to obtain the corresponding facial expression recognition result;

[0009] The facial expression recognition model is a model obtained by training an improved lightweight neural network and a classifier.

[0010] The improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverted residual module with an attention mechanism, and an output module connected in sequence.

[0011] The inverse depthwise separable convolution module includes several inverse depthwise separable convolution units connected in sequence.

[0012] The inverse depthwise separable convolutional unit is used for:

[0013] Perform depthwise separable convolution on the input data to obtain depthwise separable convolution feature maps;

[0014] Inverting the depthwise separable convolutional feature map yields a feature map that retains negative features.

[0015] The depthwise separable convolutional feature map and the feature map that retains negative features are fused together.

[0016] Optionally, the face image to be recognized is input into a facial expression recognition model to obtain the corresponding facial expression recognition result, specifically including:

[0017] The face image to be identified is preprocessed to obtain a preprocessed face image;

[0018] The preprocessed face image is input into the face expression recognition model to obtain the corresponding face expression recognition result.

[0019] Optionally, the face image to be identified is preprocessed to obtain a preprocessed face image, specifically including:

[0020] Determine whether the type of the face image to be identified is a single-channel grayscale image to obtain a first determination result;

[0021] If the first judgment result indicates that the type of the face image to be identified is a single-channel grayscale image, then the face image to be identified is determined as a target detection image;

[0022] If the first judgment result indicates that the type of the face image to be identified is not a single-channel grayscale image, then the face image to be identified is converted into a single-channel grayscale image, and the face image to be identified converted into a single-channel grayscale image is determined as the target detection image;

[0023] Perform face detection on the target detection map to determine the face region;

[0024] Based on the face region, the target detection map is cropped to obtain a preprocessed face image.

[0025] Optionally, the preprocessed face image is input into a facial expression recognition model to obtain the corresponding facial expression recognition result, specifically including:

[0026] The preprocessed face image is used to extract features using a trained, improved, lightweight neural network to obtain a feature vector;

[0027] The trained classifier is used to classify the feature vectors to obtain the corresponding facial expression recognition results.

[0028] Optionally, the process of determining the feature vector is as follows:

[0029] The preprocessed face image is subjected to feature extraction using the standard convolution module to obtain a first feature map; the standard convolution module includes several standard two-dimensional convolution units, each standard two-dimensional convolution unit includes a two-dimensional convolution layer, a normalization layer and an activation function layer connected in sequence; the activation function layer includes the SELU activation function;

[0030] The reverse depthwise separable convolution module is used to extract features from the first feature map to obtain the second feature map;

[0031] The inverse residual module with the introduced attention mechanism is used to perform feature weighting and feature extraction on the second feature map to obtain the third feature map;

[0032] The output module performs global average pooling and feature vector generation on the third feature map to obtain the feature vector.

[0033] Optionally, the inverse depthwise separable convolutional unit includes a pointwise convolutional layer, a depthwise separable convolutional layer, a depthwise convolutional inversion layer, and an inverse fusion layer;

[0034] The pointwise convolutional layer is used to perform pointwise convolution operations on the input data to obtain a pointwise convolutional feature map; the depthwise separable convolutional layer is used to perform depthwise separable convolution operations on the pointwise convolutional feature map to obtain a depthwise separable convolutional feature map; the depthwise convolution inversion layer is used to invert the depthwise separable convolutional feature map to obtain a feature map that retains negative features; the inverse fusion layer is used to fuse the depthwise separable convolutional feature map and the feature map that retains negative features.

[0035] Optionally, the inverted residual module that introduces the attention mechanism includes an extension unit, a depthwise separable convolution unit, a channel attention unit, a residual connection unit, and a projection unit connected in sequence.

[0036] The expansion unit is used to increase the dimension of the second feature map to obtain an expanded feature map; the depthwise separable convolution unit is used to perform depthwise convolution operation on the expanded feature map and reduce the feature dimension to obtain a dimensionality-reduced feature map; the channel attention unit is used to perform feature weighting on the dimensionality-reduced feature map to obtain a weighted feature map; the residual connection unit is used to perform feature addition operation on the second feature map and the weighted feature map to obtain a residual connection feature map; the projection unit is used to perform dimension matching between the residual connection feature map and the second feature map to obtain a third feature map.

[0037] Secondly, the present invention provides a facial expression recognition system based on a lightweight network, comprising:

[0038] The acquisition module is used to acquire the face image to be identified;

[0039] The facial expression recognition module is used to input the facial image to be recognized into the facial expression recognition model to obtain the corresponding facial expression recognition result;

[0040] The facial expression recognition model is a model obtained by training an improved lightweight neural network and a classifier.

[0041] The improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverted residual module with an attention mechanism, and an output module connected in sequence.

[0042] The inverse depthwise separable convolution module includes several inverse depthwise separable convolution units connected in sequence.

[0043] The inverse depthwise separable convolutional unit is used for:

[0044] Perform depthwise separable convolution on the input data to obtain depthwise separable convolution feature maps;

[0045] Inverting the depthwise separable convolutional feature map yields a feature map that retains negative features.

[0046] The depthwise separable convolutional feature map and the feature map that retains negative features are fused together.

[0047] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the facial expression recognition method based on a lightweight network described in the first aspect.

[0048] Fourthly, the present invention provides a computer program product, including a computer program / instruction which, when executed by a processor, implements the steps of the facial expression recognition method based on a lightweight network described in the first aspect.

[0049] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: The facial expression recognition method based on a lightweight network provided by the present invention includes: acquiring a facial image to be recognized; inputting the facial image to be recognized into a facial expression recognition model to obtain a corresponding facial expression recognition result; the facial expression recognition model is obtained by training an improved lightweight neural network and a classifier; the improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverse residual module with an attention mechanism, and an output module connected in sequence; wherein, the reverse depthwise separable convolutional module includes several reverse depthwise separable convolutional units connected in sequence; the reverse depthwise separable convolutional units are used to: perform depthwise separable convolution operations on the input data to obtain a depthwise separable convolutional feature map; perform an inversion operation on the depthwise separable convolutional feature map to obtain a feature map that retains negative features; and perform a fusion operation on the depthwise separable convolutional feature map and the feature map that retains negative features. The improved lightweight neural network in this invention has a reverse depthwise separable convolution module. By adopting a reverse fusion method, negative features are preserved, making information less likely to be lost and improving the accuracy of facial expression recognition. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is a schematic diagram of the facial expression recognition method provided in Embodiment 1 of the present invention;

[0052] Figure 2 This is a schematic diagram of the facial expression recognition method provided in Embodiment 2 of the present invention;

[0053] Figure 3 This is a schematic diagram of the face image preprocessing process provided in Embodiment 2 of the present invention;

[0054] Figure 4 This is a schematic diagram of the feature vector determination process provided in Embodiment 2 of the present invention;

[0055] Figure 5 This is a schematic diagram of the structure of the inverse depth-separable convolutional unit provided in Embodiment 2 of the present invention;

[0056] Figure 6 This is a schematic diagram of the SENET network structure provided in Embodiment 3 of the present invention;

[0057] Figure 7This is a schematic diagram of a facial expression recognition system provided in Embodiment 4 of the present invention. Detailed Implementation

[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0059] The purpose of this invention is to provide a facial expression recognition method based on a lightweight network. By enabling the improved lightweight neural network to have a reverse fusion mechanism, negative features are preserved, making information less likely to be lost and improving the accuracy of facial expression recognition.

[0060] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] Example 1

[0062] like Figure 1 As shown, the present invention provides a facial expression recognition method based on a lightweight network, including the following steps 101 to 102.

[0063] Step 101: Obtain the face image to be identified.

[0064] Step 102: Input the face image to be recognized into the face expression recognition model to obtain the corresponding face expression recognition result.

[0065] The facial expression recognition model is a model obtained by training an improved lightweight neural network and a classifier.

[0066] The improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverted residual module with an attention mechanism, and an output module connected in sequence.

[0067] The inverse depthwise separable convolution module includes several inverse depthwise separable convolution units connected in sequence.

[0068] The inverse depthwise separable convolutional unit is used for:

[0069] The input data is subjected to depthwise separable convolution to obtain depthwise separable convolution feature maps.

[0070] Inverting the depthwise separable convolutional feature map yields a feature map that retains negative features.

[0071] The depthwise separable convolutional feature map and the feature map that retains negative features are fused together.

[0072] Example 2

[0073] like Figure 2 As shown, the present invention provides a facial expression recognition method based on a lightweight network, including the following steps 201 to 204.

[0074] Step 201: Obtain the face image to be identified.

[0075] Step 202: Preprocess the face image to be identified to obtain a preprocessed face image.

[0076] Step 203: Use the trained and improved lightweight neural network to extract features from the preprocessed face image to obtain feature vectors.

[0077] Step 204: Use the trained classifier to classify the feature vector to obtain the corresponding facial expression recognition result.

[0078] In this embodiment, as Figure 3 As shown, the face image preprocessing process in step 202 specifically includes:

[0079] The first step is to determine whether the face image to be identified is a single-channel grayscale image, and obtain the first determination result.

[0080] The second step is to determine the face image to be identified as a target detection image if the first judgment result indicates that the face image to be identified is a single-channel grayscale image.

[0081] If the first judgment result indicates that the type of the face image to be identified is not a single-channel grayscale image, then the face image to be identified is converted into a single-channel grayscale image, and the face image to be identified converted into a single-channel grayscale image is determined as the target detection image.

[0082] The third step is to perform face detection on the target detection map to determine the face region.

[0083] The fourth step is to crop the target detection map based on the face region to obtain a preprocessed face image.

[0084] In this embodiment, as Figure 4 As shown, the process of determining the feature vector is as follows:

[0085] The first step is to use the standard convolutional module to extract features from the preprocessed face image to obtain a first feature map. The standard convolutional module includes several standard two-dimensional convolutional units, and each standard two-dimensional convolutional unit includes a two-dimensional convolutional layer, a normalization layer and an activation function layer connected in sequence. The activation function layer includes the SELU activation function.

[0086] The second step involves using the inverse depthwise separable convolution module to extract features from the first feature map, thereby obtaining the second feature map.

[0087] The inverse depthwise separable convolution module comprises several sequentially connected inverse depthwise separable convolution units. Each inverse depthwise separable convolution unit includes a pointwise convolutional layer, a depthwise separable convolutional layer, a depthwise convolution inversion layer, and an inverse fusion layer; the structure of the inverse depthwise separable convolution unit is as follows: Figure 5 As shown.

[0088] The pointwise convolutional layer is used to perform pointwise convolution operations on the input data to obtain a pointwise convolutional feature map; the depthwise separable convolutional layer is used to perform depthwise separable convolution operations on the pointwise convolutional feature map to obtain a depthwise separable convolutional feature map; the depthwise convolution inversion layer is used to invert the depthwise separable convolutional feature map to obtain a feature map that retains negative features; the inverse fusion layer is used to fuse the depthwise separable convolutional feature map and the feature map that retains negative features.

[0089] The third step involves using the inverted residual module with the introduced attention mechanism to perform feature weighting and feature extraction on the second feature map to obtain the third feature map.

[0090] The inverse residual module with an attention mechanism includes an expansion unit, a depthwise separable convolution unit, a channel attention unit, a residual connection unit, and a projection unit connected in sequence. The expansion unit increases the dimension of the second feature map to obtain an expanded feature map. The depthwise separable convolution unit performs depthwise convolution on the expanded feature map and reduces the feature dimension to obtain a dimensionality-reduced feature map. The channel attention unit performs feature weighting on the dimensionality-reduced feature map to obtain a weighted feature map. The residual connection unit performs feature addition on the second feature map and the weighted feature map to obtain a residual connection feature map. The projection unit performs dimensionality matching between the residual connection feature map and the second feature map to obtain a third feature map.

[0091] The fourth step involves using the output module to perform global average pooling and feature vector generation on the third feature map to obtain the feature vector.

[0092] Example 3

[0093] Based on Example 1 or Example 2, the process for determining the feature vector has been further specified.

[0094] The process of determining the feature vector is as follows:

[0095] Step 1: Use the standard convolution module to extract features from the preprocessed face image to obtain a first feature map; the preprocessed face image is a single-channel face image with a size of 48*48*1, and the obtained first feature map has a size of 24*24*16.

[0096] The standard convolutional module includes 16 standard two-dimensional convolutional units. Each standard two-dimensional convolutional unit includes a two-dimensional convolutional layer, a normalization layer, and an activation function layer connected in sequence. The activation function layer includes the SELU activation function. The kernel size of the two-dimensional convolutional layer is 3*3.

[0097] The second step involves using the inverse depthwise separable convolution module to extract features from the first feature map, thereby obtaining the second feature map.

[0098] The inverse depthwise separable convolution module comprises eight sequentially connected inverse depthwise separable convolutional units. Each inverse depthwise separable convolutional unit includes a pointwise convolutional layer, a depthwise separable convolutional layer, a depthwise convolutional inversion layer, and an inverse fusion layer. The pointwise convolutional layer has a 1x1 kernel size, with the following kernel numbers: 24, 32, 64, 96, 160, and 320. The depthwise separable convolutional layer has a 3x3 kernel size, with the following kernel numbers: 16, 24, 32, 64, 96, 160, 320, and 320.

[0099] The pointwise convolutional layer is used to perform pointwise convolution operations on the input data to obtain a pointwise convolutional feature map; the depthwise separable convolutional layer is used to perform depthwise separable convolution operations on the pointwise convolutional feature map to obtain a depthwise separable convolutional feature map; the depthwise convolution inversion layer is used to invert the depthwise separable convolutional feature map to obtain a feature map that retains negative features; the inverse fusion layer is used to fuse the depthwise separable convolutional feature map and the feature map that retains negative features.

[0100] The third step involves using the inverted residual module with the introduced attention mechanism to perform feature weighting and feature extraction on the second feature map, resulting in the third feature map.

[0101] The inverse residual module incorporating the attention mechanism comprises, in sequence, an extended unit, a depthwise separable convolutional unit, a channel attention unit, a residual connection unit, and a projection unit. The channel attention unit uses a SENET network for feature weighting, and the structure of the SENET network is as follows: Figure 6 As shown.

[0102] The SENET network implementation process includes: squeeze operation, excitation operation, and reweight operation; the squeeze operation compresses the features along the spatial dimension of the feature map through global average pooling, transforming each two-dimensional feature channel into a one-dimensional real number z∈R. c And its output dimension and input feature channels are:

[0103]

[0104] In the formula, F sq This indicates a squeeze operation on the feature map, where H represents the height of the feature map, W represents the width of the feature map, c represents the number of channels in the feature map, and U represents the height of the feature map. c Z represents the number of channels in the feature map. c The scalar value reflects the global features of the feature map.

[0105] The excitation operation generates weights for each feature channel using the parameter W, and its expression is as follows:

[0106] A c =F ex (Z c ,W)=σ(W2δ(W1Z c ));

[0107] In the formula, F ex This indicates an excitation operation on the feature map, where δ represents the ReLU activation function and σ represents the sigmoid function. Two fully connected layers with parameters W1 and W2 are used here to improve the generalization ability of the network.

[0108] The reweight operation is to multiply the weights obtained from the excitation operation and then apply them channel-by-channel to the previous features, thus recalibrating the original features along the channel dimension.

[0109] U c '=A c *U c ;

[0110] In the formula, A c U represents a scalar. c 'Indicates a new feature map.

[0111] The expansion unit is used to increase the dimension of the second feature map to obtain an expanded feature map; the depthwise separable convolution unit is used to perform depthwise convolution on the expanded feature map and reduce the feature dimension to obtain a dimensionality-reduced feature map; the channel attention unit is used to perform feature weighting on the dimensionality-reduced feature map to obtain a weighted feature map; the residual connection unit is used to perform feature addition on the second feature map and the weighted feature map to obtain a residual connection feature map; the projection unit is used to perform dimension matching between the residual connection feature map and the second feature map to obtain a third feature map; the size of the obtained third feature map is 24*24*16.

[0112] The fourth step involves using the output module to perform global average pooling and feature vector generation on the third feature map to obtain the feature vector.

[0113] This invention applies a normalization layer and a SELU activation layer after the convolution operation in all convolutional layers except for the inverse depthwise separable convolutional units. This accelerates the network's convergence speed and increases its ability to extract nonlinear features. For example... Figure 7 As shown, the lightweight Mobilenetv2 network currently uses the ReLU6 activation function. The ReLU6 activation function adds a non-linear constraint to the positive half-axis of ReLU, outputting 6 for all inputs greater than 6 to prevent gradient explosion. It is also computationally simple. However, ReLU6 still has the drawbacks of vanishing negative gradient information and non-zero mean and variance. On the other hand, the SELU activation function can make the input become a fixed distribution after a certain number of layers. The positive half-axis of the SELU activation function is greater than 1, which can be increased when the variance is too small, while preventing gradient vanishing. In this way, the activation function has a fixed point. As the network becomes deeper, the output of each layer has a mean of 0 and a variance of 1.

[0114] To enhance the extraction capability of facial expression features, this invention employs methods such as adding an attention mechanism, a reverse fusion mechanism, and the SELU activation function. Simultaneously, to reduce the number of model parameters, a width factor compression method is used. To analyze the impact of different improvement methods on recognition performance, comparative ablation experiments were conducted using two commonly used facial expression recognition datasets, FER2013 and CK+. The results of the comparative ablation experiments are shown in Table 1. It can be seen that the improved lightweight neural network model used in this invention has only 3.26M parameters, which is only 16.2% of that of a typical lightweight neural network model. Furthermore, it improves performance by 0.72% and 5.10% on the two datasets, respectively, with a particularly significant improvement on the CK+ dataset. Both the reverse fusion mechanism and the attention mechanism improve model performance, thus the improved lightweight neural network used in this invention achieves the effect of reducing the number of parameters and improving model accuracy.

[0115] Table 1. Ablation experiment results comparing FER2013 and CK+ datasets

[0116]

[0117]

[0118] Example 4

[0119] like Figure 7 As shown, this invention provides a facial expression recognition system based on a lightweight network, the system comprising:

[0120] The acquisition module 401 is used to acquire the face image to be identified.

[0121] The facial expression recognition module 402 is used to input the facial image to be recognized into the facial expression recognition model to obtain the corresponding facial expression recognition result.

[0122] The facial expression recognition model is a model obtained by training an improved lightweight neural network and a classifier.

[0123] The improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverted residual module with an attention mechanism, and an output module connected in sequence.

[0124] The inverse depthwise separable convolution module includes several inverse depthwise separable convolution units connected in sequence.

[0125] The inverse depthwise separable convolutional unit is used for:

[0126] The input data is subjected to depthwise separable convolution to obtain depthwise separable convolution feature maps.

[0127] Inverting the depthwise separable convolutional feature map yields a feature map that retains negative features.

[0128] The depthwise separable convolutional feature map and the feature map that retains negative features are fused together.

[0129] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0130] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0131] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0132] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A facial expression recognition method based on lightweight networks, characterized in that, include: Obtain the face image to be identified; The face image to be identified is input into the facial expression recognition model to obtain the corresponding facial expression recognition result; The facial expression recognition model is a model obtained by training an improved lightweight neural network and a classifier. The improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverse residual module with an attention mechanism, and an output module connected in sequence. The standard convolutional module includes several standard two-dimensional convolutional units, and each standard two-dimensional convolutional unit includes a two-dimensional convolutional layer, a normalization layer, and an activation function layer connected in sequence. The activation function layer includes the SELU activation function. The inverse depthwise separable convolution module comprises several sequentially connected inverse depthwise separable convolution units. Each inverse depthwise separable convolution unit includes a pointwise convolutional layer, a depthwise separable convolutional layer, a depthwise convolution inversion layer, and an inverse fusion layer. The pointwise convolutional layer performs pointwise convolution operations on the input data to obtain a pointwise convolutional feature map. The depthwise separable convolutional layer performs depthwise separable convolution operations on the pointwise convolutional feature map to obtain a depthwise separable convolutional feature map. The depthwise convolution inversion layer inverts the depthwise separable convolutional feature map to obtain a feature map that retains negative features. The inverse fusion layer fuses the depthwise separable convolutional feature map and the feature map that retains negative features. The inverse residual module incorporating the attention mechanism comprises an expansion unit, a depthwise separable convolution unit, a channel attention unit, a residual connection unit, and a projection unit connected in sequence. The expansion unit increases the dimension of the second feature map to obtain an expanded feature map. The depthwise separable convolution unit performs depthwise convolution on the expanded feature map and reduces the feature dimension to obtain a dimensionality-reduced feature map. The channel attention unit performs feature weighting on the dimensionality-reduced feature map to obtain a weighted feature map. The residual connection unit performs feature addition on the second feature map and the weighted feature map to obtain a residual connection feature map. The projection unit performs dimensionality matching between the residual connection feature map and the second feature map to obtain a third feature map. Furthermore, the channel attention unit uses the SENET network for feature weighting.

2. The facial expression recognition method based on a lightweight network according to claim 1, characterized in that, The face image to be identified is input into the facial expression recognition model to obtain the corresponding facial expression recognition result, which specifically includes: The face image to be identified is preprocessed to obtain a preprocessed face image; The preprocessed face image is input into the face expression recognition model to obtain the corresponding face expression recognition result.

3. The facial expression recognition method based on a lightweight network according to claim 2, characterized in that, The face image to be identified is preprocessed to obtain a preprocessed face image, specifically including: Determine whether the type of the face image to be identified is a single-channel grayscale image to obtain a first determination result; If the first judgment result indicates that the type of the face image to be identified is a single-channel grayscale image, then the face image to be identified is determined as a target detection image; If the first judgment result indicates that the type of the face image to be identified is not a single-channel grayscale image, then the face image to be identified is converted into a single-channel grayscale image, and the face image to be identified converted into a single-channel grayscale image is determined as the target detection image; Perform face detection on the target detection map to determine the face region; Based on the face region, the target detection map is cropped to obtain a preprocessed face image.

4. The facial expression recognition method based on a lightweight network according to claim 2, characterized in that, The preprocessed face image is input into the facial expression recognition model to obtain the corresponding facial expression recognition results, specifically including: The preprocessed face image is used to extract features using a trained, improved, lightweight neural network to obtain a feature vector; The trained classifier is used to classify the feature vectors to obtain the corresponding facial expression recognition results.

5. The facial expression recognition method based on a lightweight network according to claim 4, characterized in that, The process of determining the feature vector is as follows: The preprocessed face image is used to extract features using the standard convolution module to obtain a first feature map; The reverse depthwise separable convolution module is used to extract features from the first feature map to obtain the second feature map; The inverse residual module with the introduced attention mechanism is used to perform feature weighting and feature extraction on the second feature map to obtain the third feature map; The output module performs global average pooling and feature vector generation on the third feature map to obtain the feature vector.

6. A facial expression recognition system based on a lightweight network, used to implement the facial expression recognition method based on a lightweight network as described in any one of claims 1-5, characterized in that, include: The acquisition module is used to acquire the face image to be identified; The facial expression recognition module is used to input the facial image to be recognized into the facial expression recognition model to obtain the corresponding facial expression recognition result; The facial expression recognition model is a model obtained by training an improved lightweight neural network and a classifier. The improved lightweight neural network includes a standard convolutional module, a reverse depthwise separable convolutional module, an inverted residual module with an attention mechanism, and an output module connected in sequence. The inverse depthwise separable convolution module includes several inverse depthwise separable convolution units connected in sequence. The inverse depthwise separable convolutional unit is used for: Perform depthwise separable convolution on the input data to obtain depthwise separable convolution feature maps; Inverting the depthwise separable convolutional feature map yields a feature map that retains negative features. The depthwise separable convolutional feature map and the feature map that retains negative features are fused together.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of a lightweight network-based facial expression recognition method as described in any one of claims 1-5.

8. A computer program product, comprising a computer program, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the facial expression recognition method based on a lightweight network as described in any one of claims 1-5.