Image defogging method, device, equipment and medium based on diffusion model

By combining the deep learning model, the physical dehazing model and the improved Unet noise reduction network, and using the transmission map to guide the dehazing process, the problem of unsatisfactory image dehazing effect is solved and better dehazing effect and image quality are achieved.

CN118521496BActive Publication Date: 2024-09-27XIANGJIANG LAB
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410974894.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-09-27
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

Existing image dehazing technology does not perform satisfactorily when processing complex scenes and images with rich details. In particular, the diffusion model fails to fully consider the physical properties of the dehazing task, resulting in unsatisfactory dehazing effects.

Method used

An image defogging model based on deep learning is used to perform preliminary dehazing processing on the hazy image to generate a transmission map. The transmission map is then input into the physical dehazing model for further processing to obtain a pseudo-dehazed image. The pseudo-dehazed image is then input and improved. The Unet denoising network is used for dehazing, and the transmission map is used to guide the denoising process.

Benefits of technology

The image dehazing effect is improved, making the dehazed image clearer and more natural, close to the real fog-free image, and overcoming the limitations of the traditional diffusion model in processing complex fog scenes and images with rich details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521496B
    Figure CN118521496B
Patent Text Reader

Abstract

The present application is applicable to the field of image defogging technology, and provides an image defogging method, device, equipment and medium based on a diffusion model. The method includes: inputting a foggy image into an image defogging model based on deep learning for defogging processing to obtain a transmission map; inputting the transmission map into a physical defogging model for defogging processing to obtain a pseudo defogging image; inputting the pseudo defogging image into a diffusion model for defogging processing to obtain a defogging image; the diffusion model uses an improved Unet denoising network for denoising, and the improved Unet denoising network uses the transmission map for guidance during the denoising process; the improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module, the downsampling module is used to extract a feature map of the input image, the transmission module is used to use the feature map and the transmission map to obtain a guidance map, and the upsampling module is used to reconstruct the feature map using the guidance map and residual connection operation to obtain a defogging image. The present application can improve the image defogging effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of image defogging, and in particular relates to an image defogging method, device, equipment and medium based on a diffusion model. Background Art

[0002] In the traditional field of image processing, dehazing has always been an important research direction. Due to the presence of fog, the details and color information in the image are often seriously disturbed, resulting in a decrease in image quality. In order to solve this problem, various physical dehazing models have been proposed.

[0003] The performance of physical defogging models is affected by parameters such as atmospheric light and transmittance. In order to obtain accurate defogging effects, these parameters need to be accurately estimated. However, due to the large uncertainty in the distribution and intensity of fog in actual scenes, it is difficult to accurately estimate these parameters. Once the estimation is inaccurate, the defogging results will be biased or even completely ineffective. Therefore, physical defogging models often have great limitations in practical applications.

[0004] With the continuous development of deep learning technology, deep convolutional neural networks (DCNN) have been widely used in the field of image processing. DCNN can extract key information such as transmission maps by performing convolution operations on foggy images, thus solving the limitations of physical defogging models to a certain extent. However, DCNN still has certain limitations when processing complex scenes. When processing complex foggy scenes, strong lighting conditions, and images with rich details, the defogging effect may be affected, resulting in unsatisfactory results.

[0005] In recent years, diffusion models have made significant progress in the field of image processing. By simulating the process of noise propagation, diffusion models can flexibly handle various image restoration and denoising tasks without relying on prior knowledge. In particular, diffusion models have shown significant advantages in image generation, restoration and denoising. This provides a new perspective for the image dehazing task.

[0006] However, although the diffusion model has achieved remarkable results in image processing tasks, it still has certain limitations when dealing with defogging tasks. The main reason is that the diffusion model does not fully consider the physical properties of the defogging task. In other words, although the diffusion model can generate diverse and realistic images, in the specific task of defogging, it may not be able to fully capture the physical changes in the image caused by fog, resulting in unsatisfactory defogging results. Summary of the invention

[0007] The embodiments of the present application provide an image defogging method, device, equipment and medium based on a diffusion model, which can solve the problem of unsatisfactory image defogging effect.

