Model training method, face recognition method, device, equipment, medium and product
By combining the feature enhancement network and the recognition network and adjusting the parameters based on the feature error, the overfitting problem in the 3D face recognition network training was solved and the recognition accuracy was improved.
Patent Information
- Application Number
- CN202111531367.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-12-14
AI Technical Summary
Existing three-dimensional face recognition networks are prone to overfitting during training, resulting in a decrease in recognition accuracy.
A feature enhancement network is used to perform feature enhancement processing on low-quality facial images, and facial features are extracted through a recognition network. The model parameters are adjusted based on feature errors to avoid pixel-level error training.
It improves the accuracy of face recognition, avoids overfitting of feature learning, and enhances the model's ability to recognize low-quality face images.
Smart Images

Figure CN114140862B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training method, face recognition method, device, equipment, medium and product. Background Art
[0002] Nowadays, three-dimensional facial recognition technology has been widely promoted and applied, and its application scenarios include gate clocking, rider identity recognition, offline payment, etc.
[0003] Related technologies use 3D face recognition networks to identify 3D faces in the aforementioned application scenarios. Generally, 3D face recognition networks are trained using pairs of high-quality and low-quality face images. A high-quality face image is one with image quality exceeding a specified threshold, while a low-quality face image is one with image quality below the specified threshold.
[0004] This training method can easily cause the 3D face recognition network to overfit during feature learning. Summary of the Invention
[0005] The present application provides a model training method, face recognition method, apparatus, device, medium, and product. In this model training method, facial features are extracted from different images, and model parameters are adjusted based on the error between facial features. Compared to adjusting model parameters based on the error between pixels, this method can avoid overfitting of feature learning in the model. The model also adds a feature enhancement network that can enhance the features of facial images before face recognition, thereby improving the accuracy of face recognition. The technical solution is as follows:
[0006] According to one aspect of the present application, a model training method for a face recognition model is provided, wherein the face recognition model includes a feature enhancement network and a pre-trained recognition network, the method comprising:
[0007] Acquire at least one group of facial image samples, each group of facial image samples including a first image sample and a second image sample, where the second image sample is a sample obtained by amplifying the first image sample;
[0008] extracting a first facial feature from the first image sample through a recognition network;
[0009] and performing facial feature enhancement processing on the second image sample through the feature enhancement network to obtain an enhanced image sample; and extracting the second facial feature from the enhanced image sample through the recognition network;
[0010] Based on the feature error between the first facial feature and the second facial feature, the network parameters of the feature enhancement network are adjusted to obtain a trained face recognition model.
[0011] According to another aspect of the present application, a face recognition method is provided, using the face recognition model obtained in the above-mentioned model training method, the method comprising:
[0012] Calling the face recognition model to perform facial feature enhancement processing on the collected face image to obtain an enhanced image;
[0013] Calling the face recognition model to extract features from the enhanced image to obtain facial features in the face image;
[0014] Call the face recognition model to perform recognition based on facial features to obtain face recognition results.
[0015] According to another aspect of the present application, a model training device for a face recognition model is provided, wherein the face recognition model includes a feature enhancement network and a pre-trained recognition network, and the device includes:
[0016] A sample acquisition module is used to acquire at least one group of face image samples, each group of face image samples includes a first image sample and a second image sample, and the second image sample is a sample obtained by amplifying the first image sample;
[0017] A feature acquisition module is configured to extract a first facial feature from a first image sample using a recognition network; perform facial feature enhancement processing on a second image sample using a feature enhancement network to obtain an enhanced image sample; and extract a second facial feature from the enhanced image sample using a recognition network;
[0018] The parameter adjustment module is used to adjust the network parameters of the feature enhancement network based on the feature error between the first facial feature and the second facial feature to obtain a trained face recognition model.
[0019] According to another aspect of the present application, a face recognition device is provided, which uses the face recognition model obtained in the above-mentioned model training method, and the device includes:
[0020] The feature enhancement module is used to call the face recognition model to perform facial feature enhancement processing on the collected face image to obtain an enhanced image;
[0021] The feature extraction module is used to call the face recognition model to extract features from the enhanced image and obtain facial features in the face image;
[0022] The face recognition module is used to call the face recognition model to perform recognition based on facial features and obtain face recognition results.
[0023] According to another aspect of the present application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the model training method of the face recognition model as described above, or the face recognition method as described above.
[0024] According to another aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the model training method of the face recognition model as described above, or the face recognition method as described above.
[0025] According to another aspect of the present application, a computer program product (or computer program) is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the model training method for the face recognition model described above, or the face recognition method described above.
[0026] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0027] The face recognition model in the above model training method includes two parts: a feature enhancement network and a pre-trained recognition network; the first face feature is extracted from the first image sample through the recognition network, and the feature enhancement network is used to perform feature enhancement processing on the amplified sample of the first image sample (that is, the second image sample), and then the second face feature is extracted from the enhanced image sample through the recognition network; based on the feature error between the first face feature and the second face feature, the network parameters of the feature enhancement network are adjusted to improve the ability of the feature enhancement network to enhance face features, so that the face recognition model can improve the image quality of the face image through the feature enhancement network before extracting the face feature, so that higher quality face features can be extracted from the enhanced face image (the higher quality here is relative to the face features extracted directly from the face image); and compared with using the error between pixels to train the model, training the model through the error between features can avoid overfitting of feature learning in the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0029] Figure 1 A schematic diagram of the structure of a face recognition model provided by an exemplary embodiment of the present application is shown;
[0030] Figure 2 A flowchart of a model training method for a face recognition model provided by an exemplary embodiment of the present application is shown;
[0031] Figure 3 A schematic diagram of an augmented human face provided by an exemplary embodiment of the present application is shown;
[0032] Figure 4 A flowchart of a model training method for a face recognition model provided by another exemplary embodiment of the present application is shown;
[0033] Figure 5 A flowchart of a face recognition method provided by an exemplary embodiment of the present application is shown;
[0034] Figure 6 A schematic diagram of a face image before and after noise reduction provided by an exemplary embodiment of the present application is shown;
[0035] Figure 7 A schematic diagram showing a face image before and after noise reduction provided by another exemplary embodiment of the present application is shown;
[0036] Figure 8 A block diagram of a model training device for a face recognition model provided by an exemplary embodiment of the present application is shown;
[0037] Figure 9 A block diagram of a face recognition device provided by an exemplary embodiment of the present application is shown;
[0038] Figure 10 A schematic structural diagram of a computer device provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0040] First, let’s introduce several terms involved in this application:
[0041] Face recognition is a biometric technology that identifies people based on their facial features. It uses a camera or video camera to capture images or video streams containing faces, automatically detects and tracks faces within the images, and then performs facial recognition on the detected faces. This technology is also known as portrait recognition or facial recognition.
[0042] 3D face recognition technology, which uses 3D facial images to achieve face recognition, fully utilizes spatial geometric information and overcomes the limitations of 2D face recognition in terms of lighting, makeup, and posture. 3D facial images captured by sensors often have various defects, such as holes of varying sizes and locations (i.e., missing pixel values), random noise that is difficult to model, inherent noise that varies with the sensor and the scene being captured, and information loss when sampling as depth maps. The quality of 3D facial images directly affects the recognition accuracy of the 3D face recognition network.
[0043] Typically, 3D face recognition networks are trained using paired high-quality and low-quality facial images as training data to improve the network's recognition accuracy for low-quality facial images. However, during training, adjusting the model parameters of the 3D face recognition network based on the pixel-level recognition loss between high-quality and low-quality facial images can lead to overfitting of the resulting 3D face recognition network during feature learning.
[0044] Therefore, in order to solve the above problems, this application provides a model training method for a face recognition model. For example, Figure 1 The face recognition model is designed with two parts: a feature enhancement network 110 and a recognition network 120; the feature enhancement network 110 is used to enhance the features of the face in the three-dimensional face image so that the enhanced image can provide more accurate facial features; the recognition network 120 is used to extract facial features from the three-dimensional face image (including the three-dimensional face image before and after feature enhancement).
[0045] For training the face recognition model, first, the recognition network 120 is pre-trained separately to obtain a recognition network 120 with face recognition capabilities. Then, a first image sample is input into the recognition network 120, and the recognition network 120 outputs a first facial feature corresponding to the first image sample. Furthermore, a second image sample is input into the feature enhancement network 110, and facial feature enhancement processing is performed on the second image sample to obtain an enhanced image sample. The enhanced image sample is then input into the recognition network 120, and the recognition network 120 outputs a second facial image corresponding to the second image sample. The second image sample may be obtained by adding artificial noise to the first image sample, so that the image quality of the second image sample is lower than that of the first image sample. The first facial feature can be used as a reference feature to calculate the feature error (i.e., feature loss) between the second facial feature and the first facial feature. Based on the feature error, the network parameters of the feature enhancement network 110 are adjusted. After multiple parameter adjustments, the trained feature enhancement network 110 is obtained. After completing the network parameter adjustments of the recognition network 120 and the feature enhancement network 110 in sequence, the third image sample is also used to adjust the overall parameters of the face recognition model, and finally the training of the face recognition model is completed.
[0046] This face recognition model adds a feature enhancement network that can enhance facial features before face recognition, allowing the recognition network to obtain more accurate facial features. Compared with adjusting network parameters based on recognition loss between pixels, this method of adjusting network parameters based on recognition loss between features can avoid overfitting of feature learning in the model. For detailed implementation of the training method of the face recognition model provided in this application, please refer to the following examples.
[0047] Figure 2 A flowchart of a model training method for a face recognition model provided by an exemplary embodiment of the present application is shown. The method is applied to a computer device. Exemplarily, the computer device may be a terminal or a server. The method includes:
[0048] Step 210: Obtain at least one group of face image samples, each group of face image samples includes a first image sample and a second image sample, and the second image sample is a sample obtained by amplifying the first image sample.
[0049] For example, each first image sample may correspond to multiple groups of facial image samples, wherein the second image samples in the multiple groups of facial image samples are different. Alternatively, each first image sample may correspond to a group of facial image samples, wherein the group of facial image samples includes multiple different second image samples.
[0050] The facial image sample may be prepared before model training. Exemplarily, the computer device performs amplification processing on the first image sample using at least one of the following amplification methods:
[0051] • Add noise to the first image sample.
[0052] For example, the noise may be artificial noise, shot noise, dark noise, or readout noise. The computer device may randomly add one or more of the above noises to the first image sample to obtain a second image sample corresponding to the first image sample.
[0053] Down-sampling or up-sampling the first image samples.
[0054] The computer device randomly downsamples the first image sample to obtain a second image sample; or randomly upsamples the first image sample to obtain a second image sample; or randomly downsamples and randomly upsamples the first image sample in sequence to obtain the second image sample; or randomly upsamples and randomly downsamples the first image sample in sequence to obtain the second image sample.
[0055] Adjust the depth distance between the person and the background in the first image sample.
[0056] The computer device adjusts the depth distance between the person and the background in the first image sample to obtain a second image sample after distance amplification, where the background refers to the pixel area excluding the person in the first image sample. Exemplarily, the computer device uses a random distance to perform distance amplification on the first image sample to obtain the second image sample.
[0057] like Figure 3 As shown, the computer equipment amplifies the original image to obtain a noise-amplified image, a distance-amplified image, an occlusion-amplified image and an attitude-amplified image, among which "Pitch Attitude Amplification_1" and "Pitch Attitude Amplification_2" are obtained by amplifying at different elevation angles, and "Pitch Attitude Amplification_3" and "Pitch Attitude Amplification_4" are obtained by amplifying at different elevation angles; "Yaw Attitude Amplification_1", "Yaw Attitude Amplification_2" and "Yaw Attitude Amplification_3" are obtained by amplifying at different rightward yaw angles, and "Yaw Attitude Amplification_4", "Yaw Attitude Amplification_5" and "Yaw Attitude Amplification_6" are obtained by amplifying at different leftward yaw angles.
[0058] After obtaining the second image sample, the computer device stores it in the memory of the computer device corresponding to the first image sample, or stores it in a database dedicated to training sample storage; when performing model training, the computer device reads the required facial image samples from the memory or database.
[0059] The face recognition model includes a feature enhancement network and a pre-trained recognition network. For the first image sample, step 220 is executed to extract facial features; for the second image sample, steps 230 to 240 are executed to extract facial features, as shown below:
[0060] Step 220: extracting a first facial feature from the first image sample through a recognition network.
[0061] The computer device performs M feature extractions based on the first image sample through a recognition network to obtain M first sample feature vectors of different levels; the level is used to indicate the number of feature extractions, and the first sample feature vector of each level is extracted from the first sample feature vector of the previous level; the recognition network performs multi-scale feature fusion (Multi-Scale Feature Fusion) on the M first sample feature vectors to obtain a fused first sample feature vector, where M is an integer greater than 1; the recognition network performs feature learning under a spatial attention vector mechanism (Spatial Attention Vectorization) on the fused first sample feature vector to obtain a learned first sample feature vector; and the recognition network extracts a first facial feature from the learned first sample feature vector.
[0062] Exemplarily, for feature fusion, the computer device performs maximum pooling (MaxPooling) on each of the M first sample feature vectors to obtain M pooled first sample feature vectors; and fuses the M pooled first sample feature vectors to obtain a fused first sample feature vector.
[0063] Step 230: Perform facial feature enhancement processing on the second image sample through a feature enhancement network to obtain an enhanced image sample.
[0064] The feature enhancement network includes a denoising network and a feature superposition function; the computer device performs denoising on the second image sample through the denoising network to obtain a denoised sample residual image; the sample residual image is superimposed on the second image sample through the feature superposition function to obtain an enhanced image sample.
[0065] Optionally, the denoising network includes a first dilated convolution and a first activation function, N second dilated convolutions and N second activation functions, wherein each second dilated convolution corresponds to a second activation function; for denoising the second image sample, the first dilated convolution is used to perform convolution calculation on the second image sample to obtain a sample feature image after feature extraction; the sample feature image is input into the first activation function to obtain an intermediate sample feature image after nonlinear processing; the second dilated convolution is used to perform convolution calculation on the intermediate sample feature image to obtain a sample feature image after feature extraction again; the sample feature image after feature extraction again is input into the second activation function to obtain an updated intermediate sample feature image; the above-mentioned step of updating the intermediate sample feature image is repeated N times to obtain a sample residual image after denoising, where N is an integer greater than 1.
[0066] Exemplarily, the denoising network may also adopt a convolutional neural network for image denoising (learning deep CNN denoiser prior for Image Restoration, IRCNN).
[0067] Optionally, the denoising network includes a first dilated convolution and a first activation function, N second dilated convolutions, N batch normalization layers and N second activation functions, and a third dilated convolution; wherein each second dilated convolution corresponds to a batch normalization layer and a second activation function;
[0068] For denoising the second image sample, a first dilated convolution is used to perform convolution calculation on the second image sample to obtain a sample feature image after feature extraction; the sample feature image is input into a first activation function to obtain an intermediate sample feature image after nonlinear processing;
[0069] Performing a convolution calculation on the intermediate sample feature image using a second dilated convolution to obtain a sample feature image after feature extraction again; inputting the sample feature image after feature extraction again into a batch normalization layer to obtain a normalized sample feature image; inputting the normalized sample feature image into a second activation function to obtain an updated intermediate sample feature image; repeating the above steps of updating the intermediate sample feature image N times to obtain an intermediate sample feature image after N updates, where N is an integer greater than 1;
[0070] The third dilated convolution is used to perform convolution calculation on the intermediate sample feature image after the N updates to obtain the denoised sample residual image.
[0071] For example, Figure 1The denoising network includes: a first dilated convolution and a first activation function, five second dilated convolutions, five batch normalization layers and five second activation functions, and a third dilated convolution; the computer device uses the first dilated convolution to perform convolution calculation on the low-quality image (i.e., the second image sample) to obtain a sample feature image after feature extraction; the sample feature vector after feature extraction is input into the first activation function to obtain an intermediate sample feature image 11 after nonlinear processing;
[0072] The intermediate sample feature image 11 is convolved by the first second dilated convolution to obtain the sample feature image 1 after feature extraction again; the sample feature image 1 after feature extraction is input into the first batch normalization layer to obtain the normalized sample feature image 1; the normalized sample feature image 1 is input into the first second activation function to obtain the updated intermediate sample feature image 12;
[0073] The second second dilated convolution is used to perform convolution calculation on the intermediate sample feature image 12 to obtain the sample feature image 2 after feature extraction again; the sample feature image 2 after feature extraction is input into the second batch normalization layer to obtain the normalized sample feature image 2; the normalized sample feature image 2 is input into the second second activation function to obtain the updated intermediate sample feature image 13;
[0074] The intermediate sample feature image 13 is convolved by the third second dilated convolution to obtain the sample feature image 3 after feature extraction again; the sample feature image 3 after feature extraction is input into the third batch normalization layer to obtain the normalized sample feature image 3; the normalized sample feature image 3 is input into the third second activation function to obtain the updated intermediate sample feature image 14;
[0075] The intermediate sample feature image 14 is convolved using the fourth second dilated convolution to obtain a sample feature image 4 after feature extraction again; the sample feature image 4 after feature extraction is input into the fourth batch normalization layer to obtain a normalized sample feature image 4; the normalized sample feature image 4 is input into the fourth second activation function to obtain an updated intermediate sample feature image 15;
[0076] The fifth second dilated convolution is used to perform convolution calculation on the intermediate sample feature image 15 to obtain the sample feature image 5 after feature extraction again; the sample feature image 5 after feature extraction is input into the fifth batch normalization layer to obtain the normalized sample feature image 5; the normalized sample feature image 5 is input into the fifth second activation function to obtain the updated intermediate sample feature image 16;
[0077] The third dilated convolution is used to perform convolution calculation on the intermediate sample feature image 16 to obtain a denoised sample residual image 17; the sample residual image 17 is superimposed on the low-quality image to complete the facial feature enhancement processing of the low-quality image and obtain an enhanced image sample 18.
[0078] Optionally, the activation function includes a ReLU (the Rectified Linear Unit) function.
[0079] Optionally, the dilation factors between the adjacent dilated convolutions are different, and the dilated convolutions include a first dilated convolution and a second dilated convolution. Exemplarily, the dilation factor (dilatation rate) may show a trend of first increasing at equal intervals and then decreasing at equal intervals, and the dilation factor of the first dilated convolution and the last second dilated convolution is the same; for example, in Figure 1 In the denoising network shown, the dilation factor of the first dilated convolution is 1, and the dilation factors of the six second dilated convolutions are 2, 3, 4, 3, 2, and 1, respectively.
[0080] Optionally, the second dilated convolution + batch normalization layer + second activation function are regarded as a second recognition layer as a whole, and the feature mapping data of the second recognition layer is set to 64.
[0081] Step 240: extract the second facial feature from the enhanced image sample through the recognition network.
[0082] The computer device performs M feature extractions based on the enhanced image sample through a recognition network to obtain M second sample feature vectors of different levels, where the level indicates the number of feature extractions, and the second sample feature vector of each level is extracted from the second sample feature vector of the previous level; the computer device performs multi-scale feature fusion on the M second sample feature vectors through the recognition network to obtain a fused second sample feature vector, where M is an integer greater than 1; the computer device performs feature learning under a spatial attention vector mechanism on the fused second sample feature vector through the recognition network to obtain a learned second sample feature vector; and the computer device extracts a second facial feature from the learned second sample feature vector through the recognition network.
[0083] Exemplarily, for feature fusion, the computer device performs Max Pooling on each of the M second sample feature vectors to obtain M pooled second sample feature vectors; and fuses the M pooled second sample feature vectors to obtain a fused second sample feature vector.
[0084] For example, Figure 1As shown, the recognition network includes four feature extraction layers; the computer device extracts a sample feature vector 21 from the target image sample through the first feature extraction layer, extracts a sample feature vector 22 from the sample feature vector 21 through the second feature extraction layer, extracts a sample feature vector 23 from the sample feature vector 22 through the third feature extraction layer, and extracts a sample feature vector 24 from the sample feature vector 23 through the fourth feature extraction layer; multi-scale feature fusion is performed on the sample feature vector 21, the sample feature vector 22, the sample feature vector 23 and the sample feature vector 24 to obtain a fused sample feature vector (not shown in the figure); feature learning is performed on the fused sample feature vector under the spatial attention vector mechanism to obtain a learned sample feature vector 25; and the target face features are extracted from the learned sample feature vector 25.
[0085] If the target image sample is the first image sample, the sample feature vector is the first sample feature vector, the fused sample feature vector is the fused first sample feature vector, the learned sample feature vector is the learned first sample feature vector, and the target facial feature is the first facial feature 26; if the target image sample is the second image sample, the sample feature vector is the second sample feature vector, the fused sample feature vector is the fused second sample feature vector, the learned sample feature vector is the learned second sample feature vector, and the target facial feature is the second facial feature 26'.
[0086] Step 250: Based on the feature error between the first facial feature and the second facial feature, adjust the network parameters of the feature enhancement network to obtain a trained face recognition model.
[0087] The computer device performs back-propagation training on the network parameters of the feature enhancement network based on the feature error between the first facial feature and the second facial feature to obtain a trained face recognition model.
[0088] Exemplarily, the computer device uses a loss function to calculate the feature loss (ie, feature error) between the first facial feature and the second facial feature. The loss function may be a square loss function or a cross entropy loss function.
[0089] Optionally, the computer device adjusts network parameters of the feature enhancement network based on the feature error between the first facial feature and the second facial feature to obtain a trained feature enhancement network; thereafter, the computer device fine-tunes the overall network parameters of the face recognition model. Specifically, the computer device obtains at least one third image sample; invokes the trained feature enhancement network to perform facial feature enhancement processing on the third image sample to obtain an enhanced third image sample; invokes the recognition network to extract a third facial feature from the enhanced third image sample; and adjusts network parameters of the trained feature enhancement network and a pre-trained recognition network based on the third facial feature to obtain a trained face recognition model.
[0090] For example, the computer device can calculate the face recognition loss based on the third facial feature, and adjust the network parameters of the trained feature enhancement network and the network parameters of the pre-trained recognition network based on the face recognition loss to obtain a trained face recognition model. Exemplarily, the calculation of the above-mentioned face recognition loss can be implemented using at least one face recognition loss function selected from the group consisting of a softmax loss function, a center-loss function, an A-Softmax Loss function, an AM (Additive Margin)-Softmax Loss function, and an ArcFaceLoss (Additive Angular Margin Loss) function.
[0091] Optionally, the third image sample includes the second image sample. Exemplarily, the computer device uses the second image sample to perform the overall parameter fine-tuning process on the face recognition model.
[0092] To summarize, the model training method of the face recognition model provided in this embodiment extracts the first facial feature from the first image sample through a pre-trained recognition network, and at the same time performs feature enhancement processing on the amplified sample of the first image sample (that is, the second image sample) through the feature enhancement network, and then extracts the second facial feature from the enhanced image sample through the recognition network; based on the feature error between the first facial feature and the second facial feature, the network parameters of the feature enhancement network are adjusted to improve the ability of the feature enhancement network to enhance facial features, so that the face recognition model can improve the image quality of the facial image through the feature enhancement network before extracting the facial features, thereby reducing the burden of subsequent recognition network learning, making the learned features more pure and generalized, and then extracting higher quality facial features from the enhanced facial image.
[0093] Compared with using the error between pixels to train the model, this method trains the model through the error between features, learns the high quality of feature-to-feature data, no longer relies on constructing pixel-to-pixel paired data that conforms to the real noise distribution, and can also avoid overfitting of feature learning in the model.
[0094] This method learns the migration of low-quality features to high-quality features in the feature space. The feature space has a small dimension, and each feature and its position has clear semantics. It guides low-quality features in the feature space to move in a more separable direction (that is, to migrate in the direction of high-quality features). It can avoid the disturbances encountered during convergence in the image space, such as avoiding the pixel averaging effect caused by traditional denoising networks. At the same time, it can also make any factors that affect face recognition generalizable.
[0095] For the feature recognition loss of the face recognition model, the computer device can use positive sample face features and negative sample face features to calculate, for example, Figure 4 , the above step 250 can be replaced by steps 252 to 256 as shown below:
[0096] Step 252: After obtaining the first facial feature and the second facial feature, obtain other facial features.
[0097] The other facial features are extracted from other second image samples other than the second image sample, and the faces corresponding to the other second image samples are different from the faces corresponding to the second image samples.
[0098] The computer device performs feature extraction on other second image samples other than the second image sample, obtains other facial features of the other second image samples, and stores or caches them; in the process of model training for the first image sample and the second image sample, if the extraction of the first facial features and the second facial features is completed, the other stored or cached facial features are obtained.
[0099] In the case where multiple other facial features have been stored or cached, the computer device obtains the latest stored other facial features; or obtains the latest cached other facial features; or the computer device randomly obtains one other facial feature.
[0100] Step 254 : Calculate feature loss based on the first facial feature, the second facial feature, and other facial features.
[0101] The computer device uses the second facial feature as a positive sample facial feature and the other facial features as negative sample facial features, and calculates the feature loss based on the first facial feature, the second facial feature and the other facial features.
[0102] For example, the binary loss function can be defined as follows:
[0103] L turple =max(||f hq -f p ||-||f hq -f n ||+margin,0);
[0104] Among them, L turple Represents the above feature loss, f hq represents the first facial feature, f p Represents the second facial feature, f n Represents other facial features, max represents the maximum value, and margin represents a hyperparameter.
[0105] The computer device inputs the first facial feature, the second facial feature and other facial features into the above-mentioned binary loss function to calculate the feature loss.
[0106] Step 256: Adjust the network parameters of the feature enhancement network based on the feature loss to obtain a trained face recognition model.
[0107] Optionally, the computer device adjusts the network parameters of the feature enhancement network based on the feature loss to obtain a trained feature enhancement network; obtains at least one third image sample; calls the trained feature enhancement network to perform facial feature enhancement processing on the third image sample to obtain an enhanced third image sample; calls the recognition network to extract a third facial feature from the enhanced third image sample; and adjusts the network parameters of the trained feature enhancement network and the recognition network based on the third facial feature to obtain a trained face recognition model. For example, the computer device may use a Softmax loss function to calculate the face recognition loss corresponding to the third facial feature, and adjust the trained feature enhancement network and the pre-trained recognition network based on the face recognition loss to obtain a trained face recognition model.
[0108] Optionally, the third image sample includes a second image sample, and the computer device may use the second image sample to perform the above-mentioned overall parameter fine-tuning processing on the face recognition model.
[0109] For example, the algorithm flow of the model training method in the above embodiment is as follows:
[0110]
[0111] Among them, Led3D is a lightweight and efficient three-dimensional face recognition network, namely A Lightweight and EfficientDeep Approach to Recognizing Low-quality 3D Faces.
[0112] To sum up, the model training method of the face recognition model provided in this embodiment calculates the loss based on the positive sample facial features and the negative sample facial features, while taking into account the distribution of positive samples and negative samples in the high-quality feature space, which can better match the embedding of the high-quality feature space, and ultimately enable the face recognition model to achieve higher-precision face recognition.
[0113] It should also be noted that the above-mentioned pre-trained recognition network can be trained based on the first image sample, that is, the above-mentioned pre-trained recognition network can be trained based on high-quality face images, so that the recognition network can obtain better face recognition capabilities.
[0114] Exemplarily, a computer device performs M feature extractions based on a first image sample through a recognition network to obtain M first sample feature vectors of different levels, where the level indicates the number of feature extractions, and the first sample feature vector of each level is extracted from the feature vector of the previous level; performs multi-scale feature fusion on the M first sample feature vectors through the recognition network to obtain a fused first sample feature vector, where M is a positive integer greater than 1; performs feature learning under a spatial attention vector mechanism on the fused first sample feature vector through the recognition network to obtain a learned first sample feature vector; extracts a first facial feature from the learned first sample feature vector through the recognition network; adjusts the network parameters of the recognition network based on the recognition loss of the first facial feature, and obtains a pre-trained recognition network after multiple rounds of training. Exemplarily, a Softmax loss function can be used to calculate the recognition loss of the first facial feature.
[0115] The first facial features may also be stored, so that during the above-mentioned model training process, the first facial features corresponding to the first sample image may be directly obtained.
[0116] Figure 5 A flowchart of a face recognition method provided by an exemplary embodiment of the present application is shown. The method is applied to a computer device, which may be a terminal or a server. The method adopts the face recognition model provided by the above embodiment, and the method includes:
[0117] Step 310: Call the face recognition model to perform facial feature enhancement processing on the collected face image to obtain an enhanced image.
[0118] The face recognition model includes a denoising network and a feature superposition function; the computer device performs denoising on the face image through the denoising network to obtain a denoised residual image; the residual image is superimposed on the face image through the feature superposition function to obtain an enhanced image.
[0119] Optionally, the denoising network includes: a first dilated convolution and a first activation function, N second dilated convolutions and N second activation functions; for obtaining the residual image, the computer device uses the first dilated convolution to perform convolution calculation on the face image to obtain a feature image after feature extraction; the feature image is input into the first activation function to obtain an intermediate feature image after nonlinear processing; the second dilated convolution is used to perform convolution calculation on the intermediate feature image to obtain a feature image after feature extraction again; the feature image after feature extraction again is input into the second activation function to obtain an updated intermediate feature image; repeat the above steps of updating the intermediate feature image N times to obtain the denoised residual image, where N is a positive integer greater than 1.
[0120] Optionally, the denoising network includes: a first dilated convolution and a first activation function, N second dilated convolutions, N batch normalization layers and N second activation functions, and a third dilated convolution; wherein each second dilated convolution corresponds to a batch normalization layer and a second activation function;
[0121] For obtaining the residual image, the computer device performs convolution calculation on the face image using a first dilated convolution to obtain a feature image after feature extraction; the feature image is input into a first activation function to obtain an intermediate feature image after nonlinear processing;
[0122] Performing a convolution calculation on the intermediate feature image using a second dilated convolution to obtain a feature image after feature extraction again; inputting the feature image after feature extraction again into a batch normalization layer to obtain a normalized feature image; inputting the normalized feature image into a second activation function to obtain an updated intermediate feature image; repeating the above steps of updating the intermediate feature image N times to obtain an intermediate feature image after N updates, where N is a positive integer greater than 1;
[0123] The third dilated convolution is used to perform convolution calculation on the intermediate feature image after the above N updates to obtain the denoised residual image.
[0124] Optionally, the activation function includes a ReLU function.
[0125] Optionally, the dilation factors of the adjacent dilated convolutions are different, and the dilated convolutions include a first dilated convolution and a second dilated convolution. Exemplarily, the dilation factors may first increase at equal intervals and then decrease at equal intervals, and the dilation factors of the first dilated convolution and the last second dilated convolution are the same.
[0126] Optionally, the second dilated convolution + batch normalization layer + second activation function are regarded as a second recognition layer as a whole, and the feature mapping data of the second recognition layer is set to 64.
[0127] Step 320: Call the face recognition model to perform feature extraction on the enhanced image to obtain facial features in the face image.
[0128] The face recognition model includes a recognition network; a computer device performs M feature extractions based on an enhanced image through the recognition network to obtain M feature vectors of different levels, where the level indicates the number of feature extractions, and the feature vectors of each level are extracted from the feature vectors of the previous level; the recognition network performs multi-scale feature fusion on the M feature vectors to obtain a fused feature vector, where M is a positive integer greater than 1; the recognition network performs feature learning on the fused feature vector under a spatial attention vector mechanism to obtain a learned feature vector; and the recognition network extracts facial features from the learned feature vector.
[0129] Exemplarily, for feature fusion, the computer device performs Max Pooling on each of the M feature vectors to obtain M pooled feature vectors; and fuses the M pooled feature vectors to obtain a fused feature vector.
[0130] Step 330: Call the face recognition model to perform recognition based on facial features to obtain a face recognition result.
[0131] For example, the face recognition result may be a face recognition result of identity authentication based on facial visual feature information, or may be a result of extraction of facial visual feature information (ie, facial features).
[0132] Exemplarily, the face recognition model also includes a dropout layer, a fully connected (FC) layer, and a classification (softmax) layer. The computer device inputs facial features into the dropout layer, discards some of the facial features, and obtains processed facial features. The processed facial features are then input into the FC layer, which performs comprehensive processing on the facial features to obtain reprocessed facial features. The reprocessed facial features are then input into the softmax layer for recognition, thereby obtaining face recognition results. The dropout layer is used to reduce overfitting in feature learning and improve the generalization ability of the network.
[0133] To sum up, the face recognition method provided in this embodiment adopts a face recognition model to perform face recognition. The face recognition model includes a denoising network and a feature superposition function. After the face image is denoised by the denoising network, a residual image is obtained, and then the feature superposition function is used to superimpose the residual image on the face image, and the face features of the face image are enhanced. Face recognition is performed based on the feature-enhanced image, which can reduce the burden of subsequent recognition network learning, make the learned features more pure and generalized, and then extract higher quality facial features from the enhanced face image to achieve more accurate face recognition.
[0134] For example, a Gaussian with indefinite variance was randomly added to the data of a high-quality 3D face dataset, and recognition experiments were conducted using Scheme 1, Scheme 2, and the scheme in this application. The results are shown in Table 1 below:
[0135] Table 1
[0136] Model Accuracy Led3d 90.78% DnCNN+Led3d 94.15% Ours 97.15%
[0137] Among them, Solution 1 is a solution that uses the Led3d model alone for recognition; Solution 2 is a solution that uses the Denoising Convolutional Neural Network (DnCNN) to denoise the face image and then uses Led3d for recognition; Solution 3 is a solution provided by this application, namely Ours. Obviously, compared with Solution 1, the recognition accuracy of the solution provided by this application has increased by about 6.37%; compared with the use of DnCNN for noise reduction, the recognition accuracy of the solution provided by this application has also increased by 3%. Figure 6 , which respectively shows the difference between the face before denoising, the face after denoising, and the face before and after denoising in Scheme 2 and Scheme 3. Obviously, the difference of Scheme 3 is clearer, indicating that the denoising effect of Scheme 3 is better.
[0138] For example, experiments were conducted using a real low-quality 3D face dataset, and the results are shown in Table 2 below:
[0139] Table 2
[0140] Model Accuracy Led3d 89.27% Ours 94.77%
[0141] Compared with solution 1, the recognition accuracy of the solution provided by this application is improved by 5.5%. Figure 7 , shows the recognition effect on real images. Figure 7 , which shows the difference between the face before and after noise reduction in Solution 3 in a real scene. It can be seen that the difference of Solution 3 is clear, indicating that the noise reduction effect of Solution 3 is excellent.
[0142] Figure 8 A block diagram of a model training device for a face recognition model provided by an exemplary embodiment of the present application is shown. The device can be implemented as part or all of a computer device through software, hardware, or a combination of both. The computer device may include a server or a terminal. The face recognition model includes a feature enhancement network and a pre-trained recognition network. The device includes:
[0143] A sample acquisition module 412 is configured to acquire at least one group of facial image samples, each group of facial image samples including a first image sample and a second image sample, where the second image sample is obtained by amplifying the first image sample;
[0144] Feature acquisition module 414 is configured to extract a first facial feature from the first image sample using a recognition network; perform facial feature enhancement processing on the second image sample using a feature enhancement network to obtain an enhanced image sample; and extract a second facial feature from the enhanced image sample using a recognition network;
[0145] The parameter adjustment module 416 is used to adjust the network parameters of the feature enhancement network based on the feature error between the first facial feature and the second facial feature to obtain a trained face recognition model.
[0146] In some embodiments, the feature enhancement network includes a noise reduction network and a feature superposition function;
[0147] Performing facial feature enhancement processing on the second image sample through the feature enhancement network to obtain an enhanced image sample, including:
[0148] Performing denoising on the second image sample through a denoising network to obtain a denoised sample residual image;
[0149] The sample residual image is superimposed on the second image sample through the feature superposition function to obtain an enhanced image sample.
[0150] In some embodiments, the denoising network includes a first dilated convolution and a first activation function, N second dilated convolutions and N second activation functions;
[0151] The second image sample is subjected to denoising processing through the denoising network to obtain a denoised sample residual image, including:
[0152] Performing a convolution calculation on the second image sample using the first dilated convolution to obtain a sample feature image after feature extraction; inputting the sample feature image into the first activation function to obtain an intermediate sample feature image after nonlinear processing;
[0153] Performing a convolution calculation on the intermediate sample feature image using a second dilated convolution to obtain a sample feature image after feature extraction again; inputting the sample feature image after feature extraction again into a second activation function to obtain an updated intermediate sample feature image;
[0154] Repeat the above steps of updating the intermediate sample feature image N times to obtain the sample residual image after denoising, where N is an integer greater than 1.
[0155] In some embodiments, dilation factors between adjacent dilated convolutions are different, and the dilated convolutions include a first dilated convolution and a second dilated convolution.
[0156] In some embodiments, extracting a first facial feature from a first image sample using a recognition network includes:
[0157] Performing M feature extractions based on the first image sample through the recognition network to obtain M first sample feature vectors of different levels. The level indicates the number of feature extractions. The first sample feature vector of each level is extracted from the first sample feature vector of the previous level.
[0158] Performing multi-scale feature fusion on M first sample feature vectors through a recognition network to obtain a fused first sample feature vector, where M is an integer greater than 1;
[0159] The recognition network performs feature learning on the fused first sample feature vector under the spatial attention vector mechanism to obtain the learned first sample feature vector;
[0160] The first facial feature is extracted from the learned first sample feature vector through the recognition network.
[0161] In some embodiments, extracting a second facial feature from the enhanced image sample using a recognition network includes:
[0162] Perform M feature extractions based on the enhanced image samples through the recognition network to obtain M second sample feature vectors at different levels. The level indicates the number of feature extractions. The second sample feature vectors at each level are extracted from the second sample feature vectors at the previous level.
[0163] Performing multi-scale feature fusion on M second sample feature vectors through the recognition network to obtain a fused second sample feature vector, where M is an integer greater than 1;
[0164] The recognition network performs feature learning on the fused second sample feature vector under the spatial attention vector mechanism to obtain the learned second sample feature vector;
[0165] The second facial feature is extracted from the learned second sample feature vector through the recognition network.
[0166] In some embodiments, the apparatus further comprises:
[0167] A feature acquisition module 414 is configured to acquire other facial features after obtaining the first facial feature and the second facial feature, where the other facial features are extracted from other second image samples other than the second image sample, and the faces corresponding to the other second image samples are different from the faces corresponding to the second image sample;
[0168] The parameter adjustment module 416 is used to calculate the feature loss based on the first facial feature, the second facial feature and other facial features; adjust the network parameters of the feature enhancement network based on the feature loss to obtain a trained face recognition model.
[0169] In some embodiments, adjusting network parameters of a feature enhancement network based on a feature error between a first facial feature and a second facial feature to obtain a trained face recognition model includes:
[0170] Adjusting network parameters of the feature enhancement network based on a feature error between the first facial feature and the second facial feature to obtain a trained feature enhancement network;
[0171] acquiring at least one third image sample;
[0172] Calling the trained feature enhancement network to perform facial feature enhancement processing on the third image sample to obtain an enhanced third image sample;
[0173] Calling the recognition network to extract the third face feature from the enhanced third image sample;
[0174] Based on the third facial feature, the network parameters of the trained feature enhancement network and the network parameters of the recognition network are adjusted to obtain a trained face recognition model.
[0175] In some embodiments, the second image sample is amplified in at least one of the following ways:
[0176] adding noise to the first image sample;
[0177] Adding occlusion to the first image sample;
[0178] downsampling or upsampling the first image sample;
[0179] rotating the first image sample;
[0180] The depth distance between the person and the background in the first image sample is adjusted, where the background refers to a pixel area other than the person in the first image sample.
[0181] In summary, the model training device of the face recognition model provided in this embodiment extracts the first face feature from the first image sample through the pre-trained recognition network, and at the same time performs feature enhancement processing on the amplified sample of the first image sample (that is, the second image sample) through the feature enhancement network, and then extracts the second face feature from the enhanced image sample through the recognition network; based on the feature error between the first face feature and the second face feature, the network parameters of the feature enhancement network are adjusted to improve the ability of the feature enhancement network to enhance face features, so that the face recognition model can improve the image quality of the face image through the feature enhancement network before extracting the face feature, thereby reducing the burden of subsequent recognition network learning, making the learned features more pure and generalized, and then extracting higher quality face features from the enhanced face image.
[0182] Compared with using the error between pixels to train the model, this device trains the model through the error between features, learning the high-quality feature-to-feature data. It no longer relies on constructing pixel-to-pixel paired data that conforms to the real noise distribution, and can also avoid overfitting of feature learning in the model.
[0183] The device learns the migration of low-quality features to high-quality features in the feature space. The feature space has a small dimension, and each feature and its position have clear semantics. It guides low-quality features in the feature space to move in a more separable direction (that is, to migrate in the direction of high-quality features), which can avoid the disturbances encountered during convergence in the image space. For example, it avoids the pixel averaging effect caused by traditional denoising networks, and at the same time enables any factors that affect face recognition to be generalized.
[0184] Figure 9 A block diagram of a face recognition device provided by an exemplary embodiment of the present application is shown. The device can be implemented as part or all of a computer device through software, hardware, or a combination of both. The computer device may include a server or a terminal. The device uses the face recognition model described in the above embodiment and includes:
[0185] The feature enhancement module 422 is used to call the face recognition model to perform face feature enhancement processing on the collected face image to obtain an enhanced image;
[0186] A feature extraction module 424 is used to call a face recognition model to extract features from the enhanced image to obtain facial features in the face image;
[0187] The face recognition module 426 is used to call the face recognition model to perform recognition based on facial features to obtain a face recognition result.
[0188] In some embodiments, the face recognition model includes a noise reduction network and a feature superposition function;
[0189] Call the face recognition model to perform facial feature enhancement on the collected face image to obtain the enhanced image, including:
[0190] The face image is denoised through the denoising network to obtain the denoised residual image;
[0191] The residual image is superimposed on the face image through the feature superposition function to obtain the enhanced image.
[0192] In some embodiments, the denoising network includes a first dilated convolution and a first activation function, N second dilated convolutions and N second activation functions;
[0193] The face image is denoised through the denoising network to obtain the denoised residual image, including:
[0194] Performing convolution calculation on the face image using the first dilated convolution to obtain a feature image after feature extraction; inputting the feature image into the first activation function to obtain an intermediate feature image after nonlinear processing;
[0195] The second dilated convolution is used to perform convolution calculation on the intermediate feature image to obtain a feature image after feature extraction again; the feature image after feature extraction is input into the second activation function to obtain an updated intermediate feature image;
[0196] Repeat the above steps of updating the intermediate feature image N times to obtain a denoised residual image, where N is a positive integer greater than 1.
[0197] In some embodiments, dilation factors between adjacent dilated convolutions are different, and the dilated convolutions include a first dilated convolution and a second dilated convolution.
[0198] In some embodiments, the face recognition model includes a recognition network;
[0199] Call the face recognition model to extract features from the enhanced image to obtain facial features in the face image, including:
[0200] Perform M feature extractions based on the enhanced image through the recognition network to obtain M feature vectors at different levels. The level indicates the number of feature extractions, and the feature vectors at each level are extracted from the feature vectors at the previous level.
[0201] Perform multi-scale feature fusion on M feature vectors through the recognition network to obtain the fused feature vector, where M is a positive integer greater than 1;
[0202] The recognition network performs feature learning on the fused feature vector under the spatial attention vector mechanism to obtain the learned feature vector;
[0203] The facial features are extracted from the learned feature vector through the recognition network.
[0204] To sum up, the face recognition device provided in this embodiment adopts a face recognition model to perform face recognition. The face recognition model includes a denoising network and a feature superposition function. After the face image is denoised by the denoising network, a residual image is obtained, and then the feature superposition function is used to superimpose the residual image on the face image, and the face features of the face image are enhanced. Face recognition is performed based on the feature-enhanced image, which can reduce the burden of subsequent recognition network learning, make the learned features more pure and generalized, and then extract higher quality facial features from the enhanced face image to achieve more accurate face recognition.
[0205] Figure 10 The following is a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application. The computer device can be a device that executes the model training method of the face recognition model provided by the present application, and / or the face recognition method, and the computer device can be a terminal or a server. Specifically:
[0206] Computer device 500 includes a central processing unit (CPU) 501, a system memory 504 including a random access memory (RAM) 502 and a read-only memory (ROM) 503, and a system bus 505 connecting system memory 504 and CPU 501. Computer device 500 also includes a basic input / output system (I / O system) 506 that facilitates information transfer between various components within the computer, and a mass storage device 507 for storing an operating system 513, application programs 514, and other program modules 515.
[0207] The basic input / output system 506 includes a display 508 for displaying information and an input device 509, such as a mouse and keyboard, for user input. Both the display 508 and the input device 509 are connected to the central processing unit 501 via an input / output controller 510 connected to the system bus 505. The basic input / output system 506 may also include an input / output controller 510 for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 510 also provides output to a display screen, printer, or other types of output devices.
[0208] The mass storage device 507 is connected to the central processing unit 501 through a mass storage controller (not shown) connected to the system bus 505. The mass storage device 507 and its associated computer-readable media provide non-volatile storage for the computer device 500. That is, the mass storage device 507 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0209] Computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash memory or other solid-state storage technologies, CD-ROM, Digital Versatile Disc (DVD) or Solid State Drive (SSD), other optical storage, cassettes, magnetic tape, disk storage or other magnetic storage devices. Among them, random access memory may include resistance random access memory (ReRAM) and dynamic random access memory (DRAM). Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The system memory 504 and the large-capacity storage device 507 mentioned above may be collectively referred to as memory.
[0210] According to various embodiments of the present application, the computer device 500 may also be connected to a remote computer on a network such as the Internet for operation. That is, the computer device 500 may be connected to the network 512 via the network interface unit 511 connected to the system bus 505, or the network interface unit 511 may be used to connect to other types of networks or remote computer systems (not shown).
[0211] The memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU.
[0212] In an optional embodiment, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the model training method of the face recognition model as described above, and / or the face recognition method.
[0213] In an optional embodiment, a computer-readable storage medium is provided, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the model training method of the face recognition model as described above, and / or the face recognition method.
[0214] Optionally, the computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid-state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0215] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0216] The present application also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the model training method of the face recognition model provided by the above-mentioned method embodiments, and / or the face recognition method.
[0217] The present application also provides a computer program product, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the model training method for the face recognition model and / or the face recognition method described above.
[0218] It should be understood that the term "plurality" used herein refers to two or more. "And / or" describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates an "or" relationship between the associated objects.
[0219] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0220] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A model training method for a face recognition model, characterized in that: The face recognition model includes a feature enhancement network and a pre-trained recognition network, wherein the feature enhancement network includes a noise reduction network and a feature superposition function; and the method includes: Acquire at least one group of facial image samples, each group of facial image samples including a first image sample and a second image sample, where the second image sample is a sample obtained by amplifying the first image sample; extracting a first facial feature from the first image sample through the recognition network; and performing facial feature enhancement processing on the second image sample through the feature enhancement network to obtain an enhanced image sample, including: performing denoising processing on the second image sample through the denoising network to obtain a denoised sample residual image; and superimposing the sample residual image on the second image sample through the feature superposition function to obtain the enhanced image sample; extracting a second facial feature from the enhanced image sample through the recognition network; Based on the feature error between the first facial feature and the second facial feature, the network parameters of the feature enhancement network are adjusted to obtain a trained face recognition model, including: obtaining at least one third image sample; calling the trained feature enhancement network to perform facial feature enhancement processing on the third image sample to obtain an enhanced third image sample; calling the recognition network to extract a third facial feature from the enhanced third image sample; based on the third facial feature, the network parameters of the trained feature enhancement network and the network parameters of the recognition network are adjusted to obtain the trained face recognition model, wherein the third image sample includes the second image sample.
2. The method according to claim 1, characterized in that The denoising network includes a first dilated convolution and a first activation function, N second dilated convolutions and N second activation functions; The performing denoising on the second image sample by the denoising network to obtain a denoised sample residual image includes: Performing a convolution calculation on the second image sample using the first dilated convolution to obtain a sample feature image after feature extraction; inputting the sample feature image into the first activation function to obtain an intermediate sample feature image after nonlinear processing; Performing a convolution calculation on the intermediate sample feature image using the second dilated convolution to obtain a sample feature image after feature extraction again; inputting the sample feature image after feature extraction again into the second activation function to obtain an updated intermediate sample feature image; Repeat the above step of updating the intermediate sample feature image N times to obtain the sample residual image after denoising, where N is an integer greater than 1.
3. The method according to claim 2, characterized in that Adjacent dilated convolutions have different dilation factors, and the dilated convolutions include the first dilated convolution and the second dilated convolution.
4. The method according to any one of claims 1 to 3, characterized in that: The extracting a first facial feature from the first image sample by the recognition network includes: Performing M feature extractions based on the first image sample by the recognition network to obtain M first sample feature vectors at different levels, where the level indicates the number of feature extractions, and the first sample feature vectors at each level are extracted from the first sample feature vectors at the previous level; Performing multi-scale feature fusion on the M first sample feature vectors through the recognition network to obtain a fused first sample feature vector, where M is an integer greater than 1; Performing feature learning under a spatial attention vector mechanism on the fused first sample feature vector through the recognition network to obtain a learned first sample feature vector; The first facial feature is extracted from the learned first sample feature vector through the recognition network.
5. The method according to any one of claims 1 to 3, characterized in that: Extracting a second facial feature from the enhanced image sample by the recognition network includes: Performing M feature extractions based on the enhanced image sample by the recognition network to obtain M second sample feature vectors at different levels, where the level indicates the number of feature extractions, and the second sample feature vectors at each level are extracted from the second sample feature vectors at the previous level; Performing multi-scale feature fusion on the M second sample feature vectors through the recognition network to obtain a fused second sample feature vector, where M is an integer greater than 1; Performing feature learning under a spatial attention vector mechanism on the fused second sample feature vector through the recognition network to obtain a learned second sample feature vector; The second facial feature is extracted from the learned second sample feature vector through the recognition network.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: After obtaining the first facial feature and the second facial feature, obtaining other facial features, where the other facial features are extracted from other second image samples other than the second image sample, and the faces corresponding to the other second image samples are different from the faces corresponding to the second image sample; Calculating a feature loss based on the first facial feature, the second facial feature, and the other facial features; The network parameters of the feature enhancement network are adjusted based on the feature loss to obtain a trained face recognition model.
7. The method according to any one of claims 1 to 3, characterized in that: The amplification method of the second image sample includes at least one of the following: adding noise to the first image sample; downsampling or upsampling the first image sample; The depth distance between the person and the background in the first image sample is adjusted, where the background refers to a pixel area in the first image sample excluding the person.
8. A face recognition method, characterized in that: Using the face recognition model according to any one of claims 1 to 7, the method comprises: Calling the face recognition model to perform facial feature enhancement processing on the collected face image to obtain an enhanced image; Calling the face recognition model to perform feature extraction on the enhanced image to obtain facial features in the face image; The face recognition model is called to perform recognition based on the face features to obtain a face recognition result.
9. A model training device for a face recognition model, characterized in that: The face recognition model includes a feature enhancement network and a pre-trained recognition network, wherein the feature enhancement network includes a noise reduction network and a feature superposition function; the device includes: a sample acquisition module, configured to acquire at least one group of facial image samples, each group of facial image samples comprising a first image sample and a second image sample, wherein the second image sample is a sample obtained by amplifying the first image sample; a feature acquisition module, configured to extract a first facial feature from the first image sample using the recognition network; and perform facial feature enhancement processing on the second image sample using the feature enhancement network to obtain an enhanced image sample, including: performing denoising processing on the second image sample using the denoising network to obtain a denoised sample residual image; superimposing the sample residual image onto the second image sample using the feature superposition function to obtain the enhanced image sample; and extracting a second facial feature from the enhanced image sample using the recognition network; A parameter adjustment module is used to adjust the network parameters of the feature enhancement network based on the feature error between the first facial feature and the second facial feature to obtain a trained face recognition model, including: obtaining at least one third image sample; calling the trained feature enhancement network to perform facial feature enhancement processing on the third image sample to obtain an enhanced third image sample; calling the recognition network to extract a third facial feature from the enhanced third image sample; adjusting the network parameters of the trained feature enhancement network and the network parameters of the recognition network based on the third facial feature to obtain the trained face recognition model, wherein the third image sample includes the second image sample.
10. A face recognition device, characterized in that: Using the face recognition model according to any one of claims 1 to 7, the device comprises: A feature enhancement module is used to call the face recognition model to perform face feature enhancement processing on the collected face image to obtain an enhanced image; A feature extraction module, configured to call the face recognition model to perform feature extraction on the enhanced image to obtain facial features in the face image; The face recognition module is used to call the face recognition model to perform recognition based on the face features to obtain a face recognition result.
11. A computer device, characterized in that: The computer device includes: a processor and a memory, the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the model training method of the face recognition model as described in any one of claims 1 to 7, or the face recognition method as described in claim 8.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the model training method of the face recognition model as described in any one of claims 1 to 7, or the face recognition method as described in claim 8.
13. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the model training method of the face recognition model as described in any one of claims 1 to 7, or the face recognition method as described in claim 8.
Citation Information
Patent Citations
Low-quality face image enhancement method, system and device, and storage medium
CN109493297A
A noise robust face recognition method based on a cascade deep convolutional neural network
CN109948573A
Vein recognition method and system with scale rotation invariance based on IRCNN and MTCNN
CN110334667A