Face Recognition Method, Device, Terminal and Computer Readable Storage Medium

By comparing and clustering the current face image with historical face images in the face recognition system, and selecting the optimal face image for recognition, the problem of slow face recognition speed in the prior art is solved, and the recognition speed and accuracy are improved.

CN114463808BActive Publication Date: 2025-07-01ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111664170.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-07-01
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In the prior art, the slow speed of facial recognition leads to problems such as excessive computing volume and excessive memory usage.

Method used

By detecting the current face image in the current video frame, comparing it with the historical face image in the historical video frame, determining the similarity, and classifying the images that reach the similarity threshold into the same face track image set. The face image is clustered and the face image of the target object is obtained, and the optimal face image is selected from it for recognition.

Benefits of technology

By removing the face images that are repeated in the face trajectory images in a concentrated manner, the calculation amount and memory usage are reduced, the recognition speed is improved, and the recognition accuracy of the target object is improved through the recognition of the optimal face image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463808B_ABST
    Figure CN114463808B_ABST
Patent Text Reader

Abstract

The present invention provides a face recognition method, device, terminal, and computer-readable storage medium. The face recognition method includes: in response to detecting a current face image in a current video frame, comparing the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images; in response to the similarity between the current face image and the historical face images reaching a similarity threshold, classifying the current face image and the historical face images into the same face trajectory image set; performing clustering processing on the face images in the face trajectory image set to obtain a face image set of a target object, and selecting an optimal face image of the target object from the face image set; and recognizing the target object based on the optimal face image. This application removes duplicate face images in the face trajectory image set, reduces the amount of computation and the memory occupancy rate, thereby improving the recognition speed; and the recognition accuracy can be improved based on the optimal face image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and particularly to a face recognition method, device, terminal and computer-readable storage medium. Background Art

[0002] With the continuous development of artificial intelligence technology, face recognition technology has gradually been applied to monitoring fields such as security, finance, and transportation. Face recognition mainly includes a series of processes such as face detection and face comparison. A large number of duplicate face images will be generated in the face detection link, resulting in problems of excessive computational complexity and high memory occupancy. Summary of the Invention

[0003] The main technical problem to be solved by the present invention is to provide a face recognition method, device, terminal and computer-readable storage medium to solve the problem of slow face recognition speed in the prior art.

[0004] To solve the above technical problem, the first technical solution adopted by the present invention is: to provide a face recognition method, the face recognition method includes: in response to detecting a current face image in a current video frame, comparing the current face image with a historical face image in a historical video frame to determine the similarity between the current face image and the historical face image; in response to the similarity between the current face image and the historical face image reaching a similarity threshold, classifying the current face image and the historical face image into the same face trajectory image set; performing clustering processing on the face images in the face trajectory image set to obtain a face image set of a target object, and selecting an optimal face image of the target object from the face image set; performing face recognition on the target object based on the optimal face image.

[0005] Among them, in response to detecting a current face image in a current video frame, comparing the current face image with a historical face image in a historical video frame to determine the similarity between the current face image and the historical face image includes: calculating the intersection over union of the face region of the current face image and the face region of the historical face image; in response to the intersection over union being greater than a preset intersection over union, determining that the similarity between the current face image and the historical face image exceeds the similarity threshold.

[0006] Among them, calculating the intersection over union (IoU) of the face region of the current face image and the face region of the historical face image includes: calculating the adjacent-frame IoU of the face regions of the face image in the current video frame and the face image in the previous video frame; in response to the IoU being greater than a preset IoU, determining that the similarity between the current face image and the historical face image exceeds a similarity threshold, including: in response to the adjacent-frame IoU being greater than the preset IoU, determining that the similarity between the current face image and the historical face image exceeds the similarity threshold; in response to the adjacent-frame IoU not being greater than the preset IoU, newly establishing a face trajectory image set and classifying the current face image into the newly established face trajectory image set.

[0007] Among them, calculating the quality assessment value of each face image included in the face trajectory image set; performing clustering processing on the face images in the face trajectory image set to obtain the face image set of the target object, and selecting the optimal face image of the target object from the face image set, including: clustering the face images included in the face trajectory image set to obtain the face image set of the target object; selecting the face image corresponding to the highest quality assessment value in the face image set of the target object as the optimal face image of the target object.

