Face comparison method and apparatus

By training a face comparison model, color and texture features are used to adjust and fill in face images, solving the problem of low comparison accuracy caused by image color differences and improving the accuracy of face comparison.

CN114399802BActive Publication Date: 2025-12-30JILUO TECH (SHANGHAI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111450398.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-12-30
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

In existing technologies, the accuracy of face matching is poor due to differences in image color.

Method used

A face comparison model trained based on sample images and texture labels is adopted. The model extracts face image features, color features, and texture features through a feature extraction layer, and performs color adjustment and texture filling to reduce the impact of color differences and improve the comparison accuracy.

Benefits of technology

By adjusting colors and filling textures, the integrity of facial image features is enhanced, thus improving the accuracy of face comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114399802B_ABST
    Figure CN114399802B_ABST
Patent Text Reader

Abstract

The present application provides a kind of face comparison method and device, method, comprising: obtaining the face image to be identified;Face image to be identified is input into face comparison model, and the face comparison result of face comparison model output is obtained;Wherein, face comparison model is based on sample image and the texture label corresponding to sample image training obtains;Face comparison model is used to carry out color adjustment and texture filling after the face image feature based on the face image feature extracted from face image to be identified, and pre-stored face comparison feature is compared with face.The color feature extracted by face comparison model is used to carry out color adjustment on face image feature in the present application, to eliminate the color difference caused by the difference of image source, and the texture feature extracted by face comparison model is used to carry out texture filling on face image feature, to avoid the loss of texture feature of face image feature caused by the area of color removal, so as to improve the accuracy of subsequent face comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a face comparison method and apparatus. Background Technology

[0002] With the rapid development of internet technology, facial verification has become increasingly important for ensuring user account security. Facial verification, a branch of facial recognition, involves comparing the face to be identified with pre-stored facial images to determine if it belongs to the same person—a "same or not" problem, a one-to-one matching process. The facial verification algorithm first locates the stored facial image based on the claimed identity (such as name or username), then compares the stored image with the image of the person to be identified according to a certain decision or matching principle, thereby determining the authenticity of the person's identity. Facial verification can be widely applied in various scenarios, including internet finance, for verifying user identity via facial recognition.

[0003] In practical applications, due to changes in time and lighting, and because the camera that captures the images may not be the same or of the same type as the camera that captures the pre-stored images, there may be color differences between the captured images and the pre-stored images, which will cause the reliability of the face comparison verification model to drop sharply. Summary of the Invention

[0004] This invention provides a face comparison method and apparatus to address the shortcomings of existing technologies where face comparison accuracy is poor due to differences in image color, thereby reducing the influence of color on face comparison and improving the accuracy of face comparison.

[0005] This invention provides a face comparison method, comprising: acquiring a face image to be identified; inputting the face image to be identified into a face comparison model to obtain a face comparison result output by the face comparison model; wherein, the face comparison model is trained based on a sample image and the texture label corresponding to the sample image; the face comparison model is used to perform face comparison with pre-stored face comparison features after color adjustment and texture filling of the face image features extracted based on the face image to be identified.

[0006] According to a face comparison method provided by the present invention, the face comparison model includes: a feature extraction layer, which extracts features based on an input face image to be identified, and obtains face features to be detected based on the extracted face image features, color features and texture features; and a face comparison layer, which performs face comparison between the face features to be detected and pre-stored face comparison features to obtain a face comparison result.

[0007] According to a face comparison method provided by the present invention, the step of obtaining the face features to be detected based on the extracted face image features, color features, and texture features includes: performing feature extraction based on the input face image to be identified to obtain face image features; performing feature extraction on the face image to be identified to obtain color features and texture features; adjusting the color of the face image features using the color features; and filling the texture of the color-adjusted area using the texture features to obtain the face features to be detected.

[0008] According to a face comparison method provided by the present invention, the feature extraction layer includes: a first convolutional layer, into which the face image to be identified is input to obtain face image features output by the first convolutional layer; a second convolutional layer, into which the face image to be identified is input to the second convolutional layer to obtain color features; a third convolutional layer, into which the face image to be identified is input to the third convolutional layer to obtain texture features; and a fourth convolutional layer, into which the face feature image, the color features, and the texture features are input to the fourth convolutional layer to obtain face features to be detected output by the fourth convolutional layer.

[0009] A face comparison method provided by the present invention further includes: the first convolutional layer and the fourth convolutional layer comprising n convolutional layers; the second convolutional layer and the third convolutional layer being respectively disposed on the first convolutional layer. Any convolutional layer in the array.

[0010] According to a face comparison method provided by the present invention, training the face comparison model includes: acquiring sample images and their corresponding texture labels; using the sample images as input data for training, using the texture labels corresponding to the sample images as labels, and training the model using deep learning to obtain a face comparison model for generating face comparison results of face images to be recognized.

[0011] The present invention also provides a face comparison device, comprising: a data acquisition module for acquiring a face image to be identified; and a face comparison module for inputting the face image to be identified into a face comparison model to obtain a face comparison result output by the face comparison model; wherein the face comparison model is trained based on a sample image and the texture label corresponding to the sample image; the face comparison model is used to perform face comparison with pre-stored face comparison features after color adjustment and texture filling of the face image features extracted based on the face image to be identified.

[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any of the face comparison methods described above.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the face comparison method as described above.

[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the face comparison methods described above.

[0015] The face comparison method and apparatus provided by this invention extract color features, texture features, and face image features of the face image to be identified using a face comparison model. The color features are used to adjust the color of the face image features to eliminate color differences caused by differences in image sources. The texture features are used to fill the texture of the face image features to avoid loss of texture features in areas where color is removed, thereby improving the feature integrity of the face image features and improving the accuracy of subsequent face comparison. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is one of the flowcharts illustrating the face comparison method provided by the present invention;

[0018] Figure 2 This is the second flowchart illustrating the face comparison method provided by the present invention;

[0019] Figure 3 This is one of the flowcharts illustrating the training process of the face comparison model provided by the present invention;

[0020] Figure 4 This is the second schematic diagram of the process for training the face comparison model provided by the present invention;

[0021] Figure 5 This is a schematic diagram of the face comparison device provided by the present invention;

[0022] Figure 6 This is a schematic diagram of the training module provided by the present invention;

[0023] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0025] Figure 1 The diagram illustrates a flow chart of a face comparison method according to the present invention, the method comprising:

[0026] S11, Obtain the image of the face to be identified;

[0027] S12, Input the face image to be identified into the face comparison model to obtain the face comparison result output by the face comparison model;

[0028] Among them, the face comparison model is trained based on sample images and the texture labels corresponding to the sample images;

[0029] The face comparison model is used to compare the face image features extracted from the face image to be identified with the pre-stored face comparison features after color adjustment and texture filling.

[0030] It should be noted that S1N in this manual does not represent the order of face comparison methods. The following details will explain this in conjunction with... Figures 2-4 The face comparison method of the present invention is described.

[0031] Step S11: Obtain the face image to be identified.

[0032] It should be noted that the acquired face image to be identified can be a single-frame face image captured by a camera, or a single-frame face image extracted from a video stream captured by a camera. Furthermore, the acquired face image to be identified should be captured in real-time; that is, when a specific object needs to undergo face verification, the face image of that specific object should be captured immediately and input into the face comparison model for face comparison.

[0033] Step S12: Input the face image to be identified into the face comparison model to obtain the face comparison result output by the face comparison model; wherein, the face comparison model is trained based on the sample image and the texture label corresponding to the sample image; the face comparison model is used to perform face comparison with the pre-stored face comparison features after color adjustment and texture filling of the face image features extracted based on the face image to be identified.

[0034] In this embodiment, the face comparison model includes: a feature extraction layer, which extracts features from the input face image to be identified, and obtains the face features to be detected based on the extracted face image features, color features, and texture features; and a face comparison layer, which compares the face features to be detected with pre-stored face comparison features to obtain the face comparison result. It should be noted that texture features include the contour features and positional features of various key points on the face.

[0035] Specifically, firstly, the feature extraction layer extracts features from the input face image to be identified, and obtains the face features to be detected based on the extracted face image features, color features, and texture features. More specifically, obtaining the face features to be detected based on the extracted face image features, color features, and texture features includes: extracting features from the input face image to be identified to obtain face image features; extracting features from the face image to be identified to obtain color features and texture features; adjusting the color of the face image features using color features; and filling the color-adjusted areas with texture features using texture features to obtain the face features to be detected, thereby reducing the influence of color on face comparison and improving face comparison accuracy.

[0036] In one alternative embodiment, reference Figure 2 The feature extraction layer includes: a first convolutional layer, which inputs the face image to be identified into the first convolutional layer to obtain the face image features output by the first convolutional layer; a second convolutional layer, which inputs the face image to be identified into the second convolutional layer to obtain color features; a third convolutional layer, which inputs the face image to be identified into the third convolutional layer to obtain texture features; and a fourth convolutional layer, which inputs the face feature image, color features, and texture features into the fourth convolutional layer to obtain the face features to be detected output by the fourth convolutional layer.

[0037] In one optional embodiment, the second and third convolutional layers are parallel convolutional layers, which are the same convolutional layer within the first convolutional layer. The first and fourth convolutional layers contain n convolutional layers. In order to make the extracted face image features more accurate, the second and third convolutional layers are selected as convolutional layers after the 0.5nth convolutional layer in the first convolutional layer.

[0038] Specifically, the second and third convolutional layers are located at the th convolutional layers of the first convolutional layer, respectively. or Any convolutional layer in the array, where n represents the total number of the first and fourth convolutional layers. The second and third convolutional layers are parallel convolutional layers. By setting the second and third convolutional layers above any of the aforementioned convolutional layers, the first convolutional layer can fully extract facial image features from the face image to be recognized. This facilitates the second and third convolutional layers to extract color and texture features respectively, improving the accuracy of color and texture feature extraction and thus facilitating subsequent face comparison.

[0039] For example, if the feature extraction layer includes 12 convolutional layers, with the first and fourth convolutional layers having 10 convolutional layers each, and the first convolutional layer having 9 convolutional layers, then the second and third convolutional layers can choose either the 8th or 9th convolutional layer as their branch. This allows the second convolutional layer to extract color features after the first convolutional layer accurately extracts facial image features, and the third convolutional layer to extract texture features. It should be noted that the second and third convolutional layers cannot choose the last convolutional layer; that is, the second and third convolutional layers cannot choose the fourth convolutional layer as their branch.

[0040] In one optional embodiment, the fourth convolutional layer obtains the face features to be detected based on the input face image features, color features, and texture features. Specifically, this includes: subtracting the face image features from the color features to obtain a difference map; and adding the texture features to the difference map to obtain the face image to be detected. It should be noted that when subtracting the face image features from the color features, the color features are used as a mask, and the difference is based on the RGB values ​​of the color features to obtain the face image features after color removal. Similarly, the texture features are added to the difference map to perform texture filling on the face image features after color removal, thus avoiding loss of texture features due to color removal and improving the accuracy of face comparison.

[0041] Secondly, the face comparison layer compares the facial features to be detected with pre-stored face comparison features to obtain the face comparison result. It should be noted that comparing the facial features to be detected with the pre-stored face comparison features includes: calculating the similarity between the facial features to be detected and the pre-stored face comparison features using similarity calculation methods such as Euclidean distance or cosine similarity distance; and obtaining the face comparison result based on the minimum distance calculation result and a preset threshold. It should be noted that if the minimum distance calculation result is less than the preset threshold, the facial features to be detected and the pre-stored face comparison features are determined to be the same facial features, and the face comparison result is "passed".

[0042] It should be noted that the pre-stored facial comparison features are facial features extracted from color images captured by a color camera. These color images can be the color images recorded during user registration or pre-stored color images.

[0043] In another optional embodiment, the process of comparing the face features to be detected with pre-stored face comparison features further includes: clustering the face features to be detected with multiple pre-stored face comparison features using a clustering method; calculating the similarity between the face features to be detected and the face comparison features in the same cluster, thereby obtaining the face comparison result.

[0044] In one alternative embodiment, reference Figure 3 Training a face comparison model includes:

[0045] S31, Obtain the sample image and its corresponding texture label;

[0046] S32, the sample images are used as input data for training, and the texture labels corresponding to the sample images are used as labels. The deep learning method is used for training to obtain a face comparison model used to generate face comparison results for the face images to be recognized.

[0047] Step S31: Obtain the sample image and its corresponding texture label.

[0048] In this embodiment, sample image data can be understood as a collection of image data. This image data can be images of different faces, and of the same face at different angles, under different environmental conditions, and with different pixel colors. The image data stream is usually quite large, reaching millions of images. These sample images are used to train the network to be trained, in order to complete the construction of the model.

[0049] In an optional embodiment, after acquiring the sample image, the method further includes: performing data augmentation on the sample image based on a data augmentation strategy. Specifically, the data augmentation strategy includes at least one of cropping, rotation, translation, flipping, sharpening, illumination, and occlusion. For example, the data augmentation strategy may include cropping, rotation, translation, flipping, sharpening, illumination, or occlusion; or, for instance, the data augmentation strategy may include at least two of cropping, rotation, translation, flipping, sharpening, illumination, and occlusion. By employing at least two data augmentation strategies to augment the acquired samples, the amount of training data for the model can be increased, thereby improving the model's detection accuracy.

[0050] Step S32: The sample images are used as input data for training, and the texture labels corresponding to the sample images are used as labels. The deep learning method is used for training to obtain a face comparison model used to generate face comparison results for the face images to be recognized.

[0051] In this embodiment, reference Figure 4The network to be trained can be an existing network built into the training device, which typically includes a network structure, or it can be other networks specified by the user, such as various neural networks (CNNs). The network to be trained typically includes a feature extraction layer, a face comparison layer, and a loss function. According to a preset iteration rule, the enhanced training data is input into the model to be trained for training, resulting in a trained target recognition model.

[0052] It should be noted that the loss function based on texture labels and extracted texture features can specifically be the cross-entropy function. During the model training process, texture labels are used to supervise the extraction of texture features in order to improve the accuracy of the extracted texture features. In addition, color features are trained using unsupervised learning.

[0053] In summary, the embodiments of the present invention extract color features, texture features, and facial image features from the face image to be identified using a face comparison model. Color features are used to adjust the color of the facial image features to eliminate color differences caused by variations in image sources. Texture features are used to fill the texture of the facial image features to avoid loss of texture features in areas where color has been removed, thereby improving the feature completeness of the facial image features and increasing the accuracy of subsequent face comparisons.

[0054] The face comparison device provided by the present invention will be described below. The face comparison device described below can be referred to in correspondence with the face comparison method described above.

[0055] Figure 5 A schematic diagram of the result of a face comparison device is shown. The device includes:

[0056] Data acquisition module 51 acquires the face image to be identified;

[0057] The face comparison module 52 inputs the face image to be identified into the face comparison model and obtains the face comparison result output by the face comparison model.

[0058] Among them, the face comparison model is trained based on sample images and the texture labels corresponding to the sample images;

[0059] The face comparison model is used to compare the face image features extracted from the face image to be identified with the pre-stored face comparison features after color adjustment and texture filling.

[0060] In this embodiment, when the data acquisition module 51 acquires the face image to be identified, the acquired face image to be identified should be collected in real time. That is, when a specific object needs to be verified by face, the face image of the specific object is collected immediately and input into the face comparison model for face comparison.

[0061] The face comparison module 52 includes: a feature extraction unit, which extracts features from the input face image to be identified, and obtains the face features to be detected based on the extracted face image features, color features, and texture features; and a face comparison unit, which compares the face features to be detected with pre-stored face comparison features to obtain the face comparison result. It should be noted that texture features include the contour features and positional features of various key points on the face.

[0062] Specifically, the feature extraction unit includes: a first convolutional subunit, which extracts features based on the input face image to be identified to obtain face image features; a second convolutional subunit, which extracts features from the face image to be identified to obtain color features; a third convolutional subunit, which extracts features from the face image to be identified to obtain texture features; and a fourth convolutional subunit, which uses color features to adjust the color of the face image features and uses texture features to fill the texture of the color-adjusted areas to obtain the face features to be detected, thereby reducing the influence of color on face comparison and improving the accuracy of face comparison.

[0063] It should be noted that the data acquisition module 11 inputs the face image to be recognized into the first convolutional sub-unit to obtain the face image features output by the first convolutional sub-unit; the second convolutional sub-unit inputs the face image to be recognized into the second convolutional sub-unit to obtain the color features output by the second convolutional sub-unit; the third convolutional sub-unit inputs the face image to be recognized into the third convolutional sub-unit to obtain the texture features output by the third convolutional sub-unit; and the fourth convolutional sub-unit inputs the face feature image, color features, and texture features into the fourth convolutional sub-unit to obtain the face features to be detected output by the fourth convolutional sub-unit.

[0064] In one optional embodiment, the second and third convolutional subunits are parallel convolutional layers, located within the same convolutional layer of the first convolutional subunit. The first and fourth convolutional subunits contain n convolutional layers. To ensure that the extracted facial image features are more accurate, the second and third convolutional subunits are selected as convolutional layers after the 0.5nth convolutional layer in the first convolutional subunit.

[0065] Specifically, the second and third convolutional subunits are located at the first convolutional subunit. or Any convolutional layer in the array, where n represents the total number of the first and fourth convolutional sub-units. The second and third convolutional sub-units are parallel convolutional sub-units. By placing the second and third convolutional sub-units in any of the aforementioned convolutional layers within the first convolutional layer, the first convolutional sub-unit can fully extract facial image features from the face image to be recognized. This facilitates the second and third convolutional sub-units in extracting color and texture features respectively, improving the accuracy of color and texture feature extraction and thus facilitating subsequent face comparison.

[0066] In an optional embodiment, the fourth convolutional subunit specifically includes: a subunit for difference feature extraction, which subtracts the face image features from the color features to obtain a difference map; and a subunit for image acquisition, which adds the texture features to the difference map to obtain the face image to be detected. It should be noted that when subtracting the face image features from the color features, the color features are used as a mask, and the difference is based on the RGB values ​​of the color features to obtain the face image features after color removal. Similarly, the texture features are added to the difference map to perform texture filling on the face image features after color removal, thereby avoiding loss of texture features due to color removal and improving the accuracy of face comparison.

[0067] Secondly, the face comparison unit includes: a similarity calculation subunit, which can use similarity calculation methods such as Euclidean distance or cosine similarity distance to calculate the similarity between the face feature to be detected and the pre-stored face comparison features; and a comparison result acquisition subunit, which obtains the face comparison result based on the minimum distance calculation result and a preset threshold. It should be noted that if the minimum distance calculation result is less than the preset threshold range, it is determined that the face feature to be detected and the pre-stored face comparison features are the same face feature, that is, the face comparison result is a pass.

[0068] In another optional embodiment, the face comparison unit further includes: a clustering subunit, which clusters the face features to be detected with multiple pre-stored face comparison features; and a calculation subunit, which calculates the similarity between the face features to be detected and the face comparison features within the same cluster, thereby obtaining the face comparison result. Alternatively, a clustering method can be used to cluster the face features to be detected with multiple pre-stored face comparison features, and calculate the similarity between the face features to be detected and the face comparison features within the same cluster, thereby obtaining the face comparison result.

[0069] In one alternative embodiment, reference Figure 6 The device also includes a training module for training a face comparison model, the training module comprising:

[0070] Sample acquisition unit 61 acquires sample images and their corresponding texture labels;

[0071] Training unit 62 uses sample images as input data for training and texture labels corresponding to the sample images as labels. It is trained using deep learning to obtain a face comparison model used to generate face comparison results for the face images to be recognized.

[0072] It should be noted that when the sample acquisition unit 61 acquires sample images and their corresponding texture labels, the acquired sample image data can be understood as a collection of image data. This image data can be images of different faces, and the same face under different angles, environmental conditions, pixel colors, etc. The image data stream is usually quite large, reaching millions of images. The aforementioned sample images are used to train the network to be trained, in order to complete the construction of the model.

[0073] In an optional embodiment, the training module further includes a data augmentation unit to perform data augmentation on the sample images based on a data augmentation strategy after acquiring the sample images. Specifically, the data augmentation strategy includes at least one of cropping, rotation, translation, flipping, sharpening, illumination, and occlusion. For example, the data augmentation strategy may include cropping, rotation, translation, flipping, sharpening, illumination, or occlusion; or, for example, the data augmentation strategy may include at least two of cropping, rotation, translation, flipping, sharpening, illumination, and occlusion. By employing at least two data augmentation strategies to augment the acquired samples, the amount of training data for the model can be increased, thereby improving the model's detection accuracy.

[0074] In this embodiment, the training unit 62 uses sample images as input data for training and texture labels corresponding to the sample images as labels. Deep learning is employed for training to obtain a face comparison model used to generate face comparison results for the image to be recognized. It should be noted that the network to be trained can be an existing network built into the training device, which typically includes a network structure, or it can be other networks specified by the user, such as various neural networks (CNNs). The network to be trained typically includes a feature extraction layer, a face comparison layer, and a loss function. Following a preset iteration rule, the enhanced training data is input into the model to be trained for training, resulting in a trained target recognition model.

[0075] In addition, the loss function based on texture labels and extracted texture features can be the cross-entropy function. During the model training process, texture labels are used to supervise the extraction of texture features in order to improve the accuracy of the extracted texture features. In addition, color features are trained using unsupervised learning.

[0076] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include a processor 71, a communication interface 72, a memory 73, and a communication bus 74. The processor 71, communication interface 72, and memory 73 communicate with each other via the communication bus 74. The processor 71 can call logical instructions stored in the memory 73 to execute a face comparison method. This method includes: acquiring a face image to be recognized; inputting the face image to be recognized into a face comparison model to obtain the face comparison result output by the face comparison model; wherein the face comparison model is trained based on sample images and their corresponding texture labels; the face comparison model is used to perform face comparison by adjusting the color and filling the texture of the face image features extracted from the face image to be recognized, and then comparing them with pre-stored face comparison features.

[0077] Furthermore, the logical instructions in the aforementioned memory 73 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0078] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the face comparison method provided by the above methods. The method includes: acquiring a face image to be identified; inputting the face image to be identified into a face comparison model to obtain a face comparison result output by the face comparison model; wherein the face comparison model is trained based on a sample image and the texture label corresponding to the sample image; the face comparison model is used to perform face comparison with pre-stored face comparison features after color adjustment and texture filling of the face image features extracted based on the face image to be identified.

[0079] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the face comparison method provided by the above methods. The method includes: acquiring a face image to be identified; inputting the face image to be identified into a face comparison model to obtain a face comparison result output by the face comparison model; wherein the face comparison model is trained based on sample images and texture labels corresponding to the sample images; the face comparison model is used to perform face comparison with pre-stored face comparison features after color adjustment and texture filling of the face image features extracted based on the face image to be identified.

[0080] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0081] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A face comparison method, characterized in that, The method comprises the following steps: obtaining a to-be-identified face image; inputting the to-be-identified face image into a face comparison model to obtain a face comparison result output by the face comparison model; wherein the face comparison model is trained based on sample images and texture labels corresponding to the sample images; the face comparison model is used to perform face comparison on face image features extracted based on the to-be-identified face image after color adjustment and texture filling, and pre-stored face comparison features; the face comparison model comprises: a feature extraction layer that performs feature extraction based on the input to-be-identified face image, and obtains to-be-detected face features based on face image features, color features and texture features extracted; a face comparison layer that performs face comparison on the to-be-detected face features and pre-stored face comparison features to obtain a face comparison result; the to-be-detected face features are obtained based on the face image features, the color features and the texture features extracted, and the method comprises the following steps: performing feature extraction based on the input to-be-identified face image to obtain face image features; performing feature extraction on the to-be-identified face image to obtain color features and texture features; performing color adjustment on the face image features by using the color features, and performing texture filling on a color adjustment region by using the texture features to obtain to-be-detected face features.

