Image defogging method and device based on wavelet transform, equipment and storage medium

By decomposing the image into low-frequency and high-frequency components using wavelet transform, and combining low-frequency conditional diffusion and high-frequency enhancement modules, the problem of poor image dehazing effect in existing technologies is solved, achieving high-quality image dehazing effect and restoring the global and local features of the image.

CN119991485BActive Publication Date: 2026-04-17NINGXIA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NINGXIA UNIVERSITY
Filing Date
2025-01-20
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing image dehazing methods struggle to clearly restore image details and global information, resulting in poor dehazing effects. In particular, images generated in complex and non-uniform haze environments are prone to artifacts or blurred details.

Method used

A wavelet transform-based method is adopted to decompose the image into low-frequency and high-frequency components. The global structure of the image is restored by using a low-frequency conditional diffusion model, and the edge and texture information of the image is restored and enhanced by a high-frequency enhancement module. Finally, local and global information are aggregated by multi-scale pooling to construct a complete image dehazing model.

Benefits of technology

It effectively restores the global and local features of the image, improves the quality of the dehazed image, ensures a balance between global consistency and local detail, and generates a more natural and realistic visual effect in the dehazed image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991485B_ABST
    Figure CN119991485B_ABST
Patent Text Reader

Abstract

The application provides a wavelet transform-based image defogging method, device and equipment and a storage medium, relates to the technical field of image processing and application, and the method comprises the following steps: obtaining a foggy image to be defogged; performing wavelet transform on the foggy image to obtain low-frequency components and high-frequency components; inputting the low-frequency components into a pre-constructed low-frequency conditional diffusion model to output recovered low-frequency components; using a pre-constructed high-frequency enhancement module to recover and enhance the edges and textures of the high-frequency components to obtain recovered high-frequency components; reconstructing the recovered low-frequency components and the recovered high-frequency components into a spatial domain image through inverse wavelet transform; and aggregating local information and global information in the spatial domain image based on multi-scale pooling to obtain an image after the foggy image is finally defogged. The scheme can clearly recover the details and global information of the image, and improves the defogging effect and image quality of the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing and application technology, and in particular to an image dehazing method, apparatus, device, and storage medium based on wavelet transform. Background Technology

[0002] With the rapid development of information technology, computer vision and image processing technologies have been widely applied in various fields such as autonomous driving, intelligent monitoring, and remote sensing image processing. However, haze is one of the key factors affecting image quality and subsequent analysis. Haze not only causes image blurring and reduced contrast, but it can also hide important details in images, seriously affecting the accuracy of image understanding and subsequent image analysis tasks. Therefore, how to effectively remove haze and restore image clarity and detail during image processing has always been a major problem that urgently needs to be solved in the field of computer vision.

[0003] Currently, image dehazing methods can be mainly divided into physics-based dehazing methods and end-to-end dehazing methods. Traditional physics-based methods mainly simulate the impact of haze on light propagation, combining atmospheric scattering models or optical transmission models to infer the concentration and scattering effect of haze, thereby restoring image clarity. Although these methods can intuitively explain the physical mechanism of the dehazing process through a strong theoretical foundation, they are usually applicable to scenes with relatively uniform haze, meaning they can only effectively recover detailed information in the image under certain conditions. In contrast, end-to-end dehazing methods employ deep learning techniques, especially models such as convolutional neural networks (CNNs), which learn the mapping relationship from hazy images to dehazed images through a large amount of training data. These methods do not rely on any physical models or hand-designed features, but rather, through a data-driven approach, they exhibit strong robustness and adaptability in complex hazy environments, and can handle images in dynamic environments and with non-uniform haze.

[0004] With the development of generative models, especially the widespread application of Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs) in image restoration, image dehazing technology has entered a new research stage. Although GANs and VAEs exhibit strong generative capabilities in image restoration, they suffer from instability during training, easily producing artifacts or blurred details in the generated images. Therefore, existing methods struggle to clearly recover the details and global features of images, resulting in poor image dehazing performance. Summary of the Invention

[0005] In view of this, and to address the above shortcomings, it is necessary to propose an image dehazing method, apparatus, device, and storage medium based on wavelet transform, so as to clearly recover the details and global information of the image, and improve the dehazing effect and image quality.

[0006] In a first aspect, the present invention provides an image dehazing method based on wavelet transform, comprising:

[0007] Obtain the foggy image to be dehazed;

