Face retrieval methods and related products

By using preset algorithms and neural network models to optimize face images in face recognition, the problem of low accuracy of face recognition in natural environments is solved and the recognition accuracy is significantly improved.

CN112487232BActive Publication Date: 2024-10-01SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910859645.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-11
Publication Date
2024-10-01
Estimated Expiration
2039-09-11

AI Technical Summary

Technical Problem

The accuracy of face recognition under unconstrained conditions is low, mainly due to the variability of pose, age, occlusion, lighting conditions and expression of the face image, which prevents the recognition accuracy from reaching a high level.

Method used

A preset algorithm is used to search for target face images in the database, the similarity value is optimized through a neural network model, and images larger than the preset threshold are selected for secondary operations and reordering to improve face retrieval accuracy.

Benefits of technology

The first search results are optimized through the neural network model, which significantly improves the accuracy of face recognition and improves the recognition performance in natural environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112487232B_ABST
    Figure CN112487232B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a face retrieval method and related products, wherein the method includes: obtaining a target face image; using a preset algorithm to search the target face image in a preset database to obtain P similarity values, wherein the preset database includes P images; selecting Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtaining images corresponding to the Q similarity values, to obtain Q first retrieval images; inputting the Q first retrieval images and the target face image into a preset neural network model for operation, to obtain Q operation results, each operation result corresponding to a first retrieval image; selecting an operation result greater than a second preset threshold from the Q operation results, to obtain N target operation results, and obtaining images corresponding to the N target operation results, to obtain N second retrieval images; outputting N second retrieval images. The embodiment of the present application can improve the image retrieval accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of face recognition technology, and in particular to a face retrieval method and related products. Background Art

[0002] Face recognition is a popular area of ​​computer technology research. It belongs to biometric recognition technology, which is the technology that can identify or verify the identity of the subject in an image or video by distinguishing the biological characteristics of the organism (generally referring to humans) itself. The first face recognition algorithm was born in the early 1970s. Since then, their accuracy has been greatly improved. The potential application range of face recognition is wider because it can also be deployed in environments where users do not expect to cooperate with the system, such as surveillance systems. Other common applications of face recognition include access control, fraud detection, identity authentication and social media.

[0003] When deployed in an unconstrained environment, face recognition is one of the most challenging biometrics methods due to the high variability of face images in the real world (such face images are often referred to as natural faces). Since face images are variable in terms of head pose, age, occlusion, lighting conditions, and facial expressions, the accuracy of face recognition cannot be very high. Therefore, the problem of how to improve the accuracy of face retrieval needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present application provide a face retrieval method and related products, which can improve the accuracy of face recognition.

[0005] In a first aspect, an embodiment of the present application provides a face retrieval method, the method comprising:

[0006] Get the target face image;

[0007] Using a preset algorithm to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images;

[0008] Selecting Q similarity values ​​greater than a first preset threshold from the P similarity values, and acquiring images corresponding to the Q similarity values ​​to obtain Q first search images, where Q is an integer less than P and greater than 1;

[0009] Inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, each operation result corresponding to a first search image;

[0010] Selecting operation results greater than a second preset threshold from the Q operation results to obtain N target operation results, and acquiring images corresponding to the N target operation results to obtain N second search images, where N is a positive integer less than Q;

[0011] The N second search images are output.

[0012] In a second aspect, an embodiment of the present application provides a face retrieval device, the device comprising:

[0013] An acquisition unit, used for acquiring a target face image;

[0014] A search unit, configured to use a preset algorithm to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images;

[0015] A first selection unit is used to select Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first search images, where Q is an integer less than P and greater than 1;

[0016] A computing unit, used for inputting the Q first search images and the target face image into a preset neural network model for computing, and obtaining Q computing results, each computing result corresponding to a first search image;

[0017] A second selection unit is used to select a calculation result greater than a second preset threshold from the Q calculation results to obtain N target calculation results, and obtain images corresponding to the N target calculation results to obtain N second search images, where N is a positive integer less than Q;

[0018] An output unit is used to output the N second search images.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiment of the present application.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0022] The implementation of the embodiments of the present application has the following beneficial effects:

[0023] It can be seen that the face retrieval method and related products described in the embodiments of the present application obtain a target face image, use a preset algorithm to search the target face image in a preset database, obtain P similarity values, P is an integer greater than 1, and the preset database includes P images, select Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first retrieval images, Q is an integer less than P and greater than 1, input the Q first retrieval images and the target face image into a preset neural network model for calculation, obtain Q calculation results, each calculation result corresponds to a first retrieval image, select a calculation result greater than a second preset threshold from the Q calculation results, obtain N target calculation results, and obtain images corresponding to the N target calculation results to obtain N second retrieval images, N is a positive integer less than Q, and output N second retrieval images. In this way, the first retrieval result can be optimized through the neural network model, which helps to improve the accuracy of face retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1A It is a flowchart of a face retrieval method provided in an embodiment of the present application;

