Face image recognition method, device, equipment and storage medium

By using serially arranged classifiers and weighted voting algorithms in face recognition technology, the problem of low face recognition efficiency is solved and fast and accurate face image recognition is achieved.

CN109543547BActive Publication Date: 2024-08-27PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811255714.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-10-26
Publication Date
2024-08-27
Estimated Expiration
2038-10-26

AI Technical Summary

Technical Problem

In existing face recognition technology, face image recognition efficiency is not high, the amount of calculation is large, and it is easily limited by models and scenarios.

Method used

A face image recognition method is adopted, by inputting the face image to be recognized into N classifiers arranged serially in a preset order, calculating the feature similarity, and determining the recognition result based on the similarity data. If the i-th If the recognition result of the classifier is successful, it will be used as the matching result; if all N classifiers fail to recognize, a weighted voting algorithm will be used to vote on the similarity data to determine the most similar image.

Benefits of technology

It achieves fast and simple face recognition, reduces the amount of calculation, avoids restrictions on image types and model types, and improves recognition efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109543547B
    Figure CN109543547B
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and provides a facial image recognition method, device, equipment and storage medium, wherein the facial image recognition method comprises: sequentially inputting the acquired facial image to be recognized into N classifiers arranged in series according to a preset order, calculating the feature similarity between the facial image to be recognized and the sample image pre-stored in the sample library in the ith classifier, obtaining the similarity data of the ith classifier, and determining the recognition result of the ith classifier according to the similarity data; if the recognition result of the ith classifier is recognition success, the target sample image recognized by the ith classifier is used as the matching result of the facial image to be recognized; if the recognition results of the N classifiers are all recognition failures, voting is performed on the obtained similarity data of the N classifiers based on a weighted voting algorithm, and determining the matching result of the facial image to be recognized according to the voting result. The present invention can improve the efficiency of facial recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a face image recognition method, device, equipment and storage medium. Background Art

[0002] Face recognition is a biometric technology that identifies a person based on his or her facial features.

[0003] At present, the traditional technology for recognizing facial images is usually to build and train an artificial neural network model, then input the facial image into the artificial neural network model for recognition, and output the recognition result through the output layer of the artificial neural network model. During the recognition process, it is easily affected by the advantages and disadvantages of the model itself and the limitations of the specific matching scene. In addition, when processing a large number of different types of training sets, the amount of calculation required for recognition using the artificial neural network model is large, which can easily lead to low efficiency of facial recognition. Summary of the invention

[0004] Based on this, it is necessary to provide a facial image recognition method, device, equipment and storage medium to address the above technical problems, so as to solve the problem of low facial recognition efficiency of traditional facial recognition technology.

[0005] A facial image recognition method, comprising:

[0006] Obtain a face image to be recognized;

[0007] The face image to be identified is sequentially input into N classifiers arranged in series according to a preset order, and in the i-th classifier, the feature similarity between the face image to be identified and the sample image pre-stored in the sample library is calculated to obtain the similarity data of the i-th classifier, and the recognition result of the i-th classifier is determined according to the similarity data, wherein i is an integer greater than 0 and less than or equal to N;

[0008] If the recognition result of the i-th classifier is successful, the target sample image recognized by the i-th classifier is used as the matching result of the face image to be recognized;

[0009] If the recognition results of the N classifiers are all recognition failures, the similarity data of the N classifiers are voted based on a weighted voting algorithm, and the matching result of the face image to be recognized is determined according to the voting result.

[0010] A facial image recognition device, comprising:

[0011] An image acquisition module, used to acquire a face image to be recognized;

[0012] An image recognition module, used for sequentially inputting the face image to be recognized into N classifiers arranged in series according to a preset order, calculating the feature similarity between the face image to be recognized and the sample image pre-stored in the sample library in the i-th classifier, obtaining the similarity data of the i-th classifier, and determining the recognition result of the i-th classifier according to the similarity data, wherein i is an integer greater than 0 and less than or equal to N;

[0013] A result output module, configured to use the target sample image identified by the i-th classifier as the matching result of the face image to be identified if the recognition result of the i-th classifier is successful;

[0014] The result determination module is used to vote on the similarity data of the N classifiers based on a weighted voting algorithm if the recognition results of the N classifiers are all recognition failures, and determine the matching result of the face image to be recognized according to the voting result.

[0015] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned face image recognition method when executing the computer program.

[0016] A computer-readable storage medium stores a computer program, which implements the steps of the above-mentioned face image recognition method when executed by a processor.

[0017] The above-mentioned face image recognition method, device, equipment and storage medium sequentially input the acquired face image to be recognized into N classifiers arranged in series according to a preset order, calculate the feature similarity between the face image to be recognized and the sample image in the i-th classifier, obtain the similarity data of the i-th classifier, and obtain the recognition result of the i-th classifier based on the similarity data. If the recognition result of the i-th classifier is a successful recognition, the target sample image recognized by the i-th classifier is used as the matching result of the face image to be recognized. Such a recognition method is simple to operate, has a small amount of calculation, and can avoid being affected by image type and recognition. The type of model is limited to achieve rapid recognition of face images, thereby improving the recognition efficiency of face images, as well as improving the universality and practicality of face image recognition. Then, if the recognition results of N classifiers are all recognition failures, then on the basis of face image recognition with serial integrated classifiers, the similarity data of the N classifiers will be voted based on the weighted voting algorithm. According to the voting results, the image most similar to the face image to be recognized can be further screened out from the sample image as the matching result of the face image to be recognized, thereby improving the recognition efficiency of face images while ensuring the accuracy of face image recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0019] Figure 1 is a schematic diagram of an application environment of a face image recognition method according to an embodiment of the present invention;

[0020] Figure 2 is a flow chart of a facial image recognition method in one embodiment of the present invention;

[0021] Figure 3 is a flowchart for implementing step S2 in the face image recognition method in one embodiment of the present invention;

[0022] Figure 4 is a flowchart for implementing step S4 in the face image recognition method in one embodiment of the present invention;

[0023] Figure 5 is a flow chart of obtaining a target threshold value in a face image recognition method in one embodiment of the present invention;

[0024] Figure 6 is a flowchart for implementing step S6 in the face image recognition method in one embodiment of the present invention;

[0025] Figure 7 is a schematic diagram of a face image recognition device in one embodiment of the present invention;

[0026] Figure 8 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] Figure 1The application environment provided by the embodiment of the present invention is shown, and the application environment includes a server and a client, wherein the server and the client are connected via a network, the client is used to obtain a face image to be identified, and sends the obtained face image to be identified to the server, and the client can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices; the server is used to process image data, and the server can be implemented as an independent server or a server cluster composed of multiple servers. The face image recognition method provided by the embodiment of the present invention is applied to the server.

