Training method of adjustable parameter image restoration model and adjustable parameter image restoration method
Through hierarchical processing and parameter adjustment of images, the problem of fixed image restoration model parameters in the existing technology is solved, the ability to generate images of different styles based on different parameters is achieved, and the flexibility of the model and image quality are improved.
Patent Information
- Application Number
- CN202410697931.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-31
AI Technical Summary
In the existing technology, the model parameters of the image restoration model are fixed, and it is difficult to generate images with different noise levels and sharpening levels based on different noise reduction parameters and sharpening parameters. Multiple models need to be trained to adapt to different parameter settings.
By decomposing the original image into multiple layers, determining the superposition coefficient of each layer according to different noise reduction and sharpening parameters, performing weighted superposition to generate a true value image, and adjusting the model parameters through the difference with the output image to obtain adjustable parameters. Image restoration model.
It realizes the generation of output images of different styles according to different noise reduction and sharpening parameters, improves the flexibility and quality of the image restoration model, and avoids the redundancy of multiple model training.
Smart Images

Figure CN118279181B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of digital image processing, and in particular to a training method of an image restoration model with adjustable parameters and an image restoration method with adjustable parameters. Background Art
[0002] The image will be grainy if it is disturbed by noise during the generation, transmission and storage process. In addition, the limitations of the optical system in the image acquisition device, motion blur and other factors will cause the image to become blurred and lose important edge and detail information, affecting the overall perception of the image and the accuracy of subsequent processing. Therefore, it is necessary to denoise and sharpen the image to improve the quality and clarity of the image and make the image details more prominent.
[0003] In the related art, the traditional AI (Artificial Intelligence) image restoration method is used to reduce noise and sharpen images. However, the model parameters of the image restoration model in the traditional image network restoration method are fixed. If it is necessary to generate images with different noise levels and sharpening levels for different noise reduction parameters and sharpening parameters, it is usually necessary to train multiple image restoration models according to different noise reduction parameters and sharpening parameters. Therefore, how to obtain an image restoration model that can generate images with different noise levels and sharpening levels is the focus of relevant technical personnel. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a training method and an image restoration method for an adjustable parameter image restoration model, so that the adjustable parameter image restoration model can generate images with different noise levels and sharpening levels according to different noise reduction parameters and sharpening parameters. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for training an image restoration model with adjustable parameters, the method comprising:
[0006] Acquire multiple original sample images and noise reduction parameters and sharpening parameters corresponding to the original sample images, wherein at least two noise reduction parameters are different and at least two sharpening parameters are different;
[0007] Decomposing each original sample image respectively to obtain an edge sharpening layer, a structure layer, an edge layer, a texture layer, a blur layer and a noise layer of each original sample image;
[0008] Determine the stacking coefficient of each layer of each original sample image according to the noise reduction parameter and the sharpening parameter corresponding to each original sample image;
[0009] For each original sample image, weighted superposition is performed on each layer of the original sample image according to the determined superposition coefficient to obtain a true value image corresponding to the original sample image; and the structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image are superimposed to obtain a target sample image corresponding to the original sample image;
[0010] For each original sample image, the noise reduction parameter, sharpening parameter and target sample image corresponding to the sample image are input into the original adjustable parameter image restoration model to obtain an output image corresponding to the sample image output by the original adjustable parameter image restoration model;
[0011] Based on the difference between the true value image corresponding to each original sample image and the output image, the model parameters of the original adjustable parameter image restoration model are adjusted to obtain the target adjustable parameter image restoration model.
[0012] In a second aspect, an embodiment of the present application provides an image restoration method with adjustable parameters, the method comprising:
[0013] Obtaining a target image to be restored, target noise reduction parameters, and target sharpening parameters;
[0014] The target image to be restored, the target denoising parameters and the target sharpening parameters are input into a target adjustable parameter image restoration model to obtain a target restored image; wherein the target adjustable parameter image restoration model is trained according to the image restoration model training method described in the first aspect.
[0015] Beneficial effects of the embodiments of the present application:
[0016] The training method of the adjustable parameter image restoration model and the adjustable parameter image restoration method provided in the embodiments of the present application decompose a high-quality sample image into multiple different layers, and determine the superposition coefficient of each layer when superimposing each layer according to different noise reduction parameters and sharpening parameters, weightedly superimpose each layer according to the determined superposition coefficient to obtain multiple true value images, directly superimpose each layer to obtain a target sample image, and then input the target sample image and different noise reduction parameters and sharpening parameters into the original adjustable parameter restoration model to obtain a corresponding output image, and then adjust the model parameters of the model based on the difference between the true value image and the output image to obtain the target adjustable parameter image restoration model.
[0017] Through the method of the embodiment of the present application, after the original sample image is decomposed into six layers, since simply directly superimposing multiple layers corresponding to the high-quality original sample image will lose the details in the image, there will be obvious blur, noise or other degradation phenomena in the superimposed image, so a low-quality sample image for model training can be obtained, and since when weighted superposition of each layer is performed, the characteristics of each layer can be emphasized by adjusting the weight value of each layer, and then the noise level and sharpening level of the superimposed image can be adjusted, so as to obtain a true value image with different sharpening levels and / or sharpening levels. Since the present application inputs a low-quality sample image, different noise reduction parameters and sharpening parameters into the original adjustable parameter image restoration model to generate output images corresponding to different noise reduction parameters and sharpening parameters, and then trains the target adjustable parameter image restoration model based on the difference between the output image corresponding to different noise reduction parameters and sharpening parameters and the true value image, the target adjustable parameter image restoration model can generate output images of different styles based on different noise reduction parameters and sharpening parameter controls.
[0018] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0020] Figure 1 A first schematic diagram of a method for training an image restoration model provided in an embodiment of the present application;
[0021] Figure 2a An example diagram of image changes when only sharpening parameters are adjusted according to an embodiment of the present application;
[0022] Figure 2b This is an example diagram of image changes when only noise reduction parameters are adjusted according to an embodiment of the present application;
[0023] Figure 3 A schematic diagram of layering an image provided in an embodiment of the present application;
[0024] Figure 4 A flow chart for obtaining the superposition coefficient of each layer provided in an embodiment of the present application;
[0025] Figure 5 An example diagram for obtaining the superposition coefficient of each layer provided in an embodiment of the present application;
[0026] Figure 6 A flowchart for obtaining a true value image and a target sample image provided in an embodiment of the present application;
[0027] Figure 7 A flowchart for obtaining a sharpened layer provided in an embodiment of the present application;
[0028] Figure 8 A flowchart for obtaining edge layers and texture layers provided in an embodiment of the present application;
[0029] Fig. 9 A flowchart for obtaining a blur layer and a noise layer provided in an embodiment of the present application;
[0030] Fig.10 An example diagram of layering an image provided in an embodiment of the present application;
[0031] Fig.11 A second schematic diagram of the image restoration model training method provided in an embodiment of the present application;
[0032] Fig.12 A schematic diagram of the structure of an adjustable parameter image restoration model provided in an embodiment of the present application;
[0033] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0035] First, the professional terms in the embodiments of the present application are explained:
[0036] GT (Grouth Truth, real, accurate data) is used to verify the accuracy of algorithms, models, or predictions. Accurate labels or data for training and evaluating models.
[0037] RTV (Relative Total Variation) is an algorithm for separating image structure and texture.
[0038] FC (Fully Connected Layer) is a deep learning network structure.
[0039] Arcface network is an optimization method for face recognition in deep learning.
[0040] In the process of neural network model training, multiple iterations are usually required. Batch size refers to the amount of data processed by the model during each iteration.
[0041] UNet type structure: UNet is an encoder-decoder network with a symmetrical U-shaped structure, mainly used for image segmentation tasks.
[0042] Since the noise level and sharpness level in the image will affect the display effect of the image, and since the image is subjected to different degrees of noise reduction and / or sharpening, the noise level and sharpness level of the processed image are different, for the sake of ease of description, in this application, the images with different noise levels and / or different sharpness levels restored by the image restoration model according to different noise reduction parameters and / or sharpening parameters are referred to as images of different styles. Style modulation refers to adjusting the sharpening and noise reduction levels of the image to obtain images with different sensory clarity, noise levels, and texture details.
[0043] In order to enable the image restoration model to generate images of different styles, the embodiments of the present application provide a training method for an image restoration model with adjustable parameters and an image restoration method with adjustable parameters. The training method for the image restoration model and the image restoration method provided by the present application are described below through specific embodiments. In the first aspect of the embodiments of the present application, a training method for an image restoration model with adjustable parameters is first provided, which can be applied to any electronic device with model training capabilities. In a specific application, the electronic device can be a server, a personal computer, or a device with an image acquisition function, which is not limited in the present application.
[0044] The following describes the training method of the image restoration model provided by the embodiment of the present application in conjunction with the accompanying drawings. Figure 1 As shown, Figure 1 The first schematic diagram of the training method of the image restoration model provided in the embodiment of the present application comprises the following steps:
[0045] Step S110, obtaining a plurality of original sample images and noise reduction parameters and sharpening parameters corresponding to the original sample images, wherein at least two noise reduction parameters are different and at least two sharpening parameters are different;
[0046] Step S120, decomposing each original sample image respectively to obtain an edge sharpening layer, a structure layer, an edge layer, a texture layer, a blur layer and a noise layer of each original sample image;
[0047] Step S130, determining the superposition coefficient of each layer of each original sample image according to the noise reduction parameter and sharpening parameter corresponding to each original sample image;
[0048] Step S140, for each original sample image, weighted superposition of each layer of the original sample image is performed according to the determined superposition coefficient to obtain a true value image corresponding to the original sample image; and the structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image are superimposed to obtain a target sample image corresponding to the original sample image;
[0049] Step S150, for each original sample image, inputting the noise reduction parameter, sharpening parameter and target sample image corresponding to the sample image into the original adjustable parameter image restoration model, and obtaining an output image corresponding to the sample image output by the original adjustable parameter image restoration model;
[0050] Step S160, based on the difference between the true value image corresponding to each original sample image and the output image, adjust the model parameters of the original adjustable parameter image restoration model to obtain the target adjustable parameter image restoration model.
[0051] Through the method of the embodiment of the present application, after the original sample image is decomposed into six layers, since simply directly superimposing multiple layers corresponding to the high-quality original sample image will lose the details in the image, there will be obvious blur, noise or other degradation phenomena in the superimposed image, so a low-quality sample image for model training can be obtained, and since when weighted superposition of each layer is performed, the characteristics of each layer can be emphasized by adjusting the weight value of each layer, and then the noise level and sharpening level of the superimposed image can be adjusted, so as to obtain a true value image with different sharpening levels and / or sharpening levels. Since the present application inputs a low-quality sample image, different noise reduction parameters and sharpening parameters into the original adjustable parameter image restoration model to generate output images corresponding to different noise reduction parameters and sharpening parameters, and then trains the target adjustable parameter image restoration model based on the difference between the output image corresponding to different noise reduction parameters and sharpening parameters and the true value image, the target adjustable parameter image restoration model can generate output images of different styles based on different noise reduction parameters and sharpening parameter controls.
[0052] It is understandable that the target adjustable parameter image restoration model in the embodiment of the present application can process any image. For example, it can process animal photos or images containing human faces. It should be noted that the aforementioned images containing human faces are all taken with the knowledge and permission of the user, and are not taken for specific persons.
[0053] Steps S110 to S160 are described below respectively:
[0054] In step S110, the original sample image refers to a high-quality image with a clarity higher than a preset clarity threshold, rich details and good image visual effects, wherein a high-quality image refers to an image without obvious blur, noise or other degradation phenomena. It can be understood that in order to improve the generalization ability of the trained image restoration model, there are multiple original sample images, and as many pairs of different noise reduction parameters and sharpening parameters as possible, and the multiple pairs of noise reduction parameters and sharpening parameters can be set by the user or randomly generated. In order to make each pair of noise reduction parameters and sharpening parameters as different as possible, in a possible implementation, each pair of noise reduction parameters and sharpening parameters can be randomly generated in the interval [0,1] or in other intervals. In the following, the noise reduction parameters and sharpening parameters are randomly generated in the interval [0,1] as an example.
[0055] The sharpening parameter is used to indicate the intensity of sharpening the image. For example, Figure 2a As shown in the figure, when the parameter is set to (0.0, 0.0), that is, the sharpening parameter and the noise reduction parameter are both 0, only the sharpening parameter is adjusted, and the noise reduction parameter is not adjusted. When the sharpening parameter is adjusted to between 0-0.5, the image is mainly deblurred, and the edges and details outside the noise are enhanced, and the noise changes little; when the sharpening parameter is adjusted to between 0.5-1.0, the edge of the image is sharpened with overshoot protection, making the image perceptually clear.
[0056] The noise reduction parameter is used to indicate the intensity of noise reduction on the image, for example, Figure 2b As shown in the figure, when the sharpening parameter is controlled to 0.5, the noise reduction parameters are adjusted respectively. It can be seen from the figure that when the noise reduction parameter is between 0-0.5, the image is mainly denoised and the sharpness of the image will not be changed; when the noise reduction parameter is between 0.5-1.0, the texture details of the image will be fine-tuned. Within this range, the larger the noise reduction parameter, the gradually reduced texture intensity until all fine textures are removed, showing smooth skin and hair.
[0057] In step S120, each original sample image is decomposed to obtain an edge sharpening layer, a structure layer, an edge layer, a texture layer, a blur layer and a noise layer of each original sample image. The decomposition may be performed using existing image processing techniques. For example, the layer function of an image editing software is used to manually separate different layers of the image, or a filter is used to decompose the structure layer and texture layer of the image, and other image editing software is used to decompose the edge sharpening layer, edge layer, blur layer and noise layer of the image.
[0058] The following is an example of how to decompose the six layers mentioned above. Figure 3 ,include:
[0059] Step S121, performing edge sharpening on the original sample image to obtain an edge sharpening layer;
[0060] Step S122, performing texture filtering on the original sample image to obtain a structure layer, and performing Gaussian filtering on the structure layer to obtain an edge layer and a texture layer;
[0061] Step S123, blurring and degrading the original sample image respectively to obtain a blurred layer and a noise layer.
[0062] Understandably, Figure 3 The figure is only a flow chart of an image decomposition method provided by the present application. In other possible examples, the above steps S121 to S123 may be performed simultaneously to obtain the above six layers, or may be performed in accordance with Figure 3 When executing step S121 to step S123 in any order other than the above to obtain the above six layers, the steps are executed in sequence. For example, step S123 is first executed to obtain a blurred layer and a noise layer, and then step S121 is executed to obtain an edge sharpening layer, and finally step S122 is executed to obtain an edge layer and a texture layer; for another example, step S122 may be executed first, and then step S121 and step S123 are executed. The present application does not impose any limitation on this.
[0063] The specific process of decomposing the original sample image into an edge sharpening layer, a structure layer, an edge layer, a texture layer, a blur layer, and a noise layer is described below and will not be repeated here.
[0064] Please come back and see Figure 1 , let's continue Figure 1 Steps S130 to S160 in FIG.
[0065] In step S130, the stacking coefficient of each layer is determined according to the noise reduction parameters and sharpening parameters corresponding to each original sample image. The stacking coefficient of each layer can be determined according to the noise reduction parameters and sharpening parameters based on a preset value rule. The preset value rule is: when the sharpening parameter is small or the sharpening parameter is large and the noise reduction parameter is small, the stacking coefficient of the blurred layer, the edge sharpening layer, and the noise layer is reduced; when the sharpening parameter and the noise reduction parameter are both large, the stacking coefficient of the blurred layer, the edge sharpening layer, the noise layer, and the texture layer is reduced.
[0066] It is understandable that the noise reduction parameter or sharpening parameter is set larger or smaller based on actual experience. For example, when the value of the noise reduction parameter or sharpening parameter is less than 0.5, it can be considered that the noise reduction parameter or sharpening parameter is small, and when the value of the noise reduction parameter or sharpening parameter is greater than 0.5, it can be considered that the noise reduction parameter or sharpening parameter is large. The embodiments of the present application are not limited to this.
[0067] The following is a detailed description of step S140:
[0068] After obtaining the edge sharpening layer, structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image according to the above steps S121 to S123, the structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image are directly superimposed to obtain the target sample image corresponding to the original sample image.
[0069] As mentioned above, the target sample image obtained by directly superimposing the structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image is a low-quality image, and the true value image is obtained by weighted superposition of the edge sharpening layer, structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image according to a predetermined superposition coefficient. In a possible implementation, the target sample image can be obtained according to the following formula (1), and the true value image can be obtained according to the following formula (2):
[0070] (1)
[0071] (2)
[0072] Among them, LQ is the target sample image, GT is the true value image, For the structure layer, For the edge layer, For the texture layer, For the blurred layer, is the noise layer, For edge sharpening layer, is the overlay coefficient of the texture layer, is the overlay coefficient of the blurred layer, is the superposition coefficient of the noise layer, It is the overlay factor of the edge sharpening layer.
[0073] It can be seen that before determining the true value image, it is necessary to first determine the superposition coefficients of each layer when superimposing to obtain the true value image corresponding to the original sample image according to step S130.
[0074] Combine the following Figure 4 How to determine the overlay coefficient of each layer based on the noise reduction parameters and sharpening parameters is explained below:
[0075] When the noise reduction parameter is less than the preset noise reduction parameter threshold (corresponding to Figure 4 The second threshold in the middle) and the sharpening parameter is less than the preset sharpening parameter threshold (corresponding to Figure 4In the case of the first threshold in the image, the overlay coefficient group is determined to be the preset first overlay coefficient group, wherein the overlay coefficient of the blurred layer in the first overlay coefficient group is negatively correlated with the sharpening parameter, the overlay coefficient of the edge sharpening layer is the preset lower threshold, the overlay coefficient of the noise layer is negatively correlated with the noise reduction parameter, and the overlay coefficient of the texture layer is the preset upper threshold.
[0076] If the noise reduction parameter is less than the preset noise reduction parameter threshold and the sharpening parameter is greater than or equal to the preset sharpening parameter threshold, the overlay coefficient group is determined to be a preset second overlay coefficient group, wherein the overlay coefficient of the blur layer in the second overlay coefficient group is the preset lower limit threshold, the overlay coefficient of the edge sharpening layer is positively correlated with the sharpening parameter, the overlay coefficient of the noise layer is negatively correlated with the noise reduction parameter, and the overlay coefficient of the texture layer is the preset upper limit threshold;
[0077] If the noise reduction parameter is greater than or equal to the preset noise reduction parameter threshold and the sharpening parameter is less than the preset sharpening parameter threshold, the overlay coefficient group is determined to be a preset third overlay coefficient group, wherein the overlay coefficient of the blur layer in the third overlay coefficient group is negatively correlated with the sharpening parameter, the overlay coefficient of the edge sharpening layer and the overlay coefficient of the noise layer are the preset lower threshold, and the overlay coefficient of the texture layer is the preset upper threshold;
[0078] If the noise reduction parameter is greater than or equal to the preset noise reduction parameter threshold and the sharpening parameter is greater than or equal to the preset sharpening parameter threshold, the overlay coefficient group is determined to be the preset fourth overlay coefficient group, wherein the overlay coefficient of the blurred layer in the fourth overlay coefficient group is the preset lower limit threshold, the overlay coefficient of the edge sharpening layer is positively correlated with the sharpening parameter, the overlay coefficient of the noise layer is the preset lower limit threshold, and the overlay coefficient of the texture layer is negatively correlated with the noise reduction parameter.
[0079] Among them, the preset noise reduction parameter threshold and the preset sharpening parameter threshold are set in advance based on actual experience. For example, the preset noise reduction parameter can be set to 0.5, or 0.4, or other values less than 1, and the preset sharpening parameter can be set to 0.6, or 0.5, or other values less than 1.
[0080] For example, Figure 5 As shown in the figure, assuming that the preset noise reduction parameter threshold and the preset sharpening parameter are both 0.5, the preset upper threshold is 1, and the preset lower threshold is 0. If the randomly generated sharpening parameter and noise reduction parameters are all less than 0.5, then the overlay coefficient of the fuzzy layer , the overlay factor of the edge sharpening layer 0, the superposition coefficient of the noise layer , the overlay factor of the texture layer is 1. In this case, it is mainly the overlay coefficients of the blur layer and the noise layer that are changing, and the overlay coefficient of the edge sharpening layer is 0. Since the degradation has not been completely eliminated at this time, the texture layer needs to be overlaid, but since the blur layer has destroyed the texture, if the texture layer is weighted overlaid, the texture will be added at the sensory position, making the image effect unnatural. Therefore, the overlay coefficient of the texture layer is 1.
[0081] If the sharpening parameters Less than 0.5 but the noise reduction parameter If it is greater than or equal to 0.5, the overlay coefficient of the blurred layer , the overlay factor of the edge sharpening layer 0, the superposition coefficient of the noise layer 0, the overlay coefficient of the texture layer is 1. In this case, the overlay coefficient of the blur layer is changing, and the overlay coefficients of the sharp layer and the noise layer are 0. Similar to the previous case, when the blur layer exists, the overlay coefficient of the texture layer is 1.
[0082] If the sharpening parameters Greater than or equal to 0.5 but the noise reduction parameter If it is less than 0.5, the overlay coefficient of the blurred layer 0, the overlay coefficient of the edge sharpening layer , the superposition coefficient of the noise layer , the overlay factor of the texture layer is 1. In this case, the overlay coefficient of the blur layer is 0, mainly the edge sharpening layer and the noise layer work, and the overlay coefficient of the texture layer remains at 1.
[0083] If the sharpening parameters and noise reduction parameters are greater than or equal to 0.5, then the overlay coefficient of the blurred layer 0, the overlay coefficient of the edge sharpening layer , the superposition coefficient of the noise layer 0, the overlay coefficient of the texture layer In this case, the overlay coefficient of the blur layer and the noise layer is 0, and the texture layer and the edge sharpening layer are mainly responsible.
[0084] It can be seen that by superimposing the layers of the original sample image according to the superposition coefficients in the preset first superposition coefficient group, the preset second superposition coefficient group, the preset third superposition coefficient group and the preset fourth superposition coefficient group, four different styles of true value images corresponding to the original sample image can be obtained.
[0085] As can be seen from the above, the process of obtaining the true value image and the target sample image in the embodiment of the present application is as follows: Figure 6As shown in FIG. 1 , the original sample image and the randomly generated noise reduction parameters and sharpening parameters are first obtained, the original sample image is decomposed into 6 layers, and the superposition coefficients of different layers are determined according to the noise reduction parameters and sharpening parameters. Then, the layers are superimposed according to the above formulas (1) and (2) to obtain the target sample image and the true value image corresponding to the original sample image.
[0086] Then, the target sample image corresponding to the original sample image, as well as the denoising parameters and sharpening parameters are input into the original adjustable parameter image restoration model to obtain the output image, and then the model parameters of the original adjustable parameter image restoration model are adjusted according to the difference between the output image and the true value until the convergence condition is reached to obtain the target adjustable parameter image restoration model. The specific structure of the adjustable parameter image restoration model is shown below and will not be repeated here.
[0087] The difference between the true value image corresponding to the original sample image and the output image refers to at least one of the L1 loss, perceptual loss and identity feature loss between the true value image corresponding to the original sample image and the output image. The calculation formulas of the above three losses are as follows:
[0088] (3)
[0089] (4)
[0090] (5)
[0091] in, The output image obtained by inputting the target sample image into the parameter adjustment image restoration network G is Row, No. Pixel values of columns of pixels; is the first Row, No. Pixel values of columns of pixels; represents a network for extracting perceptual features, and exemplarily, it may be a VGG19 network; I represents a network for extracting identity features. When the image is a facial image of a person, the network is a network for extracting facial features of the person, and exemplarily, it may be an Arcface network.
[0092] is the height of the output image; is the width of the output image; The features extracted by the network for extracting perceptual features are high; The width of the features extracted by the network for extracting perceptual features; The features extracted by the network for extracting identity features are high; The width of the features extracted by the network for extracting identity features.
[0093] In the case where the difference between the true value image corresponding to the original sample image and the output image refers to L1 loss, perceptual loss and identity feature loss, when calculating the total loss between the true value image corresponding to the original sample image and the output image, the total loss is obtained by weighted summing the three losses, and the weight value of each loss is pre-set by the user according to needs. Exemplarily, the weights of L1 loss, perceptual loss and identity feature loss when calculating the total loss can be pre-set to 1, 1, and 10 respectively, and then the total loss function between the true value image and the output image is calculated, and then the loss function is used to derive the model parameters to obtain the original gradient of each model parameter. Exemplarily, the total loss function between the true value image and the output image can be calculated according to the following formula (6): :
[0094] (6)
[0095] The convergence condition can be reached when the loss value between the output image and the true value continues to decrease and approaches a stable threshold, then the model is considered to have reached the convergence condition. During the training process, an optimizer is usually used to adjust the model parameters to minimize the loss function. For example, SGD (Stochastic Gradient Descent) optimizer, SGDM (Stochastic Gradient Descent with momentum) optimizer, Adam (Adaptive Moment Estimation) optimizer, etc. can be used. The learning rate of the optimizer is a key parameter of the optimizer, which is used to control the amplitude of each adjustment of the model parameters. Batch size is the amount of data processed by the optimizer in each iteration, which has an important impact on the training speed and generalization ability of the model. In the embodiment of the present application, the learning rate and batch size are pre-set by the user. For example, it can be 3e -4 , or 4e -4 , or other values. This application does not limit this. In a specific embodiment, an Adam optimizer may be used, and the learning rate of the optimizer is set to 3e-4 and the batch size is 16.
[0096] However, since the model in the embodiment of the present application needs to learn different noise reduction parameters and sharpening parameters to generate images of different styles during the training process, the loss usually produces relatively large oscillations, resulting in a large gradient of model parameter adjustment, which causes the problem of training collapse. In one possible implementation, the problem of excessive gradient of model parameter adjustment can be solved by adjusting the learning rate of the model to less than the preset learning rate threshold. However, a lower learning rate will slow down the speed of model training. In one possible approach, the gradient of each parameter can be reduced by gradient clipping. Exemplarily, the model parameters can be reduced using formula (7) to obtain the scaled gradient after reduction:
[0097] (7)
[0098] in, is the reduced gradient, is the maximum value of the gradient, is the clipping factor, which is set in advance based on experience. For example, it can be set to 0.1, 0.5, or other values less than 1. The maximum value of the gradient is also set first. For example, it can be set to 10, or other values.
[0099] Then, the model parameters of the original adjustable parameter image restoration model are adjusted according to the reduced scaling gradient and the preset learning rate until the convergence condition is reached, thereby obtaining the target adjustable parameter image restoration model.
[0100] Based on the above, the aforementioned step S160 may include:
[0101] Step S161, calculating the original gradient of the model parameters of the original adjustable parameter image restoration model based on the difference between the true value image corresponding to each original sample image and the output image;
[0102] Step S162, linearly reduce the original gradient to obtain a reduced scaled gradient;
[0103] Step S163, adjusting the model parameters of the original adjustable parameter image restoration model according to the scaling gradient and the preset learning rate to obtain the target adjustable parameter image restoration model, and the preset learning rate is lower than the preset learning rate threshold.
[0104] By using the method of the embodiment of the present application, the gradient is clipped and a smaller learning rate is used during the training process, which can reduce the possibility of training collapse caused by large gradients. While maintaining the stability of the model, the training process is accelerated and the generalization ability of the model is improved.
[0105] The following is an explanation of the process of decomposing the original sample image:
[0106] (1) Edge sharpening:
[0107] Edge sharpening is to enhance the edges of the original sample image to improve the overall clarity and make the image features more obvious. However, the enhanced image cannot be over-sharpened, that is, the texture cannot be over-enhanced, which will make the noise stronger and destroy the texture performance in the image. Figure 7 As shown in the figure, the input image is texture filtered to extract the high-frequency edges, and then the edge image is denoised, and the sharpening is suppressed by setting the upper and lower sharpening bounds (corresponding to Figure 7 The process of obtaining the edge sharpening layer is as follows:
[0108] Since sharpening is usually performed on the Y channel, when the original sample image in the embodiment of the present application is usually an RGB image, it is necessary to first convert the sample image into an original YUV image. When the original sample image in the embodiment of the present application is a YUV image, the image does not need to be converted; then, texture filtering is performed on the Y channel of the original YUV image based on a preset texture filtering algorithm to obtain a filtered YUV image; then, the low-frequency edge and medium-low frequency edge of the filtered YUV image are extracted using a first Gaussian filter kernel and a second Gaussian filter kernel with different variance sizes of the Gaussian filter kernel, respectively, and the low-frequency edge and medium-low frequency edge are subtracted from the original YUV image to obtain the high-frequency edge of the YUV image.
[0109] In a specific embodiment, the high-frequency edge of the YUV image may be determined using the following formula (8):
[0110] (8)
[0111] in, To extract high-frequency details, that is, high-frequency edges, is the original YUV image, and There are two Gaussian filter kernels with different variances, namely the first Gaussian filter kernel and the second Gaussian filter kernel. After obtaining the edge details, it is necessary to perform noise reduction processing on the edge details using a variance-preserving algorithm to remove fine textures and retain clean edge details.
[0112] In order to avoid the occurrence of black edges and black spots or white edges and white spots during the sharpening process, the high-frequency edges can be normalized by setting the upper and lower sharpening limits. When the sharpening degree exceeds the preset upper and lower sharpening limits, the sharpening is suppressed. In a specific embodiment, the high-frequency edges can be normalized by formula (9):
[0113] (9)
[0114] in, is the normalized high-frequency edge, To sharpen the upper bound, To sharpen the lower bound, and It is a preset suppression parameter, which is set based on actual experience and is not limited in this application.
[0115] In this way, the normalized high-frequency edge is superimposed on the Y channel of the original YUV image to obtain the enhanced target YUV image; the target YUV image is converted into a target RGB image; the edge sharpening layer is obtained by subtracting the sample image from the target RGB image. In a specific embodiment, the sharpening layer can be obtained by the following formula (10):
[0116] (10)
[0117] in, is the color space conversion formula, It is the UV component after converting the original sample image to a YUV image.
[0118] (2) Texture filtering
[0119] By performing texture filtering on the original sample image, some irregular and fine texture details in the original sample image can be extracted, and the shape and size of the texture details can be controlled, thereby obtaining the structural layer, edge layer and texture layer of the original sample image. The process of texture filtering is as follows: Figure 8 As shown, after texture filtering is performed on the input image, Gaussian filtering with different kernel sizes is performed to obtain an edge layer, and then the edge layer (i.e., edge layer) is decomposed to obtain a texture layer (i.e., texture layer), and then the edge layer and texture layer are obtained. The specific process of obtaining the edge layer and texture layer is as follows:
[0120] The original sample image is texture filtered using a preset texture filtering algorithm to obtain a structure layer and an edge texture layer; the edge texture layer is filtered through Gaussian filters of different kernel sizes to obtain an edge layer; and then the edge texture layer is subtracted from the edge layer to obtain a texture layer. The texture filtering algorithm can be any texture filtering algorithm and this application does not limit this.
[0121] In a specific embodiment, using The texture filtering algorithm determines the edge layer and the texture layer through the following formula (11) to formula (13):
[0122] (11)
[0123] (12)
[0124] (13)
[0125] in, is used Texture filtering algorithm refers to texture filtering of the original sample image. is the kernel size of the Gaussian filter kernel. In this way, by controlling the kernel size of the Gaussian filter kernel, the size of the texture to be removed can be effectively controlled.
[0126] (3) Degeneration
[0127] Degradation of the original sample image can improve the clarity of the image and remove noise. Based on the degree of degradation, degradation is divided into fuzzy degradation and complete degradation, such as Fig. 9 As shown in the figure, after the input image is input into the complete degradation model and the blur-only degradation model respectively, it is processed with the same blur intensity and decomposed into a blur layer and a noise layer. The specific process is as follows:
[0128] The original sample image is input into a preset blur degradation model to obtain a blurred image, and the original sample image is input into a preset complete first-order image degradation model to obtain a completely degraded image; then the blurred image is subtracted from the original sample image to obtain a blurred layer, and the completely degraded image is subtracted from the original sample image and the blurred layer to obtain a noise layer.
[0129] In a specific embodiment, the blur layer can be obtained by the following formula (14), and the noise layer can be obtained by the following formula (15):
[0130] (14)
[0131] (15)
[0132] in, To blur the image, is the original sample image, A completely degraded image.
[0133] Based on the above, if Fig.10As shown, in the embodiment of the present application, the original sample image is processed by three different algorithms respectively. The first is to perform edge sharpening processing on the original sample image to obtain an edge sharpening layer (i.e., edge sharpening layer); the second is to perform texture filtering algorithm and Gaussian filtering algorithm on the original sample image, and obtain a structure layer and an edge and texture layer (i.e., edge texture layer) through the texture filtering algorithm, and then perform Gaussian filtering algorithm to obtain an edge layer (i.e., edge layer) and a texture layer (i.e., texture layer), so as to adjust the flatness of the image; the third is to use blur-only degradation and complete degradation models to obtain blur layers and noise layers. By restoring different degrees of blur and noise degradation, the problems of anomalies and excessive generation on extremely low-quality images can be effectively avoided.
[0134] In order to more clearly illustrate the training method of the image restoration model provided in the embodiment of the present application, a description is given below in conjunction with a specific embodiment.
[0135] like Fig.11 As shown, firstly, a high-quality RGB image (i.e., the original sample image) is determined, and two modulation parameters, denoising parameters and sharpening parameters, are randomly generated in the interval [0, 1] (corresponding to the aforementioned step S110). Then, training data is generated based on the RGB image, denoising parameters, and sharpening parameters, i.e., a low-quality target sample image and true value images with different denoising levels and sharpening levels (corresponding to the aforementioned steps S120 to S140). Then, an adjustable parameter image restoration model (the original adjustable parameter image restoration model) is initialized, and the target sample image and the denoising parameters and sharpening parameters are input into the original adjustable parameter image restoration model to obtain an output image. A loss function is constructed based on the true value image corresponding to the denoising parameters and sharpening parameters and the output image. The model is trained and optimized based on the loss function (corresponding to the aforementioned steps S150 to S160). The gradient of the model parameter update is clipped using the gradient clipping method to stabilize the training process (corresponding to the content described in the aforementioned formula (7)). Finally, an adjustable parameter image restoration model that can autonomously adjust the denoising level and sharpening level is obtained.
[0136] Corresponding to the aforementioned first aspect, a second aspect of the embodiment of the present application provides an image restoration method with adjustable parameters, the method comprising:
[0137] Step S101, obtaining a target image to be restored, target noise reduction parameters and target sharpening parameters;
[0138] Step S102, inputting the target image to be restored, the target denoising parameters and the target sharpening parameters into the target adjustable parameter image restoration model to obtain the target restored image; wherein the target adjustable parameter image restoration model is trained according to the training method of the image restoration model of the first aspect.
[0139] Through the method of the embodiment of the present application, since the target adjustable parameter image restoration model is trained based on the difference between the output image corresponding to different denoising parameters and sharpening parameters and the true image, the target adjustable parameter image restoration model can generate output images of different styles based on different denoising parameters and sharpening parameter controls.
[0140] The structure of the adjustable parameter image restoration model provided in the embodiment of the present application is described below. It can be understood that the structure of the original adjustable parameter image restoration model is the same as that of the target adjustable parameter image restoration model, and only the model parameters are different.
[0141] In a possible implementation, the adjustable parameter image restoration model includes an input module, a style control module and an output module, and the style control module includes a dense feature submodule and a modulation submodule. The above step S102 specifically includes:
[0142] Step S1021, inputting the target restored image into an input module, and obtaining the original image features of the target restored image output by the input module;
[0143] Step S1022, inputting the original image features into the dense feature submodule to obtain multi-style image features output by the dense feature submodule;
[0144] Step S1023, inputting the multi-style image features, the target noise reduction parameters and the target sharpening parameters into the modulation submodule, and obtaining the specified style image features output by the modulation submodule; wherein the modulation submodule is used to extract the style features of the target noise reduction parameters and the target sharpening parameters, and fuse the style features with the multi-style image features to obtain the specified style image features;
[0145] Step S1024, inputting the specified style image features into the output module to obtain the target restored image output by the output module.
[0146] In a possible implementation, the adjustable parameter image restoration model further includes a fully connected layer, and the noise reduction parameters and sharpening parameters input by the user are obtained through the fully connected layer. .
[0147] In a specific embodiment, Fig.12 As shown in FIG, the structure of the adjustable parameter image restoration model is a UNet-type structure, which is composed of a fully connected layer, multiple convolutional layers and multiple style control modules. The style control module includes a dense feature submodule and a modulation submodule. Fig.12 The style control module and convolution layer on the left constitute the encoder, and the style control module and upsampling layer on the right constitute the decoder. The input image can be one or multiple images. When the input image is one image, the input image is passed through the convolution layer to extract the input image features. , image features The dimension is (H, W, C). When the input image is multiple images, the input image is extracted through the convolution layer. , image features The dimensions are (B, C, H, W), where H is the height of the image, W is the width of the image, C is the number of channels, and B is the number of images.
[0148] Depend on Fig.12 As shown, taking the input image as an image as an example, the input image features Input into the style control module of the encoder, and the fully connected layer obtains a 512-dimensional first vector according to the sharpening parameters and noise reduction parameters input by the user , the first vector It is also input into the style control module of the encoder. The encoder uses the style control module and a convolutional layer with a convolution kernel size of 3×3 pixels and a stride of 2 to perform feature extraction on the input image. Downsampling is repeated 7 times, and then a convolution layer with a convolution kernel size of 3×3 pixels outputs features with a resolution of 4×4. The decoder on the right then repeats upsampling 7 times, upsampling the features with a resolution of 4×4 to the original resolution, and outputs the final result through a convolution layer with a convolution kernel size of 3×3 pixels.
[0149] from Fig.12 It can be seen that the dense feature submodule uses a convolution layer with a convolution kernel size of 3×3 pixels and a nonlinear activation function ReLU (i.e., linear rectification function) to transform the input image features. Continuously convolve and process, activate the intermediate features, connect all the intermediate features through channels, and obtain the input image features through a convolution layer with a convolution kernel size of 3×3 pixels. Equal size first image features , and the first image feature The modulation submodule uses three fully connected layers and two nonlinear activation functions ReLU to control the first vector. After processing, a second vector with a channel number of 2×C is obtained, and the second vector is channel-segmented to obtain a third vector and the fourth vector , and then based on the third vector and the fourth vector For the first image feature Perform multiplication and addition to obtain the second image feature of the fusion parameter .
[0150] It can be seen that the style control module in the adjustable parameter image restoration model can combine the denoising parameters, sharpening parameters and image features to achieve the purpose of controlling the image features according to the denoising parameters and sharpening parameters, thereby outputting images of different styles.
[0151] The present application also provides an electronic device, such as Fig.13 As shown, including:
[0152] Memory 1301, used for storing computer programs;
[0153] The processor 1302 is used to implement the steps of any of the above-mentioned image restoration model training methods and image restoration methods when executing the program stored in the memory 1301.
[0154] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0155] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0156] In another embodiment provided in the present application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the training method of any of the above-mentioned adjustable parameter image restoration models and the adjustable parameter image restoration method.
[0157] In another embodiment provided in the present application, a computer program product comprising instructions is also provided. When the computer is run on a computer, the computer executes any one of the training methods of the adjustable parameter image restoration model and the adjustable parameter image restoration method in the above-mentioned embodiments.
[0158] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0159] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0160] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0161] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A training method for an adjustable parameter image restoration model, characterized in that: The method comprises: Acquire multiple original sample images and noise reduction parameters and sharpening parameters corresponding to the original sample images, wherein at least two noise reduction parameters are different and at least two sharpening parameters are different; Decomposing each original sample image respectively to obtain an edge sharpening layer, a structure layer, an edge layer, a texture layer, a blur layer and a noise layer of each original sample image; Determine the stacking coefficient of each layer of each original sample image according to the noise reduction parameter and the sharpening parameter corresponding to each original sample image; For each original sample image, weighted superposition is performed on each layer of the original sample image according to the determined superposition coefficient to obtain a true value image corresponding to the original sample image; and the structure layer, edge layer, texture layer, blur layer and noise layer of the original sample image are superimposed to obtain a target sample image corresponding to the original sample image; For each original sample image, the noise reduction parameter, sharpening parameter and target sample image corresponding to the original sample image are input into the original adjustable parameter image restoration model to obtain an output image corresponding to the original sample image output by the original adjustable parameter image restoration model; Based on the difference between the true value image corresponding to each original sample image and the output image, the model parameters of the original adjustable parameter image restoration model are adjusted to obtain the target adjustable parameter image restoration model; The step of determining the superposition coefficient of each layer of each original sample image according to the noise reduction parameter and the sharpening parameter corresponding to each original sample image comprises: If the noise reduction parameter is less than a preset noise reduction parameter threshold and the sharpening parameter is less than a preset sharpening parameter threshold, the overlay coefficient group is determined to be a preset first overlay coefficient group, wherein the overlay coefficient of the blur layer in the first overlay coefficient group is negatively correlated with the sharpening parameter, the overlay coefficient of the edge sharpening layer is a preset lower threshold, the overlay coefficient of the noise layer is negatively correlated with the noise reduction parameter, and the overlay coefficient of the texture layer is a preset upper threshold; If the noise reduction parameter is less than a preset noise reduction parameter threshold and the sharpening parameter is greater than or equal to a preset sharpening parameter threshold, the overlay coefficient group is determined to be a preset second overlay coefficient group, wherein the overlay coefficient of the blur layer in the second overlay coefficient group is a preset lower threshold, the overlay coefficient of the edge sharpening layer is positively correlated with the sharpening parameter, the overlay coefficient of the noise layer is negatively correlated with the noise reduction parameter, and the overlay coefficient of the texture layer is a preset upper threshold; If the noise reduction parameter is greater than or equal to a preset noise reduction parameter threshold and the sharpening parameter is less than a preset sharpening parameter threshold, the overlay coefficient group is determined to be a preset third overlay coefficient group, wherein the overlay coefficient of the blur layer in the third overlay coefficient group is negatively correlated with the sharpening parameter, the overlay coefficient of the edge sharpening layer and the overlay coefficient of the noise layer are a preset lower threshold, and the overlay coefficient of the texture layer is a preset upper threshold; If the noise reduction parameter is greater than or equal to a preset noise reduction parameter threshold and the sharpening parameter is greater than or equal to a preset sharpening parameter threshold, the overlay coefficient group is determined to be a preset fourth overlay coefficient group, wherein the overlay coefficient of the blurred layer in the fourth overlay coefficient group is a preset lower limit threshold, the overlay coefficient of the edge sharpening layer is positively correlated with the sharpening parameter, the overlay coefficient of the noise layer is a preset upper limit threshold, and the overlay coefficient of the texture layer is negatively correlated with the noise reduction parameter.
2. The method according to claim 1, characterized in that The method of decomposing each original sample image to obtain an edge sharpening layer, a structure layer, an edge layer, a texture layer, a blur layer and a noise layer of each original sample image includes: Performing edge sharpening on the original sample image to obtain an edge sharpening layer; Performing texture filtering on the original sample image to obtain a structure layer, and performing Gaussian filtering on the structure layer to obtain an edge layer and a texture layer; The original sample image is blurred and degraded respectively to obtain a blurred layer and a noise layer.
3. The method according to claim 2, characterized in that The step of performing edge sharpening on the original sample image to obtain an edge sharpening layer comprises: Convert the original sample image into an original YUV image; Performing texture filtering on the Y channel of the original YUV image based on a preset texture filtering algorithm to obtain a filtered YUV image; Using a first Gaussian filter kernel to extract low-frequency edges of the filtered YUV image, and using a second Gaussian filter kernel to extract medium- and low-frequency edges of the filtered YUV image, wherein the variances of the first Gaussian filter kernel and the second Gaussian filter kernel are different; Subtract the low-frequency edge and the medium-low-frequency edge from the original YUV image to obtain a target high-frequency edge of the YUV image; Superimposing the target high-frequency edge into the Y channel of the original YUV image to obtain a target YUV image; Convert the target YUV image into a target RGB image; The sample image is subtracted from the target RGB image to obtain the edge sharpening layer.
4. The method according to claim 3, characterized in that The step of subtracting the low-frequency edge and the medium-low-frequency edge from the original YUV image to obtain a target high-frequency edge of the YUV image includes: Subtracting the low-frequency edge and the medium-low-frequency edge from the original YUV image to obtain the original high-frequency edge of the YUV image; The original high-frequency edge is normalized based on a preset sharpening upper bound and a preset sharpening lower bound to obtain the target high-frequency edge.
5. The method according to claim 2, characterized in that: The step of performing texture filtering on the original sample image to obtain a structure layer, and performing Gaussian filtering on the structure layer to obtain an edge layer and a texture layer includes: Performing texture filtering on the original sample image based on a preset texture filtering algorithm to obtain a structure layer and an edge texture layer; The edge texture layer is subjected to Gaussian filtering with different kernel sizes to obtain an edge layer; The texture layer is obtained by subtracting the edge layer from the edge texture layer.
6. The method according to claim 2, characterized in that The blurring and degrading the original sample image to obtain a blur layer and a noise layer respectively include: Inputting the original sample image into a preset blur degradation model to obtain a blurred image; Subtract the original sample image from the blurred image to obtain the blurred layer; Inputting the original sample image into a preset complete first-order image degradation model to obtain a completely degraded image; The noise layer is obtained by subtracting the original sample image and the blurred layer from the completely degraded image.
7. The method according to claim 1, characterized in that The method of adjusting the model parameters of the original adjustable parameter image restoration model based on the difference between the true value image corresponding to each original sample image and the output image to obtain the target adjustable parameter image restoration model includes: Based on the difference between the true value image corresponding to each original sample image and the output image, calculating the original gradient of the model parameters of the original adjustable parameter image restoration model; Linearly reducing the original gradient to obtain a reduced scaled gradient; The model parameters of the original adjustable parameter image restoration model are adjusted according to the scaling gradient and the preset learning rate to obtain a target adjustable parameter image restoration model, wherein the preset learning rate is lower than a preset learning rate threshold.
8. A parameter-adjustable image restoration method, characterized in that: The method comprises: Obtaining a target image to be restored, target noise reduction parameters, and target sharpening parameters; The target image to be restored, the target denoising parameters and the target sharpening parameters are input into a target adjustable parameter image restoration model to obtain a target restored image; wherein the target adjustable parameter image restoration model is trained according to the method described in claim 1 above.
9. The method according to claim 8, characterized in that The target parameter-adjustable image restoration model comprises an input module, a style control module and an output module, wherein the style control module comprises a dense feature submodule and a modulation submodule; the target restoration image, the target noise reduction parameter and the target sharpening parameter are input into the target parameter-adjustable image restoration model to obtain the target restoration image, comprising: Inputting the target restored image into the input module to obtain the original image features of the target restored image output by the input module; Inputting the original image features into the dense feature submodule to obtain multi-style image features output by the dense feature submodule; Inputting the multi-style image features, the target noise reduction parameters and the target sharpening parameters into the modulation submodule to obtain the specified style image features output by the modulation submodule, wherein the modulation submodule is used to extract the style features of the target noise reduction parameters and the target sharpening parameters, and fuse the style features with the multi-style image features to obtain the specified style image features; The specified style image features are input into the output module to obtain a target restored image output by the output module.
