Face recognition method, device and equipment and storage medium

By extracting and fusing facial angle features, and utilizing a multi-head attention mechanism and a feature redirection network, the problem of facial recognition algorithms being sensitive to angle changes was solved, achieving high-precision recognition under multiple angles.

CN120260102BActive Publication Date: 2025-10-17MLKEY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510734622.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-10-17
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

The existing face recognition algorithm is sensitive to changes in face angle, resulting in reduced recognition accuracy.

Method used

By extracting the target face features and face angle features from the image to be recognized, and combining them with pre-registered face features, a multi-head attention mechanism and a feature redirection network are used to generate face recognition results.

Benefits of technology

The adaptability and accuracy of face recognition have been improved, and it can accurately identify faces in multiple face angle scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120260102B_ABST
    Figure CN120260102B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, and discloses a face recognition method, device and equipment and a storage medium. The method comprises the following steps: acquiring a to-be-recognized image; extracting a target face feature in the to-be-recognized image to obtain a to-be-recognized face feature; extracting a face angle feature in the to-be-recognized image to obtain a to-be-recognized face angle feature; extracting a target face feature corresponding to the to-be-recognized face angle feature in a pre-registered face feature to obtain a to-be-matched face feature; and generating a face recognition result of the to-be-recognized image according to the similarity between the to-be-recognized face feature and the to-be-matched face feature. The embodiment of the application can adapt to a face recognition scene with multiple face angles and improve the face recognition precision.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a face recognition method and device, equipment and a storage medium. BACKGROUND

[0002] Face recognition is a biometric technology that identifies the identity based on facial feature information of a person. Its basic principle includes three main steps of face detection, feature extraction and matching recognition.

[0003] However, in the feature extraction process, the face feature extraction algorithm has a problem of being sensitive to changes in the angle of the face. When the face in the image is at a non-frontal angle, the face feature extraction accuracy will decrease significantly, resulting in a decrease in face recognition accuracy. SUMMARY

[0004] The purpose of the present application is to provide a face recognition method, device, equipment and storage medium, which can adapt to face recognition scenes with multiple face angles and improve face recognition accuracy.

[0005] The present application provides a face recognition method, comprising:

[0006] Obtaining a to-be-recognized image;

[0007] Extracting a target face feature in the to-be-recognized image to obtain a to-be-recognized face feature;

[0008] Extracting a face angle feature in the to-be-recognized image to obtain a to-be-recognized face angle feature;

[0009] Extracting a target face feature corresponding to the to-be-recognized face angle feature in a pre-registered face feature to obtain a to-be-matched face feature; the pre-registered face feature contains a target face feature in a plurality of pre-registered images obtained from the same face at multiple angles;

[0010] Generating a face recognition result of the to-be-recognized image according to the similarity between the to-be-recognized face feature and the to-be-matched face feature.

[0011] In some embodiments, the face recognition method further comprises:

[0012] Obtaining a plurality of pre-registered images corresponding to a plurality of face groups;

[0013] Extracting a target face feature in the pre-registered image;

[0014] Fusing the target face features in the pre-registered images to obtain the pre-registered face feature.

[0015] In some embodiments, the fusing of the target face features in each of the pre-registered images comprises:

[0016] splicing target face features in each of the pre-registration images to obtain first spliced features;

[0017] performing nonlinear activation processing on the first spliced features to obtain first activated features;

[0018] performing multi-head attention mechanism processing on the first activated features to obtain attention weight features;

[0019] superimposing the first activated features and the attention weight features to obtain the pre-registration face features.

[0020] In some embodiments, the face angle feature in the to-be-identified image is extracted, including:

[0021] extracting a yaw angle feature and a pitch angle feature of the face in the to-be-identified image;

[0022] performing angle encoding processing on the yaw angle feature and the pitch angle feature to obtain the to-be-identified face angle feature.

[0023] In some embodiments, the angle encoding processing on the yaw angle feature and the pitch angle feature includes:

[0024] splicing the yaw angle feature and the pitch angle feature to obtain second spliced features;

[0025] mapping the second spliced features to a preset feature space to obtain the to-be-identified face angle feature.

[0026] In some embodiments, the target face feature corresponding to the to-be-identified face angle feature in the pre-registration face features is extracted, including:

[0027] performing feature redirection on the pre-registration face features according to a mapping relationship between the to-be-identified face angle feature and the target face feature in the pre-registration face features to extract the corresponding target face feature in the pre-registration face features to obtain the to-be-matched face feature.

