Face recognition method, device, server and storage medium

By using sample training sets for various augmentation processing methods in the face recognition model, the problem of low accuracy of traditional face recognition models in specific scenarios is solved, and higher recognition performance and accuracy are achieved.

CN112241664BActive Publication Date: 2024-10-15SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910649677.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-18
Publication Date
2024-10-15
Estimated Expiration
2039-07-18

AI Technical Summary

Technical Problem

The face recognition accuracy of traditional face recognition neural networks in specific application scenarios is not high, mainly due to the dependence on large-scale training data and the problem of data ratio mismatch.

Method used

The face recognition model trained using the sample training set performs a variety of augmentation processes on each face image (such as flipping, trimming, color dithering, translation, scale transformation, noise perturbation, and rotation transformation). Added to the training set, the neural network model is trained to improve recognition performance.

Benefits of technology

This method enables the face recognition model to more effectively eliminate invalid interference in augmented images, improve the recognition accuracy of face images and their deformed images, improve classification recognition performance and interpretability, and improve the accuracy of face recognition. Spend.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112241664B_ABST
    Figure CN112241664B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a face recognition method, device, server and storage medium. The face recognition method includes: obtaining a face picture; inputting the face picture into a preset face recognition model, the face recognition model is trained based on a sample training set as a model training sample, the sample training set includes multiple sample face pictures, and multiple augmented processing pictures corresponding to each sample face picture; performing face recognition on the face picture according to the face recognition model, and outputting the face recognition result. In the embodiment of the present invention, the face recognition model is trained using a sample training set as a model training sample. Since the sample training set includes multiple sample face pictures, each sample face picture corresponds to multiple augmented processing pictures, so that the face recognition model has better classification and recognition performance, and also improves the interpretability of face recognition to a certain extent, and improves the accuracy of face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Face recognition is a biometric technology that identifies people based on their facial features. It usually uses a camera to capture images or video streams containing faces, automatically detects and tracks faces in the images, and then performs facial recognition on the detected faces. It is also commonly called portrait recognition or facial recognition.

[0003] Influenced by the development of deep learning, face recognition technology has made great progress. Traditional face recognition neural networks are widely used in face recognition. In terms of the performance of public face recognition test sets, technology based on deep convolutional networks has a firm advantage.

[0004] However, the facial feature extraction models in traditional face recognition neural networks are mostly trained on a large face dataset (more than 500,000), that is, the good face recognition performance based on the face recognition neural network is inseparable from the support of huge-scale training data, and then used as a general model in various scenarios. Since the general face recognition network model has a strong dependence on training data, the data of specific application scenarios accounts for a small proportion of the general face dataset, and the acquisition of large-scale training data is often costly, the face recognition accuracy of the general model in specific face recognition application scenarios is not high. Summary of the invention

[0005] The embodiments of the present invention provide a face recognition method, device, server and storage medium, so that the face recognition model trained by using the sample training set can eliminate invalid interference in the augmented picture, and can recognize the face picture and the augmented and deformed picture of the face picture as the same identity, thereby making the face recognition model have better classification and recognition performance, and also improve the interpretability of face recognition to a certain extent, and improve the accuracy of face recognition.

[0006] In a first aspect, the present application provides a face recognition method, the face recognition method comprising:

[0007] Get face pictures;

[0008] Inputting the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0009] Perform face recognition on the face image according to the face recognition model, and output a face recognition result.

[0010] In some embodiments of the present application, before inputting the face image into a preset face recognition model, the face recognition method further includes:

[0011] Collect multiple sample face images;

[0012] Establishing a sample training set according to the plurality of sample face images, wherein the sample training set includes the plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0013] The neural network model is trained according to the sample training set to obtain the face recognition model.

[0014] In some embodiments of the present application, establishing a sample training set based on the plurality of sample face images includes:

[0015] Taking sample face pictures from the plurality of sample face pictures as target sample face pictures respectively, and processing the target sample face pictures by using a plurality of preset augmentation methods to obtain a plurality of augmented processed pictures;

[0016] The plurality of augmented images are added to the sample training set.

[0017] In some embodiments of the present application, the multiple augmentation methods include at least two of flip transformation, random pruning, color jitter, translation transformation, scale transformation, contrast transformation, noise disturbance and rotation transformation.

[0018] In some embodiments of the present application, the step of training the neural network model according to the sample training set to obtain the face recognition model includes:

[0019] Sequentially use multiple augmented processed images corresponding to each sample face image as target augmented processed images;

[0020] Inputting the target augmented processed image into the neural network model, performing feature sampling processing on the target augmented processed image to obtain a feature map;

[0021] Performing a full connection operation on the feature map to obtain a predicted value of the target augmented image;

[0022] Loss training is performed according to the predicted values ​​of multiple augmented processed images in the sample training set to obtain the face recognition model.

[0023] In some embodiments of the present application, the loss training is performed according to the predicted values ​​of the plurality of augmented processed images in the sample training set to obtain the face recognition model, including:

[0024] The predicted values ​​of the multiple augmented processed images corresponding to each sample face image are subjected to constrained divergence minimization processing to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image, and the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image are obtained;

[0025] Get the true value of multiple augmented images corresponding to each sample face image;

[0026] The true values ​​and corrected predicted values ​​of multiple augmented processed images corresponding to each sample face image are converged to obtain the face recognition model.

[0027] In some embodiments of the present application, the convergence of the true values ​​and the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image to obtain the face recognition model includes:

[0028] Calculate the loss function value corresponding to the preset loss function according to the true values ​​and corrected prediction values ​​of multiple augmented processed images corresponding to each sample face image;

[0029] When the loss function value is minimum, the face recognition model is obtained.

[0030] In some embodiments of the present application, the loss function value corresponding to the preset loss function is calculated according to the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image, including:

[0031] According to the classification loss value of each sample face image;

[0032] Calculate the first loss value of multiple augmented processed images corresponding to each sample image in the feature sampling process;

[0033] Calculate the second loss value of multiple augmented processed images corresponding to each sample image in the feature full connection processing;

[0034] The loss function value is calculated according to the classification loss value, the first loss value and the second loss value.

[0035] In a second aspect, the present application further provides a face recognition device, the face recognition device comprising:

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

[0037] An input unit, used to input the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0038] The recognition unit is used to perform face recognition on the face image according to the face recognition model and output a face recognition result.

[0039] In some embodiments of the present application, the face recognition device further includes a training unit, and the training unit is specifically used to:

[0040] Before inputting the face image into a preset face recognition model, collecting a plurality of sample face images;

[0041] Establishing a sample training set according to the plurality of sample face images, wherein the sample training set includes the plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0042] The neural network model is trained according to the sample training set to obtain the face recognition model.

[0043] In some embodiments of the present application, the training unit is specifically used for:

[0044] Taking sample face pictures from the plurality of sample face pictures as target sample face pictures respectively, and processing the target sample face pictures by using a plurality of preset augmentation methods to obtain a plurality of augmented processed pictures;

[0045] The plurality of augmented images are added to the sample training set.

[0046] In some embodiments of the present application, the multiple augmentation methods include at least two of flip transformation, random pruning, color jitter, translation transformation, scale transformation, contrast transformation, noise disturbance and rotation transformation.

[0047] In some embodiments of the present application, the training unit is specifically used for:

[0048] Sequentially use multiple augmented processed images corresponding to each sample face image as target augmented processed images;

[0049] Inputting the target augmented processed image into the neural network model, performing feature sampling processing on the target augmented processed image to obtain a feature map;

[0050] Performing a full connection operation on the feature map to obtain a predicted value of the target augmented image;

[0051] Loss training is performed according to the predicted values ​​of multiple augmented processed images in the sample training set to obtain the face recognition model.

[0052] In some embodiments of the present application, the training unit is specifically used for:

[0053] The predicted values ​​of the multiple augmented processed images corresponding to each sample face image are subjected to constrained divergence minimization processing to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image, and the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image are obtained;

[0054] Get the true value of multiple augmented images corresponding to each sample face image;

[0055] The true values ​​and corrected predicted values ​​of multiple augmented processed images corresponding to each sample face image are converged to obtain the face recognition model.

[0056] In some embodiments of the present application, the training unit is specifically used for:

[0057] Calculate the loss function value corresponding to the preset loss function according to the true values ​​and corrected prediction values ​​of multiple augmented processed images corresponding to each sample face image;

[0058] When the loss function value is minimum, the face recognition model is obtained.

[0059] In some embodiments of the present application, the training unit is specifically used for:

[0060] According to the classification loss value of each sample face image;

[0061] Calculate the first loss value of multiple augmented processed images corresponding to each sample image in the feature sampling process;

[0062] Calculate the second loss value of multiple augmented processed images corresponding to each sample image in the feature full connection processing;

[0063] The loss function value is calculated according to the classification loss value, the first loss value and the second loss value.

[0064] In a third aspect, the present application further provides a server, the server comprising:

[0065] one or more processors;

[0066] Memory; and

[0067] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the face recognition method described in any one of the first aspects.

[0068] In a fourth aspect, the present application further provides a storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in the face recognition method described in any one of the first aspects.

[0069] The embodiment of the present invention obtains a face picture; inputs the face picture into a preset face recognition model, where the face recognition model is trained based on a sample training set as a model training sample, where the sample training set includes multiple sample face pictures and multiple augmented processed pictures corresponding to each sample face picture; performs face recognition on the face picture according to the face recognition model, and outputs a face recognition result. In the case that the existing face recognition model is only trained through sample face pictures, resulting in low recognition accuracy of the face recognition model for augmented and deformed pictures of different face pictures, the face recognition model in the embodiment of the present invention is trained using a sample training set as a model training sample. Since the sample training set includes multiple sample face pictures, each sample face picture corresponds to multiple augmented processed pictures, that is, the sample face picture and the multiple augmented processed pictures corresponding to the sample face picture are all face pictures of the same identity, so that the face recognition model trained with the sample training set can eliminate invalid interference in the augmented pictures, and can recognize the face pictures and the augmented and deformed pictures of the face pictures as the same identity, thereby making the face recognition model have better classification and recognition performance, and also improve the interpretability of face recognition to a certain extent, and improve the accuracy of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] 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 those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0071] Figure 1 It is a schematic diagram of a flow chart of an embodiment of a face recognition method provided by an embodiment of the present invention;