[0026] Figure 1B It is a schematic diagram of the structure of a recurrent neural network RNN ​​provided in an embodiment of the present application;

[0027] Figure 2 It is a flowchart of another face retrieval method provided in an embodiment of the present application;

[0028] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0029] Figure 4This is a block diagram of the functional units of a face retrieval device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0032] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0033] The electronic devices involved in the embodiments of the present application may include various handheld devices with wireless communication functions, vehicle-mounted devices, wearable devices (smart watches, smart bracelets, wireless headphones, augmented reality / virtual reality devices, smart glasses), servers, computing devices or other processing devices connected to wireless modems, as well as various forms of user equipment (UE), mobile stations (MS), terminal devices, etc. For the convenience of description, the above-mentioned devices are collectively referred to as electronic devices.

[0034] The following is a detailed description of the embodiments of the present application.

[0035] See also Figure 1A , Figure 1A FIG. 1 is a flow chart of a face retrieval method provided in an embodiment of the present application. As shown in the figure, the face retrieval method includes:

[0036] 101. Obtain a target face image.

[0037] In the embodiment of the present application, the target face image may be an image including only the face area, or may be a full-body or half-body image of a person. Of course, the target face image may also be an image of the target object wearing sunglasses or a mask, or may be a face image taken with multiple exposures or in a dark environment.

[0038] In a possible example, the above step 101, obtaining the target face image, may include the following steps:

[0039] 11. Get the target shooting distance between the target object and the camera;

[0040] 12. Determine a target zoom parameter according to the target shooting distance;

[0041] 13. Obtain target environment parameters;

[0042] 14. Determine target shooting parameters corresponding to the target environment parameters;

[0043] 15. Shoot according to the target zoom parameter and the target shooting parameter to obtain the target face image.

[0044] Among them, in the embodiment of the present application, the target environmental parameter can be at least one of the following: environmental brightness, weather (such as: heavy rain, foggy day, sunny day, snowy day, etc.), magnetic field interference intensity, number of light sources, etc., which are not limited here, and the shooting parameter can be at least one of the following: exposure time, sensitivity, white balance parameter, exposure compensation parameter, defogging parameter, etc., which are not limited here. The target object can be a person. In a specific implementation, the electronic device can obtain the target shooting distance between the target object and the camera, and the mapping relationship between the shooting distance and the zoom parameter can be pre-stored in the electronic device, and then, the target shooting parameter corresponding to the target environmental parameter can be determined based on the mapping relationship. The electronic device can also obtain the target environmental parameter, and the mapping relationship between the environmental parameter and the shooting parameter can be pre-stored in the electronic device, and then, the target shooting parameter corresponding to the target environmental parameter is determined based on the mapping relationship. Further, shooting is performed according to the target zoom parameter and the target shooting parameter to obtain the target face image.

[0045] 102. Use a preset algorithm to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images.

[0046] The preset algorithm may be at least one of the following: Hamming distance, Euclidean distance, cosine distance, structural similarity index measurement (SSIM), etc., which are not limited here. A preset database may be pre-stored in the electronic device, and a large number of pictures may be stored in the preset database. For example, the electronic device may be connected to multiple cameras, each of which may be used to take pictures, and a large number of images may be obtained. Faces may be extracted from these images to obtain a large number of face images, and these face images may constitute the preset database. In a specific implementation, the preset database may include P images, where P is an integer greater than 1. The electronic device may use a preset algorithm to search the target face image in the preset database to obtain P similarity values, and each of the P images corresponds to a similarity value.

[0047] In a possible example, the above step 102, using a preset algorithm to search the target face image in a preset database to obtain P similarity values, may include the following steps:

[0048] 21. Perform feature extraction on the target face image to obtain a first feature set;

[0049] 22. Perform image segmentation on each image in the preset database to obtain P individual face region images;

[0050] 23. Perform feature extraction on each of the P face region images to obtain P second feature sets;

[0051] 24. Calculate the feature distance between the first feature set and each of the P second feature sets to obtain P feature distances;

[0052] 25. Determine the P similarity values ​​based on the P feature distances.

