Facial AU detection model establishment method and application based on adaptive patch learning

The facial AU detection model through adaptive patch learning combines global features and facial key point locations to adaptively divide multi-scale patch areas, which improves the accuracy of facial action unit detection and solves the posture changes and spatial correlation in traditional methods. Underutilization problem.

CN114758382BActive Publication Date: 2024-09-10HUAZHONG UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210315936.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2024-09-10
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Traditional facial action unit detection methods are difficult to crop out semantically aligned patch areas under different head postures, and fail to effectively utilize the spatial correlation between AUs, resulting in limited detection accuracy.

Method used

A facial AU detection model based on adaptive patch learning is used to adaptively divide multi-scale patch areas through global feature learning and face key point location learning. Combined with the AU prediction module, the joint learning of AU detection and face alignment is achieved, weakening the head. Partial pose affects and captures the temporal and spatial correlations between AUs.

Benefits of technology

It improves the accuracy of facial action unit detection, weakens the impact of head posture changes on detection results, and learns the temporal dependence and spatial dependence between AUs on a larger scale, improving detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114758382B
    Figure CN114758382B
Patent Text Reader

Abstract

The present invention discloses a method for establishing a facial AU detection model based on adaptive patch learning and its application, which belongs to the field of computer vision technology, including: establishing an initial neural network model and training it to obtain a facial AU detection model; the model includes: a global feature learning module for extracting global facial features F from a facial image; global ; Face key point location learning module, used to learn from F global Learn the position of facial key points P align ; Adaptive multi-scale patch learning module, including: adaptive patch proposal submodule for align From F global The invention divides patch regions of various scales into multiple scales; a multi-scale patch learning submodule is used to obtain the features of patch regions of various scales through patch learning and then cascade them into AU features; and an AU prediction module is used to predict the probability of occurrence of each AU label according to the AU features; the patch region includes an AU-level scale region, an association-level scale region and a face-level scale region. The invention can reduce the influence of head posture and improve the accuracy of AU detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer vision technology, and more specifically, relates to a method for establishing a facial AU detection model based on adaptive patch learning and an application thereof. Background Art

[0002] Facial action units (AUs) are basic facial movements in local facial regions defined by the Facial Action Coding System (FACS), which describe fine-grained changes in facial expressions. Facial action unit detection refers to determining whether various types of AUs appear in a given face image. AU detection is an important face analysis task. Automatic detection of AUs and their combinations by computers helps to accurately analyze facial expressions and understand individual emotions, and is applied to various fields such as health, entertainment, and public safety.

[0003] AU is essentially a muscle activation pattern in a local area of ​​the face. Each AU label corresponds to some specific muscle movements. Different AUs have different structures and texture information, so explicit local feature learning helps improve the accuracy of AU detection. The traditional local area partitioning method divides the input convolution feature map evenly into several patch areas, and uses different convolution kernels for local feature learning for each patch area. This type of method cannot crop semantically aligned patch areas under different head postures, which limits the accuracy of AU detection.

[0004] In addition, AUs are often activated in combination. For example, a happy expression generally includes a combination of AU6 and AU12. Therefore, there is a temporal correlation between AUs. This related information can help improve the accuracy of AU detection. In order to utilize the temporal correlation between AUs, traditional AU relationship modeling methods mostly use Boltzmann machines or Bayesian networks, but do not consider the spatial correlation of AUs, which limits the detection accuracy of related methods. Summary of the invention

[0005] In view of the defects and improvement needs of the prior art, the present invention provides a method for establishing a facial AU detection model based on adaptive patch learning and its application, which aims to reduce the influence of head posture, capture AU features at different scales, and improve AU detection accuracy.

[0006] To achieve the above object, according to one aspect of the present invention, a method for establishing a facial AU detection model based on adaptive patch learning is provided, comprising: establishing an initial neural network model and training it to obtain a facial AU detection model;

[0007] The initial neural network model includes:

[0008] A global feature learning module is used to extract features from an input image containing a face, and obtain a global face feature that includes a global face structure and context features;

[0009] The facial key point location learning module is used to learn the facial key point locations from global facial features;

[0010] The adaptive multi-scale patch learning module includes: an adaptive patch proposal submodule, which is used to divide patch regions of various scales from global face features according to the positions of facial key points; a multi-scale patch learning submodule, which is used to perform patch learning on patch regions of various scales, obtain the features of each patch region and then cascade the obtained patch region features into AU features; the patch regions of various scales include AU-level scale regions; the AU-level scale region is a square region centered on the AU center position;