[0008] Among them, calculating the quality assessment value of each face image included in the face trajectory image set includes: determining the quality assessment value of the face image based on the face occlusion degree, face integrity degree, and face clarity degree of the face image.

[0009] Among them, calculating the quality assessment value of each face image in the face trajectory image set includes: determining the quality assessment value of the face image based on the pitch angle, yaw angle, and roll angle of the face in the face image.

[0010] Among them, performing clustering processing on the face images in the face trajectory image set to obtain the face image set of the target object, and selecting the optimal face image of the target object from the face image set further includes: determining whether the time interval between the current video frame and the start video frame in the face trajectory image set to which it belongs exceeds a preset time; if the time interval exceeds the preset time, then clustering the face images included in the face trajectory image set.

[0011] Among them, clustering the face images included in the face trajectory image set to obtain the face image set of the target object, including: calculating the similarity between each face image in the face trajectory image set; in response to the similarity exceeding a preset similarity, classifying the two face images corresponding to the similarity into the same category image set; traversing the similarity between each face image in the category image set and each other face image included in the category image set, and determining the category score of each face image in the category image set; taking the highest category score in the category image set as the category score corresponding to the category image set; taking the category image set corresponding to the highest category score as the face image set of the target object.

[0012] Among them, performing face recognition on the target object based on the optimal face image, including: extracting features from the optimal face image to obtain face features; comparing the face features with preset face features; in response to the similarity between the face features and the preset face features exceeding a threshold, determining the preset target corresponding to the preset face features as the target object corresponding to the optimal face image.

[0013] To solve the above technical problems, the second technical solution adopted by the present invention is: providing a face recognition device, the face recognition device includes: a comparison module, configured to, in response to detecting a current face image in a current video frame, compare the current face image with a historical face image in a historical video frame to determine the similarity between the current face image and the historical face image; a tracking module, configured to, in response to the similarity between the current face image and the historical face image reaching a similarity threshold, classify the current face image and the historical face image into the same face trajectory image set; a clustering module, configured to perform clustering processing on the face images in the face trajectory image set to obtain the face image set of the target object, and select the optimal face image of the target object from the face image set; an identification module, configured to perform face recognition on the target object based on the optimal face image.

[0014] To solve the above technical problems, the third technical solution adopted by the present invention is: providing a terminal, the terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor is configured to execute program data to implement the steps in the face recognition method as described above.

[0015] To solve the above technical problems, the fourth technical solution adopted by the present invention is: providing a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps in the face recognition method as described above.

[0016] The beneficial effects of the present invention are as follows: Different from the prior art, a face recognition method, device, terminal, and computer-readable storage medium are provided. The face recognition method includes: in response to detecting a current face image in a current video frame, comparing the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images; in response to the similarity between the current face image and the historical face images reaching a similarity threshold, classifying the current face image and the historical face images into the same face trajectory image set; performing clustering processing on the face images in the face trajectory image set to obtain a face image set of a target object, and selecting an optimal face image of the target object from the face image set; and performing face recognition on the target object based on the optimal face image. By obtaining the face trajectory image set of the current face image, performing clustering processing on the face images in the face trajectory image set, determining the face image set of the target object, determining the optimal face image in the face image set of the target object, and removing duplicate face images in the face trajectory image set, the present application reduces the calculation amount and the memory occupancy rate, thereby improving the recognition speed; and performing face recognition on the target object based on the optimal face image can improve the recognition accuracy of the target object. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 is a flowchart of the face recognition method provided by the present invention;

[0019] Figure 2 is a flowchart of an embodiment of the face recognition method provided by the present invention;

[0020] Figure 3 is a flowchart of a specific embodiment of the face recognition method provided by the present invention;

[0021] Figure 4 is a schematic block diagram of the face recognition device provided by the present invention;

[0022] Figure 5 is a schematic block diagram of an embodiment of the terminal provided by the present invention;

[0023] Figure 6 is a schematic block diagram of an embodiment of the computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] The following will combine with the accompanying drawings of the specification to elaborate in detail on the solutions of the embodiments of the present application.

[0025] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system architectures, interfaces, technologies, etc. are presented to thoroughly understand the present application.

[0026] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after. Furthermore, "multiple" in this article means two or more than two.