[0008] In a first aspect, an embodiment of the present application provides an image defogging method based on a diffusion model, comprising:

[0009] The foggy image is input into the image defogging model based on deep learning for defogging, and the transmission map of the foggy image is obtained;

[0010] The transmission image is input into the physical defogging model for defogging to obtain a pseudo defogging image;

[0011] The pseudo dehazed image is input into the trained diffusion model for dehazing to obtain a dehazed image;

[0012] Among them, the diffusion model uses the improved Unet denoising network for denoising, and the improved Unet denoising network uses the transmission map for guidance in the denoising process;

[0013] The improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module. The input of the downsampling module is the input image of the improved Unet denoising model. The downsampling module is used to extract the feature map of the input image. The transmission module is used to obtain the guidance map using the feature map and the transmission map. The upsampling module is used to reconstruct the feature map using the guidance map and the residual connection operation to obtain a reconstructed map. The reconstructed map obtained by the last iteration of the diffusion model is the dehazed image.

[0014] Optionally, the downsampling module includes four downsampling layers connected in sequence, the transmission module includes three transmission layers connected in sequence, and the upsampling module includes four upsampling layers connected in sequence;

[0015] Among them, the input end of the first downsampling layer is the input end of the downsampling module, the output end of the fourth upsampling layer is the output end of the upsampling module, the output end of the i-th downsampling layer is connected to the input end of the i-th transmission layer and the input end of the i-th upsampling layer respectively, and the output end of the i-th transmission layer is connected to the input end of the i-th upsampling layer. , the output of the fourth downsampling layer is connected to the input of the fourth upsampling layer.

[0016] Optionally, the i-th downsampling layer is used to pass the formula Get feature map ; ;

[0017] in, represents the feature map output by the i-1th downsampling layer, represents the input image of the improved Unet denoising network, represents the relu activation function, represents the maximum pooling downsampling operation, Represents 2 3x3 convolution operations.

[0018] Optionally, the i-th transmission layer is used to obtain the guidance graph by the transmission guidance formula , , the transmission guidance formula is:

[0019] ;

[0020] in, represents the maximum pooling operation, represents the normalization operation, represents the inter-layer graph of the output of the i-1th transmission layer to the i-th transmission layer, represents the transmission diagram, Represents the Hadamard dot product operation.

[0021] Optionally, the i-th upsampling layer is used to obtain the reconstructed image through the reconstruction formula ;

[0022] exist When , the reconstruction formula is:

[0023] ;

[0024] in, represents the residual connection operation, represents the relu activation function, represents a 3x3 deconvolution upsampling operation, represents the reconstructed image output by the i-1th upsampling layer, ;

[0025] exist When , the reconstruction formula is: .

[0026] Optionally, the loss function used in the training process of the diffusion model is expressed as:

[0027]

[0028] in, represents the loss value of the loss function, represents a 3x3 convolution operation, represents the dehazed image output by the diffusion model, represents the maximum pooling operation, Represents the pseudo dehazed denoised image output by the diffusion model in the denoising stage.

[0029] In a second aspect, an embodiment of the present application provides an image defogging device based on a diffusion model, comprising:

[0030] A first defogging module is used to input the foggy image into an image defogging model based on deep learning for defogging processing to obtain a transmission map of the foggy image;

[0031] The second defogging module is used to input the transmission image into the physical defogging model for defogging processing to obtain a pseudo defogging image;

[0032] The third defogging module is used to input the pseudo defogging image into the trained diffusion model for defogging processing to obtain a defogging image;

[0033] Among them, the diffusion model uses the improved Unet denoising network for denoising, and the improved Unet denoising network uses the transmission map for guidance in the denoising process;

[0034] The improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module. The input of the downsampling module is the input image of the improved Unet denoising model. The downsampling module is used to extract the feature map of the input image. The transmission module is used to obtain the guidance map using the feature map and the transmission map. The upsampling module is used to reconstruct the feature map using the guidance map and the residual connection operation to obtain a reconstructed map. The reconstructed map obtained by the last iteration of the diffusion model is the dehazed image.