[0011] And, an AU prediction module is used to predict the probability of occurrence of each AU label based on AU features.

[0012] The facial AU detection model established by the present invention introduces a joint learning framework of two highly related tasks, AU detection and face alignment. When performing AU detection, the AU center position is first determined based on the predicted facial key points, and then the local area is divided based on the AU center position, and then AU detection is performed in the specified area. Since the result of the area division is adaptive to the facial key point position of the input image, the influence of head posture changes on the AU detection result is effectively reduced, and the accuracy of AU detection is improved.

[0013] In some optional embodiments, the patch regions of multiple scales further include: an association-level scale region; the association-level scale region is a minimum circumscribed rectangular region of two AU-level scale regions whose dependency and spatial correlation both meet preset conditions.

[0014] Since AUs are often activated in a combined manner, the present invention combines two AU-level scale areas that are dependent and satisfy a certain spatial relationship, and also uses the minimum circumscribed rectangle of the two AU-level scale areas as a patch area, i.e., an associated-level scale area, for subsequent AU prediction. This enables the model to learn the temporal and spatial dependencies between AUs on a larger scale when performing AU detection. With the assistance of this information, the accuracy of AU detection is further improved.

[0015] In some optional embodiments, the patch regions of multiple scales further include: a face-level scale region; the face-level scale region is the minimum circumscribed rectangular region of the AU-level scale region located in the same facial emotion expression region.

[0016] The present invention further regards the minimum circumscribed rectangular area of ​​the AU-level scale area within the same facial emotion expression area as a patch area, namely, a face-level patch area, for subsequent AU prediction. This enables the model to learn the emotional characteristics of the face on a larger scale when performing AU detection. With the assistance of this information, the accuracy of AU detection is further improved.

[0017] Furthermore, the spatial correlation satisfies a preset condition, which means that: in the same correlation-level scale region, the distance between the AU center positions of two AU-level scale regions is less than a preset threshold.

[0018] The present invention sets a spatial correlation condition so that the distance between AU-level scale areas in the same association-level scale area obtained by division is close, thereby avoiding the interference of the association-level scale areas with each other and affecting the AU detection accuracy; and when the patch areas of multiple scales obtained by division include both the association-level scale area and the face-level scale area, it can avoid that the association-level scale area is larger than the face-level scale area.

[0019] Furthermore, the training of the initial neural network model includes:

[0020] The first stage: freeze all parameters of the adaptive multi-scale patch learning module, use the first data set consisting of face images with labeled face key point positions to train the initial neural network model, and obtain an intermediate model;

[0021] The second stage: without freezing the parameters, the intermediate model is trained as a whole using a second data set consisting of face images with labeled face key point positions and AU labels to obtain a facial AU detection model.

[0022] The present invention carries out model training in two stages. In the first stage, all parameters of the adaptive multi-scale patch learning module are frozen, and only the face alignment loss is calculated, so that after the first stage of training, the model can accurately predict the position of facial key points; in the second stage, based on the first-order training, a complete model training is carried out, so that the adaptive patch proposal is as accurate as possible at the beginning of training, and different branches in patch learning are guided to focus on learning the local features of their respective AU division areas, so as to avoid the network learning unreasonable features; in the second stage of training, facial key point detection can provide accurate AU center positions, and the apparent changes caused by activated AUs will significantly affect the position distribution of facial key points. The two tasks promote each other in the training process, and can effectively improve the AU detection accuracy of the trained model.

[0023] Furthermore, before using the first data set to train the initial neural network model, the method further includes: performing a data enhancement operation on the first data set;

[0024] Furthermore, before using the second data set to train the intermediate model as a whole, the method further includes: performing a data enhancement operation on the second data set;

[0025] The data enhancement operation includes: obtaining an image scale of D by one or more operations of rotation, scaling, and translation in ×D in ×3 first RGB face image; randomly crop the first RGB face image into a second RGB face image of size D×D×3 and perform horizontal flipping;

[0026] Among them, D in and D are both positive integers, and D in >D.

[0027] Before performing model training, the present invention first performs data enhancement on the acquired training data set, which can effectively expand the data set and further improve the training effect of the model.

[0028] Furthermore, the training loss function of the first stage is:

[0029]

[0030] The training loss function of the second stage is:

[0031]

[0032] Among them, L align represents the L2 loss of face key point learning, N align Indicates the number of predicted facial key points, x n and n represents the ground truth x- and y-coordinates of the nth facial landmark, and represents the corresponding predicted coordinates, d represents the normalized true pupil distance; L au represents the weighted multi-label cross entropy loss for AU detection, N au Indicates the number of predicted AU labels, p n represents the probability that the nth AU actually appears, It indicates the probability of predicting the occurrence of the nth AU. r n represents the probability of the nth AU actually appearing in the second data set; L total represents the total loss of the second stage training, λ align Represents a trade-off parameter.

[0033] According to another aspect of the present invention, there is provided a facial action unit detection method, comprising:

[0034] The face image to be detected is input into the facial AU detection model established by the facial AU detection model establishment method based on adaptive patch learning provided by the present invention, and the AU label with the highest probability of occurrence is extracted from the output of the facial AU detection model as the face action unit detection result.

[0035] According to another aspect of the present invention, a computer-readable storage medium is provided, comprising a stored computer program; when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the facial AU detection model establishment method based on adaptive patch learning provided by the present invention, and / or the facial action unit detection method provided by the present invention.

[0036] In general, through the above technical scheme conceived by the present invention, a joint learning framework of two highly related tasks, AU detection and face alignment, is introduced into the model. Local area division is performed based on the detected face key points, and then AU detection is performed in the specified area to reduce the impact of head posture shaking. The two tasks promote each other during the training process, which can effectively improve the AU detection accuracy. An adaptive patch proposal method is proposed. First, the positional relationship between the face key points and the AU center is determined using prior knowledge, and then the predicted face key point coordinates related to the AU center are used to adaptively generate patch areas at three scales: AU level, association level, and face level based on the adaptive multi-scale patch proposal, so that the network can simultaneously learn the AU label features of the image, the association features between AUs, and the facial emotion features, thereby further improving the accuracy of AU detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of a facial AU detection model provided by an embodiment of the present invention;

[0038] Figure 2 A schematic diagram of the correspondence between the AU center position and the key point positions of a face provided in an embodiment of the present invention;

[0039] Figure 3 Schematic diagram of multi-scale patch regions divided according to an embodiment of the present invention; (a) is an AU-level scale region, (b) is an association-level scale region, and (c) is a face-level scale region;

[0040] Figure 4 A schematic diagram of an adaptive multi-scale patch learning module provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0042] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.

[0043] In order to solve the technical problem that the existing facial action unit detection method has low detection accuracy, the present invention provides a facial AU detection model establishment method based on adaptive patch learning and its application, the overall idea of ​​which is: introducing a face alignment task to obtain the positions of facial key points, then cutting out patch areas related to AU semantics based on these key points, and improving the accuracy of AU detection by jointly learning face alignment and AU detection; on this basis, an adaptive multi-scale patch proposal is proposed to obtain association-level patch areas containing AU spatial correlation and face-level patch areas containing emotional features, so that the model can learn the feature expression and spatial association of AU at different scales, and further improve the accuracy of AU detection.

[0044] The following are examples.

[0045] Embodiment 1:

[0046] A method for establishing a facial AU detection model based on adaptive patch learning includes: establishing an initial neural network model and training it to obtain a facial AU detection model.

[0047] See also Figure 1 The initial neural network model established in this embodiment includes three modules: Global Feature Learning (GFL), Facial Landmark Location Learning (FLLL), and Adaptive Multi-scale Patch Learning (AMPL); among which:

[0048] The global feature learning module is used to extract features from input images containing faces and obtain global face features F that contain global face structures and context features. global ;

[0049] The facial key point location learning module is used to learn the facial key point locations from global facial features. Nalign Indicates the number of predicted facial key points, and Represents the x-coordinate and y-coordinate of the predicted n-th facial key point;

[0050] The adaptive multi-scale patch learning module includes: an adaptive patch proposal submodule, which is used to divide patch regions of various scales from global face features according to the positions of facial key points; a multi-scale patch learning submodule, which is used to perform patch learning on patch regions of various scales, obtain the features of each patch region, and then cascade the obtained patch region features into AU features;

[0051] And, an AU prediction module is used to predict the probability of occurrence of each AU label based on AU features.