[0072] Figure 2 is a flowchart of an embodiment of step 102 in the face recognition method provided by an embodiment of the present invention;

[0073] Figure 3 It is a schematic diagram of an embodiment architecture of a neural network model provided by an embodiment of the present invention;

[0074] Figure 4 It is a schematic diagram of a flow chart of an embodiment of a face recognition device provided by an embodiment of the present invention;

[0075] Figure 5 It is a schematic diagram of the structure of a server in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0077] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0078] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.

[0079] The embodiments of the present invention provide a face recognition method, device, server and storage medium, which are described in detail below.

[0080] First, an embodiment of the present invention provides a face recognition method, which includes: obtaining a face picture; inputting the face picture into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes multiple sample face pictures and multiple augmented processed pictures corresponding to each sample face picture; performing face recognition on the face picture according to the face recognition model, and outputting a face recognition result.

[0081] like Figure 1 FIG. 1 is a flow chart of an embodiment of a face recognition method in an embodiment of the present invention. The face recognition method is applied to a face recognition device, and the face recognition device may be located in a server. Specifically, the face recognition method includes:

[0082] 101. Get a face picture.

[0083] Among them, the face image in the embodiment of the present invention is a face image to be subjected to face recognition.

[0084] There are multiple ways to obtain facial images in the embodiments of the present invention. In some embodiments of the present invention, the facial image can be obtained by photographing the user's face, that is, the facial image can be a facial image taken by a photographing device (such as a mobile phone, camera, camcorder, and monitoring equipment, etc.), or the facial image can be obtained from a facial image database, etc.

[0085] In other embodiments of the present invention, the face picture may refer to an original picture (such as a face picture taken by a camera) that is processed to meet preset requirements. It should be noted that after obtaining the original picture by photographing the user's face and the face database, the original picture obtained may have the face part in the corner (such as the lower right corner) or the side of the image, and the sizes of the original pictures obtained are different. Therefore, it is necessary to uniformly process the obtained original pieces to obtain face pictures of uniform specifications. Further, before obtaining the face picture, the original picture needs to be processed so that the original picture meets the preset requirements and is more conducive to the prediction of face attributes. At this time, the step of obtaining the face picture can further include: obtaining the original picture; performing face detection on the original picture to perform face correction processing on the original picture to obtain the face picture.

[0086] Further, face detection is performed on the original image to perform face correction processing on the original image, and the steps of obtaining the face image may include: performing face detection on the original image to determine the face area; determining a preset number of face key points in the face area; performing face correction on the original image according to the face key points to obtain a face correction image; and resizing the face correction image according to a preset size to obtain the face image. It can be understood that the original image is an original image containing a face, and only an original image containing a face can be processed to obtain the face image in the embodiment of the present invention, and an image that does not contain a face can be directly discarded without subsequent processing.

[0087] In the embodiment of the present invention, an AdaBoost classifier (adaptive boost classifier) ​​or a deep learning face detection algorithm can be used to perform face detection on the original image to determine the face area and determine a preset number of face key points in the face area. Among them, the algorithm of using the AdaBoost classifier to detect the face and determine the face key points, and the method of using the deep learning algorithm to detect the face and determine the face key points are both conventional technical means, which will not be repeated here.

[0088] After determining the key points of the face in the original image, the face correction can be performed on the original image according to the key points of the face to obtain a face correction image. For example, if the key points of the face include the key points of the eyebrows on both sides of the face key points, the key points of the eyebrows on both sides of the face key points can be connected into a straight line. If the straight line is inclined relative to the upper and lower boundaries of the pattern, the original image is adjusted so that the straight line is parallel to the upper and lower boundaries of the pattern. Finally, the sample face correction image is resized according to a preset size (for example, 50*50) to obtain a face image. It should be noted that the size of the original image generally needs to be larger than the preset size to facilitate size adjustment. Of course, in some embodiments, the original image can also be smaller than the preset size. In this case, the original image needs to be enlarged by a preset multiple before size adjustment.

[0089] 102. Input the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image.

[0090] In the embodiment of the present invention, before the face image is input into the preset face recognition model, the sample data is first trained to obtain the face recognition model. Specifically, Figure 2 As shown, that is, before the face image is input into the preset face recognition model, the face recognition method in the embodiment of the present invention may further include:

[0091] 201. Collect multiple sample face images.

[0092] In the embodiment of the present invention, certain original sample face images may be collected, specifically, the original sample face images may be obtained by photographing a large number of user faces, or the original sample face images may be obtained by searching for face images on the Internet, or the original sample face images may be obtained from a face image database, etc. Among them, when photographing the user's face to obtain the multiple sample face images, the original sample face images may also be collected by photographing multiple face images of the same user, etc.