[0008] The foggy image is subjected to wavelet transform to decompose it into low-frequency components and high-frequency components; wherein, the low-frequency components contain global structural information of the image, and the high-frequency components contain detailed and texture information of the image.

[0009] The low-frequency component is input into a pre-constructed low-frequency conditional diffusion model, and the recovered low-frequency component is output; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from the noise based on the diffusion and denoising process;

[0010] The edges and textures of the high-frequency components are restored and enhanced using a pre-built high-frequency enhancement module to obtain the restored high-frequency components; wherein, the high-frequency enhancement module is constructed based on multiple Gabor convolutions in different directions;

[0011] The recovered low-frequency component and the recovered high-frequency component are reconstructed into a spatial domain image through inverse wavelet transform;

[0012] Multi-scale pooling is used to aggregate local and global information in the spatial domain image to obtain the final dehazed image of the foggy image.

[0013] Preferably, performing wavelet transform on the foggy image includes:

[0014] For the foggy image J∈R H×W×C The foggy image J is decomposed using two-dimensional discrete wavelet transform, yielding four components: Among them, X A For low-frequency components, X H X V X D These are the horizontal high-frequency components, the vertical high-frequency components, and the diagonal high-frequency components, respectively; the basis functions of the two-dimensional discrete wavelet transform are Haar wavelet basis functions.

[0015] Preferably, the pre-trained low-frequency conditional diffusion model is expressed as:

[0016]

[0017] in, Used to characterize the image obtained in step t. Used to characterize low-frequency components, α t It is used as a hyperparameter to control the variance of the noise added at each step. This represents the noise in the model's predictions.

[0018] Preferably, the step of restoring and enhancing the edges and textures of the high-frequency components using a pre-built high-frequency enhancement module includes:

[0019] For the horizontal high-frequency component X H Vertical high-frequency component X V and diagonal high-frequency component X D Execute any one of them:

[0020] Based on the following calculation formula, depthwise separable convolution is used to map the current high-frequency components to a high-dimensional feature space, and four 7×7 Gabor convolutions are used to obtain high-dimensional features in four directions:

[0021]

[0022] Where, x0, These are the current high-frequency components X. α Corresponding to the high-dimensional features in four directions, Conv Gabor Characterizing Gabor convolution, Conv Depth Used to characterize depthwise separable convolution;

[0023] Based on the following calculation formula, the current high-frequency component X is used through two cross-attention layers. α The high-frequency features in the four directions are fused and stitched together to obtain the recovered high-frequency component of the current high-frequency component:

[0024]

[0025] in, The recovered high-frequency component is used to characterize the current high-frequency component. ψ(·) represents batch normalization, Attn(·) represents the cross-self-attention mechanism, and Conv Depth Used to characterize depthwise separable convolution, Cat(·) is an abbreviation for the Concat(·) operation.

[0026] Preferably, the aggregation of local and global information in the spatial domain image based on multi-scale pooling includes:

[0027] This can be achieved using the following set of calculations:

[0028]

[0029] Among them, MP n×nThis indicates that max pooling is performed using an n×n kernel. This represents element-wise addition, x n×n This represents the feature map after max pooling using an n×n kernel. Representing spatial domain images The feature map after convolution and batch normalization, where ψ(·) represents batch normalization.

[0030] Preferably, when constructing a complete model for image dehazing, the recovered low-frequency component of the low-frequency conditional diffusion model output is defined as follows: The recovered high-frequency components obtained by the high-frequency enhancement module are right The spatial domain image after inverse wavelet transform is For reference image X GT Wavelet decomposition image;

[0031] The low-frequency loss function is then expressed as follows:

[0032]

[0033] In the formula, L low Used to represent the low-frequency loss function, where ε is the actual added noise. θ The noise in the model prediction;

[0034] High-frequency loss function L high It is expressed as follows:

[0035]

[0036] The overall image loss function is expressed as follows:

[0037]

[0038] In the formula, L image The image loss function used to characterize the whole image is SSIM(·), which is used to characterize the SSIM loss function.

[0039] The total loss function of the complete model for image dehazing is then expressed as:

[0040] L total =αL low +βL high +γL image

[0041] Among them, L total The total loss function is used to characterize the total loss function, where α, β, and γ are the weight parameters for low-frequency loss, high-frequency loss, and image loss, respectively.

[0042] In a second aspect, the present invention provides an image dehazing device based on wavelet transform, comprising: an image acquisition module, a wavelet transform module, a low-frequency recovery module, a high-frequency recovery module, an inverse wavelet transform module, and an image aggregation module;

