A method and device for face recognition

By determining the occlusion and influence of the area of interest in face recognition, and adjusting the features using the graph neural network, the problem of accuracy degradation caused by environmental occlusion is solved, and a higher recognition accuracy is achieved.

CN114764933BActive Publication Date: 2025-08-05GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011633996.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2025-08-05
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

In the prior art, the face area in the image due to environmental complexity is blocked, which affects the accuracy of face recognition. Especially when it is blocked by objects such as sunglasses, masks, and mobile phones, the predicted blocking part does not match the actual situation, resulting in the generated unblocked face area with identity interference information, which reduces the recognition accuracy.

Method used

By obtaining the face key points in the image to be identified, multiple areas of interest are determined, the occlusion and influence of each area are calculated, the area features are adjusted and compared with the reference face area features, and the graph neural network is used for feature fusion and weighting operations to improve the recognition accuracy.

Benefits of technology

By capturing the relationship between occlusion information and the region, the interference information related to occlusion is reduced, the accuracy of face recognition is improved, and more accurate identity authentication is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114764933B_ABST
    Figure CN114764933B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method and apparatus for face recognition, which are applied to the field of image processing technology. The method includes: obtaining facial key points of a first face region in an image to be recognized; determining multiple first regions of interest from the first face region based on the obtained facial key points, and extracting first region features of each first region of interest; determining occluded regions in the first face region, and calculating a first occlusion degree of each first region of interest based on the determined occlusion regions; obtaining a first influence degree between each first region of interest determined based on the calculated first occlusion degree; adjusting each first region feature based on the obtained first influence degree, comparing the adjusted first region feature with the second region feature, and obtaining a face recognition result for the first face region. Using the solution provided by the embodiments of the present application to recognize faces can improve the accuracy of face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for face recognition. Background Art

[0002] Facial recognition technology is a technology that uses information in the facial area to authenticate identity. It has been widely used in many fields such as access control and attendance, security checks and clearance, security monitoring, and financial payments.

[0003] Due to the complexity of the environment, the facial areas in the collected images are often blocked by objects such as sunglasses, masks, mobile phones, and water cups, which affects the accuracy of face recognition.

[0004] In order to perform face recognition on an occluded face area, the occluded part of the face area is often predicted through the unoccluded part of the face area, and then the unoccluded face area is generated, and finally face recognition is performed based on the generated face area.

[0005] Since the occluded part of the predicted face area often does not completely match the actual occluded part of the face area, the generated unoccluded face area often contains identity interference information, resulting in low accuracy of face recognition. Summary of the Invention

[0006] The purpose of the embodiments of the present application is to provide a method and apparatus for face recognition to improve the accuracy of face recognition. The specific technical solutions are as follows:

[0007] The present invention provides a method for face recognition, including:

[0008] Obtaining facial key points of the first face area in the image to be recognized;

[0009] determining a plurality of first regions of interest from the first face region according to the acquired facial key points, and extracting a first region feature of each first region of interest;

[0010] Determining an obscured area in the first facial area, and calculating a first obscuration degree of each first region of interest based on the determined obscured area;

[0011] Obtaining a first influence degree between each first region of interest determined according to the calculated first occlusion degree;

[0012] Adjust each first area feature according to the obtained first influence degree, compare the adjusted first area feature with the second area feature, and obtain the face recognition result of the first face area, wherein the second area feature is: the feature obtained by adjusting the area feature of each second region of interest according to each second influence degree, and each second region of interest is: the area corresponding to each first region of interest in the second face area preset in the reference face image.

[0013] In one embodiment of the present application, comparing the adjusted first region features with the second region features to obtain a face recognition result of the first face region includes:

[0014] Calculating the similarity between the adjusted first region feature of each first region of interest and the corresponding second region feature as the similarity corresponding to each first region of interest;

[0015] Determining, based on the first occlusion degree of each first region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first facial region;

[0016] performing a weighted operation on the similarities corresponding to the first regions of interest according to the determined weights, and obtaining an operation result as the similarity between the first facial region and the second facial region;

[0017] Determine a face recognition result of the first face area according to the obtained similarity.

[0018] In one embodiment of the present application, determining, based on the first occlusion degree of each first region of interest, the weight of the first region feature of each first region of interest relative to the feature of the first facial region includes:

[0019] Based on the first occlusion degree of each first region of interest and the second occlusion degree of the corresponding second region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first face region is determined.

[0020] In one embodiment of the present application, comparing the adjusted first region features with the second region features to obtain a face recognition result of the first face region includes:

[0021] According to the first occlusion degree of each first region of interest, feature fusion is performed on the first region features of each first region of interest to obtain a first fused feature, and according to the second occlusion degree of each second region of interest, feature fusion is performed on the second region features of each second region of interest to obtain a second fused feature;

[0022] Calculating the similarity between the first fusion feature and the second fusion feature;

[0023] Determine a face recognition result of the first face area according to the calculated similarity.

[0024] In one embodiment of the present application, the first influence between the first regions of interest is calculated according to the following expression:

[0025] A ij =max(occlusion i , thd)*(1- occlusion j )

[0026] Among them, A ij is the first influence of the first region of interest j on the first region of interest i, and the occlusion degree i Indicates the occlusion degree of the first region of interest i, occlusion degree j represents the occlusion degree of the first region of interest j, and thd is a preset threshold.

[0027] In one embodiment of the present application, adjusting each first region feature according to the obtained first influence, and comparing the adjusted first region features with the second region features to obtain a face recognition result of the first face region includes:

[0028] Inputting each first region feature, a first influence degree between each first region of interest, a region feature of each second region of interest, and a second influence degree between each second region of interest into a pre-trained graph neural network, so that the graph neural network adjusts each first region feature based on each first influence degree to obtain an adjusted first region feature, and adjusts each second region feature based on each second influence degree to obtain a second region feature, and compares the adjusted first region feature with the second region feature, and outputs a face recognition result;

[0029] Obtain the face recognition result output by the graph neural network model.

[0030] In one embodiment of the present application, determining a plurality of first regions of interest from the first face region based on the obtained facial key points includes:

[0031] Determining the region type to which each facial key point belongs based on the obtained key point types of the facial key points and the correspondence between the preset facial key point types and the region types of the first region of interest;

[0032] For each region type, based on the position information of the facial key points belonging to the region type, the center position of the region of interest belonging to the region type is obtained, and the inter-region distance between the center position of the region of interest belonging to the region type and the center position of the adjacent region of interest is determined; and the region size of the region of interest belonging to the region type is calculated based on the determined inter-region distance;