[0029] See also Figure 2 , Figure 2 The implementation process of the face image recognition method provided by this embodiment is shown. The details are as follows:

[0030] S1: Obtain a face image to be recognized.

[0031] Specifically, the facial image to be recognized may be obtained by manual import or automatic timing acquisition from a local database, or by other acquisition methods, which are not limited here.

[0032] The manually importing of the face image to be identified may specifically be performed by receiving an image link address input by a user of the client, and obtaining the face image to be identified stored corresponding to the image link address from the image link address.

[0033] The automatic timing acquisition of the face image to be identified from the local database may specifically be to start a timing acquisition task to acquire the face image to be identified, wherein the timing acquisition task may specifically be to read at a preset time interval. Preferably, the time interval may be set to 20 minutes, 10 minutes or 5 minutes, but is not limited thereto, and may be specifically set according to the needs of the actual application, and is not limited here.

[0034] Specifically, the image timing acquisition task is started, and the face image to be recognized is automatically read from the local database at predetermined time intervals.

[0035] S2: Input the face image to be identified into N classifiers arranged in series according to a preset order in sequence. In the i-th classifier, calculate the feature similarity between the face image to be identified and the sample image pre-stored in the sample library to obtain the similarity data of the i-th classifier, and determine the recognition result of the i-th classifier based on the similarity data, where i is an integer greater than 0 and less than or equal to N.

[0036] In this embodiment, the method for calculating the feature similarity between the face image to be identified and the sample images pre-stored in the sample library can specifically be a histogram similarity calculation formula, Euclidean distance, cosine similarity calculation formula, correlation coefficient similarity calculation formula, chi-square similarity calculation formula, intersection similarity calculation formula or Bhattacharyya distance, etc., which is not limited here.

[0037] Specifically, N classifiers are arranged in series in a preset order. By inputting the face image to be identified into the i-th classifier arranged in the preset order, the RGB component value of each pixel in each sample image pre-stored in the sample library corresponding to the classifier is obtained, as well as the RGB component value of each pixel in the face image to be identified. That is, the RGB component value of each pixel of each extracted image can be obtained by the formula g(x, y)=k1*R(x, y)+k2*G(x, y)+k3*B(x, y). Among them, x and y represent the horizontal and vertical coordinates of each pixel in each extracted image, g(x, y) represents the pixel value of the pixel (x, y) after image processing, R(x, y) represents the color component of the R channel of the pixel (x, y), G(x, y) represents the color component of the G channel of the pixel (x, y), B(x, y) represents the color component of the B channel of the pixel (x, y), k1, k2, k3 are the proportion parameters corresponding to the R channel, G channel, and B channel respectively, and k1+k2+k3=1, and its specific value can be set according to the type of classifier. For example, assuming that a classifier obtains the brightness information of the pixels in the image mainly distributed in the B channel, then the value of k3 is greater than k1 and k2, for example, k1=0.25, k2=0.25, k3=0.5.

[0038] Furthermore, in order to accurately calculate the feature similarity between the face image to be identified and the sample images pre-stored in the sample library, the histogram of the face image to be identified and the respective histograms of each sample image can be calculated by calling the encapsulated histogram calculation function based on the RGB component value of each pixel of the face image to be identified and the RGB component value of each pixel in each sample image pre-stored in the sample library, and these histograms are normalized, and the feature similarity values ​​between the face image to be identified and the sample images pre-stored in the sample library are calculated according to the histogram similarity calculation formula, and then, these feature similarity values ​​are used as the similarity data of the i-th classifier.

[0039] Furthermore, the recognition result of the classifier can be determined based on the calculated similarity data of the i-th classifier by a simple maximum screening method, that is, comparing the numerical values ​​of each feature similarity in the similarity data, and then selecting the sample image corresponding to the feature similarity with the largest numerical value from the similarity data, and determining the sample image as the recognition result of the i-th classifier. It can also be determined by a threshold screening method, that is, comparing the numerical value of each feature similarity in the similarity data with the classifier threshold preset in each classifier, and then determining the sample image that meets the classifier threshold as the recognition result of the i-th classifier. Accurate similarity data can be obtained through a simple similarity calculation formula, and the recognition result of the i-th classifier can be quickly determined based on the similarity data. The calculation amount is small, which saves the calculation time of face recognition to a large extent, thereby improving the recognition efficiency of face images.

[0040] S3: If the recognition result of the i-th classifier is successful, the target sample image recognized by the i-th classifier is used as the matching result of the face image to be recognized.

[0041] Specifically, according to the recognition result of the i-th classifier obtained in step 2, if the i-th classifier outputs a sample image pre-stored in the sample library of the classifier, it can be understood that the classifier has identified a target sample image that is most similar to the face image to be recognized from the sample images pre-stored in the sample library of the classifier, then the recognition result of the classifier is a successful recognition, so the target sample image output by the classifier can be used as the matching result of the classifier, that is, the face image recognition is completed, and no other steps are continued. Such a recognition method is simple to operate, has a small amount of calculation, and can achieve rapid recognition of face images, thereby improving the recognition efficiency of face images.

[0042] S4: If the recognition results of the N classifiers are all recognition failures, then based on a weighted voting algorithm, the obtained similarity data of the N classifiers are voted on, and the matching result of the face image to be recognized is determined according to the voting result.

[0043] Specifically, according to the recognition results of the N classifiers obtained in step 2, if the outputs of the N classifiers are all empty, it can be understood that the N classifiers have not recognized the sample image that is most similar to the face image to be recognized, or, in the N classifiers, the similarity between each pre-stored sample image and the face image to be recognized is not high, that is, the recognition results of the N classifiers are all recognition failures. In order to find the sample image that is most similar to the face image to be recognized among the sample images with low similarity and ensure the accuracy of face image recognition, this embodiment performs weighted voting on the similarity data of the N classifiers obtained. Voting may specifically be a classifier weight value pre-set according to the classifier type, that is, each classifier type corresponds to a classifier weight value, by calculating the average value of the similarity data of each classifier, and multiplying the average value of the classifier similarity data by the classifier weight value corresponding to the classifier, and the obtained product is used as the basic voting score of the classifier, and then, the basic voting score with the highest score is selected from these basic voting scores, the classifier corresponding to the basic voting score with the highest score is obtained, and the sample image corresponding to the maximum feature similarity of the classifier is used as the matching result of the face image to be recognized.