[0093] It should be noted that after obtaining the original sample face images by photographing the user's face, searching the Internet, and using a face database, the original sample face images obtained may also have the face part in the corner (such as the lower right corner) or on the side of the image. At the same time, the original sample face images obtained are of different sizes. Therefore, it is necessary to uniformly process the original sample face images obtained to obtain sample face images. The method for uniformly processing the sample face images can refer to the specific process of processing the original images to obtain face images in step 101, which will not be repeated here.

[0094] 202. Establish a sample training set according to the plurality of sample face images, wherein the sample training set includes the plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image.

[0095] Specifically, the step of establishing a sample training set based on the multiple sample face images may include: taking sample face images from the multiple sample face images as target sample face images, processing the target sample face images using a plurality of preset augmentation methods to obtain multiple augmented processed images; and adding the multiple augmented processed images to the sample training set.

[0096] The multiple augmentation methods include at least two of flip transformation, random pruning, color jitter, translation transformation, scale transformation, contrast transformation, noise disturbance and rotation transformation. If the processing capacity of the server where the face recognition device is located is strong enough, more augmentation methods can be used to process each sample face image, so that the trained face recognition model has better recognition ability for augmented images of various face images and better face recognition accuracy.

[0097] 203. Train the neural network model according to the sample training set to obtain the face recognition model.

[0098] In an embodiment of the present invention, the neural network model may be an existing neural network model, such as a convolutional neural network (CNN) model. It can be understood that the embodiment of the present invention is mainly based on the training method of the model, and the neural network model may also be a new neural network model that will emerge in the future.

[0099] Specifically, Figure 3 As shown, the structure of the neural network model may include: a deep convolutional network layer, a feature layer, a fully connected layer, an output layer, and a loss layer. Among them, the deep convolutional network layer may include an input layer, a convolutional layer, and a pooling layer. The details are as follows:

[0100] Input layer: responsible for accepting image input, such as sample face image input.

[0101] The neural convolutional network layer may include a convolution layer and a pooling layer, and these two operations are performed alternately (that is, the convolution layer and the pooling layer are alternately arranged).

[0102] Convolution layer: mainly used for feature extraction (i.e. mapping the original data to the hidden feature space) of the input image (such as training sample face images or face images to be recognized), wherein the convolution kernel size can be determined according to the actual application, for example, the convolution kernel size of the first convolution layer is set to (5, 5), and the convolution kernel size of the first convolution layer is set to (3, 3). Optionally, in order to reduce the complexity of calculation and improve the calculation efficiency, the convolution kernel size of all convolution layers in the neural network model can also be set to (3, 3); the convolution layer acts as a feature detector, so that the neural network model can obtain features from low-level features to high-level features. Optionally, in order to improve the expressive power of the model, nonlinear factors can also be added by adding nonlinear activation functions. In the embodiment of the present invention, the convolution layer is followed by a nonlinear activation function, which can be set according to the needs of the actual application. For example, the nonlinear activation function can be f(x) = max(0, x).

[0103] It should be noted that, for the convenience of description, in an embodiment of the present invention, the layer where the activation function is located and the downsampling layer (also called the pooling layer) are both included in the deep convolutional network layer. It should be understood that the deep convolutional network layer can also be considered to include a convolutional layer, a layer where the activation function is located, a downsampling layer (i.e., a pooling layer) and a fully connected layer. Of course, it can also include an input layer for inputting data and an output layer for outputting data, which will not be elaborated here.

[0104] Pooling layer: The pooling layer merges adjacent regions so that the neural network model can tolerate certain deformations and improve the robustness of the model. The operation of the pooling layer is basically the same as that of the convolution layer, except that the convolution kernel of the pooling layer only takes the maximum value (max pooling) or the average value (average pooling) of the corresponding position.

[0105] Feature layer: The output features of multiple neural network models are concatenated through the feature layer. The feature layer normalizes the features so that the output features of the neural network models have the same order of magnitude, which facilitates feature fusion.

[0106] Fully connected layer: The fused features are then input into the fully connected layer. The fully connected layer can map the learned "distributed feature representation" to the sample tag space. It mainly plays the role of a "classifier" in the entire convolutional neural network. Each node of the fully connected layer is connected to all nodes output by the previous layer (such as the last pooling layer in the neural network model). Among them, a node in the fully connected layer is called a neuron in the fully connected layer. The number of neurons in the fully connected layer can be determined according to the needs of the actual application. For example, the number of neurons in the fully connected layer can be set to 2048. Since the neural network model can include multiple neural sub-network models, each neural sub-network model can output multiple vectors, and the number of vectors is consistent with the number of neurons in the neural network model, the fully connected layer will splice these multiple vectors to obtain a fused vector. For example, the neural network model includes a first neural sub-network model and a second neural sub-network model. If the first neural sub-network model and the second neural sub-network model can output 2048 vectors respectively; then the fully connected layer splices the output vector of the first neural sub-network model and the output vector of the second neural sub-network model to obtain 4096 vectors.