[0033] Based on the obtained center positions and the calculated region sizes, a first region of interest to which each center position belongs is determined.

[0034] In one embodiment of the present application, extracting facial features within each first region of interest includes:

[0035] Extracting a global feature map of a first face region in the image to be recognized;

[0036] Determining, based on a position of each first region of interest in the first facial region, a feature region corresponding to each first region of interest in the global feature map;

[0037] According to a preset feature map size, transform the feature region of each first region of interest to generate a feature map of the same size as the preset feature map;

[0038] The facial features corresponding to the feature maps of each first region of interest are determined as the facial features within each first region of interest.

[0039] The present invention also provides a face recognition device, including:

[0040] A key point acquisition module is used to obtain facial key points of the first face area in the image to be recognized;

[0041] a feature extraction module, configured to determine a plurality of first regions of interest from the first face region based on the acquired facial key points, and extract a first region feature of each first region of interest;

[0042] an occlusion degree calculation module, configured to determine an occlusion area in the first facial area, and calculate a first occlusion degree of each first region of interest according to the determined occlusion area;

[0043] An influence degree obtaining module, configured to obtain a first influence degree between each first region of interest determined according to the calculated first occlusion degree;

[0044] A feature comparison module is used to adjust the features of each first area according to the obtained first influence degree, compare the adjusted first area features with the second area features, and obtain the face recognition result of the first face area, wherein the second area features are: the features obtained by adjusting the area features of each second region of interest according to each second influence degree, and each second region of interest is: the area corresponding to each first region of interest in the second face area preset in the reference face image.

[0045] In one embodiment of the present application, the feature comparison module includes:

[0046] A similarity calculation submodule, configured to calculate the similarity between the adjusted first region feature of each first region of interest and the corresponding second region feature, as the similarity corresponding to each first region of interest;

[0047] a weight determination submodule, configured to determine, based on the first occlusion degree of each first region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first facial region;

[0048] an operation submodule, configured to perform a weighted operation on the similarities corresponding to the first regions of interest according to the determined weights, and obtain an operation result as the similarity between the first facial region and the second facial region;

[0049] The face recognition submodule is configured to determine a face recognition result of the first face area according to the obtained similarity.

[0050] In one embodiment of the present application, the weight determination submodule is specifically used to determine the weight of the first area feature of each first area of interest relative to the feature of the first face area based on the first occlusion degree of each first area of interest and the second occlusion degree of the corresponding second area of interest.

[0051] In one embodiment of the present application, the feature comparison module includes:

[0052] a feature fusion submodule, configured to perform feature fusion on the first region features of each first region of interest according to the first occlusion degree of each first region of interest to obtain a first fused feature, and perform feature fusion on the second region features of each second region of interest according to the second occlusion degree of each second region of interest to obtain a second fused feature;

[0053] A similarity calculation submodule, configured to calculate the similarity between the first fusion feature and the second fusion feature;

[0054] The face recognition submodule is configured to determine a face recognition result of the first face area according to the calculated similarity.

[0055] In one embodiment of the present application, the first influence between the first regions of interest is calculated according to the following expression:

[0056] A ij =max(occlusion i , thd)*(1- occlusion j )

[0057] Among them, A ij is the first influence of the first region of interest j on the first region of interest i, and the occlusion degree i Indicates the occlusion degree of the first region of interest i, occlusion degree j represents the occlusion degree of the first region of interest j, and thd is a preset threshold.

[0058] In one embodiment of the present application, the feature comparison module is specifically used to input each first region feature, the first influence degree between each first region of interest, the region feature of each second region of interest, and the second influence degree between each second region of interest into a pre-trained graph neural network, so that the graph neural network adjusts each first region feature based on each first influence degree to obtain an adjusted first region feature, and adjusts the region feature of each second region of interest based on each second influence degree to obtain a second region feature, and compares the adjusted first region feature with the second region feature to output a face recognition result; and obtains the face recognition result output by the graph neural network model.

[0059] In one embodiment of the present application, the feature extraction module includes:

[0060] a region type determination submodule, configured to determine the region type to which each facial key point belongs based on the acquired key point type of the facial key point and a correspondence between the preset facial key point type and the region type of the first region of interest;

[0061] a region information determination submodule for obtaining, for each region type, a center position of a region of interest belonging to that region type based on the position information of facial key points belonging to that region type, determining an inter-region distance between the center position of the region of interest belonging to that region type and the center position of an adjacent region of interest, and calculating a region size of the region of interest belonging to that region type based on the determined inter-region distance;

[0062] The region determination submodule is configured to determine the first region of interest to which each center position belongs based on the obtained center position and the calculated region size.

[0063] In one embodiment of the present application, the feature extraction module includes:

[0064] A global feature extraction submodule, configured to extract a global feature map of the first face region in the image to be identified;

[0065] a feature region determination submodule, configured to determine, based on a position of each first region of interest in the first face region, a feature region corresponding to each first region of interest in the global feature map;

[0066] A feature map generating submodule, configured to transform the feature region of each first region of interest according to a preset feature map size to generate a feature map having a size of the preset feature map size;

[0067] The facial feature determination submodule is used to determine the facial features corresponding to the feature map of each first region of interest as the facial features in each first region of interest.

[0068] An embodiment of the present application further provides an electronic device, characterized in that it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0069] Memory for storing computer programs;

[0070] The processor is configured to implement any of the above-mentioned face recognition method steps when executing the program stored in the memory.

[0071] An embodiment of the present application further provides a computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the above-mentioned face recognition method steps is implemented.

[0072] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described face recognition methods.

[0073] Beneficial effects of the embodiments of the present application:

[0074] An embodiment of the present application provides a method and device for face recognition, which determines multiple first regions of interest from a first face region, and then calculates the influence between the first regions of interest based on the occlusion degree of each first region of interest. Since the first influence of each first region of interest is obtained based on the occlusion degree of each first region of interest, the influence between the first regions of interest includes the occlusion information in the first face image. The process of adjusting the first region features using the first influence degree is equivalent to adjusting the first region features of each first region of interest based on the occlusion information in the first person image, thereby reducing the interference information related to occlusion contained in the first face image caused by occlusion, thereby improving the accuracy of face recognition.

