Face image processing method, device, electronic device and storage medium
Through the cascaded three-dimensional reconstruction and image enhancement network, low-quality face images are processed, the problems of blur and noise interference are solved, and the accuracy of image recognition is improved.
Patent Information
- Application Number
- CN202011428827.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-12-09
AI Technical Summary
In face image recognition, low-quality images cause difficulty in computer automatic recognition due to blur and noise interference, which is not conducive to human eye recognition, and traditional denoising and deblurring algorithms are difficult to effectively process.
Using a cascaded three-dimensional reconstruction network and image enhancement network, high-quality two-dimensional face images are obtained as prior information through three-dimensional face reconstruction and rendering, and image denoising and deblurring are performed to improve image quality.
It effectively improves the visual quality of face images, enhances the clarity of image features, improves the accuracy of face recognition, and solves the recognition difficulties caused by low-quality images.
Smart Images

Figure CN112509144B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a facial image processing method, device, electronic equipment and storage medium. Background Art
[0002] With the in-depth study of artificial intelligence, image recognition technology is constantly being implemented. In image recognition technology, image quality is an important basis for image recognition, which directly affects the accuracy and effectiveness of the image recognition system. The characteristic is face image recognition, which requires images with higher visual quality to ensure the accuracy and effectiveness of face image recognition. In the current use scenarios of image recognition, most of the scene images are collected by cameras. However, due to cost and space considerations in the use scenarios, in order to obtain a larger image acquisition range, the camera is often installed at a relatively higher position in the use scenario. In this way, although a larger image acquisition range is obtained, the image of the target object in the captured image is often of low visual quality, and there will be a lot of blur or noise. Such images, due to a lot of blur and noise as interference, will increase the difficulty of the computer to automatically identify the target object. At the same time, when the image is archived, the visual quality is too low, which is not easy for the human eye to recognize. Based on this problem, the most direct way is to solve it by improving the camera resolution and imaging quality, but improving the camera resolution and imaging quality requires monetary costs. Traditional image denoising and deblurring algorithms need to know the blur parameters and noise distribution type that blur the image in order to be effective. However, finding blur methods and noise distribution types is an ill-posed problem with infinite solutions, which is very difficult to implement. Therefore, in face image recognition, there is a problem of low face image quality. Summary of the invention
[0003] The embodiment of the present invention provides a facial image processing method, which can perform denoising and deblurring processing on facial images, thereby improving the quality of facial images in facial image recognition.
[0004] In a first aspect, an embodiment of the present invention provides a face image processing method, comprising:
[0005] Obtain a preset number of continuous face frame images;
[0006] Inputting the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and rendering the obtained 3D face into a 2D face image;
[0007] Performing image denoising and deblurring on the continuous face frame images through the two-dimensional face image and a pre-trained image enhancement network to obtain a target face image;
[0008] Wherein, the three-dimensional reconstruction network and the image enhancement network are cascaded.
[0009] Optionally, the three-dimensional reconstruction network includes a parameter extraction network and a parameter reconstruction network, and the continuous face frame images are input into a pre-trained three-dimensional reconstruction network to perform three-dimensional face reconstruction, and the obtained three-dimensional face is rendered into a two-dimensional face image, including:
[0010] Extracting face reconstruction parameters of the continuous face frame images through the parameter extraction network;
[0011] Reconstructing the face reconstruction parameters through the parameter reconstruction network to obtain a three-dimensional face;
[0012] Perform two-dimensional rendering on the three-dimensional human face to obtain a two-dimensional human face image.
[0013] Optionally, the image enhancement network includes a denoising convolution kernel and a deblurring convolution kernel, and the image denoising and deblurring are performed on the continuous face frame images through the two-dimensional face image and the pre-trained image enhancement network to obtain the target face image, including:
[0014] Input the two-dimensional face image into the image enhancement network as the prior information of the continuous face frame image;
[0015] Using the prior information as a reference, performing a denoising operation on the continuous face frame images through the denoising convolution kernel; and
[0016] Using the prior information as a reference, performing a deblurring operation on the continuous face frame images through the deblurring convolution kernel;
[0017] The target face image is output.
[0018] Optionally, the 3D reconstruction network and the image enhancement network are jointly trained, and the joint training includes:
[0019] Constructing a sample set, the sample set comprising a sample face image, a face key point position label, a pixel mean square error label, and a reconstruction parameter label corresponding to the sample face image;
[0020] Inputting the sample set into the cascaded three-dimensional reconstruction network and the image enhancement network to train the three-dimensional reconstruction network and the image enhancement network;
[0021] Calculating a first loss function for predicting reconstruction parameters and reconstruction parameter labels in the three-dimensional reconstruction network; and
[0022] Calculating a second loss function corresponding to the positions of facial key points in the two-dimensional face image and the labels of the positions of the facial key points in the three-dimensional reconstruction network; and
[0023] Calculating a third loss function for predicting a face image and a pixel mean square error label in the image enhancement network;
[0024] The total loss of the first loss function, the second loss function and the third loss function is calculated, and the parameters of the 3D reconstruction network and the image enhancement network are adjusted according to back propagation, and the training is iteratively performed to minimize the total loss to obtain a trained 3D reconstruction network and a trained image enhancement network.
[0025] Optionally, the sample set includes multiple groups of sample face images, and constructing the sample set includes:
[0026] Acquire a preset number of continuous face frame images as a group of sample face images to be processed;
[0027] Randomly selecting at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to add blur and noise to the current sample face image to be processed, so as to obtain a processed sample face image;
[0028] According to the sample face image to be processed, obtaining the face key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the sample face image to be processed;
[0029] The processed sample face images, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the sample face images to be processed are added to the sample set as a group of sample face images.
[0030] Optionally, the sample set includes multiple groups of sample face images, and constructing the sample set includes:
[0031] Obtain 2n+1 consecutive face frame images as a group of sample face images to be processed;
[0032] Randomly select at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to add blur and noise to the current sample face image to be processed, so as to obtain 2n+1 processed sample face images;
[0033] Connect the 2n+1 processed sample face images through channels to obtain a target sample face image;
[0034] According to the sample face image to be processed, obtaining the face key point position label, pixel mean square error label and reconstruction parameter label corresponding to the nth sample face image to be processed;
[0035] The target sample face image, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the nth sample face image to be processed are added to the sample set as a group of sample face images.
[0036] In a second aspect, an embodiment of the present invention provides a face image processing device, comprising:
[0037] An acquisition module, used for acquiring a preset number of continuous face frame images;
[0038] A first processing module is used to input the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and then render the obtained 3D face into a 2D face image;
[0039] A second processing module is used to perform image denoising and deblurring on the continuous face frame images through the two-dimensional face image and a pre-trained image enhancement network to obtain a target face image;
[0040] Wherein, the three-dimensional reconstruction network and the image enhancement network are cascaded.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the face image processing method provided in the embodiment of the present invention when executing the computer program.
[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the face image processing method provided in the embodiment of the invention are implemented.
[0043] In an embodiment of the present invention, a preset number of continuous face frame images are obtained; the continuous face frame images are input into a pre-trained three-dimensional reconstruction network for three-dimensional face reconstruction, and the three-dimensional face is obtained and then rendered as a two-dimensional face image; the continuous face frame images are subjected to image denoising and deblurring through the two-dimensional face image and the pre-trained image enhancement network to obtain a target face image; wherein the three-dimensional reconstruction network and the image enhancement network are cascaded. By performing three-dimensional face reconstruction on the continuous face frame images and rendering to obtain a two-dimensional face image, the image quality of the two-dimensional face image obtained in this way is very high, so that the two-dimensional face image has clearer features that can be used as prior information. After the image enhancement network denoises and deblurs the continuous face frame images based on the two-dimensional face image as prior information, a face image with higher visual quality can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 is a flow chart of a facial image processing method provided by an embodiment of the present invention;
[0046] Figure 2 is a flow chart of a three-dimensional face reconstruction method provided by an embodiment of the present invention;
[0047] Figure 3 This is a flow chart of two-dimensional face acquisition provided by an embodiment of the present invention;
[0048] Figure 4 This is a flowchart of facial image denoising and deblurring provided by an embodiment of the present invention;
[0049] Figure 5 It is a flow chart of a method for jointly training a three-dimensional reconstruction network and an image enhancement network provided by an embodiment of the present invention;
[0050] Figure 6 is a flow chart of constructing a sample set provided by an embodiment of the present invention;
[0051] Figure 7 is a flow chart of another method for jointly training a 3D reconstruction network and an image enhancement network provided by an embodiment of the present invention;
[0052] Figure 8 is a structural schematic diagram of a face image processing device provided by an embodiment of the present invention;
[0053] Fig. 9 is a structural schematic diagram of another face image processing device provided by an embodiment of the present invention;
[0054] Fig.10 is a structural schematic diagram of another face image processing device provided by an embodiment of the present invention;
[0055] Fig.11 is a structural schematic diagram of another face image processing device provided by an embodiment of the present invention;
[0056] Fig.12 is a structural schematic diagram of another face image processing device provided by an embodiment of the present invention;
[0057] Fig.13is a structural schematic diagram of another face image processing device provided by an embodiment of the present invention;
[0058] Fig.14 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0060] See also Figure 1 , Figure 1 is a flow chart of a face image processing method provided by an embodiment of the present invention. Figure 1 As shown, the following steps are included:
[0061] 101. Obtain a preset number of continuous face frame images.
[0062] The continuous face frame images may be obtained by shooting with a camera and sending in real time, or may be obtained by intercepting in a video. The camera may be a three-dimensional depth camera that can shoot face frame images with depth information.
[0063] The above continuous face frame images can be understood as continuous in the frame sequence, which can be understood as that the camera takes 30 frames of images in one second, and these 30 frames of images will be continuous in the frame sequence. It can also be understood as continuous in the time series. For example, when the camera takes one frame of image per millisecond, the above continuous face frame images can be 5 face frame images taken in 5 milliseconds. In some possible cases, a high-quality face frame image can also be selected every 3 milliseconds, and a total of 5 face frame images are selected as the above continuous face frame images.
[0064] In an embodiment of the present invention, the above-mentioned preset number may be 2n+1, where n is an integer greater than or equal to 1. At this time, when the camera is shooting in real time, the face quality of the currently captured face frame image will be calculated in real time. When the face quality is higher than the preset threshold, the currently captured face frame image is recorded as the n+1th frame. At this time, n face frame images can be taken forward and n face frame images can be taken backward, and a total of 2n+1 face frame images are obtained. Taking the preset number of continuous face frame images as 2n+1=5 (i.e., n=2) as an example, when the camera is shooting in real time, the currently captured face frame image is the 256th frame image in the video, and it is calculated that the face quality in the 256th frame image is higher than the preset threshold, then the 256th frame image is recorded as the n+1th frame (i.e., the 3rd frame in the continuous face frame images), 2 frames are taken forward and 2 frames are taken backward, and 5 face frame images are obtained as continuous face frame images. Of course, since the camera is shooting in real time, when taking 2 frames backward, if there is a face frame image with higher face quality in the latter 2 frames, the face frame image will be reselected with the latter face frame image as the n+1th frame. If continuous face frame images are obtained by intercepting in the video, the frame with the highest face quality in the face frame image is selected as the n+1th frame in the video, and then n face frame images are taken forward and n face frame images are taken backward, and a total of 2n+1 face frame images are taken as continuous face frame images. In this way, the input quality of continuous face frame images can be improved. It should be noted that, among the above 2n+1 face frame images, the n+1th face frame image can also be called a representative face frame image.
[0065] Of course, the above-mentioned preset number can be 2n, in which case n should be greater than or equal to 2, and a representative face frame image needs to be selected from the 2n face frame images. Taking n=2 as an example, 2n=4, and the 2nd (n) or 3rd (n+1) face frame image among the 4 face frame images can be selected as the representative face frame image.
[0066] 102. Input the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and render the obtained 3D face into a 2D face image.
[0067] In this step, the above-mentioned 3D reconstruction network can be a multi-input convolutional neural network to meet the input of continuous face frame images. Further, the 3D reconstruction network in the embodiment of the present invention can be a full convolutional neural network that can support images of different sizes as input.
[0068] 3D face reconstruction can be understood as the process of restoring a 3D face from a 2D face image, or as representing any face through a set of face reconstruction parameters. All 3D faces can be represented by the same number of point clouds or face patches, and points with the same serial number represent the same semantics. For example, in the (BFM2017 database), the 2217th face patch vertex of each face shape base represents the left outer corner of the face. By extracting features from the 2D face image, feature information representing these point cloud numbers or face patch numbers can be obtained, which is equivalent to obtaining the corresponding face reconstruction parameters. Therefore, each textured 3D face can be represented by the corresponding face reconstruction parameters. It can be further understood that each 3D face can be represented by face reconstruction shape parameters, face reconstruction texture parameters, and face motion parameters.
[0069] In an embodiment of the present invention, the above-mentioned 3D face reconstruction network includes a parameter extraction network and a parameter reconstruction network.
[0070] Specifically, Figure 2 As shown, Figure 2 A flowchart of a 3D face reconstruction method provided by an embodiment of the present invention includes:
[0071] 201. Extracting face reconstruction parameters of continuous face frame images through a parameter extraction network.
[0072] The above-mentioned face reconstruction parameters may include: face reconstruction shape parameters, face reconstruction texture parameters, face movement, face posture parameters, face angle parameters or face key point parameters, etc.
[0073] In this step, the continuous face frame images are input into the parameter extraction network. Since the parameter extraction network is a pre-trained convolutional neural network, the face reconstruction parameters contained in the continuous face frame images can be extracted through the trained convolution kernel and the corresponding activation function. The face reconstruction parameters include: face reconstruction shape parameters, face reconstruction texture parameters and face motion parameters.
[0074] Specifically, the features corresponding to the face reconstruction parameters reconstruct_params output by the parameter extraction network are expressed as a four-dimensional vector [_3dface_shape_params, _3d face_texture_params, (R, T)], where _3dface_shape_params represents face reconstruction shape parameters, _3dface_texture_params represents face reconstruction texture parameters, and (R, T) represents face action parameters.
[0075] Among them, the above-mentioned face reconstruction shape parameters represent the spatial position of each point in the three-dimensional face to be reconstructed, the above-mentioned face reconstruction texture parameters represent the pixel value (color) of each point in the three-dimensional face to be reconstructed, and in the face motion parameters, R represents the rotation matrix and T represents the displacement of the feature point.
[0076] In a possible embodiment, the parameter extraction network can be a convolutional neural network with resnet18 as the main framework. In resnet18, there are 18 weighted convolutional layers and fully connected layers, that is, the depth of the convolutional neural network is 18. In resnet18, residual connections and identity mapping are used to solve the problem of model degradation as the depth of the convolutional neural network increases, and more accurate features can be extracted from continuous face frame images.
[0077] 202. Reconstruct the face reconstruction shape parameters, face reconstruction texture parameters and face motion parameters through a parameter reconstruction network to obtain a three-dimensional face.
[0078] In this step, the above-mentioned parameter reconstruction network can be a reconstruction network based on the basel model. The face reconstruction shape parameters, face reconstruction texture parameters and face motion parameters extracted in step 201 are input into the parameter reconstruction network, and the three-dimensional face is reconstructed through the parameter reconstruction network.
[0079] Specifically, the three-dimensional face can be reconstructed by the following formula:
[0080]
[0081]
[0082] Face3d(shape,texture)=(Face_shape 3d ,Face_tex 3d )(Formula 3)
[0083] in, t, s, and m are all known parameters in the basel model. represents the average shape parameter, represents the average texture parameter, t i and i are the principal components of face texture and face shape in the basel model, and m is the number of key points of the face. t, s, and m are all known parameters in the basel model, and in formula 1 and formula 2, Face_shape 3d is the three-dimensional face shape in the basel model, Face_tex 3dis the 3D face texture in the basel model, 3dface_shape_params, _3dface_texture_params, (R, T) are the face reconstruction parameters extracted by the parameter extraction network, which are also known; therefore, in the parameter reconstruction network, Face3d(shape, texture) can be obtained according to Formula 3. The Face3d(shape, texture) in Formula 3 represents the corresponding 3D face, and Face3d(shape, texture) indicates that the 3D face contains shape (the spatial position of each point) and texture (the color of each point).
[0084] In the embodiment of the present invention, after the three-dimensional face is obtained in step 202, the three-dimensional face is rendered into a two-dimensional face by a rendering component, such as OpenGL (Open Graphics Library) to render the three-dimensional face into a two-dimensional face. During the rendering process, the face orientation feature in the face frame image representative of the continuous face frame image can be extracted, and according to the face orientation feature, the three-dimensional face is rendered into a two-dimensional face in terms of face orientation, so that the two-dimensional face orientation is the same as the face orientation in the face frame image representative.
[0085] In a possible embodiment, the number of the continuous face frame images is 2n+1, and the above step 102 is specifically as follows: Figure 3 As shown, Figure 3 A schematic diagram of a two-dimensional face acquisition provided by an embodiment of the present invention, taking 2n+1=3 as an example, specifically includes:
[0086] 301. Obtain consecutive face frame images im_0, im_1, im_2.
[0087] The above-mentioned im_0, im_1, and im_2 can be obtained by the method provided in step 101. Wherein, im_1 is a representative face frame image.
[0088] It should be noted that, for the sake of convenience, this embodiment takes the number of continuous face frame images as 3 as an example, which should not be regarded as a limitation of the present invention, and the number of the continuous face frame images can also be 5, 7, etc. Of course, the number of the continuous face frame images can also be an even number, but since the three-dimensional face reconstruction network in the embodiment of the present invention is a multi-input single-output network, when the number of continuous face frame images is an even number, the face frame image representative of the continuous face frame images should be determined in advance.
[0089] 302. Connect im_0, im_1, and im_2 on the channel.
[0090] In this step, im_0, im_1, and im_2 are connected on the channel to obtain a multi-channel image, which is input into the three-dimensional face reconstruction network to predict the face reconstruction parameters.
[0091] 303. Input the connected im_0, im_1, and im_2 into the parameter extraction network in the 3D face reconstruction network to extract face reconstruction parameters.
[0092] In this step, the face reconstruction parameters include: face reconstruction shape parameters, face reconstruction texture parameters and face motion parameters.
[0093] 304. Reconstruct the extracted face reconstruction parameters through the parameter extraction network in the three-dimensional face reconstruction network to obtain a reconstructed three-dimensional face.
[0094] In this step, the step of reconstructing the three-dimensional face can refer to step 202, and the three-dimensional face is reconstructed according to the above-mentioned face reconstruction shape parameters, face reconstruction texture parameters and face motion parameters.
[0095] 305. Perform two-dimensional rendering on the reconstructed three-dimensional human face to obtain a two-dimensional human face.
[0096] Among them, the above two-dimensional face and the face frame image representative im_1 have similar face key points. Face images have very distinct prior information, such as face key points, face shape parameters, face texture parameters, etc., which can all be used as prior information. Therefore, the above face key points can be used as prior information in subsequent steps. Of course, the prior information in subsequent steps can be any one or a combination of face key points, face shape parameters, and face texture parameters.
[0097] 103. The target face image is obtained by performing image denoising and deblurring on the continuous face frame images through the two-dimensional face image and the pre-trained image enhancement network.
[0098] In this step, the image enhancement network may be a multi-input convolutional neural network to satisfy the input of continuous face frame images and the two-dimensional face images. Furthermore, the image enhancement network may be a face enhancement network (Face Enhance Net).
[0099] In an embodiment of the present invention, the above two-dimensional face image is used as prior information to form reference information for denoising and deblurring in the image enhancement network.
[0100] The above-mentioned image enhancement network includes a denoising convolution kernel and a deblurring convolution kernel, which are used to denoise and deblur the continuous face frame images respectively, so as to obtain a higher quality face image. It should be noted that the above-mentioned denoising convolution kernel and deblurring convolution kernel can also be called convolution kernel.
[0101] Specifically, Figure 4 As shown, Figure 4 A flowchart of face image denoising and deblurring provided by an embodiment of the present invention specifically includes the following:
[0102] 401. The two-dimensional face image is used as prior information of continuous face frame images and input into the image enhancement network.
[0103] In this step, the two-dimensional face image may include any one or a combination of face key points, face shape parameters, and face texture parameters as prior information. In the image enhancement network, the prior information of the two-dimensional face image may be extracted through convolution operation.
[0104] The above image enhancement network is used to perform denoising and deblurring operations on continuous face frame images.
[0105] 402. Using the prior information as a reference, a denoising operation is performed on the continuous face frame images through a denoising convolution kernel.
[0106] The above denoising operation refers to filtering out the noise of continuous face frame images through convolution kernels, such as light noise, electrical signal noise, etc. Furthermore, the image enhancement network has multiple inputs and a single output, and the above denoising operation can also be understood as filtering out the noise represented by the face frame images through convolution kernels.
[0107] 403. Using the prior information as a reference, a deblurring operation is performed on the continuous face frame images through a deblurring convolution kernel.
[0108] The above deblurring operation refers to filtering out blur factors of continuous face frame images through convolution kernels, such as defocus blur, motion blur, jitter blur, etc. Furthermore, the image enhancement network has multiple inputs and a single output, and the above deblurring operation can also be understood as filtering out blur factors represented by face frame images through convolution kernels.
[0109] In the above steps 402 and 403, the above prior information may be facial key points, and the above facial key points may be, for example, feature points such as eyebrows, eyes, nose, mouth, and facial contours. The above facial key points may be extracted when generating a two-dimensional image in step 102, or may be extracted by inputting into an image enhancement network. Since facial key points are neat and robust, they can be used as prior information to guide the denoising and deblurring operations of facial frame image representations, that is, during the denoising and deblurring process, the feature values of the corresponding facial key points need to be kept from decreasing.
[0110] Similarly, when the above-mentioned prior information is face shape parameters and face texture parameters, where the face shape parameters can be described by face key points and the face texture parameters can be described by pixels or color gradient distribution, both can be used as prior information to guide the denoising and deblurring operations on face frame images, that is, during the denoising and deblurring process, the corresponding face shape parameters and face texture parameters need to be kept unchanged or the range of change is within a predetermined range.
[0111] It should be noted that the execution order of the above-mentioned step 402 and step 403 can be in no particular order. In some possible embodiments, the above-mentioned denoising convolution kernel and deblurring convolution kernel can be fused. After the training is completed, the fused convolution kernel can simultaneously denoise and deblur the continuous face frame images.
[0112] 404. Output the target face image.
[0113] After denoising and deblurring continuous face frame images, the image enhancement network will output a target face image, which can be used for face recognition. Since the target face image has been denoised and deblurred, the image quality of the face becomes higher, which can improve the accuracy of face recognition in subsequent face recognition.
[0114] It should be noted that the above-mentioned 3D reconstruction network and the above-mentioned image enhancement network are cascaded. By cascading the 3D reconstruction network and the image enhancement network, the overall performance of the two networks can be improved, and the training set is more unified, which makes the learning speed fast and improves the network training speed.
[0115] In an embodiment of the present invention, a preset number of continuous face frame images are obtained; the continuous face frame images are input into a pre-trained three-dimensional reconstruction network for three-dimensional face reconstruction, and the three-dimensional face is obtained and then rendered as a two-dimensional face image; the continuous face frame images are subjected to image denoising and deblurring through the two-dimensional face image and the pre-trained image enhancement network to obtain a target face image; wherein the three-dimensional reconstruction network and the image enhancement network are cascaded. By performing three-dimensional face reconstruction on the continuous face frame images and rendering to obtain a two-dimensional face image, the image quality of the two-dimensional face image obtained in this way is very high, so that the two-dimensional face image has clearer features that can be used as prior information. After the image enhancement network denoises and deblurs the continuous face frame images based on the two-dimensional face image as prior information, a face image with higher visual quality can be obtained.
[0116] It should be noted that the face image processing method provided in the embodiment of the present invention can be applied to devices such as mobile phones, monitors, computers, servers, etc. that can perform face image processing.
[0117] See also Figure 5 , Figure 5 1 is a flow chart of a method for jointly training a 3D reconstruction network and an image enhancement network provided by an embodiment of the present invention. Figure 5 As shown, the method includes:
[0118] 501. Build a sample set.
[0119] The sample set includes a sample face image, a face key point position label, a pixel mean square error label, and a reconstruction parameter label corresponding to the sample face image.
[0120] In this step, the face images in the sample set are a preset number of continuous face frame images. Furthermore, the preset number of continuous face frame images is the same during the training process and the inference process. For example, during the training process, the number of continuous face frame images in the sample set is 5, and during the inference process, the number of continuous face frame images input is also 5. It should be noted that the preset number of continuous face frame images can be used as a group of sample face images. For example, a group of sample face images includes 5 continuous face frame images.
[0121] The facial key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the sample facial images may be annotated manually or through a corresponding automatic annotation network.
[0122] The sample face image is a sample face image with fuzzy factors and noise factors. The sample face can be obtained by adding fuzzy factors and noise factors to a clear face image.
[0123] Specifically, Figure 6 As shown, Figure 6 A flow chart of constructing a sample set provided in an embodiment of the present invention includes:
[0124] 601. Obtain a preset number of continuous face frame images as a group of sample face images to be processed.
[0125] In this step, the above-mentioned sample face images to be processed can be high-quality face images captured by a camera, or can be high-quality face images captured in a video, or can be high-quality face images generated by a GAN (Generative Adversarial Networks) network or other face generators. High-quality face images can obtain more accurate labels when labeled. Of course, in some automatic labeling networks, since the automatic labeling network learns fuzzy face labels, in embodiments of the present invention, it is not necessary to require the sample face images to be processed to be of high quality.
[0126] In the embodiment of the present invention, since the 3D reconstruction network and the image enhancement network are both multi-input neural networks, the sample face image can be a set of continuous face frame images. Further, since the 3D reconstruction network and the image enhancement network are both single-output neural networks, one face image can be selected as a representative face frame image from a set of sample face images.
[0127] Specifically, the above-mentioned preset number can be 2n+1, that is, in this step, 2n+1 continuous face frame images are obtained as a group of sample face images to be processed. In this way, the middle n+1 frame can be selected as a representative face frame image, so as to obtain evenly distributed upper and lower frame image information to improve the accuracy of the 3D reconstruction network and the image enhancement network.
[0128] 602. Randomly select at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to perform blur addition and noise addition on the current sample face image to be processed, so as to obtain a processed sample face image.
[0129] In this step, the above-mentioned pre-prepared blur kernel and noise kernel can be obtained through the image blur data and image noise data provided by the corresponding database. Specifically, a blur kernel library and a noise kernel library can be established based on the above-mentioned image blur data and image noise data, and the current sample face image to be processed can be processed by randomly selecting or specifying blur kernels and noise kernels in the blur kernel library and the noise kernel library to obtain a sample face image with added blur factors and noise factors as the processed sample face image. It should be noted that since the current sample face image to be processed is a set of a preset number of sample face frame images, the same blur factors and noise factors are added to a set of preset number of sample face frame images through the same blur kernel and noise kernel.
[0130] In a possible embodiment, fuzzy factors and noise are added to the current sample face image to be processed, or the processed sample face image is generated by simultaneously inputting the current sample face image to be processed and the corresponding fuzzy factor type and noise type to be added into the image generator.
[0131] It should be noted that the above-mentioned sample face image to be processed can be understood as image F(x, y), and the above-mentioned processed sample face image can be understood as image G(x, y), wherein the above-mentioned G(x, y)=H(F(x, y))+N, wherein the above-mentioned H is the blur kernel and the above-mentioned N is the noise kernel.
[0132] 603. According to the current sample face image to be processed, obtain the face key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the current sample face image to be processed.
[0133] In this step, the facial key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the current sample face image to be processed can be obtained by manual or automatic labeling. The above-mentioned facial key point position labels, pixel mean square error labels and reconstruction parameter labels can be used as training guidance, so that the reconstruction parameters of the three-dimensional face output by the three-dimensional reconstruction network during the training process are as close as possible to the reconstruction parameter labels, the facial key point positions of the two-dimensional face image rendered by the three-dimensional reconstruction network are as close as possible to the facial key point position labels, and the target face image output by the image enhancement network is as close as possible to the pixel mean square error labels. In this way, the cascaded three-dimensional reconstruction network and image enhancement network can be trained to output the target face image as the desired face image.
[0134] 604. Add the processed sample face images, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the current sample face images to be processed as a group of sample face images to the sample set.
[0135] In this step, blur factors and noise factors are added to the processed sample face images to make the processed sample face images closer to the face images captured by the real camera. It should be noted that a set of sample face images includes a preset number of continuous face frame images, as well as face key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the face frame images.
[0136] Furthermore, in an embodiment of the present invention, continuous face frame images in a group of sample face images may be connected on a channel to form an input entity.
[0137] 502. Input the sample set into the cascaded 3D reconstruction network and image enhancement network to train the 3D reconstruction network and image enhancement network.
[0138] In this step, the 3D reconstruction network and the image enhancement network are cascaded, and the inputs of the two networks both contain the same sample face images.
[0139] The above-mentioned training of the 3D reconstruction network includes: (1) enabling the 3D reconstruction network to learn to predict the reconstruction parameters of the 3D face and render it as a 2D face; and (2) enabling the image enhancement network to learn to predict deblurring and denoising.
[0140] During the training process, the error between the predicted result and the expected result (label) can be calculated through the loss function, and the parameters of the 3D reconstruction network and the image enhancement network can be adjusted through reverse error propagation to complete the training.
[0141] 503. Calculate a first loss function of predicting reconstruction parameters and reconstruction parameter labels in a three-dimensional reconstruction network.
[0142] In this step, the first loss function is as follows:
[0143]
[0144] Among them, the above-mentioned Param_Loss represents the first loss function, the above-mentioned reconstruct_params represents the predicted reconstruction parameters, the above-mentioned reconstruct_params ground truth represents the reconstruction parameter label, N represents the total number of sample face images in the sample set, reconstruct_params[i] represents the predicted reconstruction parameters of the current sample face image, and reconstruct_params ground truth[i] represents the reconstruction parameter label of the current sample face image.
[0145] 504. Calculate a second loss function corresponding to the predicted facial key point positions and the facial key point position labels in the two-dimensional face image in the three-dimensional reconstruction network.
[0146] In this step, the second loss function is as follows:
[0147]
[0148] Among them, the above-mentioned Landmark_Loss represents the second loss function, the above-mentioned reconland_mark represents the predicted face key point position, the above-mentioned origin_mark represents the face key point position label, N represents the total number of sample face images in the sample set, reconland_mark[i][x] represents the x-coordinate of the predicted face key point position of the current sample face image, origin_mark[i][x] represents the x-coordinate of the face key point position label of the current sample face image, similarly, reconland_mark[i][y] represents the y-coordinate of the predicted face key point position of the current sample face image, and origin_mark[i][y] represents the y-coordinate of the face key point position label of the current sample face image.
[0149] 505. Calculate the third loss function of the predicted pixel mean square error and the pixel mean square error label of the target face image obtained in the image enhancement network.
[0150] In this step, the third loss function is as follows:
[0151] ImageMse_Loss=mse_loss(Face_enhanced, im n+1 )(Formula 6)
[0152] The above ImageMse_Loss represents the third loss function, and the above mse_loss(Face_enhanced,im1) represents the loss of the predicted face image and the pixel mean square error label. Face_enhanced is the predicted face image output by the image enhancement network, im1 is the predicted face image output by the image enhancement network, and n+1 It represents the face frame image when the preset number is 2n+1.
[0153] 506. Calculate the total loss of the first loss function, the second loss function and the third loss function, adjust the parameters of the 3D reconstruction network and the image enhancement network according to back propagation, iterate the training to minimize the total loss, and obtain a trained 3D reconstruction network and a trained image enhancement network.
[0154] In this step, the total loss of the first loss function, the second loss function and the third loss function can be the sum of the first loss function, the second loss function and the third loss function, or the weighted sum of the first loss function, the second loss function and the third loss function, which can be selected or set by the user. For example, when the gradient descent of the image enhancement network is fast, the weight coefficient of the third loss function can be adjusted to slow down the gradient descent of the total loss, so that the training of the three-dimensional reconstruction network and the image enhancement network can be synchronized, avoiding the gradient explosion of the image enhancement network due to the gradient descent being too fast.
[0155] After calculating the total loss, the corresponding error is calculated through the total loss, and the parameters of the 3D reconstruction network and the image enhancement network are adjusted by back propagation based on the error.
[0156] For further explanation of the embodiments of the present invention, see Figure 7 , Figure 7 A schematic diagram of a joint training further provided by an embodiment of the present invention is as follows: Figure 7 As shown, the sample face image is (im0, im1, im2), where im1 is a representative face frame image, im1 is labeled to obtain the corresponding face key point position label, pixel mean square error label and reconstruction parameter label, and fuzzy factors and noise factors are added to im0, im1, and im2 respectively, and im0, im1, and im2 with added fuzzy factors and noise factors are connected. After connection, they are input into the parameter prediction network in the three-dimensional reconstruction network for processing to obtain predicted reconstruction parameters, and the loss of the predicted reconstruction parameters and the reconstruction parameter label is calculated through the first loss function; the face is reconstructed by the parameter reconstruction network in the three-dimensional reconstruction network. Perform three-dimensional reconstruction to obtain a three-dimensional face; render the three-dimensional face to obtain a two-dimensional face image, at this time, extract the predicted face key point positions of the two-dimensional face image, and calculate the loss of the predicted face key point positions and the face key point position labels through the second loss function; connect the two-dimensional face image with im0, im1, and im2 to which blur factors and noise factors are added, and after connection, input them into the cascaded image enhancement network for denoising and deblurring, and the image enhancement network outputs a high-quality target face image, at this time, calculate the predicted pixel mean square error of the target face image, and calculate the loss of the predicted pixel mean square error and the pixel mean square error label through the third loss function.
[0157] It should be noted that the forward reasoning is different from the above training process. After training, when the continuous face frame images are forward reasoned, there is no labeling step, no step of adding blur factors and noise factors, and no step of calculating the loss through the first loss function, the second loss function, and the third loss function. Figure 7 Indicated by dotted lines.
[0158] In the embodiment of the present invention, since both the 3D reconstruction network and the image enhancement network process the image of the human face, they have high commonality, and joint training can reduce the time required for training. By training the 3D reconstruction network and the image enhancement network, a human face image with high image quality can be obtained, providing high-quality input for the subsequent recognition network, thereby improving the recognition accuracy of the subsequent recognition network.
[0159] See also Figure 8 , Figure 8 is a structural diagram of a face image processing device provided by an embodiment of the present invention, such as Figure 8 As shown, the device comprises:
[0160] An acquisition module 801 is used to acquire a preset number of continuous face frame images;
[0161] The first processing module 802 is used to input the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and then render the obtained 3D face into a 2D face image;
[0162] The second processing module 803 is used to perform image denoising and deblurring on the continuous face frame images through the two-dimensional face image and a pre-trained image enhancement network to obtain a target face image;
[0163] Wherein, the three-dimensional reconstruction network and the image enhancement network are cascaded.
[0164] Optional, such as Fig. 9 As shown, the first processing module 802 includes:
[0165] A parameter extraction submodule 8021 is used to extract face reconstruction parameters of the continuous face frame images through the parameter extraction network;
[0166] A parameter reconstruction submodule 8022, configured to reconstruct the face reconstruction parameters through the parameter reconstruction network to obtain a three-dimensional face;
[0167] The rendering submodule 8023 is used to perform two-dimensional rendering on the three-dimensional face to obtain a two-dimensional face image.
[0168] Optionally, the image enhancement network includes a denoising convolution kernel and a deblurring convolution kernel, such as Fig.10 As shown, the second processing module 803 includes:
[0169] A first input submodule 8031 is used to input the two-dimensional face image as the prior information of the continuous face frame image into the image enhancement network;
[0170] A first processing submodule 8032 is configured to perform a denoising operation on the continuous face frame images by using the denoising convolution kernel, taking the prior information as a reference; and
[0171] The second processing submodule 8033 is used to perform a deblurring operation on the continuous face frame images by using the deblurring convolution kernel with reference to the prior information;
[0172] The output submodule 8034 is used to output the target face image.
[0173] Optionally, the 3D reconstruction network and the image enhancement network are jointly trained, such as Fig.11 As shown, the apparatus further includes a joint training module 804, wherein the joint training module 804:
[0174] The sample submodule 8041 is used to construct a sample set, wherein the sample set includes a sample face image, a face key point position label, a pixel mean square error label, and a reconstruction parameter label corresponding to the sample face image;
[0175] A second input submodule 8042 is used to input the sample set into the cascaded 3D reconstruction network and the image enhancement network to train the 3D reconstruction network and the image enhancement network;
[0176] A first calculation submodule 8043 is used to calculate a first loss function for predicting reconstruction parameters and reconstruction parameter labels in the 3D reconstruction network; and
[0177] A second calculation submodule 8044 is used to calculate a second loss function corresponding to the predicted facial key point positions and the facial key point position labels in the two-dimensional face image in the three-dimensional reconstruction network; and
[0178] A third calculation submodule 8045 is used to calculate a third loss function of the predicted pixel mean square error and the pixel mean square error label of the target face image obtained in the image enhancement network;
[0179] The fourth calculation submodule 8046 is used to calculate the total loss of the first loss function, the second loss function and the third loss function, and adjust the parameters of the three-dimensional reconstruction network and the image enhancement network according to back propagation, iteratively train to minimize the total loss, and obtain a trained three-dimensional reconstruction network and a trained image enhancement network.
[0180] Optionally, the sample set includes multiple groups of sample face images, such as Fig.12 As shown, the sample submodule 8041 includes:
[0181] The first acquisition unit 80411 is used to acquire a preset number of continuous face frame images as a group of sample face images to be processed;
[0182] The first adding unit 80412 is used to randomly select at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to perform blur addition and noise addition on the current sample face image to be processed, so as to obtain a processed sample face image;
[0183] The second acquisition unit 80413 is used to acquire, according to the current sample face image to be processed, a face key point position label, a pixel mean square error label and a reconstruction parameter label corresponding to the current sample face image to be processed;
[0184] The second adding unit 80414 is used to add the processed sample face image, and the facial key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the current sample face image to be processed as a group of sample face images to the sample set.
[0185] Optionally, the sample set includes multiple groups of sample face images, such as Fig.13 As shown, the sample submodule 8041 includes:
[0186] The third acquisition unit 80415 is used to acquire 2n+1 consecutive face frame images as a group of sample face images to be processed;
[0187] The third adding unit 80416 is used to randomly select at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to perform blur addition and noise addition on the current sample face image to be processed, so as to obtain 2n+1 processed sample face images;
[0188] A connection unit 80417 is used to perform channel connection on the 2n+1 processed sample face images to obtain a target sample face image;
[0189] The fourth acquisition unit 80418 is used to acquire, according to the sample face image to be processed, a face key point position label, a pixel mean square error label and a reconstruction parameter label corresponding to the nth sample face image to be processed;
[0190] The fourth adding unit 80419 is used to add the target sample face image, and the face key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the nth sample face image to be processed as a group of sample face images to the sample set.
[0191] It should be noted that the face image processing apparatus provided in the embodiment of the present invention can be applied to devices such as mobile phones, monitors, computers, servers, etc. that can perform face image processing.
[0192] The face image processing device provided in the embodiment of the present invention can implement each process implemented by the face image processing method in the above method embodiment and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0193] See also Fig.14 , Fig.14 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Fig.14 As shown, it includes: a memory 1402, a processor 1401, and a computer program stored in the memory 1402 and executable on the processor 1401, wherein:
[0194] The processor 1401 is used to call the computer program stored in the memory 1402 and execute the following steps:
[0195] Obtain a preset number of continuous face frame images;
[0196] Inputting the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and rendering the obtained 3D face into a 2D face image;
[0197] Performing image denoising and deblurring on the continuous face frame images through the two-dimensional face image and a pre-trained image enhancement network to obtain a target face image;
[0198] Wherein, the three-dimensional reconstruction network and the image enhancement network are cascaded.
[0199] Optionally, the 3D reconstruction network includes a parameter extraction network and a parameter reconstruction network, and the processor 1401 inputs the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and renders the obtained 3D face into a 2D face image, including:
[0200] Extracting face reconstruction parameters of the continuous face frame images through the parameter extraction network;
[0201] Reconstructing the face reconstruction parameters through the parameter reconstruction network to obtain a three-dimensional face;
[0202] Perform two-dimensional rendering on the three-dimensional human face to obtain a two-dimensional human face image.
[0203] Optionally, the image enhancement network includes a denoising convolution kernel and a deblurring convolution kernel, and the processor 1401 performs image denoising and deblurring on the continuous face frame images through the two-dimensional face image and the pre-trained image enhancement network to obtain the target face image, including:
[0204] Input the two-dimensional face image into the image enhancement network as the prior information of the continuous face frame image;
[0205] Using the prior information as a reference, performing a denoising operation on the continuous face frame images through the denoising convolution kernel; and
[0206] Using the prior information as a reference, performing a deblurring operation on the continuous face frame images through the deblurring convolution kernel;
[0207] The target face image is output.
[0208] Optionally, the three-dimensional reconstruction network and the image enhancement network are jointly trained, and the processor 1401 further performs the joint training, including:
[0209] Constructing a sample set, the sample set comprising a sample face image, a face key point position label, a pixel mean square error label, and a reconstruction parameter label corresponding to the sample face image;
[0210] Inputting the sample set into the cascaded three-dimensional reconstruction network and the image enhancement network to train the three-dimensional reconstruction network and the image enhancement network;
[0211] Calculating a first loss function for predicting reconstruction parameters and reconstruction parameter labels in the three-dimensional reconstruction network; and
[0212] Calculating a second loss function corresponding to predicted facial key point positions and facial key point position labels in the two-dimensional face image in the three-dimensional reconstruction network; and
[0213] Calculating a third loss function of the predicted pixel mean square error and the pixel mean square error label of the target face image obtained in the image enhancement network;
[0214] The total loss of the first loss function, the second loss function and the third loss function is calculated, and the parameters of the 3D reconstruction network and the image enhancement network are adjusted according to back propagation, and the training is iteratively performed to minimize the total loss to obtain a trained 3D reconstruction network and a trained image enhancement network.
[0215] Optionally, the sample set includes a plurality of groups of sample face images, and the step of constructing the sample set executed by the processor 1401 includes:
[0216] Acquire a preset number of continuous face frame images as a group of sample face images to be processed;
[0217] Randomly selecting at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to add blur and noise to the current sample face image to be processed, so as to obtain a processed sample face image;
[0218] According to the current sample face image to be processed, obtaining the face key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the current sample face image to be processed;
[0219] The processed sample face image, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the current sample face image to be processed are added to the sample set as a group of sample face images.
[0220] Optionally, the sample set includes a plurality of groups of sample face images, and the step of constructing the sample set executed by the processor 1401 includes:
[0221] Obtain 2n+1 consecutive face frame images as a group of sample face images to be processed;
[0222] Randomly select at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to add blur and noise to the current sample face image to be processed, so as to obtain 2n+1 processed sample face images;
[0223] Connect the 2n+1 processed sample face images through channels to obtain a target sample face image;
[0224] According to the sample face image to be processed, obtaining the face key point position label, pixel mean square error label and reconstruction parameter label corresponding to the nth sample face image to be processed;
[0225] The target sample face image, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the nth sample face image to be processed are added to the sample set as a group of sample face images.
[0226] It should be noted that the above-mentioned electronic device may be a mobile phone, monitor, computer, server or other device that can be used for facial image processing.
[0227] The electronic device provided by the embodiment of the present invention can implement each process implemented by the face image processing method in the above method embodiment, and can achieve the same beneficial effects. To avoid repetition, it will not be described here.
[0228] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the face image processing method provided by the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0229] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0230] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A facial image processing method, characterized in that: The following steps are involved: Obtain a preset number of continuous face frame images; Inputting the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and rendering the obtained 3D face into a 2D face image; Performing image denoising and deblurring on the continuous face frame images through the two-dimensional face image and a pre-trained image enhancement network to obtain a target face image; The three-dimensional reconstruction network and the image enhancement network are cascaded, and the three-dimensional reconstruction network and the image enhancement network are jointly trained, and the joint training includes: Constructing a sample set, the sample set comprising a sample face image, a face key point position label, a pixel mean square error label, and a reconstruction parameter label corresponding to the sample face image; Inputting the sample set into the cascaded three-dimensional reconstruction network and the image enhancement network to train the three-dimensional reconstruction network and the image enhancement network; Calculating a first loss function for predicting reconstruction parameters and reconstruction parameter labels in the three-dimensional reconstruction network; and Calculating a second loss function corresponding to predicted facial key point positions and facial key point position labels in the two-dimensional face image in the three-dimensional reconstruction network; and Calculating a third loss function of the predicted pixel mean square error and the pixel mean square error label of the target face image obtained in the image enhancement network; The total loss of the first loss function, the second loss function and the third loss function is calculated, and the parameters of the 3D reconstruction network and the image enhancement network are adjusted according to back propagation, and the training is iteratively performed to minimize the total loss to obtain a trained 3D reconstruction network and a trained image enhancement network.
2. The method according to claim 1, characterized in that The three-dimensional reconstruction network includes a parameter extraction network and a parameter reconstruction network. The continuous face frame images are input into a pre-trained three-dimensional reconstruction network to perform three-dimensional face reconstruction, and the obtained three-dimensional face is rendered into a two-dimensional face image, including: Extracting face reconstruction parameters of the continuous face frame images through the parameter extraction network; Reconstructing the face reconstruction parameters through the parameter reconstruction network to obtain a three-dimensional face; Perform two-dimensional rendering on the three-dimensional human face to obtain a two-dimensional human face image.
3. The method according to claim 2, characterized in that The image enhancement network includes a denoising convolution kernel and a deblurring convolution kernel. The continuous face frame images are subjected to image denoising and deblurring through the two-dimensional face image and the pre-trained image enhancement network to obtain a target face image, including: Input the two-dimensional face image into the image enhancement network as the prior information of the continuous face frame image; Using the prior information as a reference, performing a denoising operation on the continuous face frame images through the denoising convolution kernel; and Using the prior information as a reference, performing a deblurring operation on the continuous face frame images through the deblurring convolution kernel; The target face image is output.
4. The method according to claim 1, characterized in that The sample set includes a plurality of groups of sample face images, and constructing the sample set includes: Acquire a preset number of continuous face frame images as a group of sample face images to be processed; Randomly selecting at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to add blur and noise to the current sample face image to be processed, so as to obtain a processed sample face image; According to the current sample face image to be processed, obtaining the face key point position labels, pixel mean square error labels and reconstruction parameter labels corresponding to the current sample face image to be processed; The processed sample face image, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the current sample face image to be processed are added to the sample set as a group of sample face images.
5. The method according to claim 1, characterized in that The sample set includes a plurality of groups of sample face images, and constructing the sample set includes: Obtain 2n+1 consecutive face frame images as a group of sample face images to be processed; Randomly select at least one blur kernel and at least one noise kernel from the pre-prepared blur kernels and noise kernels to add blur and noise to the current sample face image to be processed, so as to obtain 2n+1 processed sample face images; Connect the 2n+1 processed sample face images through channels to obtain a target sample face image; According to the sample face image to be processed, obtaining the face key point position label, pixel mean square error label and reconstruction parameter label corresponding to the nth sample face image to be processed; The target sample face image, and the face key point position labels, pixel mean square error labels, and reconstruction parameter labels corresponding to the nth sample face image to be processed are added to the sample set as a group of sample face images.
6. A facial image processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a preset number of continuous face frame images; A first processing module is used to input the continuous face frame images into a pre-trained 3D reconstruction network to perform 3D face reconstruction, and then render the obtained 3D face into a 2D face image; A second processing module is used to perform image denoising and deblurring on the continuous face frame images through the two-dimensional face image and a pre-trained image enhancement network to obtain a target face image; The three-dimensional reconstruction network and the image enhancement network are cascaded, and the three-dimensional reconstruction network and the image enhancement network are jointly trained, and the joint training includes: Constructing a sample set, the sample set comprising a sample face image, a face key point position label, a pixel mean square error label, and a reconstruction parameter label corresponding to the sample face image; Inputting the sample set into the cascaded three-dimensional reconstruction network and the image enhancement network to train the three-dimensional reconstruction network and the image enhancement network; Calculating a first loss function for predicting reconstruction parameters and reconstruction parameter labels in the three-dimensional reconstruction network; and Calculating a second loss function corresponding to predicted facial key point positions and facial key point position labels in the two-dimensional face image in the three-dimensional reconstruction network; and Calculating a third loss function of the predicted pixel mean square error and the pixel mean square error label of the target face image obtained in the image enhancement network; The total loss of the first loss function, the second loss function and the third loss function is calculated, and the parameters of the 3D reconstruction network and the image enhancement network are adjusted according to back propagation, and the training is iteratively performed to minimize the total loss to obtain a trained 3D reconstruction network and a trained image enhancement network.
7. The device according to claim 6, characterized in that The three-dimensional reconstruction network includes a parameter extraction network and a parameter reconstruction network, and the first processing module includes: A parameter extraction submodule, used for extracting face reconstruction parameters of the continuous face frame images through the parameter extraction network; A parameter reconstruction submodule, used to reconstruct the face reconstruction parameters through the parameter reconstruction network to obtain a three-dimensional face; The rendering submodule is used to perform two-dimensional rendering on the three-dimensional face to obtain a two-dimensional face image.
8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the face image processing method according to any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps in the face image processing method according to any one of claims 1 to 5 are implemented.