[0043] The image acquisition module is configured to acquire a foggy image to be dehazed;

[0044] The wavelet transform module is configured to perform wavelet transform on the foggy image to decompose it into low-frequency components and high-frequency components; wherein, the low-frequency components contain global structural information of the image, and the high-frequency components contain detailed and texture information of the image.

[0045] The low-frequency recovery module is configured to input the low-frequency component into a pre-constructed low-frequency conditional diffusion model and output the recovered low-frequency component; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from noise based on the diffusion and denoising process.

[0046] The high-frequency recovery module is configured to recover and enhance the edges and textures of the high-frequency components using a pre-built high-frequency enhancement module to obtain recovered high-frequency components; wherein, the high-frequency enhancement module is constructed based on multiple Gabor convolutions in different directions;

[0047] The inverse wavelet transform module is configured to reconstruct a spatial domain image from the recovered low-frequency component and the recovered high-frequency component through inverse wavelet transform.

[0048] The image aggregation module is configured to aggregate local and global information in the spatial domain image based on multi-scale pooling to obtain the final dehazed image of the foggy image.

[0049] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform any of the methods described in the first aspect.

[0050] Fourthly, the present invention provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method described in any of the first aspects.

[0051] As can be seen from the above technical solution, the image dehazing method based on wavelet transform provided in this embodiment of the invention first acquires a hazy image to be dehazed, then performs wavelet transform on the hazy image to decompose it into low-frequency components and high-frequency components; further, the low-frequency components are input into a pre-constructed low-frequency conditional diffusion model to recover the low-frequency structure of the image from the noise based on the diffusion and denoising process, while a pre-constructed high-frequency enhancement module is used to restore and enhance the edges and textures of the high-frequency components; then, the recovered low-frequency components and recovered high-frequency components are reconstructed into a spatial domain image through inverse wavelet transform, and the local and global information in the spatial domain image are aggregated based on multi-scale pooling to obtain the final dehazed image. Therefore, this solution can decompose the input image into low-frequency components containing global structural information of the image and high-frequency components containing detail and texture information of the image through wavelet transform, and then process the low-frequency components through the low-frequency conditional diffusion model to gradually recover the low-frequency structure of the image from the noise, thereby removing the influence of haze on the global features of the image. Simultaneously, a high-frequency enhancement module is used to process high-frequency components, which can improve the clarity of high-frequency components through Gabor convolution in different directions, ensuring that edges and textures are fully restored and enhanced. Finally, multi-scale pooling is performed on the reconstructed spatial domain image to ensure a balance between global consistency and local detail in the output dehazed image, greatly improving the quality of the dehazed image. Attached Figure Description

[0052] Figure 1 This is a flowchart of an image dehazing method based on wavelet transform provided in an embodiment of the present invention.

[0053] Figure 2 This is a schematic diagram of the overall architecture for image dehazing provided by the present invention.

[0054] Figure 3 A schematic diagram showing the Haar wavelet transform and low-frequency / high-frequency information recombination of dense fog and clear images.

[0055] Figure 4 A visualization of features extracted in four directions using Gabor convolution.

[0056] Figure 5 This is a visual comparison of the present invention with different image dehazing methods on the Dense-Haze dataset.

[0057] Figure 6 This is a visual comparison of the present invention with different image dehazing methods on the NH-Haze dataset.

[0058] Figure 7 This paper presents a visual comparison of the present invention with different image dehazing methods on the SOTS dataset. Detailed Implementation

[0059] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0060] like Figure 1 As shown, this invention provides an image dehazing method based on wavelet transform, which includes the following steps:

[0061] Step 101: Obtain the foggy image to be dehazed;

[0062] Step 102: Perform wavelet transform on the foggy image to decompose it into low-frequency components and high-frequency components; wherein, the low-frequency components contain the global structural information of the image, and the high-frequency components contain the details and texture information of the image.

[0063] Step 103: Input the low-frequency component into the pre-built low-frequency conditional diffusion model and output the recovered low-frequency component; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from the noise based on the diffusion and denoising process.

[0064] Step 104: Use a pre-built high-frequency enhancement module to restore and enhance the edges and textures of the high-frequency components to obtain the restored high-frequency components; wherein, the high-frequency enhancement module is built based on multiple Gabor convolutions in different directions;

