Image restoration method based on high-order gradient constraint and diffusion generation model
By introducing high-order gradient constraints and diffusion generation models into the image restoration method, combined with the modified LogCosh loss function, the problem of poor results in the restoration of complex degraded images is solved, and better image structure and detail retention is achieved. Improved recovery and model robustness.
Patent Information
- Application Number
- CN202411609721.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Traditional image restoration methods are not ideal when processing complex degraded images, resulting in poor image restoration effects, especially in retaining image structure and details.
Image restoration method based on high-order gradient constraints and diffusion generation models is adopted, and image restoration is performed by constructing a high-order gradient recovery module and using a modified LogCosh loss function, combined with a pre-trained diffusion generation model.
It significantly improves the retention ability of image structure and edges, enhances image details and texture quality, improves the robustness and generalization ability of the model, and achieves excellent restoration effect.
Smart Images

Figure CN119494802A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image restoration based on artificial intelligence and machine vision, and in particular to an image restoration method based on high-order gradient constraints and a diffusion generation model. Background Art
[0002] With the rapid development of modern information technology, digital image processing technology has developed rapidly and is widely used in daily life and work. Digital image restoration is an important branch of digital image processing technology, playing an important role in many fields such as medicine, remote sensing, agriculture, image recognition, etc.
[0003] Image restoration aims to restore high-quality images from low-quality observed images. Typical tasks include denoising, deblurring, defogging, deraining, and super-resolution reconstruction. In traditional image restoration research, the degradation process is usually known and relatively simple, such as Gaussian noise and bicubic downsampling. Based on this, many image restoration algorithms have been proposed. However, the generalization ability of these algorithms is relatively limited, and it is difficult to cope with complex image degradation problems in real scenes. In addition, traditional image restoration methods usually only focus on pixel-level errors, using low-order gradient constraints or simple loss functions, such as mean square error (MSE). These methods can restore images to a certain extent, but often result in over-smoothing of the image, lack of clear details and textures, especially when dealing with complex degraded images, which is not ideal, resulting in poor image restoration results. Summary of the invention
[0004] In order to solve the technical problem of poor image restoration effect, the present invention proposes an image restoration method based on high-order gradient constraints and a diffusion generation model.
[0005] The present invention provides an image restoration method based on high-order gradient constraints and diffusion generation model, which can better preserve the structure and detail information of the image and obtain excellent restoration effect when processing different types of degraded images. The method comprises:
[0006] Obtaining the image to be restored;
[0007] The image to be restored is restored through the pre-trained image restoration network, wherein the image restoration network includes: a shallow feature extraction module, a deep feature extraction module, a high-definition image reconstruction module, a high-order gradient restoration module and a diffusion generation model;
[0008] The training process of the image restoration network includes:
[0009] Obtain natural high-definition dataset images, preprocess them, and generate degraded low-quality images;
[0010] An image restoration network is constructed based on the SwinIR network, the modified LogCosh loss function, the high-order gradient restoration module and the pre-trained diffusion generation model. The modified LogCosh loss function is a LogCosh loss function with a penalty term added. The SwinIR network includes: a shallow feature extraction module, a deep feature extraction module and a high-definition image reconstruction module.
[0011] The degraded low-quality images are used as training samples, the natural high-definition dataset images are used as training labels, and the modified LogCosh loss function is used as the loss function in the training process. The constructed image restoration network is trained to obtain a trained image restoration network.
[0012] Optionally, the image restoration network is constructed based on the SwinIR network, the modified LogCosh loss function, the high-order gradient restoration module and the pre-trained diffusion generation model, including:
[0013] A high-order gradient restoration module is introduced after the high-definition image reconstruction module included in the SwinIR network, wherein the high-order gradient restoration module is used to extract high-order gradient information of the image;
[0014] Replace the MSE loss function of the SwinIR network structure with the modified LogCosh loss function;
[0015] A pre-trained diffusion generation model is introduced, and the final network is determined as the image restoration network.
[0016] Optionally, the steps implemented by the high-order gradient restoration module include:
[0017] The high-order gradient information of the two images extracted by gradient operation is:
[0018]
[0019] in, represents the kth order gradient operation, I gt Represents natural high-definition dataset images, I RM represents the intermediate restored image obtained by the high-definition image reconstruction module;
[0020] Introduce the anisotropic diffusion equation and construct the formula corresponding to the high-order gradient constraint loss:
[0021]
[0022] Among them, I gd-loss represents a high-order gradient constrained loss function;
[0023] represents the gradient operation, I represents the grayscale image, represents the image gradient modulus, g(x) is the improved diffusion coefficient function, I RM is the intermediate restored image obtained after the image reconstruction module, I gt is a real image; and It means to find the partial derivative of the function in the brackets with respect to x and y respectively; w x and w y Represent the gradient of w in the x direction and y direction respectively.
[0024] Optionally, the formula corresponding to the modified LogCosh loss function is:
[0025]
[0026] in, I RM =RM(I lq ), RM is the high-definition image reconstruction module, I RM is the intermediate restored image obtained by the high-definition image reconstruction module, I lq For low-quality images, I gt is the original high-definition image, ε is the stabilization term, and ε is set to 10 -3 ; F() is a high-order gradient recovery module constructed based on the anisotropic diffusion equation, represents the gradient operation, I represents the grayscale image, represents the image gradient modulus, g(x) is the improved diffusion coefficient function, λ is used to balance the weight between the LogCosh loss based on high-order gradient constraints and the LogCosh loss based on pixel differences, and λ is set to 0.1; and It means to find the partial derivative of the function in the brackets with respect to x and y respectively; w x and w y Represent the gradient of w in the x direction and y direction respectively.
[0027] Optionally, the final goal is to find the parameter θ that can minimize the entire loss function. The corresponding formula is:
[0028]
[0029] The model parameters are adjusted through iterative training, and the loss function is repeatedly calculated and the parameters are updated until the loss function converges.
[0030] The present invention has the following beneficial effects:
[0031] First, the ability to preserve image structures and edges can be improved. Specifically, the constructed high-order gradient restoration module can better capture and preserve the structural information and edge features of the image. The present invention can more accurately reconstruct image contours and boundaries during the restoration process, significantly reducing the problems of edge blur and structural distortion. This enables the present invention to demonstrate strong adaptability to a variety of image degradation conditions.
[0032] Second, the image details and texture quality can be enhanced. Specifically, the modified LogCosh loss function of the present invention enhances the robustness of the model to image outliers, for example, image outliers can be extreme pixel values. It behaves similarly to MAE loss when dealing with large errors, and similarly to MSE loss when dealing with small errors, which enables the model to better adapt to different types and degrees of image degradation. In the task of restoring images containing noise or artifacts, the modified LogCosh loss function combined with the diffusion generation model can generate smoother and more natural restoration results.
[0033] Third, it provides new ideas for other image processing tasks. Specifically, the high-order gradient restoration module proposed in this invention integrates the anisotropic diffusion equation and enhances the generalization of deep learning models in image processing tasks. This not only provides a new method for improving image restoration algorithms, but also opens up a new perspective for theoretical research in related fields.
[0034] In summary, the present invention cleverly integrates the improved anisotropic diffusion equation into the deep learning framework to construct a high-order gradient restoration module, which not only improves the image quality and visual effects in various image restoration tasks, but also enhances the generalization ability of the model. At the same time, the modified LogCosh loss function enhances the robustness of the model. This comprehensive consideration of low-level pixel information and high-level structural information is expected to promote the further development of image restoration technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flowchart of an image restoration method based on high-order gradient constraints and a diffusion generation model of the present invention;
[0037] Figure 2 is a flow chart of the training process of the image restoration network of the present invention;
[0038] Figure 3A schematic diagram of an image restoration network based on high-order gradient constraints and a diffusion generation model of the present invention;
[0039] Figure 4 A schematic diagram showing a comparison of low-quality image restoration results according to the present invention;
[0040] Figure 5 This is another schematic diagram of comparison of low-quality image restoration results according to the present invention. DETAILED DESCRIPTION
[0041] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0042] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0043] The present invention proposes an image restoration method based on high-order gradient constraints and diffusion generation models. By cleverly integrating the improved anisotropic diffusion equation into the deep learning framework, a high-order gradient restoration module is constructed, and a modified LogCosh loss function is proposed. The intermediate restored image under the constraints of the high-order gradient restoration module is then processed using the pre-trained diffusion generation model to obtain the final restored image.
[0044] refer to Figure 1 , shows the process of some embodiments of the image restoration method based on high-order gradient constraints and diffusion generation model according to the present invention. The image restoration method based on high-order gradient constraints and diffusion generation model includes the following steps:
[0045] Step S1, obtaining an image to be restored.
[0046] The image to be restored may be a low-quality image to be restored.
[0047] Step S2, restoring the image to be restored through a pre-trained image restoration network.
[0048] Among them, the image restoration network can include: a shallow feature extraction module, a deep feature extraction module, a high-definition image reconstruction module, a high-order gradient restoration module and a diffusion generation model.
[0049] refer to Figure 2, shows the process corresponding to the training process of the image restoration network, which may include the following steps:
[0050] Step 201 : obtaining a natural high-definition dataset image, and preprocessing it to generate a degraded low-quality image.
[0051] In some embodiments, a public natural high-definition dataset image I may be obtained. gt , preprocess it to generate a degraded low-quality image I lq , forming a high-definition-low-quality image pair (I gt -I lq ), then the data set is divided into a training set and a validation set according to a certain ratio. Preprocessing can be achieved by randomly adding noise, blurring, and adjusting the size.
[0052] As an example, this step may include the following steps:
[0053] The first step is to use the public natural high-definition dataset image I gt , three steps are performed in sequence: blurring, adding noise, and resizing the image, and finally a low-quality degraded image I is obtained. lq The specific process is as follows:
[0054] First, in the blurring stage, the size of the blur kernel is set, and two types of blur kernels, isotropic (iso) and anisotropic (aniso), are used, both with a probability of 50%. The standard deviation of the blur is set in the range of 0.1 to 15.
[0055] Secondly, in the noise adding stage, the noise intensity range is set to 0 to 15, and Gaussian noise, Poisson noise and JPEG compressed noise are randomly added, where the quality range of JPEG compressed noise is set to 30 to 100.
[0056] Finally, in the image resizing stage, the downsampling range is set to 1 to 15, bilinear interpolation or bicubic interpolation is used for resizing, and the output image size is fixed to 512×512 pixels by center cropping.
[0057] In the second step, the high-definition and low-quality image pairs (I gt -I lq ) is randomly divided into training set and validation set in a ratio of 7:3, and train.txt and val.txt files containing the image addresses of the training set and validation set are generated.
[0058] Step 202: construct an image restoration network based on the SwinIR network, the modified LogCosh loss function, the high-order gradient restoration module and the pre-trained diffusion generation model.
[0059] The modified LogCosh loss function is a LogCosh loss function with a penalty term added. The existing SwinIR (Swin Transformer-based image restoration) network includes: a shallow feature extraction module, a deep feature extraction module and a high-definition image reconstruction module.
[0060] It should be noted that the existing SwinIR (Swin Transformer-based image restoration) network structure mainly consists of three parts: a shallow feature extraction module, a deep feature extraction module, and a high-definition image reconstruction module. The shallow feature extraction module consists of a single 3×3 convolutional layer; the deep feature extraction module contains 6 residual Swin Transformer blocks (RSTBs) and 1 3×3 convolutional layer. Each RSTB consists of 6 Swin Transformer layers (STLs), and every two STLs form a pair. In each pair of STLs, a single STL is composed of a normalization layer, a multi-head self-attention mechanism (MSA), a normalization layer, and a multi-layer perceptron (MLP) in sequence, and there are residual connections after the MSA and MLP. The MSA of the first STL is a window self-attention (W-MSA), and the MSA of the second STL is a shifted window self-attention (SW-MSA). A 3×3 convolutional layer is also added after each RSTB. Finally, through cross-layer connections, the shallow and deep features are fed into the HD image reconstruction module, which consists of multiple 3×3 convolutional layers.
[0061] In some embodiments, the present invention is improved based on the SwinIR network structure. First, based on the SwinIR network structure, a high-order gradient restoration module is introduced to better retain important structural information such as image texture; secondly, the MSE loss function in the SwinIR network structure is replaced with a modified logarithmic hyperbolic cosine (LogCosh) loss function, so that the network pays more attention to the image detail processing during the restoration process; through continuous iterative optimization, until the loss function converges, an intermediate restored image is obtained, and the weight parameters of the image restoration model are saved; finally, combined with a pre-trained diffusion generation model, the real detail performance of the restored image is further enhanced. The trained model weights are loaded, and the degraded image is restored using the image restoration model to complete the image restoration task.
[0062] As an example, this step may include the following steps:
[0063] In the first step, the shallow feature extraction module is used to transform the input low-quality image I lq , a shallow feature map is obtained through a single 3×3 convolution operation, and its corresponding formula can be:
[0064] F shallow =fshallow (I lq ),
[0065] Among them, I lq ∈R H×W×C is the input low-quality image, f shallow () is a shallow feature extraction function, i.e., a 3×3 convolutional layer. F shallow ∈R H×W×C is the extracted shallow features.
[0066] In the second step, the deep feature extraction module is used to extract the shallow features F shallow , use the deep feature extraction module to further extract features. The deep feature extraction module consists of K RSTBs and a 3×3 convolutional layer. Specifically, the deep feature extraction module is used to implement the following steps:
[0067] F deep =f deep (F shallow ),
[0068] Among them, f deep () is a deep feature extraction function, which contains K RSTBs and a 3×3 convolution layer. deep ∈R H ×W×C To extract the deep features, specifically:
[0069]
[0070] Among them, F mid is the middle layer feature, f RSTBi () is the i-th RSTB, f CONV () is the last convolutional layer. Through the combination of STL module and convolutional layer (CON), the inductive bias of convolution is introduced into the Transformer-based network, laying the foundation for the subsequent fusion of shallow and deep features. Each RSTB module consists of L Swin Transformer layers (STL) and a residual block of a convolutional layer. First, calculate the intermediate features after L STL:
[0071]
[0072] Among them, F in is the input feature of the i-th RSTB, F mid The intermediate features extracted for each STL in the L STL modules, For the Lth Swin Transformer layer in the i-th RSTB, then add a convolutional layer before the residual connection:
[0073]
[0074] in, is the output feature of the i-th RSTB, f convi () is the convolutional layer of the i-th RSTB. Features at different levels can be aggregated through residual connections.
[0075] In the third step, the high-definition image reconstruction module is used according to different restoration tasks, and the high-definition image reconstruction module has personalized differences.
[0076] It should be noted that for classic super-resolution tasks, 3×3 convolution is first performed, followed by PixelShuffle upsampling, and finally the convolution layer is output; for real image super-resolution, the input features are first processed by multiple 3×3 convolutions, followed by two nearest neighbor interpolation upsamplings, and then the upsampled image is convolved, and finally the convolution layer is output. For image denoising and JPEG compression artifact removal tasks, convolution is performed directly.
[0077] The fourth step is to introduce the constructed high-order gradient restoration module after the high-definition image reconstruction module included in the SwinIR network.
[0078] Among them, the high-order gradient restoration module is used to extract the high-order gradient information of the image.
[0079] It should be noted that in order to further improve the texture and detail restoration capability of the SwinIR network in the HD image reconstruction module, the present invention introduces a high-order gradient restoration module based on the anisotropic diffusion equation after the HD image reconstruction module, and uses the module to extract and restore the high-order gradient information of the image. Specifically, the module calculates the original HD image I gt and the intermediate restored image I RM The high-order gradient residual value between the two images is used as a constraint term to characterize the high-order gradient difference of the image before and after restoration, so as to impose stricter boundary and texture constraints on the restoration process of the model, effectively restore the details and contour information in the image, and adjust the model parameters through cyclic iteration to improve the quality of image restoration.
[0080] Specifically, the steps implemented by the high-order gradient restoration module may include the following sub-steps:
[0081] The first sub-step is to extract the high-order gradient information of the two images through gradient operation:
[0082]
[0083] in, represents the kth order gradient operation, I gt Represents natural high-definition dataset images, I RMRepresents the intermediate restored image obtained by the high-definition image reconstruction module.
[0084] In the second sub-step, the anisotropic diffusion equation is introduced to construct the formula corresponding to the high-order gradient constraint loss:
[0085]
[0086] Among them, I gd-loss represents a high-order gradient constrained loss function; is the MSE loss function, which is the square form of the 2 norm;
[0087] represents the gradient operation, I represents the grayscale image, represents the image gradient modulus. g(x) is the improved diffusion coefficient function, which is a monotonically decreasing function, and I RM is the intermediate restored image obtained after the image reconstruction module, I gt is a real image; and It means to find the partial derivative of the function in the brackets with respect to x and y respectively; w x and w y Represent the gradient of w in the x direction and y direction respectively.
[0088] By capturing the high-order gradient contour information between the intermediate restored image and the original high-definition image, the details, textures and other structures in the restored image can be ensured.
[0089] The fifth step is to replace the MSE loss function of the SwinIR network structure with the modified LogCosh loss function.
[0090] Among them, the modified LogCosh loss function, also known as the LogCosh loss function based on high-order gradient constraints and pixel difference, consists of two parts: the loss based on high-order gradient constraints and the logCosh loss based on pixel difference; it is equivalent to adding the penalty term "loss based on high-order gradient constraints" to the original LogCosh loss function based on pixel difference, so it can be called the modified LogCosh loss function. The logCosh loss based on pixel difference is also called the pixel-level loss function or the LogCosh loss function based on pixel difference.
[0091] It should be noted that compared with the MSE loss function, the LogCosh loss function is smoother when dealing with larger pixel errors. Specifically, the MSE loss function of the original SwinIR model image restoration is modified to the LogCosh loss function, and a penalty term is added to ensure numerical stability. The LogCosh loss function is similar to the MSE loss when the pixel deviation is small, and similar to the MAE loss when the pixel deviation is large, and the LogCosh loss function is second-order differentiable everywhere. The modified loss function is more suitable for dealing with scenes with more outliers, so that the network can better focus on the details of the image during the restoration process.
[0092] Secondly, by setting the number of training steps, the optimization is iterated continuously until the loss function converges and the weight parameters of the image restoration model are saved. Specifically, the modified LogCosh loss function (based on high-order gradient constraints and LogCosh loss based on pixel differences) can be constructed, and the gradient descent algorithm can be used to iterate and optimize continuously to reach a convergence state through dynamic adjustment changes.
[0093] The improved pixel-level loss function is constructed as:
[0094] I pix-loss =log(cosh((I RM -I gt )+ε))
[0095] Among them, I pix-loss is the pixel-level loss, log is the logarithmic operation, I RM is the intermediate restored image obtained after the image reconstruction module, I gt is the original high-definition image. ε is the stabilization term, set to ε=10 -3 .
[0096] For example, using the constructed high-order gradient restoration module and the modified LogCosh loss, the final loss function is obtained. The final modified LogCosh loss function is divided into two parts, including LogCosh loss based on high-order gradient constraints and pixel difference. The formula corresponding to the modified LogCosh loss function is:
[0097]
[0098] in, I RM =RM(I lq ), RM is the high-definition image reconstruction module, I RM is the intermediate restored image obtained by the high-definition image reconstruction module, I lq For low-quality images, I gtis the original high-definition image, ε is the stabilization term, and ε is set to 10 -3 ; F() is a high-order gradient recovery module constructed based on the anisotropic diffusion equation, represents the gradient operation, I represents the grayscale image, represents the image gradient modulus, g(x) is the improved diffusion coefficient function, λ is used to balance the weight between the LogCosh loss based on high-order gradient constraints and the LogCosh loss based on pixel differences, and λ is set to 0.1; and It means to find the partial derivative of the function in the brackets with respect to x and y respectively; w x and w y Represent the gradient of w in the x direction and y direction respectively.
[0099] The ultimate goal is to find the parameter θ that can minimize the entire loss function. The corresponding formula is:
[0100]
[0101] The model parameters are adjusted through iterative training, and the loss function is repeatedly calculated and the parameters are updated until the loss function converges.
[0102] By constructing a high-order image gradient restoration module to better preserve the image structure and detail information, compared with the existing loss function, the MSE loss function is improved, and the quality and robustness of the restored image are improved.
[0103] The sixth step is to introduce a pre-trained diffusion generation model to make the restored image generate more realistic details, and determine the final network as the image restoration network.
[0104] It should be noted that the pre-trained Vincent graph diffusion generative model is used to generate a smooth and natural image to complete the image restoration process. Specifically, the intermediate restored image I RM The final image restoration is achieved by using a large-scale text-to-image potential diffusion model (Sable Diffusion); in the above process, IR ControlNet is used to guide the final restored image I final With original high-definition image I gt The local pixel information of final .
[0105] Step 203, using the degraded low-quality images as training samples, using the natural high-definition dataset images as training labels, and using the modified LogCosh loss function as the loss function in the training process, the constructed image restoration network is trained to obtain a trained image restoration network.
[0106] It should be noted that the image restoration network based on high-order gradient constraints and diffusion generation model can be Figure 3 The comparison of low-quality image restoration results can be shown as follows Figure 4 and Figure 5 As shown, it can be clearly seen that in the degradation restoration task, the present invention can better preserve the structure and detail information of the image and achieve good restoration results.
[0107] In summary, the present invention cleverly integrates the improved anisotropic diffusion equation into the deep learning framework to construct a high-order gradient restoration module, which not only improves the image quality and visual effects in various image restoration tasks, but also enhances the generalization ability of the model. At the same time, the modified LogCosh loss function enables the model to better adapt to various image degradation situations and enhance the robustness of the model. This comprehensive consideration of low-level pixel information and high-level structural information is expected to promote the further development of image restoration technology.
[0108] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. An image restoration method based on high-order gradient constraints and diffusion generation model, characterized in that: The following steps are involved: Obtaining the image to be restored; The image to be restored is restored through the pre-trained image restoration network, wherein the image restoration network includes: a shallow feature extraction module, a deep feature extraction module, a high-definition image reconstruction module, a high-order gradient restoration module and a diffusion generation model; The training process of the image restoration network includes: Obtain natural high-definition dataset images, preprocess them, and generate degraded low-quality images; An image restoration network is constructed based on the SwinIR network, the modified LogCosh loss function, the high-order gradient restoration module and the pre-trained diffusion generation model. The modified LogCosh loss function is a LogCosh loss function with a penalty term added. The SwinIR network includes: a shallow feature extraction module, a deep feature extraction module and a high-definition image reconstruction module. The degraded low-quality images are used as training samples, the natural high-definition dataset images are used as training labels, and the modified LogCosh loss function is used as the loss function in the training process. The constructed image restoration network is trained to obtain a trained image restoration network.
2. The image restoration method based on high-order gradient constraints and diffusion generation model according to claim 1, characterized in that: The image restoration network is constructed based on the SwinIR network, the modified LogCosh loss function, the high-order gradient restoration module and the pre-trained diffusion generation model, including: A high-order gradient restoration module is introduced after the high-definition image reconstruction module included in the SwinIR network, wherein the high-order gradient restoration module is used to extract high-order gradient information of the image; Replace the MSE loss function of the SwinIR network structure with the modified LogCosh loss function; A pre-trained diffusion generation model is introduced, and the final network is determined as the image restoration network.
3. The image restoration method based on high-order gradient constraints and diffusion generation model according to claim 2, characterized in that: The steps to implement the high-order gradient restoration module include: The high-order gradient information of the two images extracted by gradient operation is: ▽ k I gt ,▽ k I RM , Among them, k represents the k-th order gradient operation, I gt Represents natural high-definition dataset images, I RM represents the intermediate restored image obtained by the high-definition image reconstruction module; Introduce the anisotropic diffusion equation and construct the formula corresponding to the high-order gradient constraint loss: Among them, I gd-loss represents a high-order gradient constrained loss function; w=▽I, ▽ represents gradient operation, I represents grayscale image, represents the image gradient modulus, g(x) is the improved diffusion coefficient function, I RM is the intermediate restored image obtained after the image reconstruction module, I gt is a real image; and It means to find the partial derivative of the function in the brackets with respect to x and y respectively; w x and w y Represent the gradient of w in the x direction and y direction respectively.
4. The image restoration method based on high-order gradient constraints and diffusion generation model according to claim 2, characterized in that: The formula corresponding to the modified LogCosh loss function is: in, I RM =RM(I lq ), RM is the high-definition image reconstruction module, I RM is the intermediate restored image obtained by the high-definition image reconstruction module, I lq For low-quality images, I gt is the original high-definition image, ε is the stabilization term, and ε is set to 10 -3 ; F() is a high-order gradient recovery module constructed based on the anisotropic diffusion equation, w=▽I, ▽ represents gradient operation, I represents grayscale image, represents the image gradient modulus, g(x) is the improved diffusion coefficient function, λ is used to balance the weight between the LogCosh loss based on high-order gradient constraints and the LogCosh loss based on pixel differences, and λ is set to 0.1; and It means to find the partial derivative of the function in the brackets with respect to x and y respectively; w x and w y Represent the gradient of w in the x direction and y direction respectively.
5. The image restoration method based on high-order gradient constraints and diffusion generation model according to claim 4, characterized in that: The ultimate goal is to find the parameter θ that can minimize the entire loss function. The corresponding formula is: The model parameters are adjusted through iterative training, and the loss function is repeatedly calculated and the parameters are updated until the loss function converges.
Citation Information
Patent Citations
Image super-resolution reconstruction method and device, model training method and device and electronic equipment
CN116805282A
Image restoration method and device, electronic equipment and storage medium
CN116934615A
Nuclear magnetic resonance image super-resolution recovery method and model construction method
CN117611453A