[0075] Furthermore, the influence between the first regions of interest is determined by the occlusion degree of each first region of interest, thereby capturing the relationship between the first regions of interest, and then using the captured relationship between regions to realize face recognition, further improving the accuracy of face recognition.

[0076] Of course, it is not necessary to achieve all the advantages described above at the same time when implementing any product or method of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without any creative work.

[0078] Figure 1 A flowchart of a face recognition method provided in one embodiment of the present application.

[0079] Figure 2 A partial flow chart of a face recognition method provided in one embodiment of the present application.

[0080] Figure 3 A partial flow chart of a face recognition method provided in another embodiment of the present application.

[0081] Figure 4 A partial flow chart of a face recognition method provided in yet another embodiment of the present application.

[0082] Figure 5 A partial flow chart of a face recognition method provided in yet another embodiment of the present application.

[0083] Figure 6 A schematic diagram of a feature extraction model provided for one embodiment of the present application.

[0084] Figure 7 A schematic diagram of the structure of a face recognition device provided in one embodiment of the present application.

[0085] Figure 8 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0086] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0087] This embodiment of the present application provides a method for face recognition, the method comprising:

[0088] S101: Obtain facial key points of a first face region in an image to be recognized.

[0089] S102: Determine a plurality of first regions of interest from the first face region according to the acquired facial key points, and extract a first region feature of each first region of interest.

[0090] S103: Determine an obstruction area in the first face area, and calculate a first obstruction degree of each first region of interest according to the determined obstruction area.

[0091] S104: Obtaining a first influence degree between first regions of interest determined according to the calculated first occlusion degree.

[0092] S105: Adjust each first region feature according to the obtained first influence degree, compare the adjusted first region feature with the second region feature, and obtain the face recognition result of the first face region, wherein the second region feature is: the feature obtained by adjusting the region feature of each second region of interest according to each second influence degree, and each second region of interest is: the region corresponding to each first region of interest in the second face region preset in the reference face image.

[0093] The embodiments of this application provide Figure 1The face recognition method shown determines multiple first regions of interest from the first face region, and then calculates the influence between the first regions of interest based on the occlusion degree of each first region of interest. Since the first influence of each first region of interest is obtained based on the occlusion degree of each first region of interest, the influence between the first regions of interest includes the occlusion information in the first face image. The process of adjusting the first region features using the first influence is equivalent to adjusting the first region features of each first region of interest based on the occlusion information in the first person image, thereby reducing the interference information related to occlusion contained in the first face image caused by occlusion, thereby improving the accuracy of face recognition.

[0094] Furthermore, the similarity between the first regions of interest is determined by the occlusion degree of each first region of interest, thereby capturing the relationship between the first regions of interest, and then using the captured inter-regional relationship to realize face recognition, further improving the accuracy of face recognition.

[0095] In order to clearly illustrate the technical solution of the embodiment of the present application, the following describes the following steps in detail: Figure 1 The face recognition method shown.

[0096] For step S101, the image to be identified can be an image of a face containing identity information to be verified, which is collected in scenarios such as access control and attendance, security check and clearance, financial payment, etc., or it can be an image collected in a security monitoring scenario. Optionally, the image to be identified referred to in the embodiment of the present invention can be an image obtained after preprocessing the collected original image. For example, if the original image contains multiple face areas, in order to perform face recognition more targetedly, after the areas belonging to the face are identified, each area belonging to the face can be cropped, and the cropped image to which each area belonging to the face belongs can be the image to be identified referred to in the embodiment of the present application.

[0097] In one embodiment of the present application, facial key points of the first face region in the image to be identified can be obtained by performing facial key point detection on the image to be identified. The specific detection method can be determined in combination with actual needs and scenarios. For example, a trained facial key point detection model can be used to detect facial key points on the image to be identified. The facial key point detection model can be a face detection model, which can include but is not limited to Boosting (boosting method), Fast RCNN (Fast Region Convolutional Neural Networksm, fast regional convolutional neural network), Faster RCNN (Faster Region Convolutional Neural Networksm, faster regional convolutional neural network), Yolo (You Only Look Once, you only look once), SSD (Single Shot MultiBox Detector, single shot multi-box detector) and other machine learning models. Optionally, the facial key points of the first face region can also be obtained by manual labeling.

[0098] Optionally, the number of facial key points in the first facial area can also be determined based on the scenario and requirements. For example, the number of facial key points can be 3: left eye key point, right eye key point and mouth center key point. The number of facial key points can also be 5: left eye key point, right eye key point, nose tip key point, left corner of mouth key point and right corner of mouth key point. The number of facial key points can also be 68 more specific key points.

[0099] In one embodiment of the present application, after detecting the facial key points of the original face area, the posture of the face contained in the original face area is adjusted to a preset posture through rotation, displacement, scaling, etc. based on the detected facial key points. For example, if the face in the original face area is tilted to the left, the original face area can be rotated to the right to "straighten" the face. The adjusted face area is the first face area referred to in the embodiment of the present application, and the adjusted facial key points are the facial key points belonging to the first face area in the image to be identified. Optionally, the above rotation, displacement, and scaling can be specifically achieved through affine transformation.

[0100] With respect to step S102 , the first region of interest is determined based on facial key points. The first region of interest may include part of the facial key points, may not include the facial key points, or may include all the facial key points.

[0101] Exemplarily, when the facial key points of the first facial area include: the left eye key point, the right eye key point, and the mouth center key point, the determined first region of interest includes: the left eye area including the left eye key point, the right eye area including the right eye key point, and the mouth area including the mouth center key point. Optionally, the first region of interest can also be the first facial area including the left eye key point, the right eye key point, and the mouth center key point. Optionally, when the facial key points of the first facial area include: the upper corner of the mouth key point, the lower corner of the mouth key point, the left corner of the mouth key point, and the right corner of the mouth key point, the first region of interest can be the inscribed area of the upper corner of the mouth key point, the lower corner of the mouth key point, the left corner of the mouth key point, and the right corner of the mouth key point, such as an inscribed rectangle.

[0102] In one embodiment of the present application, the first region features extracted from each first region of interest may be various features such as color, texture, and edge of the first region of interest. For example, for the left eye region, the first region features extracted may be the color and texture of the left eye.

[0103] For step S103, the obscured area in the first face area is the area in the first face area where the obstructing object is located, such as the face part obscured by face accessories such as sunglasses, masks, hats, bangs, etc., or the face part obscured by other obstructing objects such as mobile phones, hands, and objects in the foreground.