[0035] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned diffusion model-based image dehazing method when executing the computer program.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned image dehazing method based on the diffusion model is implemented.

[0037] The above solution of the present application has the following beneficial effects:

[0038] In an embodiment of the present application, a preliminary defogging process is performed on a foggy image by utilizing an image defogging model based on deep learning to obtain an accurate transmission map, and then the transmission map is further defogged in combination with a physical defogging model to generate a pseudo defogged image, which is then input into a diffusion model for defogging. Since the diffusion model guides the denoising process through the transmission map, the diffusion model can better handle complex fog scenes and images with rich details compared to traditional diffusion models, so that the defogged image output by the diffusion model is clearer and more natural, and closer to a real fog-free image than the defogged image obtained by the traditional defogging method, thereby achieving the purpose of improving the image defogging effect.

[0039] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 A flowchart of an image defogging method based on a diffusion model provided in an embodiment of the present application;

[0042] Figure 2 is a schematic diagram of a foggy image in an example;

[0043] Figure 3 is a schematic diagram of a dehazed image obtained by using a commonly used dehazed convolutional network in an example;

[0044] Figure 4 is a schematic diagram of a defogging image obtained by using the defogging method of the present application in an example;

[0045] Figure 5 A schematic diagram of the structure of an image defogging device provided in one embodiment of the present application;

[0046] Figure 6 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0047] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0048] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0049] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0050] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0051] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0052] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0053] In response to the problem that the current image defogging effect is not ideal, an embodiment of the present application provides an image defogging method based on a diffusion model. The method uses a deep learning-based image defogging model to perform preliminary defogging on the foggy image to obtain an accurate transmission map, and then further defogs the transmission map in combination with a physical defogging model to generate a pseudo-defogged image. The pseudo-defogged image is then input into the diffusion model for defogging. Since the diffusion model guides the denoising process through the transmission map, the diffusion model can better handle complex fog scenes and images with rich details compared to traditional diffusion models. Therefore, the defogged image output by the diffusion model is clearer and more natural than the defogged image obtained by the traditional defogging method, and is closer to a real fog-free image, thereby achieving the purpose of improving the image defogging effect.

[0054] The following is an exemplary description of the image defogging method based on the diffusion model provided in the embodiment of the present application in conjunction with a specific embodiment.

[0055] like Figure 1 As shown, the image defogging method based on the diffusion model provided in the embodiment of the present application includes the following steps:

[0056] Step 11: Input the foggy image into the image defogging model based on deep learning for defogging processing to obtain a transmission map of the foggy image.

[0057] The foggy image may be any image that needs to be dehazed, and the deep learning-based image dehazing model may be a commonly used dehazing convolutional network, such as a DehazeNet model (the DehazeNet model is an end-to-end deep learning model).

[0058] Specifically, after the foggy image is input into the DehazeNet model, the DehazeNet model extracts the transmission map from the foggy image through a series of convolution operations and nonlinear activation functions. The transmission map is a matrix that reflects the transmission relationship between different pixels in the image, which describes the degree to which each pixel in the image is affected by haze. The transmission map plays a vital role in the dehazing process. It reflects the transmission relationship between different pixels in the image, that is, the degree to which each pixel is affected by haze. Through the transmission map, the haze in the image can be accurately identified and located, thereby providing strong support for subsequent dehazing operations. The specific formula is as follows:

[0059]

[0060] in, represents the transmission diagram, represents the DehazeNet model, Represents a foggy image.

[0061] Step 12: Input the transmission image into the physical defogging model for defogging to obtain a pseudo defogging image.

[0062] The above physical model refers to a defogging algorithm based on the atmospheric scattering model. The atmospheric scattering model is a mathematical model that describes the transmission process of light in the atmosphere, including the attenuation, scattering and reflection of light in the atmosphere. By using this model, the true brightness and color of each pixel in the image can be restored according to the transmission map, thereby obtaining a pseudo defogging image. The formula of the physical model is as follows:

[0063] ;

[0064] in, is the pseudo dehazed image, T is the transmission map, A is the atmospheric natural light, and X is the foggy image.