[0053] Among them, the electronic device can perform feature extraction on the target face image to obtain a first feature set, and the specific implementation method of the feature extraction is at least one of the following: Harris corner detection, scale invariant feature transform (SIFT), SURF algorithm, etc., which are not limited here. Further, the electronic device can also perform image segmentation on each image in the preset database to obtain P personal face area images, each image corresponds to a face area image, and perform feature extraction on each face area image in the P personal face area images to obtain P second feature sets, and then, the feature distance between the first feature set and each second feature set in the P second feature sets can be calculated to obtain P feature distances, and the electronic device can pre-store the mapping relationship between the feature distance and the similarity value, and then, based on the mapping relationship, the similarity value corresponding to each feature distance in the P feature distances can be determined to obtain P similarity values.

[0054] 103. Select Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first retrieval images, where Q is an integer less than P and greater than 1.

[0055] Among them, the first preset threshold can be set by the user or by the system default, and the electronic device can select Q similarity values ​​greater than the first preset threshold from the P similarity values, for example, first select the maximum value, then select the second largest value, and so on, or the electronic device can sort the P similarity values ​​in descending order, and select some similarity values ​​at the top of the P similarity values, such as TOP Q (100), to obtain Q similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first retrieval images, where Q is an integer less than P and greater than 1.

[0056] 104. Input the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, each operation result corresponding to a first search image.

[0057] The preset neural network model can be at least one of the following: convolutional neural network, recurrent neural network (RNN), Deep Lab algorithm, etc., which are not limited here. In a specific implementation, the electronic device can input Q first search images and target face images into the preset neural network model for operation to obtain Q operation results, each of which corresponds to a first search image. In this way, it is equivalent to re-determining the similarity between the Q first search images and the target face image.

[0058] In a possible example, the above step 104, inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, may include the following steps:

[0059] 41. Obtain identification information of each of the Q first search images to obtain Q pieces of identification information;

[0060] 42. Obtain a feature set in each of the Q first search images to obtain Q feature sets;

[0061] 43. Constructing the Q identification information and the Q feature sets into Q merged feature sets, each merged feature set including identification information and feature set of a unique first search image;

[0062] 44. Input the Q merged feature sets and the target face image into the preset neural network model for operation to obtain the Q operation results, where each merged feature set corresponds to one operation result.

[0063] Among them, the above-mentioned identification information can be at least one of the following: the sorting position of the first search image, the matching position (such as: which feature points in the image have been successfully matched by the preset algorithm), etc., which are not limited here. In a specific implementation, the electronic device can obtain the identification information in each of the Q first search images to obtain Q identification information, and can obtain the feature set of each of the Q first search images to obtain Q feature sets, which may include feature points or feature lines. Further, the Q identification information and the Q feature sets can be constituted into Q merged feature sets, each merged feature set includes the identification information and feature set of a unique first search image, and then, the Q merged feature sets and the target face image can be input into the preset neural network model for operation to obtain Q operation results, each merged feature set corresponds to a operation result, and the operation result is the similarity value. Since the above supervised training is carried out through secondary supervised learning, the label information can be fully utilized and more information can be learned, so the performance of face recognition will be better than the previous method.

[0064] In a possible example, the above step 42, obtaining the feature set in each of the Q first retrieval images to obtain Q feature sets, may include the following steps:

[0065] 421. Acquire all feature points in the first search image i to obtain M feature points, where the first search image i is any first search image among the Q first search images, and M is an integer greater than 1;

[0066] 422. Determine the modulus of each feature point in the M feature points to obtain M moduli;

[0067] 423. Determine a maximum comparison value between each feature point in the M feature points and a corresponding feature point in the target face image, and obtain M maximum comparison values;

[0068] 424. The M moduli and the M maximum comparison values ​​are used to form M feature parameter groups, each feature point corresponds to one feature parameter group, and each feature parameter group includes a modulus and a maximum comparison value;

[0069] 425. Select a target feature parameter group whose modulus is within the first preset range and whose maximum comparison value is within the second preset range from the M feature parameter groups, to obtain K target feature parameter groups, where K is a positive integer less than M.

[0070] 426. Use the feature points corresponding to the K target feature parameter groups as the feature set of the first retrieval image i.

[0071] Among them, the above-mentioned first preset range and second preset range can be set by the user or by the system default. Taking the first search image i as an example, the first search image i is any search image among the Q first search images. The electronic device can obtain all the feature points in the first search image i and obtain M feature points. Then, since each feature point can be regarded as a vector, that is, including size and direction, the modulus of each feature point in the M feature points can be determined to obtain M moduli, each feature point corresponds to a modulus, and M is an integer greater than 1. Then, the maximum comparison value between each feature point in the M feature points and the corresponding feature point in the target face image can be determined. Since each feature point in the M feature points has been compared with each feature point in the target face image, the target face The number of comparison values ​​obtained is the same as the number of feature points in the image. The maximum comparison value corresponding to each feature point can be selected. The M moduli and the M maximum comparison values ​​can be used to form M feature parameter groups. Each feature point corresponds to a feature parameter group. Each feature parameter group includes a modulus and a maximum comparison value. A target feature parameter group whose modulus is within a first preset range and whose maximum comparison value is within a second preset range is selected from the M feature parameter groups to obtain K target feature parameter groups, where K is an integer greater than 1 and less than M. Furthermore, the feature points corresponding to the K target feature parameter groups can be used as the feature set of the first retrieval image i. In this way, robust feature points can be screened out.