[0028] In some embodiments, the feature redirection on the pre-registration face features according to the mapping relationship between the to-be-identified face angle feature and the target face feature in the pre-registration face features includes:

[0029] splicing the pre-registration face features and the to-be-identified face angle feature to obtain third spliced features;

[0030] performing probabilistic activation processing on the third spliced features to obtain second activated features;

[0031] According to the second activation feature, a corresponding target face feature in the pre-registered face feature is extracted, and the face feature to be matched is obtained.

[0032] The embodiment of the present application further provides a face recognition device, comprising:

[0033] A first module is configured to acquire an image to be recognized.

[0034] A second module is configured to extract a target face feature in the image to be recognized, and obtain a face feature to be recognized.

[0035] A third module is configured to extract a face angle feature in the image to be recognized, and obtain a face angle feature to be recognized.

[0036] A fourth module is configured to extract a target face feature corresponding to the face angle feature to be recognized in pre-registered face features, and obtain a face feature to be matched; the pre-registered face features include target face features in multiple groups of pre-registered images of the same face collected from multiple angles.

[0037] A fifth module is configured to generate a face recognition result of the image to be recognized according to a similarity between the face feature to be recognized and the face feature to be matched.

[0038] The embodiment of the present application further provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the face recognition method described above when executing the computer program.

[0039] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the face recognition method described above.

[0040] The present application has the following beneficial effects: face feature extraction and face angle feature extraction are performed on an image to be recognized, a corresponding target face feature in pre-registered face features is extracted according to the extracted face angle feature to be recognized, a face feature to be matched is obtained, and then a face recognition result of the image to be recognized is generated according to a similarity between the face feature to be recognized and the face feature to be matched. Since the face feature to be matched extracted from the pre-registered face features is a target face feature having a face angle feature matched with the face angle feature to be recognized, the face recognition method can adapt to a face recognition scene of multiple face angles, and improve face recognition accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 An application environment of a face recognition method provided by the embodiment of the present application is shown in the figure.

[0042] Figure 2is a flowchart of a face recognition method provided by an embodiment of the present application.

[0043] Figure 3 is a schematic diagram of a face angle feature provided by an embodiment of the present application.

[0044] Figure 4 is a flowchart of a method before step S201 provided by an embodiment of the present application.

[0045] Figure 5 is a structural schematic diagram of a face recognition device provided by an embodiment of the present application.

[0046] Figure 6 is a hardware structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0048] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the description and claims and drawings are used to distinguish similar objects, and are not intended to describe a specific order or sequence.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0050] The face recognition method provided by the embodiments of the present application can be executed by a computer device, which can be a terminal device or a server. The terminal device includes but is not limited to a mobile phone, a computer, a smart voice interactive device, a smart home appliance, a vehicle-mounted terminal, an aircraft, etc. The server can be a stand-alone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server.

[0051] In addition, the information, data and signals involved in the embodiments of the present application are all authorized by the relevant objects or fully authorized by all parties, and the collection, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0052] For the convenience of understanding the face recognition method provided by the embodiments of the present application, the application scenario of the face recognition method is exemplarily introduced below taking the execution subject of the face recognition method as a server.

[0053] Figure 1 The application environment diagram of the face recognition method provided by the embodiments of the present application. Referring to Figure 1 , the face recognition method is applied to a face recognition system. The face recognition system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. The terminal 110 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer, etc. The server 120 can be implemented by an independent server or a server cluster composed of multiple servers. The terminal 110 is configured to send a to-be-recognized image to the server 120. The server 120 is configured to obtain the to-be-recognized image, extract a target face feature in the to-be-recognized image to obtain a to-be-recognized face feature, extract a face angle feature in the to-be-recognized image to obtain a to-be-recognized face angle feature, extract a target face feature corresponding to the to-be-recognized face angle feature in a pre-registered face feature to obtain a to-be-matched face feature, and generate a face recognition result of the to-be-recognized image according to the similarity between the to-be-recognized face feature and the to-be-matched face feature. The pre-registered face feature contains target face features in multiple groups of pre-registered images obtained by collecting the same face from multiple angles.

[0054] It should be understood that Figure 1 The application scenario shown is only an example, and in actual application, the face recognition method provided by the embodiments of the present application can also be applied to other scenarios, for example, the face recognition method described above can be directly applied to the terminal 110, and the terminal 110 is configured to obtain the to-be-recognized image, extract the target face feature in the to-be-recognized image to obtain the to-be-recognized face feature, extract the face angle feature in the to-be-recognized image to obtain the to-be-recognized face angle feature, extract the target face feature corresponding to the to-be-recognized face angle feature in the pre-registered face feature to obtain the to-be-matched face feature, and generate the face recognition result of the to-be-recognized image according to the similarity between the to-be-recognized face feature and the to-be-matched face feature. The pre-registered face feature contains target face features in multiple groups of pre-registered images obtained by collecting the same face from multiple angles.