[0065] It is worth noting that although the pseudo dehazed image can improve the visual quality of the image and the accuracy of subsequent processing to a certain extent, its quality often cannot reach the level of the real dehazed image due to the influence of complex factors such as atmospheric scattering. Therefore, it is necessary to continue to use the diffusion model for dehazing to further improve the quality and efficiency of image processing.

[0066] Step 13, input the pseudo dehazed image into the trained diffusion model for dehazing processing to obtain a dehazed image; wherein the diffusion model uses an improved Unet denoising network for denoising, and the improved Unet denoising network uses a transmission map for guidance during the denoising process.

[0067] The improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module. The input of the downsampling module is the input image of the improved Unet denoising model. The downsampling module is used to extract the feature map of the input image. The transmission module is used to obtain the guidance map using the feature map and the transmission map. The upsampling module is used to reconstruct the feature map using the guidance map and the residual connection operation to obtain a reconstructed map. The reconstructed map obtained by the last iteration of the diffusion model is the dehazed image.

[0068] The above-mentioned diffusion model processes the pseudo defogging image in two stages: one is the noise adding stage, and the other is the noise reduction stage. In the embodiment of the present application, the noise adding stage adopts the traditional method to add Gaussian noise, and the noise reduction stage is implemented by using the improved Unet noise reduction network. Since the improved Unet noise reduction network uses the transmission graph for guidance in the noise reduction process, the diffusion model can better handle complex fog scenes and images with rich details compared with the traditional diffusion model, so that the defogging image output by the diffusion model is clearer and more natural than the defogging image obtained by the traditional defogging method, and is close to the real fog-free image, so as to achieve the purpose of improving the image defogging effect.

[0069] It is worth mentioning that the transmission map is an image that can reflect the light intensity transmission relationship between pixels in an image, which can help to more accurately identify and remove fog in an image. By combining the transmission map and the diffusion model, the details and features of the image can be better preserved while denoising, thus achieving a better defogging effect.

[0070] At the same time, in the process of using the diffusion model for defogging, the image is denoised and defogged in an iterative manner. In each iteration, the parameters of the diffusion model are updated according to the current image, and new denoising and defogging results are generated. Through multiple iterations, the denoising and defogging effects are gradually optimized until a satisfactory result is achieved.

[0071] The noise addition stage and noise reduction stage of the diffusion model are exemplarily described below in conjunction with specific embodiments.

[0072] The denoising stage refers to the pseudo dehazed image Add Gaussian noise In the process of adding noise, Image (i.e. Starting from the image obtained after adding noise once), add random noise that conforms to the Gaussian distribution to each pixel to generate image. This process can be done with To indicate that represents the conditional probability density function, and Respectively represent the images before and after adding noise. The formula is:

[0073]

[0074] If the first diffusion process can be Obtain , the specific formula is:

[0075]

[0076] in, represents a Gaussian distribution, Indicates The image obtained after adding noise is Indicates The image obtained after adding noise is Indicates the correlation between the current image and the previous image, that is, the image rate, represents the noise rate, represents the noise added for the tth time, represents the image obtained after the first noise addition, Indicates the proportion of the image when the noise is added for the first time, represents the pseudo dehazed image, represents the noise rate, Indicates the noise added for the first time. and is a pair of combined coefficients, which are the ratio of signal to noise in the image. These two coefficients can also be called image rate and noise rate, which represent the proportion of effective information and noise in the image respectively. By gradually increasing the noise, we can observe the gradual process of the image from clear to blurred, until it is completely transformed into a noisy image.

[0077] The denoising stage, also known as the anti-diffusion stage, is a crucial step in image processing. In this stage, the fully noisy image is denoised through a series of carefully designed neural network parameterized Gaussian distributions. The goal of this process is to restore the clarity and details of the original image. In the denoising stage, the denoising model is constructed using the neural network parameterized Gaussian distribution. Gaussian distribution is a common probability distribution with many excellent properties, such as symmetry, continuity, and differentiability. Through neural network parameterization, the parameters of Gaussian distribution can be flexibly adjusted to adapt to image denoising tasks with different noise types and degrees.

[0078] For a completely noisy image (i.e. the image output from the previous noise adding stage) is subjected to the noise reduction process, and the formula is:

[0079]

[0080] in, represents the conditional probability density function, Represents the new denoised image , represents a Gaussian distribution, Train the network for the mean, Train the network for variance.

[0081] In the above formula, we can and t as input, train a network To predict the noise .here, represents the image at time t, Then represents the noise at that moment. Through training, the network can learn the ability to extract useful information from images and noise, and then predict the distribution and intensity of noise. Next, use the predicted noise , for the original image Perform denoising. This process can be achieved by subtracting the predicted noise from the original image to obtain a new denoised image. .

[0082] It should be noted that the embodiments of the present application The improved Unet denoising model is proposed. The improved Unet denoising network uses the transmission map for guidance in the denoising process, so that the diffusion model can better handle complex fog scenes and images with rich details compared with the traditional diffusion model. As a result, the defogged image output by the diffusion model is clearer and more natural than the defogged image obtained by the traditional defogging method, and is close to the real fog-free image, thereby achieving the purpose of improving the image defogging effect.

[0083] The above improved Unet denoising model is exemplarily described below in conjunction with specific embodiments.

[0084] The down-sampling module includes four down-sampling layers connected in sequence, the transmission module includes three transmission layers connected in sequence, and the up-sampling module includes four up-sampling layers connected in sequence.

[0085] Among them, the input end of the first downsampling layer is the input end of the downsampling module (that is, the input end of the first downsampling layer is the input end of the improved Unet denoising model), the output end of the fourth upsampling layer is the output end of the upsampling module (that is, the output end of the fourth upsampling layer is the output end of the improved Unet denoising model), the output end of the i-th downsampling layer is connected to the input end of the i-th transmission layer and the input end of the i-th upsampling layer respectively, and the output end of the i-th transmission layer is connected to the input end of the i-th upsampling layer. , the output of the fourth downsampling layer is connected to the input of the fourth upsampling layer.

[0086] In some embodiments of the present application, each downsampling layer is used to extract features from the image data input thereto. Specifically, the i-th downsampling layer is used to extract features from the image data input thereto by using the formula Get feature map ; .

[0087] in, represents the feature map output by the i-1th downsampling layer, represents the input image of the improved Unet denoising network, represents the relu activation function, represents the maximum pooling downsampling operation, Represents 2 3x3 convolution operations.

[0088] That is, the i-th downsampling layer is used to perform two 3x3 convolutions on the input image data, and then perform maximum pooling downsampling. Finally, after passing the relu activation function, the output feature map is input to three places, namely: the next downsampling layer, the corresponding transmission layer, and the corresponding upsampling layer. Of course, if the downsampling layer does not have a transmission layer or the next downsampling layer connected to it, it only needs to be output to the upsampling layer.

[0089] In some embodiments of the present application, each transmission layer is used to process the received feature map to obtain a guidance map for guiding the noise reduction process. Specifically, the i-th transmission layer is used to obtain the guidance map by transmitting the guidance formula , , the transmission guidance formula is:

[0090]

[0091] in, represents the maximum pooling operation, represents the normalization operation, represents the inter-layer graph of the output of the i-1th transmission layer to the i-th transmission layer, represents the transmission diagram, Represents the Hadamard dot product operation.

[0092] That is, the i-th transmission layer is used to perform maximum pooling and normalization processing on the inter-layer graph input thereto to obtain the inter-layer graph of this layer, and then output the inter-layer graph of this layer to the next transmission layer, and perform Hadamard point multiplication on the received feature graph and the inter-layer graph of this layer and output them to the corresponding upsampling layer. It can be understood that if there is no next transmission layer, it is only necessary to output the guidance graph obtained by the Hadamard point multiplication to the corresponding upsampling layer.

[0093] In some embodiments of the present application, each upsampling layer is used to reconstruct the received feature map using the received guidance map to obtain a reconstructed map. Specifically, the i-th upsampling layer is used to obtain the reconstructed map by the reconstruction formula .

[0094] Among them, When , the reconstruction formula is:

[0095] ;

[0096] in, represents the residual connection operation, represents the relu activation function, represents a 3x3 deconvolution upsampling operation, represents the reconstructed image output by the i-1th upsampling layer, .

