Image super-resolution method, system and medium based on gradient optimized diffusion model
By introducing the consistency constraint and gradient optimization method of denoising intermediate variables in the image super-resolution task, the instability and inconsistency problems of the diffusion model under different noise conditions are solved, and a more stable and consistent high resolution is achieved. Image reconstruction improves image detail retention and processing efficiency.
Patent Information
- Application Number
- CN202410361514.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-03-28
AI Technical Summary
Existing image super-resolution methods based on diffusion models have large reconstruction performance fluctuations under different starting noise conditions. Especially when processing local low-resolution images, there are inconsistencies between the reconstructed images and the real images, and the high resolution in the solution space Image quality varies.
Introduce the consistency constraint between the denoising intermediate variable and the input low-resolution image, adjust the consistency constraint through local scaling and positioning guidance methods, use the gradient optimization method to enhance the representation consistency, extract the contour mask as positioning guidance information, and fuse the gradient The denoising variables before and after optimization are performed iteratively until completion.
It effectively solves the problems of instability and inconsistency, reduces the understanding space, improves the stability and consistency of image super-resolution tasks, retains image structure and detailed information, and improves processing efficiency.
Smart Images

Figure CN117974450B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to an image super-resolution method, system and medium based on a gradient optimized diffusion model. Background Art
[0002] In recent years, diffusion models have made significant progress in image generation tasks. Unlike other generative models, they show significant improvements without the mode collapse problem. Diffusion models have a more compact representation in the latent space, which helps to avoid the fuzzy sample problem found in variational autoencoders. In addition, they can model the highly complex distribution of natural images without dealing with billions of parameters in autoregressive models. Recent studies have shown that the robust generation ability of diffusion models expands its applicability to various conditional tasks, such as image super-resolution, image colorization, and image completion. Image super-resolution is a technique that increases image details and clarity by converting low-resolution images into high-resolution images. In order to improve the performance on image super-resolution tasks, researchers have proposed different diffusion models.
[0003] SRDiff uses a flow-based approach to solve problems such as over-smoothing and mode collapse in single image super-resolution. This method converts noise into diverse and realistic super-resolution images through Markov chains, and accelerates model convergence through residual prediction. It can produce high-quality image reconstruction results with rich details and provides an image processing strategy that is easy to train. DDRM introduces an effective unsupervised method for image restoration tasks, using a pre-trained denoising diffusion generative model to solve various linear inverse problems in image processing. It outperforms existing unsupervised methods in terms of reconstruction and perceptual quality, and also demonstrates robust generalization to out-of-distribution natural images. SR3 is a method for image super-resolution through repeated refinement. Its success is partly due to the use of large model capacity and large training datasets. The main disadvantage is that the model generates very similar images under similar conditions, which limits the diversity of reconstructed images. DiffBIR introduces latent image guidance during inference and uses pre-trained stable diffusion to maintain generation capabilities. StableSR introduces a controllable feature packaging module to balance quality and fidelity, and introduces a progressive aggregation sampling strategy to adapt to different resolutions.
[0004] When dealing with image super-resolution problems, existing diffusion model-based methods show significant fluctuations in reconstruction performance under different starting noise conditions. In particular, when the diffusion model processes local low-resolution images, the inconsistency between the reconstructed image and the real image is particularly serious. The application of diffusion models in image super-resolution faces unique challenges. Unlike general content generation tasks, image super-resolution requires reconstructing accurate high-resolution images with high-quality details from low-resolution images, which constitutes an ill-posed inverse problem, meaning that the same low-resolution image can correspond to multiple high-resolution image solutions, rather than a unique solution. The powerful generation ability of the diffusion model further expands the solution space, resulting in uneven quality of high-resolution images in the solution space. In addition, the output of the diffusion model is closely related to the random Gaussian noise of the input. The randomness plus the huge solution space make it very challenging to find high-quality high-resolution image solutions through conditional diffusion models. Summary of the invention
[0005] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide an image super-resolution method, system and medium based on a gradient optimized diffusion model. The present invention introduces consistency constraints between denoising intermediate variables and input low-resolution images, and flexibly adjusts consistency constraints for different feature areas through local scaling and positioning guidance methods, effectively solving the instability and inconsistency problems caused by unreasonable denoising and reconstruction processes.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides an image super-resolution method based on a gradient optimized diffusion model, comprising the following steps:
[0008] A. Project the pixel space to a low-dimensional latent space and establish the denoising and reconstruction process of the conditional diffusion model in the latent space;
[0009] B. At each time step of the denoising and reconstruction process, the consistency constraints between the denoising intermediate variables and the input low-resolution image are calculated to obtain the consistency constraint matrix P;
[0010] C. At each time step of the denoising and reconstruction process, dynamically scale the consistency constraint between the denoising intermediate variable and the input low-resolution image to obtain the locally scaled consistency constraint Q;
[0011] D. At each time step of the denoising and reconstruction process, a gradient optimization method is used to enhance the representation consistency between the denoising intermediate variable and the input low-resolution image;
[0012] E. At each time step of the denoising and reconstruction process, the contour mask of the input low-resolution image is extracted as positioning guidance information, thereby fusing the denoising variables before and after gradient optimization;
[0013] F. Iterate steps BE until the denoising steps are completed. The latent representation of the denoised variable obtained after the denoising steps are completed is projected into the pixel space through the pre-trained decoder to obtain a high-resolution denoised image.
[0014] As a preferred technical solution, the step A is specifically as follows:
[0015] A1. In the image super-resolution task, a low-resolution image is input. The preprocessing process of the conditional diffusion model on the conditional information is as follows: the input low-resolution image y is passed through the pre-trained encoder Projecting to a low-dimensional latent space to obtain a potential representation of the low-resolution image ;
[0016] A2. According to the standard Gaussian distribution Randomly sampled values , random Gaussian noise As the starting input of the denoising and reconstruction process of the conditional diffusion model;
[0017] A3. Combine the latent representation of the low-resolution image with random Gaussian noise After splicing, the input is diffuse model and denoised according to the given method.
[0018] As a preferred technical solution, in step A3, the denoising and reconstruction process of the conditional diffusion model is specifically as follows:
[0019] The denoising process of the conditional diffusion model is a Gaussian noise As a starting point, take the latent representation of the input low-resolution image As input conditions, the process of step-by-step denoising and reconstruction in accordance with the Markov chain is carried out by iterative execution of T time steps to obtain a series of denoised variables , the denoising process is as follows:
[0020] ,
[0021] in, is the denoised variable at the tth time step, is a real noise-free image, is the preset attenuation coefficient, , I represents the identity matrix; since There is an unknown , the build parameters are Neural Network Approximate the denoising process:
[0022] , ,
[0023] The learnable covariance , the learnable mean , The noise predicted by the neural network;
[0024] In summary, according to Derivation It is expressed as:
[0025] ,in is the random noise introduced at each step; according to Derivation immediately indicates It is expressed as: .
[0026] As a preferred technical solution, the step B is specifically as follows:
[0027] B1. Immediate representation of the denoising process calculation Through the pre-trained decoder Projected into pixel space, we get the immediate representation of the reconstruction ;
[0028] B2. Immediate representation of reconstruction Through the bicubic interpolation function Downsampling to get a low-resolution immediate representation ;
[0029] B3. Immediately display low-resolution The Euclidean norm is calculated with the input low-resolution image y to obtain the consistency constraint matrix P, as shown below: , where y is the input low-resolution image representation, represents the decoder network, Represents the bicubic interpolation function.
[0030] As a preferred technical solution, the step C is specifically as follows:
[0031] C1. According to the consistency constraint matrix P, sort the elements in P according to the size of the value to obtain the topK element values and their indexes;
[0032] C2. Dynamically adjust the consistency constraint through local scaling method to balance the trade-off between denoising and detail retention. Specifically, construct a set of linear transformation equations, linearly scale the topK element values to a new matrix with given upper and lower bounds, and keep the remaining element values unchanged to obtain the consistency constraint Q after local scaling.
[0033] As a preferred technical solution, the step C2 is specifically as follows:
[0034] The topK element values obtained by sorting the consistency constraint matrix P are , the topK element values include the maximum value among the K elements The minimum value among the K elements , according to the given upper bound and the lower bound Construct the linear transformation equations:
[0035] , ,
[0036] in and is the coefficient to be determined;
[0037] The calculated coefficients and Perform a linear transformation on the above K elements to map them into the new coordinate system:
[0038] ,in is the new element after mapping;
[0039] In the original consistency constraint matrix, the elements except the topK elements keep their values unchanged, and only the topK element values are updated to the new element values after mapping, so as to obtain the consistency constraint Q after local scaling.
[0040] As a preferred technical solution, the step D is specifically as follows:
[0041] D1. According to the locally scaled consistency constraint Q, calculate the denoising variable at the tth time step Gradient ;
[0042] D2, denoised variable at the t-1th time step obtained in step A3 , and the gradient obtained in step D1, the denoised variable of the t-1th time step The value of is further updated to , as shown below: ,in is the step size constant for gradient updates.
[0043] As a preferred technical solution, the step E is specifically as follows:
[0044] E1. Use edge detection operator to extract the contour mask matrix M of the input low-resolution image y as positioning guidance information;
[0045] E2, the denoised variable at the t-1th time step is finally expressed as , where E represents a matrix whose elements are all 1, The edge elements in the denoised variable are located. The locations of smoothing elements in the denoised variable are located.
[0046] In a second aspect, the present invention provides an image super-resolution system based on a gradient optimized diffusion model, which is applied to the image super-resolution method based on a gradient optimized diffusion model, including a denoising process construction module, a consistency constraint calculation module, a consistency constraint scaling module, a gradient optimization module, a positioning fusion module and an image generation module;
[0047] The denoising process building module is used to project the pixel space into a low-dimensional latent space and establish a denoising and reconstruction process of a conditional diffusion model in the latent space;
[0048] The consistency constraint calculation module is used to calculate the consistency constraint between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process to obtain a consistency constraint matrix P;
[0049] The consistency constraint scaling module is used to dynamically scale the consistency constraint between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process to obtain a locally scaled consistency constraint Q;
[0050] The gradient optimization module is used to use a gradient optimization method to enhance the representation consistency between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process;
[0051] The positioning fusion module is used to extract the contour mask of the input low-resolution image as positioning guidance information at each time step of the denoising and reconstruction process, thereby fusing the denoising variables before and after the gradient optimization;
[0052] The image generation module is used to project the potential representation of the denoising variable obtained after completing the denoising steps into the pixel space through the pre-trained decoder to obtain a high-resolution denoised image.
[0053] In a third aspect, the present invention provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the image super-resolution method based on the gradient optimized diffusion model.
[0054] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0055] 1. The present invention uses prior knowledge to guide the learning process of the model and introduces consistency constraints between the denoising intermediate variables and the input low-resolution image, so that the denoising and reconstruction process will not deviate from the prior knowledge. At the same time, it helps the model to reduce the solution space of the image super-resolution problem and prevent instability and inconsistency problems caused by unreasonable denoising and reconstruction.
[0056] 2. The present invention dynamically adjusts the degree of consistency constraints by means of local scaling, so that the model can flexibly adjust the strength of consistency constraints according to the degree of inconsistency in different feature areas, thereby balancing global consistency and local adaptability and better preserving the structure and detail information of the image.
[0057] 3. The present invention uses contour information to strengthen the positioning guidance of the gradient optimization method, so that the model's correction of image details is concentrated in key areas, which helps prevent the model from excessively intervening in other parts of the image, thereby maintaining the overall consistency of the image and improving the processing efficiency of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0059] Figure 1 This is a flow chart of an image super-resolution method based on a gradient optimized diffusion model according to an embodiment of the present invention;
[0060] Figure 2 It is a model framework diagram of an embodiment of the present invention;
[0061] Figure 3 4 is a block diagram of an image super-resolution system based on a gradient optimized diffusion model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0063] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0064] The diffusion model is a model that gradually denoises data from pure noise data through neural network learning.
[0065] Gradient optimization is a method of updating the input data in the direction of minimizing the objective function by calculating the gradient of the objective function with respect to the input data.
[0066] Image super-resolution is a technique that increases image details and clarity by converting low-resolution images into high-resolution images.
[0067] like Figure 1 As shown, Figure 2 As shown, this implementation provides an image super-resolution method based on a gradient optimized diffusion model, comprising the following steps:
[0068] A. Project the pixel space to a low-dimensional latent space and establish the denoising and reconstruction process of the conditional diffusion model in the latent space.
[0069] Furthermore, the specific A comprises the following steps:
[0070] A1. In the image super-resolution task, a low-resolution image is input. The preprocessing process of the conditional diffusion model on the conditional information is as follows: the input low-resolution image y is passed through the pre-trained encoder Projecting to a low-dimensional latent space to obtain a potential representation of the low-resolution image ;
[0071] A2. According to the standard Gaussian distribution Randomly sampled values , random Gaussian noise As the starting input of the denoising and reconstruction process of the conditional diffusion model;
[0072] A3. Combine the latent representation of the low-resolution image with random Gaussian noise After splicing, the data is input into the diffusion model, and the denoising and reconstruction process of the conditional diffusion model is iteratively performed according to the given denoising step number.
[0073] Furthermore, the denoising and reconstruction process of the conditional diffusion model in step A3 is specifically as follows:
[0074] This patent aims to solve the image super-resolution task. The denoising process of the conditional diffusion model used is a Gaussian noise As a starting point, take the latent representation of the input low-resolution image As input conditions, the process of step-by-step denoising and reconstruction in accordance with the Markov chain is carried out by iterative execution of T time steps to obtain a series of denoised variables , the denoising process is as follows:
[0075] ,
[0076] in, is the denoised variable at the tth time step, is a real noise-free image, is the preset attenuation coefficient, , I represents the identity matrix; since There is an unknown , the build parameters are Neural Network Approximate the denoising process:
[0077] , ,
[0078] The learnable covariance , the learnable mean , is the noise predicted by the neural network.
[0079] In summary, according to Derivation It is expressed as: ,in is the random noise introduced at each step; according to Derivation immediately indicates It can be expressed as: .
[0080] B. At each time step of the denoising and reconstruction process, the consistency constraints between the denoising intermediate variables and the input low-resolution image are calculated.
[0081] Furthermore, the step B is specifically as follows:
[0082] B1. Immediate representation of the denoising process calculation Through the pre-trained decoder Projected into pixel space, we get the immediate representation of the reconstruction ;
[0083] B2. Immediate representation of reconstruction Through the bicubic interpolation function Downsampling to get a low-resolution immediate representation ;
[0084] B3. In order to use prior knowledge to guide the learning process of the model, the consistency constraint between the denoising intermediate variable and the input low-resolution image is introduced so that the denoising and reconstruction process will not deviate from the prior knowledge. Specifically, the low-resolution immediate representation The Euclidean norm is calculated with the input low-resolution image y to obtain the consistency constraint P as follows:
[0085] ,
[0086] Where y is the input low-resolution image representation, represents the decoder network, Represents the bicubic interpolation function.
[0087] C. At each time step of the denoising and reconstruction process, dynamically scale the consistency constraints between the denoising intermediate variables and the input low-resolution image.
[0088] Furthermore, the step C is specifically as follows:
[0089] C1. Obtain the consistency constraint matrix P according to step B, sort the elements in the matrix according to the size of the value, and obtain the topK element values and their indexes;
[0090] C2. Dynamically adjust the consistency constraint through local scaling, so that the model can flexibly adjust the strength of the consistency constraint according to the degree of inconsistency in different feature areas, thereby balancing global consistency and local adaptability. Specifically, a linear transformation equation group is constructed, and the topK element values are linearly scaled to a new matrix with given upper and lower bounds, while the remaining element values remain unchanged, to obtain the consistency constraint Q after local scaling.
[0091] Furthermore, the step C2 is specifically as follows:
[0092] Assume that the topK elements sorted in step C1 are ,in represents the maximum value among K elements, Represents the minimum value among K elements, according to the given upper bound and the lower bound Construct the linear transformation equations:
[0093] , ,
[0094] in and is the unknown coefficient, and the above equations are combined to solve the coefficient and .
[0095] The calculated coefficients and Perform a linear transformation on the above K elements to map them into the new coordinate system: ,in is the new element after mapping. In the original consistency constraint matrix, the elements other than the topK elements keep their values unchanged, and only the topK element values are updated to the new element values after mapping, and the consistency constraint Q after local scaling is obtained.
[0096] D. At each time step of the denoising and reconstruction process, a gradient optimization method is used to enhance the representation consistency between the denoising intermediate variables and the input low-resolution image.
[0097] Furthermore, the step D specifically includes:
[0098] D1. Based on the locally scaled consistency constraint Q obtained in step C, calculate the denoised variable at the tth time step. Gradient ;
[0099] D2, denoised variable at the t-1th time step obtained in step A3 , and the gradient obtained in step D1, the denoised variable of the t-1th time step The value of is further updated to , as shown below: ,in is the step size constant for gradient updates.
[0100] E. At each time step of the denoising and reconstruction process, the contour mask of the input low-resolution image is extracted as the positioning guidance information to fuse the denoising variables before and after gradient optimization.
[0101] Furthermore, the step E specifically includes:
[0102] E1. In order to make the model focus on the key areas to correct the image details and prevent the model from excessively interfering with other parts of the image, the Canny edge detection operator is used to extract the contour mask matrix M of the input low-resolution image as positioning guidance information;
[0103] E2, the denoised variable at the t-1th time step is finally expressed as , where E represents a matrix whose elements are all 1, The edge elements in the denoised variable are located. The locations of smoothing elements in the denoised variable are located.
[0104] F. Iterate steps BE until the denoising steps are completed. The latent representation of the denoised variable obtained after the denoising steps are completed is projected into the pixel space through the pre-trained decoder to obtain a high-resolution denoised image.
[0105] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.
[0106] Based on the same idea as the image super-resolution method based on the gradient optimized diffusion model in the above embodiment, the present invention also provides an image super-resolution system based on the gradient optimized diffusion model, which can be used to execute the above image super-resolution method based on the gradient optimized diffusion model. For ease of explanation, the structural schematic diagram of the embodiment of the image super-resolution system based on the gradient optimized diffusion model only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than the illustrated structure, or combine certain components, or arrange the components differently.
[0107] See also Figure 3 In another embodiment of the present application, there is provided an image super-resolution system 100 based on a gradient optimized diffusion model, the system comprising a denoising process construction module 101, a consistency constraint calculation module 102, a consistency constraint scaling module 103, a gradient optimization module 104, a positioning fusion module 105 and an image generation module 106;
[0108] The denoising process construction module 101 is used to project the pixel space into a low-dimensional latent space and establish a denoising and reconstruction process of a conditional diffusion model in the latent space;
[0109] The consistency constraint calculation module 102 is used to calculate the consistency constraint between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process to obtain a consistency constraint matrix P;
[0110] The consistency constraint scaling module 103 is used to dynamically scale the consistency constraint between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process to obtain a locally scaled consistency constraint Q;
[0111] The gradient optimization module 104 is used to use a gradient optimization method to enhance the representation consistency between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process;
[0112] The positioning fusion module 105 is used to extract the contour mask of the input low-resolution image as positioning guidance information at each time step of the denoising and reconstruction process, thereby fusing the denoising variables before and after the gradient optimization;
[0113] The image generation module 106 is used to project the latent representation of the denoising variable obtained after completing the denoising steps to the pixel space through the pre-trained decoder to obtain a high-resolution denoised image.
[0114] It should be noted that the image super-resolution system based on the gradient optimized diffusion model of the present invention corresponds one-to-one to the image super-resolution method based on the gradient optimized diffusion model of the present invention. The technical features and beneficial effects described in the embodiment of the image super-resolution method based on the gradient optimized diffusion model are applicable to the embodiment of the image super-resolution based on the gradient optimized diffusion model. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.
[0115] In addition, in the implementation of the image super-resolution system based on the gradient optimized diffusion model in the above embodiment, the logical division of each program module is only an example. In actual applications, the above functions can be assigned to different program modules as needed, for example, for the convenience of corresponding hardware configuration requirements or software implementation. That is, the internal structure of the image super-resolution system based on the gradient optimized diffusion model is divided into different program modules to complete all or part of the functions described above.
[0116] In another embodiment of the present application, a program is provided, and when the program is executed by a processor, the image super-resolution method based on the gradient optimized diffusion model is implemented, specifically:
[0117] A. Project the pixel space to a low-dimensional latent space and establish the denoising and reconstruction process of the conditional diffusion model in the latent space;
[0118] B. At each time step of the denoising and reconstruction process, the consistency constraints between the denoising intermediate variables and the input low-resolution image are calculated to obtain the consistency constraint matrix P;
[0119] C. At each time step of the denoising and reconstruction process, dynamically scale the consistency constraint between the denoising intermediate variable and the input low-resolution image to obtain the locally scaled consistency constraint Q;
[0120] D. At each time step of the denoising and reconstruction process, a gradient optimization method is used to enhance the representation consistency between the denoising intermediate variable and the input low-resolution image;
[0121] E. At each time step of the denoising and reconstruction process, the contour mask of the input low-resolution image is extracted as positioning guidance information, thereby fusing the denoising variables before and after gradient optimization;
[0122] F. Iterate steps BE until the denoising steps are completed. The latent representation of the denoised variable obtained after the denoising steps are completed is projected into the pixel space through the pre-trained decoder to obtain a high-resolution denoised image.
[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0124] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0125] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. An image super-resolution method based on a gradient optimized diffusion model, characterized in that: The steps include: A. Project the pixel space to a low-dimensional latent space and establish the denoising and reconstruction process of the conditional diffusion model in the latent space; B. At each time step of the denoising and reconstruction process, the consistency constraint between the denoising intermediate variable and the input low-resolution image is calculated to obtain the consistency constraint P; C. At each time step of the denoising and reconstruction process, dynamically scale the consistency constraint between the denoising intermediate variable and the input low-resolution image to obtain the locally scaled consistency constraint Q; D. At each time step of the denoising and reconstruction process, a gradient optimization method is used to enhance the representation consistency between the denoising intermediate variable and the input low-resolution image; E. At each time step of the denoising and reconstruction process, the contour mask of the input low-resolution image is extracted as positioning guidance information, thereby fusing the denoising variables before and after gradient optimization; F. Iterate steps BE until the denoising steps are completed, and project the latent representation of the denoised variable obtained after the denoising steps are completed into the pixel space through the pre-trained decoder to obtain a high-resolution denoised image; The step A is specifically as follows: A1. In the image super-resolution task, a low-resolution image is input. The preprocessing process of the conditional diffusion model on the conditional information is as follows: the input low-resolution image y is passed through the pre-trained encoder Projecting to a low-dimensional latent space to obtain a potential representation of the low-resolution image ; A2. According to the standard Gaussian distribution Randomly sampled values , random Gaussian noise As the starting input of the denoising and reconstruction process of the conditional diffusion model; A3. Combine the latent representation of the low-resolution image with random Gaussian noise After splicing, input the diffusion model and denoise according to the given method; In step A3, the denoising and reconstruction process of the conditional diffusion model is specifically as follows: The denoising process of the conditional diffusion model is a Gaussian noise As a starting point, take the latent representation of the input low-resolution image As input conditions, the process of step-by-step denoising and reconstruction in accordance with the Markov chain is carried out by iterative execution of T time steps to obtain a series of denoised variables , the denoising process is as follows: , in, is the denoised variable at the tth time step, is a real noise-free image, is the preset attenuation coefficient, , I represents the identity matrix; since There is an unknown , the build parameters are Neural Network Approximate the denoising process: , , The learnable covariance , the learnable mean , The noise predicted by the neural network; In summary, according to Derivation It is expressed as: ,in is the random noise introduced at each step; according to Derivation immediately indicates for: .
2. The image super-resolution method based on the gradient optimized diffusion model according to claim 1, characterized in that: The step B is specifically as follows: B1. Immediate representation of the denoising process calculation Through the pre-trained decoder Projected into pixel space, we get the immediate representation of the reconstruction ; B2. Immediate representation of reconstruction Through the bicubic interpolation function Downsampling to get a low-resolution immediate representation ; B3. Immediately display low-resolution The Euclidean norm is calculated with the input low-resolution image y to obtain the consistency constraint matrix P, as shown below: , where y is the input low-resolution image representation, represents the decoder network, Represents the bicubic interpolation function.
3. The image super-resolution method based on the gradient optimized diffusion model according to claim 1, characterized in that: The step C is specifically as follows: C1. According to the consistency constraint matrix P, sort the elements in P according to the size of the value to obtain the topK element values and their indexes; C2. Dynamically adjust the consistency constraint through local scaling method to balance the trade-off between denoising and detail retention. Specifically, construct a set of linear transformation equations, linearly scale the topK element values to a new matrix with given upper and lower bounds, and keep the remaining element values unchanged to obtain the consistency constraint Q after local scaling.
4. The image super-resolution method based on the gradient optimized diffusion model according to claim 3, characterized in that: The step C2 is specifically as follows: The topK element values obtained by sorting the consistency constraint matrix P are , the topK element values include the maximum value among the K elements The minimum value among the K elements , according to the given upper bound and the lower bound Construct the linear transformation equation system: , , in and is the coefficient to be determined; The calculated coefficients and Perform a linear transformation on the above K elements to map them into the new coordinate system: ,in is the new element after mapping; In the original consistency constraint matrix, the elements except the topK elements keep their values unchanged, and only the topK element values are updated to the new element values after mapping, so as to obtain the consistency constraint Q after local scaling.
5. The image super-resolution method based on the gradient optimized diffusion model according to claim 1, characterized in that: The step D is specifically as follows: D1. According to the locally scaled consistency constraint Q, calculate the denoising variable at the tth time step Gradient ; D2, denoised variable at the t-1th time step obtained in step A3 , and the gradient obtained in step D1, the denoised variable of the t-1th time step The value of is further updated to , as shown below: ,in is the step size constant for gradient updates.
6. The image super-resolution method based on the gradient optimized diffusion model according to claim 5, characterized in that: The step E is specifically as follows: E1. Use edge detection operator to extract the contour mask matrix M of the input low-resolution image y as positioning guidance information; E2, the denoised variable at the t-1th time step is finally expressed as , where E represents a matrix whose elements are all 1, The edge elements in the denoised variable are located. The locations of smoothing elements in the denoised variable are located.
7. An image super-resolution system based on a gradient optimized diffusion model, characterized in that: The image super-resolution method based on the gradient optimized diffusion model applied to any one of claims 1-6 comprises a denoising process construction module, a consistency constraint calculation module, a consistency constraint scaling module, a gradient optimization module, a positioning fusion module and an image generation module; The denoising process building module is used to project the pixel space into a low-dimensional latent space and establish a denoising and reconstruction process of a conditional diffusion model in the latent space; The consistency constraint calculation module is used to calculate the consistency constraint between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process to obtain a consistency constraint matrix P; The consistency constraint scaling module is used to dynamically scale the consistency constraint between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process to obtain a locally scaled consistency constraint Q; The gradient optimization module is used to use a gradient optimization method to enhance the representation consistency between the denoising intermediate variable and the input low-resolution image at each time step of the denoising and reconstruction process; The positioning fusion module is used to extract the contour mask of the input low-resolution image as positioning guidance information at each time step of the denoising and reconstruction process, thereby fusing the denoising variables before and after the gradient optimization; The image generation module is used to project the potential representation of the denoising variable obtained after completing the denoising steps to the pixel space through the pre-trained decoder to obtain a high-resolution denoised image.
8. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the image super-resolution method based on the gradient optimized diffusion model described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Single-image super-resolution method combining contour enhancement and denoising statistical prior
CN112150354A
Image super-resolution reconstruction method and system based on diffusion model
CN117522694A
Nuclear magnetic resonance image super-resolution recovery method and model construction method
CN117611453A
Image super-resolution using gradient profile prior
US20100086227A1
