CN-116631035-B - Face recognition output result screening method and device
Abstract
The embodiment of the invention provides a face recognition output result screening method and device, which comprise the steps of reading a target face image to be detected, identifying similar face images from a target face database based on a preset face recognition algorithm, outputting the first k similar face images and the corresponding first k similar values according to a descending order of the similar values, calculating the maximum inter-class variance of the first k similar values, determining that the output result is not hit in the target face image to be detected if the maximum inter-class variance is smaller than a maximum inter-class variance threshold value which is obtained by training in advance based on the preset face recognition algorithm, and otherwise, screening the target face image from the first k similar face images according to the maximum inter-class variance, thereby relieving the defect that the face recognition result is excessively dependent on manual judgment, reducing the application cost of the face recognition technology in the public safety field, and improving the usability and practicability of the face recognition technology in the public safety field.
Inventors
- LIU JITONG
- ZHANG LU
- XIE FUJIN
- YU BO
- WANG ZHIHAI
Assignees
- 北京明朝万达科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230531
Claims (9)
- 1. The face recognition output result screening method is characterized by comprising the following steps of: reading a face image of a target to be detected; based on a preset face recognition algorithm, recognizing similar face images from a target face database, and outputting the first k similar face images and the corresponding first k similarity values in descending order of the similarity values; calculating the maximum inter-class variance of the first k similarity values; If the maximum inter-class variance is smaller than a maximum inter-class variance threshold value which is obtained based on the preset face recognition algorithm and trained in advance, determining that an output result is not hit in the target face image to be detected; Otherwise, determining an output result to hit the target face image to be detected, and screening the target face image from the first k similar face images according to the maximum inter-class variance; The calculating the maximum inter-class variance of the first k similarity values includes: Sequentially calculating the inter-class variances of the first n similarity values and the last k-n similarity values in the first k similarity values, and sequentially storing the calculated inter-class variances into a list L, wherein n is a positive integer in an interval [1, k); And taking the maximum value Lmax in the list L as the maximum inter-class variance of the first k similarity values.
- 2. The method of claim 1, wherein the maximum inter-class variance threshold is determined by: setting a face recognition training data set S and a target face training data set Q to be detected; According to the target face training data set Q to be detected, training data in the face recognition training data set S are divided into a hit training data set Sh and a miss training data set Sn; For each target face data to be detected in the target face training data set Q to be detected, respectively identifying similar face images from the hit training data set Sh and the miss training data set Sn based on the preset face recognition algorithm, outputting two groups of first k similarity values in descending order according to the similarity values, and respectively calculating a first maximum inter-class variance and a second maximum inter-class variance corresponding to the two groups of first k similarity values; a maximum inter-class variance threshold T is determined based on the first maximum inter-class variance and the second maximum inter-class variance.
- 3. The method according to claim 2, wherein the identifying similar face images from the hit training data set Sh and the miss training data set Sn based on the preset face recognition algorithm for each target face data qi to be detected in the target face training data set Q, and outputting two sets of first k similarity values according to a descending order of similarity values, and calculating a first maximum inter-class variance and a second maximum inter-class variance corresponding to the two sets of first k similarity values, respectively, includes: any target face data qi to be detected is taken from the target face training data set Q to be detected; based on the preset face recognition algorithm, recognizing similar face images from the hit training data set Sh, and outputting the first k similarity values in descending order according to the similarity values; Calculating a first maximum inter-class variance vi of the first k similarity values through a maximum inter-class variance algorithm, and storing the first maximum inter-class variance vi into a first array Vh until all the face data to be detected in the face training data set Q to be detected are identified; Based on the preset face recognition algorithm, recognizing similar face images from the unnoticed training data set Sn, and outputting the first k similarity values in descending order according to the similarity values; and calculating a second maximum inter-class variance vj of the first k similarity values through a maximum inter-class variance algorithm, and storing the second maximum inter-class variance vj into a second group Vn until all the face data to be detected in the face training data set Q to be detected are completely identified.
- 4. A method according to claim 3, wherein determining a maximum inter-class variance threshold T based on the first maximum inter-class variance and the second maximum inter-class variance comprises: calculating a minimum value Vmin in the first array Vh and a maximum value Vmax in the second array; and taking the average value of the minimum value Vmin and the maximum value Vmax as the maximum inter-class variance threshold T.
- 5. The method of claim 1, wherein the screening the target face image from the top k similar face images according to the maximum inter-class variance comprises: Determining a list index m corresponding to a maximum value Lmax in the list L, wherein m is a positive integer in a section [1, n ]; and determining the first m similar face images in the first k similar face images as target face images.
- 6. The method according to any one of claims 1-4, wherein the predetermined face recognition algorithm is a face recognition algorithm based on a depth residual neural network ResNet-50.
- 7. The utility model provides a face identification output result sieving mechanism which characterized in that includes: the reading module is used for reading the face image of the target to be detected; The recognition module is used for recognizing similar face images from the target face database based on a preset face recognition algorithm, and outputting the first k similar face images and the corresponding first k similarity values in descending order according to the similarity values; the calculating module is used for calculating the maximum inter-class variance of the first k similarity values; The judging module is used for determining that the output result is not hit in the target face image to be detected if the maximum inter-class variance is smaller than a maximum inter-class variance threshold value which is obtained based on the preset face recognition algorithm and trained in advance; The output module is used for determining that the output result hits the target face image to be detected if the maximum inter-class variance is not smaller than a maximum inter-class variance threshold value which is obtained based on the preset face recognition algorithm and screening the target face image from the previous k similar face images according to the maximum inter-class variance; the computing module is used for: Sequentially calculating the inter-class variances of the first n similarity values and the last k-n similarity values in the first k similarity values, and sequentially storing the calculated inter-class variances into a list L, wherein n is a positive integer in an interval [1, k); And taking the maximum value Lmax in the list L as the maximum inter-class variance of the first k similarity values.
- 8. An electronic device, comprising: A memory and a processor, the processor and the memory completing communication with each other via a bus, the memory storing program instructions executable by the processor, the processor invoking the program instructions capable of performing the method of any of claims 1-6.
- 9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any one of claims 1 to 6.
Description
Face recognition output result screening method and device Technical Field The invention relates to the technical field of image recognition, in particular to a face recognition output result screening method and a face recognition output result screening device. Background Public safety is an important foundation stone for the development of social stability and prosperity, and the public safety has the characteristics of wide service range, large data volume and the like in the field. The public security maintenance needs to monitor and identify the citizens or users, and the face recognition technology is a technology for comparing the faces in the images to be detected with a feature library constructed based on target faces so as to realize the identity verification or the identity recognition of the people in the images to be detected, so that the face recognition technology has become an important component in the public security field. Referring to fig. 1, a flow chart of a face recognition technology based on an artificial intelligence algorithm in the prior art is shown, which specifically includes the following steps: inputting a target face image q to be detected, and a target face picture library M, k=5 A1, reading a picture q to be detected; And A2, based on a depth residual neural network algorithm, extracting face features in the image to be detected, and obtaining the face features F of the target to be detected. And A3, calculating the similarity between the face feature F and each face feature in the target face picture library M by adopting Euclidean distance, and returning to top-k (top-5) most similar face features in a descending order. And A4, inquiring the corresponding face picture from the target face picture library M according to the top-5 face features. And A5, manually judging whether the returned target face picture contains the face in the image q to be detected. The output result comprises two parts, namely 1) a target face image and 2) similarity. The k (k=5) target face images represent 5 face images with highest similarity with the face image to be detected in the target face library, the similarity represents the similarity degree of the k most similar target face images and the face image to be detected, the similarity value range [0,1] is larger, and the higher the similarity value is, the higher the similarity degree of the two face images is. According to whether the returned result contains the target face image to be detected, the output result can be divided into: (1) N (n < = k, k is the number of output results) target faces are included and marked as hit face images to be detected; (2) And (5) not including the target face, and recording as a face image to be detected which is not hit. The following problems exist in the application of face recognition technology in public safety field due to the numerous users needing to be recognized: (1) The public safety field requires high recognition precision to the target person, however, the current face recognition technology cannot ensure hundred percent accuracy of the recognition result, and top-k similar face images are often returned to improve the effectiveness of the face recognition result. (2) The target face feature library is huge, so that the similarity between different face features is high, and whether the faces of the targets to be detected exist in k results returned by the face recognition algorithm or not cannot be judged through a simple threshold value, namely whether the targets to be detected hit or not. (3) The k results returned by the face recognition algorithm may contain n (n < k) target face images to be detected, and the images containing the target face images to be detected need to be screened from the output results. Aiming at the problems, the traditional method adopts a manual mode to finish screening output results, however, the manual mode consumes huge manpower and financial resources in the public safety field with massive detection tasks, and cannot meet the requirement of high-efficiency identification in the public safety field, so how to accurately screen out the face images of the target to be detected from the returned results becomes the problem to be solved in the face recognition algorithm. Disclosure of Invention Aiming at the defects in the prior art, the embodiment of the invention provides a face recognition output result screening method and a face recognition output result screening device. In a first aspect, an embodiment of the present invention provides a face recognition output result screening method, including: reading a face image of a target to be detected; based on a preset face recognition algorithm, recognizing similar face images from a target face database, and outputting the first k similar face images and the corresponding first k similarity values in descending order of the similarity values; calculating the maximum inter-class variance of the firs