[0044] By voting on the similarity data of N classifiers obtained by performing face image recognition on ordered serial integrated classifiers based on a weighted voting algorithm, the similarity data of the N classifiers are further limited by the N classifier weights, thereby improving the recognition efficiency of face images while ensuring the accuracy of face image recognition.

[0045] In this embodiment, the acquired face image to be identified is sequentially input into N classifiers arranged in series according to a preset order, and in the i-th classifier, the feature similarity between the face image to be identified and the sample image is calculated to obtain the similarity data of the i-th classifier, and the recognition result of the i-th classifier is obtained according to the similarity data. If the recognition result of the i-th classifier is successful, the target sample image identified by the i-th classifier is used as the matching result of the face image to be identified. Such a recognition method is simple to operate, has a small amount of calculation, and can avoid being restricted by the type of image and the type of recognition model. , to achieve rapid recognition of face images, thereby improving the recognition efficiency of face images, as well as improving the universality and practicality of face image recognition. Then, if the recognition results of N classifiers are all recognition failures, then on the basis of face image recognition with serial integrated classifiers, the similarity data of the N classifiers will be voted based on a weighted voting algorithm. According to the voting results, the image most similar to the face image to be recognized can be further screened out from the sample image as the matching result of the face image to be recognized, thereby improving the recognition efficiency of the face image while ensuring the accuracy of the face image recognition.

[0046] In one embodiment, if Figure 3 As shown, in step S2, the face image to be identified is sequentially input into N classifiers arranged in series according to a preset order, and in the i-th classifier, the feature similarity between the face image to be identified and the sample image pre-stored in the sample library is calculated to obtain the similarity data of the i-th classifier, and the recognition result of the i-th classifier is determined according to the similarity data. Specifically, the steps include:

[0047] S201: extracting facial features of the face image to be identified according to the model definition of the i-th classifier to obtain a facial feature vector of the face image to be identified.

[0048] Specifically, since the type of each classifier is different, the dimensions of feature extraction for the face image to be identified are different, and the facial feature vectors of the face image to be identified corresponding to each classifier are different. Specifically, the facial image to be identified can be feature extracted according to the feature dimension defined by the model of the i-th classifier to obtain the facial feature vector of the face image to be identified. For example, if the feature dimension defined by the model of the i-th classifier is the local binary pattern feature (LBP), LBP feature extraction is performed on the face image to be identified to obtain the LBP texture feature vector corresponding to the face image to be identified. Facial feature extraction can also be performed on the face image to be identified in other ways. The way of facial feature extraction for the face image to be identified is determined by the feature dimension defined by the model of the classifier, and is not limited here.

[0049] The process of extracting LBP features from the face image to be identified includes steps a1) to a5), which are described in detail as follows:

[0050] a1) Divide the face image to be recognized into s×s small regions (cells) according to the feature dimension s defined by the model of the i-th classifier;

[0051] a2) Since the face image to be recognized contains the pixel value corresponding to each pixel, for each pixel in each cell, the pixel value of the central pixel is compared with the pixel values ​​of the adjacent s / 2 pixels. If the pixel value of the surrounding s / 2 pixels is greater than the pixel value of the central pixel, the position of the pixel is marked as 1, otherwise it is marked as 0. The s / 2 pixels in the 3*3 neighborhood of each cell are compared to generate an s / 2-bit binary number as the LBP value corresponding to the central pixel of each cell;

[0052] a3) Calculate the histogram of each cell, that is, the frequency of occurrence of each number, where each number is a decimal LBP value;

[0053] a4) normalizing the histogram in step a3) to obtain a statistical histogram of each cell;

[0054] a5) Connect the obtained statistical histogram of each cell into a feature vector to obtain the LBP texture feature vector of the face image to be identified, that is, the facial feature vector corresponding to the face image to be identified.

[0055] S202: Calculate the feature similarity between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier, and use the obtained M feature similarities as similarity data of the i-th classifier, where M is the number of sample images.

[0056] In this embodiment, the feature similarity between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier is calculated. Specifically, the Euclidean distance between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier may be calculated, or the cosine similarity between the image feature value and the pre-stored sample feature value may be calculated. Other similarity calculation methods may also be used, which are not limited here.

[0057] Preferably, the Euclidean distance calculation method is adopted in this embodiment.

[0058] Specifically, the facial feature vector obtained in step S201 and the sample feature vector corresponding to each pre-stored sample image in the i-th classifier are substituted into the Euclidean distance calculation formula: By calculating in, the feature similarity between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier can be obtained, where a i represents the component of the facial feature vector in the i-th classifier, b i Represents the component of the sample feature vector in the i-th classifier, d represents the value of the Euclidean distance, and m represents the total number of components of the facial feature vector. Since each classifier has M pre-stored sample images, the M sample images correspond to M sample feature vectors in the i-th classifier. Then, the feature similarity between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier is calculated, and M feature similarities can be obtained. The obtained M feature similarities are used as the similarity data of the i-th classifier.

[0059] S203: If the feature similarity with the largest value among the obtained M feature similarities is greater than or equal to the target threshold preset by the ith classifier, determine that the recognition result of the ith classifier is the sample image corresponding to the feature similarity with the largest value.

[0060] Specifically, since the preset target threshold of each classifier can be used to further limit the M feature similarities, it is possible to screen out a unique sample image that is most similar to the face image to be identified from the M feature similarities of each classifier. Therefore, according to the M feature similarities calculated in step S202, the M feature similarities are compared, and the feature similarity with the largest value is selected therefrom. Then, the feature similarity is compared with the preset target threshold of the i-th classifier. If the feature similarity is greater than or equal to the preset target threshold of the i-th classifier, it can be understood that the sample image corresponding to the feature similarity is most similar to the face image to be identified, and the sample image corresponding to the feature similarity is used as the recognition result of the i-th classifier.

[0061] S204: If the feature similarity with the largest value among the obtained M feature similarities is less than the target threshold, it is determined that the recognition result of the i-th classifier is empty.

[0062] Specifically, based on the further limitation of the M feature similarities by the preset target threshold of each classifier, if the M feature similarities cannot meet the requirement of the target threshold, it means that the sample image most similar to the face image to be identified has not been identified in the pre-stored sample images of the classifier, then according to the M feature similarities calculated in step S202, the M feature similarities are compared, and the feature similarity with the largest value is selected therefrom, and then the feature similarity is compared with the target threshold preset by the i-th classifier. If the feature similarity is less than the target threshold preset by the i-th classifier, it can be understood that the sample image corresponding to the feature similarity is not similar to the face image to be identified, and the recognition result output of the i-th classifier is empty.