2. The face comparison method of claim 1, wherein, the feature extraction layer comprises: a first convolutional layer that inputs the to-be-identified face image into the first convolutional layer to obtain face image features output by the first convolutional layer; a second convolutional layer that inputs the to-be-identified face image into the second convolutional layer to obtain color features; a third convolutional layer that inputs the to-be-identified face image into the third convolutional layer to obtain texture features; a fourth convolutional layer that inputs the face image features, the color features and the texture features into the fourth convolutional layer to obtain to-be-detected face features output by the fourth convolutional layer.

3. The face comparison method of claim 2, wherein, Further comprising: the first convolutional layer and the fourth convolutional layer comprise n convolutional layers; The second and third convolutional layers are respectively arranged in the first convolutional layer any of the convolutional layers.

4. The face comparison method of claim 1, wherein, training the face comparison model comprises: obtaining sample images and texture labels corresponding to the sample images; using the sample images as input data for training, using the texture labels corresponding to the sample images as labels, and using a deep learning method to train a face comparison model for generating a face comparison result of a to-be-identified face image.

5. A face comparison device, characterized by, The method comprises the following steps: a data acquisition module that obtains a to-be-identified face image; a face comparison module that inputs the to-be-identified face image into a face comparison model to obtain a face comparison result output by the face comparison model; wherein the face comparison model is trained based on sample images and texture labels corresponding to the sample images; the face comparison model is used to perform face comparison on face image features extracted based on the to-be-identified face image after color adjustment and texture filling, and pre-stored face comparison features; the face comparison module comprises: a feature extraction unit that performs feature extraction based on the input to-be-identified face image, and obtains to-be-detected face features based on face image features, color features and texture features extracted; The face comparison unit compares the face feature to be detected with a pre-stored face comparison feature to obtain a face comparison result; The feature extraction unit comprises: A first convolution subunit performs feature extraction on an input face image to be recognized to obtain a face image feature; A second convolution subunit performs feature extraction on the face image to be recognized to obtain a color feature and a texture feature; A third convolution subunit performs color adjustment on the face image feature using the color feature, and performs texture filling on a color adjustment region using the texture feature to obtain a face feature to be detected.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the program to implement the steps of the face comparison method according to any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the face comparison method according to any one of claims 1 to 4.

8. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the face comparison method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Attendance checking method, attendance checking system based on dense micro face recognition, equipment and medium

    CN110852704A

  • Face recognition method combined with mask attribute loss function

    CN111339930A

  • Head three-dimensional reconstruction method and equipment

    CN113628327A