Face recognition method and device and electronic equipment
Through pre-registration and one-to-one registration and alignment of face templates, combined with the feature extraction model, the problem of inaccurate registration between images and templates in face recognition is solved, and the accuracy and quality of the recognition results are significantly improved.
Patent Information
- Application Number
- CN202310320938.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2024-10-01
AI Technical Summary
Existing face recognition technology is difficult to achieve accurate identity recognition, especially when there are errors in the registration of face images and templates, which affects the accuracy of the recognition results.
By pre-registering the identity information of the target object, obtaining the face template and performing one-to-one registration and alignment, combined with the feature extraction model to calculate feature similarity, determine the face recognition result, and achieve two-stage recognition to improve accuracy.
It improves the accuracy and quality of face recognition, avoids inaccurate alignment results caused by using the same template, and enhances the reliability of identity recognition.
Smart Images

Figure CN118736634A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of face recognition technology, and in particular to a face recognition method, device and electronic equipment. Background Art
[0002] Face recognition is a biometric identification technology that uses facial features to identify people. It is widely used in security, access control, attendance and other fields. Therefore, how to accurately implement face recognition has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] In view of this, embodiments of the present application provide a face recognition method, device, and electronic device to achieve face recognition through alignment of face images and face templates.
[0004] According to a first aspect of an embodiment of the present application, a face recognition method is provided, comprising:
[0005] Acquire pre-query information of a target object to be identified; the pre-query information at least includes candidate identity information of the target object;
[0006] Based on the pre-query information, target information matching the pre-query information is obtained from an identity registration database; each target information at least includes a face template of a registered object corresponding to the target information;
[0007] The target face image corresponding to the target object is registered and aligned with the face template, and the face recognition result of the target object is determined according to the alignment result.
[0008] Optionally, obtaining pre-query information of the target object to be identified includes:
[0009] Receiving an object query event triggered by the target object;
[0010] Based on the object query event, a corresponding object query operation is performed on the target object to obtain pre-query information of the target object.
[0011] Optionally, acquiring target information matching the pre-query information from the identity registration database based on the pre-query information includes:
[0012] Using the candidate identity information of the target object as a keyword, searching the identity registration database for data information containing the candidate identity information, and determining the face template in the found data information as the target information.
[0013] Optionally, the dimension of the target face image corresponding to the target object is three-dimensional; the dimension of the face template is three-dimensional; and the registering and aligning the target face image corresponding to the target object with the face template includes:
[0014] Determine the position transformation matrix by using the coordinate position information of the same key point in the target face image and the face template in a specified coordinate system; or, estimate the position transformation matrix between the target face image and the face template based on a trained point cloud registration model;
[0015] Based on the position transformation matrix, the pixel points on the target face image are mapped to obtain an alignment result.
[0016] Optionally, determining the face recognition result of the target object according to the alignment result includes:
[0017] Inputting the alignment result and the face template into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and the face template, and outputs a first feature of the alignment result and a second feature of the face template;
[0018] Calculating feature similarity between the first feature and the second feature;
[0019] When the feature similarity is greater than a preset similarity threshold, the face recognition result of the target object is determined as the pre-query information.
[0020] Optionally, determining the face recognition result of the target object according to the alignment result includes:
[0021] Inputting the alignment result and all the face templates in the identity registration database into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and all the face templates, and outputs a first feature of the alignment result and a second feature of each face template;
[0022] Calculating feature similarity between the first feature and each second feature;
[0023] The identity information of the face template corresponding to the feature similarity that meets the specified similarity condition is determined as the face recognition result of the target object.
[0024] According to a second aspect of an embodiment of the present application, there is provided a face recognition device, comprising:
[0025] A pre-query information acquisition module, used to acquire pre-query information of a target object to be identified; the pre-query information at least includes candidate identity information of the target object;
[0026] A target information acquisition module, used to acquire target information matching the pre-query information from an identity registration database based on the pre-query information; each target information at least includes a face template of a registered object corresponding to the target information;
[0027] The recognition result determination module is used to align the target face image corresponding to the target object with the face template, and determine the face recognition result of the target object according to the alignment result.
[0028] Optionally, the pre-query information acquisition module is specifically used to:
[0029] Receiving an object query event triggered by the target object;
[0030] Based on the object query event, a corresponding object query operation is performed on the target object to obtain pre-query information of the target object.
[0031] Optionally, the target information acquisition module is specifically used to:
[0032] Using the candidate identity information of the target object as a keyword, searching the identity registration database for data information containing the candidate identity information, and determining the face template in the found data information as the target information.
[0033] According to a third aspect of an embodiment of the present application, there is provided an electronic device, the electronic device comprising a machine-readable storage medium and a processor;
[0034] The machine-readable storage medium stores machine-executable instructions that can be executed by a processor;
[0035] The processor is used to read the machine executable instructions to implement the steps of the face recognition method as described in the first aspect or any optional implementation manner of the first aspect.
[0036] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0037] In the embodiment of the present application, in order to achieve a 1:1 registration between a face image and a face template, the identity information of each target object is registered in advance to obtain an identity registration database, and then the pre-query information of the target object is first obtained, and the corresponding face template is obtained from the identity registration database according to the obtained pre-query information, and the corresponding face template is used for registration and alignment, thereby achieving a one-to-one registration between the face image and the face template, avoiding the use of the same face template for all target objects, and being able to obtain a higher quality alignment result, thereby improving the accuracy of the face recognition result;
[0038] Furthermore, based on the pre-query information, the face template of the target object is determined to determine the potential identity of the target object, which is the first stage of recognition. Then, the determined face template is matched with the acquired face image of the target object, which is the second stage of recognition. This realizes two-stage face recognition and improves the accuracy of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of the method provided in the embodiment of the present application.
[0040] Figure 2 This is a flow chart of obtaining pre-query information provided in an embodiment of the present application.
[0041] Figure 3 This is a registration and alignment flowchart provided in an embodiment of the present application.
[0042] Figure 4 This is a flow chart for determining a face recognition result provided in an embodiment of the present application.
[0043] Figure 5 This is another face recognition result determination flow chart provided in an embodiment of the present application.
[0044] Figure 6 It is a device diagram provided in an embodiment of the present application.
[0045] Figure 7 It is a schematic diagram of the hardware structure of the device of the embodiment of the present application. DETAILED DESCRIPTION
[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0047] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0048] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0049] Next, the embodiments of the present application are described in detail.
[0050] The face recognition method provided in the embodiment of the present application is performed by an electronic device. In some embodiments, the electronic device is a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. Those skilled in the art will appreciate that the number of the electronic device may be one, or the number of the electronic device may be dozens or hundreds, or more. The embodiment of the present application does not limit the number and type of electronic devices.
[0051] In some embodiments, the facial recognition method is applied in a scenario where employees enter an office building. The electronic device is a terminal connected to a gate. The electronic device verifies the facial information of the person entering according to the method of an embodiment of the present application. When the facial recognition result passes, the gate is controlled to open to allow the employee to enter.
[0052] In another embodiment, the facial recognition method is applied to a scenario where a user conducts business at a bank. Before the electronic terminal conducts business for the user, the electronic terminal verifies the user's facial information according to the method of the embodiment of the present application, and provides services to the user after confirming that the user conducting the business is a legally registered user.
[0053] Figure 1 is a flow chart of the method provided in the embodiment of the present application, such as Figure 1 As shown, the following steps are included:
[0054] S110: Obtain pre-query information of the target object to be identified.
[0055] For example, in this embodiment, the target object may be a person who needs to perform face recognition. The target object is not specifically limited in this embodiment and may be determined according to a specific application scenario. For example, when the application scenario is to handle banking business, the target object is the user who needs to handle the business.
[0056] In this embodiment, the above-mentioned pre-query information at least includes candidate identity information of the target object. The candidate identity information is possible identity information of the target object. The candidate identity information can be obtained by various methods, which are described by way of example in the following embodiment and will not be described in detail here.
[0057] S120: Based on the pre-query information, target information matching the pre-query information is obtained from the identity registration database; each target information at least includes a face template of a registration object corresponding to the target information.
[0058] For example, in this embodiment, the above-mentioned identity registration database can be set in advance with the consent of each registered object, and the identity registration database stores multiple pieces of data information, each piece of data information corresponds to a registered object. Each piece of data information may include: identity information of the registered object, 3D face template of the registered object, 2D face template of the registered object, facial feature information of the registered object, etc. The embodiment of this application does not specifically limit the data information, and those skilled in the art can determine it according to actual conditions.
[0059] In this embodiment, the above-mentioned face template may be a 2D face template or a 3D face template. This embodiment of the present application is not specifically limited.
[0060] In this embodiment, in this step S120, based on the pre-query information, obtaining the target information that matches the pre-query information from the identity registration database can specifically be: using the candidate identity information of the target object as a keyword, searching the identity registration database for data information containing the candidate identity information, and determining the face template in the found data information as the target information.
[0061] As an embodiment of the present application, if there is no target information matching the pre-query information in the identity registration database, it is determined that the face recognition result of the target object is a failure, and the target object needs to be registered before face recognition can be performed.
[0062] S130: Aligning the target face image corresponding to the target object with the face template, and determining the face recognition result of the target object according to the alignment result.
[0063] Exemplarily, in this embodiment, the target facial image may be a 3D facial image, and the 3D facial image may be a depth image or a point cloud image, which is not specifically limited in this embodiment of the present application.
[0064] In this embodiment, the face template corresponds to the above-mentioned target face image. When the target face image is a depth image, the face template is also a depth image template. When the target face image is a point cloud image, the face template is also a point cloud image template.
[0065] When the target face image is a depth image, it can be collected by a depth camera, such as an RGB-D camera or a line laser profile scanner, and then transmitted to an electronic device via a wired network or a wireless network. The present application embodiment does not specifically limit the collection device and the image transmission method, which can be determined according to actual conditions.
[0066] When the target face image is a point cloud image, the collected depth image can be converted into a point cloud image. The specific conversion method is a conventional technology and will not be described in detail here.
[0067] In this embodiment, registration and alignment refers to comparing images of the same object acquired under different conditions, that is, for two images of the same object acquired under different conditions, one of the images is mapped to the other image by determining the position transformation matrix, so that the points corresponding to the same position in the two images are one-to-one corresponding to each other, thereby achieving the purpose of aligning each point in the image. In this step S130, the target face image corresponding to the target object is registered and aligned with the face template, which can be specifically: all pixel points on the target face image and the face template are mapped to the same coordinate system and then registered and aligned. The specific registration and alignment process can be referred to the example description of the following embodiment, which will not be repeated here.
[0068] In this embodiment, in this step S130, there are many ways to determine the face recognition result of the target object based on the alignment result, for example, by performing a feature comparison between the alignment result and the face template of the target object, or by performing a feature comparison between the alignment result and each face template in the identity registration database, which is not specifically limited in the embodiment of the present application.
[0069] As for the specific feature comparison method, please refer to the example description in the following embodiment, which will not be described here in detail.
[0070] So far, completed Figure 1 Description of the process shown.
[0071] pass Figure 1 It can be seen from the process shown that in the embodiment of the present application, in order to achieve a 1:1 registration between a face image and a face template, the identity information of each target object is registered in advance to obtain an identity registration database, and then the pre-query information of the target object is first obtained, and the corresponding face template is obtained from the identity registration database according to the obtained pre-query information, and the corresponding face template is used for registration and alignment, thereby achieving a one-to-one registration between the face image and the face template, avoiding the use of the same face template for all target objects, and being able to obtain a higher quality alignment result, thereby improving the accuracy of the face recognition result;
[0072] Furthermore, based on the pre-query information, the face template of the target object is determined to determine the potential identity of the target object, which is the first stage of recognition. Then, the determined face template is matched with the acquired face image of the target object, which is the second stage of recognition. This realizes two-stage face recognition and improves the accuracy of face recognition.
[0073] See also Figure 2 , Figure 2 This is a flowchart of obtaining pre-query information provided in the embodiment of the present application. Figure 2 As shown, the process may include the following steps:
[0074] S210: Receive an object query event triggered by a target object.
[0075] Exemplarily, in this embodiment, there may be many types of the above-mentioned object query events, such as swiping an identity card, taking a face photo, taking a palm photo, etc., which are not specifically limited in the embodiment of the present application.
[0076] Here, the identity proof document can be: an identity card, a household register, a driver's license, a Hong Kong and Macau Pass or a passport, and the embodiments of the present application are not specifically limited.
[0077] S220: Based on the object query event, perform a corresponding object query operation on the target object to obtain pre-query information of the target object.
[0078] Exemplarily, in this embodiment, based on the object query event, the corresponding object query operation on the target object may be specifically: when the object query event is swiping a certification document, the object query operation is extracting identity sensing information.
[0079] When the object query event is taking a photo of a face, the object query operation is to recognize the captured 2D face image to obtain pre-query information of the target object. Here, the specific recognition method can be based on a trained recognition model or a traditional image processing method (for example, a principal component analysis method, a singular value feature method, etc.), which is not specifically limited in the embodiments of the present application.
[0080] Taking the recognition method based on a trained recognition model as an example, the captured 2D face image is input into the recognition model trained in advance for recognition, and the face features are obtained. The face features are compared with the face features stored in the identity registration database to determine the pre-query information.
[0081] When the object query event is taking a photo of a palm, the object query operation is to recognize the captured 2D palm image to obtain pre-query information of the target object. The specific recognition method can be consistent with the above-mentioned 2D face image recognition method, which will not be repeated here.
[0082] See also Figure 3 , Figure 3 This is a registration and alignment flow chart provided in the embodiment of the present application. Figure 3 As shown, the process may include the following steps:
[0083] S310: Determine the position transformation matrix using the coordinate position information of the same key point in the target face image and the face template in a specified coordinate system; or, estimate the position transformation matrix between the target face image and the face template based on a trained point cloud registration model.
[0084] Exemplarily, in this embodiment, the dimension of the target face image is three-dimensional, and the dimension of the face template is also three-dimensional.
[0085] Exemplarily, in this embodiment, the position transformation matrix may include: a rotation matrix and a translation matrix. In this step S310, there are many methods for determining the position transformation matrix, which are not specifically limited in this embodiment of the application.
[0086] For example, the position transformation matrix is determined by utilizing the coordinate position information of the same key point in the target face image and the face template in a specified coordinate system. Specifically: the key points of the target face image are located to determine the key points of the target face image, and the key points of the face template are located to determine the key points of the face template. The transformation matrix is determined through specified calculation based on the coordinates of the key points of the target face image in a preset coordinate system and the coordinates of the key points of the face template in a preset coordinate system.
[0087] For example, for the target face image, the key points may include eyes, nose, mouth, eyebrows, facial contour, etc. The embodiment of the present application does not specifically limit the key points, and can be determined according to actual conditions. The key points of the face template are the same as the key points of the target face image, and will not be repeated here.
[0088] In the embodiment of the present application, the key points of the target face image are located to determine the key points of the target image, and the key points of the face template are located to determine the key points of the face template. Specifically, the following steps can be performed:
[0089] A 2D image and a 2D face template of a target object are obtained, the 2D image and the target face image are taken at the same time, and the 2D face template and the 3D face template are taken at the same time; key points of the 2D image are located to determine the key points of the 2D image, and key points of the 2D face template are located to determine the key points of the 2D face template, the key points of the 2D image and the key points of the 2D face template being the same; points on the target face image in a preset coordinate system corresponding to coordinates that are the same as the coordinates of the key points of the 2D image are determined as key points on the target face image, and points on the 3D face template in a preset coordinate system corresponding to coordinates that are the same as the coordinates of the key points of the 2D face template are determined as key points on the 3D face template.
[0090] The above-mentioned preset coordinate system can be an image coordinate system or a world coordinate system. The embodiment of the present application does not specifically limit the preset coordinate system and can be determined according to actual conditions.
[0091] The key point positioning of the 2D image and the 2D face template can be a traditional method based on manual features or a method based on deep learning, which is not specifically limited in the embodiments of the present application.
[0092] Here, traditional methods mainly include conventional AAMs (active appearance models), CLMs (constrained local models), ESR (explicit shape regression), SDM (supervised descent method), etc. These methods mainly use manually designed features to fit the positions of facial key points. The deep learning-based method inputs the 2D image into a pre-trained feature extraction model to obtain key points.
[0093] In an embodiment of the present application, when the position transformation matrix is determined by a specified calculation based on the coordinates of the key points of the target face image in the preset coordinate system and the coordinates of the key points of the face template in the preset coordinate system, the process of solving the position transformation matrix is modeled as the following formula:
[0094] B=R*A+t
[0095] Among them, R represents the rotation matrix, t represents the translation matrix, A represents the coordinates of the key points of the target face image in the preset coordinate system, and B represents the coordinates of the key points of the face template in the preset coordinate system.
[0096] R and t are solved by the coordinates of the key points of the target face image in the preset coordinate system and the coordinates of the key points of the face template in the preset coordinate system. The specific solution method is conventional technology and will not be repeated here.
[0097] For another example, based on the trained point cloud registration model, estimating the position transformation matrix between the target face image and the face template can be specifically done by: inputting the target face image and the face template into the trained point cloud registration model together to obtain the position transformation matrix; or it can be done by: inputting the key points of the target face image and the key points of the face template into the trained point cloud registration model together to obtain the position transformation matrix, which is not specifically limited in the embodiments of the present application.
[0098] S320: Mapping the pixel points on the target face image based on the position transformation matrix to obtain an alignment result.
[0099] Exemplarily, in this embodiment, in this step S320, the pixel points on the target face image are mapped based on the position transformation matrix, and the alignment result can be specifically obtained as follows: for each pixel point on the target face image, its coordinates are multiplied by the rotation matrix and then summed with the translation matrix to obtain the coordinates of the mapping point, and each pixel point on the target image is mapped based on the position transformation matrix to obtain the alignment result.
[0100] See also Figure 4 , Figure 4 This is a flow chart for determining the face recognition result provided in the embodiment of the present application. Figure 4 As shown, the process may include the following steps:
[0101] S410: Input the alignment result and the face template into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and the face template, and outputs a first feature of the alignment result and a second feature of the face template.
[0102] For example, in this embodiment, the feature extraction model may be trained in advance using face image samples. The first feature may include feature vectors of eyes, mouth, nose, etc. The first feature is not specifically limited in this embodiment and may be determined according to actual conditions.
[0103] In this embodiment, the second feature is the same as the first feature and will not be described in detail herein.
[0104] S420: Calculate the feature similarity between the first feature and the second feature.
[0105] Illustratively, in this embodiment, the feature similarity may be cosine similarity. Here, the calculation method of cosine similarity is a conventional calculation method, which will not be described in detail.
[0106] S430: When the feature similarity is greater than a preset similarity threshold, determining the face recognition result of the target object as pre-query information.
[0107] Exemplarily, in this embodiment, the above-mentioned preset similarity threshold is defined in advance, for example, it can be 0.9, and the embodiment of the present application does not specifically limit it.
[0108] In this embodiment, in this step S430, when the feature similarity is greater than the preset similarity threshold, the face recognition result of the target object is determined to be pre-query information, and when the feature similarity is less than or equal to the above preset threshold, the face recognition result of the target object is determined to be a failure.
[0109] In the embodiment of the present application, since the pre-query information is possible identity information of the target object, the alignment result is directly compared with the face template to determine whether the pre-query information is the face recognition result of the target object, thereby improving the efficiency of face recognition.
[0110] See also Figure 5 , Figure 5 Another face recognition result determination flow chart provided in the embodiment of the present application. Figure 5 As shown, the process may include the following steps:
[0111] S510: Input the alignment result and all the face templates in the identity registration database into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and all the face templates, and outputs a first feature of the alignment result and a second feature of each face template.
[0112] For the specific implementation, please refer to the detailed description of step S410 above, which will not be repeated here.
[0113] S520: Calculate the feature similarity between the first feature and each second feature.
[0114] For the specific implementation, please refer to the detailed description of step S420 above, which will not be repeated here.
[0115] S530: Determine the identity information of the face template corresponding to the feature similarity that meets the specified similarity condition as the face recognition result of the target object.
[0116] Exemplarily, in this embodiment, there are many similarity conditions specified, for example, the similarity condition is specified as the maximum feature similarity, and for another example, the similarity condition is specified as the maximum feature similarity is greater than the above-mentioned preset similarity threshold, which is not specifically limited in the embodiment of the present application.
[0117] When the specified similarity condition is the maximum feature similarity, the identity information of the face template corresponding to the maximum feature similarity can be directly determined as the face recognition result of the target object.
[0118] When the specified similarity condition is that the maximum feature similarity is greater than the above-mentioned preset similarity threshold, when the maximum similarity is greater than the above-mentioned preset similarity threshold, the face recognition result of the target object is determined to be the identity information of the face template corresponding to the maximum similarity; when the maximum similarity is less than or equal to the above-mentioned preset similarity threshold, the face recognition result of the target object is determined to be a failure.
[0119] The embodiment of the present application determines the face recognition result of the target object by comparing the alignment result with all the face templates stored in the identity registration database, ensuring that when the pre-query information is inaccurate, the recognition result of the target object can also be determined from other face templates, further improving the accuracy of face recognition.
[0120] Corresponding to the embodiments of the aforementioned method, the embodiments of the present application also provide embodiments of the device and the terminal to which it is applied.
[0121] See also Figure 6 , Figure 6 This is a diagram of the structure of a device provided in an embodiment of the present application. The device may include:
[0122] A pre-query information acquisition module is used to acquire pre-query information of a target object to be identified; the pre-query information at least includes candidate identity information of the target object;
[0123] A target information acquisition module is used to acquire target information matching the pre-query information from the identity registration database based on the pre-query information; each target information at least includes a face template of a registered object corresponding to the target information;
[0124] The recognition result determination module is used to align the target face image corresponding to the target object with the face template, and determine the face recognition result of the target object based on the alignment result.
[0125] As an optional implementation of the embodiment of the present application, the above-mentioned pre-query information acquisition module is specifically used for:
[0126] Receive object query events triggered by the target object;
[0127] Based on the object query event, a corresponding object query operation is performed on the target object to obtain pre-query information of the target object.
[0128] As an optional implementation of the embodiment of the present application, the target information acquisition module is specifically used for:
[0129] Using the candidate identity information of the target object as a keyword, search for data information containing the candidate identity information in the identity registration database, and determine the face template in the found data information as the target information.
[0130] As an optional implementation of the embodiment of the present application, the dimension of the target face image corresponding to the target object is three-dimensional; the dimension of the face template is three-dimensional; the above-mentioned recognition result determination module is specifically used for:
[0131] Determine the position transformation matrix by using the coordinate position information of the same key point in the target face image and the face template in the specified coordinate system; or, estimate the position transformation matrix between the target face image and the face template based on the trained point cloud registration model;
[0132] Based on the position transformation matrix, the pixels on the target face image are mapped to obtain the alignment result.
[0133] As an optional implementation of the embodiment of the present application, the above-mentioned recognition result determination module is specifically used for:
[0134] Inputting the alignment result and the face template into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and the face template, and outputs a first feature of the alignment result and a second feature of the face template;
[0135] Calculate the feature similarity between the first feature and the second feature;
[0136] When the feature similarity is greater than a preset similarity threshold, the face recognition result of the target object is determined as pre-query information.
[0137] As an optional implementation of the embodiment of the present application, the above-mentioned recognition result determination module is specifically used for:
[0138] Input the alignment result and all the face templates in the identity registration database into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and all the face templates, and outputs a first feature of the alignment result and a second feature of each face template;
[0139] Calculating feature similarity between the first feature and each second feature;
[0140] The identity information of the face template corresponding to the feature similarity that meets the specified similarity condition is determined as the face recognition result of the target object.
[0141] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0142] So far, completed Figure 6 Structural description of the device shown.
[0143] Correspondingly, the embodiment of the present application also provides Figure 6 The hardware structure diagram of the device shown is as follows Figure 7As shown, the electronic device may be a device for implementing the above method. Figure 7 As shown, the hardware structure includes: a processor and a memory.
[0144] Wherein, the memory is used to store machine executable instructions;
[0145] The processor is used to read and execute the machine executable instructions stored in the memory to implement the corresponding face recognition method embodiment shown above.
[0146] As an embodiment, the memory may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the memory may be: a volatile memory, a non-volatile memory or a similar storage medium. Specifically, the memory may be a RAM (Random Access Memory), a flash memory, a storage drive (such as a hard disk drive), a solid state drive, any type of storage disk (such as a CD, a DVD, etc.), or a similar storage medium, or a combination thereof.
[0147] So far, completed Figure 7 Description of the electronic device shown.
[0148] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A face recognition method, It is characterized in that include: Obtaining pre-query information of the target object to be identified; The pre-query information at least includes candidate identity information of the target object; Based on the pre-query information, acquiring target information matching the pre-query information from an identity registration database; Each target information at least includes a face template of a registered object corresponding to the target information; The target face image corresponding to the target object is registered and aligned with the face template, and the face recognition result of the target object is determined according to the alignment result.
2. The method according to claim 1, It is characterized in that The acquiring, based on the pre-query information, target information matching the pre-query information from the identity registration database comprises: Using the candidate identity information of the target object as a keyword, searching the identity registration database for data information containing the candidate identity information, and determining the face template in the found data information as the target information.
3. The method according to claim 1, It is characterized in that The dimension of the target face image corresponding to the target object is three-dimensional; the dimension of the face template is three-dimensional; and the registering and aligning the target face image corresponding to the target object with the face template includes: Determine the position transformation matrix by using the coordinate position information of the same key point in the target face image and the face template in a specified coordinate system; or, estimate the position transformation matrix between the target face image and the face template based on a trained point cloud registration model; Based on the position transformation matrix, the pixel points on the target face image are mapped to obtain an alignment result.
4. The method according to claim 1, It is characterized in that Determining the face recognition result of the target object according to the alignment result includes: Inputting the alignment result and the face template into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and the face template, and outputs a first feature of the alignment result and a second feature of the face template; Calculating feature similarity between the first feature and the second feature; When the feature similarity is greater than a preset similarity threshold, the face recognition result of the target object is determined as the pre-query information.
5. The method according to claim 1, It is characterized in that Determining the face recognition result of the target object according to the alignment result includes: Inputting the alignment result and all the face templates in the identity registration database into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and all the face templates, and outputs a first feature of the alignment result and a second feature of each face template; Calculating feature similarity between the first feature and each second feature; The identity information of the face template corresponding to the feature similarity that meets the specified similarity condition is determined as the face recognition result of the target object.
6. A face recognition device, It is characterized in that include: A pre-query information acquisition module is used to acquire pre-query information of a target object to be identified; The pre-query information at least includes candidate identity information of the target object; A target information acquisition module, used to acquire target information matching the pre-query information from an identity registration database based on the pre-query information; Each target information at least includes a face template of a registered object corresponding to the target information; The recognition result determination module is used to align the target face image corresponding to the target object with the face template, and determine the face recognition result of the target object according to the alignment result.
7. The device according to claim 6, It is characterized in that The pre-query information acquisition module is specifically used for: Receiving an object query event triggered by the target object; Based on the object query event, a corresponding object query operation is performed on the target object to obtain pre-query information of the target object.
8. The device according to claim 6, It is characterized in that The target information acquisition module is specifically used for: Using the candidate identity information of the target object as a keyword, searching the identity registration database for data information containing the candidate identity information, and determining the face template in the found data information as the target information.
9. The device according to claim 6, It is characterized in that The recognition result determination module is specifically used for: Inputting the alignment result and the face template into a trained feature extraction model, so that the feature extraction model extracts features from the input alignment result and the face template, and outputs a first feature of the alignment result and a second feature of the face template; Calculating feature similarity between the first feature and the second feature; When the feature similarity is greater than a preset similarity threshold, the face recognition result of the target object is determined as the pre-query information.
10. An electronic device, It is characterized in that The electronic device includes a machine-readable storage medium and a processor; The machine-readable storage medium stores machine-executable instructions that can be executed by a processor; The processor is used to read the machine executable instructions to implement the steps of the face recognition method as described in any one of claims 1-5.