[0097] exist When , the reconstruction formula is: .

[0098] That is, for the first three upsampling layers, each upsampling layer is used to perform a 3x3 deconvolution upsampling on the reconstructed image input thereto, and then after passing through the relu activation function, the obtained feature map is residually connected with the output of the corresponding downsampling layer, and then the output of the corresponding transmission layer is added to obtain the reconstructed image of this layer, and finally the reconstructed image of this layer is output to the upsampling layer of the next layer. For the fourth upsampling layer, it is used to perform a 3x3 deconvolution upsampling on the reconstructed image input thereto, and then after processing through the relu activation function, the reconstructed image of this layer (i.e., the output of the improved Unet denoising model) is obtained.

[0099] The following is an exemplary description of the training process of the diffusion model.

[0100] In some embodiments of the present application, a diffusion model can be trained using a large number of foggy images obtained from a public data set, and the parameters of the diffusion model can be adjusted using a loss function. The training is stopped when the value of the loss function is less than a preset loss value, and the diffusion model at this time is used as the trained diffusion model.

[0101] In some embodiments of the present application, a perceptual loss evaluation method is used to calculate the loss in the diffusion model training process. Specifically, the expression of the loss function used in the diffusion model training process is:

[0102] ;

[0103] in, represents the loss value of the loss function, represents a 3x3 convolution operation, represents the dehazed image output by the diffusion model, represents the maximum pooling operation, Represents the pseudo dehazed denoised image output by the diffusion model in the denoising stage. and represent Pixel-level details and sensory-level detail feature maps, and represent The advantage of the perceptual loss evaluation method is that it can capture the subtle differences in image quality that are sensitive to the human visual system, thus making the dehazed image more consistent with the perceptual characteristics of the human eye.

[0104] It is worth mentioning that the perceptual loss evaluation method is not limited to traditional distortion or noise metrics, but comprehensively evaluates the overall quality of the image from the perspective of human visual perception, providing direct feedback on image quality during the training process, so that the dehazing method of this application can optimize the generation of images that are more in line with human visual perception, thereby achieving the purpose of improving the dehazing effect.

[0105] The effect of the defogging method of the present application is illustrated below with a specific example.

[0106] In this example, the commonly used defogging convolutional network and the defogging method of the present application are respectively used to Figure 2 The foggy image shown in the figure is defogged. The defogged image obtained by using the commonly used defogging convolutional network is as follows: Figure 3 As shown, the defogging method of the present application is used to perform defogging to obtain a defogging image as shown in FIG. Figure 4 By comparison Figure 3 and Figure 4It can be seen that the defogging method of the present application significantly improves the clarity, the details of the bicycle become more obvious, and the texture of the wall is also improved. This shows that the defogging method proposed in the present application successfully restores the original appearance of the scene at least to some extent.

[0107] In summary, the image defogging method provided in the embodiment of the present application has the following advantages:

[0108] First, compared with traditional physical models and convolutional neural network models, the image defogging method based on the diffusion model proposed in this application can better handle complex fog scenes and images with rich details, making the defogging images clearer and more natural. In addition, the training process of the model is relatively stable and not prone to collapse, which has good model versatility, which is of great significance in practical applications.

[0109] Second, the image defogging method of the present application introduces a transmission map as a condition in the defogging task of the diffusion model. The transmission map is used to guide the denoising process of the model, so that the defogging image is closer to the real haze-free image, thereby achieving a better defogging effect.

[0110] Third, the perceptual loss evaluation method proposed in this application evaluates the dehazing effect by comparing the distance between the dehazed image and the real haze-free image in the feature space. It can better preserve the details and texture information of the image during the dehazing process, making the dehazed image more realistic and natural.

[0111] Fourth, in response to the problem of scarce paired fog-free and foggy image datasets, this application proposes a method for generating transmission maps and pseudo-fog-free images using a defogging convolutional network and a physical model. This method first uses a defogging convolutional network to preliminarily process the foggy image to obtain a relatively accurate transmission map; then, the transmission map is further optimized in combination with the physical model to generate a pseudo-fog-free image. Through this method, the dataset can be effectively expanded and the generalization ability of the model can be improved.

