Face recognition model training method and device, face recognition model application method and device, equipment and medium
Through the training method of the face recognition model, the differentiable gated spatial transformation matrix and gradient descent algorithm are used to optimize the face recognition network, solving the problem of degradation of face recognition accuracy in non-cooperating scenes, and improving the recognition ability of low-quality images.
Patent Information
- Application Number
- CN202411805619.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
AI Technical Summary
In non-coordinated scenarios, the facial recognition system reduces the accuracy of facial recognition due to the lack of image features.
Through a training method of face recognition model, the preset differentiable gated spatial transformation matrix is used to map the initial image to be trained, and the face alignment error sample is generated, and the transformation matrix is updated through the gradient descent algorithm to optimize the face recognition network and improve the model's alignment error robustness.
It improves the recognition accuracy of the face recognition model in non-coordinated scenarios and enhances the recognition ability of facial features in low-quality images.
Smart Images

Figure CN119810882A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of face recognition technology, and in particular to a training method, application method, device, equipment and medium for a face recognition model. Background Art
[0002] Facial recognition technology is also widely used in non-cooperative scenarios (such as security control, visitor monitoring, contactless attendance, etc.). However, since the location of the information collection equipment is usually not directly facing the face and the person being recognized will not deliberately cooperate, the collected images usually have problems such as missing features, which affects the accuracy of facial feature point recognition and thus affects the accuracy of facial recognition. Summary of the invention
[0003] The present application provides a training method, application method, device, equipment and medium for a face recognition model to solve the technical problem that images collected in non-cooperative scenarios have missing features, which will affect the accuracy of facial recognition.
[0004] In a first aspect, an embodiment of the present application provides a method for training a face recognition model, the method comprising:
[0005] Obtain the initial image to be trained;
[0006] Based on a preset initial differentiable gated space transformation matrix, the initial image to be trained is mapped to obtain an initial face alignment error sample, wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and gating mechanism;
[0007] Performing back propagation on a preset initial face recognition network based on the initial face alignment error sample to obtain a gradient descent change value of the initial differentiable gated space transformation matrix;
[0008] By using a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value to generate a target face alignment error sample;
[0009] The initial face recognition network is updated through the target face alignment error samples to obtain a target face recognition model.
[0010] Optionally, mapping the initial image to be trained based on a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample includes:
[0011] Remapping the positions of the pixels in the initial image to be trained by using an affine transformation matrix to obtain a first image;
[0012] Performing an inverse transformation on the first image by using the initial differentiable gated space transformation matrix to obtain a second image, wherein the initial differentiable gated space transformation matrix is obtained by setting a gating coefficient on the affine transformation matrix;
[0013] The second image is compared with a standard face template image to obtain the initial face alignment error sample.
[0014] Optionally, comparing the second image with a standard face template image to obtain the initial face alignment error sample includes:
[0015] Performing interpolation processing on the pixels in the second image by a bilinear interpolation algorithm to obtain a third image;
[0016] The third image is compared with the standard face template image to obtain the initial face alignment error sample.
[0017] Optionally, the back-propagating a preset initial face recognition network based on the initial face alignment error sample to obtain a gradient descent change value of the initial differentiable gated space transformation matrix includes:
[0018] Inputting the initial face alignment error sample into the initial face recognition network to obtain an initial loss function;
[0019] The initial differentiable gated space transformation matrix is back-propagated through the initial loss function to obtain the gradient descent change value.
[0020] Optionally, the updating the initial differentiable gated space transformation matrix based on the gradient descent change value by a gradient descent algorithm to generate a target face alignment error sample includes:
[0021] By using a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value, a preset step size, and a preset adversarial disturbance range to obtain a target differentiable gated space transformation matrix;
[0022] The initial image to be trained is mapped by using the differentiable gated space transformation matrix to obtain the target face alignment error sample.
[0023] Optionally, the updating of the initial differentiable gated space transformation matrix based on the gradient descent change value, a preset step size, and a preset adversarial disturbance range by a gradient descent algorithm to obtain a target differentiable gated space transformation matrix includes:
[0024] According to the preset counter-disturbance range, projecting the initial differentiable gated space transformation matrix to obtain a first differentiable gated space transformation matrix;
[0025] The first differentiable gated space transformation matrix is iteratively updated according to the gradient descent change value and the preset step size to obtain the target differentiable gated space transformation matrix.
[0026] Optionally, updating the initial face recognition network by using the target face alignment error sample to obtain a target face recognition model includes:
[0027] Inputting the target face alignment error sample into the initial face recognition network to obtain a target loss function;
[0028] The initial face recognition network is updated based on the target loss function through a gradient descent algorithm to obtain the target face recognition model.
[0029] In a second aspect, an embodiment of the present application provides an application method of a face recognition model, the method comprising:
[0030] Obtain a low-quality image to be recognized;
[0031] The low-quality image to be recognized is input into a target face recognition model to obtain an output face recognition result, and the target face recognition model is trained by a face recognition model training method.
[0032] In a third aspect, an embodiment of the present application provides a training device for a face recognition model, the device comprising:
[0033] A first acquisition module, used to acquire an initial image to be trained;
[0034] An image mapping module is used to map the initial image to be trained based on a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample, wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and a gating mechanism;
[0035] A back propagation module, used for performing back propagation on a preset initial face recognition network based on the initial face alignment error sample to obtain a gradient descent change value of the initial differentiable gated space transformation matrix;
[0036] A matrix updating module, configured to update the initial differentiable gated space transformation matrix based on the gradient descent change value by a gradient descent algorithm to generate a target face alignment error sample;
[0037] The model updating module is used to update the initial face recognition network through the target face alignment error sample to obtain a target face recognition model.
[0038] In a fourth aspect, an embodiment of the present application provides an application device of a face recognition model, the device comprising:
[0039] A second acquisition module is used to acquire a low-quality image to be identified;
[0040] The model application module is used to input the low-quality image to be recognized into a target face recognition model to obtain an output face recognition result, and the target face recognition model is trained by a face recognition model training method.
[0041] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the training method of the above-mentioned face recognition model or the application method of the face recognition model is implemented.
[0042] In a sixth aspect, an embodiment of the present application provides a readable storage medium. When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the above-mentioned training method of the face recognition model or the application method of the face recognition model.
[0043] In summary, in the embodiment of the present application, an initial image to be trained is obtained; based on a preset initial differentiable gated space transformation matrix, the initial image to be trained is mapped to obtain an initial face alignment error sample, wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and gating mechanism; based on the initial face alignment error sample, a preset initial face recognition network is back-propagated to obtain a gradient descent change value of the initial differentiable gated space transformation matrix; through a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value to generate a target face alignment error sample; through the target face alignment error sample, the initial face recognition network is updated to obtain a target face recognition model. A low-quality image to be recognized is obtained; the low-quality image to be recognized is input into the target face recognition model to obtain an output face recognition result. In this scheme, the differentiable gated space transformation matrix is updated and optimized, a gating mechanism is introduced to adjust the gradient to avoid excessive disturbance, and the parameters are optimized with the help of the gradient returned by the face recognition network. In addition, according to the learning situation of the network, face alignment error samples are generated in a targeted manner, which improves the recognition accuracy of the face recognition model for alignment error samples in non-cooperative scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is a flowchart of the steps of a method for training a face recognition model provided in an embodiment of the present application;
[0046] Figure 2 It is a flowchart of the steps of another method for training a face recognition model provided in an embodiment of the present application;
[0047] Figure 3 It is a flowchart of the steps of another method for training a face recognition model provided in an embodiment of the present application;
[0048] Figure 4 It is a flowchart of the steps of an application method of a face recognition model provided in an embodiment of the present application;
[0049] Figure 5 It is a structural diagram of a training device for a face recognition model provided in an embodiment of the present application;
[0050] Figure 6 It is a structural diagram of an application device of a face recognition model provided in an embodiment of the present application;
[0051] Figure 7 is a structural diagram of an electronic device provided in an embodiment of the present application;
[0052] Figure 8 It is a structural diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0054] With the widespread application of facial recognition technology in non-cooperative scenarios (such as security control, visitor monitoring, non-contact attendance, etc.), higher requirements are placed on the accuracy and robustness of facial recognition algorithms. In non-cooperative scenarios, since the position of the acquisition device is usually not facing the face, and the person being recognized will not deliberately cooperate, the performance of the facial recognition system is usually affected by the image quality, such as large facial posture angles, blur, poor lighting conditions, or facial features being blocked. In existing facial recognition systems, facial alignment is a key step. First, the key feature points in the facial image, such as the position of the eyes, nose, and mouth, are detected, and then the facial image is aligned to a standard template based on these position information. Accurate facial alignment is crucial to the performance of face recognition. However, in low-quality images, key information of the face is usually missing, which will inevitably affect the positioning of key feature points and face alignment. Since the existing face recognition model has high requirements for face alignment accuracy, when the key feature point positioning is not accurate enough, it often leads to misrecognition, which in turn affects the effect of face recognition.
[0055] There are two common solutions. One is to build a large-scale dataset containing enough low-quality samples. However, due to the privacy issues and acquisition costs of face data, it is difficult to obtain enough data. The other is to augment the existing data. However, many studies have shown that random data augmentation has no positive effect in face recognition tasks. Therefore, it is very important to design a face recognition method that is robust to low-quality aligned faces.
[0056] Therefore, in order to solve the above problems, it is necessary to improve the model's robustness to face alignment errors through algorithm improvement without introducing additional data and without reducing the original recognition accuracy, thereby enhancing the performance of the existing model in non-cooperative scenarios and improving its overall competitiveness.
[0057] The following is a detailed description of the training method of the face recognition model and the application method of the face recognition model provided in the embodiments of the present application.
[0058] Figure 1 is a flowchart of the steps of a training method for a face recognition model provided in an embodiment of the present application, see Figure 1 , the training method of the face recognition model may include:
[0059] Step 101: Obtain an initial image to be trained.
[0060] In an embodiment of the present application, in the process of training the model, a large number of images are usually required as samples for training. The samples may be low-quality images that have already undergone face recognition. In this way, through these samples, the model can effectively learn face recognition for low-quality images.
[0061] It should be noted that the initial image to be trained may be an image pre-stored in a database, an image uploaded by a user in real time, or an image obtained from the cloud through a network, and the embodiments of the present application do not make specific limitations.
[0062] Step 102: Mapping the initial image to be trained based on a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample.
[0063] In face recognition technology, since the user's posture is different, facial alignment is a key step when using a unified model for recognition. It is necessary to detect the key feature points in the facial image, such as nose, eyes, mouth, etc., and then align the key feature points to the standard template. In this way, the model can be based on a unified standard template during recognition.
[0064] In the embodiment of the present application, it is also necessary to align the initial image to be trained to the standard template. Therefore, the initial image to be trained can be mapped through a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample.
[0065] It should be noted that the initial differentiable gated space transformation matrix can be understood as a transformation matrix obtained according to differentiability and gating mechanism.
[0066] Among them, the transformation matrix is an important concept in mathematical linear algebra. In linear algebra, linear transformation can be represented by a matrix. If T is a linear transformation that maps Rn to Rm, and x is a column vector with n elements, then the m×n matrix A is called the transformation matrix of T. Any linear transformation can be represented by a matrix in a consistent form that is easy to calculate, and multiple transformations can also be easily connected together by matrix multiplication.
[0067] Among them, the gating mechanism is usually related to the gating units in the neural network, such as the forget gate, input gate and output gate in the Long Short-Term Memory (LSTM) network, and the update gate and reset gate in the gated recurrent unit (GRU). These gating units process and learn input data by controlling the flow of information. Although the traditional gating mechanism does not directly involve the transformation matrix, the concept of gating can be extended to a wider range of mathematics and engineering fields to achieve flexible control of spatial transformation.
[0068] Among them, differentiability is a key property in machine learning and deep learning, allowing the algorithm to update the parameters of the model through backpropagation, thereby optimizing the performance of the model. For the transformation matrix, if its elements are part of the model parameters and these parameters are differentiable, then these parameters can be updated through optimization algorithms such as gradient descent.
[0069] It should be noted that in image processing, differentiable spatial transformation matrices can be used to implement image rotation, scaling, and translation, and the strength and range of these transformations can be controlled through gating mechanisms. In machine learning, such transformation matrices can be used as part of the model and their parameters can be optimized through back propagation.
[0070] It should be noted that mapping the initial image to be trained can be understood as converting each pixel in the initial image to be trained into another image, which may specifically include translation, rotation, affine, perspective mapping, scale transformation, etc.
[0071] It should be noted that the initial face alignment error sample can be understood as the error between the mapped image and the standard template image. Since the initial training image is a low-quality image, some pixels may not be mapped or mapped to non-corresponding places during the mapping process. Therefore, there will be errors between the image generated after mapping and the standard template. This error can be called the initial face alignment error sample, that is, in the face alignment process, due to algorithm or data problems, there are large deviations between the predicted feature point positions and the actual feature point positions. These deviations may manifest as feature point offset, missing or misrecognition.
[0072] In some embodiments, the reasons for the generation of the initial face alignment error sample may include: user's posture, expression, ambient lighting, model algorithm and other factors.
[0073] When the face angle is greatly offset from the front face, the face will be blocked, making it difficult to identify feature points, thus generating error samples. For example, when the face is greatly offset to the right, the feature points on the right may move to the middle and be more concentrated, while the feature points on the left are relatively scattered.
[0074] Among them, in the low-quality images obtained from non-cooperative scenes, the characters will show various expressions. For example, exaggerated expressions (such as surprise, laughter, etc.) will cause large changes in the shape of the face, making the real face shape different from the initialized shape (neutral expression), which increases the difficulty of algorithm fitting and thus produces error samples.
[0075] Among them, environmental factors are also very likely to play a role. For example, in photos taken at night in places with poor lighting, the visual features of the face may change drastically, making it difficult to accurately identify the feature points, thus generating error samples.
[0076] Among them, the limitations or deficiencies of the algorithm itself may also lead to the generation of erroneous samples. For example, the algorithm is not robust enough and has insufficient adaptability to complex scenes, which may lead to inaccurate feature point recognition.
[0077] Step 103, back-propagating the preset initial face recognition network based on the initial face alignment error sample to obtain the gradient descent change value of the initial differentiable gated space transformation matrix.
[0078] In an embodiment of the present application, in order to improve the accuracy of facial recognition of low-quality images by the face recognition model, both the face recognition network and the differentiable gated space transformation matrix can be updated and optimized. Specifically, the initial face alignment error sample can be first input into the initial face recognition network for back propagation to perform adversarial data enhancement training, thereby obtaining the gradient descent change value of the initial differentiable gated space transformation matrix.
[0079] It should be noted that backpropagation is a method of training neural networks by adjusting network weights and biases according to output errors. These networks are widely used in a variety of tasks such as image recognition, speech recognition, and natural language processing. The basic principle is to propagate the error between the output value and the expected value of the neural network back to each neuron according to the weight, and adjust the weight of each neuron according to this error. Specifically, for each neuron, the backpropagation algorithm calculates the error of the neuron, and then multiplies this error by the input value and weight of the neuron to obtain an adjustment value. This adjustment value is added to the weight of the neuron, so that the weight of the neuron is updated during the next forward propagation. By continuously adjusting the weights, the backpropagation algorithm can help the neural network gradually learn more complex features and rules, thereby improving the accuracy and generalization ability of the model. The backpropagation algorithm is widely used in various types of neural networks, such as Multilayer Perceptron (MLP), Convolutional Neural Networks (CNN), Recurrent Neural Network (RNN), etc. At the same time, it is also widely used in various different application fields, such as image classification, speech recognition, natural language processing, recommendation systems, etc.
[0080] In an embodiment of the present application, the parameters of the preset initial face recognition network can be frozen for back propagation, and then the gradient descent change value of the initial differentiable gated space transformation matrix can be obtained, so that the differentiable gated space transformation matrix can be updated and optimized subsequently through the gradient descent algorithm.
[0081] Step 104: Using a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value to generate a target face alignment error sample.
[0082] In an embodiment of the present application, after obtaining the gradient descent change value of the initial differentiable gated space transformation matrix, the initial differentiable gated space transformation matrix can be updated by a gradient descent algorithm to obtain an optimized differentiable gated space transformation matrix, and based on the optimized differentiable gated space transformation matrix, the initial image to be trained is mapped again to obtain a target face alignment error sample.
[0083] It should be noted that the gradient descent algorithm is a first-order iterative optimization algorithm for solving the problem of minimizing the objective function and is widely used in parameter optimization in machine learning and artificial intelligence. The gradient descent method is an optimization algorithm based on the function gradient information. The gradient is a vector that indicates the direction in which the function changes fastest (i.e., the rate of change is the largest) at a certain point in this direction. In machine learning, in order to find the minimum value of the objective function, an iterative search can be performed in the opposite direction of the gradient. In an embodiment of the present application, the initial differentiable gated space transformation matrix is updated by the gradient descent algorithm, which can also be understood as an iterative update, that is, the initial differentiable gated space transformation matrix is continuously updated as input through the output iteration until the output converges. The differentiable gated space transformation matrix at this time can be considered to be the optimal differentiable gated space transformation matrix, and the iterative update is completed.
[0084] Step 105, updating the initial face recognition network through the target face alignment error samples to obtain the target face recognition model.
[0085] In an embodiment of the present application, after the initial differentiable gated spatial transformation matrix is updated, the parameters of the differentiable gated spatial transformation matrix are fixed, and the initial face recognition network is iteratively updated through the obtained target face alignment error samples to obtain a target face recognition model, which can be considered as a model that can effectively and accurately identify facial features in low-quality images.
[0086] In summary, in the embodiment of the present application, an initial image to be trained is obtained; based on a preset initial differentiable gated space transformation matrix, the initial image to be trained is mapped to obtain an initial face alignment error sample; wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and gating mechanism, and based on the initial face alignment error sample, a preset initial face recognition network is back-propagated to obtain a gradient descent change value of the initial differentiable gated space transformation matrix; through a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value to generate a target face alignment error sample; through the target face alignment error sample, the initial face recognition network is updated to obtain a target face recognition model. A low-quality image to be recognized is obtained; the low-quality image to be recognized is input into the target face recognition model to obtain an output face recognition result. In this scheme, the differentiable gated space transformation matrix is updated and optimized, a gating mechanism is introduced to adjust the gradient to avoid excessive disturbance, and the parameters are optimized with the help of the gradient returned by the face recognition network. In addition, according to the learning situation of the network, face alignment error samples are generated in a targeted manner, which improves the recognition accuracy of the face recognition model for samples with alignment errors.
[0087] Figure 2 This is a flowchart of the steps of another face recognition model training method provided by this application, see Figure 2 , the method may include the following steps:
[0088] Step 201: Obtain an initial image to be trained.
[0089] In the embodiment of the present application, for the description of step 201, please refer to the detailed description of step 101 in the above embodiment, and the embodiment of the present application will not be repeated.
[0090] Step 202: remap the positions of the pixels in the initial image to be trained by using an affine transformation matrix to obtain a first image.
[0091] In an embodiment of the present application, the mapping for the initial image to be trained may include remapping, which may be implemented by an affine transformation matrix. Affine transformation is a linear transformation between two-dimensional coordinates and two-dimensional coordinates, which may specifically include operations such as translation, rotation, scaling, and shearing, but perspective is not allowed (i.e., maintaining straight line parallelism and proportion). Affine transformation can be represented by a 3x3 matrix, in which the last row is usually [0, 0, 1], which is used for homogeneous coordinate representation.
[0092] In some embodiments, a typical affine transformation matrix is of the form:
[0093]
[0094] Among them, a and e control scaling and rotation, b and d control shearing, and c and f control translation.
[0095] Step 203: Perform an inverse transformation on the first image using the initial differentiable gated space transformation matrix to obtain a second image.
[0096] In the embodiment of the present application, the initial differentiable gated space transformation matrix is obtained by setting gating coefficients on the affine transformation matrix.
[0097] In some embodiments, for any pixel point (i, j) in the initial image to be trained, remapping is performed, which can be expressed by the following formula:
[0098]
[0099] Among them, P v (i) represents the remapping result of the horizontal coordinate i, P u (j) represents the remapping result of the vertical coordinate j.
[0100] In some embodiments, the initial differentiable spatial transformation matrix operation may be defined as T θ , whose parameter θ is defined as:
[0101]
[0102] Among them, φ∈[0, 2π] represents the rotation angle, Δu and Δv represent the horizontal and vertical displacements respectively, λ represents the scaling factor, tanh(α), tanh(β), tanh(γ) and tanh(δ) are gating coefficients, which are used to prevent the face image from changing too much during the transformation and ensure the stability of the optimization process.
[0103] In some embodiments, for each position (P v (i), P u (j)), after T θ The mapped position is represented as follows:
[0104]
[0105] in, The inverse transformation of the initial differentiable spatial transformation matrix can be represented to obtain the second image (m, n).
[0106] Step 204: compare the second image with the standard face template image to obtain an initial face alignment error sample.
[0107] In the embodiment of the present application, the second image can be considered as an image obtained after mapping. By comparing the second image with the standard face template image, the error situation of the low-quality image can be obtained, that is, the initial face alignment error sample can be obtained.
[0108] In some embodiments, comparing the second image with the standard face template image to obtain an initial face alignment error sample may specifically include the following steps:
[0109] Sub-step 2041, interpolating the pixels in the second image using a bilinear interpolation algorithm to obtain a third image.
[0110] Sub-step 2042, comparing the third image with the standard face template image to obtain an initial face alignment error sample.
[0111] It should be noted that since (m, n) may not be aligned with the integer pixel index in the input image, bilinear interpolation B is introduced to calculate the specific pixel value. For the image I^ after the original image I is transformed, the value of each pixel can be expressed as:
[0112]
[0113] Among them, P v (i) represents the remapping result of the horizontal coordinate i, P u (j) represents the remapping result of the ordinate j, is the inverse transform, B represents bilinear interpolation, Represents the coordinates in the transformed image.
[0114] It should be noted that bilinear interpolation is also called bilinear interpolation. It is an extension of linear interpolation for interpolation functions with two variables. Its core idea is to perform linear interpolation in two directions (usually X and Y directions). Bilinear interpolation is based on the assumption of linear change, that is, the pixel value changes linearly between two known points. By finding the four pixels closest to the target point, the pixel values of these four points are used to calculate the pixel value of the target point through two single linear interpolations (first X then Y or first Y then X). In image processing, bilinear interpolation can obtain smoother image quality and avoid sudden changes in pixel values. However, since bilinear interpolation has the properties of a low-pass filter, it may make the image blurred to a certain extent.
[0115] Assume that the known function f is in Q 11 =(x1,y1),Q 12 =(x1,y2),Q 21 =(x2, y1) and Q 22=(x2, y2), and to find the value of the unknown function f at point P = (x, y), we can first interpolate in the x direction to get the values of R1 and R2, and then perform linear interpolation in the y direction to get the value of P.
[0116] In this way, the third image obtained after interpolation is compared with the standard face template image to obtain an initial face alignment error sample.
[0117] Step 205: input the initial face alignment error sample into the initial face recognition network to obtain an initial loss function.
[0118] In an embodiment of the present application, during the training process of adversarial data enhancement, an initial loss function can be obtained first. The initial loss function can be a common loss function in face recognition, such as cosface, arcface, etc.
[0119] Step 206 , back-propagating the initial differentiable gated space transformation matrix through the initial loss function to obtain a gradient descent change value.
[0120] It should be noted that the steps of the back propagation algorithm can be understood as follows: the input data is passed from the input layer to the output layer through the hidden layer, and the network calculates the output of each node through the connection between the layers (i.e., weights), and finally generates the prediction result of the network; then, the predicted output of the network is compared with the true value, and the loss function (such as mean square error, etc.) is calculated; then, the error is back-propagated to each neuron according to the weight, and the weight of each neuron is adjusted according to the error; the above steps are repeated until the preset number of iterations is reached or other stop conditions are met. It can be seen that back propagation is the process of updating parameters through the cyclic iteration of the loss function. Therefore, in the embodiment of the present application, the initial differentiable gated space transformation matrix is back-propagated through the initial loss function. In order to stabilize the training, the step-by-step parameter update is adopted during the update, so it can be optimized according to the gradient of the initial differentiable gated space transformation matrix, that is, the gradient descent change value of the initial differentiable gated space transformation matrix is obtained.
[0121] In some embodiments, the optimization goal is to find a suitable set of θ to maximize the learning target L, that is, to try to generate samples that have little impact on humans but can cause the machine learning model to make incorrect predictions:
[0122] θ * = argmax θ L(F ψ ; T θ (I),y)
[0123] Among them, y is the identity information corresponding to the face image I, and L is the commonly used loss function for face recognition (such as cosface, arcface, etc.). Finally, the initial differentiable gated space transformation matrix T θ The parameters θ and the face recognition network F ψ Combined with the parameter ψ, the overall optimization goal is:
[0124]
[0125] In the context of argmax g(t), "arg" represents a subset of the domain, the elements of which enable the function g(t) to achieve the maximum value, and the argmax function is used to find the set of parameters or variables that maximizes the objective function, while the arg function in the context of argmax represents the elements in this set. Similarly, in the context of argmin g(t), "arg" represents a subset of the domain, the elements of which enable the function g(t) to achieve the minimum value, and the argmin function is used to find the set of parameters or variables that minimizes the objective function, while the arg function in the context of argmin represents the elements in this set.
[0126] Step 207, using a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value, the preset step size, and the preset adversarial disturbance range to obtain a target differentiable gated space transformation matrix.
[0127] It should be noted that the gradient descent algorithm is an optimization algorithm based on the function gradient information. The gradient is a vector that indicates the direction in which the function changes fastest (i.e., the rate of change is the largest) at a certain point. In machine learning, in order to find the minimum value of the objective function, an iterative search can be performed in the opposite direction of the gradient.
[0128] In machine learning, the objective function is usually a loss function, which is used to evaluate the quality of the model. The objective function can then be differentiated to obtain the gradient. The gradient is a vector whose direction is the direction in which the function value increases fastest, and its magnitude is the rate of change of the function in that direction. Then, the parameters are updated in the opposite direction of the gradient, that is, the new value of the parameter is equal to the old value minus the gradient multiplied by a step size (also called the learning rate). Repeat the above steps until the termination condition is met (such as the magnitude of the gradient vector is close to 0, or the maximum number of iterations is reached).
[0129] In some embodiments, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value, the preset step size, and the preset adversarial disturbance range through the gradient descent algorithm to obtain the target differentiable gated space transformation matrix, which may specifically include the following steps:
[0130] Sub-step 2071 , projecting the initial differentiable gated space transformation matrix according to a preset anti-disturbance range to obtain a first differentiable gated space transformation matrix.
[0131] Sub-step 2072, iteratively updating the first differentiable gated space transformation matrix according to the gradient descent change value and the preset step size to obtain a target differentiable gated space transformation matrix.
[0132] In some embodiments, during the training process of updating the differentiable gated spatial transformation matrix, in order to stabilize the training, a step-by-step parameter update is adopted during the update. The initial face recognition network F can be frozen first. ψ The parameters of the gradient descent are back-propagated, and then T is obtained θ The gradient of (I) is optimized by k-step projected gradient descent, specifically:
[0133]
[0134] D={θ|||T θ (I)-I||2≤ρ}
[0135] Where sgn represents the sign function, σ is the optimization step size, and D is the permissible adversarial perturbation range, which stipulates that the 2-norm of the face alignment error sample and the original sample is less than the radius ρ, proj D The meaning of (d) is to project d into the interval specified by D.
[0136] It can be understood that the adversarial perturbation range can set the range of face alignment error samples, that is, the range of the differentiable gated space transformation matrix can be limited. Therefore, the differentiable gated space transformation matrix can be projected according to the adversarial perturbation range, and then the gradient descent calculation can be performed.
[0137] Step 208 , mapping the initial image to be trained through the target differentiable gated space transformation matrix to obtain a target face alignment error sample.
[0138] In an embodiment of the present application, after updating and optimizing the differentiable gated spatial transformation matrix, the parameters of the optimized target differentiable gated spatial transformation matrix can be fixed, and the face recognition network can continue to be trained based on the optimized target differentiable gated spatial transformation matrix. Therefore, the target face alignment error samples can be obtained first. Since the target differentiable gated spatial transformation matrix is an optimized and fixed matrix, the target face alignment error samples obtained after mapping the initial image to be trained through the target differentiable gated spatial transformation matrix can be considered as samples that combine differentiable spatial transformation, adversarial data enhancement and gated restriction, and are used to train the face recognition model.
[0139] Step 209: input the target face alignment error sample into the initial face recognition network to obtain the target loss function.
[0140] In the embodiment of the present application, the objective loss function can be expressed by the following formula:
[0141] loss=L(F ψ ; I,y)+L(F ψ ; T θ (I),y)+l2(F ψ (T θ (I)),F ψ (I))
[0142]
[0143] Among them, l2 is the square loss function, which further improves the network's anti-interference ability by shortening the feature distance between the target face alignment error sample and the original sample.
[0144] Step 210, using a gradient descent algorithm, the initial face recognition network is updated based on the target loss function to obtain a target face recognition model.
[0145] In the embodiment of the present application, the process of updating the initial face recognition network is the same as the process of iteratively updating the differentiable gated space transformation matrix in the above steps. Both can be considered to be based on the loss function and implemented by the gradient descent algorithm, which will not be elaborated here.
[0146] In summary, in the embodiment of the present application, by updating and optimizing the differentiable gated space transformation matrix, a gating mechanism is introduced to adjust the gradient to avoid excessive disturbance, and the parameters are optimized with the help of the gradient returned by the face recognition network. In addition, according to the learning situation of the network, face alignment error samples are generated in a targeted manner, thereby improving the recognition accuracy of the face recognition model for samples with alignment errors. Without introducing additional data and without reducing the original recognition accuracy, the robustness of the model to face alignment errors is improved through algorithm improvement, thereby enhancing the recognition accuracy of the existing model in non-cooperative scenarios.
[0147] Figure 3 is a flowchart of the steps of a training method for a face recognition model provided in an embodiment of the present application, see Figure 3 , the training method of the face recognition model may include:
[0148] Step 301 : Generate a differentiable gated space transformation matrix, define a mapping rule for each pixel, and initialize the differentiable gated space transformation matrix.
[0149] Step 302: Generate an initial face alignment error sample.
[0150] Step 303: Send the face alignment error samples and the original samples together into the face recognition network to calculate the loss function.
[0151] Step 304, freeze the face recognition network parameters for back propagation to obtain the gradient of the differentiable gated space transformation matrix.
[0152] Step 305 , define the adversarial perturbation range, and optimize the differentiable gated space transformation matrix by k-step projected gradient descent.
[0153] Step 306, fix the differentiable gated space transformation matrix, generate face alignment error samples, and send them together with the original samples to the face recognition network to calculate the loss function and optimize the face recognition network.
[0154] Combination Figure 3 It can be seen that the update and optimization of the differentiable gated space transformation matrix and the face recognition network in the embodiments of the present application are iterative processes, that is, they are carried out in a continuous cycle, and the loss function is continuously generated according to the error samples, and then the differentiable gated space transformation matrix and the face recognition network are updated and optimized again in a cycle.
[0155] The embodiment of the present application combines differentiable spatial transformation and adversarial data enhancement to dynamically generate alignment error samples that maximize training benefits, and embeds differentiable spatial transformation and adversarial data enhancement into the existing face recognition model training process.
[0156] In the differentiable space transformation part, a differentiable gated space transformation matrix is designed, and a gate mechanism is introduced to adjust the gradient to avoid excessive disturbance. The parameters are optimized with the help of the gradient returned by the face recognition network. During the optimization, k-step projected gradient descent is introduced, and the adversarial disturbance range is designed as an optimization constraint to ensure that the optimization process is efficient and stable.
[0157] In the adversarial data enhancement part, an adversarial training optimization process was constructed for the face recognition problem, and a step-by-step parameter update method was adopted to maximize the adversarial loss while minimizing the face recognition loss. According to the learning status of the network at each moment, face alignment error samples were generated in a targeted manner, which improved the recognition accuracy of the face recognition model for samples with alignment errors while not causing negative impact on samples without alignment errors.
[0158] Figure 4 is a flowchart of the steps of an application method of a face recognition model provided in an embodiment of the present application, see Figure 4 , the application method of the face recognition model may include:
[0159] Step 401: Obtain a low-quality image to be identified.
[0160] In an embodiment of the present application, the low-quality image may be an image in which the user's posture indicates that the user is not facing the camera, or an image in which the user's facial expression is large, or an image in which the ambient lighting is extreme, etc.
[0161] Step 402: input the low-quality image to be recognized into the target face recognition model to obtain an output face recognition result.
[0162] The target face recognition model is obtained by training using the face recognition model training method introduced in the above embodiment.
[0163] In summary, after inputting the low-quality image to be recognized into the target face recognition model, the required face recognition result can be obtained, which can improve the recognition accuracy of the face recognition model for samples with alignment errors in non-cooperative scenarios.
[0164] Figure 5 is a structural diagram of a training device for a face recognition model provided in an embodiment of the present application. The training device 500 for a face recognition model may include:
[0165] A first acquisition module 501 is used to acquire an initial image to be trained;
[0166] An image mapping module 502 is used to map the initial image to be trained based on a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample, wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and a gating mechanism;
[0167] A back propagation module 503 is used to perform back propagation on a preset initial face recognition network based on the initial face alignment error sample to obtain a gradient descent change value of an initial differentiable gated space transformation matrix;
[0168] A matrix updating module 504 is used to update the initial differentiable gated space transformation matrix based on the gradient descent change value through a gradient descent algorithm to generate a target face alignment error sample;
[0169] The model updating module 505 is used to update the initial face recognition network through the target face alignment error samples to obtain the target face recognition model.
[0170] Optionally, the image mapping module 502 may specifically include:
[0171] A remapping submodule, used to remap the positions of the pixels in the initial image to be trained by using an affine transformation matrix to obtain a first image;
[0172] A matrix inverse transformation submodule, used to perform an inverse transformation on the first image to obtain a second image by using an initial differentiable gated space transformation matrix, wherein the initial differentiable gated space transformation matrix is obtained by setting gate coefficients on the affine transformation matrix;
[0173] The image comparison submodule is used to compare the second image with the standard face template image to obtain an initial face alignment error sample.
[0174] Optionally, the image comparison submodule may specifically include:
[0175] An interpolation unit, configured to perform interpolation processing on the pixels in the second image by using a bilinear interpolation algorithm to obtain a third image;
[0176] The image comparison unit is used to compare the third image with the standard face template image to obtain an initial face alignment error sample.
[0177] Optionally, the back propagation module 503 may specifically include:
[0178] A first loss function generating submodule is used to input the initial face alignment error sample into the initial face recognition network to obtain an initial loss function;
[0179] The back-propagation submodule is used to back-propagate the initial differentiable gated space transformation matrix through the initial loss function to obtain the gradient descent change value.
[0180] Optionally, the matrix updating module 504 may specifically include:
[0181] A matrix update submodule is used to update the initial differentiable gated space transformation matrix based on the gradient descent change value, the preset step size and the preset adversarial disturbance range through a gradient descent algorithm to obtain a target differentiable gated space transformation matrix;
[0182] The image mapping submodule is used to map the initial image to be trained through the target differentiable gated space transformation matrix to obtain the target face alignment error sample.
[0183] Optionally, the matrix update submodule may specifically include:
[0184] A matrix projection unit, used to project the initial differentiable gated space transformation matrix according to a preset anti-disturbance range to obtain a first differentiable gated space transformation matrix;
[0185] The matrix updating unit is used to iteratively update the first differentiable gated space transformation matrix according to the gradient descent change value and the preset step size to obtain the target differentiable gated space transformation matrix.
[0186] Optionally, the model updating module 505 may specifically include:
[0187] The second loss function generating submodule is used to input the target face alignment error sample into the initial face recognition network to obtain the target loss function;
[0188] The model update submodule is used to update the initial face recognition network based on the target loss function through the gradient descent algorithm to obtain the target face recognition model.
[0189] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0190] Figure 6 6 is a schematic diagram of a structure of an application device of a face recognition model provided in an embodiment of the present application. The application device 600 of the face recognition model may include:
[0191] The second acquisition module 601 is used to acquire a low-quality image to be identified;
[0192] The model application module 602 is used to input the low-quality image to be recognized into the target face recognition model to obtain an output face recognition result. The target face recognition model is trained by the face recognition model training method of the above embodiment.
[0193] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0194] See also Figure 7 , the electronic device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .
[0195] The processing component 702 generally controls the overall operation of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0196] The memory 704 is used to store various types of data to support the operation of the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phone book data, messages, pictures, multimedia, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0197] The power supply component 706 provides power to the various components of the electronic device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 700.
[0198] The multimedia component 708 includes an interface that provides an output interface between the electronic device 700 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0199] The audio component 710 is used to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the electronic device 700 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0200] The input / output I / O interface 712 provides an interface between the processing component 702 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0201] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 can detect the open / closed state of the electronic device 700, the relative positioning of components, such as the display and keypad of the electronic device 700, and the sensor assembly 714 can also detect the position change of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and the temperature change of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0202] The communication component 716 is used to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0203] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement a method for displaying a vehicle-road collaborative scenario provided in an embodiment of the present application.
[0204] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by a processor 720 of an electronic device 700 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0205] Figure 88 is a block diagram of an electronic device 800 according to another embodiment of the present invention. For example, the electronic device 800 may be provided as a server. Figure 8 The electronic device 800 includes a processing component 822, which further includes one or more processors, and a memory resource represented by a memory 832 for storing instructions executable by the processing component 822, such as an application. The application stored in the memory 832 may include one or more modules, each of which corresponds to a set of instructions. In addition, the processing component 822 is configured to execute instructions to execute a method for displaying a vehicle-road cooperative scenario provided in an embodiment of the present application.
[0206] The electronic device 800 may also include a power supply component 826 configured to perform power management of the electronic device 800, a wired or wireless network interface 850 configured to connect the electronic device 800 to a network, and an input / output (I / O) interface 858. The electronic device 800 may operate based on an operating system stored in the memory 832, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM or the like.
[0207] In an embodiment of the present application, the memory 832 may be used to store software programs and various data. The memory 832 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 832 may include a volatile memory or a non-volatile memory, or the memory 832 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 832 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0208] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.
[0209] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image super-resolution reconstruction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0210] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0211] An embodiment of the present application also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the super-resolution reconstruction method embodiment of the above-mentioned image, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0212] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0213] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A training method for a face recognition model, characterized in that: The method comprises: Obtain the initial image to be trained; Based on a preset initial differentiable gated space transformation matrix, the initial image to be trained is mapped to obtain an initial face alignment error sample, wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and gating mechanism; Performing back propagation on a preset initial face recognition network based on the initial face alignment error sample to obtain a gradient descent change value of the initial differentiable gated space transformation matrix; By using a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value to generate a target face alignment error sample; The initial face recognition network is updated through the target face alignment error samples to obtain a target face recognition model.
2. The method according to claim 1, characterized in that The initial image to be trained is mapped based on a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample, including: Remapping the positions of the pixels in the initial image to be trained by using an affine transformation matrix to obtain a first image; Performing an inverse transformation on the first image by using the initial differentiable gated space transformation matrix to obtain a second image, wherein the initial differentiable gated space transformation matrix is obtained by setting a gating coefficient on the affine transformation matrix; The second image is compared with a standard face template image to obtain the initial face alignment error sample.
3. The method according to claim 2, characterized in that The step of comparing the second image with a standard face template image to obtain the initial face alignment error sample includes: Performing interpolation processing on the pixels in the second image by a bilinear interpolation algorithm to obtain a third image; The third image is compared with the standard face template image to obtain the initial face alignment error sample.
4. The method according to claim 1, characterized in that: The back propagation of the preset initial face recognition network based on the initial face alignment error sample to obtain the gradient descent change value of the initial differentiable gated space transformation matrix includes: Inputting the initial face alignment error sample into the initial face recognition network to obtain an initial loss function; The initial differentiable gated space transformation matrix is back-propagated through the initial loss function to obtain the gradient descent change value.
5. The method according to claim 1, characterized in that The method of updating the initial differentiable gated space transformation matrix based on the gradient descent change value by using the gradient descent algorithm to generate a target face alignment error sample includes: By using a gradient descent algorithm, the initial differentiable gated space transformation matrix is updated based on the gradient descent change value, a preset step size, and a preset adversarial disturbance range to obtain a target differentiable gated space transformation matrix; The initial image to be trained is mapped by using the target differentiable gated space transformation matrix to obtain the target face alignment error sample.
6. The method according to claim 5, characterized in that The method updates the initial differentiable gated space transformation matrix based on the gradient descent change value, the preset step size and the preset adversarial disturbance range through the gradient descent algorithm to obtain the target differentiable gated space transformation matrix, including: According to the preset counter-disturbance range, projecting the initial differentiable gated space transformation matrix to obtain a first differentiable gated space transformation matrix; The first differentiable gated space transformation matrix is iteratively updated according to the gradient descent change value and the preset step size to obtain the target differentiable gated space transformation matrix.
7. The method according to claim 1, characterized in that The updating of the initial face recognition network by using the target face alignment error sample to obtain a target face recognition model includes: Inputting the target face alignment error sample into the initial face recognition network to obtain a target loss function; The initial face recognition network is updated based on the target loss function through a gradient descent algorithm to obtain the target face recognition model.
8. A face recognition method, characterized in that: The method comprises: Obtain a low-quality image to be recognized; The low-quality image to be recognized is input into a target face recognition model to obtain an output face recognition result, wherein the target face recognition model is trained by the face recognition model training method described in any one of claims 1 to 7.
9. A training device for a face recognition model, characterized in that: The device comprises: A first acquisition module, used to acquire an initial image to be trained; An image mapping module is used to map the initial image to be trained based on a preset initial differentiable gated space transformation matrix to obtain an initial face alignment error sample, wherein the initial differentiable gated space transformation matrix is a transformation matrix obtained according to differentiability and a gating mechanism; A back propagation module, used for performing back propagation on a preset initial face recognition network based on the initial face alignment error sample to obtain a gradient descent change value of the initial differentiable gated space transformation matrix; A matrix updating module, configured to update the initial differentiable gated space transformation matrix based on the gradient descent change value by a gradient descent algorithm to generate a target face alignment error sample; The model updating module is used to update the initial face recognition network through the target face alignment error sample to obtain a target face recognition model.
10. An application device of a face recognition model, characterized in that: The device comprises: A second acquisition module is used to acquire a low-quality image to be identified; A model application module is used to input the low-quality image to be recognized into a target face recognition model to obtain an output face recognition result, wherein the target face recognition model is trained by the face recognition model training method described in any one of claims 1 to 7.
11. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 8 when executing the program.
12. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 8.
Citation Information
Cited By
Face recognition model training method and apparatus, face recognition method, device, and medium
WO2026124196A1