[0065] Step 105: Reconstruct the spatial domain image by restoring the low-frequency and high-frequency components through inverse wavelet transform;

[0066] Step 106: Aggregate local and global information in the spatial domain image based on multi-scale pooling to obtain the final dehazed image of the foggy image.

[0067] like Figure 2As shown in the overall architecture of image dehazing, this embodiment decomposes the input image into low-frequency components containing global structural information and high-frequency components containing detail and texture information through wavelet transform. Then, a low-frequency conditional diffusion model is used to process the low-frequency components, gradually recovering the low-frequency structure of the image from the noise, thereby removing the influence of haze on the global features of the image. Simultaneously, a high-frequency enhancement module is used to process the high-frequency components, improving their clarity through Gabor convolutions in different directions, ensuring sufficient recovery and enhancement of edges and textures. Finally, multi-scale pooling is performed on the reconstructed spatial domain image, ensuring a balance between global consistency and local detail in the output dehazed image, significantly improving the quality of the dehazed image.

[0068] For step 102, wavelet transform is performed on the foggy image to decompose it into low-frequency components and high-frequency components; wherein, the low-frequency components contain the global structural information of the image, and the high-frequency components contain the details and texture information of the image.

[0069] In this embodiment, when performing wavelet transform on a foggy image, the most basic wavelet basis function in discrete wavelet transform—the Haar wavelet—is chosen to decompose the input image. Specifically, for a foggy image J∈R H×W×C The foggy image J is decomposed using two-dimensional discrete wavelet transform (2D-DWT) to obtain four components. For example, {X A X H X V X D} = 2D - DWT(J), where X A For low-frequency components, X H X V X D These are the horizontal high-frequency components, the vertical high-frequency components, and the diagonal high-frequency components, respectively.

[0070] Low-frequency components contain the overall structure and most important visual information of an image, while high-frequency components mainly represent the image's details and edges; they are sensitive to subtle features in the image. The presence of fog reduces the difference in brightness between distant objects and the background, resulting in decreased image contrast. Fog also affects the overall brightness of the image, making it appear brighter but uneven. Because the effect of fog is uniform and smooth throughout the image, it does not cause the rapid brightness changes seen at edges or in details. Therefore, the effect of fog is more related to the low-frequency information of the image than its high-frequency information. Figure 3The results show that Haar transform and low-frequency / high-frequency information reconstruction were performed on dense fog and clear images. The findings reveal that fog and haze information is primarily found in the low-frequency components. Reconstructing the low-frequency components of the dense fog image with the high-frequency components of the clear image still yields an image containing significant fog and haze information, while swapping the high-frequency information between the two images does not result in a significant change from the original image. Quantitative results also indicate that fog and haze information primarily affects the low-frequency components of the image, with a relatively small impact on the high-frequency components.

[0071] For step 103, the low-frequency component is input into the pre-constructed low-frequency conditional diffusion model, and the recovered low-frequency component is output; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from the noise based on the diffusion and denoising process.

[0072] Since haze information primarily affects the low-frequency components of an image, and these low-frequency components contain global structural information, a low-frequency conditional diffusion model is considered for processing them. For the model training space decision, diffusion is performed in the original pixel space rather than the latent space. While diffusion in the latent space reduces computational cost and improves training efficiency, diffusion in the pixel space avoids reconstruction errors that may be introduced during decoding and better preserves image realism and detail, resulting in higher-quality generation. Specifically, the low-frequency conditional diffusion model generates clear low-frequency components in the original space. The single-step denoising process of the low-frequency conditional diffusion model can be expressed as:

[0073]

[0074] in, The low-frequency component X is used to characterize the image obtained at step t. A Recorded as α t It is used as a hyperparameter to control the variance of the noise added at each step. This represents the noise in the model's predictions.

[0075] Specifically, when constructing a low-frequency conditional diffusion model, clean data is gradually transformed into pure Gaussian noise, and then denoised step by step through a reverse process to generate new data. The entire process consists of two stages: a forward diffusion process and a reverse denoising process.

[0076] Forward diffusion process: Given a data sample x0 (such as an image), small amounts of noise are gradually added to form a series of intermediate states x1, x2, ..., x T Finally, x is obtained, which is approximately equal to standard Gaussian noise. T Its formula is expressed as:

[0077]