[0055] Figure 2 is a flowchart of a face recognition method provided by the embodiments of the present application. Referring to Figure 2 , in some embodiments, the method includes but is not limited to steps S201 to S205.

[0056] Step S201, obtaining a to-be-recognized image.

[0057] The to-be-identified image refers to an image containing a face that needs to be authenticated, which can be obtained by an image acquisition device or obtained from an image storage device.

[0058] In step S202, a target face feature in the to-be-identified image is extracted to obtain a to-be-identified face feature.

[0059] The to-be-identified face feature refers to a feature vector of a face feature with identity distinguishability extracted from the to-be-identified image, for example, a 512-dimensional feature vector extracted by a deep convolutional network. The target face feature refers to a high-level semantic feature vector such as a face key point, texture, or geometric structure extracted by a deep convolutional neural network, and the feature encoding can be realized by using a ResNet or ArcFace model.

[0060] After obtaining the to-be-identified image, a pre-trained face feature extraction network can be used to extract the target face feature in the to-be-identified image to obtain the to-be-identified face feature. The face feature extraction network can be a network constructed based on a deep convolutional network architecture, and the pre-trained face feature extraction network focuses on perceiving the face feature in the image. By performing continuous convolution operations on the to-be-identified image, the target face feature in the to-be-identified image is extracted layer by layer, and finally the to-be-identified face feature is output.

[0061] In step S203, a face angle feature in the to-be-identified image is extracted to obtain a to-be-identified face angle feature.

[0062] The to-be-identified face angle feature refers to a feature vector reflecting the orientation angle of the face in the to-be-identified image, which can be obtained by the attitude parameters of the face in the to-be-identified image through a three-dimensional face key point detection algorithm. The to-be-identified face angle feature is used to locate the feature data of the corresponding viewing angle in the pre-registered feature library, for example, when it is detected that the face is deflected to the left, the features of the left angle in the pre-registered library are preferentially selected for comparison. Referring to Figure 3 The orientation angle includes a roll angle (Roll), a yaw angle (Yaw), and a pitch angle (Pitch) of the face relative to the corresponding coordinate axis of the image.

[0063] After obtaining the to-be-identified image, a pre-trained angle feature extraction network can be used to extract the face angle feature in the to-be-identified image to obtain the to-be-identified face angle feature. The angle feature extraction network can be a network constructed based on a deep convolutional network architecture, and the pre-trained angle feature extraction network focuses on perceiving the face angle feature in the image. By performing continuous convolution operations on the to-be-identified image, the target face angle feature in the to-be-identified image is extracted layer by layer, and finally the to-be-identified face angle feature is output.

[0064] Step S204, extracting the target face feature corresponding to the to-be-recognized face angle feature in the pre-registered face feature to obtain a to-be-matched face feature.

[0065] The pre-registered face feature includes target face features in multiple groups of pre-registered images obtained by collecting the same face from multiple angles. It can be understood that the pre-registered face feature refers to a feature set constructed by target face features in multiple groups of pre-registered images obtained by collecting the same face, for example, including target face features in multiple groups of pre-registered images obtained by collecting the same face from the front, left side, and right side. The pre-registered face feature is collected before face recognition of the to-be-recognized image and is pre-stored in the memory space of the execution subject. The memory space of the execution subject pre-stores multiple groups of pre-registered face features, and different pre-registered face features include pre-registered images collected from different faces. For example, each group of pre-registered face features includes target face features in five groups of pre-registered images, and the orientation angles of the faces in each group of pre-registered images are a≈0° and b≈0°, a∈[30°, 60°] and b≈0°, a∈[-60°, -30°] and b≈0°, a≈0° and b∈[-30°, -10°], and a≈0° and b∈[10°, 30°], where a is the yaw angle of the face and b is the pitch angle of the face.

[0066] After obtaining the to-be-recognized face angle feature, the target face feature corresponding to the to-be-recognized face angle feature in the pre-registered face feature can be extracted by using a pre-trained feature redirection network to obtain the to-be-matched face feature. The feature redirection network can be a deep neural network based on an attention mechanism. The pre-trained feature redirection network focuses on perceiving the mapping relationship between the to-be-recognized face angle feature and the target face feature in the pre-registered face feature, determines and extracts the target face feature corresponding to the to-be-recognized face angle feature in the pre-registered face feature based on weight calculation or value transformation in attention weight operation, and finally outputs the to-be-matched face feature.