[0104] Optionally, the occluded area in the first face area may be determined by a pre-trained occlusion detection model. Optionally, the occluded area in the first face area may also be determined by manual labeling.

[0105] Based on the occlusion area determined in the first face area, the part of each first region of interest that belongs to the occlusion area can be determined, and then the proportion of the part of each first region of interest that belongs to the occlusion area in the first region of interest can be calculated, where the calculated proportion is the first occlusion degree of each first region of interest being occluded.

[0106] In one embodiment of the present application, a first occlusion degree of each first region of interest can be determined based on pixels. Optionally, after determining the occlusion area of the first facial region, the first pixel belonging to the occlusion area and the second pixel belonging to the unoccluded facial region can be determined among the pixels contained in the first facial region, thereby determining the number of first pixels and second pixels contained in each first region of interest. For each first region of interest, after determining the sum of the first number of first pixels and the second number of second pixels contained therein, the first occlusion degree of the first region of interest can be determined based on the first number and second number of the first regions of interest.

[0107] For step S104, the first occlusion degree of each first region of interest can reflect the amount of interference information contained in the first region feature of the first region of interest. The greater the occlusion degree, the larger the portion of the first region of interest that is occluded. For the first region of interest, the portion that is blocked by the occluder cannot be used for face recognition. Therefore, the first region feature of the first region of interest contains more interference information.

[0108] For any two first regions of interest, the first influence of each first region of interest on the other first region of interest reflects: the degree of influence of the first feature of the first region of interest on the first region feature of the other first region of interest, that is, the greater the occlusion degree of one first region of interest, the smaller its first influence on the other first region of interest, and the greater the occlusion degree of the other first region of interest, the smaller its first influence on the first region of interest.

[0109] In one embodiment of the present application, the first influence between the first regions of interest can be calculated according to the following expression:

[0110] A ij =max(occlusion i , thd)*(1- occlusion j )

[0111] Among them, A ij is the first influence of the first region of interest j on the first region of interest i, and the occlusion degree i Indicates the occlusion degree of the first region of interest i, occlusion degree j represents the occlusion degree of the first region of interest j, and thd is a preset threshold.

[0112] Regarding step S105 , for a human face, various parts thereof do not exist independently, that is, various first regions of interest have certain correlations. Therefore, the first region features of various first regions of interest may be adjusted based on the correlations among the various first regions of interest.

[0113] Optionally, for a region of interest, the intensity of adjusting the first region feature of the first region of interest is proportional to the first influence between the first region of interest and other first regions of interest. The greater the first influence, the greater the intensity of the adjustment.

[0114] For each image to be recognized for face recognition, in order to identify the information of the person corresponding to the face area to be recognized, a reference face image with known person information is needed to compare it with it to determine whether the person corresponding to the first face area in the image to be recognized and the second face area preset in the reference face image are the same. If they are the same, the known person information is used as the person information of the person corresponding to the image to be recognized to complete face recognition.

[0115] For the second face area in the reference face image, the second region of interest, the region features of the second region of interest, the second influence between the second regions of interest, and the second region features obtained by adjusting the region features based on the second influence can be predetermined.

[0116] Optionally, the reference facial image is processed according to steps S101 to S104 to obtain a second region feature of a second region of interest of a second facial region in the reference facial image.

[0117] In one embodiment, for each first region of interest, the second region of interest corresponding to the first region of interest may be: a second region of interest whose position in the second face region is the same as the position of the first region of interest in the first face region, or a second region of interest whose region type is the same as that of the first region of interest, or a second region of interest that meets both of the above conditions.

[0118] For example, when the first ROI is the inscribed rectangle of the upper, lower, left, and right corners of the mouth key points in the first facial region, the second ROI corresponding to the first ROI may be: if the position in the second facial region is the same as the position of the first ROI in the first facial region, that is, the second ROI may be the inscribed rectangle of the upper, lower, left, and right corners of the mouth key points in the second facial region.

[0119] Alternatively, when the region type of the first region of interest is the left eye region type, the second region of interest corresponding to the first region of interest may be: a second region of interest in the second face region whose region type is the left eye region type.

[0120] Alternatively, when the first region of interest is the inscribed rectangle of the upper corner of the mouth key point, the lower corner of the mouth key point, the left corner of the mouth key point and the right corner of the mouth key point in the first facial region, and the region type is a mouth region type, then the second region of interest corresponding to the first region of interest can be: the inscribed rectangle of the upper corner of the mouth key point, the lower corner of the mouth key point, the left corner of the mouth key point and the right corner of the mouth key point in the second facial region, and the second region of interest is a mouth region type.

[0121] In one embodiment of the present application, step S105 may be implemented based on a pre-trained graph neural network model, including:

[0122] Inputting each first region feature, the first influence between each first region of interest, the region feature of each second region of interest, and the second influence between each second region of interest into a pre-trained graph neural network, so that the graph neural network adjusts each first region feature based on each first influence to obtain an adjusted first region feature, and adjusts each second region feature based on each second influence to obtain a second region feature, and compares the adjusted first region feature with the second region feature, and outputs a face recognition result;

[0123] Get the face recognition results output by the graph neural network model.

[0124] Optionally, the first region features of each first region of interest, the region features of each second region of interest, and an adjacency matrix recording the first influences between the first regions of interest and the second influences between the second regions of interest are used as inputs to the graph neural network. In one embodiment, to provide richer information, the adjacency matrix may also include the influence between the first region of interest and the second region of interest.

[0125] In one embodiment of the present application, the graph neural network can adopt different architectures. Optionally, the graph neural network can be constructed in the following manner. The definition of the graph convolution layer of the graph convolutional neural network is as follows:

[0126] Y=σ(W[X||G(X,A)]+B)

[0127] in, N is the number of first regions of interest contained in the first face region, d in Represents the length of the first region feature, A is the above-mentioned adjacency matrix, G() represents the aggregation function, || represents merging, W represents weight, B represents offset, σ() represents activation function, and Y represents the output result of the graph convolution layer. d in Indicates the length of the output feature.

[0128] Furthermore, the multi-layer perceptron (MLP) is used to perform nonlinear changes on the output of the graph neural network to obtain the final similarity.

[0129] The following describes an embodiment of the present application in conjunction with a specific embodiment of the present application:

[0130] In such Figure 1 Based on the face recognition method shown in FIG, the embodiment of the present application further provides a face recognition method, such as Figure 2 The flowchart of some steps is shown, and the implementation of step S105 includes:

[0131] S201: Calculating the similarity between the adjusted first region feature of each first region of interest and the corresponding second region feature as the similarity corresponding to each first region of interest.

[0132] In this step, the similarity between the adjusted first region feature and the second region feature can be determined based on the feature matrix corresponding to the first region feature and the second region feature. By calculating the cosine similarity between the feature matrix corresponding to the first region feature and the feature matrix corresponding to the second region feature, the similarity between the adjusted first region feature and the corresponding second region feature is calculated. Optionally, the greater the cosine similarity, the higher the similarity.

[0133] S202: Determine, based on the first occlusion degree of each first region of interest, a weight of the first region feature of each first region of interest with respect to the feature of the first face region.

[0134] In this step, as can be seen from the above, the greater the first occlusion degree, the more interference information is contained in the first area feature of the first region of interest. From a global perspective, the greater the first occlusion degree, the smaller the weight of the first area feature of the first region of interest for the feature of the first face region.

[0135] Optionally, in one implementation, a correspondence between occlusion degree and weight may be pre-established. After determining the first occlusion degree of each first region of interest, the weight corresponding to the first occlusion degree of each first region of interest may be determined based on the correspondence.

[0136] Optionally, in another implementation, each region of interest may be scored based on the first occlusion degree of each region of interest, and the ratio of the scores of each region of interest is used as the weight of each first region of interest.

[0137] Optionally, in another implementation, the weight of the first region feature of each first region of interest relative to the feature of the first face region may be determined based on the first occlusion degree of each first region of interest and the second occlusion degree of the corresponding second region of interest.

[0138] S203: performing a weighted operation on the similarities corresponding to the first regions of interest according to the determined weights, and obtaining an operation result as the similarity between the first face region and the second face region.

[0139] In this step, the weighted operation can be a weighted summation. For example, the first facial region includes three first regions of interest, namely S1, S2, and S3. The similarity of S1 is 80%, with a weight of 0.5, the similarity of S2 is 50%, with a weight of 0.2, and the similarity of S3 is 90%, with a weight of 0.3. Then, the similarity between the first facial region and the second facial region is: 0.5×80%+0.2×50%+0.3×90%=77%. Optionally, in another implementation, the weighted operation can also be performed by inputting the determined weights into a pre-trained network model, and the network model is trained to obtain the operation results.

[0140] S204: Determine a face recognition result of the first face region according to the obtained similarity.

[0141] In this step, a similarity threshold may be set. When the obtained similarity is greater than the similarity threshold, it is determined that the face in the first facial region is the same as the face in the second facial region; otherwise, they are different.

[0142] The embodiments of this application provide Figure 2 The face recognition method shown in Figure 1 The basis for the beneficial effects of the face recognition method shown is to provide a technical solution for comparing the adjusted first region features with the second region features. Since the similarity of each first region feature is calculated separately, the amount of calculation for each calculation can be reduced.

[0143] In such Figure 1 Based on the face recognition method shown in FIG, the embodiment of the present application further provides a face recognition method, such as Figure 3 The flowchart shown is a partial step, and the implementation of step S105 includes:

[0144] S301: Based on the first occlusion degree of each first region of interest, feature fusion is performed on the first region features of each first region of interest to obtain a first fused feature, and based on the second occlusion degree of each second region of interest, feature fusion is performed on the second region features of each second region of interest to obtain a second fused feature.

[0145] In this step, feature fusion of the first region features of each first region of interest can be performed based on the first occlusion degree of each first region of interest. Generally speaking, first regions of interest with greater first occlusion degrees account for a smaller proportion of the fused region, while first regions of interest with smaller first occlusion degrees account for a larger proportion of the fused region. Specifically, the first features of each first region of interest can be numerically fused.

[0146] The feature fusion of the second region features of each second region of interest is similar to the feature fusion of the first region features of each first region of interest, and will not be repeated here.

[0147] S302: Calculate the similarity between the first fusion feature and the second fusion feature.

[0148] In this step, the similarity between the first fused feature and the second fused feature can be determined by the numerical difference between the feature matrix corresponding to the first fused feature and the feature matrix corresponding to the second fused feature. The smaller the numerical difference between the feature matrix corresponding to the first fused feature and the feature matrix corresponding to the second fused feature, the greater the similarity between the first fused feature and the second fused feature.

[0149] S303: Determine a face recognition result of the first face region according to the calculated similarity.

[0150] The implementation of this step is the same as or similar to step S204 and will not be repeated here.

[0151] The embodiments of this application provide Figure 4 The face recognition method shown in Figure 1 The beneficial effects of the face recognition method shown are based on a technical solution for comparing the adjusted first region features with the second region features. Since the features are first fused and then the similarity is calculated, the calculation steps can be simplified and the calculation efficiency can be improved.

[0152] In one embodiment of the present application, Figure 3 He Ru Figure 4 In the face recognition method shown, the process of obtaining the face recognition result of the first face area by comparing the adjusted first area features with the second area features can be implemented based on a preset graph convolutional neural network.

[0153] Based on the above face recognition method, the embodiment of the present application also provides a face recognition method, such as Figure 4 A flowchart showing some steps for determining a first region of interest is shown, including:

[0154] S401: Determine the region type to which each facial key point belongs based on the acquired key point types of the facial key points and the correspondence between the preset facial key point types and the region types of the first region of interest.

[0155] In this step, the key point types of the facial key points may include: left eye type, right eye type, nose type, mouth type, left ear type, right ear type, left cheek type, right cheek type, chin type, forehead type, etc.

[0156] The correspondence between the preset facial key point types and the region types of the first region of interest can be a one-to-one correspondence, such as a left eye type corresponding to a left eye region type, a right eye type corresponding to a right eye region type, and a mouth type corresponding to a mouth region type. Alternatively, the preset correspondence can be such that multiple key point types correspond to one region type, or one key point type corresponds to multiple region types. For example, the left eye type corresponds to both the left eye region type and the facial region type, eye region type, etc., and the facial region type corresponds to both the left eye type and the nose type, mouth type, etc. The specific correspondence can be determined based on actual needs and experience.

[0157] S402: For each region type, based on the position information of the facial key points belonging to the region type, the center position of the region of interest belonging to the region type is obtained, and the inter-region distance between the center position of the region of interest belonging to the region type and the center position of the adjacent region of interest is determined. According to the determined inter-region distance, the region size of the region of interest belonging to the region type is calculated.