[0063] In this embodiment, facial features are extracted from the face image to be identified according to the model definition of the i-th classifier to obtain the facial feature vector of the face image to be identified, and then the feature similarity between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier is calculated, and the obtained M feature similarities are used as the similarity data of the i-th classifier. The similarity data of the i-th classifier can intuitively reflect the similarity between the face image to be identified and each sample image in each classifier. Furthermore, under the further limitation of the preset target threshold of the i-th classifier, if the feature similarity with the largest value among the obtained M feature similarities is greater than or equal to the preset target threshold of the i-th classifier, then the recognition result of the i-th classifier is determined to be the sample image corresponding to the feature similarity with the largest value. If the feature similarity with the largest value among the obtained M feature similarities is less than the target threshold, then the recognition result of the i-th classifier is determined to be empty, so that a unique sample image that is most similar to the face image to be identified can be screened out from the M feature similarities of each classifier, thereby improving the recognition efficiency while ensuring the accuracy of face image recognition.

[0064] In one embodiment, if Figure 4 As shown, in step S4, if the recognition results of the N classifiers are all recognition failures, then based on the weighted voting algorithm, the obtained similarity data of the N classifiers are voted, and the matching result of the face image to be recognized is determined according to the voting result. Specifically, the following steps are included:

[0065] S401: If the recognition results of N classifiers are all recognition failures, then based on the similarity data of each classifier, the sample images corresponding to the feature similarities are sorted in order from large to small, and a feature similarity sequence corresponding to each classifier is generated to obtain N feature similarity sequences, wherein each feature similarity sequence includes M positions from a starting position to an ending position, each position corresponds to a sample image element, the sample image element corresponding to the starting position is the sample image corresponding to the maximum feature similarity, and the sample image element corresponding to the ending position is the sample image corresponding to the minimum feature similarity.

[0066] Specifically, according to the recognition results of the N classifiers obtained in step S2, all of them are empty. Based on the similarity data of the N classifiers obtained by performing face image similarity analysis on the face image to be identified through the preset sorted serial integration of the N classifiers, the feature similarities in the similarity data of each classifier are sorted in descending order to obtain a sample image sequence of M positions from the starting position to the ending position, which can be understood as the degree of similarity between the sample image of the classifier and the face image to be identified, a sample image sequence from the most similar to the least similar, and the sample image sequence is used as the feature similarity sequence corresponding to each classifier, and the sample image at each position is used as the sample image element corresponding to each position, that is, each position corresponds to a sample image element. It can be understood that the sample image element corresponding to the starting position is the sample image corresponding to the maximum feature similarity, and the sample image element corresponding to the ending position is the sample image corresponding to the minimum feature similarity. Since the similarity data of N classifiers are sorted, N feature similarity sequences can be obtained.

[0067] It should be noted that, in order to facilitate data statistics and processing, the sample image at each position may be used as the sample image element corresponding to each position, and each sorted sample image element may be marked according to the category of each sample image element.

[0068] For example, “sample image element one is marked as A”, “sample image element two is marked as B”, and so on.

[0069] S402: For each feature similarity sequence, select the first k sample image elements as basic image elements, and obtain N×k basic image elements in N feature similarity sequences, where k is an integer greater than 0 and less than or equal to M.

[0070] Specifically, sample image elements can be selected for each feature similarity sequence using a preset sample image element selection method, that is, the first k sample image elements are selected from the M sample image elements in the direction from the starting position to the ending position, such as k=5, and these k elements are used as the basic image elements of the feature similarity sequence. The basic elements of each feature similarity sequence are summarized to obtain an element set containing N×k basic image elements. If the example in step S401 is continued, the obtained element set containing N×k basic image elements may be (A, B, C, D, E, B, F, C, A, D,...).

[0071] By selecting the first k sample image elements as the basic image elements for each feature similarity sequence, the purpose is to select the sample images in each feature sequence that are more similar to the face image to be identified. This can avoid unnecessary computational burden caused by the data of sample images with low similarity, reduce computational complexity, save computing time, and thus improve the efficiency of face image recognition.

[0072] S403: Among the N×k basic image elements, count the number of times each basic image element appears, and use the number of times each basic image element appears as the number of votes for each basic image element.

[0073] Specifically, based on the element set including N×k basic image elements obtained in step S402 and the label of each basic image element, the number of times each basic image element appears in the element set including N×k basic image elements can be quickly counted, and the number of times each basic image element appears can be used as the number of votes for each basic image element.

[0074] It can be understood that each basic image element is subject to the conditional restrictions of N classifiers and different classifier model definitions. If a basic image element has more votes, it means that the conditional restrictions of the classifier model definition are lower, and the sample image corresponding to the basic image element is more similar to the face image to be identified. Therefore, by calculating the number of votes for each basic image element, the accuracy of face image recognition can be guaranteed.

[0075] S404: If the basic image element corresponding to the maximum value in the voting number is unique, the sample image corresponding to the basic image element is used as the matching result of the face image to be recognized.

[0076] Specifically, according to the number of votes for each basic image element obtained in step S403, the number of votes for each basic image element is compared with the number of votes for other basic image elements, and then the basic image element corresponding to the number of votes with the largest value is screened out. If the basic image element corresponding to the largest value in the number of votes is unique, it means that the sample image corresponding to the basic image element is the sample image most similar to the face image to be identified, so the sample image corresponding to the basic image element can be used as the matching result of the face image to be identified.

[0077] S405: If there are A basic image elements corresponding to the maximum value in the number of votes, then the A basic image elements are used as target image elements, and the weight score of each target image element is calculated according to the preset weight value of each position in the feature similarity sequence and the position of each target image element in the feature similarity sequence containing the target image element, wherein A is a positive integer greater than 1 and less than k, and the preset weight value of each position in the feature similarity sequence increases sequentially from the starting position to the ending position.

[0078] Specifically, according to the number of votes for each basic image element obtained in step S403, when there are multiple basic image elements with the highest number of votes obtained after comparison, such as A basic image elements, the A basic image elements are used as target image elements, and then, according to the position of each target image element in the feature similarity sequence containing the target image element and the preset weight value of each position in the feature similarity sequence, the weight score of each target image element is calculated, which can ensure the uniqueness of the recognition result, so as to achieve the purpose of making the output target sample image most similar to the face image to be recognized, thereby ensuring the accuracy of face recognition.

