Double-branch loss adversarial expression recognition method and system based on feature separation
The dual-branch loss adversarial expression recognition method through feature separation, combined with deep learning and adversarial training, solves the problem of non-expression information interference in expression recognition and achieves more accurate and robust expression recognition effects.
Patent Information
- Application Number
- CN202410514806.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-04-26
AI Technical Summary
In the existing dual-branch loss adversarial expression recognition technology, image features are difficult to completely separate, causing the expression recognition task to be interfered by non-expression-related information.
A dual-branch loss adversarial expression recognition method based on feature separation is used to extract expression features and non-expression features through a deep learning network model, and a feature separation loss is constructed, which combines confusion loss and domain adversarial loss to achieve feature separation and adversarial training.
Effectively separates expression and non-expression features, improves the accuracy and robustness of expression recognition, especially in data collected in natural environments, reduces identity information interference, and enhances the model's generalization ability and anti-interference ability.
Smart Images

Figure CN118537902A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of facial recognition, and in particular relates to a dual-branch loss adversarial expression recognition method and system based on feature separation, which is suitable for the fields of nighttime fatigue driving and security monitoring. Background Art
[0002] Dual-branch loss adversarial expression recognition is achieved by constructing two parallel network branches, one for extracting expression features and the other for extracting interference features; the expression branch aims to learn and recognize key features related to expression, while the interference branch aims to identify and separate interference factors that are not related to expression but may affect the recognition results, such as head posture, lighting conditions, etc., for identifying and classifying different expressions from face images. This method combines deep learning and adversarial training to simultaneously extract expression features and adversarial interference features through two parallel branch networks.
[0003] Facial expression recognition (FER) is an important part of face recognition technology and has very important practical significance. In recent years, it has received extensive attention in the fields of human-computer interaction, security, robot manufacturing, automation, medical treatment, communication and driving, and has become a research hotspot in academia and industry. The purpose of expression recognition is to analyze the multiple expressions of different people, explore the connection between different expressions, filter out the pseudo-feature information caused by interference factors, and find the common information of the same expression. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a dual-branch loss-adversarial expression recognition method and system based on feature separation in response to the deficiencies in the above-mentioned prior art, so that the image features extracted by the two entangled branches are separable, thereby directly performing expression recognition in the expression branch, which is used to solve the technical problem that the expression recognition task is interfered with by the presence of other expression-irrelevant information in the existing data.
[0005] The present invention adopts the following technical solutions:
[0006] A dual-branch loss adversarial expression recognition method based on feature separation, comprising the following steps:
[0007] S1, obtaining a training image dataset I and performing preprocessing and data enhancement on the training image dataset;
[0008] S2, build a deep learning network model including a feature extractor B, a weight distribution module, an expression classification module and an interference factor classification module, and use the feature extractor B to extract initial features from the training image data set I obtained in step S1 For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ;
[0009] S3, using confusion loss and domain adversarial loss to form adversarial loss, guiding the non-expression feature branch to extract non-expression features;
[0010] S4. Construct non-expression feature X d and facial features X e Feature separation loss between ;
[0011] S5. Perform a weighted summation on the adversarial loss obtained in step S3 and the feature separation loss obtained in step S4, use the obtained total expression recognition loss to train the deep learning network model obtained in step S2, input the test set image into feature extractor B, separate the features, and finally input it into the expression classifier to obtain the classification result.
[0012] Preferably, in step S1, the training image data set I is:
[0013]
[0014] in, represents the i-th expression image, express The label of , n represents the number of images.
[0015] Preferably, in step S2, iResNet50 is used as the backbone network encoder B from the input expression image I e To extract the mixed initial features, that is, X = B (I e ), define the feature residual module as:
[0016] X*(1-δ(X))=X–X*δ(X)
[0017] Among them, * represents element-by-element multiplication, δ represents the weight distribution module, and X*δ(X) represents the expression feature X e , X*(1-δ(X)) represents the identity feature X d .
[0018] Preferably, in step S2, expression-related information in the feature map is separated by a weight allocation module supervised by the expression recognition task, and branch features regarded as identity-related information are supervised by adversarial loss, and the weight allocation module includes a channel attention module and a spatial attention module.
[0019] Preferably, in step S3, the loss of for:
[0020]
[0021] in, To confuse the loss, is the domain adaptive adversarial loss.
[0022] More preferably, the loss function for expression recognition is optimized Confusion loss and domain adaptive adversarial loss They are:
[0023]
[0024]
[0025] Among them, N ex is the number of expressions in this batch, L CE represents the cross entropy loss of the predicted distribution of the classifier output, C(X d ) is the output of classifier C, W is the network weight, y e For expression tags, GRL(B(X d )) represents the gradient reversal operation on the identity feature output by classifier B.
[0026] Preferably, in step S4, the feature separation loss for:
[0027]
[0028] Among them, |||| represents the L2 norm of the vector, X e and X d is the feature vector, and N is the number of samples.
[0029] Preferably, in step S5, the total loss of expression recognition for:
[0030]
[0031] Among them, λ1, λ2 represent the equilibrium parameters, is the loss function for expression recognition, To combat losses, is the feature separation loss.
[0032] More preferably, the loss function for expression recognition is for:
[0033]
[0034] Among them, L CErepresents the cross entropy loss, A is the expression recognition network, W is the network weight, y e For expression labels.
[0035] In a second aspect, an embodiment of the present invention provides a dual-branch loss adversarial expression recognition system based on feature separation, comprising:
[0036] A data module, which obtains a training image dataset I and performs preprocessing and data enhancement on the training image dataset;
[0037] Construct a module to build a deep learning network model including feature extractor B, weight distribution module, expression classification module and interference factor classification module, and use feature extractor B to extract initial features from the training image data set I obtained from the data module For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ;
[0038] The first function module uses confusion loss and domain adversarial loss to form adversarial loss, guiding the non-expression feature branch to extract non-expression features;
[0039] The second function module constructs non-expression feature X d and facial features X e Feature separation loss between ;
[0040] The output module performs weighted summation on the adversarial loss obtained by the first function module and the feature separation loss obtained by the second function module, uses the obtained total expression recognition loss to train the deep learning network model obtained by the construction module, inputs the test set image into the feature extractor B, undergoes feature separation, and finally inputs it into the expression classifier to obtain the classification result.
[0041] In a third aspect, a chip comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned dual-branch loss adversarial expression recognition method based on feature separation when executing the computer program.
[0042] In a fourth aspect, an embodiment of the present invention provides an electronic device, including a computer program, which, when executed by the electronic device, implements the steps of the above-mentioned dual-branch loss adversarial expression recognition method based on feature separation.
[0043] Compared with the prior art, the present invention has at least the following beneficial effects:
[0044] A dual-branch loss adversarial expression recognition method based on feature separation uses a deep learning framework to solve the problem of expression recognition. It can be modeled through the powerful description ability of deep neural networks to learn and recognize seven common expressions (anger, disgust, surprise, happiness, sadness, neutrality, and fear). An important problem in expression recognition is that a person's identity information will interfere with the learning of expressions, because the same expression made by different people is different, which will seriously affect the model's learning of expression information. The present invention will separate expressions and facial information as much as possible to perform expression recognition. The present invention can not only have good results for data collected in a laboratory environment, but also show good robustness for data collected in a natural environment, because in general, the data collected in a natural environment has occlusions, posture changes and other objective factors that seriously affect expression discrimination.
[0045] Furthermore, collecting a large and diverse training image dataset ensures that the model can learn the wide sample distribution required for the expression recognition task, which helps improve the generalization ability of the model. By standardizing, normalizing, denoising, resizing and other operations on the image, unnecessary noise effects are eliminated and the data format is unified, making it easier for the model to learn the essential characteristics of the image and reducing the impact of data bias on model training. Additional training samples are generated through flipping, rotating, scaling, cropping, color transformation and other techniques to artificially increase the diversity of the data, effectively alleviate overfitting, improve the model's ability to recognize various expression variants, and enhance the robustness of the model.
[0046] Further, a deep neural network architecture, such as the convolutional neural network (CNN) in the present invention, is used to automatically extract high-dimensional, abstract feature representations from the original image. These features can capture the visual patterns of expressions, such as facial muscle movements, shape changes, etc., and provide a basis for subsequent classification. The weight distribution module can weight the initial features, achieve the emphasis on expression-related features and the suppression of non-expression features, help the model focus on the core elements of the expression recognition task, and improve recognition efficiency and accuracy. The expression classification module mainly classifies the extracted expression features, maps the features to predefined expression categories, and realizes automatic recognition of expressions. The interference factor classification module helps the model ignore the influence of irrelevant factors when recognizing expressions by identifying and separating non-expression features (such as lighting changes, occlusion, background interference, etc.), thereby improving the stability and anti-interference ability of recognition.
[0047] Furthermore, a weight distribution module is constructed using a channel attention module (CA) and a spatial attention module (SA) to highlight expression-related information at the channel and spatial levels. Note that these two attentions have outputs of the same size, and the channel attention and spatial attention are combined in a linear addition manner, which can balance their respective characteristics to a certain extent and flexibly adjust the weights of the two in the final feature representation. Spatial attention and channel attention each have their own advantages. The linear addition method enables the final feature representation to take into account the importance of spatial position and make full use of the correlation between channels, thereby describing the features more comprehensively.
[0048] Furthermore, the confusion loss penalizes the model for misclassifying non-expression features, prompting the model to learn to distinguish between expression features and non-expression features during training, avoiding confusion between the two and enhancing the model's focus on expression recognition in practical applications. The domain adversarial loss draws on the idea of adversarial learning, and by building a branch that competes with the expression recognition task, it encourages the model to learn those discriminative features that can effectively distinguish between expression and non-expression, further improving the pertinence and accuracy of feature extraction.
[0049] Furthermore, by defining and minimizing the distance between non-expression features and expression features (such as cosine similarity, Mahalanobis distance, etc.), the model is forced to learn independent feature representations, ensuring that expression features and non-expression features are separated as much as possible in the feature space, reducing mutual interference between the two. Clear feature separation helps the model to more accurately distinguish expression categories during the expression recognition stage, avoid non-expression factors from misleading the expression recognition results, and improve recognition accuracy.
[0050] Furthermore, the adversarial loss is combined with the feature separation loss to form a composite loss function, which takes into account the learning objectives of the model in both expression recognition and non-expression suppression, making the training process more comprehensive. By optimizing the total loss function, the model is guided to improve the ability of expression feature extraction, expression classification, and non-expression feature separation, ensuring a balanced improvement in the overall performance of the model. The training strategy that comprehensively considers multiple losses helps the model maintain good expression recognition performance in various complex scenarios and enhances its generalization ability on unknown test data.
[0051] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0052] In summary, the present invention can separate expression information from non-expression information through a single label, and has a high promotion value.
[0053] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 is a flow chart of the method of the present invention;
[0055] Figure 2 A schematic diagram of the structure of a deep learning network model in an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a computer device provided by an embodiment of the present invention;
[0057] Figure 4 The block diagram of a chip provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] In the description of the present invention, it should be understood that the terms “include” and “comprises” indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.
[0060] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0061] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects are in an "or" relationship.
[0062] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0063] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0064] Various structural schematic diagrams of the embodiments disclosed in the present invention are shown in the accompanying drawings. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clear expression. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0065] The present invention provides a dual-branch loss adversarial expression recognition method based on feature separation, which adopts convolutional neural network and loss-based adversarial training; the pre-trained model based on iResNet50 is widely used in expression recognition tasks, because of its simple structure, reasonable design and significant effect, many expression recognition algorithms with excellent performance will use this pre-trained model as the basic feature extraction network; the loss adversarial network, two different loss functions are added to perform adversarial to achieve the purpose of loss adversarial. The key point of the present invention is to combine the adversarial training and loss function methods to constrain the extracted basic image features, thereby separating the expression information. For the specific technical solution of the present invention, better results can be obtained by replacing the initial feature extraction network with other networks with stronger feature extraction capabilities, or designing other feature constraint means to improve performance.
[0066] See also Figure 1 The present invention provides a dual-branch loss adversarial expression recognition method based on feature separation, comprising the following steps:
[0067] S1. Obtain training image dataset And perform preprocessing and data augmentation on the training image dataset;
[0068] in, represents the i-th expression image, express The label of , n represents the number of images.
[0069] For the input training image dataset, data augmentation is first performed, and different data augmentations are performed for different datasets, generally including but not limited to random horizontal flipping and normalization.
[0070] S2, build a deep learning network model including feature extractor B, weight distribution module, expression classification module and interference factor classification module, and use feature extractor B to extract initial features from the training image data set obtained in step S1 And the initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ;
[0071] See also Figure 2 , a feature decomposition module based on weight distribution is proposed to decompose the mixed initial features in the high-level semantic space; the operation on the feature vector is more complicated than that on the feature map, and iResNet50 is used as the backbone network encoder B from the input expression image I e To extract the mixed initial features, that is, X = B (I e ), and the feature residual module is defined as:
[0072] X*(1-δ(X))=X–X*δ(X) (1)
[0073] Among them, δ represents element-by-element multiplication, represents the weight distribution module, and X*δ(X) represents the expression feature X e , X*(1-δ(X)) represents the identity feature X d .
[0074] The weight assignment module supervised by the expression recognition task separates the expression-related information in the feature map, and the adversarial loss is used to supervise the branch features that are considered identity-related information. Therefore, the weight assignment module constrains the decomposition module, which facilitates better separation of expression-related features in the mixed feature map.
[0075] In the present invention, a channel attention module (CA) and a spatial attention module (SA) are used to form a weight allocation module to highlight expression-related information at the channel and spatial levels.
[0076] S3. Constructing adversarial loss using confusion loss and domain adversarial loss Guide the non-expression feature branch to extract non-expression features;
[0077] In order to robustly decompose features using the FED module, the present invention uses the expression recognition task and adversarial loss to jointly supervise and further constrain the network to perform feature decomposition.
[0078] X eThe expression features are encoded through the expression recognition task supervision. It should be clear that the structure of the expression recognition network A and the classification network C of the adversarial loss branch are exactly the same.
[0079] Define the loss function for optimizing expression recognition for:
[0080]
[0081] Among them, L CE represents the cross entropy loss, A is the expression recognition network, W is the network weight, y e For expression labels.
[0082] The function of the weight allocation module is to focus the weight allocation on the expression-related areas. The present invention adopts a loss-supervised training method, and can guide the non-expression branch to extract non-expression features only through expression labels. The general task based on the idea of disentanglement is to extract certain features and use corresponding labels to guide model training. Here, it is necessary to suppress the extraction of expression information. It is mainly implemented by guiding the non-expression branch to extract non-expression features in a loss-adversarial manner through expression labels.
[0083] Next, use adversarial loss to supervise the non-expression branch feature X d Learning, here is X d The definition of non-expression branch is the interference factor that expression does not care about, but according to the observation of data, the biggest interference factor is still caused by the difference in people's appearance, so the non-expression branch is also defined as the identity feature branch.
[0084] Cross-expression domain adversarial learning is introduced, and continuous domain adaptation with gradient reversal layer (GRL) is used to encourage X d Keep the expression unchanged (that is, the extracted information does not change with the change of expression). The suppression loss of the identity feature branch is mainly composed of two and The composition is as follows:
[0085] y p =SoftMax(C(X d )W+b)
[0086]
[0087]
[0088]
[0089] Among them, the first term in formula (5) is the confusion loss, the second term is the domain adaptive adversarial loss, y e It's an emoticon tag.
[0090] Note that the two terms in equation (5) use a parameter-sharing network structure. It is necessary to train a classifier to better extract X e Features, supervised by cross entropy loss. In addition, the non-expression branch needs to be trained, using confusion loss and domain adaptive adversarial loss Joint training. ex Represents the number of expressions in this batch. When the calculated loss is divided by N ex To obtain the average loss function, the confusion loss is balanced for all categories, ensuring that it does not favor a specific category and that all expressions are mixed together.
[0091] S4. Construct non-expression feature X d and facial features X e The feature separation loss between
[0092] For FER, X e It is crucial that X should be the same and not change with other interfering factors in the data, but e and X d In fact, there is a strong correlation between them.
[0093] For example, X e and X d have a high linear correlation with each other. Therefore, X e Some of the interference factors involved will have a negative impact on expression recognition; the above-mentioned features include the decomposition network FED based on the weight distribution module, and the domain adversarial loss based on gradient reversal and confusion loss, all of which are to ensure that X e and X d Not related to each other.
[0094] In order to further decompose and separate the two parts of the features, the feature separation loss is introduced to further judge the similarity between the two extracted features. Formally, given a pair of features X e , X d , and then pass them through specific information processing units to evaluate feature similarity. Obviously, the goal of the present invention is to reduce X in the training process. e and X d The similarity of X reduces the correlation between the two features. e and X d Through continuous learning of the network, the similarities are small and eventually significantly irrelevant. The feature separation loss formula is defined as follows:
[0095]
[0096] Normalized eigenvectors:
[0097] First, Norm represents the two feature vectors X of the input e and X d Perform L2 normalization respectively, · represents the dot product of the vector, and |||| represents the L2 norm of the vector. This step ensures that the feature vectors have the same scale and direction when calculating the cosine similarity;
[0098] Next, the cosine similarity between the two normalized feature vectors is calculated to obtain their similarity;
[0099] The value range of cosine similarity is between -1 and 1, where 1 means complete similarity and -1 means complete dissimilarity.
[0100] Then, the cosine similarity is converted to the square of the cosine distance, so that the similarity is converted to distance, so that the larger the value, the greater the difference between the feature vectors; the mean of the square of the cosine distance is taken as the final loss value. The loss value represents the degree of difference between the two feature vectors, and they are made more separated or differentiated by minimizing this loss function. N represents the number of samples, which is used to normalize the loss.
[0101] S5: The adversarial loss L obtained in step S3 adv And the feature separation loss L obtained in step S4 fl Perform a weighted summation, use the obtained total loss of expression recognition to train the deep learning network model obtained in step S2, input the test set image into the feature extractor B, separate the features, and finally input it into the expression classifier to obtain the classification result.
[0102] The model is generally trained in an end-to-end adversarial manner, and the model extracts non-expression features through adversarial training assisted by a weight distribution module network.
[0103] Secondly, feature similarity evaluation helps to enhance the irrelevance between decomposed components. By making a difference, it ensures that the loss adversarial branch can extract non-expression features, while using expression label supervision also ensures that the expression branch can extract expression features.
[0104] Finally, the model is also used to remove certain factors in various non-expression branches such as posture, outdoor environment, etc. Based on the above equations (1) to (6), the total loss of the proposed model is as follows:
[0105]
[0106] Among them, λ1 and λ2 represent balance parameters.
[0107] By optimizing the total loss network, the interference of non-expression factors in facial images can be effectively eliminated and the required expression features can be extracted. After the model training is completed, the test image is input into the feature extractor B for feature decomposition and finally input into the expression classifier to obtain the classification result.
[0108] In another embodiment of the present invention, a dual-branch loss adversarial expression recognition system based on feature separation is provided, which can be used to implement the above-mentioned dual-branch loss adversarial expression recognition method based on feature separation. Specifically, the dual-branch loss adversarial expression recognition system based on feature separation includes a data module, a construction module, a first function module, a second function module and an output module.
[0109] Wherein, the data module obtains the training image data set I and performs preprocessing and data enhancement on the training image data set;
[0110] Construct a module to build a deep learning network model including feature extractor B, weight distribution module, expression classification module and interference factor classification module, and use feature extractor B to extract initial features from the training image data set I obtained from the data module For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ;
[0111] The first function module uses confusion loss and domain adversarial loss to form adversarial loss, guiding the non-expression feature branch to extract non-expression features;
[0112] The second function module constructs non-expression feature X d and facial features X e Feature separation loss between ;
[0113] The output module performs weighted summation on the adversarial loss obtained by the first function module and the feature separation loss obtained by the second function module, uses the obtained total expression recognition loss to train the deep learning network model obtained by the construction module, inputs the test set image into the feature extractor B, undergoes feature separation, and finally inputs it into the expression classifier to obtain the classification result.
[0114] In another embodiment of the present invention, a terminal device is provided, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the dual-branch loss adversarial expression recognition method based on feature separation, including:
[0115] Obtain a training image dataset I and perform preprocessing and data enhancement on the training image dataset; build a deep learning network model including a feature extractor B, a weight distribution module, an expression classification module, and an interference factor classification module, and use the feature extractor B to extract initial features from the obtained training image dataset I For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ; Use confusion loss and domain adversarial loss to form adversarial loss, guide the non-expression feature branch to extract non-expression features; construct non-expression feature X d and facial features X e The feature separation loss between them is calculated; the obtained adversarial loss and feature separation loss are weighted summed, and the obtained total expression recognition loss is used to train the obtained deep learning network model. The test set image is input into the feature extractor B after feature separation, and finally input into the expression classifier to obtain the classification result.
[0116] In another embodiment of the present invention, the present invention further provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory.
[0117] The processor may load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the dual-branch loss adversarial expression recognition method based on feature separation in the above embodiment; the processor may load and execute the following steps:
[0118] Obtain a training image dataset I and perform preprocessing and data enhancement on the training image dataset; build a deep learning network model including a feature extractor B, a weight distribution module, an expression classification module, and an interference factor classification module, and use the feature extractor B to extract initial features from the obtained training image dataset I For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ; Use confusion loss and domain adversarial loss to form adversarial loss, guide the non-expression feature branch to extract non-expression features; construct non-expression feature X d and facial features X e The feature separation loss between them is calculated; the obtained adversarial loss and feature separation loss are weighted summed, and the obtained total expression recognition loss is used to train the obtained deep learning network model. The test set image is input into the feature extractor B after feature separation, and finally input into the expression classifier to obtain the classification result.
[0119] See also Figure 3, the terminal device is a computer device, and the computer device 60 of this embodiment includes: a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When the computer program 63 is executed by the processor 61, the method for calculating the composition of fluid in the reservoir transformation wellbore in the embodiment is realized. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 63 is executed by the processor 61, the functions of each model / unit in the calculation system for the composition of fluid in the reservoir transformation wellbore in the embodiment are realized. To avoid repetition, it is not described one by one here.
[0120] The computer device 60 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will appreciate that Figure 3 This is only an example of the computer device 60 and does not constitute a limitation of the computer device 60. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0121] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0122] The memory 62 may be an internal storage unit of the computer device 60, such as a hard disk or memory of the computer device 60. The memory 62 may also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device 60.
[0123] Furthermore, the memory 62 may include both an internal storage unit of the computer device 60 and an external storage device. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 may also be used to temporarily store data that has been output or is to be output.
[0124] See also Figure 4 , the terminal device is a chip, and the chip 600 of this embodiment includes a processor 622, which may be one or more, and a memory 632 for storing a computer program executable by the processor 622. The computer program stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processor 622 may be configured to execute the computer program to execute the above-mentioned generalizable monocular absolute depth map estimation method.
[0125] In addition, the chip 600 may further include a power supply component 626 and a communication component 650, wherein the power supply component 626 may be configured to perform power management of the chip 600, and the communication component 650 may be configured to implement communication, for example, wired or wireless communication, of the chip 600. In addition, the chip 600 may further include an input / output interface 658. The chip 600 may operate based on an operating system stored in the memory 632.
[0126] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can usually be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0127] In order to verify the effect of the present invention, two commonly used expression datasets, FERPlus and RAF-DB, were selected for experimental verification.
[0128] Table 1: Experimental classification accuracy (unit: %)
[0129] Method FERPlus RAF-DB EAC 90.35 89.64 PACVT 88.21 88.72 SimFLE 89.41 88.94 FFDNet 88.5 88.75 VTFF 88.14 88.81 IPD-FER 88.89 88.42 Ours 91.85 91.28
[0130] The performance of the present invention is improved compared with the existing methods. On the RAF-DB dataset, it is 1.5%, 3.64%, 2.44%, 3.35%, 3.71% and 1.96% higher than EAC, PACVT, SimFLE, FFDNet, VTFF and IPD-FER respectively.
[0131] Although existing research has made great progress, there are still some objective factors that are difficult to remove in the data collected in the natural environment, such as posture changes, differences in people's appearance, changes in lighting, face blur, and partial facial area occlusion, which greatly increase the difficulty of expression recognition. The main problem solved by the present invention is that the appearance differences of people in the data collected in the natural environment lead to the problem of poor expression recognition effect. By separating the expression and facial features, the interference of identity information in the expression picture is removed.
[0132] In summary, the present invention provides a dual-branch loss adversarial expression recognition method and system based on feature separation, which is trained in an end-to-end manner, and two branches are formed by residual means, namely, an expression feature branch and a non-expression interference factor branch, to separate interference factors. The expression recognition method of the present invention learns how to guide the non-expression branch to learn non-expression information during the adversarial process, and at the same time, minimizes the similarity between the paired decomposition features of the expression and the corresponding interference factors through feature separation loss supervision. In the test, only the expression features are used for expression recognition. The loss adversarial training network is guided by two different loss functions through gradient flipping and confusion loss to achieve the purpose of loss adversarial. The key point of the present invention is to combine feature disentanglement and loss supervision training to constrain the extracted basic image features, thereby separating the expression information. Experimental results on the FERPlus and RAF-DB databases show that the present invention has superior performance in facial expression recognition.
[0133] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0134] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0135] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0136] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0138] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0139] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0140] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0143] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A dual-branch loss adversarial expression recognition method based on feature separation, characterized in that: The following steps are involved: S1, obtaining a training image dataset I and performing preprocessing and data enhancement on the training image dataset; S2, build a deep learning network model including a feature extractor B, a weight distribution module, an expression classification module and an interference factor classification module, and use the feature extractor B to extract initial features from the training image data set I obtained in step S1 For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ; S3, using confusion loss and domain adversarial loss to form adversarial loss, guiding the non-expression feature branch to extract non-expression features; S4. Construct non-expression feature X d and facial features X e Feature separation loss between ; S5. Perform a weighted summation on the adversarial loss obtained in step S3 and the feature separation loss obtained in step S4, use the obtained total expression recognition loss to train the deep learning network model obtained in step S2, input the test set image into feature extractor B, separate the features, and finally input it into the expression classifier to obtain the classification result.
2. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 1, characterized in that: In step S1, the training image dataset I is: in, represents the i-th expression image, express The label of , n represents the number of images.
3. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 1, characterized in that: In step S2, iResNet50 is used as the backbone network encoder B from the input expression image I e To extract the mixed initial features, that is, X = B (I e ), define the feature residual module as: X*(1-δ(X))=X–X*δ(X) Among them, * represents element-by-element multiplication, δ represents the weight distribution module, and X*δ(X) represents the expression feature X e , X*(1-δ(X)) represents the identity feature X d .
4. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 1, characterized in that: In step S2, the expression-related information in the feature map is separated by a weight allocation module supervised by the expression recognition task, and the branch features regarded as identity-related information are supervised by the adversarial loss. The weight allocation module includes a channel attention module and a spatial attention module.
5. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 1, characterized in that: In step S3, adversarial loss for: in, To confuse the loss, is the domain adaptive adversarial loss.
6. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 5, characterized in that: Optimizing the loss function for expression recognition Confusion loss and domain adaptive adversarial loss They are: Among them, N ex is the number of expressions in this batch, L CE represents the cross entropy loss of the predicted distribution of the classifier output, C(X d ) is the output of classifier C, W is the network weight, y e For expression tags, GRL(B(X d )) represents the gradient reversal operation on the identity feature output by classifier B.
7. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 1, characterized in that: In step S4, feature separation loss for: Among them, || || represents the L2 norm of the vector, X e and X d is the feature vector, and N is the number of samples.
8. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 1, characterized in that: In step S5, the total loss of expression recognition for: Among them, λ1, λ2 represent the equilibrium parameters, is the loss function for expression recognition, To combat losses, is the feature separation loss.
9. The dual-branch loss adversarial expression recognition method based on feature separation according to claim 8, characterized in that: Loss function for expression recognition for: Among them, L CE represents the cross entropy loss, A is the expression recognition network, W is the network weight, y e For expression labels.
10. A dual-branch loss adversarial expression recognition system based on feature separation, characterized in that: include: A data module, which obtains a training image dataset I and performs preprocessing and data enhancement on the training image dataset; Construct a module to build a deep learning network model including feature extractor B, weight distribution module, expression classification module and interference factor classification module, and use feature extractor B to extract initial features from the training image data set I obtained from the data module For initial features Perform weight distribution to obtain expression feature X e , the facial expression feature X e With initial features After subtraction, we get the non-expression feature X d ; The first function module uses confusion loss and domain adversarial loss to form adversarial loss, guiding the non-expression feature branch to extract non-expression features; The second function module constructs non-expression feature X d and facial features X e Feature separation loss between ; The output module performs weighted summation on the adversarial loss obtained by the first function module and the feature separation loss obtained by the second function module, uses the obtained total expression recognition loss to train the deep learning network model obtained by the construction module, inputs the test set image into the feature extractor B, undergoes feature separation, and finally inputs it into the expression classifier to obtain the classification result.
Citation Information
Patent Citations
Expression recognition method based on feature separation
CN110717434A
Face spoofing detection method and system based on meta-pseudo labels and illumination invariant features
CN114067444A
Expression recognition model training method and device, electronic equipment and storage medium
CN116912922A
Neural network multi-attribute facial encoder and decoder
US20230419642A1