[0052] Optionally, in this embodiment, BP4D and DISFA are selected to construct data sets for training the model. The two data sets include annotations of 12 AU labels (AU 1, 2, 4, 6, 7, 10, 12, 14, 15, 17, 23, 24) and 49 facial key point coordinates, where the positions of some facial key points and their corresponding serial numbers are shown in Table 1. The labeling scheme is selected with reference to the BioID face database. Before training the model, this embodiment performs data enhancement operations, specifically including: obtaining an image scale (height, width, number of channels) of D by one or more operations of rotation, scaling, and translation. in ×D in ×3 RGB face images; then these RGB face images are randomly cropped to D×D×3 and horizontally flipped to eliminate the zero value effect caused by image rotation and prevent the network from falling into overfitting; in this embodiment, D in =200, D=160, and accordingly, the input image of the model is an RGB face image with a scale (height, width, number of channels) of D×D×3.

[0053] Table 1 Facial key point marking scheme

[0054] Facial key point number Facial key point locations 0 Right pupil 1 Left pupil 2 Right corner of mouth 3 Left corner of mouth 4 Outer end of right eyebrow 5 Inner end of right eyebrow 6 Inner end of left eyebrow 7 Left eyebrow outer end 8 Right temple 9 Outer corner of right eye 10 inner corner of right eye 11 Inner corner of left eye 12 outer corner of left eye 13 Left temple 14 tip of the nose 15 right nostril 16 left nostril 17 Center point of the outer edge of the upper lip 18 Center point of the outer edge of the lower lip 19 Tip of chin

[0055] See also Figure 1 The global feature learning module is shared by the face alignment task and the AU detection task. As an optional implementation, the network structure of the global feature learning module is specifically composed of three convolutional layers with a convolution kernel size of 3×3 and a step size of 1 connected in series, and the output scales corresponding to each convolutional layer are D×D×C, D×D×2C, and D×D×2C respectively; optionally, in this embodiment, C=4.

[0056] As an optional implementation, in this embodiment, the network structure of the face key point location learning module is composed of three consecutive convolutional layers and a maximum pooling layer in series. The corresponding output scales after each pooling layer are D / 2×D / 2×6C, D / 4×D / 4×8C, and D / 8×D / 8×10C, respectively, followed by two fully connected layers, and the dimensions of the two fully connected layers are N f and 2N align ; Optionally, in this embodiment, N f =512,N align =49.

[0057] As a preferred implementation, in this embodiment, the patch regions of various scales extracted by the adaptive patch proposal submodule include an AU-level scale region, that is, a square region centered at the AU center position, and the extraction process is as follows:

[0058] The facial key point position P predicted by the facial key point position learning module align As a benchmark, determine the AU center position; the description of the AU center position can refer to the description in "Eac-net: Deep nets with enhancing and cropping for facial action unit detection[J]" (Li W, Abtahi F, Zhu Z, et al. IEEE transactions on pattern analysis and machine intelligence, 2018, 40(11): 2583-2596.); specifically, the AU definition and the corresponding AU center position description can be obtained based on the prior knowledge of FACS, as shown in Table 2; in Table 2, the scale refers to the distance between the inner corner of the left eye and the inner corner of the right eye; based on Table 2, the corresponding relationship between the AU center position and the position of the facial key points can be obtained, as shown in Table 2. Figure 2 As shown, therefore, the predicted facial key point coordinates P can be used align , determine the AU center position P according to the AU center position description au The coordinates of the AU center are matched with the facial key points.

[0059] Table 2AU definition and corresponding center position description

[0060] AU Number AU Description Muscle Foundation AU Center Location 1 Eyebrow lift Frontalis (medial muscle) 1 / 2 scale upward from the inner end of the left / right eyebrow 2 Eyebrow lift Frontalis (lateral muscle) 1 / 3 scale upward from the outer end of the left / right eyebrow 4 Brows gathered and pressed down Depressor supercilii muscle, Depressor supercilii muscle, Corrugator supercilii muscle 1 / 3 scale downward from the center of the eyebrow 6 Cheek lift Orbicularis oculi muscle (orbital area) 1 scale below the bottom of the eye 7 Eyelid tightening Orbicularis oculi muscle (eyelid area) Eye Center 10 Upper lip lift Quadratus labii superioris Center of upper lip 12 Lifting the corners of the mouth zygomatic major muscle Left / right corner of mouth 14 dimple Buccinator Left / right corner of mouth 15 Mouth corners pulled down Depressor anguli oris Left / right corner of mouth 17 Chin lift Mental muscle Lips down 1 scale 23 Tighten your lips Orbicularis oris Lip Center 24 Lips pressed tight Orbicularis oris Lip Center