[0079] This can be understood through an embodiment, as shown in Table 1, assuming a preset weight value for each position in a pre-set feature similarity sequence, the preset weight value for each position increases in sequence from the starting position to the ending position, such as the preset weight value of the starting position in each feature similarity sequence is 1, recorded as Rank1, the preset weight value of the subsequent position is 2, recorded as Rank2, and so on, to obtain the preset weight values ​​of M positions. For example, assuming that in N feature sequences, N=4, among the k basic image elements selected, k=4, and there are 2 basic image elements with the highest number of votes, such as "element C" and "element D" both have 3 votes, as shown in Table 1, Rank1 is set to 1, Rank2 is set to 2, Rank3 is set to 3, and Rank4 is set to 4, and the weight score of each target image element is calculated, that is, the weight score of C is "1+2+1=4", and the weight score of D is "1+2+3=6".

[0080] Rank1 Rank2 Rank3 Rank 4 Classifier 1 C F D A Classifier 2 D C J K Classifier 3 C D A E Classifier 4 B F H I

[0081] Table 1

[0082] S406: Obtain the target image element corresponding to the minimum value of the weight score, and use the sample image corresponding to the target image element as the matching result of the face image to be recognized.

[0083] Specifically, since the preset weight value of each position in the feature similarity sequence increases sequentially from the starting position to the ending position, the weight score of each target image element is calculated according to the position of each target image element in the feature similarity sequence containing the target image element and the preset weight value of each position in the feature similarity sequence. The smaller the weight score of each target image element, the more similar the sample image corresponding to the target image element is to the face image to be identified. Therefore, the weight scores of each target image element calculated in step S405 are compared, and the target image element corresponding to the minimum weight score is selected, that is, the sample image corresponding to the target image element is most similar to the face image to be identified. Therefore, the sample image corresponding to the target image element can be used as the matching result of the face image to be identified, thereby ensuring the accuracy of face image recognition.

[0084] For example, continuing to use the example shown in Table 1 in step S405, the weight score of each target image element is calculated, that is, the weight score of C is "1+2+1=4", and the weight score of D is "1+2+3=6". By comparing these two weight scores, it is found that the weight score of C is less than the weight score of D, so the sample image corresponding to the target image element C is used as the matching result of the face image to be identified.

[0085] In this embodiment, by integrating N classifiers in a preset sorted serial manner, based on the similarity data of the N classifiers obtained by performing face image recognition on the face image to be recognized, the feature similarities in the similarity data of each classifier are arranged in descending order to obtain a sample image sequence corresponding to each feature similarity, and the sample image sequence is used as the feature similarity sequence corresponding to each classifier. Then, the first k sample image elements are selected from each feature similarity sequence as basic image elements, which can avoid unnecessary calculation burden caused by the data of sample images with low similarity, reduce calculation complexity, and save calculation time. Then, by counting the number of occurrences of each basic image element, the number of occurrences of each basic image element is used as the number of votes for each basic image element, and the number of votes for each basic image element is compared, and the basic image element corresponding to the largest value in the number of votes is selected, and the basic image element corresponding to the largest value in the number of votes is selected for the basic image element. The basic image element corresponding to the maximum value in the number of votes is unique or non-unique, and corresponding data processing is performed respectively. When the basic image element corresponding to the maximum value in the number of votes is unique, the sample image corresponding to the basic image element is used as the matching result of the face image to be identified. When the basic image elements corresponding to the maximum value in the number of votes are A, the A basic image elements are used as target image elements. According to the preset weight value of each position in the feature similarity sequence and the position of each target image element in the feature similarity sequence containing the target image element, the weight score of each target image element is calculated, and the target image element corresponding to the minimum value of the weight score is obtained. The sample image corresponding to the target image element is used as the matching result of the face image to be identified. The uniqueness of the recognition result can be guaranteed, so as to achieve the purpose of making the output target sample image most similar to the face image to be identified, thereby ensuring the accuracy of face recognition.

[0086] In one embodiment, if Figure 5 As shown, before step S1, the face image recognition method further includes the following steps:

[0087] S5: Input each sample image in the sample library into each classifier to extract sample features, and obtain a sample feature vector corresponding to each sample image in each classifier.

[0088] Specifically, since the type of each classifier is different, the dimensions of feature extraction for the image are different, and the sample feature vector corresponding to each sample image in each classifier is different. In order to ensure the accuracy of facial image recognition by each classifier, each sample image in the sample library is input into each classifier for sample feature extraction. The method for each classifier to extract sample features from each sample image in the sample library is the same as the method for extracting facial features from the facial image to be identified according to the model definition of the i-th classifier in step S201, and will not be repeated here.

[0089] S6: In each classifier, according to the sample feature vector corresponding to each sample image in the classifier, the basic error rate corresponding to each basic threshold among the h preset basic thresholds of the classifier is calculated, and the basic threshold corresponding to the basic error rate equal to zero is used as the target threshold of the classifier, where h is an integer greater than 0.

[0090] Specifically, since the setting of the target threshold of each classifier is related to the accuracy of each classifier in identifying the image to be identified, in order to obtain the target threshold that each classifier wants to adapt, this embodiment pre-sets h basic thresholds for each classifier, and then calculates the basic error rate corresponding to each basic threshold of the classifier according to the sample feature vector corresponding to each sample image in each classifier obtained in step S5. Specifically, the modulus of each sample feature vector in each classifier is calculated, and then each basic threshold of the classifier is compared with the modulus of each sample feature vector of the classifier, and the number of sample feature vectors whose modulus is greater than or equal to the basic threshold is counted, and the number of sample feature vectors whose modulus is greater than or equal to the basic threshold is divided by the total number of sample feature vectors. The quotient obtained is the basic error rate corresponding to each basic threshold. The basic error rate corresponding to each basic threshold can also be calculated in other ways, which are not limited here.

[0091] It can be understood that the smaller the basic false positive rate is, the lower the probability of mistaking the face image to be recognized as two or more faces will be under the condition of the basic threshold corresponding to the basic false positive rate. Therefore, by using the basic threshold corresponding to the basic false positive rate with a value equal to zero as the target threshold of the classifier, the accuracy of face image recognition can be guaranteed.

[0092] In this embodiment, each sample image in the sample library is input into each classifier to extract sample features. Then, the basic error rate corresponding to each basic threshold of h preset basic thresholds of the classifier is calculated according to the sample feature vector corresponding to each sample image in each classifier. By taking the basic threshold corresponding to the basic error rate with a value equal to zero as the target threshold of the classifier, the target threshold that is adapted to each classifier can be obtained, thereby ensuring the accuracy of each classifier in identifying the image to be identified.

[0093] In one embodiment, if Figure 6 As shown, in step S6, that is, in each classifier, according to the sample feature vector corresponding to each sample image in the classifier, the basic error rate corresponding to each basic threshold value of the h preset basic threshold values ​​of the classifier is calculated, and the basic threshold value corresponding to the basic error rate with a value equal to zero is used as the target threshold value of the classifier. Specifically, the following steps are included:

[0094] S601: In each classifier, the sample similarity between the sample feature vector corresponding to each sample image in the classifier and other sample feature vectors in the classifier is calculated, and the total number of sample similarities is counted.

[0095] In this embodiment, the Euclidean distance formula, the cosine similarity calculation formula, or the correlation coefficient similarity calculation formula may be specifically used. Other similarity calculation formulas may also be used, which are not limited here.

[0096] Specifically, according to the sample feature vectors of the sample images in the preset sample library of each classifier obtained in step S5, since the sample image features extracted from the sample images are displayed in the form of sample feature vectors in this embodiment, the cosine similarity calculation formula is adopted to more accurately calculate the sample similarity between the sample feature vector corresponding to each sample image in the classifier and other sample feature vectors in the classifier, thereby ensuring the accuracy of the sample similarity. Substituting the sample feature vector corresponding to each sample image in the classifier and other sample feature vectors in the classifier into the cosine similarity formula is: By calculating in, we can get the similarity between the sample feature vector corresponding to each sample image in the classifier and each other sample feature vector in the classifier, where x i Represents the component of the sample feature vector corresponding to each sample image in the classifier, y i Represents the components of other sample feature vectors in the classifier, p represents the value of cosine similarity, n represents the total number of components of the sample feature vector corresponding to each sample image in the classifier, and then, each time a sample similarity is calculated, a count is performed to count the total number of sample similarities of the classifier.

[0097] S602: For the j-th basic threshold of each classifier, count the number of samples whose similarity is greater than or equal to the j-th basic threshold, and take the quotient of the number and the total number of sample similarities as the basic false positive rate corresponding to the j-th basic threshold, where j is an integer greater than zero and less than or equal to h.

[0098] Specifically, the basic false positive rate corresponding to each basic threshold is used to indicate that, under the condition of the target threshold in each classifier, each sample image is guaranteed to be different, so that each classifier can reduce the probability of mistaking the face image to be identified as multiple sample images when identifying the face image to be identified, thereby ensuring the accuracy of face image recognition. Therefore, according to the sample similarity data of each classifier obtained in step S601, the value of each sample similarity of the classifier is compared with the jth basic threshold of the classifier, and the number of sample similarities greater than or equal to the jth basic threshold of the classifier is counted, and then, the number of sample similarities greater than or equal to the jth basic threshold of the classifier is divided by the total number of sample similarities of the classifier obtained in step S601, and the quotient obtained is used as the basic false positive rate corresponding to the jth basic threshold.

[0099] It can be understood that, among the j-th basic thresholds of the classifier, the more the number is greater than or equal to the j-th basic threshold of the classifier, that is, the larger the value of the basic misjudgment rate corresponding to the j-th basic threshold calculated, indicating that the sample images corresponding to the j-th basic threshold of the classifier are more similar, which will lead to a higher misrecognition rate when the classifier identifies the face image to be identified, and will reduce the accuracy of identifying the face image.

[0100] S603: In each classifier, a basic false positive rate with a value equal to zero is selected from the obtained h basic false positive rates as a target false positive rate, and a basic threshold corresponding to the target false positive rate is determined as the target threshold of the classifier.

[0101] Specifically, according to the basic error rates corresponding to the h basic thresholds in each classifier calculated in step S602, since the smaller the value of the basic error rate corresponding to the j-th basic threshold, the less similar the sample images corresponding to the j-th basic threshold of the classifier are, the misrecognition rate of the classifier when identifying the face image to be identified will be reduced, which can improve the accuracy of identifying face images. Therefore, from the h basic error rates obtained from each classifier, the basic error rate with the smallest value is selected, that is, the basic error rate with a value equal to zero is selected as the target error rate, and the basic threshold corresponding to the target error rate is determined as the target threshold of the classifier, thereby improving the accuracy of the classifier in recognizing face images.

[0102] In this embodiment, the sample similarity between the sample feature vector corresponding to each sample image in each classifier and other sample feature vectors in the classifier is calculated, and the total number of sample similarities of the classifier is counted. Then, the number of sample similarities in each classifier that are greater than or equal to the j-th basic threshold of the classifier is counted, and the quotient of the number and the total number of sample similarities is used as the basic error rate corresponding to the j-th basic threshold. At the same time, a basic error rate with a value of zero is selected from the h basic error rates in each classifier obtained by calculation as the target error rate, and the basic threshold corresponding to the target error rate is determined as the target threshold of the classifier. Since the value of the basic error rate corresponding to the target threshold is the smallest, it indicates that the sample images corresponding to the target threshold of the classifier are the least similar, which ensures that each sample image is different, and can reduce the probability of mistaking the face image to be identified as multiple sample images when each classifier identifies the face image to be identified, thereby ensuring the accuracy of face image recognition.

[0103] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0104] In one embodiment, a face image recognition device is provided, which corresponds one-to-one to the face image recognition method in the above embodiment. Figure 7 As shown, the face image recognition device includes an image acquisition module 701, an image recognition module 702, a result output module 703 and a result determination module 704. The detailed description of each functional module is as follows:

[0105] An image acquisition module 701 is used to acquire a face image to be recognized;

[0106] The image recognition module 702 is used to sequentially input the face image to be recognized into N classifiers arranged in series according to a preset order, and in the i-th classifier, calculate the feature similarity between the face image to be recognized and the sample image pre-stored in the sample library, obtain the similarity data of the i-th classifier, and determine the recognition result of the i-th classifier according to the similarity data, where i is an integer greater than 0 and less than or equal to N;

[0107] The result output module 703 is used to use the target sample image recognized by the i-th classifier as the matching result of the face image to be recognized if the recognition result of the i-th classifier is successful;

[0108] The result determination module 704 is used to vote on the similarity data of the N classifiers based on a weighted voting algorithm if the recognition results of the N classifiers are all recognition failures, and determine the matching result of the face image to be recognized according to the voting result.

[0109] Furthermore, the image recognition module 702 includes:

[0110] A feature extraction unit, used for extracting facial features of the face image to be identified according to the model definition of the i-th classifier, to obtain a facial feature vector of the face image to be identified;

[0111] A data calculation unit, used to calculate the feature similarity between the facial feature vector and the sample feature vector corresponding to each sample image in the i-th classifier, and use the obtained M feature similarities as the similarity data of the i-th classifier, where M is the number of sample images;

[0112] The recognition output unit is used to determine that the recognition result of the i-th classifier is the sample image corresponding to the feature similarity with the largest value among the M feature similarities obtained, if the feature similarity with the largest value among the M feature similarities obtained is greater than or equal to the target threshold preset by the i-th classifier;

