Face recognition method, electronic device and computer readable storage medium
By obtaining the posture difference information between the face to be recognized and the existing face in the face recognition method to correct the original similarity, the problem of the influence of posture difference is solved, the accuracy of face recognition is improved and the storage requirement of the face library is reduced.
Patent Information
- Application Number
- CN202210377432.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-11
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-04-11
AI Technical Summary
The accuracy of existing face recognition methods is not high enough, especially affected by the difference in posture between the face to be recognized and the existing face.
By obtaining the original similarity between the face to be identified and the existing face and correcting it based on the posture difference information, the corrected similarity is obtained to determine whether there is a matching existing face.
Reduce or avoid errors caused by posture differences, improve the accuracy of face recognition, and reduce the capacity and storage space requirements of the face library.
Smart Images

Figure CN114898425B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a face recognition method, an electronic device, and a computer-readable storage medium. Background Art
[0002] Facial recognition technology is needed in many application fields such as finance and security. The application scenarios of facial recognition technology in these application fields can include face authentication scenarios, such as face login verification and face unlocking, to determine which face category (target) a face belongs to, and face identification scenarios, such as trajectory tracking (determining the trajectory of the same target in different time and space domains) and crowd counting, to determine whether two different faces belong to the same face category (target).
[0003] The current face recognition process involves extracting features from the face to be recognized and existing faces, and then comparing the features of the face to be recognized with the existing faces to obtain the face recognition result. However, the accuracy of the current face recognition method is not high enough. Summary of the Invention
[0004] The present application provides a face recognition method, an electronic device, and a computer-readable storage medium, which can solve the problem that the current face recognition method has low accuracy.
[0005] To address the above technical issues, this application adopts a technical solution: providing a face recognition method. The method includes: obtaining a face to be recognized; calculating the original similarity between the face to be recognized and each existing face in a face database; obtaining posture difference information between the face to be recognized and each existing face; modifying the original similarity based on the posture difference information to obtain a modified similarity; and determining whether there is an existing face that matches the face to be recognized based on the modified similarity.
[0006] To solve the above technical problems, another technical solution adopted in this application is: to provide an electronic device, which includes a processor and a memory connected to the processor, wherein the memory stores program instructions; the processor is used to execute the program instructions stored in the memory to implement the above method.
[0007] In order to solve the above technical problems, another technical solution adopted in this application is: providing a computer-readable storage medium storing program instructions, which can implement the above method when executed.
[0008] Through the above method, after obtaining the original similarity between the face to be identified and the existing face, the present application does not directly use the original similarity as the basis for measuring whether the face to be identified and the existing face match. Instead, based on the posture difference information between the face to be identified and the existing face, the original similarity is corrected, and the corrected similarity obtained is used as the basis for measuring whether the face to be identified and the existing face match. On the one hand, the face recognition method provided by the present application can reduce or even avoid the error caused by the posture difference between the face to be identified and the existing face, thereby improving the accuracy of face recognition. On the other hand, because the accuracy of face recognition is not affected by posture differences, only the face of the same target in one posture can be recorded in the face library, without having to record the faces of the same target in multiple different postures to adapt to the posture of the face to be identified. This can reduce the capacity of the face library, save storage space, and reduce the cost of the face library. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 This is a flow chart of an embodiment of the face recognition method of the present application;
[0010] Figure 2 This is a flow chart of another embodiment of the face recognition method of the present applicant;
[0011] Figure 3 It is a diagram of the posture angle of the face;
[0012] Figure 4 This is a flow chart of another embodiment of the face recognition method of the present application;
[0013] Figure 5 This is a flow chart of another embodiment of the face recognition method of the present application;
[0014] Figure 6 This is a flow chart of another embodiment of the face recognition method of the present application;
[0015] Figure 7 This is a flow chart of another embodiment of the face recognition method of the present application;
[0016] Figure 8 This is a flow chart of another embodiment of the face recognition method of the present application;
[0017] Figure 9 This is a flowchart of a specific example of the face recognition method of the present applicant;
[0018] Figure 10 This is a structural diagram of an embodiment of the face recognition device of the present applicant;
[0019] Figure 11 This is a structural diagram of an embodiment of an electronic device of the present application;
[0020] Figure 12 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0021] 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.
[0022] The terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include at least one of the features. In the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically specified.
[0023] Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments unless there is a conflict.
[0024] Figure 1 It is a flow chart of an embodiment of the face recognition method of the present application. It should be noted that if there are substantially the same results, this embodiment does not use Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment may include:
[0025] S11: Obtain the face to be recognized.
[0026] A single face of the target to be identified can be captured by a camera and used as the target face. Alternatively, a video stream of the target to be identified can be captured by a camera, and the target face can be determined from the video stream. Some or all of the multiple faces of the target to be identified in the video stream can be used as the target face for face recognition. For example, the target face with the best quality can be used as the target face for face recognition.
[0027] S12: Calculate the original similarity between the face to be recognized and each existing face in the face database.
[0028] Existing faces are faces of existing targets. The face database can be a standard face database or a database of passersby, depending on the application scenario. For example, in the application scenario of face recognition, the face database is a standard face database; in the application scenario of face identification, the face database is a database of passersby.
[0029] The poses of the faces in the standard face database are standard, meaning they are frontal and pre-recorded. The pedestrian database consists of faces that have appeared in video surveillance and is automatically recorded during the surveillance process. The poses of the faces in the database vary and are dynamic. The same target in the face database may correspond to faces in one or more poses.
[0030] The face database can store either existing faces or features of existing faces. The latter storage method takes up less storage space.
[0031] The raw similarity between a face to be recognized and an existing face refers to the similarity between the two faces in their feature space. Features of the face to be recognized and the existing face can be extracted separately, and the raw similarity between the two faces can be calculated based on these features.
[0032] S13: Obtaining posture difference information between the face to be recognized and each existing face.
[0033] In some embodiments, the pose of a face can be measured by the distribution of key points on the face. Accordingly, the pose difference information can be the deviation between the key point distribution of the face to be identified and the existing face. Key point detection can be performed on the face to be identified and the existing face to obtain the key points of the face to be identified and the existing face, thereby determining the key point distribution of the face to be identified and the existing face.
[0034] In some embodiments, the posture of a face can be measured by the posture angle of the face. Accordingly, the posture difference information can be the posture angle deviation between the face to be recognized and the existing face. For a description of the posture angle, refer to the following embodiments.
[0035] S14: Correcting the original similarity based on the posture difference information to obtain a corrected similarity.
[0036] The quantization parameters of the posture difference information may be obtained, and the original similarity may be adjusted using the quantization parameters of the posture difference information. The adjustment method may be, but is not limited to, multiplication and addition.
[0037] S15: Determine whether there is an existing face that matches the face to be recognized based on the corrected similarity.
[0038] When there is only one face to be recognized:
[0039] It can be determined whether the maximum corrected similarity between the face to be identified and each existing face is greater than a similarity threshold; if the maximum corrected similarity between the face to be identified and each existing face is greater than the similarity threshold, the existing face corresponding to the maximum corrected similarity is regarded as an existing face that matches the face to be identified; otherwise, it is determined that there is no existing face in the face library that matches the face to be identified.
[0040] The face to be recognized includes multiple faces to be recognized:
[0041] It is possible to determine whether the maximum corrected similarity between each face to be identified and each existing face is greater than a similarity threshold; based on the determination result of each face to be identified, it is determined whether there is an existing face that matches the face to be identified.
[0042] Understandably, due to many external factors, the pose of the face captured by the camera may vary. This can easily lead to a pose difference between the face to be recognized and the existing face, distorting the original similarity and affecting the accuracy of face recognition. For example, the face to be recognized and the existing face originally belong to the same face category, but because the face to be recognized is in profile and the existing face is in front of the face, the calculated original similarity indicates that the face to be recognized and the existing face do not belong to the same category.
[0043] Through the implementation of this embodiment, after obtaining the original similarity between the face to be identified and an existing face, the present application does not directly use the original similarity as the basis for measuring whether the face to be identified and the existing face match. Instead, the original similarity is corrected based on the posture difference information between the face to be identified and the existing face, and the corrected similarity obtained is used as the basis for measuring whether the face to be identified and the existing face match. On the one hand, the face recognition method provided by this application can reduce or even avoid the error caused by the posture difference between the face to be identified and the existing face, thereby improving the accuracy of face recognition. On the other hand, because the accuracy of face recognition is not affected by posture differences, only the face of the same target in one posture can be recorded in the face library, without having to record the same target in multiple different postures to adapt to the posture of the face to be identified. This can reduce the capacity of the face library, save storage space, and reduce the cost of the face library.
[0044] Figure 2 It is a flow chart of another embodiment of the face recognition method of the present invention. It should be noted that if there is substantially the same result, this embodiment does not take Figure 2 The process sequence shown is limited. This embodiment is a further extension of S13, and the posture difference information is the posture angle deviation. Figure 2 As shown, this embodiment may include:
[0045] S131: Determine the posture angle of the face to be recognized and the existing face in at least one direction.
[0046] Combine Figure 3 To explain the posture angles: An XYZ coordinate system is established with the center of the human head as the origin. The head is divided into three mutually perpendicular directions: the x-axis, y-axis, and z-axis. The posture angles of a face can include the posture angles of the face in at least one of the x-axis, y-axis, and z-axis. The posture angle of the face in the x-axis direction (pitch angle) is denoted as pitch, the posture angle of the face in the y-axis direction (yaw angle) is denoted as yaw, and the posture angle of the face in the z-axis direction (roll angle) is denoted as roll.
[0047] S132: Calculate the posture angle deviation between the face to be recognized and the existing face in at least one direction.
[0048] The pose angle deviation between the face to be recognized and the existing face may include a pose angle deviation in at least one of the x-axis, y-axis, and z-axis directions. The pose angle deviation in the x-axis direction is denoted as ΔCp, the pose angle deviation in the y-axis direction is denoted as ΔCy, and the pose angle deviation in the z-axis direction is denoted as ΔCr.
[0049] Pitch has vertical dimensions, while yaw and roll have left-right dimensions. Yaw and roll have rotational symmetry. Therefore, the range of ΔCp is [0°, 180°], the range of ΔCy (upward) is [0°, 90°], and the range of ΔCr is [0°, 90°].
[0050] Figure 4 It is a flow chart of another embodiment of the face recognition method of the present application. It should be noted that if there is substantially the same result, this embodiment does not take Figure 4 The process sequence shown is limited. This embodiment is a further extension of S14, and the posture difference information is the posture angle deviation. Figure 4 As shown, this embodiment may include:
[0051] S141: Determine a posture distortion in at least one direction based on a posture angle deviation in at least one direction.
[0052] The attitude distortion is positively correlated with the attitude angle deviation.
[0053] Pose distortion indicates the degree of distortion of the characteristic attributes of the face to be identified relative to an existing face due to the deviation in the pose angle. The pose distortion of the face to be identified relative to the existing face can include pose distortion in at least one of the x-axis, y-axis, and z-axis. In the x-axis direction, pose distortion is denoted as AP, which increases with increasing pitch and reaches its peak at 180°. In the y-axis direction, pose distortion is denoted as Ay, which increases with increasing yaw and reaches its peak at 90°. In the z-axis direction, pose distortion is denoted as Ar, which increases with increasing roll and reaches its peak at 90°.
[0054] The positive correlation between attitude distortion and attitude angle deviation in each direction can be expressed as a function (e.g., a monotonically increasing function with attitude angle deviation as the independent variable and attitude distortion as the dependent variable) or a mapping table. The positive correlation can be manually set or obtained through training.
[0055] The positive correlation between attitude distortion and attitude angle deviation can be as follows:
[0056] Ap=Fp(ΔCp);
[0057] Ay=Fy(ΔCy);
[0058] Ar=Fr(ΔCr);
[0059] Among them, Fp(.), Fy(.), and Fr(.) indicate a positive correlation.
[0060] Through the positive correlation, the posture angle deviation can be mapped to a preset standard range. For example, the preset standard range can be [0, 1]. Determining the posture distortion based on the posture angle deviation can be considered a normalization of the posture distortion. For another example, the preset standard range is the similarity range to which the original similarity belongs.
[0061] S142: Weighting the posture distortion in at least one direction according to the corresponding weight to obtain a total posture distortion.
[0062] In some embodiments, the weights of posture distortions in different directions may be set to be the same.
[0063] In some embodiments, the degree of attention paid to different directions may vary in different application scenarios. If the degree of attention paid to different directions varies, the weight of the posture distortion can be set to be positively correlated with the degree of attention paid to the corresponding direction. The posture distortion weight is a floating point value. If the posture distortion has a negative impact on the similarity, its weight is negative; if the posture distortion has a positive impact on the similarity, its weight is positive.
[0064] For example, the attitude distortion in at least one direction includes AP, Ay, and Ar, and the total attitude distortion can be calculated as follows:
[0065] Bs=Ap*Bp+Ay*By+Ar*Br;
[0066] Where Bs represents the total attitude distortion, Bp, By, and Br represent the weights of AP, Ay, and Ar, respectively. In the case of including only the attitude distortion in a single direction, the attitude distortion in that single direction is directly used as the total attitude distortion.
[0067] S143: Correcting the original similarity based on the total posture distortion to obtain a corrected similarity.
[0068] If the posture distortion is mapped to the similarity range to which the original similarity belongs in S141, the total posture distortion also belongs to the similarity range. The total posture distortion and the original similarity can be directly weighted, and the weight of the original similarity can be greater than the weight of the total distortion.
[0069] If the posture distortion is mapped to [0, 1] in S141, the posture distortion can be used as the adjustment ratio of the original similarity; the original similarity is adjusted based on the adjustment ratio to obtain the modified similarity. In this case, the calculation formula for the modified similarity can be as follows:
[0070] β=βs*(1+Bs);
[0071] Among them, β represents the corrected similarity and βs represents the original similarity.
[0072] Figure 5 It is a flow chart of another embodiment of the face recognition method of the present application. It should be noted that if there is substantially the same result, this embodiment does not take Figure 5 The process sequence shown is limited. This embodiment is a further extension of S11. Figure 5 As shown, this embodiment may include:
[0073] S111: Obtain the captured video stream of the target to be identified.
[0074] When the target appears in the camera's field of view, the camera tracks and captures the target until it leaves the camera's field of view. By dividing the time period, you can capture multiple video streams of the target.
[0075] S112: Perform time-division detection on the video stream to obtain faces of targets to be identified in multiple time periods.
[0076] The video stream of the target to be identified may include sub-video streams of multiple time periods. The sub-video stream of each time period is detected to obtain the face of the target to be identified in each time period.
[0077] S113: Performing a quality assessment on the face of the target to be recognized to obtain a quality score of the face of the target to be recognized.
[0078] The basis for quality assessment may include the occlusion status, clarity, exposure, etc. of the face of the target to be identified.
[0079] S114: Selecting faces of the target to be recognized whose quality scores meet the recognition requirements in each time period as faces to be recognized.
[0080] The quality score meeting the requirement may be that the quality score is higher than the quality score threshold, or that the quality score is the highest, etc.
[0081] An example is given for S111 to S113 for time periods 1 to 3:
[0082] Example 1 (real-time): 1) Let i=1, and obtain the video stream i of time period i.
[0083] 2) Determine a face with the highest quality score from video stream i as face i to be identified.
[0084] 3) Let i=i+1 and jump to 1) until time periods 1 to 3 are traversed and faces 1 to 3 to be identified are obtained.
[0085] Example 2 (non-real-time): Obtain video streams from time periods 1 to 3, and determine a face with the highest quality score from the video streams from time periods 1 to 3, to obtain faces 1 to 3 to be identified.
[0086] Figure 6 It is a flow chart of another embodiment of the face recognition method of the present application. It should be noted that if there is substantially the same result, this embodiment does not use Figure 6 The process sequence shown is limited. This embodiment is a further extension of S15. Figure 6 As shown, this embodiment may include:
[0087] S151: Determine whether the maximum corrected similarity between the face to be recognized and each existing face in each time period is greater than a similarity threshold.
[0088] If the maximum corrected similarity between the face to be identified and each existing face in at least one time period is greater than the similarity threshold, then execute S152; otherwise, execute S153.
[0089] S152: Determine whether there is an existing face that matches the face to be recognized.
[0090] S153: Determine whether there is no existing face that matches the face to be recognized.
[0091] In the above S151 to S153, the determination of each time period may be performed in real time or in non-real time.
[0092] Take S151 to S153 for example for periods 1 to 3:
[0093] Example 3 (real-time): 1) Let i=1, and obtain the maximum corrected similarity i between the face to be identified i and each existing face in time period i.
[0094] 2) Determine whether the maximum corrected similarity i is greater than the similarity threshold; if so, execute 3); otherwise, execute 4).
[0095] 3) The existing face corresponding to the maximum corrected similarity i is used as the existing face that matches the face to be recognized, and the process ends.
[0096] 4) Let i=i+1, determine whether i is greater than 3. If not, jump to 1) to repeat the above steps; if greater, end.
[0097] Example 4 (non-real-time): Obtain the maximum corrected similarities 1-3 of the faces to be identified 1-3 and each existing face in time periods 1-3, respectively, and determine whether there is one of the maximum corrected similarities 1-3 that is greater than the similarity threshold. If so, it is determined that there is an existing face that matches the face to be identified (for example, the maximum corrected similarity 1). If there are multiple maximum corrected similarities 1-3 that are greater than the similarity threshold (for example, the maximum corrected similarity 1 and the maximum corrected similarity 2), then the one with the higher quality score can be selected from the matching faces corresponding to the maximum corrected similarity 1 and the maximum corrected similarity 2 as the existing face that matches the face to be identified.
[0098] Figure 7 It is a flow chart of another embodiment of the face recognition method of the present application. It should be noted that if there is substantially the same result, this embodiment does not use Figure 7 The process sequence shown is limited. This embodiment is a further extension of S15. Figure 7 As shown, this embodiment may include:
[0099] S154: Calculate the average of the maximum corrected similarities between the face to be recognized and the existing face in multiple time periods.
[0100] S155: Determine whether the mean is greater than a similarity threshold.
[0101] If the mean is greater than the similarity threshold, execute S156; otherwise, execute S157.
[0102] S156: Determine whether there is an existing face that matches the face to be recognized.
[0103] S157: Determine whether there is no existing face that matches the face to be recognized.
[0104] In the above S154 to S157, the determination of each time period may be performed in real time or in non-real time.
[0105] Compared with method 2 (S154-S157), method 1 (S151-S153) has a fast calculation speed and low latency, but the accuracy of the judgment result is low. Relatively speaking, method 2 has a high accuracy of judgment result, but a high latency.
[0106] Furthermore, based on any of the above embodiments, if there is an existing face that matches the face to be recognized, the face to be recognized can be used to update the existing face that matches the face to be recognized; if there is no existing face that matches the face to be recognized, the face to be recognized can be entered into the face library.
[0107] Using the face to be identified to update an existing face that matches the target face (the target face) can mean replacing the target face with the face to be identified, which reduces duplicate capture rates in the face database. Alternatively, the face can be added as a new target to an existing target. This replacement method allows the face database to store only a single face of the same target, requiring less storage space.
[0108] If the face to be recognized includes faces from multiple time periods, the face with the best quality and / or best pose (closest to the standard, for example, the pose standard is that the pose angles in all directions are 0) can be used to update the target face. In order to make the quality and / or pose of the face in the face database better (closer to the standard), replacement can be performed only when the pose and / or quality of the face to be recognized are better than those of the target face.
[0109] The so-called recording of the face to be recognized into the face database may be recording the face to be recognized as a new target face into the face database. If the face to be recognized includes faces from multiple time periods, the face with the best quality and / or the best posture may be used to record the face database.
[0110] Further, refer to Figure 8 In order to ensure the quality and / or better posture of the faces to be recognized in the face database, the following extensions can be made:
[0111] S21: Determine whether the face to be recognized meets preset requirements.
[0112] The preset requirements include posture requirements and / or quality requirements.
[0113] The posture requirement means that the difference between the posture of the face to be identified and the standard posture (measured by posture angle or key point distribution) is less than the posture difference threshold, and the quality requirement means that the difference between the quality of the face to be identified and the standard quality is less than the quality difference threshold.
[0114] If the preset requirements are met, execute S24; otherwise execute S22.
[0115] S22: Determine whether the target to be identified disappears.
[0116] The target disappears when it leaves the camera's field of view.
[0117] If it disappears, execute S24; otherwise, execute S23.
[0118] S23: Continue to capture the target to be identified to obtain a new face to be identified, and enter the new face to be identified into the face database if the new face to be identified meets the preset requirements.
[0119] S24: Enter the face to be recognized into the face database.
[0120] Through the implementation of this embodiment, when a face to be recognized does not meet the preset requirements but needs to be entered into the face database, the system first determines whether the face to be recognized meets the preset requirements. If so, the face to be recognized is entered into the face database. Otherwise, the system continues to capture the target until a face to be recognized that meets the preset requirements is found, at which point the face to be recognized that meets the preset requirements is entered into the face database. If the target disappears and no face to be recognized that meets the preset requirements is found, the existing face to be recognized is entered into the face database.
[0121] Combine as follows Figures 9-10 , the implementation of this application in real time is described in detail through two examples:
[0122] Example 5: 1) A target to be identified appears, and the target is tracked and captured, and video streams 1 to 3 of time periods 1 to 3 of the target to be identified are obtained.
[0123] 2) Through face detection, faces 1 to 3 to be identified are determined from video streams 1 to 3 respectively.
[0124] 3) Calculate the corrected similarities 1-3 between the faces to be identified 1-3 and each existing face.
[0125] 4) Determine whether the corrected similarities 1 to 3 are greater than the similarity threshold; if none of them are greater than the similarity threshold, proceed to 5); otherwise proceed to 9).
[0126] 5) Determine whether faces 1 to 3 to be identified meet the preset requirements; if none of them meet the preset requirements, proceed to 6); otherwise, proceed to 8).
[0127] 6) Determine whether the target to be identified has disappeared; if not, proceed to 7); otherwise, proceed to 8).
[0128] 7) Continue to capture the face to be identified to obtain a new face to be identified that meets the requirements, and enter the new face to be identified into the face database. Go to 8).
[0129] 8) Enter the face to be identified into the face database.
[0130] 9) Use the faces to be identified to deduplicate the face database.
[0131] Example 6: Combined with reference Figure 10 , Figure 10 This is a structural diagram of an embodiment of the face recognition device of the present application. Figure 10 As shown, the face recognition device includes a face detection module, a feature extraction module, a feature comparison module, a similarity correction module, and an input / deduplication module. The functions of each module are as follows:
[0132] The face detection module is used to detect the face to be identified from the video stream of the target to be identified.
[0133] The feature extraction module is used to extract the features of the face to be identified and the faces already in the face database.
[0134] The feature comparison module is used to compare the features of the face to be identified with the existing faces to obtain the original similarity.
[0135] The similarity correction module is used to correct the face to be identified based on the posture difference information between the face to be identified and the existing face, and obtain the corrected similarity.
[0136] The entry / deduplication module is used to deduplicate the face database using the face to be identified when the corrected similarity is greater than the similarity threshold; and to enter the face to be identified into the face database when the corrected similarity is not greater than the similarity threshold.
[0137] Figure 11 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application. Figure 11 As shown, the electronic device includes a processor 21 and a memory 22 coupled to the processor 21 .
[0138] The memory 22 stores program instructions for implementing the method of any of the above embodiments; the processor 21 is used to execute the program instructions stored in the memory 22 to implement the steps of the above method embodiments. The processor 21 can also be called a CPU (Central Processing Unit). The processor 21 may be an integrated circuit chip with signal processing capabilities. The processor 21 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0139] The electronic device mentioned in this embodiment may be an access management node, or may be another device that has established a connection with the access management node.
[0140] Figure 12 This is a schematic diagram of the structure of an embodiment of the computer-readable storage medium of the present application. Figure 12 As shown, the computer-readable storage medium 30 of the embodiment of the present application stores program instructions 31, and when the program instructions 31 are executed, the method provided in the above embodiment of the present application is implemented. Among them, the program instructions 31 can form a program file and be stored in the above-mentioned computer-readable storage medium 30 in the form of a software product, so that a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) executes all or part of the steps of the various embodiments of the present application. The aforementioned computer-readable storage medium 30 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
[0141] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0142] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. The above is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A face recognition method, characterized in that: include: Get the face to be recognized; Calculating the original similarity between the face to be identified and each existing face in a face database, wherein the face database stores existing faces of the same known target in a certain posture; Determining a posture angle of the to-be-recognized face and the existing face in at least one direction; Calculating a posture angle deviation between the face to be recognized and the existing face in at least one direction; Determining a posture distortion degree in the at least one direction based on the posture angle deviation in the at least one direction, wherein the posture distortion degree is positively correlated with the posture angle deviation; Weighting the posture distortion in the at least one direction according to the corresponding weight to obtain a total posture distortion; Correcting the original similarity based on the total posture distortion to obtain a corrected similarity includes: weighting the total posture distortion and the original similarity to obtain the corrected similarity; Alternatively, the total posture distortion is added to 1 to obtain an adjustment ratio, and the adjustment ratio is multiplied by the original similarity to obtain the modified similarity; Based on the corrected similarity, it is determined whether there is an existing face that matches the face to be recognized.
2. The method according to claim 1, characterized in that The weight of the posture distortion is positively correlated with the attention degree of the corresponding direction.
3. The method according to claim 1, characterized in that The positive correlation between the posture distortion and the posture angle deviation in different directions is obtained through training.
4. The method according to claim 1, wherein The step of obtaining a face to be recognized includes: Get the captured video stream of the target to be identified; Performing time-division detection on the video stream to obtain faces of the target to be identified in multiple time periods; Performing a quality assessment on the face of the target to be identified to obtain a quality score of the face of the target to be identified; The face of the target to be identified whose quality score meets the recognition requirement is selected as the face to be identified in each time period.
5. The method according to claim 4, characterized in that The determining whether there is an existing face that matches the face to be recognized based on the corrected similarity includes: Determine whether the maximum corrected similarity between the face to be identified and each of the existing faces in each time period is greater than a similarity threshold; In response to the maximum corrected similarity between the face to be recognized and each of the existing faces in at least one time period being greater than a similarity threshold, it is determined that there is an existing face matching the face to be recognized.
6. The method according to claim 4, characterized in that The determining whether there is an existing face that matches the face to be recognized based on the corrected similarity includes: Calculating the average of the maximum corrected similarities between the face to be identified and the existing face in multiple time periods; Determining whether the mean is greater than a similarity threshold; In response to the mean being greater than a similarity threshold, it is determined that there is an existing face that matches the face to be recognized.
7. The method according to claim 1, characterized in that After determining whether there is an existing face that matches the face to be recognized based on the corrected similarity, the method further includes: In response to the existence of an existing face that matches the face to be recognized, using the face to be recognized to update the existing face that matches the face to be recognized; In response to the absence of an existing face that matches the face to be recognized, the face to be recognized is entered into the face database.
8. The method according to claim 7, characterized in that Before entering the face to be recognized into the face database, the method includes: Determining whether the face to be recognized meets preset requirements, wherein the preset requirements include posture requirements and / or quality requirements; In response to the face to be identified meeting a preset requirement, the step of entering the face to be identified into the face database is performed.
9. The method according to claim 8, characterized in that The method further comprises: In response to the face to be identified not meeting a preset requirement, determining whether the target to be identified disappears; In response to the disappearance of the target to be identified, executing the step of recording the face to be identified into the face database; In response to the target to be identified not disappearing, the target to be identified is continuously photographed to obtain a new face to be identified, and the new face to be identified is entered into the face database if the new face to be identified meets preset requirements.
10. An electronic device, characterized in that: comprising a processor and a memory connected to the processor, wherein: The memory stores program instructions; The processor is configured to execute the program instructions stored in the memory to implement the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that The storage medium stores program instructions, and when the program instructions are executed, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Human face registration library updating method and apparatus
CN108446387A
Face expression matching method, device and equipment and storage medium
CN109740511A
Identity authentication method and device, computer equipment and storage medium
CN111582027A