[0107] Optionally, in the fully connected layer, after obtaining the fused vector, a linear transformation will be performed on the fused vector to facilitate the subsequent prediction of specific facial attributes. The linear transformation operation can be performed using a linear function, such as Y=a*X+b. Among them, Y is the output, X is the input, and a and b are parameters. For example, the input X is a 10-dimensional vector, a is a 4*10 matrix, and b is a constant. For example, 0.2. First perform matrix multiplication, and add the result to the constant b to get the output Y.

[0108] Loss layer: The loss layer is used to calculate and compare the difference between the predicted value of the facial attribute and the actual value of the facial attribute, and continuously correct and optimize the parameters in the neural network model through the back propagation algorithm to obtain the neural network model. Among them, the loss function can adopt the cross entropy loss function.

[0109] The output layer, also called the prediction layer, is used to output prediction data, such as the predicted value of face recognition for face images.

[0110] Specifically, the step of training the neural network model according to the sample training set to obtain the face recognition model may include:

[0111] (1) Take the multiple augmented images corresponding to each sample face image as the target augmented images in turn.

[0112] (2) Inputting the target augmented processed image into the neural network model, performing feature sampling processing on the target augmented processed image, and obtaining a feature map.

[0113] Specifically, you can use Figure 3 The deep convolutional network layer in the neural network model shown performs feature sampling processing on the target augmented image to obtain a feature map.

[0114] In order to be consistent with human common sense that there should not be much difference in the recognition of changed faces, as part of the interpretability of the neural network model, in the embodiment of the present invention, the target augmented processed image is subjected to feature sampling processing, and the feature map is obtained, including vector dimension processing of the feature map, so that different augmented processed images corresponding to each face image are in the same vector dimension. Specifically, the dimension processing adopts the following formula:

[0115]

[0116] Where N represents the number of sample face images, i represents the i-th sample face image among N sample face images, N≥i, is the output of the feature layer after the i-th sample face image is augmented by a. is the output of the feature layer of the i-th sample face image after augmentation processing b, h represents the Gaussian kernel function, and ultimately the output of different augmented processed images in the feature layer is in the same vector dimension.

[0117] (3) Perform a full connection operation on the feature map to obtain a predicted value of the target augmented image.

[0118] In an embodiment of the present invention, a fully connected operation is performed on the feature map in the fully connected layer of the neural network model to obtain a predicted value of the target augmented processed image.

[0119] Since the number of samples of different types may be different, in order to enhance the distinguishability between categories, considering the imbalance in the number of samples between categories, in the embodiment of the present invention, an adaptive category interval is introduced in the fully connected layer, that is, a classification metric operation is performed on the feature map. Specifically, different classification metrics are designed for the feature maps corresponding to different types of sample face images, and the classification metrics are subtracted from the feature maps, so that different types of sample face images are more distinguishable. The specifically designed classification metrics are as follows:

[0120]

[0121] Where N represents the number of sample face images, i represents the i-th sample face image among N sample face images, and x i is the output of the feature layer after the augmented image of the i-th sample face image is input into the neural network model, e is a natural constant, w j is the weight of the jth unit in the fully connected layer, x j is the output of the jth unit in the fully connected layer, is the sample face image category y i Adaptive interval, η is a hyperparameter.

[0122] In the embodiment of the present invention, an adaptive category interval is introduced in the fully connected layer, which can ensure that face recognition has sufficient discriminability on the one hand, and on the other hand, the face recognition model still has good recognition accuracy when the amount of face image data is relatively small.

[0123] (4) Loss training is performed based on the predicted values ​​of multiple augmented images in the sample training set to obtain the face recognition model.

[0124] Among them, the step of performing loss training according to the predicted values ​​of multiple augmented processed images in the sample training set to obtain the face recognition model may include: performing constrained divergence minimization processing on the predicted values ​​of multiple augmented processed images corresponding to each sample face image to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image, and obtaining the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image; obtaining the true values ​​of the multiple augmented processed images corresponding to each sample face image; and converging the true values ​​and corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image to obtain the face recognition model.

[0125] Among them, the semantic consistency of the multiple augmented processing images corresponding to each sample face image is ensured, that is, the probability distribution of the multiple augmented processing images corresponding to each sample face image is consistent. In addition, the true value and the corrected prediction value of the multiple augmented processing images corresponding to each sample face image can be represented by the numerical value or vector of one or more facial attribute values ​​described in step 103 below, for example, (0, 1, 1) represents three facial attribute values ​​such as female, wearing glasses and not wearing a mask.

[0126] In the embodiment of the present invention, before performing constrained divergence minimization processing on the prediction values ​​of the multiple augmented processed images corresponding to each sample face image to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image and obtaining the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image, the prediction data output by the output layer can also be processed in the vector dimension, and specifically the following formula can be used:

[0127]

[0128] Among them, i represents the i-th sample face image among N sample face images, is the predicted value output by the output layer (prediction layer) after the i-th sample face image undergoes augmentation operation a. It represents the predicted value outputted by the output layer (prediction layer) after the i-th sample face image undergoes augmentation operation b, and JS is the Jensen divergence.