[0067] Step S205, generating a face recognition result of the to-be-recognized image according to the similarity between the to-be-recognized face feature and the to-be-matched face feature.

[0068] The similarity between the to-be-recognized face feature and the to-be-matched face feature can be obtained by calculating the cosine similarity between the to-be-recognized face feature and the to-be-matched face feature.

[0069] After obtaining the to-be-matched face feature, a similarity between the to-be-identified face feature and the to-be-matched face feature is calculated, and the calculated similarity is compared with a preset similarity threshold. If the similarity is greater than the similarity threshold, it indicates that the to-be-identified face feature and the to-be-matched face feature are matched successfully, and a face recognition result of successful face recognition is generated. If the similarity is not greater than the similarity threshold, it indicates that the to-be-identified face feature and the to-be-matched face feature are matched unsuccessfully, and the to-be-identified face feature is matched with a next group of to-be-matched face features until the similarity is greater than the similarity threshold or all to-be-matched face features are traversed. When the similarity is still not greater than the similarity threshold after all to-be-matched face features are traversed, a face recognition result of failed face recognition is generated.

[0070] Compared with the prior art, the face recognition method provided by the embodiment of the application can extract a to-be-identified face feature and a to-be-matched face feature from a to-be-identified image, extract a target face feature corresponding to the to-be-identified face feature from a pre-registered face feature according to the to-be-identified face feature, obtain the to-be-matched face feature, and generate a face recognition result of the to-be-identified image according to a similarity between the to-be-identified face feature and the to-be-matched face feature. Since the to-be-matched face feature extracted from the pre-registered face feature is a target face feature having a face angle feature matched with the to-be-identified face angle feature, the face recognition method can adapt to a face recognition scene of multiple face angles and improve face recognition accuracy.

[0071] Figure 4 is a flowchart of the method before step S201 provided by the embodiment of the application. Refer to Figure 4 In some embodiments, the method includes but is not limited to steps S401 to S403.

[0072] Step S401, obtaining a plurality of groups of pre-registered images corresponding to a plurality of groups of faces.

[0073] Step S402, extracting a target face feature in the pre-registered image.

[0074] Step S403, fusing the target face feature in the pre-registered image to obtain a pre-registered face feature.

[0075] The plurality of groups of pre-registered images refer to a plurality of images of the same face collected from different angles, for example, the same face can be image collected by using a yaw angle of ±30°, ±60° and a pitch angle of ±15°, thereby covering a common face posture change range.

[0076] For each group of pre-registered images corresponding to each group of human faces, after obtaining a plurality of groups of pre-registered images corresponding to the same human face, the target human face features in the pre-registered images can be extracted by using a pre-trained human face feature extraction network to obtain the target human face features in the plurality of groups of pre-registered images. The target human face features in the pre-registered images can be fused by using a method combining splicing and nonlinear transformation to map the target human face features in the plurality of groups of pre-registered images to a unified feature space to generate pre-registered human face features. Thus, by constructing a multi-angle feature fusion mechanism, a corresponding relationship between angle changes and feature spaces is established in the registration stage, so that the generated pre-registered human face features can adaptively match human face features of different angles to be identified.

[0077] In a specific embodiment, the dimension of the target human face features in the pre-registered images is greater than the dimension of the human face features to be identified. The target human face features in the pre-registered images can be extracted by inputting the pre-registered images into the pre-trained human face feature extraction network, obtaining the feature vectors output by the intermediate layer of the human face feature extraction network without dimension reduction processing, and obtaining the target human face features in the pre-registered images. Thus, the target human face features in the pre-registered images with richer feature content can be obtained, and after fusing the target human face features in the pre-registered images, the generated pre-registered human face features can adaptively match human face features to be identified with multiple feature contents.

[0078] In some embodiments, step S403 specifically includes: splicing the target human face features in each pre-registered image to obtain first spliced features; performing linear coding processing on the first spliced features to obtain first coded features; performing nonlinear activation processing on the first spliced features to obtain first activated features; performing multi-head attention mechanism processing on the first activated features to obtain attention weight features; and superimposing the first activated features and the attention weight features to obtain the pre-registered human face features.