[0027] To enable those skilled in the art to better understand the technical solutions of the present invention, the following will further elaborate in detail on a face recognition method provided by the present invention in combination with the accompanying drawings and specific implementation manners.

[0028] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the face recognition method provided by the present invention. In this embodiment, a face recognition method is provided, and the face recognition method includes the following steps.

[0029] S11: In response to detecting the current face image in the current video frame, compare the current face image with the historical face images in the historical video frames to determine the similarity between the current face image and the historical face images.

[0030] Specifically, calculate the intersection over union (IoU) of the face region of the current face image and the face region of the historical face image; in response to the IoU being greater than the preset IoU, determine that the similarity between the current face image and the historical face image exceeds the similarity threshold.

[0031] In a specific embodiment, calculate the adjacent frame IoU of the face regions of the face image in the current video frame and the face image in the previous video frame; in response to the adjacent frame IoU being greater than the preset IoU, determine that the similarity between the current face image and the historical face image exceeds the similarity threshold; in response to the adjacent frame IoU not being greater than the preset IoU, newly establish a face trajectory image set and classify the current face image into the newly established face trajectory image set.

[0032] S12: In response to the similarity between the current face image and the historical face image reaching the similarity threshold, classify the current face image and the historical face image into the same face trajectory image set.

[0033] Specifically, if the similarity between the current face image and the historical face image reaches the similarity threshold, the current face image and the historical face image are classified into the same face trajectory image set. Then, the tracking trajectory of the current face image in the current video frame is associated with the tracking trajectory of the historical face image similar to the current face image in the historical video frame, and then the tracking trajectory of the current face image is determined.

[0034] S13: Perform clustering processing on the face images in the face trajectory image set to obtain the face image set of the target object, and select the optimal face image of the target object from the face image set.

[0035] Specifically, calculate the quality evaluation values of the respective face images included in the face trajectory image set. Cluster the face images included in the face trajectory image set to obtain the face image set of the target object; select the face image corresponding to the highest quality evaluation value in the face image set of the target object as the optimal face image of the target object.

[0036] In a specific embodiment, based on the face occlusion degree, face integrity degree, and face clarity degree of the face image, determine the quality evaluation value of the face image. Further, the quality evaluation value of the face image can also be determined based on the pitch angle, yaw angle, and roll angle of the face in the face image.

[0037] In an embodiment, determine whether the time interval between the current video frame and the starting video frame in the attributed face trajectory image set exceeds a preset time; if the time interval exceeds the preset time, cluster the face images included in the face trajectory image set.

[0038] In a specific embodiment, calculate the similarity between the respective face images in the face trajectory image set; in response to the similarity exceeding the preset similarity, classify the two face images corresponding to the similarity into the same category image set; traverse the similarities between the face images in the category image set and the other respective face images included in the category image set to determine the category scores of the respective face images in the category image set; use the highest category score in the category image set as the category rating corresponding to the category image set; use the category image set corresponding to the highest category rating as the face image set of the target object.

[0039] S14: Perform face recognition on the target object based on the optimal face image.

[0040] Specifically, extract features from the optimal face image to obtain face features; compare the face features with the preset face features; in response to the similarity between the face features and the preset face features exceeding the threshold, determine the preset target corresponding to the preset face features as the target object corresponding to the optimal face image.

[0041] The face recognition method provided in this embodiment includes: in response to detecting a current face image in the current video frame, comparing the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images; in response to the similarity between the current face image and the historical face images reaching a similarity threshold, classifying the current face image and the historical face images into the same face trajectory image set; performing clustering processing on the face images in the face trajectory image set to obtain a face image set of the target object, and selecting the optimal face image of the target object from the face image set; and performing face recognition on the target object based on the optimal face image. By obtaining the face trajectory image set of the current face image, performing clustering processing on the face images in the face trajectory image set, determining the face image set of the target object, determining the optimal face image in the face image set of the target object, and removing duplicate face images in the face trajectory image set, this application reduces the computational amount and the memory occupancy rate, thereby improving the recognition speed; and performing face recognition on the target object based on the optimal face image can improve the recognition accuracy of the target object.

[0042] Please refer to Figure 2 and Figure 3 , Figure 2 which is a schematic flowchart of an embodiment of the face recognition method provided by the present invention; Figure 3 which is a schematic flowchart of a specific embodiment of the face recognition method provided by the present invention. In this embodiment, a face recognition method is provided, which is applicable to real-time face recognition of a target object and can also recognize faces in an offline acquired video stream. The face recognition method specifically includes the following steps.

[0043] S201: Obtain the current video frame.

[0044] Specifically, the current video frame is obtained in real time through an image acquisition device. Each video frame in the acquired offline video stream can also be used as the current video frame in sequence. Among them, the current video frame includes at least one face.

[0045] S202: Perform face detection on the current video frame to obtain the current face image in the current video frame.

[0046] Specifically, input the current video frame into the face detection network model to detect the faces in the current video frame, obtain the face detection boxes corresponding to the current video frame, and extract the images within each face detection box in the current video frame to obtain the current face images in the current video frame. That is, obtain the regional images containing each face. Among them, one current face image contains one face. In a specific embodiment, the face detection network model performs face detection on the current video frame, obtains the face detection boxes corresponding to each face, and determines the confidence levels of the faces contained within each face detection box. Among them, the value range of the confidence level of a face is [0, 1]. The coordinate position of the face in the current video frame can be determined through the face detection box corresponding to the face.

[0047] S203: Compare the current face image with the historical face images in the historical video frames to determine the similarity between the current face image and the historical face images.

[0048] Specifically, determine the similarity between the current face image and the historical face images through the face overlapping area measurement method.

[0049] In an embodiment, calculate the intersection over union (IoU) of the face region of the current face image and the face region of the historical face image, and further determine the similarity between the current face image and the historical face image.

[0050] In a specific embodiment, calculate the intersection over union (IoU) of the face region of the face image in the current video frame and the face regions of each face image contained in the historical video frames within a preset number of frames, and further determine the similarity between the current face image and the historical face images.

[0051] In a specific embodiment, calculate the adjacent frame intersection over union (IoU) of the face region of the face image in the current video frame and the face region of the face image in the previous video frame; and further determine the similarity between the face image in the current video frame and the face image in the previous video frame through the adjacent frame intersection over union (IoU).

[0052] S204: Determine whether the similarity between the current face image and the historical face images exceeds the similarity threshold.

[0053] Specifically, to determine whether the current face image and the historical face images belong to the same target, compare the similarity between the current face image and the historical face images with the similarity threshold. In a specific embodiment, compare the adjacent frame intersection over union (IoU) of the face region of the face image in the current video frame and the face region of the face image in the previous video frame with the preset intersection over union (IoU).

[0054] When the similarity between the current face image and the historical face images exceeds the similarity threshold, directly jump to step S205; when the similarity between the current face image and the historical face images does not exceed the similarity threshold, directly jump to step S206.

[0055] S205: Classify the current face image and the historical face images into the same face trajectory image set.

[0056] Specifically, when the similarity between the current face image and the historical face image exceeds a similarity threshold, the current face image and the historical face image corresponding to the similarity are classified into the same face trajectory image set.

[0057] If the adjacent frame intersection-and-union ratio of the face area of ​​the face image of the current video frame and the face area of ​​the face image of the previous video frame is greater than the preset intersection-and-union ratio, it is determined that the similarity between the current face image and the historical face image exceeds the similarity threshold, then the current face image corresponding to the adjacent frame intersection-and-union ratio and the historical face image in the previous video frame are classified into the same face trajectory image set.

[0058] Specifically, if the intersection-and-union ratio of the face area of ​​the face image in the current video frame and the face areas of each face image contained in the historical video frames within a preset frame number range is greater than the preset intersection-and-union ratio, the current face image corresponding to the intersection-and-union ratio and the historical face images in the historical video frames are classified into the same face trajectory image set, and the face trajectory image set for determining the current face image is entered.

[0059] S206: A new face track image set is created, and the current face image is classified into the newly created face track image set.

[0060] Specifically, in response to the similarity between the current face image and the historical face image not reaching the similarity threshold, a new face track image set is established, and the current face image is classified into the newly created face track image set, and the current video frame is used as the starting video frame in the face track image set.

[0061] If the similarity between the current face image and the historical face images within the preset frame number range does not exceed the similarity threshold, it indicates that the current face image is not similar to all the face images in the historical video frames. In this case, a new face track image set is established and the current face image is classified into the newly established face track image set.