[0072] 105. Select operation results greater than a second preset threshold from the Q operation results to obtain N target operation results, and obtain images corresponding to the N target operation results to obtain N second retrieval images, where N is a positive integer less than Q.

[0073] Among them, the above-mentioned second preset threshold can be set by the user or by the system default. In a specific implementation, the electronic device can select a calculation result greater than the second preset threshold from Q calculation results, obtain N target calculation results, and obtain the images corresponding to the N target calculation results to obtain N second retrieval images, where N is a positive integer less than Q. Conversely, if all the calculation results among the Q calculation results are less than or equal to the second preset threshold, it means that the retrieval has failed.

[0074] 106. Output the N second search images.

[0075] Specifically, the N second search images may be displayed, for example, by displaying the N second search images in descending order according to the calculation results.

[0076] In the specific implementation, since the traditional face recognition method is to perform face recognition by detecting and intercepting the face in the image, preprocessing the image of the face part, feature extraction, similarity calculation and final classification. This traditional method can actually achieve good classification in the recognition of many scenes, but there are still some recognition errors. Based on this, the embodiment of the present application is based on the feature output of the traditional face feature extraction model, such as extracting the top 100 similar feature faces, performing secondary reordering, using label information, using the RNN (Recurrent Neural Networks) network structure for modeling, and re-outputting the feature importance sequence, so that the accuracy of face recognition is further improved. Since the embodiment of the present application focuses on optimizing the reordering stage after the feature extraction output, the accuracy of face recognition technology is improved.

[0077] The face retrieval method described in the above embodiment of the present application is specifically as follows:

[0078] First, a network model for extracting facial image features is trained through a large number of face images with category labels. In the actual use stage, the image is input into the network model to extract the feature vector of the image, and then the similarity is compared with the faces in the database to obtain the top 100 similar facial features. Each face image corresponds to an identification information ID. It is determined whether the ID appears in the top 100 faces. If it does, the top 100 features are saved and two lists of length 100 are created. One table L1 records the matching position, and the matching face position is recorded as 1, and the non-matching is recorded as 0.1. The other table L2 records the Euclidean distance d n , n∈[1,100]; otherwise, if it does not appear, skip it.

[0079] Secondly, build the dataset module: save the top 100 features and the corresponding ID features in the previous step, x q The feature representing the ID, xdn represents the topn features n∈[1,100], x q,dn Indicates the combination of ID and topn features.

[0080] Furthermore, by introducing the gated recurrent unit (GRU) in the RNN, the gradient disappearance is prevented. Input the combined feature x q, d n , after forward prediction by the RNN network, the output Score (i.e. similarity value) is compared with the label d n *L1 performs loss calculation, back propagation, and training of the entire model. The RNN training process is as follows Figure 1B As shown, the RNN operation results can be sorted at last, and images corresponding to operation results greater than a second preset threshold value can be selected from the sorted operation results.

[0081] Among them, through the above supervised training, we can learn the internal rules and replace the original Euclidean distance d with the size of the score. n Compared with the original method (directly using the Euclidean distance between features for classification), this re-ranking method performs secondary supervised learning, which can make full use of the label information and learn more information. Therefore, it has better performance in face recognition than the previous method.

[0082] In a possible example, the following steps may be further included between step 101 and step 102:

[0083] A1, performing image segmentation on the target face image to obtain a face area image;

[0084] A2, performing feature point analysis on the face area image;

[0085] A3, dividing the face region image into a plurality of regions, each region having an equal area;

[0086] A4. Determine the distribution density of feature points in each of the multiple regions to obtain multiple feature point distribution density values;

[0087] A5. Selecting a feature point distribution density value that is less than a preset feature point distribution density value from the multiple feature point distribution density values ​​to obtain at least one feature point distribution density value;

[0088] A6. Determine at least one target image enhancement parameter corresponding to the at least one feature point distribution density value according to a preset mapping relationship between image enhancement parameters corresponding to feature point distribution density values, wherein each feature point distribution density value corresponds to a target image enhancement parameter;

[0089] A7. Perform image enhancement processing on the area corresponding to the at least one feature point distribution density value according to the at least one target image enhancement parameter to obtain the target face image after image enhancement processing.

[0090] In a specific implementation, the preset feature point distribution density value can be set by the user or by the system default. The electronic device can perform image segmentation on the target face image to obtain a face area image, that is, an image that only includes the face, and then perform feature point analysis on the face area image to divide the face area image into multiple areas, each of which can be equal in area. Further, the feature point distribution density of each of the multiple areas can be determined to obtain multiple feature point distribution densities, and a feature point distribution density value that is less than the preset feature point distribution density value is selected from the multiple feature point distribution density values ​​to obtain at least one feature point distribution density value. The electronic device can pre-store the mapping relationship between the image enhancement parameters corresponding to the preset feature point distribution density values, and the image enhancement parameters can include an image enhancement algorithm identifier and a corresponding control parameter. The image enhancement algorithm may be at least one of the following: grayscale stretching, histogram equalization, smoothing, wavelet transform, etc., which are not limited here. Furthermore, at least one target image enhancement parameter corresponding to at least one feature point distribution density value may be determined based on the mapping relationship, and each feature point distribution density value corresponds to a target image enhancement parameter. Image enhancement processing is performed on a region corresponding to at least one feature point distribution density value according to the at least one target image enhancement parameter to obtain a target face image after image enhancement processing. The target face image after image enhancement processing is then applied to steps 102 and 104. In this way, image enhancement processing can be performed on the face image in a targeted manner, which is helpful to improve the accuracy of face retrieval.

[0091] It can be seen that the face retrieval method described in the embodiment of the present application obtains a target face image, uses a preset algorithm to search the target face image in a preset database, obtains P similarity values, P is an integer greater than 1, and the preset database includes P images, selects Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtains images corresponding to the Q similarity values ​​to obtain Q first retrieval images, Q is an integer less than P and greater than 1, inputs the Q first retrieval images and the target face image into a preset neural network model for calculation, obtains Q calculation results, each calculation result corresponds to a first retrieval image, selects a calculation result greater than a second preset threshold from the Q calculation results, obtains N target calculation results, and obtains images corresponding to the N target calculation results to obtain N second retrieval images, N is a positive integer less than Q, and outputs N second retrieval images. In this way, the first retrieval result can be optimized through the neural network model, which helps to improve the accuracy of face retrieval.

[0092] With the above Figure 1A For the embodiments shown, please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of a face retrieval method provided in an embodiment of the present application. As shown in the figure, the face retrieval method includes:

[0093] 201. Obtain a target face image.

[0094] 202. Obtain identity authentication information.

[0095] The identity verification information may be at least one of the following: voiceprint information, fingerprint information, iris information, character string, pattern, sliding track, etc., which are not limited here.

[0096] 203. When the identity authentication information is successfully verified, a preset algorithm is used to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images.

[0097] 204. Select Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first retrieval images, where Q is an integer less than P and greater than 1.

[0098] 205. Input the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, each operation result corresponding to a first search image.

[0099] 206. Select operation results greater than a second preset threshold from the Q operation results to obtain N target operation results, and obtain images corresponding to the N target operation results to obtain N second retrieval images, where N is a positive integer less than Q.

[0100] 207. Output the N second search images.

[0101] The specific description of the above steps 201 to 207 can refer to the above Figure 1A The corresponding steps of the described face retrieval method will not be repeated here.

[0102] It can be seen that the face retrieval method described in the embodiment of the present application obtains a target face image and identity authentication information. When the identity authentication information is successfully verified, a preset algorithm is used to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images. Q similarity values ​​greater than a first preset threshold are selected from the P similarity values, and images corresponding to the Q similarity values ​​are obtained to obtain Q first retrieval images, where Q is an integer less than P and greater than 1. The Q first retrieval images and the target face image are input into a preset neural network model for calculation to obtain Q calculation results, each calculation result corresponding to a first retrieval image, and a calculation result greater than a second preset threshold is selected from the Q calculation results to obtain N target calculation results, and images corresponding to the N target calculation results are obtained to obtain N second retrieval images, where N is a positive integer less than Q, and N second retrieval images are output. In this way, the first retrieval result can be optimized through the neural network model, which helps to improve the accuracy of face retrieval.

[0103] In accordance with the above embodiment, please refer to Figure 3 , Figure 3 : is a structural diagram of an electronic device provided in an embodiment of the present application. As shown in the figure, the electronic device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. In the embodiment of the present application, the program includes instructions for executing the following steps:

[0104] Get the target face image;

[0105] Using a preset algorithm to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images;

[0106] Selecting Q similarity values ​​greater than a first preset threshold from the P similarity values, and acquiring images corresponding to the Q similarity values ​​to obtain Q first search images, where Q is an integer less than P and greater than 1;

[0107] Inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, each operation result corresponding to a first search image;

[0108] Selecting operation results greater than a second preset threshold from the Q operation results to obtain N target operation results, and acquiring images corresponding to the N target operation results to obtain N second search images, where N is a positive integer less than Q;

[0109] The N second search images are output.

[0110] It can be seen that the electronic device described in the embodiment of the present application obtains a target face image, uses a preset algorithm to search the target face image in a preset database, obtains P similarity values, P is an integer greater than 1, and the preset database includes P images, selects Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtains images corresponding to the Q similarity values ​​to obtain Q first retrieval images, Q is an integer less than P and greater than 1, inputs the Q first retrieval images and the target face image into a preset neural network model for calculation, obtains Q calculation results, each calculation result corresponds to a first retrieval image, selects a calculation result greater than a second preset threshold from the Q calculation results, obtains N target calculation results, and obtains images corresponding to the N target calculation results to obtain N second retrieval images, N is a positive integer less than Q, and outputs N second retrieval images. In this way, the first retrieval result can be optimized through the neural network model, which helps to improve the accuracy of face retrieval.

[0111] In a possible example, in the aspect of using a preset algorithm to search the target face image in a preset database to obtain P similarity values, the program includes instructions for executing the following steps:

[0112] Performing feature extraction on the target face image to obtain a first feature set;

[0113] Performing image segmentation on each image in the preset database to obtain P individual face region images;

[0114] Extracting features from each of the P facial region images to obtain P second feature sets;

[0115] Calculating a feature distance between the first feature set and each of the P second feature sets to obtain P feature distances;

[0116] The P similarity values ​​are determined according to the P feature distances.

[0117] In a possible example, in the aspect of inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, the program includes instructions for executing the following steps:

[0118] Acquire identification information of each of the Q first search images to obtain Q pieces of identification information;

[0119] Acquire a feature set in each of the Q first retrieval images to obtain Q feature sets;

[0120] Constructing the Q identification information and the Q feature sets into Q merged feature sets, each merged feature set including identification information and a feature set of a unique first search image;

[0121] The Q merged feature sets and the target face image are input into the preset neural network model for operation to obtain the Q operation results, where each merged feature set corresponds to one operation result.

[0122] In a possible example, in the aspect of acquiring the feature set in each of the Q first retrieval images to obtain Q feature sets, the program includes instructions for performing the following steps:

[0123] Acquire all feature points in the first search image i to obtain M feature points, where the first search image i is any first search image among the Q first search images, and M is an integer greater than 1;

[0124] Determine the modulus of each feature point in the M feature points to obtain M moduli;

[0125] Determine the maximum comparison value between each feature point in the M feature points and the corresponding feature point in the target face image, and obtain M maximum comparison values;

[0126] The M moduli and the M maximum comparison values ​​constitute M feature parameter groups, each feature point corresponds to a feature parameter group, and each feature parameter group includes a modulus and a maximum comparison value;

[0127] Selecting a target feature parameter group whose modulus is within a first preset range and whose maximum comparison value is within a second preset range from the M feature parameter groups, to obtain K target feature parameter groups, wherein K is a positive integer less than M;

[0128] The feature points corresponding to the K target feature parameter groups are used as the feature set of the first retrieval image i.

[0129] In a possible example, in the aspect of acquiring the target face image, the above program includes instructions for executing the following steps:

[0130] Get the target shooting distance between the target object and the camera;

[0131] Determining a target zoom parameter according to the target shooting distance;

[0132] Get target environment parameters;

[0133] Determining target shooting parameters corresponding to the target environment parameters;

[0134] Shooting is performed according to the target zoom parameter and the target shooting parameter to obtain the target face image.

[0135] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0136] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0137] Figure 4 4 is a functional unit block diagram of a face retrieval device 400 involved in an embodiment of the present application. The face retrieval device 400 comprises: an acquisition unit 401, a search unit 402, a first selection unit 403, a calculation unit 404, a second selection unit 405 and an output unit 406, wherein:

[0138] An acquisition unit 401 is used to acquire a target face image;

[0139] A search unit 402 is used to search the target face image in a preset database using a preset algorithm to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images;

[0140] A first selection unit 403 is used to select Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first search images, where Q is an integer less than P and greater than 1;

[0141] A computing unit 404 is used to input the Q first search images and the target face image into a preset neural network model for computing to obtain Q computing results, each computing result corresponding to a first search image;

[0142] A second selection unit 405 is used to select a calculation result greater than a second preset threshold from the Q calculation results to obtain N target calculation results, and obtain images corresponding to the N target calculation results to obtain N second search images, where N is a positive integer less than Q;

[0143] The output unit 406 is configured to output the N second search images.

[0144] It can be seen that the face retrieval device described in the embodiment of the present application obtains a target face image, uses a preset algorithm to search the target face image in a preset database, obtains P similarity values, P is an integer greater than 1, and the preset database includes P images, selects Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtains images corresponding to the Q similarity values ​​to obtain Q first retrieval images, Q is an integer less than P and greater than 1, inputs the Q first retrieval images and the target face image into a preset neural network model for calculation, obtains Q calculation results, each calculation result corresponds to a first retrieval image, selects a calculation result greater than a second preset threshold from the Q calculation results, obtains N target calculation results, and obtains images corresponding to the N target calculation results to obtain N second retrieval images, N is a positive integer less than Q, and outputs N second retrieval images. In this way, the first retrieval result can be optimized through the neural network model, which helps to improve the accuracy of face retrieval.

[0145] In a possible example, in the aspect of using a preset algorithm to search the target face image in a preset database to obtain P similarity values, the search unit 402 is specifically used to:

[0146] Performing feature extraction on the target face image to obtain a first feature set;

[0147] Performing image segmentation on each image in the preset database to obtain P individual face region images;

[0148] Extracting features from each of the P facial region images to obtain P second feature sets;

[0149] Calculating a feature distance between the first feature set and each of the P second feature sets to obtain P feature distances;

[0150] The P similarity values ​​are determined according to the P feature distances.

[0151] In a possible example, in the aspect of inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, the operation unit 404 is specifically used to:

[0152] Acquire identification information of each of the Q first search images to obtain Q pieces of identification information;

[0153] Acquire a feature set in each of the Q first retrieval images to obtain Q feature sets;

[0154] Constructing the Q identification information and the Q feature sets into Q merged feature sets, each merged feature set including identification information and a feature set of a unique first search image;

[0155] The Q merged feature sets and the target face image are input into the preset neural network model for operation to obtain the Q operation results, where each merged feature set corresponds to one operation result.

[0156] In a possible example, in acquiring the feature set in each of the Q first retrieval images to obtain Q feature sets, the operation unit 404 is specifically configured to:

[0157] Acquire all feature points in the first search image i to obtain M feature points, where the first search image i is any first search image among the Q first search images, and M is an integer greater than 1;

[0158] Determine the modulus of each feature point in the M feature points to obtain M moduli;

[0159] Determine the maximum comparison value between each feature point in the M feature points and the corresponding feature point in the target face image, and obtain M maximum comparison values;

[0160] The M moduli and the M maximum comparison values ​​constitute M feature parameter groups, each feature point corresponds to a feature parameter group, and each feature parameter group includes a modulus and a maximum comparison value;

[0161] Selecting a target feature parameter group whose modulus is within a first preset range and whose maximum comparison value is within a second preset range from the M feature parameter groups, to obtain K target feature parameter groups, wherein K is a positive integer less than M;

[0162] The feature points corresponding to the K target feature parameter groups are used as the feature set of the first retrieval image i.

[0163] In a possible example, in terms of acquiring the target face image, the acquiring unit 401 is specifically configured to:

[0164] Get the target shooting distance between the target object and the camera;

[0165] Determining a target zoom parameter according to the target shooting distance;

[0166] Get target environment parameters;

[0167] Determining target shooting parameters corresponding to the target environment parameters;

[0168] Shooting is performed according to the target zoom parameter and the target shooting parameter to obtain the target face image.

[0169] It can be understood that the functions of each program module of the face retrieval device of this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0170] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.

[0171] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0172] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0173] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0174] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0175] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0176] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0177] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0178] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0179] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A face retrieval method, characterized in that: The method comprises: Get the target face image; Using a preset algorithm to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images; Selecting Q similarity values ​​greater than a first preset threshold from the P similarity values, and acquiring images corresponding to the Q similarity values ​​to obtain Q first search images, where Q is an integer less than P and greater than 1; Inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, each operation result corresponding to a first search image; Selecting operation results greater than a second preset threshold from the Q operation results to obtain N target operation results, and acquiring images corresponding to the N target operation results to obtain N second search images, where N is a positive integer less than Q; Outputting the N second search images; The step of inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results includes: Acquire identification information of each of the Q first search images to obtain Q pieces of identification information; Acquire a feature set in each of the Q first retrieval images to obtain Q feature sets; Constructing the Q identification information and the Q feature sets into Q merged feature sets, each merged feature set including identification information and a feature set of a unique first search image; Inputting the Q merged feature sets and the target face image into the preset neural network model for operation to obtain the Q operation results, where each merged feature set corresponds to one operation result; The step of obtaining a feature set in each of the Q first search images to obtain Q feature sets includes: Acquire all feature points in the first search image i to obtain M feature points, where the first search image i is any first search image among the Q first search images, and M is an integer greater than 1; Determine the modulus of each feature point in the M feature points to obtain M moduli; Determine the maximum comparison value between each feature point in the M feature points and the corresponding feature point in the target face image, and obtain M maximum comparison values; The M moduli and the M maximum comparison values ​​constitute M feature parameter groups, each feature point corresponds to a feature parameter group, and each feature parameter group includes a modulus and a maximum comparison value; Selecting a target feature parameter group whose modulus is within a first preset range and whose maximum comparison value is within a second preset range from the M feature parameter groups, to obtain K target feature parameter groups, wherein K is a positive integer less than M; The feature points corresponding to the K target feature parameter groups are used as the feature set of the first retrieval image i.

2. The method according to claim 1, characterized in that The method of using a preset algorithm to search the target face image in a preset database to obtain P similarity values ​​includes: Performing feature extraction on the target face image to obtain a first feature set; Performing image segmentation on each image in the preset database to obtain P individual face region images; Extracting features from each of the P facial region images to obtain P second feature sets; Calculating a feature distance between the first feature set and each of the P second feature sets to obtain P feature distances; The P similarity values ​​are determined according to the P feature distances.

3. The method according to claim 1 or 2, characterized in that: The step of obtaining a target face image comprises: Get the target shooting distance between the target object and the camera; Determining a target zoom parameter according to the target shooting distance; Get target environment parameters; Determining target shooting parameters corresponding to the target environment parameters; Shooting is performed according to the target zoom parameter and the target shooting parameter to obtain the target face image.

4. A face retrieval device, characterized in that: The device comprises: An acquisition unit, used for acquiring a target face image; A search unit, configured to use a preset algorithm to search the target face image in a preset database to obtain P similarity values, where P is an integer greater than 1, and the preset database includes P images; A first selection unit is used to select Q similarity values ​​greater than a first preset threshold from the P similarity values, and obtain images corresponding to the Q similarity values ​​to obtain Q first search images, where Q is an integer less than P and greater than 1; A computing unit, used for inputting the Q first search images and the target face image into a preset neural network model for computing, and obtaining Q computing results, each computing result corresponding to a first search image; A second selection unit is used to select a calculation result greater than a second preset threshold from the Q calculation results to obtain N target calculation results, and obtain images corresponding to the N target calculation results to obtain N second search images, where N is a positive integer less than Q; An output unit, used for outputting the N second search images; Wherein, in the aspect of inputting the Q first search images and the target face image into a preset neural network model for operation to obtain Q operation results, the operation unit is specifically used for: Acquire identification information of each of the Q first search images to obtain Q pieces of identification information; Acquire a feature set in each of the Q first retrieval images to obtain Q feature sets; Constructing the Q identification information and the Q feature sets into Q merged feature sets, each merged feature set including identification information and a feature set of a unique first search image; Inputting the Q merged feature sets and the target face image into the preset neural network model for operation to obtain the Q operation results, where each merged feature set corresponds to one operation result; Wherein, in the aspect of acquiring the feature set in each of the Q first retrieval images to obtain Q feature sets, the operation unit is specifically used for: Acquire all feature points in the first search image i to obtain M feature points, where the first search image i is any first search image among the Q first search images, and M is an integer greater than 1; Determine the modulus of each feature point in the M feature points to obtain M moduli; Determine the maximum comparison value between each feature point in the M feature points and the corresponding feature point in the target face image, and obtain M maximum comparison values; The M moduli and the M maximum comparison values ​​constitute M feature parameter groups, each feature point corresponds to a feature parameter group, and each feature parameter group includes a modulus and a maximum comparison value; Selecting a target feature parameter group whose modulus is within a first preset range and whose maximum comparison value is within a second preset range from the M feature parameter groups, to obtain K target feature parameter groups, wherein K is a positive integer less than M; The feature points corresponding to the K target feature parameter groups are used as the feature set of the first retrieval image i.

5. The device according to claim 4, characterized in that In the aspect of using a preset algorithm to search the target face image in a preset database to obtain P similarity values, the search unit is specifically used to: Performing feature extraction on the target face image to obtain a first feature set; Performing image segmentation on each image in the preset database to obtain P individual face region images; Extracting features from each of the P facial region images to obtain P second feature sets; Calculating a feature distance between the first feature set and each of the P second feature sets to obtain P feature distances; The P similarity values ​​are determined according to the P feature distances.

6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store one or more programs and is configured to be executed by the processor, wherein the program comprises instructions for executing the steps in the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: A computer program for electronic data exchange is stored, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 4.