[0079] Splicing refers to connecting a plurality of feature vectors in a predetermined order, which can be implemented in a way of concatenating along the feature dimension direction, and a unified representation is formed by integrating different angle features. Nonlinear activation processing refers to nonlinear transformation of linear features by an activation function, which can be implemented by using a ReLU function or a Sigmoid function, and is used to enhance the expression ability of features and mine potential correlations. Multi-head attention mechanism processing refers to splitting features into a plurality of subspaces and calculating attention weights respectively, which can be implemented by using a plurality of parallel self-attention modules, and weight distribution is achieved by capturing dynamic dependency relationships between different feature vectors. Superimposition refers to adding a plurality of feature vectors, which can be implemented by using a residual connection structure, and is used to retain original feature information and fuse key features after attention screening.

[0080] In the pre-registration stage, the target face features of the pre-registration images of the same face are fused. First, the target face features in each pre-registration image are spliced to form a unified feature representation containing multi-angle information, i.e., a first spliced feature. Then, the first spliced feature is input into a pre-trained feature fusion network. In the feature fusion network, the first spliced feature is subjected to nonlinear activation processing, the nonlinear correlation between features is enhanced through an activation function, and a first activated feature is obtained. Then, a multi-head attention mechanism is used to perform parallel weight calculation on the first activated feature, the importance of different angle features is analyzed from multiple subspaces, dynamic attention weights are generated, and an attention weight feature is obtained. Finally, the first activated feature and the attention weight feature are superimposed to obtain a pre-registration face feature. The generated pre-registration face feature not only retains the details of the first activated feature, but also can strengthen the contribution of key angle features.

[0081] In a specific embodiment, the feature fusion network is composed of two fully connected layers, a ReLU layer, a multi-head attention layer, and an Add layer. After the first spliced feature is input into the feature fusion network, the first fully connected layer maps the first spliced feature into the corresponding feature space and outputs the mapped feature to the ReLU layer. The mapped feature is subjected to nonlinear activation in the ReLU layer to obtain the first activated feature. Then, the first activated feature is input into the multi-head attention layer and the Add layer. The multi-head attention layer performs multi-head attention mechanism processing on the first activated feature to generate an attention weight feature. The generated attention weight feature is input into the Add layer, and then the first activated feature and the attention weight feature are superimposed to generate a corresponding superimposed feature. Finally, the superimposed feature is mapped by the second fully connected layer to obtain the pre-registration face feature.

[0082] In some embodiments, step S203 specifically includes: extracting the yaw angle feature and the pitch angle feature of the face in the to-be-identified image; and performing angle encoding processing on the yaw angle feature and the pitch angle feature to obtain the to-be-identified face angle feature.

[0083] The yaw angle feature refers to the horizontal direction attitude parameter of the face rotating around the vertical axis, which can be specifically realized by using a face key point detection algorithm combined with a three-dimensional reconstruction model to calculate the horizontal rotation angle by analyzing the coordinate offset of the left and right eyes, the nose tip, and the corners of the mouth. The pitch angle feature refers to the vertical direction attitude parameter of the face rotating around the horizontal axis, which can be specifically realized by using a face contour curvature analysis method to obtain the pitch angle value by calculating the vertical projection distance change rate of the lower jaw line and the eyebrow center point. The angle encoding processing refers to the process of converting discrete angle values into continuous feature vectors, which can be specifically realized by using a multi-layer perception neural network to map the angle values to a high-dimensional feature space to form an encoding feature with geometric preservation.

[0084] In the angle feature extraction stage of the to-be-identified face, the angle feature extraction network first locates the face region in the to-be-identified image, and then captures the horizontal rotation state and the vertical tilt state through a double-branch feature extraction network. The yaw angle branch generates a horizontal rotation parameter by tracking the symmetry change of the bilateral cheekbones and the bridge of the nose, and the pitch angle branch outputs a vertical tilt parameter by analyzing the projection proportion change of the forehead and chin regions. The two types of angle parameters are input into an angle encoder for joint encoding. The encoding process can be to map the original angle values to the corresponding feature space using a nonlinear transformation function, forming a composite angle feature vector with rotation invariance. The vector is matched with the angle encoding in the pre-registered feature library through cosine similarity calculation, realizing cross-angle feature alignment.

[0085] In some embodiments, the angle encoding processing of the yaw angle feature and the pitch angle feature specifically includes: splicing the yaw angle feature and the pitch angle feature to obtain a second spliced feature; and mapping the second spliced feature to a preset feature space to obtain the angle feature of the to-be-identified face.