[0129] Specifically, in the embodiment of the present invention, the predicted values ​​of the multiple augmented processed images corresponding to each sample face image are subjected to constrained divergence minimization processing to ensure that the semantics of the multiple augmented processed images corresponding to each sample face image are consistent, and the step of obtaining the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image can adopt the following formula:

[0130]

[0131]

[0132] Among them, KL represents KL divergence (Kullback-Leibler divergence), P1 represents the predicted value of the augmented image output corresponding to the sample face image after the first augmentation process, and P2 represents the predicted value of the augmented image output corresponding to the sample face image after the second augmentation process. After the above constrained divergence minimization process, the output predictions of the augmented images of the same sample face image after different augmentation processes can be kept roughly similar.

[0133] In an embodiment of the present invention, a preset loss function can be used to converge the true value and the corrected predicted value of the multiple augmented processed images corresponding to each sample face image to obtain the face recognition model. The loss function can be flexibly set according to the actual application requirements. For example, the loss function can be a cross entropy loss function. By reducing the error between the predicted value and the true value of the multiple augmented processed images corresponding to each sample face image, continuous training is performed to adjust the parameters of the neural network model to appropriate values ​​(for example, the loss function value is minimized), and a face recognition model can be obtained.

[0134] In some embodiments of the present invention, the convergence of the true values ​​and the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image to obtain the face recognition model may specifically include: calculating the loss function value corresponding to a preset loss function according to the true values ​​and the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image; and obtaining the face recognition model when the loss function value is minimum.

[0135] Specifically, calculating the loss function value corresponding to a preset loss function according to the true values ​​and corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image may include: calculating the first loss value of the multiple augmented processed images corresponding to each sample image in the feature sampling process according to the classification loss value of each sample face image; calculating the second loss value of the multiple augmented processed images corresponding to each sample image in the feature full connection process; and calculating the loss function value according to the classification loss value, the first loss value and the second loss value.

[0136] In a specific implementation, the step of calculating the loss function value corresponding to the preset loss function according to the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image can be calculated using the following loss function:

[0137]

[0138] Among them, the first term L m is the classification loss value, i.e., the classification metric described in the above embodiment, α is a constant proportional coefficient, is the feature layer loss, used to correct the feature layer output; β is the constant proportional coefficient, is the prediction layer (i.e., the output layer described later) loss, which is used to correct the prediction layer output; L is the loss function value.

[0139] 103. Perform face recognition on the face image according to the face recognition model, and output a face recognition result.

[0140] In the embodiment of the present invention, according to the face recognition model in step 102, face recognition can be performed on the face image to output a face recognition result. The face recognition result may be a numerical representation or a vector representation of attribute values ​​corresponding to one or more face attributes.

[0141] Due to the different types of facial attributes, the attribute values ​​used to indicate facial attributes in the embodiment of the present invention may also have different representation forms, and the attribute values ​​of facial attributes may be in numerical form or in vector form. For example, the facial attributes corresponding to the sample face image may be facial attributes such as whether to wear glasses, gender, and whether to wear a mask. In practical applications, each facial attribute may be represented in numerical form. For example, there are two genders, and 0 may be used to represent male and 1 may be used to represent female. There are two types of whether to wear glasses: yes and no, and 0 may be used to represent no (not wearing glasses) and 1 may be used to represent yes (wearing glasses). There are two types of whether to wear a mask: yes and no, and 0 may be used to represent no (not wearing a mask) and 1 may be used to represent yes (wearing a mask). The attributes of two facial images among the multiple facial images obtained by the facial attribute recognition device may be female, wearing glasses, not wearing a mask and male, not wearing glasses, not wearing a mask, respectively. The attribute values ​​of the multiple attributes of the two sample face images may be 1, 1, 0 and 0, 0, 0. In the embodiment of the present invention, some facial attributes may be represented in numerical form, such as age attribute, and other facial attributes may be represented in vector form, such as gender attribute and expression attribute, which is not limited in the embodiment of the present invention.

[0142] The embodiment of the present invention obtains a face picture; inputs the face picture into a preset face recognition model, where the face recognition model is trained based on a sample training set as a model training sample, where the sample training set includes multiple sample face pictures and multiple augmented processed pictures corresponding to each sample face picture; performs face recognition on the face picture according to the face recognition model, and outputs a face recognition result. In the case that the existing face recognition model is only trained through sample face pictures, resulting in low recognition accuracy of the face recognition model for augmented and deformed pictures of different face pictures, the face recognition model in the embodiment of the present invention is trained using a sample training set as a model training sample. Since the sample training set includes multiple sample face pictures, each sample face picture corresponds to multiple augmented processed pictures, that is, the sample face picture and the multiple augmented processed pictures corresponding to the sample face picture are all face pictures of the same identity, so that the face recognition model trained with the sample training set can eliminate invalid interference in the augmented pictures, and can recognize the face pictures and the augmented and deformed pictures of the face pictures as the same identity, thereby making the face recognition model have better classification and recognition performance, and also improve the interpretability of face recognition to a certain extent, and improve the accuracy of face recognition.

[0143] In order to better implement the face recognition method in the embodiment of the present invention, based on the face recognition method, a face recognition device is also provided in the embodiment of the present invention, and the face recognition device can be applied to a server.

[0144] like Figure 4 FIG. 4 is a schematic diagram of a face recognition device according to an embodiment of the present invention. The face recognition device 400 includes:

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

[0146] An input unit 402 is used to input the face picture into a preset face recognition model, where the face recognition model is trained based on a sample training set as a model training sample, where the sample training set includes a plurality of sample face pictures and a plurality of augmented processed pictures corresponding to each sample face picture;

[0147] The recognition unit 403 is used to perform face recognition on the face image according to the face recognition model and output a face recognition result.

[0148] In some embodiments of the present application, the face recognition device further includes a training unit, and the training unit is specifically used to:

[0149] Before inputting the face image into a preset face recognition model, collecting a plurality of sample face images;

[0150] Establishing a sample training set according to the plurality of sample face images, wherein the sample training set includes the plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0151] The neural network model is trained according to the sample training set to obtain the face recognition model.

[0152] In some embodiments of the present application, the training unit is specifically used for:

[0153] Taking sample face pictures from the plurality of sample face pictures as target sample face pictures respectively, and processing the target sample face pictures by using a plurality of preset augmentation methods to obtain a plurality of augmented processed pictures;

[0154] The plurality of augmented images are added to the sample training set.

[0155] In some embodiments of the present application, the multiple augmentation methods include at least two of flip transformation, random pruning, color jitter, translation transformation, scale transformation, contrast transformation, noise disturbance and rotation transformation.

[0156] In some embodiments of the present application, the training unit is specifically used for:

[0157] Sequentially use multiple augmented processed images corresponding to each sample face image as target augmented processed images;

[0158] Inputting the target augmented processed image into the neural network model, performing feature sampling processing on the target augmented processed image to obtain a feature map;

[0159] Performing a full connection operation on the feature map to obtain a predicted value of the target augmented image;

[0160] Loss training is performed according to the predicted values ​​of multiple augmented processed images in the sample training set to obtain the face recognition model.

[0161] In some embodiments of the present application, the training unit is specifically used for:

[0162] The predicted values ​​of the multiple augmented processed images corresponding to each sample face image are subjected to constrained divergence minimization processing to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image, and the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image are obtained;

[0163] Get the true value of multiple augmented images corresponding to each sample face image;

[0164] The true values ​​and corrected predicted values ​​of multiple augmented processed images corresponding to each sample face image are converged to obtain the face recognition model.

[0165] In some embodiments of the present application, the training unit is specifically used for:

[0166] Calculate the loss function value corresponding to the preset loss function according to the true values ​​and corrected prediction values ​​of multiple augmented processed images corresponding to each sample face image;

[0167] When the loss function value is minimum, the face recognition model is obtained.

[0168] In some embodiments of the present application, the training unit is specifically used for:

[0169] According to the classification loss value of each sample face image;

[0170] Calculate the first loss value of multiple augmented processed images corresponding to each sample image in the feature sampling process;

[0171] Calculate the second loss value of multiple augmented processed images corresponding to each sample image in the feature full connection processing;

[0172] The loss function value is calculated according to the classification loss value, the first loss value and the second loss value.

[0173] The embodiment of the present invention obtains a face image through an acquisition unit 401; an input unit 402 inputs the face image into a preset face recognition model, which is trained based on a sample training set as a model training sample, and the sample training set includes multiple sample face images, and multiple augmented processed images corresponding to each sample face image; a recognition unit 403 performs face recognition on the face image according to the face recognition model, and outputs a face recognition result. In the case that the existing face recognition model is only trained through sample face pictures, resulting in low recognition accuracy of the face recognition model for augmented and deformed pictures of different face pictures, the face recognition model in the embodiment of the present invention is trained using a sample training set as a model training sample. Since the sample training set includes multiple sample face pictures, each sample face picture corresponds to multiple augmented processed pictures, that is, the sample face picture and the multiple augmented processed pictures corresponding to the sample face picture are all face pictures of the same identity, so that the face recognition model trained with the sample training set can eliminate invalid interference in the augmented pictures, and can recognize the face pictures and the augmented and deformed pictures of the face pictures as the same identity, thereby making the face recognition model have better classification and recognition performance, and also improve the interpretability of face recognition to a certain extent, and improve the accuracy of face recognition.

[0174] The embodiment of the present invention further provides a server, which integrates any face recognition device provided by the embodiment of the present invention, and the server includes:

[0175] one or more processors;

[0176] Memory; and

[0177] One or more applications, wherein the one or more applications are stored in the memory and are configured so that the processor executes the steps of the face recognition method described in any of the above-mentioned face recognition method embodiments.

[0178] The embodiment of the present invention further provides a server, which integrates any face recognition device provided by the embodiment of the present invention. Figure 5 As shown, it shows a schematic diagram of the structure of the server involved in the embodiment of the present invention, specifically:

[0179] The server may include one or more processing core processors 501, one or more computer-readable storage media memories 502, a power supply 503, an input unit 504 and other components. Those skilled in the art will appreciate that Figure 5 The server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0180] The processor 501 is the control center of the server, and uses various interfaces and lines to connect various parts of the entire server. By running or executing software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, the processor 501 performs various functions of the server and processes data, thereby monitoring the server as a whole. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501.

[0181] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0182] The server also includes a power supply 503 for supplying power to each component. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 503 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0183] The server may further include an input unit 504, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0184] Although not shown, the server may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 501 in the server will load the executable files corresponding to the processes of one or more applications into the memory 502 according to the following instructions, and the processor 501 will run the application stored in the memory 502, thereby realizing various functions, as follows:

[0185] Get face pictures;

[0186] Inputting the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0187] Perform face recognition on the face image according to the face recognition model, and output a face recognition result.

[0188] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0189] To this end, an embodiment of the present invention provides a storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. The storage medium stores multiple instructions, which can be loaded by a processor to execute the steps in any face recognition method provided in an embodiment of the present invention. For example, the instruction can execute the following steps:

[0190] Get face pictures;

[0191] Inputting the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image;

[0192] Perform face recognition on the face image according to the face recognition model, and output a face recognition result.

[0193] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0194] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0195] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0196] The above is a detailed introduction to a face recognition method, device, server and storage medium provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A face recognition method, characterized in that: The face recognition method comprises: Get face pictures; Inputting the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image; Performing face recognition on the face image according to the face recognition model, and outputting a face recognition result; The step of training a neural network model according to the sample training set to obtain the face recognition model includes: Sequentially use multiple augmented processed images corresponding to each sample face image as target augmented processed images; Inputting the target augmented processed image into the neural network model, performing feature sampling processing on the target augmented processed image to obtain a feature map; Performing a full connection operation on the feature map to obtain a predicted value of the target augmented image; The predicted values ​​of the multiple augmented processed images corresponding to each sample face image are subjected to constrained divergence minimization processing to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image, and the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image are obtained; Get the true value of multiple augmented images corresponding to each sample face image; The true values ​​and corrected predicted values ​​of multiple augmented processed images corresponding to each sample face image are converged to obtain the face recognition model.

2. The face recognition method according to claim 1, characterized in that: Before inputting the face image into a preset face recognition model, the face recognition method further includes: Collect multiple sample face images; Establishing a sample training set according to the plurality of sample face images, wherein the sample training set includes the plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image; The neural network model is trained according to the sample training set to obtain the face recognition model.

3. The face recognition method according to claim 2, characterized in that: A sample training set is established according to the plurality of sample face images, including: Taking sample face pictures from the plurality of sample face pictures as target sample face pictures respectively, and processing the target sample face pictures by using a plurality of preset augmentation methods to obtain a plurality of augmented processed pictures; The plurality of augmented images are added to the sample training set.

4. The face recognition method according to claim 1, characterized in that: The method of converging the true values ​​and the corrected predicted values ​​of the plurality of augmented processed images corresponding to each sample face image to obtain the face recognition model includes: Calculate the loss function value corresponding to the preset loss function according to the true values ​​and corrected prediction values ​​of multiple augmented processed images corresponding to each sample face image; When the loss function value is minimum, the face recognition model is obtained.

5. The face recognition method according to claim 4, characterized in that: The step of calculating the loss function value corresponding to the preset loss function according to the corrected prediction values ​​of the multiple augmented processed images corresponding to each sample face image includes: According to the classification loss value of each sample face image; Calculate the first loss value of multiple augmented processed images corresponding to each sample image in the feature sampling process; Calculate the second loss value of multiple augmented processed images corresponding to each sample image in the feature full connection processing; The loss function value is calculated according to the classification loss value, the first loss value and the second loss value.

6. A face recognition device, characterized in that: The face recognition device comprises: An acquisition unit, used for acquiring a face image; An input unit, used to input the face image into a preset face recognition model, wherein the face recognition model is trained based on a sample training set as a model training sample, wherein the sample training set includes a plurality of sample face images and a plurality of augmented processed images corresponding to each sample face image; A recognition unit, configured to perform face recognition on the face image according to the face recognition model and output a face recognition result; The face recognition device further includes a training unit, which is further used to sequentially use the multiple augmented processed images corresponding to each sample face image as target augmented processed images; Inputting the target augmented processed image into a neural network model, performing feature sampling processing on the target augmented processed image to obtain a feature map; Performing a full connection operation on the feature map to obtain a predicted value of the target augmented image; The predicted values ​​of the multiple augmented processed images corresponding to each sample face image are subjected to constrained divergence minimization processing to ensure the semantic consistency of the multiple augmented processed images corresponding to each sample face image, and the corrected predicted values ​​of the multiple augmented processed images corresponding to each sample face image are obtained; Get the true value of multiple augmented images corresponding to each sample face image; The true values ​​and corrected predicted values ​​of multiple augmented processed images corresponding to each sample face image are converged to obtain the face recognition model.

7. A server, characterized in that: The server comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the face recognition method according to any one of claims 1 to 5.

8. A storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the face recognition method according to any one of claims 1 to 5.