[0062] In a specific embodiment, in response to the adjacent frame intersection-and-union ratio being not greater than a preset intersection-and-union ratio, a new face track image set is created, and the current face image is classified into the newly created face track image set.

[0063] S207: Determine whether the time interval between the current video frame and the starting video frame in the face trajectory image set to which it belongs exceeds a preset time.

[0064] Specifically, the tracking trajectory of the face images within the preset number of frames is determined. Furthermore, it is necessary to determine whether the time interval between the current video frame and the starting video frame in the face trajectory image set to which it belongs exceeds the preset time.

[0065] If the time interval between the current video frame and the starting video frame in the face trajectory image set to which it belongs exceeds the preset time, directly jump to step S208; if the time interval between the current video frame and the starting video frame in the face trajectory image set to which it belongs does not exceed the preset time, directly jump to step S201 to obtain the next video frame.

[0066] S208: Cluster the face images included in the face trajectory image set to obtain a set of category images.

[0067] Specifically, if the time interval between the current video frame and the starting video frame in the face trajectory image set to which it belongs exceeds the preset time, determine the face trajectory image set corresponding to the current face image. Continue to cluster the face images included in the face trajectory image set to determine the set of category images for each target included in the face trajectory image set.

[0068] In a specific embodiment, calculate the similarity between each pair of face images in the face trajectory image set, and assign two face images with a similarity exceeding the preset similarity to the same category image, indicating that the two face images belong to the same target and can be assigned to the same category image set. That is to say, one category image set corresponds to one target, and the category image set contains multiple face images of the same target.

[0069] Take a face image as a node, establish an associated edge between the nodes corresponding to two face images with a similarity exceeding the preset similarity, and the length of the associated edge is the weight value obtained according to the similarity; establish an associated edge between the nodes corresponding to two face images with a similarity not exceeding the preset similarity, thereby obtaining the similarity matrix of the category image set. Determine the nearest neighbor matrix of the face image according to the similarity between the face image and other face images.

[0070] S209: Determine the category scores of each category image set.

[0071] Specifically, randomly select a face image from the category image set, and determine the category score of the selected face image according to the similarity between the selected face image and other face images in the category image set to which the selected face image belongs. Traverse each face image in the category image set to obtain the category scores of each face image in the category image set. Take the highest category score in the category image set as the category score of the category image set.

[0072] Traverse to obtain the category scores corresponding to each category image set.

[0073] S210: Determine the face image set of the target object.

[0074] Specifically, determine the face image set of the target object from various category image sets included in the face trajectory image set. Determine the face image set of the target object according to the category scores corresponding to the various category image sets. In a specific embodiment, select the category image set with the highest category score as the face image set of the target object.

[0075] S211: Calculate the quality evaluation values of each face image in the face image set.

[0076] Specifically, determine the quality evaluation value of the face image based on the face occlusion degree, face integrity degree, and face clarity degree of the face image. In a specific embodiment, compare each face image in the face image set of the target object with the standard face image respectively, and then determine the face occlusion score, face integrity score, and face clarity score of the face image. Then, determine the quality evaluation value of each face image in the face image set according to the weighted sum of the face occlusion score, face integrity score, and face clarity score.

[0077] Determine the quality evaluation value of the face image based on the pitch angle, yaw angle, and roll angle of the face in the face image. In a specific embodiment, compare each face image in the face image set of the target object with the standard face image respectively, and then determine the pitch angle offset, yaw angle offset, and roll angle offset of the face in each face image. Then, determine the quality evaluation value of each face image in the face image set according to the weighted sum of the pitch angle offset, yaw angle offset, and roll angle offset of the face in the face image.

[0078] In a preferred embodiment, determine the quality evaluation value of each face image in the face image set based on the weighted sum of the face occlusion score, face integrity score, face clarity score, and pitch angle offset, yaw angle offset, and roll angle offset of the face in the face image.

[0079] S212: Select the optimal face image of the target object from the face image set.

[0080] Specifically, select the face image corresponding to the highest quality evaluation value in the face image set of the target object as the optimal face image of the target object, obtain the high-quality face image of the target object, and thus improve the face recognition accuracy of the target object.

