Single image super-resolution method based on conditional diffusion model
By using a conditional diffusion model and mutual information to optimize the loss function, the problem of blurring and artifacts generated by existing single-image super-resolution methods is solved, and high-quality super-resolution image generation is achieved.
Patent Information
- Application Number
- CN202311117131.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-08-31
AI Technical Summary
Existing single-image super-resolution methods struggle to generate realistic and rich detail textures, and the generated models are often difficult to control, costly, or produce artifacts and blurring. Regression-based methods, on the other hand, output blurry and severely distorted results.
A conditional diffusion model is used for super-resolution image generation. By maximizing the mutual information between input and output, a conditional diffusion model is constructed and the loss function is optimized. The U-Net structure is used to improve the model performance and robustness, and high-quality super-resolution images are generated.
Generate high-resolution images with natural details and textures, reduce uncertainty, avoid distortion and artifacts, and improve image quality.
Smart Images

Figure CN117173018B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image restoration technology, and more specifically, relates to a single image super-resolution method based on a conditional diffusion model. Background Technology
[0002] Single-Image Super-Resolution Reconstruction (SISR) aims to reconstruct a high-resolution (HR) image containing sharp details from a low-resolution (LR) image. High resolution means a high density of pixels in the image, providing more necessary details for practical applications. However, SISR is challenging because it is an ill-posed problem, meaning there is no stable and unique solution; often, multiple outputs correspond to a single input. This is due to the uncertainty of using the norm as the objective function during model training. The norm output is treated as the possible average to accommodate the uncertainty in the prediction, and is used to predict the median of all these outcomes. This uncertainty prevents the trained model from generating rich high-frequency information, even though it produces good results in reconstruction accuracy (such as PSNR and SSIM). Users desire outputs with realistic and rich details, making the generation of these realistic texture details an unavoidable and crucial problem.
[0003] Currently, single-image super-resolution methods can be broadly categorized into regression-based and generative-based methods. Regression-based methods input a low-resolution image (LR) into a model, which then upscales it to the same pixel count as the high-resolution image (HR) to obtain the super-resolution image (SR). The SR and HR are then compared by minimizing the distance between individual pixels, i.e., minimizing the norm. Generative-based methods utilize the generative capabilities of generative models to generate realistic detail textures during the super-resolution process. This approach involves incorporating contextual information from the image to generate new pixels. However, current single-image super-resolution methods still suffer from the following shortcomings:
[0004] 1. While regression-based single-image super-resolution methods have achieved good results in reconstruction accuracy (such as PSNR and SSIM), their outputs often lack rich image details. The super-resolution results frequently suffer from blurring, distortion, and artifacts, while users desire outputs with realistic and rich details.
[0005] 2. While generative single-image super-resolution methods can produce richer and more realistic details compared to regression-based methods, the generative models are often difficult to control and require complex network models. Methods based on FLOW and VAE models are often subject to various limitations; asymptotic models are costly for high-resolution image generation, and FLOW and VAE typically produce suboptimal sample quality. GANs require carefully designed regularization and optimization techniques to avoid instability and mode collapse, and often produce textures that do not conform to human visual perception. Diffusion models use norms as optimization objectives, which are often plagued by uncertainties in the dataset. This ambiguity caused by norm-based loss functions leads to artifacts, low quality, and blurring in the super-resolution results, and even image distortion in large-scale super-resolution tasks. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a single image super-resolution method based on a conditional diffusion model. This method generates super-resolution images based on the conditional diffusion model, adjusts the optimization objective during the training of the conditional diffusion model, and maximizes the mutual information between the model's input and output. This can improve the quality of the model's output image while ensuring the model's generation capability.
[0007] To achieve the above-mentioned objectives, the single-image super-resolution method based on the conditional diffusion model of the present invention includes the following steps:
[0008] S1: Obtain several image samples HR of the same size according to actual needs. Downsample each image sample HR by a factor of N to obtain a low-resolution image LR. Then upsample the low-resolution image LR by a factor of N to obtain a noisy image INF. Denoise the noisy image INF to obtain the corresponding super-resolution image.
[0009] S2: Construct a conditional diffusion model based on actual needs. This model will convert the super-resolution image... x is the Gaussian representation at time T. T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The super-resolution image SR is then recursively generated by denoising the image in the reverse order of the conditional diffusion process.
[0010] S3: Use the super-resolution image corresponding to each pattern sample HR from step S1. The Gaussian representation of x at time T T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. infThe corresponding image samples HR are used as the expected output to train the conditional diffusion model, resulting in a trained conditional diffusion model. The specific steps for training the conditional diffusion model include:
[0011] S3.1: Construct a neural network M with parameter ψ according to actual needs. Its input is the Gaussian representation x of the super-resolution image at time t during the inverse denoising process of the conditional diffusion model. t and output y t The concatenated feature map along the channel dimension outputs a global feature vector with a channel dimension of 1.
[0012] S3.2: Convert the super-resolution images from the training samples... The Gaussian representation of x at time T T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The input conditional diffusion model is used for inverse denoising to recursively generate a super-resolution image SR, while simultaneously obtaining the Gaussian representation x at each time t during the inverse denoising process. t and the output y of the conditional diffusion model t ;
[0013] S3.3: Calculate the loss function based on mutual information, the specific method is as follows:
[0014] Based on a normally distributed random sampling of a noise ε′, noise ε′ is added to the image sample HR to obtain another Gaussian representation x′ of the super-resolution image at time t. t ; Represent x in Gaussian terms respectively t 、x′ t With output y t By concatenating the vectors, we obtain the concatenated vector (x). t :y t ) and (x′ t :y t The two concatenated vectors are input into the neural network M to obtain the global feature vector M. θ,ψ (x′ t :y t ) and M θ,ψ (x t :y t );
[0015] Shannon mutual information is calculated using the following formula.
[0016]
[0017] in, Let θ represent the expected value, ψ represent the parameters of the conditional diffusion model, and ψ represent the parameters of the neural network M. sp(z) = log(1 + e^(-θ / 2)) z), This represents the product of the marginal distributions of the input and output. This represents the joint distribution of inputs and outputs;
[0018] The loss function L is calculated using the following formula. DM :
[0019]
[0020] Then, the final loss function (loss) is calculated using the following formula:
[0021]
[0022] Where α and β represent preset weight parameters;
[0023] S3.4: Adjust the parameters of the conditional diffusion model and the neural network based on the calculated loss function;
[0024] S3.5: Determine whether the predicted training completion conditions have been met. If they have been met, training ends; otherwise, return to step S3.2.
[0025] S4: When it is necessary to generate a super-resolution image from a low-resolution image LR′, the low-resolution image SR′ is upsampled by N times to obtain a noisy image INF′, and the denoised noisy image INF′ is used as the corresponding super-resolution image. Then the super-resolution image x, the Gaussian representation at time T T Use the noisy image INF′ as the initial noisy image x inf The input conditional diffusion model is denoised in reverse order of the conditional diffusion process, thereby recursively generating the super-resolution image SR′ corresponding to the low-resolution image LR′.
[0026] This invention presents a single-image super-resolution method based on a conditional diffusion model. It acquires image samples, then downsamples them to generate low-resolution images. The low-resolution images are then upsampled to generate noisy images, which are then denoised to obtain the corresponding super-resolution images, thus providing training samples. A conditional diffusion model is constructed according to actual needs. The super-resolution images corresponding to the noisy images in the training samples are used as the Gaussian representation at time T, with the noisy images serving as the initial noise images and the corresponding image samples as the expected output. The conditional diffusion model is trained, maximizing the mutual information between the input and output. When super-resolution image generation is required, the low-resolution images are upsampled to obtain noisy images, which are then denoised to obtain the corresponding super-resolution images. These are input into the trained conditional diffusion model, and denoised according to the reverse order of the diffusion process, thereby generating the corresponding super-resolution images.
[0027] The present invention has the following beneficial effects:
[0028] 1) This invention utilizes a conditional diffusion model to generate high-resolution images, proposes maximizing mutual information to reduce uncertainty, and allows deep learning to maximize the mining of useful information to avoid deformation and artifacts while improving the quality of the output image, generating images with more natural details and textures.
[0029] 2) This invention designs a U-Net structure that is more suitable for the conditional diffusion model, improving the performance and robustness of the conditional diffusion model while maintaining translation invariance. Attached Figure Description
[0030] Figure 1 This is a flowchart illustrating a specific implementation of the single-image super-resolution method based on the conditional diffusion model of the present invention.
[0031] Figure 2 This is a flowchart of the conditional diffusion model in this embodiment;
[0032] Figure 3 This is a flowchart of the conditional diffusion model training in this invention;
[0033] Figure 4 This is a flowchart of calculating the loss function based on mutual information in this embodiment. Detailed Implementation
[0034] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs that might obscure the main content of the invention will be omitted here.
[0035] Example
[0036] Figure 1 This is a flowchart illustrating a specific implementation of the single-image super-resolution method based on the conditional diffusion model of this invention. Figure 1 As shown, the specific steps of the single image super-resolution method based on the conditional diffusion model of the present invention include:
[0037] S101: Obtain image samples:
[0038] To obtain several image samples (HR) of the same size as needed, each HR sample is downsampled by a factor of N to obtain a low-resolution image (LR). Then, the low-resolution image (LR) is upsampled by a factor of N to obtain a noisy image (INF). The noisy image (INF) is then denoised to obtain the corresponding super-resolution image.
[0039] In this embodiment, bicubic interpolation is used for upsampling and downsampling.
[0040] S102: Constructing a conditional diffusion model:
[0041] A diffusion model is a probabilistic model that learns the data distribution by inversely increasing Gaussian noise. At each step of this process, the model attempts to recover the original data from the corrupted data.
[0042] The forward process of the diffusion model is a Markov chain of length T, where each state at time t corresponds to a noise image. These noise images {x} t |t∈[1,T]} is obtained by adding Gaussian-distributed noise to the original image x:=x0, ultimately resulting in pure Gaussian noise x. T , where x t =α t x0+(1-α t ε, ε follows a Gaussian distribution, α t It decreases as t increases.
[0043] The inverse process of the diffusion model is from the noisy image z:=x T Starting from ~N(0,I), the original image is gradually recovered. This process consists of a series of denoising autoencoders ε θ (x t The system consists of (x, t), where θ represents the parameters, and each autoencoder can adapt to the current input image x. t Generate an output image that more closely resembles the original image. The objective function can be expressed as:
[0044]
[0045] in, It indicates the desire for expectation.
[0046] Compared to the general diffusion model, the conditional diffusion model introduces a conditional term into the input: ε. θ (x t ,x inf The goal is to enable the model to learn updates at each step based on conditions. This invention constructs a conditional diffusion model based on actual needs, which will then apply the super-resolution image... x is the Gaussian representation at time T. T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. infThe super-resolution image is then recursively generated by denoising the image in the reverse order of the conditional diffusion process. The specific principles and workflow of the conditional diffusion model can be found in the reference "
[2021] [NIPS][Classifier-Free Diffusion Guidance]".
[0047] The conditional diffusion model generates an image step-by-step through T steps, minimizing information loss at each step. To enable the neural network to fit complex functions, a deep network structure can be used, and the dimensionality of intermediate layer features can be compressed to a level far lower than that of the input and output. Therefore, in this embodiment, U-Net with skip connections is chosen as the basic structure to construct the conditional diffusion model. Figure 2 This is a flowchart of the conditional diffusion model in this embodiment. For example... Figure 2 As shown, the conditional diffusion model in this embodiment includes an input processing module, a first downsampling module, a second downsampling module, a first convolutional visual transformation module, a third downsampling module, a second convolutional visual transformation module, a first upsampling module, a first skip connection module, a third convolutional visual transformation module, a second upsampling module, a second skip connection module, a third upsampling module, a third skip connection module, and an output processing module. Each module will be described in detail below.
[0048] The input processing module is implemented based on convolutional layers and is used to process noisy images (INF) and Gaussian noise images (x). t The features are then concatenated and then extracted to obtain a feature map F of size M×N×C. in Where M×N is the size of the noisy image INF, and C represents the number of channels in the noisy image INF, then the feature map F in It is sent to the first downsampling module and the third jump connection module.
[0049] The first downsampling module is used to process the feature map F. in Perform a downsampling operation to obtain a feature map F of size m1×n1×c1. 1,down Where m1×n1 is the feature map F 1,down The size, c1 represents the feature map F 1,down The number of channels, and then the feature map F 1,down The data is sent to the second downsampling module and the second skip connection module. In this embodiment, each downsampling module consists of two residual blocks and a cascaded 3x3 convolutional layer with a stride of 2. Each residual block contains two 3x3 convolutional layers and a batch normalization layer.
[0050] The second downsampling module is used to process the feature map F. 1,down Perform downsampling to obtain a feature map F of size m²×n²×c². 2,down Where m2×n2 is the feature map F2,down The size of the feature map F is c2. 2,down The number of channels, and then the feature map F 2,down Send to the first convolutional visual transformation module.
[0051] The first Convolutional Visual Transformer (CvT) module is used to process the feature map F. 2,down Perform convolutional visual transformation processing to obtain a feature map F of size m2×n2×c2. CvT,1 The data is then sent to the third downsampling module and the first skip connection module. The CvT module improves performance and efficiency by introducing convolutions into the visual transformer. The CvT module consists of multiple Convolutional Visual Transformation Blocks (CvT Blocks), each containing a depthwise separable convolutional layer and a multi-head self-attention layer. The depthwise separable convolutional layer is used for linear projection of the query, key, and value, while the multi-head self-attention layer is used for global information interaction on the feature maps.
[0052] The third downsampling module is used to process the feature map F. CvT,1 Perform a downsampling operation to obtain a feature map F of size m³×n³×c³. 3,down Where m3×n3 is the feature map F 3,down The size, c3 represents the feature map F 3,down The number of channels, and then the feature map F 3,down Send to the second convolutional visual transformation module.
[0053] The second convolutional visual transformation module is used to process the feature map F. 3,down Perform convolutional visual transformation processing to obtain a feature map F of size m3×n3×c3. CvT,2 And send it to the first upsampling module.
[0054] The first upsampling module is used to apply nearest-neighbor interpolation to the feature map F. CvT,2 Upsampling is performed to obtain a feature map F of size m²×n²×c². 1,up And send it to the first jump connection module.
[0055] The first jump connection module is used to connect feature map F CvT,1 and feature map F 1,up The feature maps are concatenated along the channel dimension, and then feature extraction is performed on the concatenated feature maps to obtain a feature map F of size m2×n2×c2. 1,con The data is then sent to the third convolutional visual transformation module. Through the operation of the skip connection module, low-resolution low-level features and high-resolution high-level semantic features can be preserved, thereby improving the image super-resolution effect.
[0056] The third convolutional visual transformation module is used to process the feature map F. 1,con Perform convolutional visual transformation processing to obtain a feature map F of size m2×n2×c2. CvT,3 And send it to the second upsampling module.
[0057] The second upsampling module is used to perform nearest-neighbor interpolation on the feature map F. CvT,3 Upsampling is performed to obtain a feature map F of size m1×n1×c1. 2,up And send it to the second hop connection module.
[0058] The second skip connection module is used to connect feature map F 1,down and feature map F 2,up The feature maps are concatenated along the channel dimension, and then feature extraction is performed on the concatenated feature maps to obtain a feature map F of size m1×n1×c1. 2,con And send it to the third upsampling module.
[0059] The third upsampling module is used to perform nearest-neighbor interpolation on the feature map F. 2,con Upsampling is performed to obtain a feature map F of size M×N×C. 3,up And send it to the first jump connection module.
[0060] The third jump connection module is used to connect feature map F in and feature map F 3,up The feature maps are concatenated along the channel dimension, and then feature extraction is performed on the concatenated feature maps to obtain a feature map F of size M×N×C. 3,con And send it to the output processing module.
[0061] The output processing module is implemented based on convolutional layers and is used to process the feature map F. 3,con The processing yields a noisy image E of size M×N×C. ψ (x t For noisy image E ψ (x t The noisy image x was obtained by sampling. t+1 .
[0062] S103: Training the Conditional Diffusion Model:
[0063] The super-resolution image corresponding to each pattern sample HR in step S101 is used. The Gaussian representation of x at time T T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The corresponding image sample HR is used as the expected output to train the conditional diffusion model, resulting in a trained conditional diffusion model.
[0064] Generally, the loss function L used in conditional diffusion models DM The following formula is used for calculation:
[0065]
[0066] Where ε is the noise representation of the image sample HR, ε θ (x t ,x inf (t) represents the output y of the conditional diffusion model at time t. t θ represents the parameters of the conditional diffusion model.
[0067] To improve the quality of the generated super-resolution images, this invention improves the loss function, allowing deep learning to maximize the discovery of useful representations, i.e., maximizing the mutual information between the model's input and output.
[0068] Assume x t and y t It is a network ε with parameter θ θ Let x be the input and output. t and y t =ε θ (x t Let be the domain and range of a parametric function that is continuous and (almost everywhere) differentiable. Assume... It is a set of N training samples in the input space, which follow an empirical distribution. So and They are respectively Marginal and joint distributions.
[0069] To obtain high-quality reconstructed images with fine textures, the original loss function L in the conditional diffusion model is... DM A penalty term is added to the norm to reduce the uncertainty of the output when the input is known. The optimized loss function is shown in the following equation:
[0070]
[0071] Where α and β represent preset weight parameters, This indicates mutual information between Shannon and others.
[0072] In other words, by combining the loss function L of the diffusion model DM and negative proportion of Shannon mutual information To construct the optimization objective function, the target network ε θOptimization is achieved by minimizing the objective function. During computation, it's unnecessary to estimate the mutual information, as maximizing the effective information between the input and output at time t in the Markov chain is equivalent to maximizing the mutual information. Therefore, the Shannon formula for mutual information can be used for calculation.
[0073]
[0074] in, This represents calculating the expectation, θ represents the parameters of the conditional diffusion model, M is a neural network with parameter ψ, and x′ t This indicates that at time t, the distribution... Another sample was drawn, sp(z) = log(1 + e z ), This represents the product of the marginal distributions of the input and output. This represents the joint distribution of input and output.
[0075] Based on the above theoretical analysis, this invention proposes a training method for the conditional diffusion model based on the improved loss function. Figure 3 This is a flowchart of the conditional diffusion model training in this invention. For example... Figure 3 As shown, the specific steps for training the conditional diffusion model in this embodiment include:
[0076] S301: Constructing a Neural Network
[0077] Based on actual needs, a neural network M with parameter ψ is constructed, whose input is the Gaussian representation x of the super-resolution image at time t during the inverse denoising process of the conditional diffusion model. t and output y t The concatenated feature map along the channel dimension outputs a global feature vector with a channel dimension of 1. This feature vector is independent of the feature pixels. In this embodiment, the neural network M includes three cascaded convolutional layers and a sigmoid layer, with each convolutional layer having a 1×1 kernel size.
[0078] S302: Operating Condition Diffusion Model
[0079] Super-resolution images from training samples The Gaussian representation of x at time T T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The input conditional diffusion model is used for inverse denoising to generate a super-resolution image SR. At the same time, the Gaussian representation x at each time t during the inverse denoising process is obtained. t and the output y of the conditional diffusion model t .
[0080] S303: Calculating the loss function based on mutual information:
[0081] Figure 4 This is a flowchart illustrating the calculation of the loss function based on mutual information in this embodiment. For example... Figure 4 As shown, the specific method for calculating the loss function based on mutual information is as follows:
[0082] Based on a normally distributed random sampling of a noise ε′, noise ε′ is added to the image sample HR to obtain another Gaussian representation x′ of the super-resolution image at time t. t Let x be represented in Gaussian terms. t 、x′ t With output y t By concatenating the vectors, we obtain the concatenated vector (x). t :y t ) and (x′ t :y t The two concatenated vectors are input into the neural network M to obtain the global feature vector M. θ,ψ (x′ t :y t ) and M θ,ψ (x t :y t ).
[0083] Shannon mutual information is calculated using the following formula.
[0084]
[0085] in, Let θ represent the expected value, ψ represent the parameters of the conditional diffusion model, and ψ represent the parameters of the neural network M. sp(z) = log(1 + e^(-θ / 2)) z ), This represents the product of the marginal distributions of the input and output. This represents the joint distribution of inputs and outputs;
[0086] The loss function L is calculated using the following formula. DM :
[0087]
[0088] Then, the final loss function (loss) is calculated using the following formula:
[0089]
[0090] Where α and β represent preset weight parameters.
[0091] S304: Adjusting the parameters of the conditional diffusion model and neural network:
[0092] The parameters of the conditional diffusion model and the neural network are adjusted based on the calculated loss function.
[0093] S305: Determine whether the predicted training completion conditions have been met. If they have been met, training ends; otherwise, return to step S302.
[0094] There are usually two conditions for training to be completed: one is that the number of iterations reaches the preset maximum number of iterations, and the other is that the parameters of the conditional diffusion model converge.
[0095] S104: Super-resolution image generation:
[0096] When it is necessary to generate a super-resolution image from a low-resolution image LR′, the low-resolution image SR′ is upsampled by N times to obtain a noisy image INF′. The noisy image INF′ is then denoised and used as the corresponding super-resolution image. Then the super-resolution image x, the Gaussian representation at time T T Use the noisy image INF′ as the initial noisy image x inf The input conditional diffusion model is denoised in reverse order of the conditional diffusion process, thereby recursively generating the super-resolution image SR′ corresponding to the low-resolution image LR′.
[0097] To better illustrate the technical effects of the present invention, specific examples are used to experimentally verify the present invention.
[0098] Example 1
[0099] The Natural Image 4x Super-Resolution Task uses image scales of 32–128: training is performed using the DIV2K (800 images) dataset with HR image patch resolution of 128×128. This example uses three benchmark datasets to evaluate the model's performance: Set5, Set14, and Urban100. In this embodiment, six existing methods are selected as comparison methods: the bicubic algorithm, the SRGAN (Super-Resolution Generative Adversarial Network) algorithm, the SFTGAN (Recovering Realistic Texture in Image Super-Resolution by Deep Spatial Feature Transform) algorithm, the ESRGAN (Enhanced Super-Resolution Generative Adversarial Networks) algorithm, the USRGAN (Deep Unfolding Network for Image Super-Resolution) algorithm, and the SwinIR+LGAN (SwinIR: Image Restoration Using Swin Transformer) algorithm. Table 1 shows the performance comparison of the present invention and the comparison methods in Example 1 on different benchmark datasets.
[0100]
[0101] Table 1
[0102] As shown in Table 1, a quantitative comparison was made between the state-of-the-art GAN-SR methods and the method of this invention. Table 1 shows that the method of this invention exhibits excellent perceptual quality per inch (LPIPS) on several test datasets (Set5, Set14, Urban100) for the 4x task, outperforming several existing methods.
[0103] Example 2
[0104] The image sizes for the 8x face super-resolution task were set to 16–128 and 64–512 pixels. Training was performed using the FFHQ dataset, and evaluation was conducted on the CelebA-HQ dataset. In this embodiment, four existing 8x face super-resolution methods were selected for comparison: PULSE (Photo Upsampling via Latent Space Exploration), FSRNET (Face Super-Resolution Network), Regression, and SR3 (Super-Resolution through Repeated Thinning). Table 2 shows the performance comparison of the present invention and the comparison methods on the CelebA-HQ dataset in this embodiment.
[0105] CelebA-HQ 16-128 PSNR SSIM Consistency PULSE 16.88 0.44 161.1 FSRNET 23.01 0.62 33.8 Regression 23.96 0.69 2.71 SR3 23.04 0.65 2.68 This invention 24.00 0.65 2.63 CelebA-HQ 64-512 PSNR SSIM LPIPS SR3 19.87 0.44 0.3455 This invention 24.36 0.58 0.2702
[0106] Table 2
[0107] As shown in Table 2, the proposed maximized mutual information combined with conditional diffusion model improves reconstruction accuracy (PSNR, SSIM, Consistency) to a certain extent based on the traditional U-Net backbone network. This improvement is reflected in tasks 64–512 and in comparisons with SR3 in perceptual quality (LPIPS). For tasks 16–128, the smaller input images and less image information make the tasks more difficult. The regression-based regression has higher PSNR and SSIM values because its U-Net network maximizes the preservation of the basic structure of the original image. However, its output results are affected by L... p The norm loss problem results in a lack of detailed texture, making the image appear blurry. While the reconstruction accuracy of generation-based methods like PULSE, FSRNET, SR3, and the method described in this invention is not as good as simple regression-based methods, their outputs are clearer and contain more texture detail. Among these methods, the present invention produces better numerical performance and experimental output without unpleasant artifacts. To further illustrate the advantages of this invention in processing L... p The effectiveness of norm loss in addressing the problem is reduced by changing the input image to 64x64. It contains more effective information and shows significant improvements in reconstruction accuracy and perceptual quality per 100-bit (LPIPS) on experimental data.
[0108] Although the illustrative specific embodiments of the present invention have been described above to enable those skilled in the art to understand the invention, it should be understood that the invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of the present invention are protected.
Claims
1. A single image super-resolution method based on a conditional diffusion model, characterized in that, Includes the following steps: S1: Obtain several image samples HR of the same size according to actual needs. Downsample each image sample HR by a factor of N to obtain a low-resolution image LR. Then upsample the low-resolution image LR by a factor of N to obtain a noisy image INF. Denoise the noisy image INF to obtain the corresponding super-resolution image. S2: Construct a conditional diffusion model based on actual needs. This model will convert the super-resolution image... x is the Gaussian representation at time T. T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The super-resolution image SR is then recursively generated by denoising the image in the reverse order of the conditional diffusion process. S3: Use the super-resolution image corresponding to each pattern sample HR from step S1. The Gaussian representation of x at time T T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The corresponding image sample HR is used as the expected output to train the conditional diffusion model, thus obtaining the trained conditional diffusion model. The specific steps for training a conditional diffusion model include: S3.1: Construct a neural network M with parameter ψ according to actual needs. Its input is the Gaussian representation x of the super-resolution image at time t during the inverse denoising process of the conditional diffusion model. t and output y t The concatenated feature map along the channel dimension outputs a global feature vector with a channel dimension of 1. S3.2: Convert the super-resolution images from the training samples... The Gaussian representation of x at time T T The noisy image INF obtained by upsampling the low-resolution image using LR is used as the initial noisy image x. inf The input conditional diffusion model is used for inverse denoising to recursively generate a super-resolution image SR, while simultaneously obtaining the Gaussian representation x at each time t during the inverse denoising process. t and the output y of the conditional diffusion model t ; S3.3: Calculate the loss function based on mutual information, the specific method is as follows: Based on a normally distributed random sampling of a noise ε′, noise ε′ is added to the image sample HR to obtain another Gaussian representation x of the super-resolution image at time t. t ′; Represent x in Gaussian terms respectively t x t ′ and output y t By concatenating the vectors, we obtain the concatenated vector (x). t :y t ) and (x t ′:y t The two concatenated vectors are input into the neural network M to obtain the global feature vector M. θ,ψ (x t ′:y t ) and M θ,ψ (x t :y t ); Shannon mutual information is calculated using the following formula. in, Let θ represent the expected value, ψ represent the parameters of the conditional diffusion model, and ψ represent the parameters of the neural network M. sp(z) = log(1 + e^(-θ / 2)) z ), This represents the product of the marginal distributions of the input and output. This represents the joint distribution of inputs and outputs; The loss function L is calculated using the following formula. DM : Then, the final loss function (loss) is calculated using the following formula: Where α and β represent preset weight parameters; S3.4: Adjust the parameters of the conditional diffusion model and the neural network based on the calculated loss function; S3.5: Determine whether the predicted training completion conditions have been met. If they have been met, training ends; otherwise, return to step S3.
2. S4: When it is necessary to generate a super-resolution image from a low-resolution image LR′, the low-resolution image SR′ is upsampled by N times to obtain a noisy image INF′, and the noisy image INF′ is then denoised to obtain the corresponding super-resolution image. Then the super-resolution image x, the Gaussian representation at time T T Use the noisy image INF′ as the initial noisy image x inf The input conditional diffusion model is denoised in reverse order of the conditional diffusion process, thereby recursively generating the super-resolution image SR′ corresponding to the low-resolution image LR′.
2. The single-image super-resolution method according to claim 1, characterized in that, The conditional diffusion model in step S2 includes an input processing module, a first downsampling module, a second downsampling module, a first convolutional visual transformation module, a third downsampling module, a second convolutional visual transformation module, a first upsampling module, a first skip connection module, a third convolutional visual transformation module, a second upsampling module, a second skip connection module, a third upsampling module, a third skip connection module, and an output processing module, wherein: The input processing module is implemented based on convolutional layers and is used to process noisy images (INF) and Gaussian noise images (x). t The features are then concatenated and then extracted to obtain a feature map F of size M×N×C. in Where M×N is the size of the noisy image INF, and C represents the number of channels in the noisy image INF, then the feature map F in Send to the first downsampling module and the third jump connection module; The first downsampling module is used to process the feature map F. in Perform a downsampling operation to obtain a feature map F of size m1×n1×c1. 1,down Where m1×n1 is the feature map F 1,down The size, c1 represents the feature map F 1,down The number of channels, and then the feature map F 1,down Send to the second downsampling module and the second hop connection module; The second downsampling module is used to process the feature map F. 1,down Perform downsampling to obtain a feature map F of size m²×n²×c². 2,down Where m2×n2 is the feature map F 2,down The size of the feature map F is c2. 2,down The number of channels, and then the feature map F 2,down Send to the first convolutional visual transformation module; The first convolutional visual transformation module is used to process the feature map F. 2,down Perform convolutional visual transformation processing to obtain a feature map F of size m2×n2×c2. CvT,1 And send it to the third downsampling module and the first jump connection module; The third downsampling module is used to process the feature map F. CvT,1 Perform a downsampling operation to obtain a feature map F of size m³×n³×c³. 3,down Where m3×n3 is the feature map F 3,down The size, c3 represents the feature map F 3,down The number of channels, and then the feature map F 3,down Send to the second convolutional visual transformation module; The second convolutional visual transformation module is used to process the feature map F. 3,down Perform convolutional visual transformation processing to obtain a feature map F of size m3×n3×c3. CvT,2 And send it to the first upsampling module; The first upsampling module is used to apply nearest-neighbor interpolation to the feature map F. CvT,2 Upsampling is performed to obtain a feature map F of size m²×n²×c². 1,up And send it to the first hop connection module; The first jump connection module is used to connect feature map F CvT,1 and feature map F 1,up The feature maps are concatenated along the channel dimension, and then feature extraction is performed on the concatenated feature maps to obtain a feature map F of size m2×n2×c2. 1,con And send it to the third convolutional visual transformation module; The third convolutional visual transformation module is used to process the feature map F. 1,con Perform convolutional visual transformation processing to obtain a feature map F of size m2×n2×c2. CvT,3 And send it to the second upsampling module; The second upsampling module is used to perform nearest-neighbor interpolation on the feature map F. CvT,3 Upsampling is performed to obtain a feature map F of size m1×n1×c1. 2,up And send it to the second hop connection module; The second skip connection module is used to connect feature map F 1,down and feature map F 2,up The feature maps are concatenated along the channel dimension, and then feature extraction is performed on the concatenated feature maps to obtain a feature map F of size m1×n1×c1. 2,con And send it to the third upsampling module; The third upsampling module is used to perform nearest-neighbor interpolation on the feature map F. 2,con Upsampling is performed to obtain a feature map F of size M×N×C. 3,up And send it to the first hop connection module; The third jump connection module is used to connect feature map F in and feature map F 3,up The feature maps are concatenated along the channel dimension, and then feature extraction is performed on the concatenated feature maps to obtain a feature map F of size M×N×C. 3,con And send it to the output processing module; The output processing module is implemented based on convolutional layers and is used to process the feature map F. A,con The processing yields a noisy image E of size M×N×C. ψ (x t ), for noisy image E ψ (x t The noisy image x was obtained by sampling. t+1 .
