Image restoration method of enhanced conditional diffusion model based on dual-domain interactive Transform
By using a dual-domain interactive Transformer structure and a dual-domain self-attention and frequency-learnable feedforward network in image restoration, combined with wavelet transform and FFT, the problem of insufficient accuracy of noise estimation in the diffusion model is solved and higher image restoration is achieved. Performance and detail restoration effects.
Patent Information
- Application Number
- CN202410652803.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-24
AI Technical Summary
The existing diffusion model has insufficient noise estimation accuracy in image restoration, cannot fully capture the nuances of noise, and mainly focuses on the original pixel space, limiting the exploration of frequency features and affecting image restoration performance.
An enhanced conditional diffusion model based on dual-domain interactive Transformer is adopted. Through a combination of diffusion training and enhanced training, the dual-domain interactive Transformer structure is used for noise estimation. Combined with wavelet transform and FFT, multi-scale feature fusion in the frequency domain and spatial domain is achieved, and through Dual-domain self-attention and frequency-learnable feedforward networks capture dual-domain long-range dependencies.
The detail recovery fidelity and structural integrity of image restoration are improved, surpassing the performance of previous methods, achieving higher structural similarity and peak signal-to-noise ratio, and enhancing the performance of the model.
Smart Images

Figure CN118537249A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image restoration, and specifically relates to an image restoration method based on an enhanced conditional diffusion model of a dual-domain interactive Transformer. Background Art
[0002] Image restoration aims to reconstruct a clean image by removing various types of degradation, and plays an important role in multiple computer vision fields, such as autonomous driving and remote sensing image processing. The key to restoring an image is to remove noise and distortion without introducing additional artifacts. Therefore, image restoration is very important to ensure the performance of high-level vision tasks. Traditional image restoration methods rely on hand-crafted prior knowledge and cannot handle complex degradations. Most of the existing advanced image restoration methods are based on deep learning, including convolutional neural networks (CNNs) and transformer-based methods. The performance of image restoration has been significantly improved due to the powerful feature representation ability of neural networks and the emergence of large-scale paired datasets. Recently, diffusion models have been introduced into the field of image processing, providing a new perspective and method for image restoration. The inverse process of the diffusion model can be viewed as a denoising task, and accurate noise estimation enables the diffusion model to gradually generate rich details. However, the noise estimation of diffusion-based restoration methods relies on U-net, which may not fully capture the nuances required for noise estimation, thus affecting the performance of image restoration. In addition, most diffusion-based methods focus on predicting Gaussian noise in the original pixel space, which limits the exploration of image frequency features. Therefore, there is still much room for improvement in the noise estimation network in existing diffusion models.
[0003] To address these issues, the performance of diffusion models in image restoration can be enhanced by improving the accuracy of the noise estimation network. Frequency analysis has received much attention in computer vision, but most methods rely only on a single frequency analysis technique, such as Discrete Wavelet Transform (DWT) or Fast Fourier Transform (FFT). DWT provides a localized frequency representation by converting the signal into multiple frequency subbands. This enables the model to analyze the signal at multiple scales and distinguish between high-frequency noise components and low-frequency signal components. However, DWT lacks the fineness of the frequency resolution of FFT, making it less capable of selecting frequency components that are rich in information. The noise spectrum of FFT provides an effective way to analyze global frequency content, but it lacks multi-scale decomposition capabilities and fails to provide an effective sparse representation like DWT. Summary of the invention
[0004] In view of this, the object of the present invention is to provide an image restoration method based on an enhanced conditional diffusion model of a dual-domain interactive Transformer, the method comprising:
[0005] Step 1: Perform diffusion training, that is, perform forward denoising and reverse denoising on the clean image x0, and use the degraded image in the reverse denoising process As a conditional guide, a noise estimation network with parameter θ is used in the reverse denoising process. At time step t, the mean of the noise estimation network is in, represents the sampled image during the reverse denoising process at time step t,
[0006] During diffusion training, the loss function is used As the objective function, through continuous training, The minimum, among which, in, represents the mean, ||||1 represents the L1 norm, ε t represents the noise added when adding noise positively at time step t, represents the noise estimated by the noise estimation network at time step t;
[0007] Step 2: Perform enhanced training, that is, Gaussian noise Use the noise estimation network to denoise and get a clean image Using degraded images in the denoising process As a conditional guide, and the loss function As the objective function of the enhanced training phase, the parameter θ is further optimized.
[0008] in,
[0009]
[0010]
[0011] y represents the degraded image The real clean image, SSIM(x′,y′) represents the structural similarity of any two images x′ and y′, μ x and μ y Represent the mean of images x′ and y′ respectively, and Respectively represent the variance of images x′ and y′, σ xy represents the covariance of images x′ and y′, C1 and C2 are constants used to prevent instability when the denominator is close to zero, α is a hyperparameter, is the clean image obtained by final sampling;
[0012] Step 3: Use the trained noise estimation network to restore the degraded image to be restored.
[0013] Among them, the noise estimation network is a dual-domain interactive transformer structure, which includes a 3×3 first convolutional layer, an MFSIM module, 7 stacked DDITB modules and a 3×3 second convolutional layer in sequence according to the signal input direction. The MFSIM module is used to obtain multi-scale fusion features of frequency domain and spatial domain. The output of the first DDITB module is spliced with the output of the sixth DDITB module as the input of the seventh DDITB module, the output of the second DDITB module is spliced with the output of the fifth DDITB module as the input of the sixth DDITB module, and the output of the third DDITB module is spliced with the output of the fourth DDITB module as the input of the fifth DDITB module.
[0014] Furthermore, for the clean image x0, the variance sequence is {β1,β2,…,β T} is forwardly added with Gaussian noise to generate a noisy image x after T time steps. T , the noisy image x T Close to Gaussian noise, the process of forward noise addition is expressed by the formula:
[0015]
[0016]
[0017] Among them, q represents the conditional probability distribution, t represents the time step, represents Gaussian distribution, I represents the identity matrix, x t represents the image at time step t.
[0018] Furthermore, the reverse denoising process is Start learning Gaussian denoising transformation and use degraded images As a condition, the process of reverse denoising is expressed as:
[0019]
[0020]
[0021] in, α t =1-β t , represents the sampled image at time step t, represents the noise variance at time step t, represents the mean of the noise estimation network at time step t, represents the noise estimated by the noise estimation network at time step t.
[0022] Furthermore, the MFSIM module includes a frequency domain unit and a space unit. In the frequency domain unit, multi-scale frequency domain features are obtained by wavelet transform; the space unit includes three branches, which use convolution kernels of sizes 3×3, 5×5 and 7×7 to extract multi-scale spatial features respectively. The output of the frequency domain unit is used as the input of the space unit, thereby realizing the interaction and fusion of frequency domain and space domain features.
[0023] Furthermore, the DDITB module includes a dual-domain self-attention unit and a frequency-domain learnable feedforward network. The DDITB module processes the input feature F in Perform layer normalization and use sinusoidal position encoding to convert time step t into time embedding T′. in It is added to the time embedding T′ and input into the dual-domain self-attention unit. The dual-domain self-attention unit performs attention calculations on the input in the frequency domain and the spatial domain respectively to obtain the output of the dual-domain self-attention unit. The output of the dual-domain self-attention unit is input into the frequency domain learnable feedforward network together with the time embedding T′ after layer regularization.
[0024] The calculation process of the DDITB module is expressed as follows:
[0025] F in ′=DDSA(LN(F in )+T′)+F in ,
[0026] F out =FLFFN(LN(F in ′)+T′)+F in ′,
[0027] Among them, F in represents the input of the DDITB module, LN(·) represents layer normalization, DDSA(·) represents the operation of the dual-domain self-attention unit, FLFFN(·) represents the operation of the frequency-domain learnable feedforward network, and F in ′ represents the output of the dual-domain self-attention unit, F out Represents the output of the DDITB module.
[0028] Furthermore, the dual-domain self-attention unit performs attention calculations on the input in the frequency domain and the spatial domain respectively, specifically including:
[0029] Input feature X to the dual-domain self-attention unit in The temporal embedding applies 1×1 point-wise convolution and 3×3 depth-wise convolution to generate three matrices: query Q, key K, and value V.
[0030] The calculation process of dual-domain self-attention is expressed as follows:
[0031] DDSA=Concat[DDSA f (Q,K,V),DDSA s (Q,K,V)]+X in ,
[0032] in,
[0033]
[0034]
[0035]
[0036]
[0037]
[0038] DDSA f (·) and DDSA s (·) represent the operations of DDSA in the frequency domain and spatial domain respectively, Concat[·] represents the concatenation operation, and W p and W d They represent 1×1 point-by-point convolution kernels and 3×3 depth convolution kernels, respectively, with superscripts Q, K, and V added to W. p and W d where represent the weights when finding the query Q, key K and value V, respectively, β represents a learnable scaling parameter, represents the Fast Fourier Transform FFT, represents the inverse fast Fourier transform IFFT, Represents the conjugate transpose of the fast Fourier transform.
[0039] Furthermore, the frequency domain learnable feedforward network performs the following operations:
[0040] Enter X i ' n After layer normalization, add time embedding and split into X f and X s , that is, X f ,X s =Split(LN(X i ' n )+T′), Split(·) represents the split operation;
[0041] X fInput to the linear layer and transform to the frequency domain through FFT, multiply the frequency domain result by the learnable weight W element by element, then transform back to the spatial domain through IFFT, and then generate X′ after GELU activation and linear layer. f ,Right now represents the Fast Fourier Transform FFT, Indicates the inverse fast Fourier transform IFFT, Conv 1×1 Represents a 1×1 convolution of a linear layer;
[0042] X s After a linear layer, GELU activation and a linear layer, X is generated. s ′, that is, X s ′=Conv 1×1 (GELU(Conv 1×1 (X s )));
[0043] X′ f and X s ' to connect, plus input X i ' n The output of the frequency domain learnable feedforward network is obtained, namely FLFFN(X i ' n ) = Concat[X′ f ,X s ′]+X i ' n .
[0044] The beneficial effects of the present invention are:
[0045] 1. This paper proposes a novel conditional diffusion framework designed for accurate pixel-level image restoration. It demonstrates state-of-the-art performance in multiple image restoration tasks, and its restored image details and structural integrity surpass previous methods;
[0046] 2. By introducing an enhanced training strategy, we improve the detail recovery fidelity of the diffusion model;
[0047] 3. The present invention proposes a multi-scale frequency-space interaction module (MFSIM) for effective dual-domain local feature fusion. The present invention also integrates wavelet transform and FFT into the same framework, which retains the global frequency content of FFT and has the multi-scale analysis capability of wavelet transform.
[0048] 4. The dual-domain interactive Transformer of the present invention designs dual-domain self-attention (DDSA) and frequency-learnable feedforward network (FLFFN) to capture the dual-domain long-distance dependency, effectively enhancing the model performance.
[0049] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:
[0051] Figure 1 This is a schematic diagram of the overall framework structure of Reffusion;
[0052] Figure 2 It is a schematic diagram of the multi-scale frequency-space interaction module;
[0053] Figure 3 (a) is a schematic diagram of the dual-domain interaction Transformer block;
[0054] Figure 3 (b) is a schematic diagram of a dual-domain self-attention unit;
[0055] Figure 3 (c) is a schematic diagram of a frequency learnable feedforward network;
[0056] Figure 4 It is the result of low illumination enhancement qualitative experiment;
[0057] Figure 5 This is the qualitative experimental result of rain streak removal;
[0058] Figure 6 It is the qualitative experimental result of raindrop removal;
[0059] Figure 7 This is the qualitative experimental result of image snow removal;
[0060] Figure 8 It is the visualization result of night target detection;
[0061] Fig. 9 This is the ablation comparison experiment result of enhanced training;
[0062] Fig.10 This is the comparison result of different sampling steps. DETAILED DESCRIPTION
[0063] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the preferred embodiments are only for illustrating the present invention, rather than for limiting the protection scope of the present invention.
[0064] The present invention provides an image restoration method based on an enhanced conditional diffusion model of a dual-domain interactive Transformer, the method comprising:
[0065] Step 1: Perform diffusion training, that is, perform forward denoising and reverse denoising on the clean image x0, and use the degraded image in the reverse denoising process To guide as a condition;
[0066] Step 2: Perform enhanced training. During enhanced training, only the reverse process is used, that is, Gaussian noise Use the noise estimation network to denoise and get a clean image Using degraded images in the denoising process As a conditional guide, and the loss function As the objective function of the enhanced training phase, the parameter θ is further optimized;
[0067] Step 3: Use the trained noise estimation network to restore the degraded image to be restored.
[0068] The diffusion model is essentially a Markov chain, which includes a forward diffusion (i.e., forward denoising) process and a reverse denoising process. The variance sequence is {β1,β2,…,β T} is forwardly added with Gaussian noise to generate a noisy image x after T time steps. T , the noisy image x T Close to Gaussian noise, H and W represent the height and width of the image, and C represents the number of image channels, which is usually 3.
[0069] The process of forward noise addition is expressed as follows:
[0070]
[0071]
[0072] Among them, q represents the conditional probability distribution, t represents the time step, represents Gaussian distribution, I represents the identity matrix, x t represents the image at time step t.
[0073] The reverse denoising process is Start learning Gaussian denoising transformation and gradually move from completely Gaussian noise Restore to a clear image
[0074] The denoising process is expressed as follows:
[0075]
[0076]
[0077] in, is the final sampled clear image, represents the image sampled at time t.
[0078] Since the original diffusion model is unconditional and the details of the generated image are uncontrollable, it is not suitable for image restoration tasks. Therefore, the degraded image is introduced in the present invention. As a condition to guide the diffusion model. After that, the final distribution of the sampled images is highly subject to the condition Thus, pixel-level image restoration is achieved.
[0079] When using degraded images After being introduced as a condition, at time step t, the mean of the noise estimation network is, and the reverse denoising process can be re-expressed as follows:
[0080]
[0081]
[0082] in, In order to optimize the parameters of the noise estimation network, the present invention reparameterizes α t =1-β t , represents the sampled image at time step t, represents the noise variance at time step t, represents the mean of the noise estimation network at time step t, represents the noise estimated by the noise estimation network at time step t.
[0083] The final training objective can be expressed as:
[0084]
[0085] Through experiments, it can be found that the conditional diffusion model achieves higher structural similarity (SSIM), indicating that it is superior in overall image structure recovery, but due to the lack of pixel-level detail recovery and low fidelity, its peak signal-to-noise ratio (PSNR) is low. Therefore, after the diffusion model is trained, the present invention introduces enhanced training to improve the pixel and detail recovery performance. In the enhanced training stage, only the reverse process is used to sample clean images from the degraded images, and the network parameters θ are further optimized by calculating the loss between the sampled images and the real images. The new conditional diffusion framework proposed in the present invention is also called the Reffusion framework. The overall framework of Reffusion is as follows Figure 1 The training and inference processes are described in detail in Algorithms 1 and 2, respectively.
[0086] During diffusion training, the loss function is used As the objective function, through continuous training, The minimum, among which, in, represents the mean, ||||1 represents the L1 norm, ε t represents the noise added when adding noise positively at time step t, represents the noise estimated by the noise estimation network at time step t.
[0087] In the enhanced training, only the reverse process is used during the enhanced training, that is, Gaussian noise Use the noise estimation network to denoise and get a clean image Using degraded images in the denoising process As a conditional guide, and the weighted hybrid loss function As the objective function of the enhanced training phase, the parameter θ is further optimized.
[0088] in,
[0089]
[0090]
[0091] y represents the degraded image The real clean image, SSIM(x′,y′) represents the structural similarity of any two images x′ and y′, μ x and μ y Represent the mean of images x′ and y′ respectively, and Respectively represent the variance of images x′ and y′, σ xyrepresents the covariance of images x′ and y′, C1 and C2 are constants used to prevent instability when the denominator is close to zero, and α is a hyperparameter that can be set to 0.15.
[0092]
[0093]
[0094] In some embodiments of the present invention, the noise estimation network is a dual domain interaction transformer (ie, Dual Domain Interaction Transformer, DDIT) structure.
[0095] like Figure 1 The dual-domain interactive transformer structure shown in the figure includes a 3×3 first convolutional layer, an MFSIM module, 7 stacked DDITB modules, and a 3×3 second convolutional layer in the direction of signal input. The stacked DDITB modules and the second convolutional layer form a hierarchical codec. The input of the dual-domain interactive transformer structure is obtained by adding noise. The noise image x at time step t is obtained t With conditions Connect to get
[0096] The output of the MFSIM module is used as the input of the first DDITB module, the output of the first DDITB module is used as the input of the second DDITB module, the output of the second DDITB module is used as the input of the third DDITB module, and the output of the third DDITB module is used as the input of the fourth DDITB module. At the same time, the output of the first DDITB module is concatenated with the output of the sixth DDITB module as the input of the seventh DDITB module, the output of the second DDITB module is concatenated with the output of the fifth DDITB module as the input of the sixth DDITB module, the output of the third DDITB module is concatenated with the output of the fourth DDITB module as the input of the fifth DDITB module, and the output of the seventh DDITB module is input into the second 3×3 convolution layer. After a series of processing, the residual image is obtained. The output of the second convolution layer (i.e., the residual image) is concatenated with x t Add element by element to get the final noise The first three DDITB modules are encoders, the middle one is the bottleneck layer, and the last three DDITB modules are decoders. The decoders and encoders at the same level are connected by jump connections. Among them, the first DDITB module and the seventh DDITB module are also called the first-level encoder and decoder, respectively; the second DDITB module and the sixth DDITB module are also called the second-level encoder and decoder, respectively; the third DDITB module and the fifth DDITB module are also called the third-level encoder and decoder, respectively; the fourth DDITB module is the bottleneck layer. Among them, each level of codec can contain any suitable number of DDITBs, such as 4, 6, 8, etc. For the convenience of representation in the figure, each DDITB module only shows one DDITB, which does not constitute a limitation of the present invention. In some embodiments, the number of encoders and decoders of the first level may be 4, i.e., the first DDITB module contains 4 DDITBs constituting an encoder, and the seventh DDITB module contains 4 DDITBs constituting a decoder; the number of encoders and decoders of the second level may be 6, i.e., the second DDITB module contains 6 DDITBs constituting an encoder, and the sixth DDITB module contains 6 DDITBs constituting a decoder; the number of encoders and decoders of the third level may be 6, i.e., the third DDITB module contains 6 DDITBs constituting an encoder, and the fifth DDITB module contains 6 DDITBs constituting a decoder; the fourth DDITB module contains 8 DDITBs.
[0097] The MFSIM module, namely the Mult-Scale Frequency Spatial Interaction Module, is a multi-scale frequency domain (or frequency) spatial interaction module, which is used to obtain multi-scale fusion features of the frequency domain and spatial domain. Figure 2 is a schematic diagram of the multi-scale frequency-space interaction module. Figure 2 As shown, the MFSIM module sampled by the present invention includes a frequency domain unit and a space unit, thereby adopting a multi-scale design in both the space and frequency domains to enhance the local representation.
[0098] Specifically, in the frequency domain unit, a wavelet transform (such as 2D-DWT or Haar wavelet) is used to obtain multi-scale frequency domain features, which decomposes and downsamples the original image into low-frequency and high-frequency sub-bands XLL, {XLH, XHL, XHH} through a set of low-pass and high-pass filters. XLL represents the low-frequency sub-band, which contains the approximate information of the input image. {XLH, XHL, XHH} represent the high-frequency sub-bands in the horizontal, vertical and diagonal directions, respectively, which contain the details of the image structure and texture. In order to make full use of the ability of wavelet transform to perform high and low frequency decomposition, the present invention combines convolution with discrete wavelet transform to guide the network to explore between different frequency sub-bands.
[0099] The spatial unit consists of three branches, which use convolution kernels of sizes 3×3, 5×5 and 7×7 to extract multi-scale spatial features. The output of the frequency domain unit is used as the input of the spatial unit, thereby realizing the interaction and fusion of frequency domain and spatial domain features.
[0100] In some embodiments of the present invention, the DDITB module (such as Figure 3 (a)) includes dual-domain self-attention units (such as Figure 3 (b)) and frequency-domain learnable feedforward networks (e.g. Figure 3 (b)).
[0101] DDITB module, namely Dual Domain Interaction Transformer Block, is also called dual domain interaction transformer block. Since the noise estimation in the diffusion model is highly correlated with the time step, the time step t is introduced into DDITB in the present invention and used as input after embedding. Figure 3 As shown in (a), this module processes the input feature F in ∈R H×W×C Perform layer normalization and use sinusoidal position encoding to transform time step t into a temporal embedding T′∈R 1×1×C , the input feature F after layer normalization in It is added to the time embedding T′ and input into the dual-domain self-attention unit. The dual-domain self-attention unit performs attention calculations on the input in the frequency domain and spatial domain respectively to obtain the output of the dual-domain self-attention unit. The output of the dual-domain self-attention unit is input into the frequency domain learnable feedforward network together with the time embedding T′ after layer regularization.
[0102] The calculation process of the DDITB module is expressed as follows:
[0103] F in ′=DDSA(LN(F in )+T′)+F in ,
[0104] F out =FLFFN(LN(F in ′)+T′)+F in ′,
[0105] Among them, F in represents the input of the DDITB module, LN(·) represents layer normalization, DDSA(·) represents the operation of the dual-domain self-attention unit, FLFFN(·) represents the operation of the frequency-domain learnable feedforward network, and F in ′ represents the output of the dual-domain self-attention unit, F out Represents the output of the DDITB module.
[0106] In order to fully explore the characteristics of frequency domain and spatial domain, the present invention designs a dual-domain self-attention unit, namely DualDomain Self-Attention, DDSA. Figure 3 (b) as shown.
[0107] DDSA performs attention calculations on the input in the frequency domain and spatial domain respectively, including:
[0108] Input feature X to the dual-domain self-attention unit in ( Among them, X in =LN(F in )+T′) and time embedding Apply 1×1 point-wise convolution and 3×3 depth convolution to generate three matrices: query Q, key K, and value V.
[0109] The calculation process of dual-domain self-attention is expressed as follows:
[0110] DDSA=Concat[DDSA f (Q,K,V),DDSA s (Q,K,V)]+X in ,
[0111] in,
[0112]
[0113]
[0114]
[0115]
[0116]
[0117] DDSA f (·) and DDSA s (·) represent the operations of DDSA in the frequency domain and spatial domain respectively, Concat[·] represents the concatenation operation, and W p and W d They represent 1×1 point-by-point convolution kernels and 3×3 depth convolution kernels, respectively, with superscripts Q, K, and V added to W. p and W d where represent the weights when finding the query Q, key K and value V, respectively, and β represents a learnable scaling parameter for controlling the magnitude of the dot product of K and Q. Given that the convolution in the spatial domain is equivalent to the point-to-point multiplication in the frequency domain, the present invention uses Hadamard multiplication, i.e. ⊙, for the operation between Q, K and V in the frequency domain. represents the Fast Fourier Transform FFT, represents the inverse fast Fourier transform IFFT, represents the conjugate transpose of the fast Fourier transform, and the query Q and the key K are converted into frequency representation through the fast Fourier transform.
[0118] Feed-Forward Network (FFN) is one of the key components in the converter. However, not all low-frequency and high-frequency information is helpful for noise estimation, and simple FFN cannot effectively filter out this information. To solve this problem, the present invention proposes a frequency domain learnable feed-forward network (Frequency Learnable Feed-Forward Network, FLFFN), such as Figure 3 As shown in (c), by introducing a learnable weight, FLFFN is able to adaptively determine which valid frequency features should be retained. Similar to DDSA, the calculation process of FLFFN is also completed in the frequency and spatial domains. Specifically, the input is split along the channel, half of which is input to the linear layer and converted to the frequency domain through FFT. The resulting frequency features are element-wise multiplied with a learnable weight to adapt to the frequency feature space and data distribution to select valid frequency features. They are then converted back to the spatial domain through IFFT. After passing through GELU activation and linear layers, these recovered features are connected with the spatial features to form the final output.
[0119] Specifically, the frequency domain learnable feedforward network (FLFFN) performs the following operations:
[0120] Enter X i ' n After layer normalization, add time embedding and split into X f and X s , that is, X f ,X s =Split(LN(X i ' n )+T′), Split(·) represents the split operation;
[0121] X f Input to the linear layer and transform to the frequency domain through FFT, multiply the frequency domain result by the learnable weight W element by element, then transform back to the spatial domain through IFFT, and then generate X′ after GELU activation and linear layer. f ,Right now represents the Fast Fourier Transform FFT, Indicates the inverse fast Fourier transform IFFT, Conv 1×1 Represents a 1×1 convolution of a linear layer;
[0122] X s After a linear layer, GELU activation and a linear layer, X is generated. s ′, that is, X s ′=Conv 1×1 (GELU(Conv 1×1 (X s )));
[0123] X′ f and X s ' to connect, plus input X i ' n The output of the frequency domain learnable feedforward network is obtained, namely FLFFN(X i ' n ) = Concat[X′ f ,X s ′]+X i ' n .
[0124] In some embodiments of the present invention, a series of experiments are also implemented using PyTorch on a system equipped with an NVIDIA GeForce RTX 3090 GPU, using the AdamW optimizer. In the diffusion training phase, the initial learning rate is set to 2×10 -4 , the minimum learning rate is set to 1×10 -6 , the batch size used is 16. In the boost training phase, the initial learning rate is set to 1×10 -5 , the minimum learning rate is set to 1×10 -7 , the batch size used is 4. The entire training process uses a cosine annealing schedule for a total of 370,000 iterations. Patches of size 64×64 are randomly cropped from the image for training. The number of encoders and decoders at each level is set to {4, 6, 6, 8}, and the number of heads is set to {1, 2, 4, 8}. The total time step is 1000, and the forward process uses a linear variance schedule [0.0001, 0.02].
[0125] The methods of the present invention were evaluated on low-light image enhancement, image rain removal and snow removal tasks. For low-light image enhancement, each method was trained and tested on the LOL, LOLv2-real and LOLv2-synthetic datasets. For image rain removal, the Rain200H and Rain200L datasets were used for rain strip removal, and RainDrop was used for raindrop removal. In terms of image snow removal, Snow100K-S and Snow100K-L datasets were used for evaluation. PSNR and SSIM were used to quantitatively evaluate the performance of all methods in the above paired datasets from the perspective of pixels and structure. The higher the PSNR and SSIM values, the higher the quality and fidelity of the restored image. In addition, the weights pre-trained on LOL were used to compare the no-reference real datasets, including DICM, NPE, MEF and LIME datasets. The Natural Image Quality Evaluator (NIQE) was used to evaluate the perceptual quality of the no-reference results. NIQE reflects the naturalness of the image, and the lower the score, the higher the quality. In addition, in order to evaluate the performance of the proposed method in high-level vision tasks, object detection in low-light environments was performed on the ExDark dataset.
[0126] Table 1 shows the quantitative results on the low-light image enhancement datasets. The method of the present invention achieves the best performance on all three datasets. The arrows under each dataset in the first row of Table 1 indicate that the larger the value in the table, the better the performance of the corresponding method. Compared with other methods, the PSNR and SSIM scores of the present invention are at least 1.75dB and 0.034 higher on LOL, 0.18dB and 0.047 higher on LOLv2-real LOLv2-synthetic, and 0.75dB and 0.036 higher on LOLv2-synthetic.
[0127] Table 2 shows a quantitative comparison on four no-reference real datasets. The arrows under each dataset in the first row of Table 2 indicate that the smaller the NIQE value in the table, the better the performance of the corresponding method. The NIQE score is calculated using the default NIQE function in MatlabR2020b. Compared with the second best method, the method of the present invention reduces NIQE by 0.45. The results on the no-reference dataset show that the method of the present invention has better generalization ability for unseen scenes.
[0128] Table 1. Quantitative results of low-light image enhancement
[0129]
[0130]
[0131] Table 2. Quantitative results without reference dataset
[0132]
[0133] Figure 4 These are the results of the qualitative experiments on low-light enhancement, where 4(a) corresponds to the LOL dataset; 4(b) corresponds to the LOLv2-real dataset; and 4(c) corresponds to the LOLv2-synthetic dataset.
[0134] Figure 4 The qualitative results in show that URetinex-Net and SCI exhibit inaccurate exposure and color distortion, while SNR-Net and Retinexformer suffer from image blur and insufficient details. In contrast, our method (i.e., labeled “Ours”) performs well in exposure control, detail restoration, and color restoration, and is very close to the real situation. Based on quantitative and qualitative comparisons, it is clear that our method provides superior restoration results in both real and synthetic scenes, both at the structural and pixel levels.
[0135] Table 3 is the quantitative experimental results of rain streak removal, where it should be noted that the arrows under each data set in the first row of Table 3 indicate that the larger the value in the table, the better the performance of the corresponding method (the arrows in other tables also have similar meanings, that is, the upward arrow indicates that the larger the value, the better the performance of the corresponding method; the downward arrow indicates that the smaller the value, the better the performance of the corresponding method). As shown in Table 3, the method of the present invention has achieved the most advanced performance on the rain streak dataset. Compared with the best recent method DRSformer, the method of the present invention improves the PSNR by 0.17dB on Rain200L and 0.001 on SSIM; the PSNR on Rain200H is improved by 0.37dB and 0.0065 on SSIM.
[0136] Table 3 Quantitative experimental results of rain streak removal
[0137]
[0138] Figure 5 Shows a visual comparison of removing rain streaks, where Figure 5 (a) corresponds to the Rain200H dataset; Figure 5 (b) corresponds to the Rain200L dataset. Figure 5It can be seen that in the images of DualGCN and Restormer, the pixels at the junction of the zebra stripes appear blurred and contain artifacts. Thanks to the dual-domain based noise estimation network, Reffusion performs well in generating excellent details, that is, the results corresponding to the label "Ours". This advantage is particularly evident in its excellent rain streak removal effect, which is manifested in the sharpest edges, the highest level of detail recovery, and exceptional clarity, without residual rain streaks.
[0139] Table 4 is the quantitative results on the raindrop dataset. As shown in Table 4, the method of the present invention is the most effective in removing raindrops. Compared with the second best method, PSNR increases by 0.25dB and SSIM increases by 0.0033.
[0140] Table 4 Quantitative experimental results of raindrop removal
[0141]
[0142]
[0143] Figure 6 Visual results on the RainDrop dataset are shown. Our method (labeled “Ours”) performs well in completely removing raindrops, especially in areas heavily affected by raindrops, outperforming other methods.
[0144] Table 5 shows the quantitative experimental results of image snow removal. The results shown in Table 5 verify the state-of-the-art (SOTA) performance of the proposed method in the field of image snow removal. On Snow100K-S, the PSNR and SSIM of the proposed method are significantly better than those of other methods, by 0.45 dB and 0.0045 respectively; on Snow100K-L, by 0.48 dB and 0.0151 respectively.
[0145] Table 5 Quantitative experimental results of image snow removal
[0146]
[0147] Figure 7 Qualitative results on Snow100K-L are shown. Compared with SnowDiff64, the image restored by the proposed method (i.e., labeled “Ours”) is closer to the real situation, with sharper edges, better color restoration, and more detailed detail restoration.
[0148] In order to evaluate the effectiveness of the method of the present invention in advanced vision, low-light object detection was performed on the ExDark dataset. The dataset contains 12 categories of images, each of which is characterized by underexposure and accompanied by corresponding annotations. This embodiment divides it into training, validation and test sets with a ratio of 8:1:1, and uses YOLO-v5 as the detection network. Different methods are pre-trained on the LOL dataset as a preprocessing module of YOLO-v5. The results on ExDark are shown in Table 6.
[0149] Table 6 Low illumination target detection results
[0150]
[0151] As can be seen from Table 6, in all categories, the proposed method achieves the highest mean average precision (mAP), with an improvement of at least 0.025. The proposed method outperforms other methods in 10 out of 12 categories, with only slightly lower performance in the chair and table categories.
[0152] Figure 8 The qualitative results of nighttime object detection visualization on ExDark are shown. Figure 8 It can be seen that the results of SCI are overexposed, while SNR-Net is inferior to the method of the present invention (i.e., labeled "Ours") in terms of details and clarity. It is worth noting that the use of Reffusion enables the detection network to accurately detect all objects and provide accurate bounding box predictions. The results on the ExDark dataset demonstrate the effectiveness and generalization ability of the method of the present invention in advanced vision.
[0153] In order to verify the effectiveness of DDSA, FLFFN and MFSIM, some embodiments of the present invention use Restormer as the baseline V1, set up a control group, and conduct ablation experiments. It should be noted that all ablation experiments are completed on the Rain200H dataset and are consistent with the experimental settings in the previous article.
[0154] Table 7 is the effectiveness verification results of MFSIM, DDSA and FLFFN. The results in Table 7 show that after applying DDSA, FLFFN and MFSIM, the recovery performance is significantly improved. Compared with the baseline, the method of the present invention improves 1.06dB on PSNR and 0.0076 on SSIM, thereby verifying the effectiveness of DDSA, FLFFN and MFSIM.
[0155] Table 7 Validity verification results of MFSIM, DDSA and FLFFN
[0156] MFSIM DDSA FLFFN PSNR↑ SSIM↑ V1 × × × 31.3 0.9295 V2 √ × × 31.57 0.9297 V3 × √ × 32.13 0.9353 V4 × × √ 32.07 0.9322 V5 × √ √ 32.36 0.9371 V6 √ √ √ 32.55 0.9395
[0157] In order to verify the effectiveness of enhanced training, comparative experiments are also conducted in some embodiments of the present invention. Fig. 9 The visual comparison results of enhanced training are shown. After applying enhanced training, the PSNR value increases from 31.89dB to 32.55dB, and the SSIM increases from 0.9326 to 0.9395. This shows that enhanced training can effectively improve the fidelity and restoration performance of Reffusion.
[0158] In order to explore the influence of the sampling step length S on the recovery performance, some embodiments of the present invention use SNR, SSIM and sampling time as evaluation indicators, and conduct quantitative comparison experiments with different S. Fig.10 This is the comparison result of different sampling steps. The bubble size in the figure represents the required sampling time. Fig.10 The results shown in show that the best recovery performance occurs at S = 3, while the required sampling time is relatively short. Therefore, S = 3 can be selected as the default setting to achieve excellent recovery performance and relatively fast sampling speed.
[0159] Therefore, the present invention first proposes an enhanced conditional diffusion model framework for image restoration named Reffusion, which combines a dual-domain interactive transformer, by improving the noise estimation accuracy in the diffusion model. Then, a conditional diffusion model with an enhanced training strategy is introduced to achieve refined image restoration. Through the interaction between dual-domain features, the method of the present invention ensures accurate noise estimation, thereby improving the performance of the diffusion model in image restoration. Quantitative and qualitative experiments show that Reffusion exhibits state-of-the-art performance in three image restoration tasks. In addition, the evaluation is extended to low-light object detection, verifying the effectiveness of the method of the present invention in advanced vision. The method of the present invention provides a promising direction for improving the performance and applicability of multimedia in diverse and complex scenes.
[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. An image restoration method based on the enhanced conditional diffusion model of dual-domain interactive Transformer, It is characterized in that include: Step 1: Perform diffusion training, that is, for the clean image x 0 Perform forward denoising and reverse denoising, and use the degraded image in the reverse denoising process As a conditional guide, a noise estimation network with parameter θ is used in the reverse denoising process. At time step t, the mean of the noise estimation network is in, represents the sampled image during the reverse denoising process at time step t, During diffusion training, the loss function is used As the objective function, through continuous training, The minimum, among which, in, represents the mean, || || 1 represents the L1 norm, ε t represents the noise added when adding noise positively at time step t, represents the noise estimated by the noise estimation network at time step t; Step 2: Perform enhanced training, that is, Gaussian noise Use the noise estimation network to denoise and finally get a clean image Using degraded images in the denoising process As a conditional guide, and the loss function As the objective function of the enhanced training phase, the parameter θ is further optimized. in, y represents the degraded image The real clean image, SSIM(x′,y′) represents the structural similarity of any two images x′ and y′, μ x and μ y Represent the mean of images x′ and y′ respectively, and Respectively represent the variance of images x′ and y′, σ xy represents the covariance of images x′ and y′, C 1 and C 2 is a constant used to prevent instability when the denominator is close to zero, α is a hyperparameter, is the clean image obtained by final sampling; Step 3: Use the trained noise estimation network to restore the degraded image to be restored. Among them, the noise estimation network is a dual-domain interactive transformer structure, which includes a 3×3 first convolutional layer, an MFSIM module, 7 stacked DDITB modules and a 3×3 second convolutional layer in sequence according to the signal input direction. The MFSIM module is used to obtain multi-scale fusion features of frequency domain and spatial domain. The output of the first DDITB module is spliced with the output of the sixth DDITB module as the input of the seventh DDITB module, the output of the second DDITB module is spliced with the output of the fifth DDITB module as the input of the sixth DDITB module, and the output of the third DDITB module is spliced with the output of the fourth DDITB module as the input of the fifth DDITB module.
2. According to claim 1, an image restoration method based on an enhanced conditional diffusion model of a dual-domain interactive Transformer, It is characterized in that For the clean image x 0 Using the variance sequence {β 1 ,β 2 ,…,β T } is forwardly added with Gaussian noise to generate a noisy image x after T time steps. T , the noisy image x T Close to Gaussian noise, the process of forward noise addition is expressed by the formula: Among them, q represents the conditional probability distribution, t represents the time step, represents Gaussian distribution, I represents the identity matrix, x t represents the image at time step t.
3. According to claim 1, the image restoration method based on the enhanced conditional diffusion model of dual-domain interactive Transformer, It is characterized in that The reverse denoising process is Start learning Gaussian denoising transformation and use degraded images As a condition, the process of reverse denoising is expressed as: in, α t =1-β t , represents the sampled image at time step t, represents the noise variance at time step t, represents the mean of the noise estimation network at time step t, represents the noise estimated by the noise estimation network at time step t.
4. The image restoration method based on the enhanced conditional diffusion model of dual-domain interactive Transformer according to claim 1, It is characterized in that The MFSIM module includes a frequency domain unit and a space unit. In the frequency domain unit, wavelet transform is used to obtain multi-scale frequency domain features; The spatial unit consists of three branches, which use convolution kernels of sizes 3×3, 5×5 and 7×7 to extract multi-scale spatial features. The output of the frequency domain unit is used as the input of the spatial unit, thereby realizing the interaction and fusion of frequency domain and spatial domain features.
5. The image restoration method based on the enhanced conditional diffusion model of dual-domain interactive Transformer according to claim 1, It is characterized in that The DDITB module includes a dual-domain self-attention unit and a frequency-domain learnable feedforward network. The DDITB module processes the input feature F in Perform layer normalization and use sinusoidal position encoding to convert time step t into time embedding T′. in It is added to the time embedding T′ and input into the dual-domain self-attention unit. The dual-domain self-attention unit performs attention calculations on the input in the frequency domain and the spatial domain respectively to obtain the output of the dual-domain self-attention unit. The output of the dual-domain self-attention unit is input into the frequency domain learnable feedforward network together with the time embedding T′ after layer regularization. The calculation process of the DDITB module is expressed as follows: F′ in =DDSA(LN(F in )+T′)+F in , F out =FLFFN(LN(F′ in )+T′)+F′ in , Among them, F in represents the input of the DDITB module, LN(·) represents layer normalization, DDSA(·) represents the operation of the dual-domain self-attention unit, FLFFN(·) represents the operation of the frequency-domain learnable feedforward network, and F′ in represents the output of the dual-domain self-attention unit, F out Represents the output of the DDITB module.
6. The image restoration method based on the enhanced conditional diffusion model of dual-domain interactive Transformer according to claim 5, It is characterized in that The dual-domain self-attention unit performs attention calculations on the input in the frequency domain and spatial domain respectively, including: Input feature X to the dual-domain self-attention unit in The temporal embedding applies 1×1 point-wise convolution and 3×3 depth-wise convolution to generate three matrices: query Q, key K, and value V. The calculation process of dual-domain self-attention is expressed as follows: DDSA=Concat[DDSA f (Q,K,V),DDSA s (Q,K,V)]+X in , in, DDSA f (·) and DDSA s (·) represents the operation of DDSA in frequency domain and spatial domain respectively, Concat[·] represents the concatenation operation, W p and W d They represent 1×1 point-by-point convolution kernels and 3×3 depth-wise convolution kernels, respectively, with superscripts Q, K, and V added to W. p and W d where represent the weights when finding the query Q, key K and value V, respectively, β represents a learnable scaling parameter, represents the Fast Fourier Transform FFT, represents the inverse fast Fourier transform IFFT, represents the conjugate transpose of the fast Fourier transform, and ⊙ represents the Hadamard product.
7. The image restoration method based on the enhanced conditional diffusion model of dual-domain interactive Transformer according to claim 5, It is characterized in that The frequency domain learnable feedforward network performs the following operations: Input X′ in After layer normalization, add time embedding and split into X f and X s , that is, X f ,X s =Split(LN(X′ in )+T′), Split(·) represents the split operation; X f Input to the linear layer and transform to the frequency domain through FFT, multiply the frequency domain result by the learnable weight W element by element, then transform back to the spatial domain through IFFT, and then generate X′ after GELU activation and linear layer. f ,Right now represents the Fast Fourier Transform FFT, Indicates the inverse fast Fourier transform IFFT, Conv 1×1 represents the 1×1 convolution of the linear layer, ⊙ represents the Hadamard product; X s After a linear layer, GELU activation and a linear layer, X′ is generated. s , that is, X′ s =Conv 1×1 (GELU(Conv 1×1 (X s ))); X′ f and X′ s Connect and add input X′ in The output of the frequency domain learnable feedforward network is obtained, namely FLFFN(X′ in ) = Concat[X′ f ,X′ s ]+X′ in .
Citation Information
Patent Citations
Image restoration method and system
CN116596782A
Image restoration method based on image denoising diffusion generation model
CN117115032A
Learnable augmentation space for dense generative adversarial networks
WO2022194344A1
Cited By
Low-illumination image enhancement method based on low-light feature prior
CN119205539A
Low-rank recovery and deep diffusion fusion-based low-light image enhancement method
CN119338730A
Photoacoustic image enhancement method based on time-driven Transform diffusion model
CN119444630A
SAR (Synthetic Aperture Radar) image colorization method and system, storage medium and equipment
CN119693495A
A Method, System, Storage Medium and Device for Colorizing SAR Images
CN119693495B
