Face image restoration method and system based on reinforcement learning image content screening
By adopting the image content screening method based on reinforcement learning in face image repair, the problem of difficulty in actively screening image content and not robust to degraded media in the prior art is solved, and efficient face image repair is achieved and high-definition face image.
Patent Information
- Application Number
- CN202411412476.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-10-10
AI Technical Summary
Existing face image repair methods are difficult to actively filter image content, easy to learn pixel-level mapping, and are not robust to degraded media.
Using the image content filtering method based on reinforcement learning, the face image image is projected into the hidden space through the image space compression codec, and the filter of the reinforcement learning screening strategy is trained to build a face repair network for actively filtering face repair image content. .
Active screening of facial image content is realized, robustness to degraded media is improved, time and memory overhead for diffusion model training is reduced, and high-definition facial images are obtained.
Smart Images

Figure CN119494798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a facial image restoration method and system based on reinforcement learning image content screening. Background Art
[0002] Capturing high-definition images or videos of people in open scenes has long been a critical requirement for industries such as photography, filmmaking, and security. However, due to the influence of the shooting environment, the limitations of the camera, and long-distance transmission, the final image may appear blurry, noisy, or suffer from compression distortion, reducing image quality. With the development of artificial intelligence, it has become possible to improve the quality of facial images through data-driven training of deep neural networks.
[0003] Existing methods for facial image restoration can be divided into methods based on two-dimensional images and methods based on facial three-dimensional models. Among them, the two-dimensional image-based method only processes two-dimensional images in the process, and learns the mapping from low-definition images to high-definition images through a neural network. For example, the invention application with publication number CN111681182A discloses a method, device, terminal device and storage medium for image restoration based on generative adversarial networks in neural networks. Specifically, it includes obtaining the image to be restored, inputting the image to be restored into a pre-created restoration model, encoding the image in the image to be restored through an encoder to obtain feature maps of several sizes; reconstructing the feature map through a generator to obtain a generated image; and then using a discriminator to discriminate between the generated image and the high-quality image in the corresponding high-quality image dataset to obtain a discrimination result, and combining the discrimination result with a preset target loss function to train the image restoration network model to perform image restoration.
[0004] For example, reference 1 (Yang, Tao, et al..GAN prior embedded network for blindface restoration in the wild[C].Proceedings of the IEEE / CVF conferenceoncomputer vision and pattern recognition.2021) proposed a GAN prior embedded network (GAN prior embedded network) for repairing severely degraded face images. Specifically, the pre-trained StyleGAN is set as a decoder, and another encoder is set to provide the style vector of StyleGAN, and the corresponding layer of the encoder is jump-connected to StyleGAN to replace the noise input; the training loss function uses a pixel-level loss function and a perceptual loss function, and an additional discriminator is introduced to use an adversarial learning loss function.
[0005] The method based on the three-dimensional facial model uses the strong structural information of the face to predict the three-dimensional structure of the face from the low-definition picture in the model, and integrates this information into the two-dimensional image to use the facial prior structure to help prediction. For example, Reference 2 (Wang, Xintao, et al. Towards real-world blind face restoration with generative facial prior [C]. Proceedings of the IEEE / CVF conference on computervision and pattem recognition. 2021) improves the facial geometry prior or reference prior for facial restoration and improves the applicability of real-world scenes. Specifically, a two-dimensional convolutional neural network is used to extract the two-dimensional information of the low-definition picture, and in addition to the two-dimensional convolutional network, the D3DFR technology is used to predict the facial shape and color texture. After that, the three-dimensional information is projected back onto the two-dimensional plane, and then added to the picture decoder at different scales through the convolutional encoder.
[0006] The above are representative existing methods for facial image restoration. Their main shortcomings include two aspects. First, 2D image-based methods inpaint HD images from intact low-definition images without filtering, making it difficult to learn facial structural information. This makes it easier for the model to learn pixel-level mapping from low-definition to high-definition images, resulting in poor robustness to image degradation. Second, 3D model-based methods only learn structured content related to facial shape, without filtering or compressing unstructured content such as facial texture. As a result, the model still learns pixel-level mapping, resulting in poor robustness to degraded media. Summary of the Invention
[0007] The purpose of the present invention is to provide a facial image restoration method and system based on reinforcement learning image content screening, so as to solve the problems of existing facial image restoration methods that cannot actively screen, easily learn pixel-level mapping, and are not robust to degraded media, and obtain high-definition facial images through restoration.
[0008] To achieve the above-mentioned purpose of the invention, the embodiment provides a facial image restoration method and system based on reinforcement learning image content screening, including a facial image restoration method based on reinforcement learning image content screening and a system based on the facial image restoration method.
[0009] In one embodiment, the facial image restoration method based on reinforcement learning image content screening includes the following steps:
[0010] Collecting facial image data for training image space compression codecs;
[0011] Based on the image space compression codec, the face image is projected into the latent space, the filter based on the random screening strategy is trained, and a face restoration network is constructed for randomly screening the content of the face restoration image;
[0012] Reinforcement learning is used to replace random screening, and the filter of the reinforcement learning screening strategy is trained to build a face restoration network for actively screening the content of face restoration images;
[0013] Iteratively optimize the face restoration network to obtain the optimized face restoration network;
[0014] Based on the optimized face restoration network, inference sampling is performed to obtain a noise-free latent space feature map, which is then decoded using an image space compression decoder to obtain a restored high-definition face image.
[0015] In one embodiment, collecting facial image data for training an image space compression codec includes:
[0016] Facial images are collected to construct sample data, and the image space compression codec is trained based on the sample data through data-driven training; the image space compression encoder compresses the facial image and projects it into the latent space for diffusion model training; the image space compression decoder maps the feature map output by the diffusion model back to the image space for decoding to obtain the restored high-definition facial image.
[0017] In one embodiment, the filter of the random screening strategy obtains one-dimensional features by subjecting low-definition images to feature extraction and compression using a multi-layer perceptron. The one-dimensional features are screened at random proportions, and the discarded features are replaced with a unified mask token. After being processed by a Transformer, the action value is obtained for randomly screening facial image features.
[0018] In one embodiment, the face restoration network for randomly screening the content of face restoration images includes: t , random screening strategy and low-definition images are used as input to train the diffusion model, and the predicted noise map is obtained through the U-net codec. Prediction noise map and the true noise map ε t Perform loss function calculation, randomly screen facial image features, and build a face restoration network for randomly screening face restoration image content.
[0019] In one embodiment, the U-net codec includes a U-net encoder and a U-net decoder; wherein the U-net codec includes a backbone U-net encoder and a conditional U-net encoder, and the backbone U-net encoder and the conditional U-net encoder have the same structure but do not share parameters.
[0020] In one embodiment, the reinforcement learning screening is performed by downsampling the low-definition image through a multi-layer perceptron to a level similar to the latent space feature map Z. t With the same spatial dimension, the downsampled feature map F′ is obtained t , and then with the latent space feature map Z t Concatenate; add the concatenated result to the embedded time t, and then process it through the Transformer to obtain the action value. Select the action with the maximum value to actively filter the facial image features.
[0021] The face restoration network for actively screening the content of face restoration images includes: training a diffusion model based on a reinforcement learning screening strategy to obtain a predicted noise map The noise map will be predicted and the true noise map ε t Perform pixel-level loss and take negative average as the reward for the reinforcement learning screening strategy filter;
[0022] Using the DDIM sampling formula, based on time t and latent space feature map Z t , the action with the greatest value and reward, obtain the latent space feature map of the next moment t-1 Stored as a set of interaction data in the Reply Buffer;
[0023] Based on the DQN training method, random sampling from the reply buffer is used to train the reinforcement learning screening strategy filter. During the training process, the parameters of the latent space diffusion model are fixed, and only the parameters of the reinforcement learning screening strategy filter are optimized to build a face restoration network for actively screening the content of face restoration images.
[0024] In one embodiment, the iterative optimization includes:
[0025] (1) Iteratively train the diffusion model, select the screening strategy provided by the filter of the reinforcement learning screening strategy to train the diffusion model, and the parameters of the filter are fixed during the training process;
[0026] (2) Iteratively train the filter, while the parameters of the diffusion model are fixed during the training process;
[0027] (3) If the number of iterative training times has not been reached, return to the diffusion model and continue training; otherwise, the training is completed and the diffusion model and filter are output.
[0028] In one embodiment, the inference sampling includes:
[0029] (1) Based on the face restoration network, the low-resolution image is filtered through the filter strategy to obtain the filtered feature map F″ t , and the latent space feature map Z t After completing the operation of the face restoration network, the predicted noise map is output
[0030] (2) Based on the predicted noise map Iterative denoising is performed using DDIM sampling. The screening strategy in the denoising process is provided by the screening strategy generator until a noise-free latent space feature map is output.
[0031] (3) The noise-free latent space feature map After the image space compression decoder, the restored high-definition face image is obtained.
[0032] In order to clearly demonstrate the facial image restoration method, a facial image restoration system based on reinforcement learning image content screening is provided. The system uses the facial image restoration method based on reinforcement learning image content screening during the facial image restoration process.
[0033] A system based on a face image restoration method, the system comprising: an image space compression codec module, a random filter module, a reinforcement learning filter module, an iterative training module, and an inference sampling module;
[0034] The image space compression codec module is used to collect face image data and train the image space compression encoder and image space compression decoder;
[0035] The random filter module is used to randomly filter the facial structure of the face restoration image as a screening strategy, perform latent space diffusion model training, and obtain the randomly filtered face restoration image content;
[0036] The reinforcement learning filter module is used to actively filter the facial structure of the face restoration image as a screening strategy, perform latent space diffusion model training, improve the image restoration capability under the premise of ensuring the consistency of the generated image content, and obtain the actively filtered face restoration image content;
[0037] The iterative training module is used to iteratively optimize the filter and diffusion model to complete the decision-level mapping from low-definition images to high-definition images;
[0038] The inference sampling module performs inference sampling and decoding on the facial image data based on the image space compression codec module, the random filter module, the reinforcement learning filter module and the iterative training module to obtain a restored high-definition facial image.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] Compared with existing face image restoration methods, the face image restoration method based on reinforcement learning image content screening of the present invention has a compression effect on face data, reducing the time and video memory overhead of subsequent diffusion model training; and based on the generation capability of the image codec, it has a restoration effect on less degraded face images; the constructed face restoration network and screening strategy generator can not only learn the face structure, but also actively screen the face image content, complete the decision-level mapping from low-definition images to high-definition images, and improve the robustness to degraded media.
[0041] The face image restoration system of the present invention is based on the face image restoration method and can be used for face image restoration to obtain a restored high-definition face image. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for describing the embodiments or the prior art.
[0043] Figure 1 is a flow chart of the face image restoration method;
[0044] Figure 2 This is a structural diagram of the filter;
[0045] Figure 3Schematic diagram of the structure of the face restoration network built based on the filter;
[0046] Figure 4 Schematic diagram of the reinforcement learning screening strategy structure in the filter;
[0047] Figure 5 This is a structural diagram of the face image restoration system;
[0048] Figure 6 This is a schematic diagram of the effect of the face image restoration method; Figure 6 The left side of the figure is the face image before restoration. Figure 6 The right side of the figure is the restored face image. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0050] To address the problems of existing facial image restoration methods that cannot actively filter, are prone to learning pixel-level mapping, and are not robust to degraded media, the embodiments provide a facial image restoration method and system based on reinforcement learning image content screening. This restoration method can learn the structural information of the face and actively filter it, achieving decision-level mapping from low-definition images to high-definition images, and improving the robustness to degraded media of facial images. Figure 1 As shown, the face image restoration method based on reinforcement learning image content screening provided by the embodiment includes the following steps:
[0051] S1. Collect face image data to train image space compression codec.
[0052] In this embodiment, a large amount of high-definition face data is collected, and the number of face images used should be as large as possible, and should cover as many scenes as possible, to ensure the generalization of the encoder-decoder so that it can be applied to face compression encoding and decoding in various scenes;
[0053] Through data-driven training of paired latent space encoder-decoder, high-definition image I hq Compress to a smaller size latent space to obtain the encoded latent space feature Z hq :
[0054] Z hq =Encoder(I hq ) (1)
[0055] The decoder maps the latent space features back to the original normal-sized image space to obtain the decoded latent space features I hq:
[0056] I hq =Decoder(Z hq ) (2)
[0057] The training loss function consists of two parts. One is the pixel-level reconstruction constraint, which is used to constrain the consistency of the image processed by the image space compression codec with the original image. In order to constrain the distribution of the latent space, a KL divergence constraint is also added to make the distribution of the latent space close to the standard normal distribution. The number of channels in the space should not be too large, otherwise the subsequent diffusion model will not be able to be trained.
[0058] Based on the image space compression codec, the time and video memory overhead of subsequent diffusion model training can be reduced; and the encoding-decoding process itself has a certain generation capability due to its compression effect, which can repair images with weaker degradation.
[0059] S2. Based on the image space compression codec, the face image is projected into the latent space, the filter based on the random screening strategy is trained, and a face restoration network is constructed for randomly screening the content of the face restoration image;
[0060] In the embodiment, the trained image space compression encoder is first used to obtain the latent space feature Z of the high-definition image based on formula (1): hq , sampled from a Gaussian distribution with Z hq Noise maps of the same dimension and spatial size As the true noise map ε t And use the uniform distribution sampling time t~Uniform(1,...,T) to calculate the hidden space feature map Z at the time t t , the calculation formula used is as follows:
[0061]
[0062] in is a constant;
[0063] HD Picture I hq By using formula calculation to simulate degradation, a low-definition image I is generated. lq The degradation calculation method is:
[0064]
[0065] in, Indicates that the image is convolved with a Gaussian blur kernel with a kernel size of k, ↓ s indicates downsampling with a magnification of s, and n σ Indicates the addition of Gaussian noise with a standard deviation of σ, and jpeg-q indicates the use of JPEG compression with a compression rate of q.
[0066] Based on time t, latent space feature map Z t , screening strategies and low-resolution images I lq As the input of the diffusion model, the predicted noise map is obtained through the diffusion model operation The diffusion model calculation formula is as follows:
[0067]
[0068] like Figure 2 The figure shows a schematic diagram of the structure of the filter, which performs different screening according to the selected screening strategy, including a filter based on a random screening strategy and a filter based on a reinforcement learning screening strategy.
[0069] In an embodiment, the filter based on the random screening strategy is to filter the low-resolution image I lq First, a set of multi-layer perceptrons (MLPs) are used to extract features and compress resolution to obtain a two-dimensional feature map, and then the two-dimensional feature map is rearranged in one-dimensional space according to the vector to obtain a one-dimensional feature V t , for the one-dimensional feature V t , feature screening is performed according to the random screening strategy, and the screened positions are replaced with learnable mask tokens, namely:
[0070]
[0071] Among them, the random screening strategy randomly selects action a t (i) = 0 or 1 to achieve feature screening; a t (i) = 0 means that the mask token replaces the one-dimensional feature at the corresponding position, a t (i) = 1 means the action of retaining the one-dimensional feature at the corresponding position is selected;
[0072] One-dimensional features after replacement After several groups of Transformer calculations, they are rearranged in the form of two-dimensional images to obtain the filtered feature map F t , conduct subsequent diffusion model training;
[0073] like Figure 3 The figure shows the structure of the face restoration network. The filter of the random screening strategy is selected to construct the face restoration network for randomly screening the content of the face restoration image. First, the true value noise map ε with the same size as the latent space is sampled from the Gaussian distribution. t Ground truth noise map ε as face restoration network t ; The filtered feature map F t and the true noise map ε tThe fusion is performed and input into the conditional U-net for feature extraction at different levels to obtain the first feature, and then the first feature is jump-connected to the corresponding feature layer of the backbone U-net decoder;
[0074] The latent space feature map Z t and the true noise map ε t The conditional U-net encoder is fused and input into the backbone U-net encoder for feature extraction at different levels to obtain the second feature, which is then jump-connected to the corresponding feature layer of the backbone U-net decoder. Optionally, the conditional U-net encoder has the same structure as the backbone U-net encoder but does not share parameters. During the training process, the predicted noise map of the face restoration network and the true noise map ε t To calculate the loss function, the calculation formula is as follows:
[0075]
[0076] The parameters in the face restoration network are updated through gradient back propagation to complete the construction of a face restoration network for randomly screening the content of face restoration images.
[0077] S3: Use reinforcement learning to replace random filtering, train the filter of the reinforcement learning filtering strategy, and build a face restoration network for actively filtering the content of face restoration images. The face restoration network trained in S2 for random filtering of face restoration images has the ability to implicitly model facial structure but lacks the ability to actively filter image content. Therefore, the filtering strategy in the face restoration network is improved, and the reinforcement learning filtering strategy is used to replace the random filtering strategy for face restoration.
[0078] In the embodiment, Figure 4 The following is a schematic diagram of the structure of the reinforcement learning screening strategy. lq After MLP downsampling, the batch size (B) is reduced to the latent space feature map Z t With the same spatial size (h, w), the downsampled feature map F′ is obtained t ; The downsampled feature map F′ t and the latent space feature map Z t Concatenate; add the concatenated result to the embedded time t, and then process it through the Transformer block to obtain the spatial size and latent space feature map Z t Action values v with the same spatial dimensions (h, w) and dimension 2 t :
[0079] v t =N(Z t , t) (8)
[0080] Where N represents the screening strategy generator; the 0 channel on each action value represents the value of replacing the one-dimensional feature at the corresponding position with the mask token, and the 1 channel represents the value of retaining the one-dimensional feature at the corresponding position; based on the action value v t The action at position i is obtained by the following formula:
[0081]
[0082] Based on time t, latent space feature map Z t The diffusion model is trained using the reinforcement learning screening strategy. The method of obtaining the true noise map is consistent with that in the face restoration network. When performing the mask token replacement step of the low-definition image, the mask token is replaced with the action with the greatest value provided by the reinforcement learning screening strategy to obtain the predicted noise at position i. and the true noise map ε t , then perform pixel-level loss and take the negative average as the reward. The calculation formula is as follows:
[0083]
[0084] According to Z t , t and Use DDIM sampling method to obtain the feature map at time t-1 The sampling formula is as follows:
[0085]
[0086] where α t-1 , α t is a constant; if η = 0, then the generation process is deterministic, in which case it is DDIM sampling.
[0087] Z t ,t, and r t As a set of interaction data Store it in the ReplyBuffer and randomly extract interaction data from the ReplyBuffer based on the DQN training method in After filtering the strategy generator N, the action value at time t-1 is obtained and the maximum action value is taken. Finally, use the filter N to calculate the Q value:
[0088]
[0089] Where γ is the discount factor;
[0090] The calculated Q value is the expected output of the screening strategy generator N, and the training loss function is the two-norm distance between them:
[0091]
[0092] During the training process, the parameters of the diffusion model are fixed, and only the parameters of the reinforcement learning screening strategy are optimized and updated to build a face restoration network for actively screening the content of face restoration images.
[0093] S4: Iteratively optimize the face restoration network to obtain the optimized face restoration network. After S2 and S3, the face restoration network has good initial parameters, and iterative optimization is then performed to improve performance.
[0094] In the embodiment, the diffusion model is first iteratively trained, and a reinforcement learning screening strategy is selected for mask token replacement. The training steps are consistent with S2, and the remaining parameters remain fixed during the training process; then the filter is iteratively trained, and the training steps are consistent with S3, and the remaining parameters remain fixed during the training process; if the number of iterative training times has not been reached, the diffusion model is returned to continue training; otherwise, the training is completed, and the iteratively optimized diffusion model and filter are output to obtain an optimized face restoration network.
[0095] S5. Perform inference sampling based on the optimized face restoration network to obtain a noise-free latent space feature map, and use the image space compression decoder to decode the noise-free latent space feature map to obtain a restored high-definition face image.
[0096] In the embodiment, firstly, the true noise map ε is sampled from the Gaussian distribution t ; The low-resolution image is filtered through reinforcement learning strategy to obtain the filtered feature map F″ t , the filtered feature map F″ t and the true noise map ε t The fusion input is fed into the conditional U-net encoder to extract features at different levels to obtain the first feature; the latent space feature map Z t and the true noise map ε t The fusion input is fed into the backbone U-net encoder to extract features at different levels to obtain the second feature, and then the first and second features are jump-connected to the corresponding feature layer of the backbone U-net decoder to obtain the predicted noise map
[0097] Iterative denoising is performed using the DDIM sampling method. The screening strategy in the denoising process is the reinforcement learning screening strategy. This process is iterated until the time is 0, and the noise-free latent space feature map is output.
[0098] The noise-free latent space feature map Send it to the image space compression decoder trained by S1 to obtain the restored high-definition face image:
[0099]
[0100] I pre That is, a high-definition face image obtained by a face image restoration method based on reinforcement learning image content screening.
[0101] like Figure 5 The figure shows a face image restoration system based on reinforcement learning image content screening, including: an image space compression codec module, a random filter module, a reinforcement learning filter module, an iterative training module and an inference sampling module;
[0102] The image space compression codec module is used to collect face image data and train the image space compression encoder and image space compression decoder;
[0103] The random filter module is used to randomly filter the facial structure of the face restoration image as a screening strategy, perform latent space diffusion model training, and obtain the content of the randomly filtered face restoration image;
[0104] The reinforcement learning filter module is used to actively filter the facial structure of the face restoration image as a screening strategy, and conduct latent space diffusion model training to improve the image restoration capability while ensuring the consistency of the generated image content, thereby obtaining the content of the actively filtered face restoration image;
[0105] The iterative training module is used to iteratively optimize the filter and diffusion model to complete the decision-level mapping from low-definition images to high-definition images;
[0106] The inference sampling module performs inference sampling and decoding on the facial image data based on the image space compression codec module, random filter module, reinforcement learning filter module and iterative training module to obtain the restored high-definition facial image.
[0107] like Figure 6 The figure shows the effect of face image restoration method and system based on reinforcement learning image content screening. Figure 6 The left side of the figure shows the face image before restoration. Figure 6 The right side of the figure shows the restored face image. The results show that the face image restoration method and system based on reinforcement learning image content screening can effectively improve the image restoration capability and obtain high-definition face images.
[0108] By comparing with the existing face restoration methods, it is found that the face image restoration method and system based on reinforcement learning image content screening constructed by the present invention collects a large amount of face image data, and constructs a face restoration network based on a diffusion model that can be used to randomly screen face image features and output prediction noise. Considering that the face restoration network constructed based on the random screening strategy has the ability to implicitly model the facial structure, but does not have the ability to actively screen the image content, the screening strategy is optimized by training the screening strategy generator. The optimized restoration method has a compression effect on the face data, reducing the time and video memory overhead of subsequent diffusion model training; and based on the generation capability of the image codec, it has a restoration effect on facial images with weaker degradation; the face restoration network constructed based on the screening strategy generator can not only learn the face structure, but also screen the face image content, complete the decision-level mapping from low-definition images to high-definition images, improve the robustness to degraded media, and obtain the restored high-definition face image.
[0109] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A face image restoration method based on reinforcement learning image content screening, characterized in that: The following steps are involved: Collecting face image data for training image space compression codec; Based on the image space compression codec, the face image is projected into the latent space, the filter based on the random screening strategy is trained, and the face restoration network for randomly screening the content of the face restoration image is constructed; Reinforcement learning is used to replace random screening, and the filter of the reinforcement learning screening strategy is trained to build a face restoration network for actively screening the content of face restoration images. Iteratively optimize the face restoration network to obtain an optimized face restoration network; Based on the optimized face restoration network, inference sampling is performed to obtain a noise-free latent space feature map, and the noise-free latent space feature map is decoded using an image space compression decoder to obtain a restored high-definition face image.
2. The method for facial image restoration based on reinforcement learning image content screening according to claim 1, characterized in that: The collecting of face image data for training image space compression codec includes: Face images are collected to construct sample data, and the image space compression codec is trained based on the sample data through data-driven training; the image space compression encoder compresses the face image and projects it into the latent space for diffusion model training; the image space compression decoder maps the feature map output by the diffusion model back to the image space for decoding to obtain the restored high-definition face image.
3. The facial image restoration method based on reinforcement learning image content screening according to claim 1 is characterized in that: The filter of the random screening strategy obtains one-dimensional features by extracting and compressing low-definition images through a multi-layer perceptron; The one-dimensional features are screened at random proportions, and the discarded features are replaced with a unified mask token. After being processed by Transformer, the action value is obtained for random screening of facial image features.
4. The method for facial image restoration based on reinforcement learning image content screening according to claim 1, characterized in that: The face restoration network for randomly screening the content of face restoration images includes: t , random screening strategy and low-definition images are used as input to the diffusion model to train the diffusion model, and the predicted noise map is obtained through the U-net codec Predicted noise map and the true noise map ε t Calculate the loss function, randomly screen facial image features, and build a face restoration network for randomly screening face restoration image content.
5. The method for facial image restoration based on reinforcement learning image content screening according to claim 4, characterized in that: The U-net codec includes a U-net encoder and a U-net decoder; wherein the U-net codec includes a backbone U-net encoder and a conditional U-net encoder, the backbone U-net encoder and the conditional U-net encoder have the same structure but do not share parameters.
6. The method for facial image restoration based on reinforcement learning image content screening according to claim 1, characterized in that: The reinforcement learning screening described above downsamples the low-definition image through a multi-layer perceptron to a level similar to the latent space feature map Z. t With the same spatial dimension, the downsampled feature map F′ is obtained t , and then with the latent space feature map Z t Concatenate; add the concatenated result to the embedded time t, and then process it through Transformer to get the action value, and select the action with the maximum value to actively filter the face image features.
7. The method for facial image restoration based on reinforcement learning image content screening according to claim 1, characterized in that: The face restoration network for actively screening the content of face restoration images includes: training a diffusion model based on a reinforcement learning screening strategy to obtain a predicted noise map The predicted noise map and the true noise map ε t Perform pixel-level loss and take negative average as the reward for the reinforcement learning screening strategy filter; Using the DDIM sampling formula, based on time t and latent space feature map Z t , the action with the greatest value and reward, obtain the latent space feature map of the next moment t-1 Stored in the Reply Buffer as a set of interaction data; Based on the DQN training method, random sampling from the Reply Buffer is used to train the reinforcement learning screening strategy filter. During the training process, the parameters of the latent space diffusion model are fixed, and only the parameters of the reinforcement learning screening strategy filter are optimized to build a face restoration network for actively screening the content of face restoration images.
8. The method for facial image restoration based on reinforcement learning image content screening according to claim 1, characterized in that: The iterative optimization comprises: (1) Iteratively train the diffusion model, select the screening strategy provided by the filter of the reinforcement learning screening strategy to train the diffusion model, and keep the other parameters fixed during the training process; (2) Iteratively train the filter, while keeping the other parameters fixed during the training process; (3) If the number of iterative training times has not been reached, return to the diffusion model and continue training; otherwise, the training is completed, and the diffusion model and filter are output to obtain the optimized face restoration network.
9. The method for facial image restoration based on reinforcement learning image content screening according to claim 1, characterized in that: The inference sampling includes: (1) Based on the optimized face restoration network, the low-resolution image is filtered through the filter strategy to obtain the filtered feature map F″ t , and the latent space feature map Z t After completing the operation of the face restoration network, the predicted noise map is output (2) Based on the predicted noise map Iterative denoising is performed using DDIM sampling. The screening strategy in the denoising process is provided by the screening strategy generator until a noise-free latent space feature map is output. (3) The noise-free latent space feature map After the image space compression decoder, the restored high-definition face image is obtained.
10. A face image restoration system based on reinforcement learning image content screening, characterized in that: A facial image restoration method based on reinforcement learning image content screening as described in any one of claims 1 to 9; The face image restoration system comprises: an image space compression codec module, a random filter module, a reinforcement learning filter module, an iterative training module and an inference sampling module; The image space compression codec module is used to collect face image data and train the image space compression coder and image space compression decoder; The random filter module is used to randomly filter the facial structure of the face restoration image as a screening strategy, perform latent space diffusion model training, and obtain the randomly filtered face restoration image content; The reinforcement learning filter module is used to actively filter the facial structure of the face restoration image as a screening strategy, perform latent space diffusion model training, improve the image restoration capability under the premise of ensuring the consistency of the generated image content, and obtain the actively filtered face restoration image content; The iterative training module is used to iteratively optimize the filter and the diffusion model to complete the decision-level mapping from the low-definition image to the high-definition image; The inference sampling module performs inference sampling and decoding on the face image data based on the image space compression codec module, the random filter module, the reinforcement learning filter module and the iterative training module to obtain a restored high-definition face image.
Citation Information
Patent Citations
Picture restoration method and device, terminal equipment and storage medium
CN111681182A
Repair neural network training method and device for image completion, computer equipment and storage medium
CN112837236A
Degradation face image restoration method based on difference view angle constraint
CN114998123A
Face image restoration method and system based on manifold constraint diffusion model
CN118247180A
Face image restoration method based on generation diffusion prior
CN118333866A