CN111368772B - Identity recognition method, device, equipment and storage medium - Google Patents

Identity recognition method, device, equipment and storage medium Download PDF

Info

Publication number
CN111368772B
CN111368772B CN202010167720.2A CN202010167720A CN111368772B CN 111368772 B CN111368772 B CN 111368772B CN 202010167720 A CN202010167720 A CN 202010167720A CN 111368772 B CN111368772 B CN 111368772B
Authority
CN
China
Prior art keywords
similarity
image
face image
face
candidate
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.)
Active
Application number
CN202010167720.2A
Other languages
Chinese (zh)
Other versions
CN111368772A (en
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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System 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 Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN202010167720.2A priority Critical patent/CN111368772B/en
Publication of CN111368772A publication Critical patent/CN111368772A/en
Application granted granted Critical
Publication of CN111368772B publication Critical patent/CN111368772B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • 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
    • 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/178Human faces, e.g. facial parts, sketches or expressions estimating age from face image; using age information for improving recognition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Library & Information Science (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Collating Specific Patterns (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application provides an identity identification method, an identity identification device, identity identification equipment and a storage medium, wherein the identity identification method comprises the following steps: n candidate face images are identified from a preset identity database; for each candidate face image, respectively obtaining first similarity of the candidate face image and each candidate face image under each face recognition algorithm and second similarity of the candidate face image and the target image under each face recognition algorithm; determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity; and inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image. The embodiment of the application can improve the accuracy of identity recognition.

Description

Identity recognition method, device, equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an identity identification method, apparatus, device, and storage medium.
Background
With the increasing technical development and actual demands, the identification based on the face image has a wide application prospect in many fields. For example: the identification technology can be applied to a plurality of application scenes such as identification of a bank credit card, a security identification system, hotel management, a video conference man-machine interaction system and the like, so that the social operation efficiency can be improved, and the security of the daily life of citizens can be greatly enhanced.
In the prior art, the accuracy of identity recognition is improved by fusing a plurality of face recognition algorithms, specifically, target images to be recognized are respectively recognized by the plurality of face recognition algorithms, and then the recognition results of the plurality of face recognition algorithms are fused to obtain a final identity recognition result.
However, in the prior art, identity recognition is performed on a target image by fusing a plurality of face recognition algorithms, when a plurality of faces with high similarity exist in the target image, the problem of false recognition easily occurs, and the recognition accuracy is low.
Disclosure of Invention
The embodiment of the application provides an identity recognition method, an identity recognition device, identity recognition equipment and a storage medium, which are used for solving the problem of low recognition accuracy of the existing identity recognition method.
In a first aspect, an embodiment of the present application provides an identity recognition method, including:
acquiring a target image to be identified;
n candidate face images are identified from a preset identity database; the N is an integer greater than 1; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image;
for each candidate face image, respectively obtaining first similarity of the candidate face image and each candidate face image under each face recognition algorithm and second similarity of the candidate face image and the target image under each face recognition algorithm;
determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity;
and inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image.
In one possible implementation manner, determining the set of similarities corresponding to the candidate face image according to the first similarity and the second similarity includes:
aiming at any target candidate face image of the similarity set to be determined, the following steps are executed:
for each face recognition algorithm, calculating a difference value between a first similarity of the target face image and the candidate face image under the face recognition algorithm and a second similarity of the target image and the candidate face image under the face recognition algorithm for each candidate face image;
and combining all the differences of the target candidate face images under various face recognition algorithms to generate a similarity set corresponding to the target candidate face image.
In a possible implementation manner, inputting a similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, where the method includes:
inputting the similarity set corresponding to each candidate face image into the classification model, so that the classification model determines the similarity score of each candidate face image and the target image according to the similarity set corresponding to each candidate face image;
And determining the candidate face image with the highest similarity score as the first face image.
In one possible implementation, identifying N candidate face images from a preset identity database includes:
and recognizing N candidate face images in the identity database by adopting a first face recognition algorithm, wherein the first face recognition algorithm is one of the face recognition algorithms.
In a possible implementation manner, the first face recognition algorithm is the face recognition algorithm with the highest accuracy among the face recognition algorithms.
In one possible embodiment, before acquiring the target image to be identified, the method further comprises:
recognizing M second face images corresponding to the face images in the identity database and the similarity between the face images and the second face images under each face image in the identity database, and storing, wherein M is an integer greater than 1; the similarity between the second face image and the face image is greater than or equal to the maximum value of the similarity between the face images except the M second face images in the identity database;
Obtaining the first similarity of the candidate face image and each candidate face image under each face recognition algorithm, including:
and acquiring the similarity of the candidate face image and each second face image under each face recognition algorithm, and determining each first similarity of the candidate face image and each candidate face image according to the similarity of the candidate face image and each second face image.
In one possible implementation, inputting the similarity set corresponding to each candidate face image into the classification model includes:
acquiring original characteristic data of the target image under each face recognition algorithm;
and combining the original characteristic data of the target image with a similarity set corresponding to each candidate face image to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model.
In one possible implementation manner, the training method of the classification model includes:
acquiring a training data set comprising a plurality of sample images; each sample image corresponds to one piece of labeling information, and the labeling information characterizes the identity of the sample image;
for each sample image, adopting each face recognition algorithm to determine a similarity set of the sample image;
The similarity set of all sample images is formed to generate a first data set, and the first data set is divided into a training set and a testing set;
and training the classification model through the training set, and testing the trained classification model through the testing set.
In one possible implementation, each face recognition algorithm is used to determine a set of similarities for the sample image, including:
identifying N third face images corresponding to the sample image from the identity database; the similarity between the third face image and the sample image is greater than or equal to the maximum value of the similarity between the rest face images except the N third face images in the identity database and the sample image;
determining a similarity set corresponding to each third face image aiming at each third face image;
and combining the similarity sets corresponding to all the third face images of the sample image into the similarity set of the sample image.
In a second aspect, an embodiment of the present application provides an identity recognition device, including:
the acquisition module is used for acquiring a target image to be identified;
the identification module is used for identifying N candidate face images from a preset identity database; the N is an integer greater than 1; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image;
The first processing module is used for respectively obtaining first similarity of each candidate face image and each candidate face image under each face recognition algorithm and second similarity of each candidate face image and the target image under each face recognition algorithm;
the first processing module is further configured to determine a similarity set corresponding to each candidate face image according to the first similarity and the second similarity;
and the second processing module is used for inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image.
In one possible implementation manner, for any target candidate face image of the similarity set to be determined, the first processing module is specifically configured to:
for each face recognition algorithm, calculating a difference value between a first similarity of the target face image and the candidate face image under the face recognition algorithm and a second similarity of the target image and the candidate face image under the face recognition algorithm for each candidate face image;
And combining all the differences of the target candidate face images under various face recognition algorithms to generate a similarity set corresponding to the target candidate face image.
In a possible implementation manner, the first processing module is specifically configured to:
inputting the similarity set corresponding to each candidate face image into the classification model, so that the classification model determines the similarity score of each candidate face image and the target image according to the similarity set corresponding to each candidate face image;
and determining the candidate face image with the highest similarity score as the first face image.
In a possible embodiment, the identification module is specifically configured to:
and recognizing N candidate face images in the identity database by adopting a first face recognition algorithm, wherein the first face recognition algorithm is one of the face recognition algorithms.
In a possible implementation manner, the first face recognition algorithm is the face recognition algorithm with the highest accuracy among the face recognition algorithms.
In one possible embodiment, the apparatus further comprises: a preprocessing module;
the preprocessing module is used for:
Recognizing M second face images corresponding to the face images in the identity database and the similarity between the face images and the second face images under each face image in the identity database, and storing, wherein M is an integer greater than 1; the similarity between the second face image and the face image is greater than or equal to the maximum value of the similarity between the face images except the M second face images in the identity database;
the first processing module is further configured to:
and acquiring the similarity of the candidate face image and each second face image under each face recognition algorithm, and determining each first similarity of the candidate face image and each candidate face image according to the similarity of the candidate face image and each second face image.
In a possible implementation manner, the second processing module is specifically configured to:
acquiring original characteristic data of the target image under each face recognition algorithm;
and combining the original characteristic data of the target image with a similarity set corresponding to each candidate face image to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model.
In one possible embodiment, the apparatus further comprises: a training module;
the training module is used for:
acquiring a training data set comprising a plurality of sample images; each sample image corresponds to one piece of labeling information, and the labeling information characterizes the identity of the sample image;
for each sample image, adopting each face recognition algorithm to determine a similarity set of the sample image;
the similarity set of all sample images is formed to generate a first data set, and the first data set is divided into a training set and a testing set;
and training the classification model through the training set, and testing the trained classification model through the testing set.
In a possible implementation manner, the training module is specifically configured to:
identifying N third face images corresponding to the sample image from the identity database; the similarity between the third face image and the sample image is greater than or equal to the maximum value of the similarity between the rest face images except the N third face images in the identity database and the sample image;
determining a similarity set corresponding to each third face image aiming at each third face image;
And combining the similarity sets corresponding to all the third face images of the sample image into the similarity set of the sample image.
In a third aspect, an embodiment of the present application provides an identification device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored in the memory, such that the at least one processor performs the identification method as described above in the first aspect and various possible implementations of the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where computer executable instructions are stored, and when executed by a processor, implement the identification method according to the first aspect and various possible implementation manners of the first aspect.
After acquiring a target image to be identified, the identity identification method, the device, the equipment and the storage medium firstly identify N candidate face images from a preset identity database, wherein the similarity between the candidate face images and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image; then, respectively obtaining first similarity of the candidate face image and each candidate face image under each face recognition algorithm and second similarity of the candidate face image and the target image under each face recognition algorithm aiming at each candidate face image; determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity; and finally, inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image. According to the embodiment of the application, aiming at each candidate face image, the similarity between the candidate face image and each candidate face image under each face recognition algorithm is calculated, and the similarity between the target face image and each candidate face image is used for generating a similarity set of the candidate face image, and the similarity set is used as one item of information of the candidate face image and is input into a classification model, so that the similarity between the candidate face image and each candidate face image of the target image is considered when the classification model evaluates the similarity score between the candidate face image and the target image, and therefore, the similarity between the first face image determined by the classification model and the target image is higher, and the similarity between the first face image and each candidate face image of the target image is also higher, so that the accuracy of identity recognition is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it will be obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic diagram of a scenario of an identification method according to an embodiment of the present application;
FIG. 1A is a flowchart illustrating an identification method according to an embodiment of the present application;
FIG. 2 is a flowchart of an identification method according to another embodiment of the present application;
FIG. 3 is a flowchart of an identification method according to another embodiment of the present application;
FIG. 4 is a flowchart illustrating an identification method according to another embodiment of the present application;
FIG. 5 is a schematic diagram of an identification model according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an identification device according to an embodiment of the present application;
fig. 7 is a schematic hardware structure of an identification device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Identity recognition based on face images shows wide application prospects in many fields. For example: the identification technology can be applied to a plurality of application scenes such as identification of a bank credit card, a security identification system, hotel management, a video conference man-machine interaction system and the like. Fig. 1 is a schematic view of a scenario of an identification method according to an embodiment of the present application. Taking the security monitoring field as an example, a camera for monitoring can shoot a target image containing a human face. The area within the solid line box shown in fig. 1 is a target image captured by the camera, and the area within the broken line box is a face contained in the target image. The camera transmits the photographed target image to an identification device for identification. The identity recognition equipment executes an identity recognition method to carry out identity recognition on the target image, determines the identity of a face in the target image, and then outputs the recognized identity information to a display screen or records the recognized identity information in a related storage file for storage.
Fig. 1A is a flowchart of an identification method according to an embodiment of the present application. As shown in fig. 1A, the method includes:
s101, acquiring a target image to be identified.
In this embodiment, an image captured by a camera for monitoring may be acquired from a monitoring system as a target image to be identified. The target image comprises a face image to be identified; or the image collected from the image collecting device installed on the unmanned plane, the automatic driving vehicle and the like is taken as the target image to be identified, and other obtaining modes are also possible, and the method is not limited herein.
S102, identifying N candidate face images from a preset identity database; the N is an integer greater than 1; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image.
In this embodiment, the identity database is used to store the identity identifier and the corresponding face image. The identity database comprises a plurality of identity marks and face images corresponding to the identity marks. Each identity is used to uniquely identify a person, e.g. the identity may be an identification card number or the like. The identity marks are in one-to-one correspondence with the face images. The type and number of the face recognition algorithms are not limited, and for example, the face recognition algorithm may be a Neural network (Neural Networks) -based face recognition algorithm, a support vector machine-based face recognition algorithm, a local feature analysis method (Local Face Analysis), a face equal-density line analysis matching method, and the like.
For the acquired target images, the similarity between each face image in the identity database and the target image can be identified, then the face images are sequenced according to the sequence from the big similarity to the small similarity, and N face images in the sequence, which are the front, are selected as candidate face images. The similarity of the N face images is greater than or equal to the similarity of any face image except the N face images in the sequence and the target image. Or sequencing the face images according to the sequence from small to large in similarity with the target image, and selecting the N face images which are positioned later in the sequence as candidate face images. The N candidate face images will have one image that will eventually be determined to be the first face image most similar to the target image. Wherein N is an integer greater than 1.
S103, respectively obtaining first similarity of each candidate face image and each candidate face image under each face recognition algorithm and second similarity of each candidate face image and the target image under each face recognition algorithm;
and determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity.
In this embodiment, the purpose of S103 is to determine a similarity set corresponding to each candidate face image, so as to determine, according to the similarity set corresponding to each candidate face image, a first face image most similar to the target image.
For each candidate face image, each face recognition algorithm can be adopted, so that a first similarity between the candidate face image and each candidate image and a second similarity between the candidate face image and the target image under each face recognition algorithm are recognized.
For example, assume that there are three face recognition algorithms: a, B and C. The target image is X. The N candidate face images are respectively: y1, Y2, Y3, Y4. Then an algorithm a may be employed to identify the similarity of X with Y1, Y2, Y3, Y4, respectively, under algorithm a; adopting an algorithm B, and identifying the similarity between X and Y1, Y2, Y3 and Y4 under the algorithm B; and adopting an algorithm C to identify the similarity between X and Y1, Y2, Y3 and Y4 under the algorithm C.
For Y1, the similarity of Y1 with Y1, Y2, Y3, Y4, respectively, under algorithm A can be identified; under algorithm B, the similarity of Y1 and Y1, Y2, Y3 and Y4 respectively; under algorithm C, Y1 is similar to Y1, Y2, Y3, Y4, respectively. Y2, Y3, and Y4 are identified in the identification manner of Y1.
Taking a similarity set corresponding to a candidate face image as an example, the similarity between the candidate face image and the target image and between the candidate face images under each face recognition algorithm can be used as a set to form the similarity set corresponding to the face image; or, the result obtained by performing certain data operation processing on the similarity between the candidate face image and the target image and between the candidate face images under each face recognition algorithm is used as a set to form a similarity set corresponding to the face image, which is not limited herein.
Optionally, taking the example of determining the similarity set corresponding to one candidate face image, S103 may include:
aiming at any target candidate face image of the similarity set to be determined, the following steps are executed:
for each face recognition algorithm, calculating a difference value between a first similarity of the target face image and the candidate face image under the face recognition algorithm and a second similarity of the target image and the candidate face image under the face recognition algorithm for each candidate face image;
and combining all the differences of the target candidate face images under each face recognition algorithm to generate a similarity set corresponding to the target candidate face images.
Still further to the foregoing example, to determine the set of similarities corresponding to Y1, the difference between the first similarity of Y1 and Y1 under algorithm a and the second similarity of X and Y1 may be calculated and denoted as a1; the difference between the first similarity of Y1 and Y2, and the second similarity between X and Y2 is denoted as a2; the difference between the first similarity of Y1 and Y3, and the second similarity between X and Y3 is denoted as a3; the difference between the first similarity of Y1 and Y4, and the second similarity between X and Y4 is denoted as a4.
Calculating a difference between the first similarity of Y1 and the second similarity of X and Y1 under the algorithm B, and marking the difference as B1; the difference between the first similarity of Y1 and Y2, and the second similarity between X and Y2 is denoted b2; the difference between the first similarity of Y1 and Y3, and the second similarity between X and Y3 is denoted b3; the difference between the first similarity of Y1 and Y4, and the second similarity between X and Y4 is denoted b4.
Calculating a difference between the first similarity of Y1 and the second similarity of X and Y1 under the algorithm C, and marking the difference as C1; the difference between the first similarity of Y1 and Y2, and the second similarity between X and Y2 is denoted as c2; the difference between the first similarity of Y1 and Y3, and the second similarity between X and Y3 is denoted as c3; the difference between the first similarity of Y1 and Y4, and the second similarity between X and Y4 is denoted as c4.
A1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4 are combined into a set, and the set is used as a similarity set corresponding to Y1.
And respectively obtaining similarity sets corresponding to Y1, Y2, Y3 and Y4 according to the mode.
When calculating the similarity set of any candidate face image, the candidate face image of the similarity set to be determined is used as a target candidate face image, and for each candidate face image, the first similarity between the target candidate face image and the candidate face image under the face recognition algorithm is calculated for each candidate face image according to each face recognition algorithm, and the difference between the second similarity between the target image and the candidate face image under the face recognition algorithm is calculated, then all the differences of the target candidate face image under various face recognition algorithms are combined to generate the similarity set corresponding to the target candidate face image, the similarity set corresponding to each candidate face image comprises the similarity between the candidate face image and each candidate face image, and the corresponding difference information between the similarity between the target image and each candidate face image, so that the subsequent classification model scores each candidate face image according to the difference information, the determined first face image is higher in similarity with the target image and higher in similarity with each candidate face image, and the similarity between the target face image and each candidate face image is higher in accuracy is improved.
S104, inputting a similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining an identity corresponding to the first face image as the identity of the target image.
In this embodiment, the classification model is configured to identify, as a first face image, one image that is most similar to the target image in the N candidate face images according to a similarity set corresponding to the input N candidate face images. The classification model is not limited, and may be, for example, a logistic regression (Logistic Regression, LR) model, a gradient descent tree (Gradient Boosting Descision Tree, GBDT) model, a Random Forest (RF) model, or the like.
After the first face image is identified through the classification model, the identity corresponding to the first face image is obtained from the identity database, and the identity is used as the identity of the target image, so that the identity of the face in the target image is identified.
Optionally, in S104, "inputting the set of similarities corresponding to each candidate face image into the classification model to obtain the first face image with the highest similarity to the target image in all the candidate face images" may include:
Inputting the similarity set corresponding to each candidate face image into the classification model, so that the classification model determines the similarity score of each candidate face image and the target image according to the similarity set corresponding to each candidate face image;
and determining the candidate face image with the highest similarity score as the first face image.
In this embodiment, for each candidate image, the classification model determines a similarity score between the candidate face image and the target image according to a similarity set corresponding to the candidate face image. And then determining one candidate face image with the highest similarity score in all the candidate images as a first face image. The manner in which the classification model obtains the similarity score is not limited herein, and different classification models may be classified according to their respective classification manners. Taking an LR model as an example, the LR model can obtain a similarity score by weighting and summing all data in a similarity set, wherein the weight of each data is a model parameter of the LR model, and the LR model is trained in advance. Taking the similarity sets a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, and c4 corresponding to Y1 as examples, the similarity sets corresponding to Y1 have 12 pieces of data, respectively corresponding to 12 weight coefficients, and the similarity scores corresponding to Y1 can be obtained by weighting and summing the 12 pieces of data.
After acquiring a target image to be identified, the embodiment of the application firstly identifies N candidate face images from a preset identity database; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the face images except N candidate face images in the identity database and the target image; then, respectively obtaining first similarity of the candidate face image and each candidate face image under each face recognition algorithm and second similarity of the candidate face image and the target image under each face recognition algorithm aiming at each candidate face image; determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity; and finally, inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image. According to the embodiment of the application, aiming at each candidate face image, the similarity between the candidate face image and each candidate face image under each face recognition algorithm is calculated, and the similarity between the target face image and each candidate face image is used for generating a similarity set of the candidate face image, and the similarity set is used as one item of information of the candidate face image and is input into a classification model, so that the similarity between the candidate face image and each candidate face image of the target image is considered when the classification model evaluates the similarity score between the candidate face image and the target image, and therefore, the similarity between the first face image determined by the classification model and the target image is higher, and the similarity between the first face image and each candidate face image of the target image is also higher, so that the accuracy of identity recognition is improved.
Alternatively, the "inputting the feature data set corresponding to each candidate face image into the classification model" in S104 may include:
acquiring original characteristic data of the target image under each face recognition algorithm;
and combining the original characteristic data of the target image with a similarity set corresponding to each candidate face image to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model.
In this embodiment, each face recognition algorithm may be used to recognize the original feature data of the target image under each face recognition algorithm. The types of the original characteristic data identified by each face recognition algorithm can be the same or different, and the characteristic data is determined by the characteristic condition focused by each face recognition algorithm. The raw feature data is not limited herein, and may be, for example, the sex, age, whether to take glasses, whether to smile, interpupillary distance, pitch angle, color saturation, gray scale, sharpness, and the like of a face in the target image.
Combining the original characteristic data of the target image with the similarity sets corresponding to the candidate face images to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model for recognition. And the original characteristic data of the target image and the similarity set corresponding to each candidate face image are used as the input of the classification model together, so that the accuracy of identity recognition is improved. For each candidate face image, the classification model determines the similarity scores of the candidate face image and the target image according to the similarity set corresponding to the candidate face image and the original characteristic data. And then determining one candidate face image with the highest similarity score in all the candidate images as a first face image.
Optionally, after S104, the method may further include:
outputting result indication information, wherein the result indication information is used for indicating the identity of the target image.
In this embodiment, after determining that the identity corresponding to the first face image is the identity of the target image, the result indication information may be displayed on the display screen, so that the user may view the identity of the target image, or the result indication information may be recorded in a target file, and the subsequent user may obtain the identity of the target image by viewing the target file.
Fig. 2 is a flowchart of an identification method according to another embodiment of the present application. The embodiment describes in detail a specific implementation process of identifying the similarity between the target image and each candidate face image under each face recognition algorithm. As shown in fig. 2, the method includes:
s201, acquiring a target image to be identified.
In this embodiment, S201 is similar to S101 in the embodiment of fig. 1A, and will not be described here again.
S202, recognizing N candidate face images in the identity database by adopting a first face recognition algorithm, wherein the first face recognition algorithm is one of the face recognition algorithms. The similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image.
In this embodiment, the identity recognition method uses a plurality of face recognition algorithms and a classification model, where one face recognition algorithm of the plurality of face recognition algorithms may be used as the first face recognition algorithm. Firstly, N face images with highest similarity with a target image in an identity database are identified through a first face recognition algorithm, and the N face images identified under the first face recognition algorithm are used as N candidate face images.
And then, respectively adopting each face recognition algorithm (including the first face recognition algorithm) in a plurality of face recognition algorithms to recognize the similarity of the target image and each candidate face image under each face recognition algorithm.
Optionally, the first face recognition algorithm is a face recognition algorithm with the highest accuracy among the face recognition algorithms.
In this embodiment, one face recognition algorithm with the highest accuracy may be selected from multiple face recognition algorithms used in the above-mentioned identity recognition method as the first face recognition algorithm, for example, a test set may be used in advance to test the multiple face recognition algorithms used in the above-mentioned identity recognition method, so as to determine the accuracy of each face recognition algorithm, and the algorithm with the highest accuracy may be used as the first face recognition algorithm.
According to the method, the algorithm with the highest accuracy is used as the first face recognition algorithm, N candidate face images of the target image are determined through the first face algorithm, and the determined N candidate face images are more accurate due to the fact that the accuracy of the first face algorithm is the highest, so that the accuracy of identifying the faces in the target image is improved.
S203, respectively obtaining first similarity of each candidate face image and each candidate face image under each face recognition algorithm and second similarity of each candidate face image and the target image under each face recognition algorithm;
and determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity.
In this embodiment, S203 is similar to S103 in the embodiment of fig. 1A, and will not be described here again.
S204, inputting a similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining an identity corresponding to the first face image as the identity of the target image.
In this embodiment, S204 is similar to S104 in the embodiment of fig. 1A, and will not be described here again.
According to the method, the N candidate face images of the target image are identified by selecting one of the face algorithms as the first face recognition algorithm, the N candidate face images are directly determined by using one of the face algorithms, so that the operation amount of identity recognition can be reduced, and the processing speed is improved.
Fig. 3 is a flowchart of an identification method according to another embodiment of the present application. In the embodiment, each face image in the identity database is preprocessed so as to quickly obtain the similarity between a certain candidate face image of the target image and each candidate face image according to the preprocessed data; as shown in fig. 3, the method includes:
s301, recognizing M second face images corresponding to the face images in the identity database and the similarity between the face images and each second face image under each face image in the identity database, and storing, wherein M is an integer greater than 1, and the similarity between the second face images and the face images is greater than or equal to the maximum value of the similarity between the rest face images except the M second face images in the identity database and the face images.
In this embodiment, the value of M is not limited herein. Before the identity of the target image is identified, the data in the identity database is preprocessed. The following description will take a processing procedure of a face image in the identity database as an example, and other face images in the identity database are all preprocessed according to the processing procedure. The face recognition algorithm includes a, B, C, assuming preprocessing of the face image Y1 in the identity database. M is taken as 4. Under the algorithm A, recognizing the face image with the highest similarity with Y1 as Y1, Y2, Y3 and Y4; and storing the similarity between Y1 and Y1, Y2, Y3 and Y4 under the algorithm A into a preset database, and storing the similarity in association with the algorithm A and the algorithm A. Under the algorithm B, recognizing the face image with the highest similarity with Y1 as Y1, Y2, Y5 and Y6; and storing the similarity between Y1 and Y1, Y2, Y5 and Y6 under the algorithm B into a preset database, and storing the similarity in association with the algorithm B and the algorithm B. Under the algorithm C, recognizing the face image with the highest similarity with Y1 as Y1, Y2, Y4 and Y6; and storing the similarity between Y1 and Y1, Y2, Y4 and Y6 under the algorithm C into a preset database, and storing the similarity in association with the algorithm C and the algorithm C.
Each face image in the identity database is preprocessed in the manner described above. Alternatively, the data obtained by the preprocessing may be stored in a preset database. M may be equal to or not equal to the number N of candidate face images of the target image identified in the subsequent step, and is not limited herein.
S302, acquiring a target image to be identified.
In this embodiment, S302 is similar to S101 in the embodiment of fig. 1A, and will not be described here again.
S303, aiming at each candidate face image, acquiring the similarity of the candidate face image and each second face image under each face recognition algorithm, determining each first similarity of the candidate face image and each candidate face image according to the similarity of the candidate face image and each second face image, and recognizing the second similarity of the candidate face image and the target image under each face recognition algorithm;
and determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity.
In this embodiment, for each candidate face image, the similarity between the candidate face image and each candidate face image may be found. Optionally, in S301, for each face image in the identity database, under each face recognition algorithm that is recognized, M second face images corresponding to the face image in the identity database, and the similarity between the face image and each second face image may be stored in a preset database, and in S303, the similarity between the candidate face image and each candidate face image may be searched from the preset database.
Taking the candidate face image Y1 as an example, the similarity of Y1 with Y1, Y2, Y3 and Y4 under the algorithm a, the similarity of Y1 with Y2, Y5 and Y6 under the algorithm B, and the similarity of Y1, Y2, Y4 and Y6 under the algorithm C are stored in a preset database. Assuming that the N candidate face images are Y1, Y2, Y3 and Y4, extracting the similarity of Y1 with Y1, Y2, Y3 and Y4 under the algorithm A, the similarity of Y1 with Y2 under the algorithm B and the similarity of Y1 with Y2 under the algorithm C from a preset database. It can be seen that the similarity between Y1, which is not stored in the preset database, and Y3 and Y4 under the algorithm B, and the similarity between Y3 under the algorithm C are not obtained. At this time, the similarity between Y1 and Y3, Y4 under the algorithm B may be identified separately, and the similarity between Y1 and Y3 under the algorithm C may be identified, or the similarity between Y1 and Y3, Y4 under the algorithm B may also be directly identified, and the similarity between Y1 and Y3 under the algorithm C may be all determined to be zero, so as to participate in the subsequent identification process.
S304, inputting a similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining an identity corresponding to the first face image as the identity of the target image.
In this embodiment, S304 is similar to S104 in the embodiment of fig. 1A, and will not be described here again.
In this embodiment, before identity authentication is performed on a target image, face images in an identity database are preprocessed first, the similarity between each face image and the most similar M images under each face recognition algorithm is identified, and then stored in a preset database, in the process of identity recognition on the target image, similarity data between required candidate face images can be directly extracted from the preset database, and the similarity between candidate images does not need to be recognized every time of identity recognition, so that the data volume of identity recognition processing is greatly reduced, and the processing speed of identity recognition is improved.
Fig. 4 is a flowchart of an identification method according to another embodiment of the present application. The specific implementation process of training the classification model is described in detail in this embodiment. As shown in fig. 4, the method includes:
s401, acquiring a training data set comprising a plurality of sample images; each sample image corresponds to one piece of labeling information, and the labeling information characterizes the identity of the sample image.
In this embodiment, the classification model may be trained. The images containing the faces captured from the camera can be used as sample images, and a plurality of sample images can be formed into a training data set. And manually labeling the identity mark of the face in each sample image in advance to obtain labeling information of each sample image.
S402, for each sample image, determining a similarity set of the sample image by adopting each face recognition algorithm.
In this embodiment, taking the processing procedure of one sample image as an example, the similarity set of the sample image may be determined according to the processing manners of S102 and S103. Alternatively, in processing one sample image, S402 may include:
identifying N third face images corresponding to the sample image from the identity database; the similarity between the third face image and the sample image is greater than or equal to the maximum value of the similarity between the rest face images except the N third face images in the identity database and the sample image;
determining a similarity set corresponding to each third face image aiming at each third face image;
and combining the similarity sets corresponding to all the third face images of the sample image into the similarity set of the sample image.
In this embodiment, the N third face images with the highest similarity to the sample image in the identity database may be first determined, and then the similarity between the sample image and each third face image under each face recognition algorithm may be identified. And then, according to a similar processing mode of S103, determining a similarity set corresponding to each third face image of the sample image, and combining the similarity sets corresponding to each third face image together to form a characteristic data set of the sample image.
S403, combining the similarity sets of all the sample images into a first data set, and dividing the first data set into a training set and a testing set.
S404, training the classification model through the training set, and testing the trained classification model through the testing set.
In this embodiment, the similarity sets of all the sample images are combined into one data set, which is called a first data set. Each sample image of the first dataset corresponds to a set of similarities. And then dividing the sample images and the similarity sets thereof in the first data set into a training set and a testing set according to a preset proportion threshold. For example, 70% of the sample images and their similarity sets in the first dataset may be randomly selected to form the training set, and the remaining sample images and their similarity sets may be randomly selected to form the test set. And then training the classification model by adopting data in a training set, and testing the trained classification model by adopting data in a testing set. The training of the classification model using the data in the training set may be: and inputting one sample image in the training set into the classification model to obtain a recognition result of the classification model, and adjusting parameters of the classification model according to the comparison information of the recognition result and the labeling information of the sample image, thereby realizing the training of the parameters of the classification model.
According to the embodiment, the first data set is generated by combining the similarity sets of all the sample images, then the first data set is divided into the training set and the testing set, and the classification model is trained through the training set and the testing set, so that the performance of the classification model can be improved, and the accuracy of identity recognition is further improved.
Fig. 5 is a schematic diagram of an identification model according to an embodiment of the present application. The model is used for executing the identification method, and comprises a first layer model and a second layer model. The first layer model may include a variety of face recognition algorithm models. The second layer model is a classification model. As shown in fig. 5, the target image is input into a first layer model, and the first layer model invokes a plurality of recognition algorithms to recognize similarity sets corresponding to N candidate face images of the target image. And then inputting the similarity set into a second layer model, and identifying a first face image which is most similar to the target image in the N candidate face images by the second layer model, thereby realizing identification.
The foregoing identification method is described below by way of a specific example. Corresponding data examples are arranged after Step2 to Step5, so that the data processing modes of the corresponding steps are described by combining the data examples.
Step1, preparing an identity database A and a training data set B formed by calibrated snap images.
Step2, calling face recognition algorithm face of different manufacturers i ,i∈[1,t]And searching topN for each face image y in the identity database A, wherein topN represents N images with highest similarity with the face image.
For example, assuming that there is an identity database a containing [ a, b, C, d, e ]5 face images, and 4 different algorithms are shared, N is 3, then 3 images of each face image in the identity database a that are most similar to the face image in the 4 different algorithms a and corresponding similarity values can be obtained, and the set of these recognition results is denoted as C, and the following indicates that 3 images of the identity database a that are most similar to a in the 1 st algorithm are a, b, d and corresponding similarity values are 0.99,0.90,0.85.
Step3, taking a sample image x from the training data set B, selecting a face recognition algorithm as a reference algorithm, calling the reference algorithm to search topN of x in the identity database A, and calculating a corresponding similarity value m 1 ,m 2 ,..,m N
For example, assume that we take the first algorithm as the reference algorithm, then search out 3 images most similar to x in A and calculate the corresponding similarity value m under the first algorithm 1 ,m 2 ,m 3 The method comprises the steps of carrying out a first treatment on the surface of the Let the calculation result be m 1 =(a,0.90),m 2 =(b,0.89),m 3 = (c, 0.70), representing that under this algorithm the three images most similar to x are a, b, c, the corresponding similarity value is 0.9,0.89,0.7.
Step4, respectively calculating similarity values of the sample image x and the searched topN result by calling other t-1 face recognition algorithms to obtain the topN recognition result of x under various algorithms asWherein m is ij Representing that x is searched with reference comparison algorithm under ith algorithmAnd (3) identifying the j-th image of the topN result of the cable.
For example, the remaining three algorithms are called to calculate the similarity value of x and a, b and c respectively, and the identification result of topN of x under each algorithm is thatThe images are 3 images in Step 3: [ a, b, c ]]Assume that the similarity value is +.>For the above results, the rows represent the similarity values of the same image and x under 4 different algorithms, and the three rows respectively correspond to the similarity values of x and a, b, c under 4 different algorithms, and represent the similarity values of x and different images (a, b, c) under the same algorithm.
Step5, constructing a similarity set, generating N similarity sets according to topN results of x under each algorithm, wherein one image corresponds to one similarity setWherein f i1 Representing similarity values of x and the corresponding image y under an ith algorithm; f (f) i2 Representing the ranking of similarity values of x and y under the ith algorithm in topN results under the algorithm; f (f) i3 To f i(N+2) Representing the difference between the topN result of x under the ith algorithm and the topN result of the image y under the ith algorithm; the topN result of image y under the ith algorithm is taken from C obtained from Step 2. If the image z appears in the topN results of x and y at the same time, the value of the corresponding feature is the difference of the similarity values of z in the topN results of x and y; otherwise, the similarity value of z in the topN result with the value of x of the corresponding feature (z is any result in the topN result of x).
For example, 3 similarity sets are generated according to the result of Step2-4, and taking the above result as an example, x and a, b and c respectively generate a similarity set, where the similarity set generated by x and a is that
Wherein each column represents a feature extracted under one algorithm, taking the first column as an example, wherein the similarity value of the first behavior x and a under the first algorithm is 0.9, and the ranking of the scores of the second behavior x and a under the first algorithm is 1, which can be seen from the result of Step 4; the difference (absolute value) between the similarity value of the third behavior x and a under the first algorithm and the similarity value of the third behavior a and a under the first algorithm is 0.09; the difference (taking absolute value) between the similarity value of the fourth behavior x and b under the first algorithm and the similarity value of a and b under the first algorithm is 0.01; the similarity value of the fifth actions x and c under the first algorithm is 0.8 (c appears only in the topN result of x and does not appear in the topN result of a); the results of the latter three columns are calculated in this way.
Step6, collecting the similarity f y The feature data set of the sample image is generated in combination with the original feature data (age, sex, pupil distance, etc.) of the sample image.
Step7, repeating Step3 to Step6 to generate a new data set D, wherein the number of samples in the data set D is N times that of the data set B;
step8, performing discretization, normalization and other preprocessing operations on the data set D so that the data in the data set D meet the input data requirement of the classification model, for example, the data in the characteristic data set of each sample image can be normalized to a [0,1] interval.
Step9: dividing the data set D into a training set and a testing set according to a preset proportion threshold;
step10: and constructing a classification model, performing model training on the classification model according to a training set, and testing the classification model by a testing set.
Step1 to Step10 are training steps of the identification model provided in the embodiment of the present application, and the process of identifying the target image after training is completed refers to the identification method described above, which is not described herein.
The embodiment of the application has the following advantages: 1, different algorithms have different emphasis points, a single algorithm can not always obtain a better recognition effect in certain specific scenes, but other algorithms can obtain a better effect in the scenes possibly; different algorithms are integrated together through the ensemble learning algorithm framework stacking, so that more accurate identity recognition capability can be provided. 2. The existing identity recognition focuses on the similarity between a target image to be recognized and a candidate image, so that a recognition result has a certain degree of error; therefore, the embodiment of the application not only looks at the similarity between the target image to be identified and the candidate image, but also looks at the similarity of topN results similar to the target image and the candidate image, and can effectively improve the accuracy of identity identification.
The embodiment of the application performs experimental verification on the identity recognition method. Three different face comparison algorithms are adopted in the experiment, the value of N is 10, and the proportion of the first data of the target identity in the top10 in the three different algorithms is 93.001%,87.347% and 92.456% respectively; after three algorithms are integrated by the method of the embodiment, the proportion of the data with the target identity at the first position in the data of the target identity in the top10 is increased to 98.756%. This shows that the method of the present embodiment can provide more accurate identification capability.
Fig. 6 is a schematic structural diagram of an identification device according to an embodiment of the present application. As shown in fig. 6, the identification device 60 includes: an acquisition module 601, an identification module 602, a first processing module 603 and a second processing module 604.
The acquiring module 601 is configured to acquire a target image to be identified.
The identifying module 602 is configured to identify N candidate face images from a preset identity database; the N is an integer greater than 1; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image.
A first processing module 603, configured to obtain, for each candidate face image, each first similarity between the candidate face image and each candidate face image under each face recognition algorithm, and each second similarity between the candidate face image and the target image under each face recognition algorithm;
the first processing module 603 is further configured to determine a similarity set corresponding to each candidate face image according to the first similarity and the second similarity.
The second processing module 604 is configured to input a similarity set corresponding to each candidate face image into a classification model, obtain a first face image with the highest similarity to the target image in all the candidate face images, and determine an identity corresponding to the first face image as the identity of the target image.
After acquiring a target image to be identified, the embodiment of the application firstly identifies N candidate face images from a preset identity database, wherein the similarity between the candidate face images and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image; then, respectively obtaining first similarity of the candidate face image and each candidate face image under each face recognition algorithm and second similarity of the candidate face image and the target image under each face recognition algorithm aiming at each candidate face image; determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity; and finally, inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image. According to the embodiment of the application, aiming at each candidate face image, the similarity between the candidate face image and each candidate face image under each face recognition algorithm is calculated, and the similarity between the target face image and each candidate face image is used for generating a similarity set of the candidate face image, and the similarity set is used as one item of information of the candidate face image and is input into a classification model, so that the similarity between the candidate face image and each candidate face image of the target image is considered when the classification model evaluates the similarity score between the candidate face image and the target image, and therefore, the similarity between the first face image determined by the classification model and the target image is higher, and the similarity between the first face image and each candidate face image of the target image is also higher, so that the accuracy of identity recognition is improved.
Optionally, for any target candidate face image of the similarity set to be determined, the first processing module 603 is specifically configured to:
for each face recognition algorithm, calculating a difference value between a first similarity of the target face image and the candidate face image under the face recognition algorithm and a second similarity of the target image and the candidate face image under the face recognition algorithm for each candidate face image;
and combining all the differences of the target candidate face images under various face recognition algorithms to generate a similarity set corresponding to the target candidate face images.
Optionally, the first processing module 603 is specifically configured to:
inputting the similarity set corresponding to each candidate face image into the classification model, so that the classification model determines the similarity score of each candidate face image and the target image according to the similarity set corresponding to each candidate face image;
and determining the candidate face image with the highest similarity score as the first face image.
Optionally, the identification module 602 is specifically configured to:
and recognizing N candidate face images in the identity database by adopting a first face recognition algorithm, wherein the first face recognition algorithm is one of the face recognition algorithms.
Optionally, the first face recognition algorithm is a face recognition algorithm with the highest accuracy among the face recognition algorithms.
Optionally, the apparatus further comprises: a preprocessing module;
the preprocessing module is used for:
recognizing M second face images corresponding to the face images in the identity database and the similarity between the face images and each second face image under each face image in the identity database, and storing, wherein M is an integer greater than 1; the similarity between the second face image and the face image is greater than or equal to the maximum value of the similarity between the face images except the M second face images in the identity database;
the first processing module 603 is further configured to:
and acquiring the similarity of the candidate face image and each second face image under each face recognition algorithm, and determining each first similarity of the candidate face image and each candidate face image according to the similarity of the candidate face image and each second face image.
Optionally, the second processing module 604 is specifically configured to:
Acquiring original characteristic data of the target image under each face recognition algorithm;
and combining the original characteristic data of the target image with a similarity set corresponding to each candidate face image to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model.
Optionally, the apparatus further comprises: a training module;
the training module is used for:
acquiring a training data set comprising a plurality of sample images; each sample image corresponds to one piece of labeling information, and the labeling information characterizes the identity of the sample image;
for each sample image, adopting each face recognition algorithm to determine a similarity set of the sample image;
the similarity set of all sample images is formed to generate a first data set, and the first data set is divided into a training set and a testing set;
and training the classification model through the training set, and testing the trained classification model through the testing set.
Optionally, the training module is specifically configured to:
identifying N third face images corresponding to the sample image from the identity database; the similarity between the third face image and the sample image is greater than or equal to the maximum value of the similarity between the rest face images except the N third face images in the identity database and the sample image;
Determining a similarity set corresponding to each third face image aiming at each third face image;
and combining the similarity sets corresponding to all the third face images of the sample image into the similarity set of the sample image.
Optionally, the apparatus further comprises: an output module;
the output module is used for:
outputting result indication information, wherein the result indication information is used for indicating the identity of the target image.
The identity recognition device provided by the embodiment of the application can be used for executing the method embodiment, the implementation principle and the technical effect are similar, and the embodiment is not repeated here.
Fig. 7 is a schematic hardware structure of an identification device according to an embodiment of the present application. As shown in fig. 7, the identification device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. The identification device 70 further comprises communication means 703. Wherein the processor 701, the memory 702 and the communication means 703 are connected by a bus 704.
In a specific implementation, at least one processor 701 executes computer-executable instructions stored in the memory 702, so that the at least one processor 701 performs the identification method as described above.
The specific implementation process of the processor 701 can be referred to the above method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 7, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory or may further comprise non-volatile storage NVM, such as at least one disk memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
The application also provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and when a processor executes the computer execution instructions, the identity recognition method is realized.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). The processor and the readable storage medium may reside as discrete components in a device.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application 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 scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.

Claims (10)

1. An identification method, comprising:
acquiring a target image to be identified;
n candidate face images are identified from a preset identity database; the N is an integer greater than 1; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image;
for each candidate face image, respectively obtaining first similarity of the candidate face image and each candidate face image under each face recognition algorithm and second similarity of the candidate face image and the target image under each face recognition algorithm;
Determining a similarity set corresponding to each candidate face image according to the first similarity and the second similarity;
and inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image.
2. The method of claim 1, wherein determining a set of similarities for each candidate face image based on the first and second similarities comprises:
aiming at any target candidate face image of the similarity set to be determined, the following steps are executed:
for each face recognition algorithm, calculating a difference value between a first similarity of the target face image and the candidate face image under the face recognition algorithm and a second similarity of the target image and the candidate face image under the face recognition algorithm for each candidate face image;
and combining all the differences of the target candidate face images under various face recognition algorithms to generate a similarity set corresponding to the target candidate face image.
3. The method of claim 1, wherein prior to acquiring the image of the object to be identified, the method further comprises:
recognizing M second face images corresponding to the face images in the identity database and the similarity between the face images and the second face images under each face image in the identity database, and storing, wherein M is an integer greater than 1; the similarity between the second face image and the face image is greater than or equal to the maximum value of the similarity between the face images except the M second face images in the identity database;
obtaining the first similarity of the candidate face image and each candidate face image under each face recognition algorithm, including:
and acquiring the similarity of the candidate face image and each second face image under each face recognition algorithm, and determining each first similarity of the candidate face image and each candidate face image according to the similarity of the candidate face image and each corresponding second face image.
4. A method according to any one of claims 1 to 3, wherein inputting the set of similarities corresponding to each candidate face image into the classification model comprises:
Acquiring original characteristic data of the target image under each face recognition algorithm;
and combining the original characteristic data of the target image with a similarity set corresponding to each candidate face image to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model.
5. An identification device, comprising:
the acquisition module is used for acquiring a target image to be identified;
the identification module is used for identifying N candidate face images from a preset identity database; the N is an integer greater than 1; the similarity between the candidate face image and the target image is greater than or equal to the maximum value of the similarity between the rest face images except the N candidate face images in the identity database and the target image;
the first processing module is used for respectively obtaining first similarity of each candidate face image and each candidate face image under each face recognition algorithm and second similarity of each candidate face image and the target image under each face recognition algorithm;
the first processing module is further configured to determine a similarity set corresponding to each candidate face image according to the first similarity and the second similarity;
And the second processing module is used for inputting the similarity set corresponding to each candidate face image into a classification model to obtain a first face image with the highest similarity with the target image in all the candidate face images, and determining the identity corresponding to the first face image as the identity of the target image.
6. The apparatus of claim 5, wherein, for any target candidate face image for which a similarity set is to be determined, the first processing module is specifically configured to:
for each face recognition algorithm, calculating a difference value between a first similarity of the target face image and the candidate face image under the face recognition algorithm and a second similarity of the target image and the candidate face image under the face recognition algorithm for each candidate face image;
and combining all the differences of the target candidate face images under various face recognition algorithms to generate a similarity set corresponding to the target candidate face image.
7. The apparatus of claim 5, wherein the apparatus further comprises: a preprocessing module;
the preprocessing module is used for:
Recognizing M second face images corresponding to the face images in the identity database and the similarity between the face images and the second face images under each face image in the identity database, and storing, wherein M is an integer greater than 1; the similarity between the second face image and the face image is greater than or equal to the maximum value of the similarity between the face images except the M second face images in the identity database;
the first processing module is further configured to:
and acquiring the similarity of the candidate face image and each second face image under each face recognition algorithm, and determining each first similarity of the candidate face image and each candidate face image according to the similarity of the candidate face image and each corresponding second face image.
8. The apparatus according to any of the claims 5-7, wherein the second processing module is specifically configured to:
acquiring original characteristic data of the target image under each face recognition algorithm;
and combining the original characteristic data of the target image with a similarity set corresponding to each candidate face image to form a characteristic data set of the target image, and inputting the characteristic data set into the classification model.
9. An identification device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the identification method of any one of claims 1-4.
10. A computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement the identification method of any of claims 1-4.
CN202010167720.2A 2020-03-11 2020-03-11 Identity recognition method, device, equipment and storage medium Active CN111368772B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010167720.2A CN111368772B (en) 2020-03-11 2020-03-11 Identity recognition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010167720.2A CN111368772B (en) 2020-03-11 2020-03-11 Identity recognition method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111368772A CN111368772A (en) 2020-07-03
CN111368772B true CN111368772B (en) 2023-08-22

Family

ID=71208909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010167720.2A Active CN111368772B (en) 2020-03-11 2020-03-11 Identity recognition method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111368772B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115785A (en) * 2020-08-13 2020-12-22 力引万物(深圳)科技有限公司 Picture face splitting identification method and identification system thereof
CN112016623B (en) * 2020-08-28 2024-06-18 佳都科技集团股份有限公司 Face clustering method, device, equipment and storage medium
CN112199998B (en) * 2020-09-09 2023-06-20 浙江大华技术股份有限公司 Face recognition method, device, equipment and medium
CN113536953B (en) * 2021-06-22 2024-04-19 浙江吉利控股集团有限公司 Face recognition method and device, electronic equipment and storage medium
CN113705506B (en) * 2021-09-02 2024-02-13 中国联合网络通信集团有限公司 Nucleic acid detection method, apparatus, device, and computer-readable storage medium
CN116935479B (en) * 2023-09-15 2023-12-15 纬领(青岛)网络安全研究院有限公司 Face recognition method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815566A (en) * 2016-12-29 2017-06-09 天津中科智能识别产业技术研究院有限公司 A kind of face retrieval method based on multitask convolutional neural networks
CN108491773A (en) * 2018-03-12 2018-09-04 中国工商银行股份有限公司 A kind of recognition methods and system
CN109635686A (en) * 2018-11-29 2019-04-16 上海交通大学 In conjunction with two stages pedestrian's searching method of face and appearance
CN109815845A (en) * 2018-12-29 2019-05-28 深圳前海达闼云端智能科技有限公司 Face recognition method and device and storage medium
US10311288B1 (en) * 2017-03-24 2019-06-04 Stripe, Inc. Determining identity of a person in a digital image
CN109993102A (en) * 2019-03-28 2019-07-09 北京达佳互联信息技术有限公司 Similar face retrieval method, apparatus and storage medium
CN110309744A (en) * 2019-06-21 2019-10-08 武汉市公安局视频侦查支队 A kind of suspect's recognition methods and device
WO2020015075A1 (en) * 2018-07-18 2020-01-23 平安科技(深圳)有限公司 Facial image comparison method and apparatus, computer device, and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10489637B2 (en) * 2014-12-23 2019-11-26 Beijing Qihoo Technology Company Limited Method and device for obtaining similar face images and face image information
CN106777177A (en) * 2016-12-22 2017-05-31 百度在线网络技术(北京)有限公司 Search method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815566A (en) * 2016-12-29 2017-06-09 天津中科智能识别产业技术研究院有限公司 A kind of face retrieval method based on multitask convolutional neural networks
US10311288B1 (en) * 2017-03-24 2019-06-04 Stripe, Inc. Determining identity of a person in a digital image
CN108491773A (en) * 2018-03-12 2018-09-04 中国工商银行股份有限公司 A kind of recognition methods and system
WO2020015075A1 (en) * 2018-07-18 2020-01-23 平安科技(深圳)有限公司 Facial image comparison method and apparatus, computer device, and storage medium
CN109635686A (en) * 2018-11-29 2019-04-16 上海交通大学 In conjunction with two stages pedestrian's searching method of face and appearance
CN109815845A (en) * 2018-12-29 2019-05-28 深圳前海达闼云端智能科技有限公司 Face recognition method and device and storage medium
CN109993102A (en) * 2019-03-28 2019-07-09 北京达佳互联信息技术有限公司 Similar face retrieval method, apparatus and storage medium
CN110309744A (en) * 2019-06-21 2019-10-08 武汉市公安局视频侦查支队 A kind of suspect's recognition methods and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
许佩冉.人脸识别技术在安保工作中的应用及发展趋势研究.《智能建筑》.2017,(第12期),第35-37页. *

Also Published As

Publication number Publication date
CN111368772A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
CN111368772B (en) Identity recognition method, device, equipment and storage medium
CN111310731B (en) Video recommendation method, device, equipment and storage medium based on artificial intelligence
Chen et al. Person search via a mask-guided two-stream cnn model
CN112232241B (en) Pedestrian re-identification method and device, electronic equipment and readable storage medium
CN110866466B (en) Face recognition method, device, storage medium and server
CN111104867A (en) Recognition model training and vehicle heavy recognition method and device based on component segmentation
CN113449725B (en) Object classification method, device, equipment and storage medium
CN111275060A (en) Recognition model updating processing method and device, electronic equipment and storage medium
CN114049512A (en) Model distillation method, target detection method and device and electronic equipment
CN112417970A (en) Target object identification method, device and electronic system
US20210200994A1 (en) Processing method of learning face recognition by artificial intelligence module
WO2015146113A1 (en) Identification dictionary learning system, identification dictionary learning method, and recording medium
CN111340213B (en) Neural network training method, electronic device, and storage medium
CN115827995A (en) Social matching method based on big data analysis
JP2012048624A (en) Learning device, method and program
CN111382791A (en) Deep learning task processing method, image recognition task processing method and device
CN114387304A (en) Target tracking method, computer program product, storage medium, and electronic device
JP2013218605A (en) Image recognition device, image recognition method, and program
CN112257628A (en) Method, device and equipment for identifying identities of outdoor competition athletes
CN112749605A (en) Identity recognition method, system and equipment
CN113553947B (en) Method and device for generating and describing multi-mode pedestrian re-recognition and electronic equipment
CN111582404B (en) Content classification method, device and readable storage medium
CN112989869B (en) Optimization method, device, equipment and storage medium of face quality detection model
CN111008210A (en) Commodity identification method and device, codec and storage device
Kumar et al. Multi-view Face Recognition Using Deep Learning

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
GR01 Patent grant
GR01 Patent grant