[0081] S213: Perform face recognition on the target object based on the optimal face image.

[0082] Specifically, feature extraction is performed on the optimal face image to obtain face features; the face features are compared with preset face features; in response to the similarity between the face features and the preset face features exceeding a threshold, the preset target corresponding to the preset face features is determined as the target object corresponding to the optimal face image.

[0083] In a specific embodiment, in order to further improve the accuracy of face recognition of the target object, attribute extraction is performed on the optimal face image to determine attribute features such as the gender of the target object.

[0084] The face recognition method provided in this embodiment includes: in response to detecting a current face image in the current video frame, comparing the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images; in response to the similarity between the current face image and the historical face images reaching a similarity threshold, classifying the current face image and the historical face images into the same face trajectory image set; performing clustering processing on the face images in the face trajectory image set to obtain a face image set of the target object, and selecting the optimal face image of the target object from the face image set; performing face recognition on the target object based on the optimal face image. By obtaining the face trajectory image set of the current face image, performing clustering processing on the face images in the face trajectory image set, determining the face image set of the target object, determining the optimal face image in the face image set of the target object, removing duplicate face images in the face trajectory image set, reducing the calculation amount and the memory occupancy rate, and thus improving the recognition speed; and performing face recognition on the target object based on the optimal face image can improve the recognition accuracy of the target object.

[0085] Refer to Figure 4 , Figure 4 is a schematic block diagram of a face recognition device provided by the present invention. In this embodiment, a face recognition device 60 is provided. The face recognition device 60 includes a comparison module 61, a tracking module 62, a clustering module 63, and an identification module 64.

[0086] The comparison module 61 is configured to, in response to detecting a current face image in the current video frame, compare the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images.

[0087] The tracking module 62 is configured to, in response to the similarity between the current face image and the historical face images reaching a similarity threshold, classify the current face image and the historical face images into the same face trajectory image set.

[0088] The clustering module 63 is configured to perform clustering processing on the face images in the face trajectory image set to obtain a face image set of the target object, and select the optimal face image of the target object from the face image set.

[0089] The recognition module 64 is used to perform face recognition on the target object based on the optimal face image.

[0090] In this embodiment, by obtaining the face trajectory image set of the current face image, clustering the face images in the face trajectory image set to determine the face image set of the target object, determining the optimal face image in the face image set of the target object, and removing the duplicate face images in the face trajectory image set, the calculation amount is reduced and the memory occupancy rate is lowered, thereby improving the recognition speed; and performing face recognition on the target object based on the optimal face image can improve the recognition accuracy of the target object.

[0091] Refer to Figure 5 , Figure 5 which is a schematic block diagram of an embodiment of the terminal provided by the present invention. The terminal 70 in this embodiment includes: a processor 71, a memory 72, and a computer program stored in the memory 72 and executable on the processor 71. When the computer program is executed by the processor 71, it implements the above-mentioned face recognition method. To avoid repetition, details are not described herein one by one.

[0092] Refer to Figure 6 , Figure 6 which is a schematic block diagram of an embodiment of the computer-readable storage medium provided by the present invention. In an embodiment of the present application, a computer-readable storage medium 90 is further provided. The computer-readable storage medium 90 stores a computer program 901, and the computer program 901 includes program instructions. When the processor executes the program instructions, it implements the face recognition method provided by the embodiment of the present application.

[0093] Among them, the computer-readable storage medium 90 may be an internal storage unit of the computer device in the foregoing embodiment, such as the hard disk or memory of the computer device. The computer-readable storage medium 90 may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart media card (SMC), a secure digital (SD) card, a flash card, etc.

[0094] The above are only embodiments of the present invention, and do not limit the patent protection scope of the present invention. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied to other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A face recognition method, characterized in that The described face recognition method includes: In response to detecting a current face image in the current video frame, comparing the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images; In response to the similarity between the current face image and the historical face images reaching a similarity threshold, classifying the current face image and the historical face images into the same face trajectory image set; Performing clustering processing on the face images in the face trajectory image set to obtain a face image set of the target object, and selecting the optimal face image of the target object from the face image set; Performing face recognition on the target object based on the optimal face image; The performing clustering processing on the face images in the face trajectory image set to obtain a face image set of the target object includes: Calculating the similarity between each of the face images in the face trajectory image set; In response to the similarity exceeding a preset similarity, classifying the two face images corresponding to the similarity into the same category image set; Traversing the similarities between each of the face images in the category image set and each of the other face images included in the category image set to determine the category scores of each of the face images in the category image set; Taking the highest category score in the category image set as the category rating corresponding to the category image set; Taking the category image set corresponding to the highest category rating as the face image set of the target object.