[0061] After determining the AU center position, use the AU center position P au Generate a scale of D for the center au ×D au, 18 AU-level scale areas are obtained; in order to avoid that the AU-level scale area is too small to contain complete AU information, or that the AU-level scale area is too large to cause one AU-level scale area to contain information of other AU-level scale areas, thereby affecting the accuracy of AU detection, preferably, in this embodiment, D au =16; Based on the above proposal, the AU-level scale area extracted in this embodiment is as follows Figure 3 As shown in (a) in .

[0062] Considering that AUs are often activated in a combined manner, in order to encourage the network to learn the symbiotic relationship between AUs, in this embodiment, on the basis of extracting the AU-level scale region, the patch region also includes an association-level scale region, that is, the minimum circumscribed rectangular region of two AU-level scale regions whose dependency and spatial correlation both meet preset conditions; the correlation measurement method between AU-level scale regions can refer to the description in "Classifier learning with prior probabilities for facial action unit recognition[C]" (Zhang Y, Dong W, Hu BG, et al. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2018: 5108-5116.) and "Semantic relationships guided representation learning for facial action unit recognition[C]" (2. Li G, Zhu X, Zeng Y, et al. Proceedings of the AAAI Conference on Artificial Intelligence. 2019, 33(01): 8594-8601.);

[0063] In this embodiment, the spatial correlation meets the preset condition, which means that the distance between the AU center positions of two AU-level scale areas is less than a preset threshold. The spatial correlation condition is set so that the distance between the AU-level scale areas in the same association-level scale area obtained by division is close, avoiding the interference of the association-level scale areas and affecting the AU detection accuracy. Based on the above proposal, in this embodiment, the division rules of the association-level scale area are described as shown in Table 3. Due to the overlap of the areas, the association of AU14, AU15, and AU24 is ignored; at the same time, in order to avoid the association-level scale area being larger than the face-level scale, in this embodiment, the preset threshold of spatial correlation is 4D. auBased on the division rules shown in Table 3, a correlation level scale division result is as follows Figure 3 As shown in (b) in the figure, a total of 11 correlation-level scale regions are divided.

[0064] Table 3 Description of the division rules of the association level scale area

[0065] Region A Region B AU1 AU2 AU4 AU7 AU6 AU12 AU12 AU17 AU12 AU23

[0066] In order to allow the network to learn emotional features on a larger scale, in this embodiment, based on the extraction of the AU-level scale area, the patch area also includes the face-level scale area, that is, the minimum circumscribed rectangular area of ​​the AU-level scale area located in the same facial emotion expression area; in order to cover the main areas of facial emotion expression as much as possible, reference can be made to the area division method in "Deep structure inference network for facial action unit recognition[C]" (Corneanu C, Madadi M, EscaleraS. Proceedings of the European Conference on Computer Vision (ECCV). 2018: 298-313.). Based on the above proposal, in this embodiment, the division rules of the face-level scale area are shown in Table 4. Based on this rule, this embodiment obtains a total of 6 face-level scale areas, such as Figure 3 As shown in (c) in .

[0067] Table 4 Description of the division rules of face-level scale regions

[0068] Face region description Included AU area Left Eye AU1 left, AU2 left, AU4 left, AU7 left Right eye AU1 right, AU2 right, AU4 right, AU7 right Left cheek AU6 left, AU7 left, AU10 left Right cheek AU6 right, AU7 right, AU10 right nose AU7, AU10 Mouth AU10, AU12, AU14, AU15, AU17, AU23, AU24

[0069] See also Figure 4 Corresponding to the multi-scale patch area, the multi-scale patch learning submodule includes three branches, which are used to perform patch learning on the AU-level scale area, the association-level scale area, and the face-level scale area to obtain their respective feature maps F au 、F rel 、F face ;