[0112] The following is an exemplary description of the image defogging device and related equipment based on the diffusion model provided by the present application in conjunction with specific embodiments.

[0113] like Figure 5 As shown, an embodiment of the present application provides an image defogging device based on a diffusion model, and the image defogging device 500 includes:

[0114] The first defogging module 501 is used to input the foggy image into the image defogging model based on deep learning to perform defogging processing, so as to obtain a transmission map of the foggy image;

[0115] The second defogging module 502 is used to input the transmission image into the physical defogging model for defogging processing to obtain a pseudo defogging image;

[0116] The third defogging module 503 is used to input the pseudo defogging image into the trained diffusion model for defogging processing to obtain a defogging image;

[0117] Among them, the diffusion model uses the improved Unet denoising network for denoising, and the improved Unet denoising network uses the transmission map for guidance in the denoising process;

[0118] The improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module. The input of the downsampling module is the input image of the improved Unet denoising model. The downsampling module is used to extract the feature map of the input image. The transmission module is used to obtain the guidance map using the feature map and the transmission map. The upsampling module is used to reconstruct the feature map using the guidance map and the residual connection operation to obtain a reconstructed map. The reconstructed map obtained by the last iteration of the diffusion model is the dehazed image.

[0119] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0120] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0121] like Figure 6 As shown, an embodiment of the present application provides a terminal device, such as Figure 6 As shown, the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 6 Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the steps of any of the above-mentioned method embodiments when executing the computer program D102.

[0122] Specifically, when the processor D100 executes the computer program D102, it performs preliminary defogging processing on the foggy image by using the image defogging model based on deep learning to obtain an accurate transmission map, and then further defogs the transmission map in combination with the physical defogging model to generate a pseudo defogged image, and then inputs the pseudo defogged image into the diffusion model for defogging. Since the diffusion model guides the denoising process through the transmission map, the diffusion model can better handle complex fog scenes and images with rich details compared to the traditional diffusion model, so that the defogged image output by the diffusion model is clearer and more natural than the defogged image obtained by the traditional defogging method, and is close to the real fog-free image, thereby achieving the purpose of improving the image defogging effect.

[0123] The processor D100 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0124] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC, SmartMedia Card), a secure digital (SD, Secure Digital) card, a flash card (Flash Card), etc. equipped on the terminal device D10. Further, the memory D101 may also include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory D101 may also be used to temporarily store data that has been output or is to be output.

[0125] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0126] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0127] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0128] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0129] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the image defogging device / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0130] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0131] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0132] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0134] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An image defogging method based on a diffusion model, characterized in that: include: Inputting the foggy image into an image defogging model based on deep learning to perform defogging processing, and obtaining a transmission map of the foggy image; Inputting the transmission image into a physical defogging model for defogging processing to obtain a pseudo defogging image; Inputting the pseudo defogging image into the trained diffusion model for defogging processing to obtain a defogging image; The diffusion model uses an improved Unet denoising network for denoising, and the improved Unet denoising network uses the transmission graph for guidance during the denoising process; The improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module, the input of the downsampling module is the input image of the improved Unet denoising model, the downsampling module is used to extract the feature map of the input image, the transmission module is used to obtain a guidance map using the feature map and the transmission map, the upsampling module is used to reconstruct the feature map using the guidance map and the residual connection operation to obtain a reconstructed map, and the reconstructed map obtained by the last iteration of the diffusion model is the defogging image; The downsampling module includes four downsampling layers connected in sequence, the transmission module includes three transmission layers connected in sequence, and the upsampling module includes four upsampling layers connected in sequence; The input end of the first downsampling layer is the input end of the downsampling module, the output end of the fourth upsampling layer is the output end of the upsampling module, the output end of the i-th downsampling layer is connected to the input end of the i-th transmission layer and the input end of the i-th upsampling layer respectively, and the output end of the i-th transmission layer is connected to the input end of the i-th upsampling layer. , the output end of the fourth downsampling layer is connected to the input end of the fourth upsampling layer; The i-th downsampling layer is used to calculate the Get feature map ; ; in, represents the feature map output by the i-1th downsampling layer, represents the input image of the improved Unet denoising network, represents the relu activation function, represents the maximum pooling downsampling operation, Represents 2 3x3 convolution operations; The i-th transmission layer is used to obtain the guidance graph through the transmission guidance formula , , the transmission guidance formula is: ; in, represents the maximum pooling operation, represents the normalization operation, represents the inter-layer graph of the output of the i-1th transmission layer to the i-th transmission layer, represents the transmission diagram, represents the Hadamard dot product operation; The i-th upsampling layer is used to obtain the reconstructed image through the reconstruction formula ; exist When , the reconstruction formula is: in, represents the residual connection operation, represents the relu activation function, represents a 3x3 deconvolution upsampling operation, represents the reconstructed image output by the i-1th upsampling layer, ; exist When , the reconstruction formula is: .