[0086] In the angle encoding processing of the yaw angle feature and the pitch angle feature, the yaw angle feature and the pitch angle feature are spliced to form a composite feature expression containing three-dimensional space angle information. The composite feature is converted into a continuous embedding vector through a nonlinear transformation of the preset feature space, so that the features of different angles have comparability in a unified space. The activation function is used in the feature space mapping process to enhance the discriminability of the angle feature, so that the target face feature corresponding to the pre-registered face feature in the pre-registered feature library can be accurately searched in the subsequent matching stage.

[0087] In a specific embodiment, the angle encoder is composed of two fully connected layers. After obtaining the yaw angle feature and the pitch angle feature of the face in the to-be-identified image, the obtained yaw angle feature and the pitch angle feature are spliced, and then the spliced angle feature is continuously processed through full connection to map the spliced angle feature to the corresponding feature space, thereby obtaining the angle feature of the to-be-identified face.

[0088] In some embodiments, step S204 specifically includes: performing feature redirection on the pre-registered face feature according to the mapping relationship between the angle feature of the to-be-identified face and the target face feature in the pre-registered face feature, to extract the corresponding target face feature in the pre-registered face feature, thereby obtaining the to-be-matched face feature.

[0089] Feature redirection refers to dynamically selecting an effective target face feature of a corresponding angle in the pre-registered face feature according to the current angle feature. Specifically, the feature redirection can be achieved by using an attention mechanism combined with a feature projection matrix, and feature alignment is completed by establishing a nonlinear mapping between the angle feature space and the registered feature space.

[0090] When the angle of the face to be identified is deviated, the angle feature of the face to be identified is input into the pre-trained feature redirection network to generate a corresponding feature space projection matrix, the target face feature in the pre-registered face features is subjected to tensor operation with the projection matrix, and the target face feature in the pre-registered face features that is most matched with the current angle is screened out through calculation of a feature correlation score, thereby obtaining the face feature to be matched.

[0091] In some embodiments, the feature redirection of the pre-registered face features according to the mapping relationship between the angle feature of the face to be identified and the target face feature in the pre-registered face features specifically comprises: splicing the pre-registered face features and the angle feature of the face to be identified to obtain a third spliced feature; performing probabilistic activation processing on the third spliced feature to obtain a second activated feature; and extracting the corresponding target face feature in the pre-registered face features according to the second activated feature to obtain the face feature to be matched.

[0092] First, the pre-registered face features and the angle feature of the face to be identified are spliced to form a composite feature containing spatial correlation information, thereby obtaining a third spliced feature. Then, the third spliced feature is subjected to nonlinear transformation by a probabilistic activation function to calculate the matching probability distribution between the target face feature in the pre-registered face features and the current angle feature of the face to be identified. Based on the probability distribution, the target face feature in the pre-registered face features is weighted and summed, and finally the target face feature that is most matched with the current face angle, i.e., the face feature to be matched, is determined.

[0093] In a specific embodiment, the feature redirection network is composed of two fully connected layers and a GELU layer. After the angle feature of the face to be identified and the pre-registered face features are input into the feature redirection network, the first fully connected layer maps the angle feature of the face to be identified and the pre-registered face features to the corresponding feature space, performs probabilistic-driven nonlinear activation in the GELU layer, generates an activation value affected by the statistical characteristics of the input distribution through Gaussian distribution weighting, and then inputs the activation value into the second fully connected layer to obtain a feature redirection indication result pointing to the corresponding target face feature in the pre-registered face features. The corresponding target face feature in the pre-registered face features is extracted according to the feature redirection indication result to obtain the face feature to be matched.

[0094] In a specific embodiment, the face feature extraction network, the feature fusion network, the angle feature extraction network, the angle encoder, and the feature redirection network described above constitute a face recognition model. The loss function for training the face recognition model is as follows:

[0095] ,

[0096] ,

[0097] ,

[0098] wherein, is a total loss of the face recognition model, is a weight parameter, is a feature invariant loss, is a feature distance loss, is an i-th to-be-matched face feature of a current pre-registered face, is an i-th target face feature in the pre-registered face feature, and n is a number of multi-angle face features in the pre-registered face library, is a to-be-matched face feature searched based on the angle feature of the to-be-identified face, is a to-be-identified face feature, is a to-be-matched face feature of another pre-registered face.

[0099] Please refer to Figure 5 , the embodiment of the present application also provides a face recognition device, which can realize the face recognition method described above, and the device comprises:

[0100] A first module 501 is configured to acquire a to-be-identified image.

[0101] A second module 502 is configured to extract a target face feature in the to-be-identified image to obtain a to-be-identified face feature.

[0102] A third module 503 is configured to extract a face angle feature in the to-be-identified image to obtain a to-be-identified face angle feature.