[0070] Optionally, in this embodiment, the network structure of the AU-level scale branch is composed of three convolutional layers connected in series, and the scale of the input feature is D au ×D au ×2C, the output feature size of each convolutional layer is D au ×D au ×18; the network structure of the association level scale branch consists of three convolutional layers in series, and the scale of the input feature is 2D au ×2D au×2C, the output scale of each convolutional layer is 2D au ×2D au ×11; the network structure of the face-level scale branch consists of three convolutional layers in series, and the scale of the input feature is 4D au ×4D au ×2C, the output scale of each convolutional layer is 4D au ×4D au ×6.

[0071] Since the patch size obtained in the association-level scale area is larger than the scale of the input feature and is not a standard square, in order to ensure that the patch area of ​​the association-level scale can be used as the input feature of the branch network, in this embodiment, the RoI Pooling method proposed in Faster RCNN is used to block and pool the 11 association-level patch areas into a fixed 2D au ×2D au The size of the 2D au ×2D au ×2C input features; similarly, RoI Pooling is used to pool the 6 face-level patch areas into fixed 4D au ×4D au The size of the 4D au ×4D au ×2C input features.

[0072] See also Figure 4 The specific way to cascade the feature maps of each patch area into AU features is to convert the feature map F au Upsample to F rel Same scale, feature map F face Downsample to F rel At the same scale, after concatenating all feature maps, the scale of the obtained AU feature is 2D au ×2D au ×35, followed by two fully connected layers, the dimensions of the two fully connected layers are N f and 2N au , where N au =12; the output of the second fully connected layer is the probability P of each AU label appearing r ={p n |n=1,2,…,N au}.

[0073] In order to make the adaptive patch proposal as accurate as possible at the beginning of training, guide different branches in patch learning to focus on learning the local features of their respective AU division areas to avoid the network learning unreasonable features. In this embodiment, a two-stage training method is specifically used to train the above model. Specifically:

[0074] In the first stage, all parameters of the adaptive multi-scale patch learning module are frozen, and only the face alignment loss is calculated. The corresponding loss function uses L2 loss:

[0075]

[0076] Among them, L align represents the L2 loss of face key point learning, N align Indicates the number of predicted facial key points, x n and n represents the ground truth x- and y-coordinates of the nth facial landmark, and represents the corresponding predicted coordinates, and d represents the normalized true pupil distance; after the first stage of training, the network can accurately predict the location of facial key points;

[0077] Phase 2: Based on the training in the first phase, complete training is performed. The calculated loss function includes both face alignment loss and AU detection loss. The AU detection loss uses weighted multi-label cross entropy loss:

[0078]

[0079] Among them, L au represents the weighted multi-label cross entropy loss for AU detection, N au Indicates the number of predicted AU labels, p n represents the probability that the nth AU actually appears, It indicates the probability of predicting the occurrence of the nth AU, 1 represents occurrence, and 0 represents non-occurrence; r n represents the probability of the nth AU actually appearing in the second data set; the smaller the probability of the AU actually appearing, the corresponding w n The larger the value, the greater the loss weight assigned to the AU, which means that the introduction of w n The network will then pay more attention to AU labels with low frequency and reduce the attention to AU labels with high frequency. Therefore, the introduced w n It can alleviate the data imbalance problem caused by the frequency difference of AU labels;

[0080] The overall loss of the second stage training is:

[0081] L total =L au +λ align L align ;

[0082] Among them, λ align represents the trade-off parameter. In this embodiment, λalign =0.5.

[0083] After the training is completed, a facial AU detection model for performing AU detection based on the input face image is obtained. This embodiment introduces a joint learning framework for two highly related tasks, AU detection and face alignment. When performing AU detection, the AU center position is first determined based on the predicted face key points, and then the local area is divided based on the AU center position, and then AU detection is performed in the specified area. Since the result of the area division is adaptive to the face key point position of the input image, the impact of head posture changes on the AU detection results is effectively reduced, and the model learns the correlation features between AUs and facial emotion features on a larger scale, thereby improving the accuracy of AU detection.

[0084] Embodiment 2:

[0085] A facial action unit detection method, comprising:

[0086] The face image to be detected is input into the facial AU detection model established by the facial AU detection model establishment method based on adaptive patch learning provided in the above-mentioned embodiment 1, and the AU label with the highest probability of occurrence is extracted from the output of the facial AU detection model as the face action unit detection result.

[0087] Embodiment 3:

[0088] A computer-readable storage medium includes a stored computer program; when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the facial AU detection model establishment method based on adaptive patch learning provided in the above-mentioned embodiment 1, and / or the facial action unit detection method provided in the above-mentioned embodiment 2.

[0089] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for establishing a facial AU detection model based on adaptive patch learning, It is characterized in that include: Establishing an initial neural network model and training it to obtain the facial AU detection model; The initial neural network model includes: A global feature learning module is used to extract features from an input image containing a face, and obtain a global face feature that includes a global face structure and context features; A facial key point location learning module, used for learning the facial key point locations from the global facial features; The adaptive multi-scale patch learning module includes: an adaptive patch proposal submodule, which is used to divide patch areas of multiple scales from the global face features according to the positions of the face key points; a multi-scale patch learning submodule, which is used to perform patch learning on the patch areas of multiple scales, obtain the features of each patch area, and then cascade the obtained patch area features into AU features; the patch areas of multiple scales include AU-level scale areas; the AU-level scale area is a square area centered on the AU center position; and, an AU prediction module, for predicting the probability of occurrence of each AU label according to the AU features; Wherein, the training of the initial neural network model includes: The first stage: freezing all parameters of the adaptive multi-scale patch learning module, training the initial neural network model using a first data set consisting of face images with labeled face key point positions, to obtain an intermediate model; The second stage: without freezing the parameters, the intermediate model is trained as a whole using a second data set consisting of face images with labeled face key point position labels and AU labels to obtain the face AU detection model; Before using the first data set to train the initial neural network model, the method further includes: performing a data enhancement operation on the first data set; Furthermore, before using the second data set to train the intermediate model as a whole, the method further includes: performing a data enhancement operation on the second data set; The data enhancement operation includes: obtaining an image scale D by one or more operations of rotation, scaling, and translation. in ×D in ×3; randomly cropping the first RGB face image into a second RGB face image of size D×D×3 and performing horizontal flipping; Among them, D in and D are both positive integers, and D in >D.

2. The method for establishing a facial AU detection model based on adaptive patch learning as claimed in claim 1, It is characterized in that The patch regions of multiple scales further include: an association-level scale region; the association-level scale region is the minimum circumscribed rectangular region of two AU-level scale regions whose dependency and spatial correlation both meet preset conditions.

3. The method for establishing a facial AU detection model based on adaptive patch learning as claimed in claim 2, It is characterized in that The patch regions of multiple scales further include: a face-level scale region; the face-level scale region is the minimum circumscribed rectangular region of the AU-level scale region located in the same facial emotion expression region.

4. The method for establishing a facial AU detection model based on adaptive patch learning as claimed in claim 2, It is characterized in that The spatial correlation meets the preset condition means that: in the same correlation level scale area, the distance between the AU center positions of two AU level scale areas is less than a preset threshold.

5. The method for establishing a facial AU detection model based on adaptive patch learning as claimed in claim 1, It is characterized in that The patch regions of multiple scales further include: a face-level scale region; the face-level scale region is the minimum circumscribed rectangular region of the AU-level scale region located in the same facial emotion expression region.

6. The method for establishing a facial AU detection model based on adaptive patch learning as claimed in claim 1, It is characterized in that The training loss function of the first stage is: The training loss function of the second stage is: Among them, L align represents the L2 loss of face key point learning, N align Indicates the number of predicted facial key points, x n and n represents the ground truth x- and y-coordinates of the nth facial landmark, and represents the corresponding predicted coordinates, d represents the normalized true pupil distance; L au represents the weighted multi-label cross entropy loss for AU detection, N au Indicates the number of predicted AU labels, p n represents the probability that the nth AU actually appears, It indicates the probability of predicting the occurrence of the nth AU. r n represents the probability of the nth AU actually appearing in the second data set; L total represents the total loss of the second stage training, λ align Represents a trade-off parameter.

7. A facial action unit detection method, It is characterized in that include: The face image to be detected is input into the facial AU detection model established by the facial AU detection model establishment method based on adaptive patch learning as described in any one of claims 1 to 6, and the AU label with the highest probability of occurrence is extracted from the output of the facial AU detection model as the face action unit detection result.

8. A computer-readable storage medium, It is characterized in that Comprising a stored computer program; when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the method for establishing a facial AU detection model based on adaptive patch learning as described in any one of claims 1 to 6, and / or the facial action unit detection method as described in claim 7.