[0078] Where α t As a hyperparameter or reparameter, the variance of the noise added at each step is controlled. After T noise additions, the original data gradually becomes blurred and eventually becomes pure noise. I is the identity matrix. In the forward process, the data x of the original sample x0 at any time step t can be derived. t , using q(x t |x0) represents, and thus the back diffusion step q(x) with condition x0 is derived. t-1 |x t (x0). Specifically:

[0079]

[0080] in, α t =1-β t and

[0081] Inverse denoising process: Given the current state x t The goal is to gradually denoise and obtain the state x of the previous time step. t-1 Specifically, each step in the reverse process assumes a Gaussian distribution, and the parameters of this Gaussian distribution are learned through a model. The conditional probability is expressed as:

[0082] p θ (x t-1 |x t )=N(x t-1 μ θ (x t ,t),∑ θ (x t ,t))

[0083] in, For approximation Use a network to learn the noise ε in the mean. θ (x t The ,t) is used to predict the noise components that need to be removed during denoising at each time step, or the mean μ can be learned directly. θ (x t ,t), used to predict the image x at the previous time step. t-1 .

[0084] Training objective and sampling process: In order for the model to effectively denoise, the loss function in the training process is used to minimize the noise ε predicted by the model. θ (x t The difference between (t) and the true noise ε is usually measured using the mean squared error (MSE) to measure the accuracy of the noise prediction. Therefore, the training objective is:

[0085]

[0086] In the sampling process of the low-frequency conditional diffusion model, starting with standard Gaussian noise, the model progressively removes noise through a reverse process until the final image is generated. At each step, the model predicts the mean and variance of the noise and samples from the conditional Gaussian distribution to generate the image from the previous time step. After multiple iterations of denoising, the final generated sample will have a distribution similar to the original image, thus yielding a high-quality generated image.

[0087] For step 104, the edges and textures of the high-frequency components are restored and enhanced using a pre-built high-frequency enhancement module to obtain the restored high-frequency components; wherein, the high-frequency enhancement module is constructed based on Gabor convolutions in multiple different directions;

[0088] In this step, a high-frequency enhancement module is proposed for foggy images. Its purpose is to enhance the three high-frequency components X after Haar wavelet transform. H X V X D Perform detail restoration and enhancement. Specifically, this can be done on the horizontal high-frequency component X. H Vertical high-frequency component X V and diagonal high-frequency component X D Execute any one of them:

[0089] Based on the following calculation formula, depthwise separable convolution is used to map the current high-frequency components to a high-dimensional feature space, and four 7×7 Gabor convolutions are used to obtain high-dimensional features in four directions:

[0090]

[0091] Where, x0, These are the current high-frequency components X. α Corresponding to the high-dimensional features in four directions, Conv Gabor Characterizing Gabor convolution, Conv Depth Used to characterize depthwise separable convolution;

[0092] Based on the following calculation formula, the current high-frequency component X is used through two cross-attention layers. α The high-frequency features in the four directions are fused and stitched together to obtain the recovered high-frequency component of the current high-frequency component:

[0093]

[0094] in, The recovered high-frequency component is used to characterize the current high-frequency component. ψ(·) represents batch normalization, Attn(·) represents the cross-self-attention mechanism, and ConvDepth Used to characterize depthwise separable convolutions, Cat(·) is an abbreviation for the Concat(·) operation. With X H They have the same dimensions and size.

[0095] In this embodiment, a key advantage of Gabor convolution is its directional selectivity, enabling the extraction of image features in specific directions. Furthermore, the kernel parameters used in Gabor convolution can be set to directional Gabor filters before training begins, rather than being randomly initialized. This means the initial kernels already possess direction- and frequency-sensitive characteristics, eliminating the need for learning from scratch and reducing the complexity of parameter training. During convolution, features from high-frequency information acquired during training are enhanced using Gabor convolutions in four directions. Each Gabor kernel decomposes information into specific directions, resulting in a clearer representation of edge and texture information in the feature map.

[0096] like Figure 4 The diagram illustrates the process of Gabor convolution extracting features in four directions. High-frequency components are processed by Gabor convolution kernels in different directions, generating multi-angle output feature maps. This method, through multi-directional convolution operations, allows for a clearer representation of edge and texture information in the image within the feature maps. The convolution kernel parameters used in Gabor convolution can be set to directional Gabor filters before training begins, rather than being randomly initialized. This indicates that the initial convolution kernels already possess direction- and frequency-sensitive characteristics, eliminating the need for learning from scratch and thus reducing the complexity of parameter training. During the convolution process, Gabor convolution in four directions is used to enhance the features of high-frequency information during training. Each Gabor convolution kernel decomposes information into specific directions, thereby generating response features for the corresponding direction.

[0097] For step 105, the recovered low-frequency components and recovered high-frequency components are reconstructed into a spatial domain image through inverse wavelet transform;

[0098] In this embodiment, after obtaining the recovered low-frequency components respectively and recovery of high-frequency components Next, we consider using inverse Haar wavelet transform to reconstruct the spatial domain image.

[0099] For step 106, local and global information in the spatial domain image are aggregated based on multi-scale pooling to obtain the final dehazed image of the foggy image.

[0100] In this step, to balance local and global features, multi-scale max pooling (x) is considered. 5×5x 9×9 x 13×13 Feature downsampling is performed to capture feature information at different scales, thereby improving the model's ability to recognize multi-scale features.

[0101] The low-frequency conditional diffusion module will generate And the high frequency enhancement module obtained The spatial domain image is obtained after performing the inverse Haar wavelet transform. Then, it is processed by a multi-scale pooling module to finally obtain the dehazed image X, which is implemented using the following set of calculation formulas:

[0102]

[0103] Among them, MP n×n This indicates that max pooling is performed using an n×n kernel. This represents element-wise addition, x n×n This represents the feature map after max pooling using an n×n kernel. Representing spatial domain images The feature map after convolution and batch normalization, where ψ(·) represents batch normalization.

[0104] Furthermore, when constructing a complete model for image dehazing, the recovered low-frequency component of the low-frequency conditional diffusion model output is defined as follows: The recovered high-frequency components obtained by the high-frequency enhancement module are right The spatial domain image after inverse wavelet transform is For reference image X GT Wavelet decomposition image;

[0105] The low-frequency loss function is then expressed as follows:

[0106]

[0107] In the formula, L low Used to represent the low-frequency loss function, where ε is the actual added noise. θ The noise in the model prediction;

[0108] For the low-frequency loss function, only the noise and low-frequency components of the diffusion model are constrained. Therefore, we need to consider designing a high-frequency loss function L. high It is represented as follows:

[0109]

[0110] For high-frequency information, the L1 norm constraint can preserve sparsity, thus preventing excessive smoothing when extracting detailed information. Therefore, we consider combining the L2 norm and SSIM loss to design an overall image loss function, which is expressed as follows:

[0111]

[0112] In the formula, L image The image loss function used to characterize the whole image is SSIM(·), which is used to characterize the SSIM loss function.

[0113] Therefore, the total loss function of the complete model for image dehazing is expressed as:

[0114] L total =αL low +βL high +γL image

[0115] Among them, L total The total loss function is represented by α, β, and γ, which are the weight parameters for low-frequency loss, high-frequency loss, and image loss, respectively, and can be set to 2, 1, and 1. Therefore, during model training, the low-frequency loss term L is increased... low The weighting of the image can effectively suppress the impact of haze on the overall brightness and contrast of the image, thereby better restoring the background information of the image.

[0116] The following uses Python software, and implements the model framework using PyTorch on a single NVIDIA GeForce RTX 4090 GPU. Images from natural and synthetic haze datasets are used as input data, and LPIPS, PSNR, and SSIM metrics are used for evaluation. This invention is qualitatively and quantitatively compared with the traditional prior-based DCP model and six deep learning-based methods: DehazeNet, FFA-Net, Dehamer, FSDGN, WeatherDiff, and FDCM, where WeatherDiff and FDCM are both diffusion-based dehazing models.

[0117] Figure 5 This paper presents comparative experiments on the Dense-Haze dataset, comparing the proposed method with different image dehazing models. Existing methods often suffer from significant loss of content and color when removing dense fog, resulting in unsatisfactory dehazing effects. In contrast, the proposed method better preserves image details and color information, producing dehazing results that visually approximate the clear reference image.

[0118] Figure 6This paper presents comparative experiments on the NH-Haze dataset, comparing the invention with different image dehazing models. Compared to FSDGN and Dehamer methods, the invention can remove uneven haze more accurately and generate high-fidelity dehazing effects. Especially in terms of the accuracy of detail and color recovery, the invention demonstrates a significant advantage, effectively restoring details in blurred areas while avoiding artifacts and blurring common in existing methods, resulting in visually more realistic and natural images.

[0119] Figure 7 The paper presents comparative experiments on the SOTS dataset, comparing the invention with different image dehazing models. The invention, along with other methods, demonstrates comparable visual results on this dataset, effectively restoring image details and color information and providing good perceptual quality.

[0120] Table 1 below shows the quantitative comparison results of different methods on three datasets. Based on various evaluation metrics, this invention demonstrates significant advantages on the Dense-Haze and NH-Haze datasets.

[0121] Table 1

[0122]

[0123] In addition, the present invention also provides an image dehazing device based on wavelet transform, comprising: an image acquisition module, a wavelet transform module, a low-frequency recovery module, a high-frequency recovery module, an inverse wavelet transform module, and an image aggregation module;

[0124] The image acquisition module is configured to acquire a hazy image to be dehazed;

[0125] The wavelet transform module is configured to perform wavelet transform on the foggy image to decompose it into low-frequency components and high-frequency components. The low-frequency components contain the global structural information of the image, while the high-frequency components contain the details and texture information of the image.

[0126] The low-frequency recovery module is configured to input low-frequency components into a pre-built low-frequency conditional diffusion model and output recovered low-frequency components; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from noise based on the diffusion and denoising process.

[0127] The high-frequency recovery module is configured to recover and enhance the edges and textures of high-frequency components using a pre-built high-frequency enhancement module to obtain recovered high-frequency components; wherein, the high-frequency enhancement module is constructed based on multiple Gabor convolutions in different directions;

[0128] The inverse wavelet transform module is configured to reconstruct a spatial domain image by restoring the low-frequency components and the high-frequency components through inverse wavelet transform.

[0129] The image aggregation module is configured to aggregate local and global information in the spatial domain image based on multi-scale pooling to obtain the final dehazed image of the hazy image.

[0130] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods in any of the embodiments of the specification.

[0131] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any of the embodiments of the specification.

[0132] The device embodiments provided by the present invention are based on the same inventive concept as the method embodiments in this specification. For details, please refer to the description in the method embodiments of this specification, which will not be repeated here.

[0133] The modules or units in the device of this invention can be merged, divided, and deleted according to actual needs. The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that implementing all or part of the processes of the above embodiments and making equivalent changes according to the claims of this invention still fall within the scope of the invention.

Claims

1. An image dehazing method based on wavelet transform, characterized in that, include: Obtain the foggy image to be dehazed; The foggy image is subjected to wavelet transform to decompose it into low-frequency components and high-frequency components; wherein, the low-frequency components contain global structural information of the image, and the high-frequency components contain detailed and texture information of the image. The low-frequency component is input into a pre-constructed low-frequency conditional diffusion model, and the recovered low-frequency component is output; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from the noise based on the diffusion and denoising process; The edges and textures of the high-frequency components are restored and enhanced using a pre-built high-frequency enhancement module to obtain the restored high-frequency components; wherein, the high-frequency enhancement module is constructed based on multiple Gabor convolutions in different directions; The recovered low-frequency component and the recovered high-frequency component are reconstructed into a spatial domain image through inverse wavelet transform; Based on multi-scale pooling, the local and global information in the spatial domain image are aggregated to obtain the final dehazed image of the foggy image; The wavelet transform of the foggy image includes: For the foggy image Using two-dimensional discrete wavelet transform to process foggy images The decomposition yields four components, which are respectively , , , ;in, Low-frequency components, , , These are the horizontal high-frequency components, the vertical high-frequency components, and the diagonal high-frequency components, respectively; the basis functions of the two-dimensional discrete wavelet transform are Haar wavelet basis functions. The process of restoring and enhancing the edges and textures of the high-frequency components using a pre-built high-frequency enhancement module includes: For horizontal high frequency components Vertical high frequency components and diagonal high frequency components Execute any one of them: Based on the following calculation formula, depthwise separable convolution is used to map the current high-frequency components to a high-dimensional feature space, and four 7×7 Gabor convolutions are used to obtain high-dimensional features in four directions: ; in, These are the current high-frequency components. Corresponding to high-dimensional features in four directions, Characterizing Gabor convolution, Used to characterize depthwise separable convolution; Based on the following calculation formula, two cross-attention layers are used to process the current high-frequency components. The high-frequency features in the four directions are fused and stitched together to obtain the recovered high-frequency component of the current high-frequency component: ; in, The recovered high-frequency component is used to characterize the current high-frequency component. Indicates batch normalization. This indicates a cross-self-attention mechanism. Used to characterize depthwise separable convolutions for Abbreviation for operation.

2. The image dehazing method based on wavelet transform according to claim 1, characterized in that, The pre-constructed low-frequency conditional diffusion model is expressed as: ; in, Used to characterize the The image obtained from the step, Used to characterize low-frequency components. It is used as a hyperparameter to control the variance of the noise added at each step. , This represents the noise in the model's predictions.

3. The image dehazing method based on wavelet transform according to claim 1, characterized in that, The aggregation of local and global information in the spatial domain image based on multi-scale pooling includes: This can be achieved using the following set of calculations: ; in, Indicates using The kernel is max-pooled. This indicates element-wise addition. Indicates using Feature map after max pooling of kernels Representing spatial domain images The feature map after convolution and batch normalization. This indicates batch normalization.

4. The image dehazing method based on wavelet transform according to claim 1, characterized in that, When constructing a complete model for image dehazing, the recovered low-frequency component of the low-frequency conditional diffusion model output is defined as follows: The recovered high-frequency component obtained by the high-frequency enhancement module is , , ;right , , , The spatial domain image after inverse wavelet transform is , , , , For reference image Wavelet decomposition image; The low-frequency loss function is then expressed as follows: ; In the formula, Used to represent low-frequency loss function Noise added to the real thing. The noise in the model prediction; High-frequency loss function It is expressed as follows: ; The overall image loss function is expressed as follows: ; In the formula, The image loss function used to characterize the overall image. Used to characterize the SSIM loss function; The total loss function of the complete model for image dehazing is then expressed as: ; in, Used to characterize the total loss function , , These are the weight parameters for low-frequency loss, high-frequency loss, and image loss, respectively.

5. An image dehazing device based on wavelet transform, characterized in that, include: The system includes an image acquisition module, a wavelet transform module, a low-frequency recovery module, a high-frequency recovery module, an inverse wavelet transform module, and an image aggregation module. The image acquisition module is configured to acquire a foggy image to be dehazed; The wavelet transform module is configured to perform wavelet transform on the foggy image to decompose it into low-frequency components and high-frequency components; wherein, the low-frequency components contain global structural information of the image, and the high-frequency components contain detailed and texture information of the image. The low-frequency recovery module is configured to input the low-frequency component into a pre-constructed low-frequency conditional diffusion model and output the recovered low-frequency component; wherein, the low-frequency conditional diffusion model is used to recover the low-frequency structure of the image from noise based on the diffusion and denoising process. The high-frequency recovery module is configured to recover and enhance the edges and textures of the high-frequency components using a pre-built high-frequency enhancement module to obtain recovered high-frequency components; wherein, the high-frequency enhancement module is constructed based on multiple Gabor convolutions in different directions; The inverse wavelet transform module is configured to reconstruct a spatial domain image from the recovered low-frequency component and the recovered high-frequency component through inverse wavelet transform. The image aggregation module is configured to aggregate local and global information in the spatial domain image based on multi-scale pooling to obtain the final dehazed image of the hazy image. The wavelet transform of the foggy image includes: For the foggy image Using two-dimensional discrete wavelet transform to process foggy images The decomposition yields four components, which are respectively , , , ;in, Low-frequency components, , , These are the horizontal high-frequency components, the vertical high-frequency components, and the diagonal high-frequency components, respectively; the basis functions of the two-dimensional discrete wavelet transform are Haar wavelet basis functions. The process of restoring and enhancing the edges and textures of the high-frequency components using a pre-built high-frequency enhancement module includes: For horizontal high frequency components Vertical high frequency components and diagonal high frequency components Execute any one of them: Based on the following calculation formula, depthwise separable convolution is used to map the current high-frequency components to a high-dimensional feature space, and four 7×7 Gabor convolutions are used to obtain high-dimensional features in four directions: ; in, These are the current high-frequency components. Corresponding to high-dimensional features in four directions, Characterizing Gabor convolution, Used to characterize depthwise separable convolution; Based on the following calculation formula, two cross-attention layers are used to process the current high-frequency components. The high-frequency features in the four directions are fused and stitched together to obtain the recovered high-frequency component of the current high-frequency component: ; in, The recovered high-frequency component is used to characterize the current high-frequency component. Indicates batch normalization. This indicates a cross-self-attention mechanism. Used to characterize depthwise separable convolutions for Abbreviation for operation.

6. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method as described in any one of claims 1-4.

7. A computing device, comprising a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, it implements the method according to any one of claims 1-4.