[0158] In this step, for each region type, the average coordinates of the facial key points belonging to the region type may be calculated, and the position corresponding to the calculated average coordinates is used as the center position of the region of interest belonging to the region type.

[0159] After determining the center position of the region of interest of each region type, the distance between adjacent regions of interest can be calculated. Generally speaking, the larger the distance between regions, the larger the region size, where the region size can be the length and width of the region.

[0160] Exemplarily, when the interval between the left-eye ROI belonging to the left-eye region type and the right-eye ROI belonging to the right-eye region type is larger, the lengths of the left-eye ROI and the right-eye ROI are longer.

[0161] Optionally, for the convenience of calculation, a center position and size located under the standard face are first determined for each region of interest, but the center position of the first region of interest is confirmed based on the position information of the first facial key point, and the size of the first region of interest is transformed using the distance between the eyes and the distance from the mouth point to the midpoint of the eyes as scale standards.

[0162] S403: Determine the first region of interest to which each center position belongs based on the obtained center position and the calculated region size.

[0163] In this step, the first region of interest may be a rectangle. In this case, the diagonal coordinate positions of the first region of interest may be determined based on the determined center position and region size.

[0164] Optionally, the first region of interest may be circular. In this case, the radius of the first region of interest may be determined based on the determined center position and region size.

[0165] The embodiments of this application provide Figure 4 The face recognition method shown in Figure 1 The beneficial effects of the face recognition method shown are based on the fact that the first region of interest can be determined in combination with the actual posture and shape of each face region, so that the determined first region of interest is more realistic, further improving the accuracy of face recognition.

[0166] Based on the above face recognition method, the embodiment of the present application also provides a face recognition method, such as Figure 5 The flowchart of some steps is shown to realize the extraction of the first region feature, including:

[0167] S501: Extracting a global feature map of a first face region in an image to be recognized.

[0168] In this step, the global feature map of the first facial region may be texture features, color features, etc. of the first facial region.

[0169] Optionally, the global feature map of the first face region in the image to be identified can be extracted based on the feature extraction layer of the CNN network, and the extracted global feature map is the feature map of the first face region.

[0170] S502: Determine, based on the position of each first region of interest in the first face region, a feature region corresponding to each first region of interest in the global feature map.

[0171] In this step, each pixel point in the first face area exists at a corresponding position in the global feature map. Therefore, the feature area mapped to each first region of interest on the global feature map can be determined based on the mapping relationship between the first face area and the global feature map.

[0172] S503: transforming the feature region of each first region of interest according to a preset feature map size to generate a feature map of the preset feature map size.

[0173] In this step, ROI align or ROI pooling or other methods may be used to convert feature regions of different sizes in each first region of interest into a feature map of a fixed size.

[0174] S504: Determine the facial features corresponding to the feature maps of each first region of interest as the facial features in each first region of interest.

[0175] In this step, the feature map obtained in step S503 may be further processed to obtain facial features in each first region of interest.

[0176] In one embodiment of the present application, Figure 6 As shown in the figure, a schematic diagram of a feature extraction model provided by an embodiment of the present application is shown. In the figure, the leftmost rectangular box is the input image to be identified. After CNN processing, the feature map of the face area in the image to be identified is obtained, and ROI alignment is performed to obtain multiple feature maps of the same size. After FClayers (fully connected layer), a one-dimensional face feature is obtained.

[0177] The embodiments of this application provide Figure 5 The face recognition method shown in Figure 1 The beneficial effects of the face recognition method are based on the use of multi-task training to determine the first region features of each first region of interest, thereby reducing the amount of calculation.

[0178] Based on the same inventive concept, the face recognition method provided by the embodiment of the present application is as follows: Figure 7 As shown, the embodiment of the present application also provides a face recognition device, which includes:

[0179] A key point acquisition module 701 is used to obtain facial key points of a first face region in an image to be recognized;

[0180] A feature extraction module 702 is configured to determine a plurality of first regions of interest from the first face region based on the acquired facial key points, and extract a first region feature of each first region of interest;

[0181] an occlusion degree calculation module 703 for determining an occlusion region in the first face region, and calculating a first occlusion degree of each first region of interest according to the determined occlusion region;

[0182] An influence degree obtaining module 704 is configured to obtain a first influence degree between each first region of interest determined according to the calculated first occlusion degree;

[0183] The feature comparison module 705 is used to adjust the features of each first area according to the obtained first influence degree, and compare the adjusted first area features with the second area features to obtain the face recognition result of the first face area, wherein the second area features are obtained by adjusting the area features of each second region of interest according to each second influence degree, the second influence degree is the influence degree between each second region of interest determined based on each second occlusion degree, each second occlusion degree is the occlusion degree of each second region of interest, and each second region of interest is the area corresponding to each first region of interest in the second face area preset in the reference face image.

[0184] In one embodiment of the present application, the feature comparison module includes:

[0185] A similarity calculation submodule, configured to calculate the similarity between the adjusted first region feature of each first region of interest and the corresponding second region feature, as the similarity corresponding to each first region of interest;

[0186] a weight determination submodule, configured to determine, based on the first occlusion degree of each first region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first face region;

[0187] an operation submodule, configured to perform a weighted operation on the similarities corresponding to the first regions of interest according to the determined weights, and obtain a similarity sum as the similarity between the first face region and the second face region;

[0188] The face recognition submodule is used to determine the face recognition result of the first face area according to the obtained similarity.

[0189] In one embodiment of the present application, the feature comparison module includes:

[0190] a feature fusion submodule, configured to perform feature fusion on the first region features of each first region of interest according to the first occlusion degree of each first region of interest to obtain a first fused feature, and perform feature fusion on the second region features of each second region of interest according to the second occlusion degree of each second region of interest to obtain a second fused feature;

[0191] A similarity calculation submodule, configured to calculate the similarity between the first fusion feature and the second fusion feature;

[0192] The face recognition submodule is used to determine the face recognition result of the first face area according to the calculated similarity.

[0193] In one embodiment of the present application, the first influence between the first regions of interest is calculated according to the following expression:

[0194] A ij =max(occlusion i , thd)*(1- occlusion j )

[0195] Among them, A ij is the first influence of the first region of interest j on the first region of interest i, and the occlusion degree i Indicates the occlusion degree of the first region of interest i, occlusion degree j represents the occlusion degree of the first region of interest j, and thd is a preset threshold.

