An image dehazing method based on recurrent generative adversarial network
Through the improved CycleGAN network, combined with the spatial and channel residual attention modules and the cycle-aware consistency loss function, the problems of incomplete image dehazing and color distortion in the existing technology are solved, and a more efficient image dehazing effect is achieved.
Patent Information
- Application Number
- CN202310404372.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2043-04-17
AI Technical Summary
Existing image dehazing technologies do not perform well when processing real foggy images, and suffer from problems such as incomplete dehazing, color distortion, and loss of complex image details.
An improved cycle generative adversarial network (CycleGAN) is adopted to introduce spatial and channel residual attention modules into the network structure, and a cycle-aware consistency loss function is added to enhance feature extraction and image restoration capabilities.
It improves the image dehazing effect, achieves more thorough dehazing and higher image resolution, enhances image brightness and contrast, and reduces color distortion and detail loss.
Smart Images

Figure CN116664415B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning image processing technology, and in particular to an image defogging method based on a cyclic generative adversarial network. Background Art
[0002] In our daily lives, the quality of images captured in outdoor scenes is often unsatisfactory due to the presence of atmospheric particles in the air, significantly reducing the visual quality. Fog, smoke, and other phenomena are caused by the absorption and refraction of atmospheric light by these particles. Images in these scenes typically exhibit increased brightness and decreased contrast, hindering feature extraction and recognition. This makes it difficult to use various devices that rely on imaging systems, further complicating subsequent image processing. In image processing and computer vision fields, such as image recognition, object tracking, image classification, and object detection, the assumption is that the image being processed is clear. Foggy images can exacerbate these challenges.
[0003] On the other hand, due to the harsh changes in the modern environment and the accompanying pollution, smog is becoming increasingly common. This not only causes trouble in people's daily lives but also poses significant challenges to video surveillance. As mentioned earlier, videos captured in foggy weather have high brightness, low contrast, and poor visibility, making it difficult to discern certain illegal license plates and other objects in surveillance videos. Image dehazing is a key technology for further processing foggy images. The desired result is to restore the underlying clarity of foggy images captured on foggy days, improving their quality and visual quality. Therefore, there is an urgent need for dehazing foggy images, both from a research and application perspective.
[0004] In recent years, various technical methods for image dehazing have been proposed at home and abroad, but image dehazing still has the following shortcomings:
[0005] 1. Using the atmospheric light scattering model for dehazing often leads to further amplification of errors in the calculated haze-free image due to inaccuracies in atmospheric light intensity and transmittance estimation, ultimately resulting in incomplete image dehazing and color distortion.
[0006] 2. Existing models often require paired datasets for image dehazing. Since most paired datasets are synthetic, the tested models perform poorly on real foggy images.
[0007] 3. Real-world foggy images can be complex and diverse. Dehazing is still not ideal for dense fog, images with cluttered backgrounds, indoor foggy images, and foggy images at night under multiple light sources. Using a simple top-down deep neural network will lose some low-level features during repeated convolution and pooling, resulting in incomplete dehazing and loss of background details in complex images.
[0008] Therefore, we propose an image dehazing method based on cyclic generative adversarial networks to solve the above problems. Summary of the Invention
[0009] (1) Technical problems solved
[0010] In response to the shortcomings of the existing technology, the present invention provides an image defogging method based on a recurrent generative adversarial network, which solves the problems that the existing model has poor results on real foggy images, the existing technology has incomplete defogging, color distortion, and loss of background details in complex images.
[0011] (2) Technical solution
[0012] CycleGAN is composed of two GAN networks. CycleGAN shares the generators of two unidirectional GAN networks, and each has a discriminator, that is, there are two discriminators and two generators in total. A unidirectional GAN has two losses, and two have four losses in total. The generator consists of an encoder, a converter, and a decoder. Encoding: The first step is to use a convolutional neural network to extract features from the input image. The image is compressed into 256 64*64 feature vectors. Conversion: By combining the dissimilar features of the image, the feature vector of the image in the DA domain is converted into a feature vector in the DB domain. Decoding: Use the deconvolution layer to complete the task of restoring low-level features from the feature vector, and finally obtain the generated image.
[0013] CycleGAN (Cycle Generative Adversarial Network) consists of two mirror-symmetric GAN networks, forming a ring network. The two GANs share two generators, each with a discriminator, for a total of two discriminators and two generators. CycleGAN can transform one type of image into another. Due to its ring structure, the two types of images may not have a one-to-one correspondence during training. Unlike traditional standard datasets, the training dataset does not require a corresponding relationship, solving the problem of network training being unable to complete due to a small dataset. However, due to the relatively weak constraints of the network itself, the transformed images may contain some anomalies and have a high degree of randomness, making the results less than ideal.
[0014] Based on the above-mentioned deficiencies in the prior art, the object of the present invention is to provide an image defogging method based on a cyclic generative adversarial network, so as to achieve a more thorough defogging method with better PSNR and SSIM values.
[0015] An improved CycleGAN network is proposed for image dehazing. Its network structure is as follows: Figure 1 , unpaired foggy and non-fog images are input into the network, and the foggy (non-fog) images are learned through the features of the generators G and F to generate non-fog (fog) images, and then passed through the generators G and F to generate foggy (non-fog) images. The discriminators Dx and Dy discriminate the foggy and non-fog images generated by the network structure from the original input foggy and non-fog images. CycleGAN is a network in which a generator and a discriminator interact within the network structure. Including a loss function in the model improves feature extraction from the final output graphs of the generator and discriminator. The CycleGAN architecture for single image dehazing is enhanced by adding a cycle-aware consistency loss to the existing cycle consistency loss. To address issues such as image blur and color distortion, CycleGAN introduces spatial and channel-wise residual attention modules. Channel and spatial attention mechanisms target the ability to distinguish between different spatial pixels and feature channels. Channel attention focuses on different channel features. Given the uneven distribution of haze across different image pixels, spatial attention allows the network to focus on informative features, such as dense haze pixels and high-frequency image regions. Residual networks can address the problems of vanishing and gradient degradation caused by deep network layers. Introducing channel and residual attention mechanisms into residual networks, forming spatial and channel-wise residual attention blocks, prevents feature-level information from being lost during feature extraction.
[0016] The following technical solutions are specifically adopted:
[0017] An image dehazing method based on a cyclic generative adversarial network comprises the following steps:
[0018] S1. Obtain the data set and build a cyclic generative adversarial network model;
[0019] The dataset of foggy and non-fog images includes a training set and a test set. The training set consists of an indoor training set and an outdoor training set. The test set uses a synthetic objective test set and a mixed subjective test set. The ratio of the training set to the test set is 8:2.
[0020] The Cycle Generative Adversarial Network model is an adversarial network that adds a cycle-perceptual consistency loss to the network's original loss function, enhancing the CycleGAN architecture for single image dehazing.
[0021] S2: Input foggy and fog-free images. The generator learns the image features of foggy and fog-free images and generates foggy and fog-free images through the generator network.
[0022] The generator includes generator G and generator F. An attention mechanism is added to the networks of generator G and generator F of CycleGAN to enhance feature extraction. Generator G and generator F both use an encoder-converter-decoder structure. Spatial and channel attention mechanisms are added to the converter, and spatial and channel residual attention modules are designed to process the extracted features in a targeted manner before inputting them into the decoder of the network.
[0023] S3, the discriminator discriminates the foggy and fog-free images generated by the generator and the foggy and fog-free images of the original input, and outputs the discrimination result;
[0024] S4. Objectively judge the dehazed image.
[0025] Furthermore, the loss function used in the recurrent generative adversarial network model is an adversarial loss function, which consists of the following two parts:
[0026]
[0027] D Y What is generated is a matrix, and the loss is calculated using MSE (mean square error) loss; x represents the source domain image, and y represents the target domain image; the goal of the generator G is to minimize the loss function, and the discriminator D Y The goal is to maximize the loss function;
[0028] For the generator F and the discriminator D X , the adversarial loss function is mathematically expressed as:
[0029]
[0030] The cycle-aware consistency loss is to preserve the characteristics of the original image by looking at the combination of high-level and low-level features. Under the constraints of x∈X, y∈Y and generator G:X→Y, generator F:Y→X, the formula of the cycle-aware consistency loss is as follows:
[0031]
[0032] The total loss function of CycleGAN can be expressed as:
[0033]
[0034] where γ is the influence of the control loop-aware consistency loss.
[0035] Furthermore, the generator G and the generator F have the same structure, both consisting of an encoder, a converter and a decoder;
[0036] The encoder is composed of multiple CBL sequences and Reflectionpad2d. The function of Reflectionpad2d is to perform image enhancement. The Reflectionpad2d function is used to fill parameters and symmetrically increase the resolution of the image along the edge. The input image first enters the encoder, and a color image with a size of 256*256 is input into the network. The output dimension is 3. The image is first entered into the image enhancement layer for image enhancement, and then a convolution kernel size of 3*3, BN regularization and activation function are performed to perform feature extraction. Then, convolution operations with convolution kernel sizes of 3*3, 5*5, and 7*7 are performed to increase the receptive field and extract feature maps.
[0037] The converter uses spatial and channel residual attention modules in a chained structure. "SA Block" represents the spatial attention module, "CA Block" represents the channel attention module, and "Concat" represents the feature map joint operation. When C represents the number of channels in the input feature map, the number of input and output channels of the 1st, 3rd, 4th, and 6th convolution operations in the residual block are all C, and the number of input and output channels of the 2nd and 5th convolution operations are 2*C and C respectively.
[0038] The decoder is composed of multiple CTBR sequences, uses deconvolution to upsample the image, adds image enhancement operations, and performs image enhancement on the feature map.
[0039] Furthermore, the discriminator is used to accurately distinguish the images generated by the generator from the original sample images. The fully convolutional neural network PatchGAN is adopted, and the network output is a discriminant matrix; the convolution kernel size of the convolution operation is 3*3, the step size is 2*2, and the edge zero padding is 1*1.
[0040] Furthermore, the judgment criterion of step S4 is to compare the difference between the processed image and the real clear image in terms of brightness, contrast and structure, and to quantitatively evaluate the image processing effect;
[0041] The quantitative evaluation is to quantitatively analyze the defogging effect using two indicators: peak signal-to-noise ratio and structural similarity. The peak signal-to-noise ratio is expressed as:
[0042]
[0043] Where n represents the number of bits per pixel, which is 8 for grayscale images and 24 for color images. MSE represents the mean square error between the restored image and the true clear image, which is mathematically expressed as:
[0044]
[0045] Where H represents the height of the image, and W represents the width of the image. The unit of peak signal-to-noise ratio is dB. The larger the value, the smaller the distortion of the restored image relative to the true clear image, and the better the dehazing effect. The smaller the value, the greater the difference between the restored image and the true clear image.
[0046] The structural similarity measures the similarity between two images from the aspects of image brightness, image contrast and structural information, which can be expressed mathematically as:
[0047] SSIM=l(X,Y)×c(X,Y)×s(X,Y)
[0048] Where l(X,Y), c(X,Y), and s(X,Y) are expressed as:
[0049]
[0050] Among them, μ x Represents the mean of the real clear image X, μ y Represents the mean value of the real clear image Y, that is
[0051]
[0052] Where H represents the height of the image, W represents the width of the image; δ x represents the variance of the restored image X, represents the variance of the real clear image Y, δ xy It represents the covariance between the restored image X and the real clear image Y, which can be expressed as:
[0053]
[0054] and
[0055]
[0056] Among them, C1, C2, and C3 are constants to avoid the situation where the denominator is equal to 0. The value range of structural similarity is [0, 1]. The larger the value, the smaller the distortion of the restored image to the real clear image and the better the defogging effect; the smaller the value, the greater the difference between the restored image and the real clear image.
[0057] (3) Beneficial effects
[0058] Compared with the existing technology, the present invention provides an image dehazing method based on a recurrent generative adversarial network, which has the following beneficial effects:
[0059] The present invention adopts an improved cyclic generative adversarial network, which can solve the problems of incomplete defogging and color distortion in existing image defogging technology without the need for paired data sets (pairs of foggy and non-fog images in the same scene). A cyclic perceptual consistency loss function is added to the model, so that the generators G and F will not generate fixed images when generating pictures to try to deceive the discriminator; it helps to restore the details and texture information of the image during feature extraction, and introduces spatial and channel residual attention modules, so that when the network performs feature learning, it pays more attention to the parts with more feature information, thereby improving the resolution of the defogging image; the present invention can play a significant role in target tracking, image classification, target detection and other fields that require clear images. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram of a network structure based on a cyclic generative adversarial network of the present invention;
[0061] Figure 2 This is a schematic diagram of the improved generator network structure adopted by the present invention;
[0062] Figure 3 This is a schematic diagram of the structure of the improved spatial and channel residual attention module of the present invention;
[0063] Figure 4 Schematic diagram of the network structure of the discriminator of the present invention. DETAILED DESCRIPTION
[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0065] Example
[0066] like Figure 1-4 As shown, an image defogging method based on a cyclic generative adversarial network proposed in one embodiment of the present invention includes the following steps:
[0067] Step 1: Obtain the dataset and build a cyclic generative adversarial network model
[0068] The dataset includes a training set and a test set. The training set consists of an indoor training set and an outdoor training set. The training set selects the indoor training set (ITS) and the outdoor training set (OTS), with a total of 86,125 foggy and non-fog pictures. The test set uses the synthetic objective test set (SOTS) and the hybrid subjective test set (HSTS), with a total of 520 pictures. This dataset is a mixed dataset of real and synthetic, indoor and outdoor pictures, and the ratio of training set to test set is 8:2.
[0069] The original losses in the Cycle Generative Adversarial Network model are adversarial loss and cycle consistency loss. The cycle consistency loss is changed to cycle-aware consistency loss to constrain the lazy behavior of the generator in the network loop and enhance the CycleGAN architecture for single image dehazing.
[0070] The loss function used in the model is divided into two parts. The first part is the adversarial loss. The role of the generator is to try to generate pictures that can deceive the discriminator, and the role of the discriminator is to try to detect the fake pictures generated by the generator.
[0071] The adversarial loss consists of two parts:
[0072]
[0073] D Y What is generated is a matrix, and the loss is calculated using MSE (mean square error) loss; x represents the source domain image, and y represents the target domain image; the goal of the generator G is to minimize the loss function, and the discriminator D Y The goal is to maximize this loss function.
[0074] For the generator F and the discriminator D X , the adversarial loss function is mathematically expressed as:
[0075]
[0076] Cyclicperceptual-consistencyloss (Cyclic Perceptual Consistency Loss)
[0077] The second part of the loss function used in the model is the cycle-aware consistency loss. In theory, adversarial training can learn mapping outputs G and F that produce the same distribution as the target domains Y and X, respectively. However, with a large enough capacity, the network can map the same set of input images to any random permutation of images in the target domain. Therefore, the adversarial loss alone cannot guarantee that a single input can be mapped. An additional loss is needed to ensure that G and F not only satisfy their respective discriminators but can also be applied to other images. The CycleGAN architecture introduces a cycle consistency loss, which calculates the L1-norm between the original image and the cycle image for unpaired image-to-image translation tasks. However, this computational loss between the original image and the cycle image is not enough to recover all texture information, because the blurred images are mostly severely damaged. The cycle-aware consistency loss aims to preserve the original image structure by looking at the combination of high-level and low-level features. Under the constraints of x∈X, y∈Y and generator G:X→Y, generator F:Y→X, the formula of the cycle-aware consistency loss is as follows:
[0078]
[0079] The total loss function of CycleGAN can be expressed as:
[0080]
[0081] γ is the influence of controlling the cycle-aware consistency loss.
[0082] Step 2: Input foggy and fog-free images into the network. The input images first enter the two generators. The generators learn the image features of foggy and fog-free images, and generate foggy and fog-free images based on the feature learning.
[0083] An attention mechanism is added to the generator network of CycleGAN to enhance feature extraction. After extracting features from the hidden layer, spatial and channel attention mechanisms are added to process the extracted features in a targeted manner before inputting them into the network's output layer. Channel attention targets features from different channels, while spatial attention targets feature information at different pixels when fog concentration is uneven. If spatial pixels and feature channels in the feature map are treated equally and given the same weight, the network will waste computational power on features with lower value. To make the network focus more on information-rich or high-value pixel regions and feature channels, a residual network is introduced. Spatial and channel residual attention modules are designed to mitigate the gradient vanishing and degradation problems caused by the excessive number of hidden layers in the generator network. This module consists of two residual groups, a long skip connection, and two sequences of Conv-BN-Relu operations. Each residual group contains a spatial attention module, a channel attention module, and two sequences of Conv-BN-Relu operations. Two consecutive residual groups can increase the depth and feature expression capability of the neural network.
[0084] Foggy and clean images are fed into the network, respectively. Generators G and F learn from the features of these images and generate the corresponding foggy and clean images. Generators G and F share the same structure, consisting of an encoder, a converter, and a decoder. The encoder consists of multiple CBL (Conv+Batch Normalization+LeakyReLU) sequences and a Reflectionpad2d function. The Reflectionpad2d function performs image enhancement and pads parameters to increase the image resolution symmetrically along the edges. The input image first enters the encoder, where a 256*256 color image is fed into the network. The output dimension is 3. The image first enters the ReflectionPad2d layer for image enhancement, followed by a convolution with a 3*3 kernel size, BN regularization, and an activation function for feature extraction. Finally, convolution operations with kernel sizes of 3*3, 5*5, and 7*7 are performed to increase the receptive field and extract feature maps.
[0085] The converter uses spatial and channel residual attention modules (Residual Group) in a chained structure. "SA Block" represents the spatial attention module, "CA Block" represents the channel attention module, and "Concat" represents the joint operation of feature maps. If C is used to represent the number of channels in the input feature map, the input and output channels of the 1st, 3rd, 4th, and 6th convolution operations in the residual block are all C, and the input and output channels of the 2nd and 5th convolution operations are 2*C and C respectively. The decoder uses multiple CTBR (ConvTranspose+Batch Normalization+ReLU) sequences, uses deconvolution to upsample the image, and adds Reflectionpad2d operations to enhance the feature map. The specific generator parameter information is as follows:
[0086]
[0087]
[0088] S3: The discriminator discriminates the foggy and non-fog images generated by the generator and the foggy and non-fog images of the original input, and outputs the discrimination results
[0089] The structure of the discriminator is as follows Figure 4 As shown in the figure, its goal is to accurately distinguish the images generated by the generator from the original sample images. The fully convolutional neural network PatchGAN is used, and the network output is a discriminant matrix. The convolution kernel size of the convolution operation is 3*3, the step size is 2*2, and the edge zero padding is 1*1. Each pixel of the matrix represents the probability that a certain image block in the original image is a restored sample or a true sample. Therefore, it can fully consider the impact of different areas in the image on the discrimination result, so that the generator can focus more on restoring the details, texture and other information of the image during training, and help reduce artifacts in the restored image. The specific discriminator parameters are shown in the table below:
[0090]
[0091]
[0092] S4: Objectively judge the defogging image
[0093] The judgment criteria compare the differences between the processed image and the real clear image in terms of brightness, contrast, structure, etc., quantitatively evaluating the image processing effect with high objectivity. The present invention uses two indicators, Peak Signal to Noise Ratio (PSNR) and Structural Similarity (SSIM), to quantitatively analyze the dehazing effect.
[0094] Peak signal-to-noise ratio (PSNR) is an objective image restoration evaluation annotation, which can be expressed mathematically as:
[0095]
[0096] Where n represents the number of bits per pixel, which is 8 for grayscale images and 24 for color images. MSE represents the mean square error between the restored image and the true clear image, which is mathematically expressed as:
[0097]
[0098] Where H represents the height of the image, and W represents the width of the image. The unit of peak signal-to-noise ratio is dB. The larger the value, the smaller the distortion of the restored image relative to the true clear image, and the better the dehazing effect. The smaller the value, the greater the difference between the restored image and the true clear image.
[0099] Structural similarity (SSIM) is also a widely used objective evaluation criterion in the field of image restoration. It measures the similarity between two images from the aspects of image brightness, image contrast, and structural information. It can be expressed mathematically as:
[0100] SSIM=l(X,Y)×c(X,Y)×s(X,Y)
[0101] Where l(X,Y), c(X,Y), and s(X,Y) are expressed as:
[0102]
[0103] Among them, μ x Represents the mean of the real clear image X, μ y Represents the mean value of the real clear image Y, that is
[0104]
[0105] Where H represents the height of the image, W represents the width of the image; δ x represents the variance of the restored image X, represents the variance of the real clear image Y, δ xyIt represents the covariance between the restored image X and the real clear image Y, which can be expressed as:
[0106]
[0107] and
[0108]
[0109] Among them, C1, C2, and C3 are constants to avoid the situation where the denominator is equal to 0. The value range of structural similarity is [0, 1]. The larger the value, the smaller the distortion of the restored image to the real clear image and the better the defogging effect; the smaller the value, the greater the difference between the restored image and the real clear image.
[0110] The present invention adopts an improved cyclic generative adversarial network, which can solve the problems of incomplete defogging and color distortion in existing image defogging technologies without the need for paired data sets (pairs of foggy and non-fog images in the same scene). A cyclic perceptual consistency loss function is added to the model, so that the generators G and F will not generate fixed images to try to deceive the discriminator when generating images. It helps to restore the details and texture information of the image during feature extraction. The introduction of spatial and channel residual attention modules makes the network pay more attention to the parts with more feature information during feature learning, thereby improving the resolution of the defogged image.
[0111] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. An image dehazing method based on a recurrent generative adversarial network, characterized by: The following steps are involved: S1. Obtain a dataset of foggy and non-fog images and build a recurrent generative adversarial network model. The dataset of foggy and non-fog images includes a training set and a test set. The training set consists of an indoor training set and an outdoor training set. The test set uses a synthetic objective test set and a mixed subjective test set. The ratio of the training set to the test set is 8:
2. The Cycle Generative Adversarial Network model is an adversarial network that adds cycle-aware consistency loss to the network to enhance the CycleGAN architecture for single image dehazing. S2: Input foggy and fog-free images. The generator learns the image features of foggy and fog-free images and generates foggy and fog-free images through the generator network. The generator includes generator G and generator F. An attention mechanism is added to the networks of generator G and generator F of CycleGAN to enhance feature extraction. Generator G and generator F both use an encoder-converter-decoder structure. Spatial and channel attention mechanisms are added to the converter, and spatial and channel residual attention modules are designed to process the extracted features in a targeted manner before inputting them into the decoder of the network. S3, the discriminator discriminates the foggy and fog-free images generated by the generator and the foggy and fog-free images of the original input, and outputs the discrimination result; S4, objectively judge the defogging image; The generator G and the generator F have the same structure, both consisting of an encoder, a converter and a decoder; The encoder is composed of multiple CBL sequences and Reflectionpad2d. The function of the Reflectionpad2d function is to perform image enhancement. The Reflectionpad2d function is used to fill parameters and symmetrically increase the resolution of the image along the edge. The input picture first enters the encoder, and a color picture with a picture size of 256*256 is input into the network. The output dimension is 3. The image is first entered into the image enhancement layer for image enhancement, and then a convolution kernel size of 3*3, BN regularization and activation function are performed to perform feature extraction. Then, convolution operations with convolution kernel sizes of 3*3, 5*5, and 7*7 are performed to increase the receptive field and extract feature maps. The converter uses spatial and channel residual attention modules in a chained structure, where "SABlock" represents the spatial attention module, "CA Block" represents the channel attention module, and "Concat" represents the feature map joint operation. When C represents the number of channels in the input feature map, the number of input and output channels of the 1st, 3rd, 4th, and 6th convolution operations in the residual block are all C, and the number of input and output channels of the 2nd and 5th convolution operations are 2*C and C respectively. The decoder is composed of multiple CTBR sequences, uses deconvolution to upsample the image, adds image enhancement operations, and performs image enhancement on the feature map.
2. The image dehazing method based on a recurrent generative adversarial network according to claim 1, characterized in that: The loss function used in the cyclic generative adversarial network model is the adversarial loss function, which consists of the following two parts: composition: D Y What is generated is a matrix, and the loss is calculated using MSE (mean square error) loss; x represents the source domain image, and y represents the target domain image; The goal of the generator G is to minimize the loss function, and the discriminator D Y The goal is to maximize the loss function; For the generator F and the discriminator D X , the adversarial loss function is expressed as: The cycle-aware consistency loss is to preserve the characteristics of the original image by looking at the combination of high-level and low-level features. Under the constraints of x∈X, y∈Y and generator G:X→Y, generator F:Y→X, the formula of the cycle-aware consistency loss is as follows: The total loss function of CycleGAN can be expressed as: where γ is the influence of the control loop-aware consistency loss.
3. The image dehazing method based on a recurrent generative adversarial network according to claim 1, characterized in that: The discriminator is used to accurately distinguish the images generated by the generator from the original sample images. It adopts the fully convolutional neural network PatchGAN structure, and the network output is a discriminant matrix; the convolution kernel size of the convolution operation is 3*3, the step size is 2*2, and the edge zero padding is 1*1.
4. The image dehazing method based on a recurrent generative adversarial network according to claim 1, characterized in that: The judgment criterion of step S4 is to compare the difference between the processed image and the real clear image in terms of brightness, contrast and structure, and to quantitatively evaluate the image processing effect; The quantitative evaluation is to quantitatively analyze the defogging effect using two indicators: peak signal-to-noise ratio and structural similarity. The peak signal-to-noise ratio is expressed as: Where n represents the number of bits per pixel, which is 8 for grayscale images and 24 for color images. MSE represents the mean square error between the restored image and the true clear image, which is mathematically expressed as: Where H represents the height of the image, and W represents the width of the image. The unit of peak signal-to-noise ratio is dB. The larger the value, the smaller the distortion of the restored image relative to the true clear image, and the better the dehazing effect. The smaller the value, the greater the difference between the restored image and the true clear image. The structural similarity measures the similarity between two images from the aspects of image brightness, image contrast and structural information, which can be expressed mathematically as: SSIM=l(X,Y)×c(X,Y)×s(X,Y) Where l(X,Y), c(X,Y), and s(X,Y) are expressed as: Among them, μ x Represents the mean of the real clear image X, μ y Represents the mean value of the real clear image Y, that is Where H represents the height of the image, W represents the width of the image; δ x Represents the variance of the restored image X, Xδ y represents the variance of the true clear image Y, δ xy It represents the covariance between the restored image X and the real clear image Y, which can be expressed as: and Among them, C1, C2, and C3 are constants to avoid the situation where the denominator is equal to 0. The value range of structural similarity is [0, 1]. The larger the value, the smaller the distortion of the restored image to the real clear image and the better the defogging effect; the smaller the value, the greater the difference between the restored image and the real clear image.