2. The image defogging method according to claim 1, characterized in that: The expression of the loss function used in the training process of the diffusion model is: in, represents the loss value of the loss function, represents a 3x3 convolution operation, represents the dehazed image output by the diffusion model, represents the maximum pooling operation, It represents the pseudo dehazed denoised image output by the diffusion model in the denoising stage.

3. An image defogging device based on a diffusion model, characterized in that: include: A first defogging module is used to input the foggy image into the image defogging model based on deep learning to perform defogging processing, so as to obtain a transmission map of the foggy image; A second defogging module is used to input the transmission image into a physical defogging model for defogging processing to obtain a pseudo defogging image; A third defogging module is used to input the pseudo defogging image into the trained diffusion model for defogging processing to obtain a defogging image; The diffusion model uses an improved Unet denoising network for denoising, and the improved Unet denoising network uses the transmission graph for guidance during the denoising process; The improved Unet denoising model includes a downsampling module, a transmission module and an upsampling module, the input of the downsampling module is the input image of the improved Unet denoising model, the downsampling module is used to extract the feature map of the input image, the transmission module is used to obtain a guidance map using the feature map and the transmission map, the upsampling module is used to reconstruct the feature map using the guidance map and the residual connection operation to obtain a reconstructed map, and the reconstructed map obtained by the last iteration of the diffusion model is the defogging image; The down-sampling module comprises four down-sampling layers connected in sequence, the transmission module comprises three transmission layers connected in sequence, and the up-sampling module comprises four up-sampling layers connected in sequence; The input end of the first downsampling layer is the input end of the downsampling module, the output end of the fourth upsampling layer is the output end of the upsampling module, the output end of the i-th downsampling layer is connected to the input end of the i-th transmission layer and the input end of the i-th upsampling layer respectively, and the output end of the i-th transmission layer is connected to the input end of the i-th upsampling layer. , the output end of the fourth downsampling layer is connected to the input end of the fourth upsampling layer; The i-th downsampling layer is used to calculate the Get feature map ; ; in, represents the feature map output by the i-1th downsampling layer, represents the input image of the improved Unet denoising network, represents the relu activation function, represents the maximum pooling downsampling operation, Represents 2 3x3 convolution operations; The i-th transmission layer is used to obtain the guidance graph through the transmission guidance formula , , the transmission guidance formula is: ; ; in, represents the maximum pooling operation, represents the normalization operation, represents the inter-layer graph of the output of the i-1th transmission layer to the i-th transmission layer, represents the transmission diagram, represents the Hadamard dot product operation; The i-th upsampling layer is used to obtain the reconstructed image through the reconstruction formula ; exist When , the reconstruction formula is: ; ; in, represents the residual connection operation, represents the relu activation function, represents a 3x3 deconvolution upsampling operation, represents the reconstructed image output by the i-1th upsampling layer, ; exist When , the reconstruction formula is: .

4. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the image defogging method based on the diffusion model as described in any one of claims 1 to 2 is implemented.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image defogging method based on the diffusion model as described in any one of claims 1 to 2 is implemented.

Citation Information

Cited By

  • Low-complexity single-frame image reconstruction method suitable for extreme rain and fog conditions

    CN119417726A