[0113] The recognition and determination unit is used to determine that the recognition result of the i-th classifier is empty if the feature similarity with the largest value among the M feature similarities obtained is less than the target threshold.

[0114] Further, the result determination module 704 includes:

[0115] A sequence generating unit is used for, if the recognition results of N classifiers are all recognition failures, then, according to the similarity data of each classifier, in the order of feature similarity from large to small, sorting the sample images corresponding to the feature similarity, generating a feature similarity sequence corresponding to each classifier, and obtaining N feature similarity sequences, wherein each feature similarity sequence includes M positions from a starting position to an ending position, each position corresponds to a sample image element, the sample image element corresponding to the starting position is the sample image corresponding to the maximum feature similarity, and the sample image element corresponding to the ending position is the sample image corresponding to the minimum feature similarity;

[0116] An element selection unit is used to select the first k sample image elements as basic image elements for each feature similarity sequence, and obtain N×k basic image elements in N feature similarity sequences, where k is an integer greater than 0 and less than or equal to M;

[0117] A vote counting unit, used to count the number of times each basic image element appears among the N×k basic image elements, and use the number of times each basic image element appears as the number of votes for each basic image element;

[0118] An element determination unit, configured to, if the basic image element corresponding to the maximum value in the vote number is unique, use the sample image corresponding to the basic image element as the matching result of the face image to be identified;

[0119] A weight calculation unit, for, if there are A basic image elements corresponding to the maximum value in the number of votes, taking the A basic image elements as target image elements, and calculating the weight score of each target image element according to the preset weight value of each position in the feature similarity sequence and the position of each target image element in the feature similarity sequence containing the target image element, wherein A is a positive integer greater than 1 and less than k, and the preset weight value of each position in the feature similarity sequence increases in sequence from the starting position to the ending position;

[0120] The target acquisition unit is used to acquire the target image element corresponding to the minimum value of the weight score, and use the sample image corresponding to the target image element as the matching result of the face image to be identified.

[0121] Furthermore, the face image recognition device also includes:

[0122] The sample processing module 705 is used to input each sample image in the sample library into each classifier to extract sample features, and obtain the sample feature vector corresponding to each sample image in each classifier;

[0123] The threshold acquisition module 706 is used to calculate, in each classifier, the basic error rate corresponding to each basic threshold of h preset basic thresholds of the classifier according to the sample feature vector corresponding to each sample image in the classifier, and use the basic threshold corresponding to the basic error rate equal to zero as the target threshold of the classifier, where h is an integer greater than 0.

[0124] Further, the threshold acquisition module 706 includes:

[0125] A data statistics unit is used to calculate, in each classifier, the sample similarity between the sample feature vector corresponding to each sample image in the classifier and other sample feature vectors in the classifier, and to count the total number of sample similarities;

[0126] A threshold comparison unit is used to count the number of samples whose similarity is greater than or equal to the jth basic threshold for each classifier, and take the quotient of the number and the total number of sample similarities as the basic false positive rate corresponding to the jth basic threshold, where j is an integer greater than zero and less than or equal to h;

[0127] The threshold determination unit is used to select a basic error rate with a value equal to zero from the obtained h basic error rates as the target error rate in each classifier, and determine the basic threshold corresponding to the target error rate as the target threshold of the classifier.

[0128] For the specific definition of the facial image recognition device, please refer to the definition of the facial image recognition method above, which will not be repeated here. Each module in the above facial image recognition device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0129] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store processing data of facial images. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a facial image recognition method is implemented.

[0130] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the face image recognition method of the above embodiment are implemented, such as Figure 2 Alternatively, when the processor executes the computer program, the functions of each module / unit of the face image recognition device in the above embodiment are realized, for example Figure 7 The functions of modules 701 to 704 are shown in Figure 7. To avoid repetition, they are not described here.

[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the face image recognition method in the above method embodiment is implemented, or when the computer program is executed by a processor, the functions of each module / unit in the face image recognition device in the above device embodiment are implemented. To avoid repetition, it will not be repeated here.

[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0133] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0134] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A facial image recognition method, characterized in that: The facial image recognition method comprises: Obtain a face image to be recognized; The face image to be identified is sequentially input into N classifiers arranged in series according to a preset order, and in the i-th classifier, the feature similarity between the face image to be identified and the sample image pre-stored in the sample library is calculated to obtain the similarity data of the i-th classifier, and the recognition result of the i-th classifier is determined according to the similarity data, wherein i is an integer greater than 0 and less than or equal to N; If the recognition result of the i-th classifier is successful, the target sample image recognized by the i-th classifier is used as the matching result of the face image to be recognized; If the recognition results of the N classifiers are all recognition failures, voting is performed on the obtained similarity data of the N classifiers based on a weighted voting algorithm, and a matching result of the face image to be recognized is determined according to the voting result; If the recognition results of the N classifiers are all recognition failures, voting is performed on the obtained similarity data of the N classifiers based on a weighted voting algorithm, and the matching result of the face image to be recognized is determined according to the voting result, including: If the recognition results of the N classifiers are all recognition failures, then according to the similarity data of each classifier, in the order of the feature similarity from large to small, the sample images corresponding to the feature similarity are sorted to generate a feature similarity sequence corresponding to each classifier, and N feature similarity sequences are obtained, wherein each feature similarity sequence includes M positions from a starting position to an ending position, each position corresponds to a sample image element, the sample image element corresponding to the starting position is the sample image corresponding to the maximum value of the feature similarity, and the sample image element corresponding to the ending position is the sample image corresponding to the minimum value of the feature similarity; For each of the feature similarity sequences, the first k sample image elements are selected as basic image elements, and a total of the basic image elements, wherein k is an integer greater than 0 and less than or equal to M; exist Among the basic image elements, counting the number of times each of the basic image elements appears, and using the number of times each of the basic image elements appears as the number of votes for each of the basic image elements; If the basic image element corresponding to the maximum value in the vote number is unique, the sample image corresponding to the basic image element is used as the matching result of the face image to be identified; If the number of basic image elements corresponding to the maximum value in the number of votes is A, then the A basic image elements are used as target image elements, and according to the preset weight value of each position in the feature similarity sequence and the position of each target image element in the feature similarity sequence containing the target image element, the weight score of each target image element is calculated, wherein A is a positive integer greater than 1 and less than k, and the preset weight value of each position in the feature similarity sequence increases in sequence from the starting position to the ending position; The target image element corresponding to the minimum value of the weight score is obtained, and the sample image corresponding to the target image element is used as the matching result of the face image to be recognized.