[0103] A fourth module 504 is configured to extract a target face feature corresponding to the to-be-identified face angle feature in a pre-registered face feature to obtain a to-be-matched face feature; the pre-registered face feature comprises target face features in multiple groups of pre-registered images of the same face collected from multiple angles.

[0104] A fifth module 505 is configured to generate a face recognition result of the to-be-identified image according to a similarity between the to-be-identified face feature and the to-be-matched face feature.

[0105] The specific implementation of the face recognition device is basically the same as that of the specific embodiment of the face recognition method described above, and thus will not be described here again.

[0106] Figure 6 is a block diagram of an electronic device according to an exemplary embodiment.

[0107] The electronic device 600 according to this embodiment of the present disclosure will be described below with reference to Figure 6 . Figure 6The electronic device 600 shown is merely one example and should not be taken as limiting the scope of functionality or use of embodiments of the disclosure.

[0108] As shown, the electronic device 600 is in the form of a general computing device. Components of the electronic device 600 can include, but are not limited to, at least one processing unit 610, at least one storage unit 620, a bus 630 that connects different system components, including the storage unit 620 and the processing unit 610, a display unit 640, and the like. Figure 6

[0109] The storage unit stores program code that can be executed by the processing unit 610, such that the processing unit 610 performs the steps described in the face recognition method section above according to various exemplary embodiments of the disclosure.

[0110] The storage unit 620 can include a readable medium in the form of volatile storage such as random access memory (RAM) 6201 and / or cache memory 6202, and can further include a non-volatile storage such as read-only memory (ROM) 6203.

[0111] The storage unit 620 can also include program / utility 6204 having a set of at least one program modules 6205, such as an operating system, one or more application programs, other program modules, and program data, each or some combination thereof, which may

[0112] The bus 630 can be representative of one or more of several types of bus structures, including a storage bus or bus controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus structures, and the like.

[0113] ​The electronic device 600 can also communicate with one or more external devices 600' such as a keyboard, a pointing device, a Bluetooth device, etc.; and can communicate with one or more devices that enable a user to interact with the electronic device 600 and / or one or more devices (e.g. routers, modems, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface 650. Still yet, the electronic device 600 can communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or the Internet) via network adapter 660. The network adapter 660 can communicate with the other components of the electronic device 600 via bus 630. It should be understood that, although not shown, other hardware and / or software components could be used in conjunction with the electronic device 600. These include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0114] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the face recognition method.

[0115] The face recognition method, device, equipment and storage medium provided by the embodiment of the present application are used for face feature extraction and face angle feature extraction on the to-be-recognized image, obtaining the target face feature corresponding to the to-be-recognized face angle feature from the pre-registered face feature, obtaining the to-be-matched face feature, and then generating the face recognition result of the to-be-recognized image according to the similarity between the to-be-recognized face feature and the to-be-matched face feature. Since the to-be-matched face feature extracted from the pre-registered face feature is the target face feature having the face angle feature matched with the to-be-recognized face angle feature, the face recognition scene of multiple face angles can be adapted, and the face recognition precision is improved.

[0116] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a plurality of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to perform the above-mentioned method according to the embodiments of the present disclosure.

[0117] The program product can employ any combination of one or more computer readable media. The computer readable media can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0118] The computer readable storage medium can include a computer-readable medium in baseband or propagated as a carrier wave in a propagated signal, wherein the propagated signal can take any of a variety of forms, including but not limited to, electromagnetic, optical, or any suitable combination thereof. One skilled in the art will recognize the computer readable storage medium as an example of tangible storage that can be used to store a program and / or instructions that can be executed by a processor to implement various aspects of the present disclosure. A computer readable storage medium can be any available medium or media that can be accessed by a computer. By way of example, and not limitation, such computer readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium or media that can be used to

[0119] Those skilled in the art can understand that the above-mentioned modules can be distributed in the device according to the description of the embodiments, and can also be changed in one or more devices different from the embodiments. The modules of the above-mentioned embodiments can be combined into one module, or can be further split into multiple sub-modules.

[0120] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structure, arrangement or implementation method described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent arrangements within the spirit and scope of the appended claims.

Claims

