CN112861742A - Face recognition method and device, electronic equipment and storage medium - Google Patents

Face recognition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112861742A
CN112861742A CN202110190433.8A CN202110190433A CN112861742A CN 112861742 A CN112861742 A CN 112861742A CN 202110190433 A CN202110190433 A CN 202110190433A CN 112861742 A CN112861742 A CN 112861742A
Authority
CN
China
Prior art keywords
recognition
face
person
candidate
identity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110190433.8A
Other languages
Chinese (zh)
Inventor
程星星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110190433.8A priority Critical patent/CN112861742A/en
Publication of CN112861742A publication Critical patent/CN112861742A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Human Computer Interaction (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Collating Specific Patterns (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a face recognition method, a face recognition device, electronic equipment and a storage medium. The face recognition method comprises the following steps: acquiring a face image, and carrying out primary identification on the face image to obtain a plurality of candidate identification results, wherein the candidate identification results comprise at least one person identity; acquiring the recognition confidence of each person identity in a plurality of candidate recognition results; when the recognition confidence coefficient of each person identity does not meet the requirement, obtaining a difficult recognition data set based on the plurality of candidate recognition results; inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition; and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result. The face recognition method can effectively reduce the false identification and missing identification of the face image, and improve the accuracy and recall rate of the identification result.

Description

Face recognition method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image recognition technologies, and in particular, to a face recognition method and apparatus, an electronic device, and a storage medium.
Background
At present, a face recognition mode usually includes collecting a standard face image of a target object to be recognized, extracting features and storing the features; carrying out face detection and face feature extraction on a target to be recognized; compared with the stored standard human face characteristics, the principle is that the human face images belonging to the same identity have smaller spatial distance, and the human face images belonging to different identities have larger spatial distance, so as to determine the identity of the person. However, when facial features of face images belonging to different identities are similar (such as long-phase similarity, glasses with black frames, optical heads and the like), false recognition is easily generated. In the current solution, the confidence threshold of face recognition is improved, but the recall rate of face recognition is reduced; or, the number of training samples or standard face features is increased, which brings extra data acquisition and labeling workload.
Disclosure of Invention
The invention provides a face recognition method, a face recognition device, electronic equipment and a storage medium, which can effectively reduce the identity false recognition and missing recognition of a face image and improve the accuracy and recall rate of a recognition result.
The invention provides a face recognition method, which comprises the following steps:
acquiring a face image, and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, wherein the candidate recognition results comprise at least one person identity;
acquiring the recognition confidence of each person identity in the multiple candidate recognition results;
when the recognition confidence coefficient of each person identity does not meet the requirement, obtaining a difficult recognition data set based on the plurality of candidate recognition results;
inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition;
and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
According to the face recognition method provided by the invention, the obtaining of the face image and the primary recognition of the face image to obtain a plurality of candidate recognition results comprises the following steps:
extracting a face feature vector of the face image;
respectively calculating the distances between the face feature vectors and a plurality of pre-stored standard face feature vectors;
and obtaining a plurality of candidate recognition results based on the distances between the face feature vector and a plurality of pre-stored standard face feature vectors.
According to the face recognition method provided by the invention, the obtaining of the recognition confidence of each person identity in the multiple candidate recognition results comprises the following steps:
counting the occurrence frequency of each person identity in the candidate identification results;
and obtaining the recognition confidence coefficient of each person identity based on the occurrence frequency of each person identity.
According to the face recognition method provided by the invention, the hard recognition data set comprises a standard face image of any person identity in the candidate recognition results and standard face images of other person identities except the person identity,
inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition, wherein the method comprises the following steps:
extracting the face characteristic vectors of the standard face image of any person identity and the standard face images of other person identities except the person identity so that the following relation is satisfied between the face characteristic vectors of the standard face image of any person identity and the standard face images of other person identities except the person identity:
Figure BDA0002943913060000031
wherein the content of the first and second substances,
Figure BDA0002943913060000032
the face characteristics corresponding to the face image representing the identity of any person,
Figure BDA0002943913060000033
the face characteristics corresponding to any one of the face images representing the identity of any person,
Figure BDA0002943913060000034
a face feature, α, corresponding to a face image representing the identity of a person other than said any one person>0 represents a constraint range between any one of the face images of the arbitrary person identity and one of the face images of the other person identities except the arbitrary person identity.
According to the face recognition method provided by the invention, the obtaining of the final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result comprises the following steps:
counting the occurrence frequency of each person identity in the multiple candidate recognition results and the secondary recognition result;
and taking the person identity with the largest occurrence number as a final recognition result of the face image.
The face recognition method provided by the invention further comprises the following steps: when the person identity with the largest occurrence frequency is not unique, obtaining a plurality of candidate recognition results and the average distance corresponding to each person identity of the secondary recognition result;
and taking the person identity with the minimum average distance as a final recognition result of the face image.
The face recognition method provided by the invention further comprises the following steps:
and when the recognition confidence degree of the person identity meeting the requirement exists, taking the person identity meeting the requirement as a final recognition result of the face image.
The present invention also provides a face recognition apparatus, comprising:
the system comprises an acquisition module, a recognition module and a processing module, wherein the acquisition module is used for acquiring a face image and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, and the candidate recognition results comprise at least one person identity;
the confidence coefficient calculation module is used for acquiring the recognition confidence coefficient of each person identity in the candidate recognition results;
the identification difficulty data set acquisition module is used for acquiring identification difficulty data sets based on the candidate identification results when the identification confidence coefficient of each person identity does not meet the requirement;
the secondary recognition module is used for inputting the difficult recognition data set into a face recognition model which is trained in advance through a difficult recognition sample to perform secondary recognition;
and the identity determining module is used for obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the steps of the human face recognition method.
The invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the face recognition method as described in any of the above.
According to the face recognition method, the face recognition device, the electronic equipment and the storage medium, a plurality of candidate recognition results are obtained through matching of face feature vectors, then the recognition confidence coefficient of each person identity in the plurality of candidate recognition results is calculated, when the recognition confidence coefficient of each person identity is low, a face image sample which is difficult to recognize is obtained based on the recognition confidence coefficient, retraining and recognition are carried out according to the difficult-to-recognize data sample, a final recognition result is obtained by combining a primary recognition result and a secondary recognition result, identity misrecognition and missing recognition of the face image can be effectively reduced, and the accuracy and the recall rate of the recognition result are improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a face recognition method provided by the present invention;
FIG. 2 is a schematic diagram of face feature extraction in the face recognition method provided by the present invention;
FIG. 3 is a schematic diagram of Euclidean distance of the calculated feature vectors of the face recognition method provided by the invention;
FIG. 4 is a schematic diagram of calculating recognition confidence in the face recognition method provided by the present invention;
FIG. 5 is a schematic diagram of mining hard-to-recognize data sets in the face recognition method provided by the invention;
fig. 6 is a schematic diagram illustrating a final recognition result being corrected based on a secondary recognition result in the face recognition method provided by the present invention;
FIG. 7 is a schematic diagram of determining a final recognition result in the face recognition method provided by the present invention;
FIG. 8 is another schematic diagram of determining a final recognition result in the face recognition method provided by the present invention;
FIG. 9 is a block diagram of a face recognition apparatus according to the present invention;
fig. 10 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following describes a face recognition method, a face recognition apparatus, an electronic device, and a storage medium according to embodiments of the present invention with reference to the drawings.
Fig. 1 is a flowchart of a face recognition method according to an embodiment of the present invention. As shown in fig. 1, the face recognition method according to the embodiment of the present invention includes the following steps:
s101: the method comprises the steps of obtaining a face image, and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, wherein the candidate recognition results comprise at least one person identity.
The face image refers to a face image of any user. The standard face images of a plurality of people and face features extracted from the standard face images can be pre-stored in a face recognition model based on Arcface in a face recognition mode based on Arcface for primary recognition. Furthermore, the acquired face image can be identified.
In a specific example, acquiring a face image, and performing primary recognition on the face image to obtain a plurality of candidate recognition results, including: extracting a face feature vector of the face image; respectively calculating the distances between the face feature vectors and a plurality of pre-stored standard face feature vectors; and obtaining a plurality of candidate recognition results based on the distances between the face feature vector and a plurality of pre-stored standard face feature vectors.
In this example, the distance is generally referred to as a euclidean distance. The face recognition comprises face detection, feature extraction and the like, and specifically, the face detection can detect a face area, coordinates of the face area and position coordinate information of facial features in a face image. Face feature extraction, for example, converts a face image into a 512-dimensional feature vector. As shown in fig. 2, in the embodiment of the present invention, the Arcface algorithm is used to extract the face features, and the face feature vector after model conversion generally has the following characteristics: the space distance of the characteristic vectors of the face images of the same person identity is short; the space distance of the characteristic vectors of the facial images of different character identities is far. Furthermore, the feature vector of the converted human face features can distinguish human face images with different person identities in a high-dimensional vector space.
According to the Euclidean distance relationship among the feature vectors, the Euclidean distance between the face feature vector to be recognized (namely, the face features extracted from the obtained face image are connected) and a plurality of pre-stored standard face feature vectors can be calculated, the space distance of the face feature vector is measured by adopting the Euclidean distance, and the Euclidean distance calculation method comprises the following steps:
Figure BDA0002943913060000061
wherein x isiAnd xjTwo 512-dimensional face feature vectors are respectively represented, and dist represents the Euclidean distance between the two feature vectors.
And calculating Euclidean distances between the face feature vector to be recognized and all standard face feature vectors, and taking the first N values of the calculation result. As shown in fig. 3, the calculation result is shown, where x is the face feature vector to be recognized and y isiIs a stored standard face feature vector. diIs the ith Euclidean distance calculation result smaller than the preset value, and the identity is each diAnd calculating the identity of the person corresponding to the result.
In this embodiment, the first N candidate results whose calculated euclidean distance is smaller than the preset value may be used as the plurality of candidate recognition results, where the plurality of candidate recognition results are N, and N is usually an integer greater than 1. In this example, the smaller the euclidean distance between the face feature vector to be recognized and the pre-stored standard face feature vector is, the closer the face feature vector to be recognized and the pre-stored standard face feature vector are, that is: it is indicated that the more likely the person corresponding to the face feature vector to be recognized is the same person as the person corresponding to the standard face feature vector. For example: 100 standard face feature vectors are pre-stored, Euclidean distances between the face feature vector to be recognized and the 100 standard face feature vectors are respectively calculated, a preset value is assumed to be 5, and 7 of the calculated 100 Euclidean distances are smaller than 5, and the 7 Euclidean distances are used as candidate recognition results.
S102: and acquiring the recognition confidence of each person identity in the plurality of candidate recognition results.
In an embodiment of the present invention, the number of occurrences of each person identity in the plurality of candidate recognition results may be counted; and obtaining the recognition confidence of each person identity based on the occurrence frequency of each person identity.
Specifically, the person identity identities of the N candidate identification results are counted in groups and sorted according to the numerical value of the counting result from large to small, wherein if the grouping counting result of a certain identity is larger than the counting result of the certain identity, the mechanism conducts grouping counting on the person identity identities of the N candidate identification results, and the sorting is conducted in a mode that the numerical value of the counting result is from large to small
Figure BDA0002943913060000071
The confidence of the identification result is high, if all the grouping counting results do not meet the confidence threshold, namely: are all no more than
Figure BDA0002943913060000072
The confidence of the recognition result is low, and as shown in fig. 4, the calculation process of the recognition confidence is shown. In FIG. 4, identityiAnd m, n and s represent different person identities, wherein each of m, n and s is the number of groups corresponding to each person identity, and the candidate recognition result in fig. 4 comprises 3 recognized person identities.
S103: and when the recognition confidence coefficient of each person identity does not meet the requirement, based on the plurality of candidate recognition results, the data set is difficult to recognize.
In one embodiment of the present invention, the hard-to-recognize data set includes a standard face image of any one of the plurality of candidate recognition results and a standard face image of a person other than the any one.
Specifically, the hard recognition data set existing in the current recognition result may be represented by a triplet. And (2) storing the hard-to-recognize data set by adopting an < anchor, positive and negative > triple, wherein the anchor represents a standard face image corresponding to a certain identity in the N candidate results, the positive represents a random standard face image with the same identity as the anchor, and the negative is a standard face image with a different identity from the anchor in the N recognition results. And mining the difficult recognition triples appearing in the recognition based on different combinations of anchors and negative in the N candidate recognition results, wherein the mining process of the difficult recognition data sets is as follows:
selecting an anchor, namely sequentially taking the standard face images corresponding to the N candidate results as the anchor;
positive selection: randomly selecting a standard face image with the same identity as the anchor as positive;
negative selection: taking the standard face images with different identities with the anchor in the N candidate results as negative in sequence;
number of hard-to-recognize triples: the number of hard identified triples mined depends on the permutation and combination of different anchor numbers and different negative numbers.
Wherein d isiAnd identity are as defined above. As shown in fig. 5, 3 person identities appear in the recognition result, and the confidence degrees are all low, and 6 groups of triplet samples difficult to recognize are mined out in a permutation and combination manner of anchors and negative, that is: 6 difficult-to-identify data sets are acquired.
S104: and inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition.
In an embodiment of the present invention, inputting the hard-to-recognize data set into a face recognition model trained in advance by using a hard-to-recognize sample for secondary recognition, includes:
extracting the face characteristic vectors of the standard face image of any person identity and the standard face images of other person identities except the person identity so that the following relation is satisfied between the face characteristic vectors of the standard face image of any person identity and the standard face images of other person identities except the person identity:
Figure BDA0002943913060000091
wherein the content of the first and second substances,
Figure BDA0002943913060000092
the face characteristics corresponding to the face image representing the identity of any person,
Figure BDA0002943913060000093
the face characteristics corresponding to any one of the face images representing the identity of any person,
Figure BDA0002943913060000094
a face feature, α, corresponding to a face image representing the identity of a person other than said any one person>0 represents a constraint range between any one of the face images of the arbitrary person identity and one of the face images of the other person identities except the arbitrary person identity.
Specifically, based on the persistent mining and accumulation of the hard recognition data set as the hard recognition sample, the face recognition model is trained, and in the embodiment of the present invention, the Facenet network model may be used as the face recognition model used for the secondary recognition to perform the secondary training on the hard recognition sample. The Facenet network model is trained according to the formula, wherein alpha >0 represents the constraint range between positive and negative, namely the distance between all the same identity face features plus alpha constraint is smaller than the distance between different identity face features. Therefore, the triplet samples difficult to identify hardly satisfy the inequality, and the goal of the retraining is to make the triplet samples difficult to identify satisfy the inequality. The human face features extracted by the Facenet network model have the advantages that the spatial distance of the human face feature vectors belonging to the same identity (anchor and positive) is short, the spatial distance of the human face feature vectors belonging to different identities (anchor and negative) is long, and the difference between the human face feature vectors is at least alpha, so that the person identity recognition can be completed according to the spatial distance of the feature vectors.
After the face recognition model is trained through the hard recognition sample, namely the Facenet network model is trained, the hard recognition data set can be input into the Facenet network model, and then a secondary recognition result of face recognition is obtained through the Facenet network model.
S105: and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
In an embodiment of the present invention, obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the result of the secondary recognition includes: counting the occurrence frequency of each person identity in the multiple candidate recognition results and the secondary recognition result; and taking the person identity with the largest occurrence number as a final recognition result of the face image.
Specifically, the recognition task is performed again by using the Facenet model trained based on the difficult-to-recognize triple sample, and the primary recognition result (arcfacace) and the secondary recognition result (Facenet) are combined, as shown in fig. 6, the primary recognition is also called primary recognition, and the final recognition result can be determined based on the two recognition results.
In this embodiment, the final recognition result may be determined by a "voting method", that is: the identity of the person is determined according to the principle of minority majority-compliant, "voting method" recognition process is shown in fig. 7, and the identity corresponding to the result of max (m, n, s) is the finally recognized identity of the person.
Of course, when the person identity with the largest occurrence frequency is not unique, obtaining a plurality of candidate recognition results and an average distance corresponding to each person identity of the secondary recognition result; and taking the person identity with the minimum average distance as a final recognition result of the face image. Specifically, if there are multiple candidate person identities with the same confidence in the recognition result. Then the person identity is determined by using the principle of minimum average distance, the calculation process of the minimum average distance is as shown in fig. 8, and x, y and z are the identity respectively1、identity2And identity3The average euclidean distance of the packets. The identity corresponding to the min (x, y, z) result is the finally recognized person identity, that is: and finally identifying a result.
In an embodiment of the present invention, the face recognition method further includes: and when the recognition confidence degree of the person identity meeting the requirement exists, taking the person identity meeting the requirement as a final recognition result of the face image.
According to the face recognition method provided by the embodiment of the invention, a plurality of candidate recognition results are obtained through matching of face feature vectors, then the recognition confidence coefficient of each person identity in the plurality of candidate recognition results is calculated, when the recognition confidence coefficient of each person identity is lower, a face image sample which is difficult to recognize is obtained based on the recognition confidence coefficient, retraining and recognition are carried out according to the difficult-to-recognize data sample, and a final recognition result is obtained by combining the primary recognition result and the secondary recognition result, so that the false recognition and the missing recognition of the face image can be effectively reduced, and the accuracy and the recall rate of the recognition result are improved.
The following describes the face recognition device provided by the present invention, and the face recognition device described below and the face recognition method described above may be referred to in correspondence with each other.
As shown in fig. 9, a face recognition apparatus according to an embodiment of the present invention includes: an obtaining module 910, a confidence calculating module 920, a difficult-to-recognize data set obtaining module 930, a secondary recognizing module 940 and an identity determining module 950, wherein:
an obtaining module 910, configured to obtain a face image, and perform primary recognition on the face image to obtain multiple candidate recognition results, where the candidate recognition results include at least one person identity;
a confidence calculation module 920, configured to obtain a recognition confidence of each person identity in the multiple candidate recognition results;
a difficult-to-recognize data set obtaining module 930, configured to obtain a difficult-to-recognize data set based on the multiple candidate recognition results when the recognition confidence of each person identity does not meet the requirement;
a secondary recognition module 940, configured to input the hard recognition data set into a face recognition model trained in advance through a hard recognition sample for secondary recognition;
and an identity determining module 950, configured to obtain a final recognition result of the face image according to the multiple candidate recognition results and the secondary recognition result.
According to the face recognition device provided by the embodiment of the invention, a plurality of candidate recognition results are obtained through matching of face feature vectors, then the recognition confidence coefficient of each person identity in the plurality of candidate recognition results is calculated, when the recognition confidence coefficient of each person identity is lower, a face image sample which is difficult to recognize is obtained based on the recognition confidence coefficient, retraining and recognition are carried out according to the difficult-to-recognize data sample, and a final recognition result is obtained by combining the primary recognition result and the secondary recognition result, so that the identity misrecognition and missing recognition of the face image can be effectively reduced, and the accuracy and recall rate of the recognition result are improved.
Fig. 10 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 9: a processor (processor)510, a communication interface (communication interface)520, a memory (memory)530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other via the communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a face recognition method comprising: acquiring a face image, and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, wherein the candidate recognition results comprise at least one person identity; acquiring the recognition confidence of each person identity in the multiple candidate recognition results; when the recognition confidence coefficient of each person identity does not meet the requirement, obtaining a difficult recognition data set based on the plurality of candidate recognition results; inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition; and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, which when executed by a computer, enable the computer to perform the face recognition method provided by the above methods, the method comprising: acquiring a face image, and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, wherein the candidate recognition results comprise at least one person identity; acquiring the recognition confidence of each person identity in the multiple candidate recognition results; when the recognition confidence coefficient of each person identity does not meet the requirement, obtaining a difficult recognition data set based on the plurality of candidate recognition results; inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition; and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the face recognition methods provided above, the method including: acquiring a face image, and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, wherein the candidate recognition results comprise at least one person identity; acquiring the recognition confidence of each person identity in the multiple candidate recognition results; when the recognition confidence coefficient of each person identity does not meet the requirement, obtaining a difficult recognition data set based on the plurality of candidate recognition results; inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition; and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A face recognition method, comprising:
acquiring a face image, and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, wherein the candidate recognition results comprise at least one person identity;
acquiring the recognition confidence of each person identity in the multiple candidate recognition results;
when the recognition confidence coefficient of each person identity does not meet the requirement, obtaining a difficult recognition data set based on the plurality of candidate recognition results;
inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition;
and obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
2. The method of claim 1, wherein the obtaining a face image and performing a primary recognition on the face image to obtain a plurality of candidate recognition results comprises:
extracting a face feature vector of the face image;
respectively calculating the distances between the face feature vectors and a plurality of pre-stored standard face feature vectors;
and obtaining a plurality of candidate recognition results based on the distances between the face feature vector and a plurality of pre-stored standard face feature vectors.
3. The method of claim 1, wherein the obtaining a recognition confidence of each person identity in the candidate recognition results comprises:
counting the occurrence frequency of each person identity in the candidate identification results;
and obtaining the recognition confidence coefficient of each person identity based on the occurrence frequency of each person identity.
4. The face recognition method according to any one of claims 1 to 3, wherein the hard recognition data set includes a standard face image of any one of the plurality of candidate recognition results and standard face images of other person identities than the any one,
inputting the difficult-to-recognize data set into a human face recognition model trained in advance through a difficult-to-recognize sample for secondary recognition, wherein the method comprises the following steps:
extracting the face characteristic vectors of the standard face image of any person identity and the standard face images of other person identities except the person identity so that the following relation is satisfied between the face characteristic vectors of the standard face image of any person identity and the standard face images of other person identities except the person identity:
Figure FDA0002943913050000021
wherein the content of the first and second substances,
Figure FDA0002943913050000022
the face characteristics corresponding to the face image representing the identity of any person,
Figure FDA0002943913050000023
the face characteristics corresponding to any one of the face images representing the identity of any person,
Figure FDA0002943913050000024
a face feature, α, corresponding to a face image representing the identity of a person other than said any one person>0 represents a constraint range between any one of the face images of the arbitrary person identity and one of the face images of the other person identities except the arbitrary person identity.
5. The method according to claim 1, wherein obtaining a final recognition result of the face image according to the candidate recognition results and the secondary recognition result comprises:
counting the occurrence frequency of each person identity in the multiple candidate recognition results and the secondary recognition result;
and taking the person identity with the largest occurrence number as a final recognition result of the face image.
6. The face recognition method of claim 5, further comprising: when the person identity with the largest occurrence frequency is not unique, obtaining a plurality of candidate recognition results and the average distance corresponding to each person identity of the secondary recognition result;
and taking the person identity with the minimum average distance as a final recognition result of the face image.
7. The face recognition method of claim 1, further comprising:
and when the recognition confidence degree of the person identity meeting the requirement exists, taking the person identity meeting the requirement as a final recognition result of the face image.
8. A face recognition apparatus, comprising:
the system comprises an acquisition module, a recognition module and a processing module, wherein the acquisition module is used for acquiring a face image and carrying out primary recognition on the face image to obtain a plurality of candidate recognition results, and the candidate recognition results comprise at least one person identity;
the confidence coefficient calculation module is used for acquiring the recognition confidence coefficient of each person identity in the candidate recognition results;
the identification difficulty data set acquisition module is used for acquiring identification difficulty data sets based on the candidate identification results when the identification confidence coefficient of each person identity does not meet the requirement;
the secondary recognition module is used for inputting the difficult recognition data set into a face recognition model which is trained in advance through a difficult recognition sample to perform secondary recognition;
and the identity determining module is used for obtaining a final recognition result of the face image according to the plurality of candidate recognition results and the secondary recognition result.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the face recognition method according to any one of claims 1 to 7 are implemented when the program is executed by the processor.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the face recognition method according to any one of claims 1 to 7.
CN202110190433.8A 2021-02-18 2021-02-18 Face recognition method and device, electronic equipment and storage medium Pending CN112861742A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110190433.8A CN112861742A (en) 2021-02-18 2021-02-18 Face recognition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110190433.8A CN112861742A (en) 2021-02-18 2021-02-18 Face recognition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112861742A true CN112861742A (en) 2021-05-28

Family

ID=75988190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110190433.8A Pending CN112861742A (en) 2021-02-18 2021-02-18 Face recognition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112861742A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420631A (en) * 2021-06-17 2021-09-21 广联达科技股份有限公司 Safety alarm method and device based on image recognition
CN116434313A (en) * 2023-04-28 2023-07-14 北京声迅电子股份有限公司 Face recognition method based on multiple face recognition modules

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117808A (en) * 2018-08-24 2019-01-01 深圳前海达闼云端智能科技有限公司 Face recognition method and device, electronic equipment and computer readable medium
CN109977765A (en) * 2019-02-13 2019-07-05 平安科技(深圳)有限公司 Facial image recognition method, device and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117808A (en) * 2018-08-24 2019-01-01 深圳前海达闼云端智能科技有限公司 Face recognition method and device, electronic equipment and computer readable medium
WO2020038136A1 (en) * 2018-08-24 2020-02-27 深圳前海达闼云端智能科技有限公司 Facial recognition method and apparatus, electronic device and computer-readable medium
CN109977765A (en) * 2019-02-13 2019-07-05 平安科技(深圳)有限公司 Facial image recognition method, device and computer equipment
WO2020164264A1 (en) * 2019-02-13 2020-08-20 平安科技(深圳)有限公司 Facial image recognition method and apparatus, and computer device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FLORIAN SCHROFF ET AL: "FaceNet: A unified embedding for face recognition and clustering", 《2015 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR)》, pages 1 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113420631A (en) * 2021-06-17 2021-09-21 广联达科技股份有限公司 Safety alarm method and device based on image recognition
CN116434313A (en) * 2023-04-28 2023-07-14 北京声迅电子股份有限公司 Face recognition method based on multiple face recognition modules
CN116434313B (en) * 2023-04-28 2023-11-14 北京声迅电子股份有限公司 Face recognition method based on multiple face recognition modules

Similar Documents

Publication Publication Date Title
CN111339990B (en) Face recognition system and method based on dynamic update of face features
WO2021026805A1 (en) Adversarial example detection method and apparatus, computing device, and computer storage medium
CN109325964B (en) Face tracking method and device and terminal
CN102945366B (en) A kind of method and device of recognition of face
CN105868695A (en) Human face recognition method and system
CN109376604B (en) Age identification method and device based on human body posture
CN111401171B (en) Face image recognition method and device, electronic equipment and storage medium
WO2022166532A1 (en) Facial recognition method and apparatus, and electronic device and storage medium
CN111626371A (en) Image classification method, device and equipment and readable storage medium
CN110069989B (en) Face image processing method and device and computer readable storage medium
CN112861742A (en) Face recognition method and device, electronic equipment and storage medium
US10423817B2 (en) Latent fingerprint ridge flow map improvement
CN111738120B (en) Character recognition method, character recognition device, electronic equipment and storage medium
CN109635625B (en) Intelligent identity verification method, equipment, storage medium and device
CN111444817B (en) Character image recognition method and device, electronic equipment and storage medium
CN112084904A (en) Face searching method, device and storage medium
CN111553241A (en) Method, device and equipment for rejecting mismatching points of palm print and storage medium
CN112749605A (en) Identity recognition method, system and equipment
CN113177479B (en) Image classification method, device, electronic equipment and storage medium
JP2005165447A (en) Age/sex discrimination device, age/sex discrimination method and person recognition device
US11749021B2 (en) Retrieval device, control method, and non-transitory storage medium
CN114373212A (en) Face recognition model construction method, face recognition method and related equipment
CN110363149B (en) Handwriting processing method and device
CN112906680A (en) Pedestrian attribute identification method and device and electronic equipment
CN115311649A (en) Card type identification method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination