A facial image matching method, device, electronic device and storage medium

By using an automatic encoder model in face image matching, high-quality face images to be matched are filtered out and matched with the face library, the problem of low accuracy of face image matching in the prior art is solved, and a higher matching accuracy is achieved.

CN114038031BActive Publication Date: 2025-03-28ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111267784.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2025-03-28
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

In the prior art, the accuracy of face image matching is low, mainly due to inconsistent image capture quality.

Method used

By acquiring each face image in the personnel trajectory data, the pre-trained autoencoder model determines the loss value of each first face image, and filters out the second face image to be matched based on the loss value, and matches it with each face image in the face library to determine the identity information of the person.

Benefits of technology

The accuracy of face image matching is improved. Through the use of the automatic encoder model, images with higher matching degree with face images in the face library can be more effectively screened.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114038031B_ABST
    Figure CN114038031B_ABST
Patent Text Reader

Abstract

The present invention discloses a facial image matching method, device, electronic device and storage medium, the method comprising: obtaining each facial image in personnel trajectory data, determining each first facial image to be matched according to each facial image; inputting each first facial image into a pre-trained autoencoder model, determining the loss value corresponding to each first facial image based on the autoencoder model, and determining the second facial image to be matched according to the loss value corresponding to each first facial image; wherein the autoencoder model is trained based on each facial image in a facial library; matching the second facial image to be matched with each facial image in the facial library to determine the identity information of the person. The accuracy of facial image matching is improved.
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 matching method, device, electronic equipment and storage medium. Background Art

[0002] With the advancement of science and technology and the need for convenience, various face recognition applications have become popular, including face recognition for unlocking, opening doors, security checks, boarding, staying in hotels, paying for medical treatment, etc. The above-mentioned face recognition applications collect people's trajectory data, which includes facial images and the time and place of facial image collection. How to make good use of these trajectory data and make them have a positive impact on social progress and stability, the most important step is to file the identities of the people corresponding to the facial images in these trajectory data.

[0003] Traditional facial image recognition is to select any collected facial image, then compare the feature values ​​of the selected facial image with the standard base image (ID card picture), and when a certain threshold is met, it is determined to match the ID card. However, due to the influence of the image capture scene, the image capture quality is uneven, resulting in a low accuracy rate of facial image matching. Summary of the invention

[0004] The embodiments of the present invention provide a face image matching method, device, electronic device and storage medium to solve the problem of low face image matching accuracy in the prior art.

[0005] An embodiment of the present invention provides a face image matching method, the method comprising:

[0006] Acquire each facial image in the personnel trajectory data, and determine each first facial image to be matched according to each facial image;

[0007] Input each of the first face images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first face images based on the autoencoder model, and determine the second face image to be matched according to the loss value corresponding to each of the first face images; wherein the autoencoder model is trained based on each face image in the face library;

[0008] The second face image to be matched is matched with each face image in the face library to determine the identity information of the person.

[0009] Further, the acquiring each facial image in the personnel trajectory data and determining each first facial image to be matched according to each facial image comprises:

[0010] A similarity calculation is performed between each face image and the archive image in each archive, each face image is divided into a corresponding target archive group according to the similarity calculation result, and each first face image to be matched is selected from the target archive group.

[0011] Further, performing similarity calculation between each face image and the archive image in each archive, and classifying each face image into a corresponding target archive group according to the similarity calculation result comprises:

[0012] For each of the archives, selecting a preset second number of archive images from the archives as archive images to be matched;

[0013] A similarity calculation is performed between each face image and each to-be-matched file image in each file, and each face image is divided into a corresponding target file group according to the similarity calculation result.

[0014] Further, selecting each first face image to be matched from the target file group includes:

[0015] According to the attribute characteristics of each image in the target archive group, the quality score of each image is determined, and a preset second number of images with high quality scores are selected as each first face image to be matched.

[0016] Further, determining the quality score of each image according to the attribute characteristics of each image in the target archive group includes:

[0017] For each image in the target file group, the attribute feature value corresponding to each attribute feature of the image is determined, and the quality score of the image is determined according to the attribute feature value corresponding to each attribute feature of the image and the preset weight value corresponding to each attribute feature.

[0018] Further, determining the loss value corresponding to each first face image based on the autoencoder model includes:

[0019] For each of the first facial images, the first facial image is decoded based on the autoencoder model, and then re-encoded to obtain a reconstructed first image, and the loss value corresponding to the first facial image is determined according to the feature information of the first facial image and the feature information of the reconstructed first image.

[0020] Further, determining the second face image to be matched according to the loss value corresponding to each first face image includes:

[0021] Determine whether there is a first facial image whose loss value is less than a preset loss threshold; if so, determine the first facial image whose loss value is less than the preset loss threshold as the second facial image to be matched; if not, determine the first facial image with the smallest loss value as the second facial image to be matched.

[0022] Further, matching the second face image to be matched with each face image in the face library to determine the identity information of the person includes:

[0023] Determine the similarity between each second facial image to be matched and each facial image in the face library, and determine the target facial image with the greatest similarity to each second facial image to be matched;

[0024] If there is a target face image with a similarity greater than a preset first threshold, the identity information of the target face image with a similarity greater than the preset first threshold is determined as the identity information of the person;

[0025] If the determined maximum similarity is less than a preset second similarity threshold, it is determined that the match fails;

[0026] If the determined maximum similarity is between a preset second similarity threshold and a preset first similarity threshold, the identity information of the target facial image with the largest number of repetitions among the target facial images determined to have the maximum similarity to each of the second facial images to be matched is determined as the identity information of the person;

[0027] The preset second similarity threshold is smaller than the preset first similarity threshold.

[0028] Furthermore, the training process of the autoencoder model includes:

[0029] For each face image in the face library, the face image is input into the autoencoder model, the face image is decoded based on the autoencoder model, and then re-encoded to obtain a reconstructed second image, and the loss value corresponding to the face image is determined according to the feature information of the face image and the feature information of the reconstructed second image; the autoencoder model is trained according to the loss value corresponding to each face image in the face library.

[0030] On the other hand, an embodiment of the present invention provides a face image matching device, the device comprising:

[0031] A first determination module is used to obtain each facial image in the personnel trajectory data, and determine each first facial image to be matched according to each facial image;

[0032] A second determination module is used to input each of the first facial images into a pre-trained autoencoder model, determine a loss value corresponding to each of the first facial images based on the autoencoder model, and determine a second facial image to be matched according to the loss value corresponding to each of the first facial images; wherein the autoencoder model is trained based on each facial image in the face library;

[0033] The third determination module is used to match the second face image to be matched with each face image in the face library to determine the identity information of the person.

[0034] The first determination module is specifically used to calculate the similarity between each facial image and the archive image in each archive, divide each facial image into a corresponding target archive group according to the similarity calculation result, and select each first facial image to be matched from the target archive group.

[0035] The first determination module is specifically used to select a preset second number of archive images from the archive as archive images to be matched for each archive; calculate the similarity between each face image and each archive image to be matched in each archive, and divide each face image into a corresponding target archive group according to the similarity calculation result.

[0036] The first determination module is specifically used to determine the quality score of each image in the target file group according to the attribute characteristics of each image, and select a preset second number of images with high quality scores as each first face image to be matched.

[0037] The first determination module is specifically used to determine, for each image in the target archive group, an attribute feature value corresponding to each attribute feature of the image, and determine a quality score of the image based on the attribute feature value corresponding to each attribute feature of the image and a preset weight value corresponding to each attribute feature.

[0038] The second determination module is specifically used to decode each first facial image based on the autoencoder model, and then re-encode it to obtain a reconstructed first image, and determine the loss value corresponding to the first facial image based on the feature information of the first facial image and the feature information of the reconstructed first image.

[0039] The second determination module is specifically used to determine whether there is a first facial image with a loss value less than a preset loss threshold; if so, the first facial image with a loss value less than the preset loss threshold is determined as the second facial image to be matched; if not, the first facial image with the smallest loss value is determined as the second facial image to be matched.

[0040] The third determination module is specifically used to determine the similarity between each second facial image to be matched and each facial image in the face library, and determine the target facial image with the greatest similarity to each second facial image to be matched; if there is a target facial image with a similarity greater than a preset first similarity threshold, the identity information of the target facial image greater than the preset first similarity threshold is determined as the identity information of the person; if the determined maximum similarity is less than the preset second similarity threshold, it is determined that the match fails; if the determined maximum similarity is between the preset second similarity threshold and the preset first similarity threshold, the identity information of the target facial image with the largest number of repetitions among the target facial images with the greatest similarity to each second facial image to be matched is determined as the identity information of the person; wherein, the preset second similarity threshold is less than the preset first similarity threshold.

[0041] The device shown also includes:

[0042] The training module is used to input each face image in the face library into the autoencoder model, decode the face image based on the autoencoder model, and then re-encode it to obtain a reconstructed second image, determine the loss value corresponding to the face image according to the feature information of the face image and the feature information of the reconstructed second image; and train the autoencoder model according to the loss value corresponding to each face image in the face library.

[0043] In another aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0044] Memory, used to store computer programs;

[0045] The processor is used to implement any of the method steps described above when executing the program stored in the memory.

[0046] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of the above are implemented.

[0047] An embodiment of the present invention provides a facial image matching method, device, electronic device and storage medium, the method comprising: obtaining each facial image in personnel trajectory data, and determining each first facial image to be matched based on each facial image; inputting each first facial image into a pre-trained autoencoder model, determining a loss value corresponding to each first facial image based on the autoencoder model, and determining a second facial image to be matched based on the loss value corresponding to each first facial image; wherein the autoencoder model is trained based on each facial image in a face library; matching the second facial image to be matched with each facial image in the face library to determine the identity information of the person.

[0048] The above technical solution has the following advantages or beneficial effects:

[0049] After obtaining each face image in the personnel trajectory data and determining each first face image to be matched based on each face image, the loss value corresponding to each first face image is determined based on the pre-trained autoencoder model, and the second face image to be matched is determined based on the loss value corresponding to each first face image. In this way, the second face image to be matched that has a higher degree of matching with the face image in the face library can be screened out. Then, the second face image to be matched is matched with each face image in the face library to determine the identity information of the person. In this way, the accuracy of face image matching is improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0051] Figure 1 A schematic diagram of a facial image matching process provided in Example 1 of the present invention;

[0052] Figure 2 A schematic diagram of a facial image matching process provided in Embodiment 3 of the present invention;

[0053] Figure 3 A schematic diagram of an identity matching process based on a selected image provided in Embodiment 3 of the present invention;

[0054] Figure 4 A schematic diagram of determining the corresponding identity of a person provided in Example 3 of the present invention;

[0055] Figure 5 A schematic diagram of the structure of a face image matching device provided in Embodiment 4 of the present invention;

[0056] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Example 5 of the present invention. DETAILED DESCRIPTION

[0057] The present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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.

[0058] Embodiment 1:

[0059] Figure 1 A schematic diagram of a face image matching process provided by an embodiment of the present invention, the process includes the following steps:

[0060] S101: Acquire each facial image in the personnel trajectory data, and determine each first facial image to be matched according to each facial image.

[0061] S102: Input each of the first facial images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first facial images based on the autoencoder model, and determine the second facial image to be matched according to the loss value corresponding to each of the first facial images; wherein the autoencoder model is trained based on each facial image in the face library.

[0062] S103: Match the second face image to be matched with each face image in the face library to determine the identity information of the person.

[0063] The face image matching method provided by the embodiment of the present invention is applied to an electronic device, which may be a PC, a tablet computer, a server or the like.

[0064] In the embodiment of the present invention, the person trajectory data is collected by face recognition applications such as face recognition for unlocking, face recognition for door opening, face recognition for security check, face recognition for boarding, face recognition for hotel check-in, face recognition for medical treatment payment, etc., and the electronic device obtains each face image in the person trajectory data. Then, each face image can be used as each first face image to be matched.

[0065] The electronic device is pre-trained with an autoencoder model, wherein the autoencoder model is trained based on each face image in the face library. Specifically, the training process of the autoencoder model includes: for each face image in the face library, the face image is input into the autoencoder model, the face image is decoded based on the autoencoder model, and then re-encoded to obtain a reconstructed second image, and the loss value corresponding to the face image is determined according to the feature information of the face image and the feature information of the reconstructed second image; and the autoencoder model is trained according to the loss value corresponding to each face image in the face library.

[0066] Input each first facial image into a pre-trained autoencoder model, determine the loss value corresponding to each first facial image based on the autoencoder model, and determine the second facial image to be matched according to the loss value corresponding to each first facial image. Optionally, the first facial image corresponding to the smallest loss value is determined as the second facial image to be matched, or a preset number of first facial images with smaller loss values ​​are determined as the second facial images to be matched. Match the second facial image to be matched with each facial image in the facial library to determine the identity information of the person.

[0067] Specifically, determining the loss value corresponding to each first facial image based on the autoencoder model includes: for each first facial image, decoding the first facial image based on the autoencoder model, and then re-encoding to obtain a reconstructed first image, and determining the loss value corresponding to the first facial image based on feature information of the first facial image and feature information of the reconstructed first image.

[0068] In the embodiment of the present invention, after obtaining each facial image in the personnel trajectory data and determining each first facial image to be matched based on each facial image, the loss value corresponding to each first facial image is determined based on the pre-trained autoencoder model, and the second facial image to be matched is determined based on the loss value corresponding to each first facial image. Thus, the second facial image to be matched that has a higher degree of matching with the facial image in the face library can be screened out. Then, the second facial image to be matched is matched with each facial image in the face library to determine the identity information of the person. Thus, the accuracy of facial image matching is improved.

[0069] Embodiment 2:

[0070] In order to make the determination of each first face image to be matched more accurate, based on the above embodiment, in an embodiment of the present invention, the step of obtaining each face image in the personnel trajectory data and determining each first face image to be matched according to each face image includes:

[0071] A similarity calculation is performed between each face image and the archive image in each archive, each face image is divided into a corresponding target archive group according to the similarity calculation result, and each first face image to be matched is selected from the target archive group.

[0072] The electronic device calculates the similarity between each face image and the archive image in each existing archive. If there is an archive image whose similarity with the face image is greater than a preset similarity threshold, the face image is divided into a corresponding target archive group. It should be noted that the same face image may be divided into different target archive groups. It is also possible that the similarity between the archive image in each archive and the face image is not greater than the preset similarity threshold. In this case, a new archive group is created and the face image is divided into the newly created archive group. Calculating the similarity between each face image and the archive image in each archive, and dividing each face image into a corresponding target archive group according to the similarity calculation result includes: for each archive, selecting a preset second number of archive images from the archive as archive images to be matched; calculating the similarity between each face image and each archive image to be matched in each archive, and dividing each face image into a corresponding target archive group according to the similarity calculation result. Among them, the preset second number of archive images with good quality can be selected as archive images to be matched.

[0073] The electronic device divides each facial image into a corresponding target file group according to the above method, and then selects each first facial image to be matched from each target file group. Among them, a file image with the best quality can be selected from each target file group as the first facial image to be matched, or several file images with better quality can be selected from each target file group as the first facial image to be matched. It should be noted that the selected first facial image to be matched may be a facial image in the personnel trajectory data, or it may be an existing file image in the target file group. Selecting a file image with good quality from each target file group as the first facial image to be matched may be selecting a file image with high definition as the first facial image to be matched.

[0074] Preferably, selecting each first face image to be matched from the target file group includes:

[0075] According to the attribute characteristics of each image in the target archive group, the quality score of each image is determined, and a preset second number of images with higher quality scores are selected as each first face image to be matched.

[0076] The attribute features of each image in the target archive group include image clarity, face angle, whether wearing a mask, whether wearing sunglasses, whether wearing a hat, and face size. For clarity attribute, the higher the clarity, the clearer the image; for face angle in the image, the smaller the value, the more positive the face angle; whether wearing a mask, whether wearing sunglasses, and whether wearing a hat, these three attributes indicate whether the face is covered. The greater the proportion of the face covered, the fewer features of the face and the lower the similarity with the identity information image; for face size in the image, the larger the face, the closer it is to the camera and the more information captured. In other words, the higher the clarity, the higher the attribute feature value; the smaller the face angle, the larger the attribute feature value; the attribute feature value of not wearing a mask, not wearing sunglasses, and not wearing a hat is higher than the attribute feature value of wearing a mask, wearing sunglasses, and wearing a hat; the larger the face, the larger the attribute feature value.

[0077] The quality score of each image is determined according to the attribute feature value corresponding to the attribute feature of each image in the target archive group. For example, for each image, the attribute feature value corresponding to the attribute feature of the image is added to obtain the quality score of the image.

[0078] Preferably, determining the quality score of each image according to the attribute features of each image in the target archive group includes: for each image in the target archive group, determining the attribute feature value corresponding to each attribute feature of the image, and determining the quality score of the image according to the attribute feature value corresponding to each attribute feature of the image and a preset weight value corresponding to each attribute feature.

[0079] A corresponding weight value is assigned to each attribute feature, and for each image, the attribute feature value corresponding to the attribute feature of the image and the weight value are weighted and summed to obtain the quality score of the image.

[0080] After determining the quality score of each image according to the attribute feature value corresponding to the attribute feature of each image in the target file group, the quality score of each image is sorted from high to low, and then a preset second number of images with high quality scores are selected as each first face image to be matched.

[0081] In the embodiment of the present invention, the similarity calculation is performed between each face image and the archive image in each archive, each face image is divided into a corresponding target archive group according to the similarity calculation result, the quality score of each image is determined according to the attribute characteristics of each image in the target archive group, and a preset second number of images with high quality scores are selected as each first face image to be matched. Therefore, each first face image to be matched is determined more accurately.

[0082] Embodiment 3:

[0083] On the basis of the above embodiments, in an embodiment of the present invention, determining the second face image to be matched according to the loss value corresponding to each first face image includes:

[0084] Determine whether there is a first facial image whose loss value is less than a preset loss threshold; if so, determine the first facial image whose loss value is less than the preset loss threshold as the second facial image to be matched; if not, determine the first facial image with the smallest loss value as the second facial image to be matched.

[0085] The embodiments of the present invention provide two methods for determining the second facial image to be matched according to the loss value corresponding to each first facial image. The first method: if there is a first facial image whose loss value is less than a preset loss threshold, the first facial image whose loss value is less than the preset loss threshold is determined as the second facial image to be matched. At this time, the second facial image to be matched determined may be one or more. The second method: if there is no first facial image whose loss value is less than the preset loss threshold, the first facial image with the smallest loss value is determined as the second facial image to be matched. At this time, one second facial image to be matched is determined.

[0086] In the embodiment of the present invention, matching the second face image to be matched with each face image in the face library to determine the identity information of the person includes:

[0087] Determine the similarity between each second facial image to be matched and each facial image in the face library, and determine the target facial image with the greatest similarity to each second facial image to be matched;

[0088] If there is a target face image with a similarity greater than a preset first threshold, the identity information of the target face image with a similarity greater than the preset first threshold is determined as the identity information of the person;

[0089] If the determined maximum similarity is less than a preset second similarity threshold, it is determined that the match fails;

[0090] If the determined maximum similarity is between a preset second similarity threshold and a preset first similarity threshold, the identity information of the target facial image with the largest number of repetitions among the target facial images determined to have the maximum similarity to each of the second facial images to be matched is determined as the identity information of the person;

[0091] The preset second similarity threshold is smaller than the preset first similarity threshold.

[0092] In an embodiment of the present invention, after determining the second facial image to be matched, the similarity between each second facial image to be matched and each facial image in the face library is determined. It should be noted that the number of second facial images to be matched may be one or more. If there are multiple second facial images to be matched, then for each second facial image to be matched, the similarity between the second facial image to be matched and each facial image in the face library is determined. From the face library, a target facial image with the greatest similarity to each second facial image to be matched is determined. If there is a target facial image with a similarity greater than a preset first similarity threshold, the identity information of the target facial image with a similarity greater than the preset first similarity threshold is determined as the identity information of the person. If the determined maximum similarity is less than the preset second similarity threshold, it is determined that the match fails. Wherein, the preset second similarity threshold is less than the preset first similarity threshold.

[0093] If the determined maximum similarity is between the preset second similarity threshold and the preset first similarity threshold, the identity information of the target facial image with the largest number of repetitions among the target facial images with the greatest similarity to each second facial image to be matched is determined as the identity information of the person.

[0094] The process of face image matching is described in detail below with reference to the accompanying drawings.

[0095] Figure 2 A schematic diagram of a face image matching process provided by an embodiment of the present invention, the process includes:

[0096] S201: Obtain clustering files of different portraits.

[0097] S202: Perform a preliminary screening based on the attributes of the archive images.

[0098] S203: Feature reconstruction, removing images with abnormal loss values.

[0099] S204: Perform identity matching based on the optimized images.

[0100] The specific process of obtaining clustering files of different portraits is as follows.

[0101] Obtain the trajectory sequence data of a person within a period of time and a spatial range, such as the trajectory (A1, A2, A3, A4, A5) generated by person A's activities on the day. A1 includes the time and area of ​​capture, as well as the features of the captured image and other information.

[0102] The similarity of the image features of the person's trajectory is calculated and compared with the previously existing file features in the order of activity time. For example, the image features of person A's trajectory A1 are taken to calculate the similarity with the features of all files. If the similarity calculated with the B file meets the preset threshold, A1 is included in the B file. If all files are traversed and the threshold is not met, a new file C is created and A1 is included in the C file.

[0103] Repeat steps 1 and 2 until the facial activity trajectories of all persons are archived.

[0104] The specific process of initial screening based on the attributes of archival images is as follows.

[0105] Get the file information of person A, and get the image attribute features of a picture in the file of person A, which are mainly the attribute features of the following six dimensions, namely, the clarity attribute of the picture. The higher the clarity, the clearer the picture; the face angle of the picture. The smaller the value, the more positive the face angle; whether wearing a mask, whether wearing sunglasses, and whether wearing a hat. These three attributes indicate whether the face is obscured. The greater the proportion of the face being obscured, the fewer the features of the face, and the lower the similarity with the identity information picture; the face size of the picture. The larger the face size, the closer it is to the camera and the more information captured.

[0106] The attributes of the facial image in step 1 can be identified through model training, such as a deep convolutional network (Resnet, etc.). The image is sent to a trained model to obtain the above facial features.

[0107] After obtaining the facial features, the score of the face image is calculated. The score represents the possibility of a picture being selected. The higher the score, the greater the possibility of the picture being selected. The score can be calculated according to the following formula:

[0108] Score = ω a * Clarity + ω b *Face angle+ω c *Mask score + ω d *Sunglasses score+ω e *Hat score + ω f * Face size.

[0109] where ω x They represent the weight of each attribute respectively, and clarity, face angle, etc. are also normalized attribute scores.

[0110] After obtaining the scores of all pictures in person A's file, sort them from high to low according to the scores, and select one-third of the total number X of all pictures in the file as pending pictures. If one-third of the number of pictures in the file is less than two, two pictures are selected as pending pictures. If one-third of the number of pictures in the file is greater than five, only five pictures are selected as pending pictures.

[0111] The specific process of feature reconstruction and removing images with abnormal loss values ​​is as follows.

[0112] The training set used for training the autoencoder model is a collection of ID card images. The autoencoder is an unsupervised training model that first decodes the image features and then re-encodes them, hoping to obtain new encoded features that are the same as the original image features or have a smaller loss gap. The training goal of the autoencoder is to minimize the value of the loss function. The loss function is as follows, where λ∑ j |h j | is the regularization term, W j h j is the reconstructed feature, and the loss function is to find the square difference between the reconstructed features and the original features of all samples. The optimization goal of the model is to minimize the error between the reconstructed samples and the original samples of all samples.

[0113] L(X;W)=∑ j ||W j h j -X j || 2 +λ∑ j |h j |.

[0114] During the training process, the autoencoder can learn the spatial distribution of the ID card picture, so the trained autoencoder can be used to identify the pending pictures preliminarily screened in the file in S102. If the loss of the pending picture obtained by model recognition is less than the set threshold, it is considered that the pending picture is in the spatial distribution of the ID card picture, and the pending picture has a greater possibility of matching with the ID card picture. When calculating the similarity with the ID card, there is a greater confidence that the similarity between the pending picture and the ID card picture is credible.

[0115] All pending images of person A are passed through the autoencoder to obtain the loss. If the loss is less than the threshold, it is considered to be the final preferred image. If there is no image with a loss less than the threshold in a file, it is sorted according to the loss and the image with the smallest loss is taken as the preferred image.

[0116] The specific process of identity matching based on the optimized image is as follows: Figure 3 shown.

[0117] Get all the preferred pictures in person A's file that have been identified by the automatic encoder, calculate the similarity between each picture and all the ID card databases, and return the ID card number and similarity that ranks top 1 in similarity to each picture.

[0118] Perform logical judgment. If the similarity between any picture in person A's file and a certain ID card is greater than or equal to the first threshold, it is considered that person A and the ID card are the same person and are matched directly; if the similarity between a picture in person A's file and the ID card is between the first threshold and the second threshold, perform the next step of judgment, where the value of the first threshold is greater than the second threshold.

[0119] Obtain all pictures in file A whose similarity with the ID card is between the second threshold and the first threshold and the corresponding ID card, determine the number of acquisitions, and if the number of acquisitions is less than two, skip directly; otherwise, determine that the identity information corresponding to two or more preferred pictures is equal, then it is considered that person A has a corresponding relationship with the identity information, and match person A with the ID card.

[0120] by Figure 4 For example, for person A, if there are five preferred pictures, namely preferred picture a, preferred picture b, preferred picture c, preferred picture d, and preferred picture e, preferred pictures a, b, and c correspond to identity a, preferred picture d corresponds to identity b, and preferred picture e corresponds to identity c. The identity information with the largest number of repetitions is identity a, so it is determined that person A corresponds to identity a.

[0121] The face image matching method provided by the embodiment of the present invention trains the ID card data through an autoencoder to obtain the spatial distribution of the ID card image features. The trained autoencoder is used to identify abnormal face images. If the image reconstructed by the autoencoder has a large reconstruction error, it is considered that it does not conform to the spatial distribution of the ID card and usually has a low degree of matching with the ID card. The screened images are used for ID card matching, and some voting strategies are used to enhance the accuracy of ID card matching.

[0122] Embodiment 4:

[0123] Figure 5 A schematic diagram of the structure of a face image matching device provided by an embodiment of the present invention, the device comprising:

[0124] A first determination module 51 is used to obtain each face image in the personnel trajectory data, and determine each first face image to be matched according to each face image;

[0125] A second determination module 52 is used to input each of the first facial images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first facial images based on the autoencoder model, and determine the second facial image to be matched according to the loss value corresponding to each of the first facial images; wherein the autoencoder model is trained based on each facial image in the face library;

[0126] The third determination module 53 is used to match the second face image to be matched with each face image in the face database to determine the identity information of the person.

[0127] The first determination module 51 is specifically used to select a preset second number of archive images from the archive as archive images to be matched for each archive; calculate the similarity between each facial image and each archive image to be matched in each archive, and divide each facial image into a corresponding target archive group according to the similarity calculation result.

[0128] The first determination module 51 is specifically used to calculate the similarity between each facial image and the archive image in each archive, divide each facial image into a corresponding target archive group according to the similarity calculation result, and select each first facial image to be matched from the target archive group.

[0129] The first determination module 51 is specifically used to determine, for each image in the target file group, an attribute feature value corresponding to each attribute feature of the image, and determine a quality score of the image based on the attribute feature value corresponding to each attribute feature of the image and a preset weight value corresponding to each attribute feature.

[0130] The first determination module 51 is specifically configured to determine the quality score of each image in the target file group according to the attribute characteristics of each image, and select a preset second number of images with high quality scores as each first face image to be matched.

[0131] The second determination module 52 is specifically used to decode each first facial image based on the autoencoder model, and then re-encode it to obtain a reconstructed first image, and determine the loss value corresponding to the first facial image according to the feature information of the first facial image and the feature information of the reconstructed first image.

[0132] The second determination module 52 is specifically used to determine whether there is a first facial image with a loss value less than a preset loss threshold; if so, the first facial image with a loss value less than the preset loss threshold is determined as the second facial image to be matched; if not, the first facial image with the smallest loss value is determined as the second facial image to be matched.

[0133] The third determination module 53 is specifically used to determine the similarity between each second facial image to be matched and each facial image in the face library, and determine the target facial image with the greatest similarity to each second facial image to be matched; if there is a target facial image with a similarity greater than a preset first similarity threshold, the identity information of the target facial image greater than the preset first similarity threshold is determined as the identity information of the person; if the determined maximum similarity is less than the preset second similarity threshold, it is determined that the match fails; if the determined maximum similarity is between the preset second similarity threshold and the preset first similarity threshold, the identity information of the target facial image with the largest number of repetitions among the target facial images with the greatest similarity to each second facial image to be matched is determined as the identity information of the person; wherein, the preset second similarity threshold is less than the preset first similarity threshold.

[0134] The device shown also includes:

[0135] The training module 54 is used to input each facial image in the face library into the autoencoder model, decode the facial image based on the autoencoder model, and then re-encode it to obtain a reconstructed second image, determine the loss value corresponding to the facial image according to the feature information of the facial image and the feature information of the reconstructed second image; and train the autoencoder model according to the loss value corresponding to each facial image in the face library.

[0136] Embodiment 5:

[0137] Based on the above embodiments, an electronic device is also provided in an embodiment of the present invention, such as Figure 6 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;

[0138] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps:

[0139] Acquire each facial image in the personnel trajectory data, and determine each first facial image to be matched according to each facial image;

[0140] Input each of the first face images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first face images based on the autoencoder model, and determine the second face image to be matched according to the loss value corresponding to each of the first face images; wherein the autoencoder model is trained based on each face image in the face library;

[0141] The second face image to be matched is matched with each face image in the face library to determine the identity information of the person.

[0142] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present invention. Since the principle of solving the problem by the above electronic device is similar to that of the face image matching method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0143] The electronic device provided in the embodiment of the present invention may specifically be a desktop computer, a portable computer, a smart phone, a tablet computer, a personal digital assistant (PDA), a network side device, etc.

[0144] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0145] The communication interface 302 is used for communication between the electronic device and other devices.

[0146] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0147] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0148] In the embodiment of the present invention, when the processor executes the program stored in the memory, each facial image in the personnel trajectory data is obtained, and each first facial image to be matched is determined according to each facial image; each first facial image is input into the pre-trained autoencoder model, and the loss value corresponding to each first facial image is determined based on the autoencoder model, and the second facial image to be matched is determined according to the loss value corresponding to each first facial image; wherein the autoencoder model is trained based on each facial image in the face library; the second facial image to be matched is matched with each facial image in the face library to determine the identity information of the person. After obtaining each facial image in the personnel trajectory data and determining each first facial image to be matched according to each facial image, the loss value corresponding to each first facial image is determined based on the pre-trained autoencoder model, and the second facial image to be matched is determined according to the loss value corresponding to each first facial image. Thus, the second facial image to be matched with a higher degree of matching with the facial image in the face library can be screened out. Then the second facial image to be matched is matched with each facial image in the face library to determine the identity information of the person. Thereby improving the accuracy of face image matching.

[0149] Embodiment 6:

[0150] On the basis of the above embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, wherein the computer readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:

[0151] Acquire each facial image in the personnel trajectory data, and determine each first facial image to be matched according to each facial image;

[0152] Input each of the first face images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first face images based on the autoencoder model, and determine the second face image to be matched according to the loss value corresponding to each of the first face images; wherein the autoencoder model is trained based on each face image in the face library;

[0153] The second face image to be matched is matched with each face image in the face library to determine the identity information of the person.

[0154] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present invention. Since the principle of solving the problem when the processor executes the computer program stored on the above-mentioned computer-readable storage medium is similar to that of the face image matching method, the implementation of the processor when executing the computer program stored on the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0155] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.

[0156] A computer program is stored in a computer-readable storage medium provided in an embodiment of the present invention. When the computer program is executed by a processor, each facial image in the personnel trajectory data is obtained, and each first facial image to be matched is determined according to each facial image; each first facial image is input into a pre-trained autoencoder model, and the loss value corresponding to each first facial image is determined based on the autoencoder model, and the second facial image to be matched is determined according to the loss value corresponding to each first facial image; wherein the autoencoder model is trained based on each facial image in the face library; the second facial image to be matched is matched with each facial image in the face library to determine the identity information of the person. After obtaining each facial image in the personnel trajectory data and determining each first facial image to be matched according to each facial image, the loss value corresponding to each first facial image is determined based on the pre-trained autoencoder model, and the second facial image to be matched is determined according to the loss value corresponding to each first facial image. Thus, the second facial image to be matched with a higher degree of matching with the facial image in the face library can be screened out. Then the second facial image to be matched is matched with each facial image in the face library to determine the identity information of the person. Thereby improving the accuracy of face image matching.

[0157] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0158] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0159] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0160] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0161] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A facial image matching method, characterized in that: The method comprises: Obtain each face image in the personnel trajectory data, perform similarity calculation between each face image and the file image in each file, divide each face image into a corresponding target file group according to the similarity calculation result, and select each first face image to be matched from the target file group; Input each of the first face images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first face images based on the autoencoder model, and judge whether there is a first face image with a loss value less than a preset loss threshold; if there is, determine the first face image with a loss value less than the preset loss threshold as the second face image to be matched; if there is not, determine the first face image with the smallest loss value as the second face image to be matched; wherein the autoencoder model is trained based on each face image in the face library; The second face image to be matched is matched with each face image in the face library to determine the identity information of the person.

2. The method according to claim 1, characterized in that Calculating the similarity between each face image and the archive images in each archive, and dividing each face image into a corresponding target archive group according to the similarity calculation result comprises: For each of the archives, selecting a preset second number of archive images from the archives as archive images to be matched; A similarity calculation is performed between each face image and each to-be-matched file image in each file, and each face image is divided into a corresponding target file group according to the similarity calculation result.

3. The method according to claim 1, characterized in that Selecting each first face image to be matched from the target file group includes: According to the attribute characteristics of each image in the target archive group, the quality score of each image is determined, and a preset second number of images with high quality scores are selected as each first face image to be matched.

4. The method according to claim 3, characterized in that Determining the quality score of each image according to the attribute characteristics of each image in the target archive group includes: For each image in the target file group, the attribute feature value corresponding to each attribute feature of the image is determined, and the quality score of the image is determined according to the attribute feature value corresponding to each attribute feature of the image and the preset weight value corresponding to each attribute feature.

5. The method according to claim 1, characterized in that Determining the loss value corresponding to each first face image based on the autoencoder model includes: For each of the first facial images, the first facial image is decoded based on the autoencoder model, and then re-encoded to obtain a reconstructed first image, and the loss value corresponding to the first facial image is determined according to the feature information of the first facial image and the feature information of the reconstructed first image.

6. The method according to claim 1, characterized in that Matching the second face image to be matched with each face image in the face database to determine the identity information of the person includes: Determine the similarity between each second facial image to be matched and each facial image in the face library, and determine the target facial image with the greatest similarity to each second facial image to be matched; If there is a target face image with a similarity greater than a preset first threshold, the identity information of the target face image with a similarity greater than the preset first threshold is determined as the identity information of the person; If the determined maximum similarity is less than a preset second similarity threshold, it is determined that the match fails; If the determined maximum similarity is between a preset second similarity threshold and a preset first similarity threshold, the identity information of the target facial image with the largest number of repetitions among the target facial images determined to have the maximum similarity to each of the second facial images to be matched is determined as the identity information of the person; The preset second similarity threshold is smaller than the preset first similarity threshold.

7. The method according to claim 1, characterized in that The training process of the autoencoder model includes: For each face image in the face library, the face image is input into the autoencoder model, the face image is decoded based on the autoencoder model, and then re-encoded to obtain a reconstructed second image, and the loss value corresponding to the face image is determined according to the feature information of the face image and the feature information of the reconstructed second image; the autoencoder model is trained according to the loss value corresponding to each face image in the face library.

8. A facial image matching device, characterized in that: The device comprises: A first determination module is used to obtain each face image in the personnel trajectory data, perform similarity calculation between each face image and the file image in each file, divide each face image into a corresponding target file group according to the similarity calculation result, and select each first face image to be matched from the target file group; A second determination module is used to input each of the first facial images into a pre-trained autoencoder model, determine the loss value corresponding to each of the first facial images based on the autoencoder model, and judge whether there is a first facial image with a loss value less than a preset loss threshold; if there is, determine the first facial image with a loss value less than the preset loss threshold as the second facial image to be matched; if not, determine the first facial image with the smallest loss value as the second facial image to be matched; wherein the autoencoder model is trained based on each facial image in the face library; The third determination module is used to match the second face image to be matched with each face image in the face library to determine the identity information of the person.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN112991152A

  • Technologies for transferring visual attributes to images

    US20210019541A1