[0196] In one embodiment of the present application, a feature comparison module is specifically used to input each first region feature, the first influence between each first region of interest, the region feature of each second region of interest, and the second influence between each second region of interest into a pre-trained graph neural network, so that the graph neural network adjusts each first region feature based on each first influence to obtain an adjusted first region feature, and adjusts the region feature of each second region of interest based on each second influence to obtain a second region feature, and compares the adjusted first region feature with the second region feature to output a face recognition result; and obtains a face recognition result output by the graph neural network model.

[0197] In one embodiment of the present application, the feature extraction module includes:

[0198] a region type determination submodule, configured to determine the region type to which each facial key point belongs based on the acquired key point type of the facial key point and a correspondence between the preset facial key point type and the region type of the first region of interest;

[0199] a region information determination submodule for obtaining, for each region type, a center position of a region of interest belonging to that region type based on the position information of facial key points belonging to that region type, determining an inter-region distance between the center position of the region of interest belonging to that region type and the center position of an adjacent region of interest, and calculating a region size of the region of interest belonging to that region type based on the determined inter-region distance;

[0200] The region determination submodule is configured to determine the first region of interest to which each center position belongs based on the obtained center position and the calculated region size.

[0201] In one embodiment of the present application, the feature extraction module includes:

[0202] A global feature extraction submodule is used to extract a global feature map of the first face region in the image to be identified;

[0203] a feature region determination submodule, configured to determine, based on a position of each first region of interest in the first face region, a feature region corresponding to each first region of interest in the global feature map;

[0204] A feature map generation submodule, configured to transform the feature region of each first region of interest according to a preset feature map size to generate a feature map of the preset feature map size;

[0205] The facial feature determination submodule is used to determine the facial features corresponding to the feature map of each first region of interest as the facial features in each first region of interest.

[0206] The embodiments of this application provide Figure 7 The face recognition device shown determines multiple first regions of interest from the first face area, and then calculates the influence between the first regions of interest based on the occlusion degree of each first region of interest. Since the first influence of each first region of interest is obtained based on the occlusion degree of each first region of interest, the influence between the first regions of interest includes the occlusion information in the first face image. The process of adjusting the first region features using the first influence is equivalent to adjusting the first region features of each first region of interest based on the occlusion information in the first person image, thereby reducing the interference information related to occlusion contained in the first face image caused by occlusion, thereby improving the accuracy of face recognition.

[0207] Furthermore, the similarity between the first regions of interest is determined by the occlusion degree of each first region of interest, thereby capturing the relationship between the first regions of interest, and then using the captured inter-regional relationship to realize face recognition, further improving the accuracy of face recognition.

[0208] The present application also provides an electronic device, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0209] Memory 803, used for storing computer programs;

[0210] The processor 801 is configured to execute the program stored in the memory 803, and implement the following steps:

[0211] Obtaining facial key points of the first face area in the image to be recognized;

[0212] Determining a plurality of first regions of interest from the first face region based on the acquired facial key points, and extracting first region features of each first region of interest;

[0213] Determining an obstruction area in the first face area, and calculating a first obstruction degree of each first region of interest based on the determined obstruction area;

[0214] Obtaining a first influence degree between each first region of interest determined according to the calculated first occlusion degree;

[0215] Adjust each first area feature according to the obtained first influence degree, compare the adjusted first area feature with the second area feature, and obtain the face recognition result of the first face area, wherein the second area feature is: the feature obtained by adjusting the area feature of each second region of interest according to each second influence degree, and each second region of interest is: the area corresponding to each first region of interest in the second face area preset in the reference face image.

[0216] The embodiments of this application provide Figure 8 The electronic device shown, since multiple first regions of interest are determined from the first face area, and then the influence between the first regions of interest is calculated based on the occlusion degree of each first region of interest, since the first influence of each first region of interest is obtained based on the occlusion degree of each first region of interest, the influence between the first regions of interest includes the occlusion information in the first face image. The process of adjusting the first region features using the first influence degree is equivalent to adjusting the first region features of each first region of interest based on the occlusion information in the first person image, thereby reducing the interference information related to occlusion contained in the first face image caused by occlusion, thereby improving the accuracy of face recognition.

[0217] Furthermore, the similarity between the first regions of interest is determined by the occlusion degree of each first region of interest, thereby capturing the relationship between the first regions of interest, and then using the captured inter-regional relationship to realize face recognition, further improving the accuracy of face recognition.

[0218] It should be noted that the above-mentioned electronic device implements other embodiments based on face recognition, which are the same as the face recognition method mentioned in the above-mentioned method embodiment part, and will not be repeated here.

[0219] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0220] The communication interface is used for communication between the above electronic device and other devices.

[0221] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0222] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0223] In another embodiment provided in the present application, a computer-readable storage medium is further provided, wherein a computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the steps of any of the above-mentioned face recognition methods are implemented.

[0224] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any face recognition method in the above embodiments.

[0225] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0226] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0227] Each embodiment in this specification is described in a related manner. Similar portions between embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the device, electronic device, computer-readable storage medium, and computer program product embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.

[0228] The above are only preferred embodiments of the present application and are not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the scope of protection of the present application.

Claims

1. A method for face recognition, characterized in that: include: Obtaining facial key points of the first face area in the image to be recognized; determining a plurality of first regions of interest from the first face region according to the acquired facial key points, and extracting a first region feature of each first region of interest; Determining an obscured area in the first facial area, and calculating a first obscuration degree of each first region of interest based on the determined obscured area; Obtaining a first influence degree between each first region of interest determined according to the calculated first occlusion degree; Adjusting each first region feature according to the obtained first influence degree, and comparing the adjusted first region feature with the second region feature to obtain a face recognition result for the first face region, wherein the second region feature is a feature obtained by adjusting the region feature of each second region of interest according to each second influence degree, each second region of interest being a region corresponding to each first region of interest within a second face region preset in the reference face image; the second influence degree is an influence degree between each second region of interest determined based on each second occlusion degree, each second occlusion degree being an occlusion degree of each second region of interest; The step of adjusting each first region feature according to the obtained first influence, and comparing the adjusted first region features with the second region features to obtain a face recognition result of the first face region includes: Inputting each first region feature, a first influence degree between each first region of interest, a region feature of each second region of interest, and a second influence degree between each second region of interest into a pre-trained graph neural network, so that the graph neural network adjusts each first region feature based on each first influence degree to obtain an adjusted first region feature, and adjusts each second region feature based on each second influence degree to obtain a second region feature, and compares the adjusted first region feature with the second region feature, and outputs a face recognition result; Obtain the face recognition result output by the graph neural network model.