2. The facial image recognition method according to claim 1, characterized in that: The step of sequentially inputting the face image to be identified into N classifiers arranged in series according to a preset order, calculating the feature similarity between the face image to be identified and a sample image pre-stored in a sample library in the i-th classifier to obtain similarity data of the i-th classifier, and determining the recognition result of the i-th classifier according to the similarity data comprises: According to the model definition of the i-th classifier, facial features are extracted from the face image to be identified to obtain a facial feature vector of the face image to be identified; Calculating the feature similarity between the facial feature vector and the sample feature vector corresponding to each of the sample images in the i-th classifier, and using the obtained M feature similarities as the similarity data of the i-th classifier, where M is the number of the sample images; If the feature similarity with the largest value among the M feature similarities obtained is greater than or equal to the target threshold preset by the i-th classifier, then determine that the recognition result of the i-th classifier is the sample image corresponding to the feature similarity with the largest value; If the feature similarity with the largest value among the M feature similarities obtained is less than the target threshold, it is determined that the recognition result of the i-th classifier is empty.

3. The facial image recognition method according to claim 2, characterized in that: Before acquiring the face image to be recognized, the face image recognition method further includes: Input each of the sample images in the sample library into each of the classifiers to extract sample features, and obtain a sample feature vector corresponding to each of the sample images in each of the classifiers; In each of the classifiers, based on the sample feature vector corresponding to each of the sample images in the classifier, the basic error rate corresponding to each of the h preset basic thresholds of the classifier is calculated, and the basic threshold corresponding to the basic error rate equal to zero is used as the target threshold of the classifier, where h is an integer greater than 0.

4. The facial image recognition method according to claim 3, characterized in that: The step of calculating, in each of the classifiers, the basic misjudgment rate corresponding to each of the h preset basic thresholds of the classifier according to the sample feature vector corresponding to each of the sample images in the classifier, and taking the basic threshold corresponding to the basic misjudgment rate equal to zero as the target threshold of the classifier includes: In each of the classifiers, the sample similarity between the sample feature vector corresponding to each of the sample images in the classifier and other sample feature vectors in the classifier is calculated, and the total number of the sample similarities is counted; For the jth basic threshold of each classifier, count the number of samples whose similarity is greater than or equal to the jth basic threshold, and take the quotient of the number and the total number of sample similarities as the basic false positive rate corresponding to the jth basic threshold, where j is an integer greater than zero and less than or equal to h; In each of the classifiers, a basic error rate with a value equal to zero is selected from the obtained h basic error rates as the target error rate, and a basic threshold corresponding to the target error rate is determined as the target threshold of the classifier.

5. A facial image recognition device, characterized in that: The face image recognition device comprises: An image acquisition module, used to acquire a face image to be recognized; An image recognition module, used for sequentially inputting the face image to be recognized into N classifiers arranged in series according to a preset order, calculating the feature similarity between the face image to be recognized and the sample image pre-stored in the sample library in the i-th classifier, obtaining the similarity data of the i-th classifier, and determining the recognition result of the i-th classifier according to the similarity data, wherein i is an integer greater than 0 and less than or equal to N; A result output module, configured to use the target sample image identified by the i-th classifier as the matching result of the face image to be identified if the recognition result of the i-th classifier is successful; A result determination module, for voting on the obtained similarity data of the N classifiers based on a weighted voting algorithm if the recognition results of the N classifiers are all recognition failures, and determining the matching result of the face image to be recognized according to the voting result; The result determination module includes: A sequence generating unit is used for, if the recognition results of N classifiers are all recognition failures, then, according to the similarity data of each classifier, in the order of feature similarity from large to small, sorting the sample images corresponding to the feature similarity, generating a feature similarity sequence corresponding to each classifier, and obtaining N feature similarity sequences, wherein each feature similarity sequence includes M positions from a starting position to an ending position, each position corresponds to a sample image element, the sample image element corresponding to the starting position is the sample image corresponding to the maximum feature similarity, and the sample image element corresponding to the ending position is the sample image corresponding to the minimum feature similarity; The element selection unit is used to select the first k sample image elements as the basic image elements for each feature similarity sequence, and obtain a total of basic image elements, where k is an integer greater than 0 and less than or equal to M; The vote counting unit is used to Among the basic image elements, count the number of times each basic image element appears, and use the number of times each basic image element appears as the number of votes for each basic image element; An element determination unit, configured to, if the basic image element corresponding to the maximum value in the vote number is unique, use the sample image corresponding to the basic image element as the matching result of the face image to be identified; A weight calculation unit, for, if there are A basic image elements corresponding to the maximum value in the number of votes, taking the A basic image elements as target image elements, and calculating the weight score of each target image element according to the preset weight value of each position in the feature similarity sequence and the position of each target image element in the feature similarity sequence containing the target image element, wherein A is a positive integer greater than 1 and less than k, and the preset weight value of each position in the feature similarity sequence increases in sequence from the starting position to the ending position; The target acquisition unit is used to acquire the target image element corresponding to the minimum value of the weight score, and use the sample image corresponding to the target image element as the matching result of the face image to be identified.

6. The facial image recognition device according to claim 5, characterized in that: The image recognition module comprises: A feature extraction unit, configured to extract facial features of the face image to be identified according to the model definition of the i-th classifier, and obtain a facial feature vector of the face image to be identified; A data calculation unit, used for calculating the feature similarity between the facial feature vector and the sample feature vector corresponding to each of the sample images in the i-th classifier, and using the obtained M feature similarities as the similarity data of the i-th classifier, wherein M is the number of the sample images; an identification output unit, configured to determine that the identification result of the i-th classifier is the sample image corresponding to the feature similarity with the largest value among the M feature similarities obtained, if the feature similarity with the largest value among the M feature similarities obtained is greater than or equal to the target threshold preset by the i-th classifier; The identification and determination unit is used to determine that the identification result of the i-th classifier is empty if the feature similarity with the largest value among the M feature similarities obtained is less than the target threshold.

7. The facial image recognition device according to claim 5, characterized in that: The face image recognition device also includes: A sample processing module, used for inputting each of the sample images in the sample library into each of the classifiers to extract sample features, and obtaining a sample feature vector corresponding to each of the sample images in each of the classifiers; A threshold acquisition module is used to calculate, in each of the classifiers, the basic error rate corresponding to each of the h preset basic thresholds of the classifier according to the sample feature vector corresponding to each of the sample images in the classifier, and use the basic threshold corresponding to the basic error rate equal to zero as the target threshold of the classifier, wherein h is an integer greater than 0.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the face image recognition method according to any one of claims 1 to 4 are implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the face image recognition method according to any one of claims 1 to 4 are implemented.