1. A face recognition method, characterized in that: include: Obtain the image to be recognized; Extracting target facial features from the image to be identified to obtain facial features to be identified; Extracting facial angle features from the image to be identified to obtain facial angle features to be identified; Extracting target facial features corresponding to the angle features of the face to be identified from the pre-registered facial features to obtain facial features to be matched; the pre-registered facial features include target facial features from multiple sets of pre-registered images obtained by capturing the same face from multiple angles; Generating a face recognition result of the image to be recognized based on the similarity between the face features to be recognized and the face features to be matched; The step of extracting target facial features corresponding to the face angle features to be identified from the pre-registered facial features includes: Performing feature redirection on the pre-registered facial features according to a mapping relationship between the facial angle features to be identified and the target facial features in the pre-registered facial features, so as to extract the corresponding target facial features in the pre-registered facial features and obtain the facial features to be matched; The face recognition method is performed by a face recognition model, and the loss function for training the face recognition model is as follows: , , , in, is the total loss of the face recognition model, is the weight parameter, is the feature invariance loss, is the feature distance loss, is the i-th facial feature to be matched for the current pre-registered face, is the i-th target face feature in the pre-registered face feature, n is the number of multi-angle faces in the pre-registered face database, is the face feature to be matched obtained by searching based on the angle feature of the face to be identified. is the facial feature to be recognized, The facial features to be matched for other pre-registered faces.

2. The face recognition method according to claim 1, characterized in that Also includes: Obtain multiple sets of pre-registered images corresponding to several groups of faces; Extracting target facial features from the pre-registered image; The target facial features in the pre-registered image are fused to obtain the pre-registered facial features.

3. The face recognition method according to claim 2, characterized in that: The fusing of target facial features in the pre-registered images includes: Splicing the target facial features in the pre-registered images to obtain a first spliced ​​feature; Performing nonlinear activation processing on the first splicing feature to obtain a first activation feature; Performing a multi-head attention mechanism on the first activation feature to obtain an attention weight feature; The first activation feature and the attention weight feature are superimposed to obtain the pre-registered face feature.

4. The face recognition method according to claim 1, characterized in that The extracting of facial angle features from the image to be identified includes: Extracting yaw angle features and pitch angle features of the face in the image to be recognized; Angle coding processing is performed on the yaw angle feature and the pitch angle feature to obtain the angle feature of the face to be identified.

5. The face recognition method according to claim 4, characterized in that: The performing angle encoding processing on the yaw angle feature and the pitch angle feature includes: splicing the yaw angle feature and the pitch angle feature to obtain a second spliced ​​feature; The second splicing feature is mapped to a preset feature space to obtain the angle feature of the face to be identified.

6. The face recognition method according to claim 1, characterized in that: The feature redirection of the pre-registered facial features according to the mapping relationship between the face angle feature to be identified and the target facial feature in the pre-registered facial features includes: Splicing the pre-registered facial features and the angle features of the face to be identified to obtain a third spliced ​​feature; Performing probabilistic activation processing on the third splicing feature to obtain a second activation feature; The corresponding target facial features in the pre-registered facial features are extracted according to the second activation features to obtain the facial features to be matched.

7. A face recognition device, characterized in that: include: The first module is used to obtain an image to be identified; The second module is used to extract the target facial features in the image to be identified to obtain the facial features to be identified; The third module is used to extract the facial angle features in the image to be identified to obtain the facial angle features to be identified; The fourth module is used to extract the target facial features corresponding to the angle features of the face to be identified from the pre-registered facial features to obtain the facial features to be matched; the pre-registered facial features include the target facial features in multiple groups of pre-registered images obtained by capturing the same face from multiple angles; A fifth module is configured to generate a face recognition result of the image to be recognized based on the similarity between the face features to be recognized and the face features to be matched; The step of extracting target facial features corresponding to the face angle features to be identified from the pre-registered facial features includes: Performing feature redirection on the pre-registered facial features according to a mapping relationship between the facial angle features to be identified and the target facial features in the pre-registered facial features, so as to extract the corresponding target facial features in the pre-registered facial features and obtain the facial features to be matched; The face recognition method is performed by a face recognition model, and the loss function for training the face recognition model is as follows: , , , in, is the total loss of the face recognition model, is the weight parameter, is the feature invariance loss, is the feature distance loss, is the i-th facial feature to be matched for the current pre-registered face, is the i-th target face feature in the pre-registered face feature, n is the number of multi-angle faces in the pre-registered face database, is the face feature to be matched obtained by searching based on the angle feature of the face to be identified. is the facial feature to be recognized, The facial features to be matched for other pre-registered faces.

8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the face recognition method according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the face recognition method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Face recognition method and device, robot and storage medium

    CN109543633A

  • Face recognition method, device and system, computing equipment and storage medium

    CN112016508A

  • Face feature extraction model training method, face feature extraction method and device

    CN119810894A