2. The method according to claim 1, characterized in that The step of comparing the adjusted first region features with the second region features to obtain a face recognition result of the first face region includes: Calculating the similarity between the adjusted first region feature of each first region of interest and the corresponding second region feature as the similarity corresponding to each first region of interest; Determining, based on the first occlusion degree of each first region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first facial region; performing a weighted operation on the similarities corresponding to the first regions of interest according to the determined weights, and obtaining an operation result as the similarity between the first facial region and the second facial region; Determine a face recognition result of the first face area according to the obtained similarity.

3. The method according to claim 2, characterized in that The determining, based on the first occlusion degree of each first region of interest, the weight of the first region feature of each first region of interest relative to the feature of the first face region includes: Based on the first occlusion degree of each first region of interest and the second occlusion degree of the corresponding second region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first face region is determined.

4. The method according to claim 1, wherein The step of comparing the adjusted first region features with the second region features to obtain a face recognition result of the first face region includes: According to the first occlusion degree of each first region of interest, feature fusion is performed on the first region features of each first region of interest to obtain a first fused feature, and according to the second occlusion degree of each second region of interest, feature fusion is performed on the second region features of each second region of interest to obtain a second fused feature; Calculating the similarity between the first fusion feature and the second fusion feature; Determine a face recognition result of the first face area according to the calculated similarity.

5. The method according to any one of claims 1 to 4, characterized in that The first influence is calculated according to the following expression: A ij =max(occlusion i , thd)*(1- occlusion j ) Among them, A ij is the first influence of the first region of interest j on the first region of interest i, and the occlusion degree i Indicates the occlusion degree of the first region of interest i, occlusion degree j represents the occlusion degree of the first region of interest j, and thd is a preset threshold.

6. The method according to any one of claims 1 to 4, characterized in that The step of determining a plurality of first regions of interest from the first face region based on the acquired facial key points includes: Determining the region type to which each facial key point belongs based on the obtained key point types of the facial key points and the correspondence between the preset facial key point types and the region types of the first region of interest; For each region type, based on the position information of the facial key points belonging to the region type, the center position of the region of interest belonging to the region type is obtained, and the inter-region distance between the center position of the region of interest belonging to the region type and the center position of the adjacent region of interest is determined; and the region size of the region of interest belonging to the region type is calculated based on the determined inter-region distance; Based on the obtained center positions and the calculated region sizes, a first region of interest to which each center position belongs is determined.

7. The method according to any one of claims 1 to 4, characterized in that Extracting facial features in each first region of interest includes: Extracting a global feature map of a first face region in the image to be recognized; Determining, based on a position of each first region of interest in the first facial region, a feature region corresponding to each first region of interest in the global feature map; According to a preset feature map size, transform the feature region of each first region of interest to generate a feature map of the same size as the preset feature map; The facial features corresponding to the feature maps of each first region of interest are determined as the facial features within each first region of interest.

8. A face recognition device, characterized in that: include: A key point acquisition module is used to obtain facial key points of the first face area in the image to be recognized; a feature extraction module, configured to determine a plurality of first regions of interest from the first face region based on the acquired facial key points, and extract a first region feature of each first region of interest; an occlusion degree calculation module, configured to determine an occlusion area in the first facial area, and calculate a first occlusion degree of each first region of interest according to the determined occlusion area; An influence degree obtaining module, configured to obtain a first influence degree between each first region of interest determined according to the calculated first occlusion degree; a feature comparison module, configured to adjust each first region feature based on the obtained first influence degree, and compare the adjusted first region feature with the second region feature to obtain a face recognition result for the first facial region, wherein the second region feature is a feature obtained by adjusting the region feature of each second region of interest based on each second influence degree, each second region of interest being a region corresponding to each first region of interest within a second facial region preset in the reference facial image; and the second influence degree is an influence degree between each second region of interest determined based on each second occlusion degree, each second occlusion degree being an occlusion degree of each second region of interest; The feature comparison module is specifically used to input each first region feature, the first influence between each first region of interest, the region feature of each second region of interest, and the second influence between each second region of interest into a pre-trained graph neural network, so that the graph neural network adjusts each first region feature based on each first influence to obtain an adjusted first region feature, and adjusts the region feature of each second region of interest based on each second influence to obtain a second region feature, and compares the adjusted first region feature with the second region feature to output a face recognition result; and obtains the face recognition result output by the graph neural network model.

9. The device according to claim 8, characterized in that The feature comparison module includes: A similarity calculation submodule, configured to calculate the similarity between the adjusted first region feature of each first region of interest and the corresponding second region feature, as the similarity corresponding to each first region of interest; a weight determination submodule, configured to determine, based on the first occlusion degree of each first region of interest, a weight of the first region feature of each first region of interest relative to the feature of the first facial region; an operation submodule, configured to perform a weighted operation on the similarities corresponding to the first regions of interest according to the determined weights, and obtain an operation result as the similarity between the first facial region and the second facial region; The face recognition submodule is configured to determine a face recognition result of the first face area according to the obtained similarity.

10. The device according to claim 9, characterized in that The weight determination submodule is specifically configured to determine the weight of the first region feature of each first region of interest relative to the feature of the first face region based on the first occlusion degree of each first region of interest and the second occlusion degree of the corresponding second region of interest.

11. The device according to claim 8, characterized in that The feature comparison module includes: a feature fusion submodule, configured to perform feature fusion on the first region features of each first region of interest according to the first occlusion degree of each first region of interest to obtain a first fused feature, and perform feature fusion on the second region features of each second region of interest according to the second occlusion degree of each second region of interest to obtain a second fused feature; A similarity calculation submodule, configured to calculate the similarity between the first fusion feature and the second fusion feature; The face recognition submodule is configured to determine a face recognition result of the first face area according to the calculated similarity.

12. The device according to any one of claims 8 to 11, characterized in that The first influence is calculated according to the following expression: A ij =max(occlusion i , thd)*(1- occlusion j ) Among them, A ij is the first influence of the first region of interest j on the first region of interest i, and the occlusion degree i Indicates the occlusion degree of the first region of interest i, occlusion degree j represents the occlusion degree of the first region of interest j, and thd is a preset threshold.

Citation Information

Patent Citations

  • Face identification method and device, electronic device and storage medium

    CN107292287A