2. The face recognition method according to claim 1, wherein the in response to detecting a current face image in the current video frame, comparing the current face image with historical face images in historical video frames to determine the similarity between the current face image and the historical face images includes: Calculating the intersection over union (IoU) between the face region of the current face image and the face region of the historical face image; In response to the IoU being greater than a preset IoU, determining that the similarity between the current face image and the historical face image exceeds the similarity threshold.

3. The face recognition method according to claim 2, wherein the calculating the intersection over union (IoU) between the face region of the current face image and the face region of the historical face image includes: Calculating the adjacent frame IoU between the face regions of the face image in the current video frame and the face image in the previous video frame; the in response to the IoU being greater than a preset IoU, determining that the similarity between the current face image and the historical face image exceeds the similarity threshold includes: In response to the adjacent frame IoU being greater than the preset IoU, determining that the similarity between the current face image and the historical face image exceeds the similarity threshold; In response to the adjacent frame IoU not being greater than the preset IoU, newly establishing a face trajectory image set and classifying the current face image into the newly established face trajectory image set.

4. The face recognition method according to claim 1, wherein It further includes: Calculating the quality evaluation values of each of the face images included in the face trajectory image set; Selecting the optimal face image of the target object from the face image set includes: Selecting the face image corresponding to the highest quality evaluation value in the face image set of the target object as the optimal face image of the target object.

5. The face recognition method according to claim 4, wherein Calculating the quality evaluation values of the respective face images included in the face trajectory image set includes: Determining the quality evaluation value of the face image based on the face occlusion degree, face integrity degree, and face clarity degree of the face image.

6. The face recognition method according to claim 4 or 5, wherein Calculating the quality evaluation values of the respective face images in the face trajectory image set includes: Determining the quality evaluation value of the face image based on the pitch angle, yaw angle, and roll angle of the face in the face image.

7. The face recognition method according to claim 4, wherein Clustering the face images in the face trajectory image set to obtain a face image set of the target object, and selecting the optimal face image of the target object from the face image set further includes: Judging whether the time interval between the current video frame and the starting video frame in the face trajectory image set to which it belongs exceeds a preset time; If the time interval exceeds the preset time, clustering the face images included in the face trajectory image set.

8. The face recognition method according to claim 1, wherein Performing face recognition on the target object based on the optimal face image includes: Performing feature extraction on the optimal face image to obtain face features; Comparing the face features with preset face features; In response to the similarity between the face features and the preset face features exceeding a threshold, determining the preset target corresponding to the preset face features as the target object corresponding to the optimal face image.

9. A face recognition device, characterized in that, The face recognition device includes: A comparison module for, in response to detecting a current face image in a current video frame, comparing the current face image with a historical face image in a historical video frame to determine the similarity between the current face image and the historical face image; A tracking module for, in response to the similarity between the current face image and the historical face image reaching a similarity threshold, classifying the current face image and the historical face image into the same face trajectory image set; A clustering module, which is used to perform clustering processing on the face images in the face trajectory image set to obtain a face image set of a target object, and select the optimal face image of the target object from the face image set; it is also used to calculate the similarity between each of the face images in the face trajectory image set; in response to the similarity exceeding a preset similarity, the two face images corresponding to the similarity are classified into the same category image set; traverse the similarity between each of the face images in the category image set and each of the other face images included in the category image set, determine the category scores of each of the face images in the category image set; use the highest category score in the category image set as the category rating corresponding to the category image set; use the category image set corresponding to the highest category rating as the face image set of the target object; An identification module, which is used to perform face recognition on the target object based on the optimal face image.

10. A terminal, characterized in that, The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor. The processor is used to execute program data to implement the steps in the face recognition method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, it implements the steps in the face recognition method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Human face identification method and apparatus, electronic device and computer storage medium

    CN108229297A

  • Character recognition method and device, electronic equipment and storage medium

    CN111738120A