A non-paired image defogging method based on reinforcement learning and physical mixed action
By constructing a physical hybrid action module and a composite reward loss based on reinforcement learning and unpaired image dehazing, this method solves the problems of insufficient generalization ability and low training efficiency of existing image dehazing methods in real-world scenarios, and achieves efficient and robust image dehazing results.
Patent Information
- Application Number
- CN202611290391.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2046-08-25
AI Technical Summary
Existing image dehazing methods lack generalization ability in real-world scenes, making it difficult to accurately estimate parameters such as transmittance and atmospheric light, resulting in color and structural distortion, and also have low training efficiency.
We employ an unpaired image dehazing method based on reinforcement learning and physical hybrid actions. We construct a physical hybrid action module and a composite reward loss, train the network using real foggy images and clear images, and perform image restoration through the physical hybrid action module and decoder. We optimize the dehazing strategy network by combining dark channel priors and random sampling of various action parameters.
It achieves good visual quality and physical interpretability in real-world scenarios, improves training efficiency, reduces computational costs, enhances the robustness and generalization ability of image dehazing, and is suitable for real-time applications.
Smart Images

Figure CN122820494B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image dehazing technology, specifically relating to an unpaired image dehazing method based on reinforcement learning and physical hybrid actions. Background Technology
[0002] Image dehazing technology is an important foundational technology in the field of computer vision. It is often used as a preprocessing step for high-level vision tasks such as autonomous driving, video surveillance, and intelligent security. Clear and natural input images have a significant impact on the robustness of subsequent tasks such as target detection, recognition, and tracking.
[0003] Most existing dehazing methods rely on manually designed priors to estimate unknown parameters such as transmittance and atmospheric light, and then use atmospheric scattering models to retrieve a clear image. Typical methods include dark channel priors and color line priors. These methods have a certain degree of physical interpretability, but in complex real-world scenarios, they often struggle to accurately estimate parameters and are prone to problems such as color distortion.
[0004] With the development of deep learning, data-driven image dehazing methods have made significant progress. Existing deep dehazing methods can be broadly classified into two categories: one is to explicitly estimate physical parameters in the atmospheric scattering model, such as transmittance maps and atmospheric light, and then recover a clear image based on the physical model; the other is to directly learn the end-to-end mapping relationship from a foggy image to a clear image. Although these methods usually achieve good results on synthetic datasets, most rely on large-scale paired synthetic training sets. Since the synthetic fogging process often fails to fully characterize the complex factors in the real environment, such as non-uniform fog distribution, illumination variations, color shifts, and sensor noise, these methods are often affected by significant domain differences in real-world scenes, leading to decreased generalization ability and manifesting as residual fog, structural distortion, or color anomalies.
[0005] In recent years, reinforcement learning has been introduced into the field of image restoration. Most of these efforts focus on optimizing the stepwise sampling process of diffusion models and still rely on supervised fine-tuning using paired ground truth images. This results in low visual quality and low training efficiency, making it difficult to meet the application requirements of real unpaired dehazing scenarios. In addition, there is a lack of explicit explanation of the physical mechanisms of image dehazing, making it difficult to effectively control key factors such as transmittance and atmospheric light. Summary of the Invention
[0006] The technical problem to be solved by the present invention is to address the shortcomings of the prior art by providing an unpaired image dehazing method based on reinforcement learning and physical hybrid actions. The method constructs a physical hybrid action module and a composite reward loss, and trains the network using unpaired real foggy images and real clear images. This results in the dehazing strategy network outputting dehazed images with good visual quality and physical interpretability, and high training efficiency.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for dehazing unpaired images based on reinforcement learning and physical hybrid actions, the method comprising the following steps: Step 1: Obtain unpaired real foggy images and real clear images; Step 2: Construct a dehazing strategy network; the dehazing strategy network includes an encoder, a bottleneck residual module, a decoder, and a physical hybrid action module; wherein, the physical hybrid action module includes Conv1 convolutional layer, Conv2 convolutional layer, global average pooling, global max pooling, MLP network, Conv3 convolutional layer, upsampling 1, upsampling 2, Conv4 convolutional layer, ReLU function, and Conv5 convolutional layer; the MLP network includes a first linear layer, a LeakyReLU function, and a second linear layer; Step 3: The real foggy image and the real clear image are passed through a defogging strategy network for reinforcement learning to obtain a composite reward loss; Step 4: Train the defogging policy network based on the composite reward loss to obtain the trained defogging policy network; Step 5: Use the trained dehazing strategy network to dehaze subsequent real foggy images to obtain dehazed images.
[0008] The above-mentioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes, in step two, an encoder comprising a first convolutional layer, a first physical sensing feature block, a first downsampling module, a second convolutional layer, a second physical sensing feature block, a second downsampling module, a third convolutional layer, a third physical sensing feature block, a third downsampling module, and a fourth convolutional layer. The decoder includes a first upsampling module, a fifth convolutional layer, a first physical feature extraction block, a second upsampling module, a sixth convolutional layer, a second physical feature extraction block, a third upsampling module, a seventh convolutional layer, a third physical feature extraction block, and an eighth convolutional layer; The first physical sensing feature block, the second physical sensing feature block, the third physical sensing feature block, the first physical feature extraction block, the second physical feature extraction block, and the third physical feature extraction block all have the same structure, and each includes a group normalization 1, a physical feature module, a group normalization 2, and a Gated FFN module. The physical feature module includes a first extraction branch and a second extraction branch. The first extraction branch includes a convolutional layer 1, a convolutional layer 2, a ReLU function, a convolutional layer 3, and a Sigmoid function. The second extraction branch includes a GAP module, a convolutional layer 4, a ReLU function, a convolutional layer 5, and a Sigmoid function.
[0009] The above-mentioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific steps in step three: Step 301: Divide the pixel value of each channel of the real foggy image by 255 to normalize it, and obtain the normalized real foggy image; the normalized real foggy image is processed by the encoder to obtain the encoder output feature map. Step 302: Process the encoder output feature map through the bottleneck residual module to obtain the bottleneck output feature map; Step 303: Process the bottleneck output feature map through the decoder to obtain the decoded output feature map; Step 304: The feature maps output by the first physical sensing feature block, the second physical sensing feature block and the third physical sensing feature block in the encoder are processed by the physical hybrid action module to obtain feature vectors and physical hybrid action feature maps; Step 305: Based on the feature vector and physical hybrid action feature map, obtain the distribution of perspective view, gating map, atmospheric light, saturation and contrast, and obtain 6 sets of corrected transmission map, gating map, corrected atmospheric light, corrected saturation and corrected contrast through 6 random sampling and correction of physical actions. Step 306: The normalized real foggy image is processed through 6 sets of corrected transmission map, gate map, corrected atmospheric light, corrected saturation and corrected contrast, and the feature map is decoded and output to obtain 6 sets of fused physical defogging images. Step 307: Based on the 6 sets of fused physical dehazing images, obtain the 6 total rewards corresponding to the 6 sets of fused physical dehazing images; Step 308: Perform Z-score normalization on the six total rewards corresponding to the six sets of fused physically dehazed images to obtain the six normalized values of the total rewards corresponding to the six sets of fused physically dehazed images; Step 309: Input the real clear image, and obtain the fused physical dehazing image corresponding to a random physical action according to the methods of steps 301 to 306. Record it as the clear output image, and obtain the L1 loss between the clear output image and the normalized real clear image. Step 3010, according to Resulting in compound reward loss ;in, Let g be the standardized value of the total reward corresponding to the g-th physical action. Let g be the probability corresponding to the g-th physical action. To calculate the L1 loss between the sharp output image and the normalized true sharp image, G is the number of physical actions, G = 6, g is a positive integer, and 1 ≤ g ≤ G.
[0010] The aforementioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific step 301: Step 3011: The normalized real foggy image is processed through the first convolutional layer to obtain the first feature map; the first feature map is processed through the first physical perception feature block to obtain the second feature map; the second feature map is processed through the first downsampling module to obtain the third feature map. Step 3012: Process the third feature map through the second convolutional layer to obtain the fourth feature map; process the fourth feature map through the second physical sensing feature block to obtain the fifth feature map; process the fifth feature map through the second downsampling module to obtain the sixth feature map; Step 3013: Process the sixth feature map through the third convolutional layer to obtain the seventh feature map; process the seventh feature map through the third physical sensing feature block to obtain the eighth feature map; process the eighth feature map through the third downsampling module to obtain the ninth feature map; Step 3014: Process the ninth feature map through the fourth convolutional layer to obtain the encoder output feature map; Step 303 is as follows: Step 3031: Process the bottleneck output feature map through the first upsampling module to obtain the first upsampling feature map; concatenate the first upsampling feature map and the eighth feature map channel to obtain the tenth feature map; process the tenth feature map through the fifth convolutional layer to obtain the eleventh feature map; process the eleventh feature map through the first physical feature extraction block to obtain the twelfth feature map. Step 3032: Process the twelfth feature map through the second upsampling module to obtain the second upsampling feature map; concatenate the second upsampling feature map and the fifth feature map channel to obtain the thirteenth feature map; process the thirteenth feature map through the sixth convolutional layer to obtain the fourteenth feature map; process the fourteenth feature map through the second physical feature extraction block to obtain the fifteenth feature map; Step 3033: Process the fifteenth feature map through the third upsampling module to obtain the third upsampling feature map; concatenate the third upsampling feature map and the second feature map channel to obtain the sixteenth feature map; process the sixteenth feature map through the seventh convolutional layer to obtain the seventeenth feature map; process the seventeenth feature map through the third physical feature extraction block to obtain the eighteenth feature map; Step 3034: Process the eighteenth feature map through the eighth convolutional layer to obtain the decoded output feature map.
[0011] The aforementioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific step 304: Step 3041: Process the second feature map through a Conv1 convolutional layer to obtain the first intermediate feature map, and process the fifth feature map through a Conv2 convolutional layer to obtain the second intermediate feature map; Step 3042: The eighth feature map is processed by global average pooling, global max pooling and Conv3 convolutional layer respectively to obtain the third intermediate feature map, the fourth intermediate feature map and the fifth intermediate feature map. The fifth intermediate feature map is upsampled by 1 to obtain the sixth intermediate feature map. Step 3043: Add the sixth intermediate feature map and the second intermediate feature map element by element to obtain the seventh intermediate feature map; the seventh intermediate feature map is then upsampled by 2 to obtain the eighth intermediate feature map; Step 3044: Add the eighth intermediate feature map and the first intermediate feature map element by element to obtain the ninth intermediate feature map, and process the ninth intermediate feature map through a Conv4 convolutional layer, a ReLU function and a Conv5 convolutional layer to obtain the physical hybrid action feature map. Step 3045: Concatenate the third intermediate feature map and the fourth intermediate feature map through channels to obtain the concatenated feature map, and then pass the concatenated feature map through an MLP network to obtain the feature vector.
[0012] The aforementioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific step 305: Step 3051: The normalized real foggy image is processed using the dark channel prior algorithm to obtain the prior atmospheric light A0 and the prior transmittance map t0. Step 3052: Select the first 6 data points from the feature vector as the mean, variance, green channel component, variance, blue channel component, and variance of the red channel component of atmospheric light, respectively. Add the mean, variance, and variance of the red channel component to the three components of the prior atmospheric light A0 to obtain the corrected mean, variance, and variance of the red channel component. The 7th and 8th data points in the feature vector are used as the variance and mean of saturation, and the 9th and 10th data points in the feature vector are used as the variance and mean of contrast. Step 3053: Add the first channel image of the physical mixed motion feature map and the prior transmittance map t0 to obtain the mean map of the transmittance map, and use the second channel image of the physical mixed motion feature map as the variance map of the transmittance map. Add 1.1 to each pixel value in the 3rd and 4th channel images of the physical hybrid action feature map to obtain the corrected 3rd and 4th channel images, and use the corrected 3rd and 4th channel images as the α parameter map and β parameter map of the gating map; Step 3054: Based on the corrected red channel component mean, red channel component variance, corrected green channel component mean, green channel component variance, corrected blue channel component mean, and blue channel component variance, obtain the normal distribution of atmospheric light; based on the variance and mean of saturation, obtain the normal distribution of saturation; based on the variance and mean of contrast, obtain the normal distribution of contrast. Based on the mean and variance plots of the transmission map, the normal distribution of each pixel value on the transmission map is obtained; Based on the α-parameter map and β-parameter map of the gated graph, the beta distribution of each pixel value on the gated graph is obtained; Step 3055: Randomly sample the values of each pixel on the gated graph to obtain the gated graph; Random sampling is performed based on the normal distribution of each pixel value in the transmission image to obtain each pixel value in the transmission image; each pixel value in the transmission image is then processed sequentially by the sigmoid function and the Clamp(0.1,1.0) function to obtain each corrected pixel value in the transmission image, thus obtaining the corrected transmission image; Random sampling is performed based on the normal distribution of atmospheric light to obtain the atmospheric light component A of any channel. Then, according to A´=sigmoid(A)×0.75+0.25, the corrected atmospheric light component A´ of any channel is obtained; where sigmoid(A)×0.75+0.25. () is the operation of the sigmoid function; Random sampling is performed based on the normal distribution of saturation to obtain the saturation S, and the corrected saturation S' is obtained according to S' = 1.0 + 1.0 × tanh(S); where tanh( ) represents the operation of the tanh function; Random sampling is performed based on the normal distribution of contrast to obtain the contrast C, and the corrected contrast C' is obtained according to C'=1.0+0.6×tanh(C); Step 3056: Following the method in step 3055, obtain 6 sets of corrected transmission maps, gated maps, corrected atmospheric light, corrected saturation, and corrected contrast.
[0013] The aforementioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific step 306: Step 3061: According to J(j)=[I(j)-A´] / t(j)+A´, obtain the j-th pixel value J(j) in any channel after dehazing; where I(j) is the j-th pixel value in any channel of the normalized real hazy image, A´ is the corrected atmospheric light component of any channel, t(j) is the j-th pixel value in the corrected transmission image, j is a positive integer, the value range of j is 1~N, and N is the total number of pixels; Step 3062: According to J(j)´=[J(j)-0.5]×C´+0.5, obtain the value J(j)´ of the j-th pixel in any channel after contrast enhancement; Step 3063: Repeat steps 3061 and 3062 multiple times to obtain the red channel component, green channel component and blue channel component after contrast enhancement. Step 3064: Process according to gray=0.299R+0.587G´+0.114B to obtain the grayscale image gray; where R is the red channel component after contrast enhancement, G´ is the green channel component after contrast enhancement, and B is the blue channel component after contrast enhancement. Step 3065: According to Ji´=Ji×S´+gray×(1-S´), obtain the saturation-enhanced image Ji´ of any channel; where Ji is any channel component after contrast enhancement; Step 3066: According to Ji´´=Ji´+Gk⊙Jri, obtain any channel synthesis map Ji´´; where Gk is the gated map, ⊙ is the Hadamard product operation, and Jri is any channel map in the decoded output feature map; Step 3067: Repeat steps 3065 and 3066 multiple times to obtain a composite image of three channels, which is then combined to obtain a fused physical dehazing image; Step 3068: Following the methods of steps 3061 to 3067, input 6 different sets of corrected transmission maps, gated maps, corrected atmospheric light, corrected saturation, and corrected contrast to obtain 6 sets of fused physical dehazing images.
[0014] The aforementioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific step 307: Step 3071: Input the fused physically dehazed image into the no-reference image quality assessment model MUSIQ to obtain the first index Rmusiq, and obtain the corrected first index Rm according to Rm=(Rmusiq / 100-0.5)×10; Step 3072: Input the fused physically dehazed image into the Natural Image Quality Evaluator (NIQE) to obtain the second index Rniqe. According to Rni = -(Rniqe - 3.8) × 2.5, the second index Rni after the first correction is obtained. Then, after processing by the Clamp (-6.0, 2.0) function, the second index Rn after the second correction is obtained. Step 3073: Obtain the perceived quality reward Rgz according to Rgz=Rm+Rn; Step 3074: Process the fused physically dehazed image and positive cue words through the CLIP encoder to obtain the positive semantic alignment reward Rz; process the fused physically dehazed image and negative cue words through the CLIP encoder to obtain the negative semantic alignment reward Rf; obtain the semantic reward Rcl according to Rcl=(Rz-Rf)×50; Step 3075: The fused physical dehazing image is processed based on the corrected transmission map and the corrected atmospheric light inversion to obtain a hazy physical image; the mean absolute error (Means) between the hazy physical image and the normalized real hazy image is obtained; and the structural consistency reward (Rp) is obtained according to Rp=-Means. Step 3076: Based on Rt=2×Rgz+2×Rcl+0.1×Rp, the total reward Rt is obtained; Step 3077: Repeat steps 3071 to 3076 multiple times to obtain 6 total rewards corresponding to 6 sets of fused physical dehazing images.
[0015] The above-mentioned unpaired image dehazing method based on reinforcement learning and physical hybrid actions further includes the following specific steps in step four: The computer uses the Adam optimizer, inputting real foggy images and real clear images from the training set, and trains the defogging policy network using the compound reward loss until a set number of training rounds are reached, resulting in a well-trained defogging policy network. The specific process of step five is as follows: The computer inputs any subsequent real foggy image into the trained dehazing strategy network, and selects the fused physical dehazing image corresponding to the physical action with the highest sampling probability for correcting the transmission map, gating map, atmospheric light, saturation, and contrast. Then, the pixel value of each channel of the fused physical dehazing image is multiplied by 255 and inversely normalized to obtain the dehazing image.
[0016] Compared with the prior art, the present invention has the following advantages: 1. This invention constructs a physical hybrid action module and a composite reward loss, which solves the problems of unstable training, insufficient physical constraints, poor subjective visual quality and limited generalization ability of existing unpaired real-scene dehazing methods, thereby achieving a more stable, efficient and realistic image dehazing effect that conforms to human visual perception.
[0017] 2. When constructing the physical hybrid action module, this invention combines dark channel priors to establish a physical hybrid action space, which allows the action exploration of transmittance maps and global atmospheric light to revolve around physically reasonable regions, thereby narrowing the search range, improving exploration efficiency, and enhancing training stability. At the same time, by using action components such as saturation parameters, contrast parameters, and spatial gating maps, visual enhancement can be further achieved on the basis of physical constraints, thus taking into account both physical interpretability and subjective visual quality, and improving the robustness and generalization ability of dehazing real scene images.
[0018] 3. Traditional reinforcement learning involves multi-step decision-making, which is computationally expensive and slow to converge. In contrast, this invention models dehazing as a single-step decision-making process, allowing the network to output all action parameters at once, which greatly reduces inference latency and is suitable for real-time applications. Furthermore, all operations required for dehazing (physical parameters, augmentation parameters, and spatial gating) are packaged into a unified hybrid action, enabling reinforcement learning optimization to adjust all parameters simultaneously and avoiding suboptimal solutions or error accumulation that may result from step-by-step optimization. In addition, single-step decision-making is suitable for end-to-end gradient backpropagation, which allows subsequent reinforcement learning reward signals to directly affect the parameter updates of all modules without the need for complex intermediate reward design.
[0019] 4. It is very difficult to directly predict transmittance and atmospheric light from scratch in conventional methods, and it is easy to converge to a physically unreasonable region. Therefore, this invention provides an initial estimate through physical priors such as dark channel priors, which greatly reduces the action exploration space and improves the sample efficiency of reinforcement learning. In addition, ensuring physical rationality ensures that the actions do not deviate too far from physical laws, avoiding over-enhancement or color distortion; and it has cross-scene generalization ability, that is, the physical prior has a certain robustness under different fog concentrations, which can help the network maintain a stable initial state in different scenarios (thin fog, thick fog, night fog), reducing the risk of the network overfitting to the training set distribution.
[0020] 5. When obtaining the distributions of perspective view, gated view, atmospheric light, saturation and contrast, this invention considers that different types of action parameters have different statistical characteristics. For example, transmittance, atmospheric light, saturation and contrast parameters are suitable for normal distribution; spatial gated view is suitable for beta distribution. This heterogeneous modeling is more consistent with the actual physical process than a uniform distribution assumption. In addition, random sampling during the training phase allows the network to explore different action combinations and discover better dehazing strategies; the use of maximum probability output in subsequent phases ensures the stability and repeatability of the results.
[0021] 6. This invention utilizes modified transmittance and atmospheric light to reconstruct the image using an atmospheric scattering model, ensuring the physical consistency of the dehazing results. Compared to directly reverting to a clear image, this reconstruction method is more robust to extreme scenes. In addition, compensation is provided by an enhancement module because the physical model assumes uniform atmospheric light, which often does not hold true in real scenes. The introduction of saturation and contrast parameters can compensate for the shortcomings of the physical model. For example, saturation is adjusted in the sky area to prevent oversaturation, and contrast is increased in the detail area to enhance texture.
[0022] 7. The dehazed image output by the decoder of this invention contains high-frequency details (texture, edges) extracted by the network from the input image, but direct addition may lead to noise amplification or artifacts. The gating map achieves spatial adaptive detail compensation through pixel-by-pixel modulation. Moreover, the gating map is generated by multi-scale local features, which can perceive structural information at different scales. It is more refined than single-scale gating and can handle fog and objects of different sizes.
[0023] 8. This invention does not require real paired dehazing samples and can complete training under unpaired real image conditions, reducing data acquisition costs; it explicitly constrains the reinforcement learning action space as a combination of transmittance map, global atmospheric light, saturation parameter, contrast parameter and spatial gating map, so that the exploration space has a clear physical meaning and avoids color distortion and structural artifacts caused by unconstrained exploration. By providing actions through dark channel priors and then having the network learn and correct them, the stability of physical priors is preserved while enhancing adaptability in real and complex scenes. By jointly evaluating the dehazing results through multiple composite rewards, the reinforcement learning update direction is simultaneously constrained by perceptual quality, semantic performance, structural consistency, and physical reversibility, thereby improving the final visual effect and enhancing the stability and convergence of the training process. This approach is suitable for dehazing images in real and complex scenes.
[0024] In summary, this invention constructs a physical hybrid action module and a composite reward loss, and trains the network using unpaired real foggy images and real clear images, so that the dehazing strategy network outputs dehazing images with good visual quality and physical interpretability, and has high training efficiency.
[0025] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0026] Figure 1 This is a flowchart of the method of the present invention.
[0027] Figure 2 This is a schematic diagram of the defogging strategy network of the present invention.
[0028] Figure 3 This is a schematic diagram of the structure of the physical sensing feature block and physical feature module of the present invention.
[0029] Figure 4 This is a schematic diagram of the physical hybrid action module of the present invention.
[0030] Figure 5 This invention provides a dehazed image obtained by processing a real foggy image using the dehazing strategy network trained in this invention. Detailed Implementation
[0031] like Figure 1 The method shown is an unpaired image dehazing method based on reinforcement learning and physical hybrid actions, which includes the following steps: Step 1: Obtain unpaired real foggy images and real clear images; Step 2: Construct a dehazing strategy network; the dehazing strategy network includes an encoder, a bottleneck residual module, a decoder, and a physical hybrid action module; wherein, the physical hybrid action module includes Conv1 convolutional layer, Conv2 convolutional layer, global average pooling, global max pooling, MLP network, Conv3 convolutional layer, upsampling 1, upsampling 2, Conv4 convolutional layer, ReLU function, and Conv5 convolutional layer; the MLP network includes a first linear layer, a LeakyReLU function, and a second linear layer; Step 3: The real foggy image and the real clear image are passed through a defogging strategy network for reinforcement learning to obtain a composite reward loss; Step 4: Train the defogging policy network based on the composite reward loss to obtain the trained defogging policy network; Step 5: Use the trained dehazing strategy network to dehaze subsequent real foggy images to obtain dehazed images.
[0032] like Figure 2 , Figure 3 and Figure 4 As shown, in this embodiment, the encoder in step two includes a first convolutional layer, a first physical sensing feature block, a first downsampling module, a second convolutional layer, a second physical sensing feature block, a second downsampling module, a third convolutional layer, a third physical sensing feature block, a third downsampling module, and a fourth convolutional layer. The decoder includes a first upsampling module, a fifth convolutional layer, a first physical feature extraction block, a second upsampling module, a sixth convolutional layer, a second physical feature extraction block, a third upsampling module, a seventh convolutional layer, a third physical feature extraction block, and an eighth convolutional layer; The first physical sensing feature block, the second physical sensing feature block, the third physical sensing feature block, the first physical feature extraction block, the second physical feature extraction block, and the third physical feature extraction block all have the same structure, and each includes a group normalization 1, a physical feature module, a group normalization 2, and a Gated FFN module. The physical feature module includes a first extraction branch and a second extraction branch. The first extraction branch includes a convolutional layer 1, a convolutional layer 2, a ReLU function, a convolutional layer 3, and a Sigmoid function. The second extraction branch includes a GAP module, a convolutional layer 4, a ReLU function, a convolutional layer 5, and a Sigmoid function.
[0033] In this embodiment, the specific process of step three is as follows: Step 301: Divide the pixel value of each channel of the real foggy image by 255 to normalize it, and obtain the normalized real foggy image; the normalized real foggy image is processed by the encoder to obtain the encoder output feature map. Step 302: Process the encoder output feature map through the bottleneck residual module to obtain the bottleneck output feature map; Step 303: Process the bottleneck output feature map through the decoder to obtain the decoded output feature map; Step 304: The feature maps output by the first physical sensing feature block, the second physical sensing feature block and the third physical sensing feature block in the encoder are processed by the physical hybrid action module to obtain feature vectors and physical hybrid action feature maps; Step 305: Based on the feature vector and physical hybrid action feature map, obtain the distribution of perspective view, gating map, atmospheric light, saturation and contrast, and obtain 6 sets of corrected transmission map, gating map, corrected atmospheric light, corrected saturation and corrected contrast through 6 random sampling and correction of physical actions. Step 306: The normalized real foggy image is processed through 6 sets of corrected transmission map, gate map, corrected atmospheric light, corrected saturation and corrected contrast, and the feature map is decoded and output to obtain 6 sets of fused physical defogging images. Step 307: Based on the 6 sets of fused physical dehazing images, obtain the 6 total rewards corresponding to the 6 sets of fused physical dehazing images; Step 308: Perform Z-score normalization on the six total rewards corresponding to the six sets of fused physically dehazed images to obtain the six normalized values of the total rewards corresponding to the six sets of fused physically dehazed images; Step 309: Input the real clear image, and obtain the fused physical dehazing image corresponding to a random physical action according to the methods of steps 301 to 306. Record it as the clear output image, and obtain the L1 loss between the clear output image and the normalized real clear image. Step 3010, according to Resulting in compound reward loss ;in, Let g be the standardized value of the total reward corresponding to the g-th physical action. Let g be the probability corresponding to the g-th physical action. To calculate the L1 loss between the sharp output image and the normalized true sharp image, G is the number of physical actions, G = 6, g is a positive integer, and 1 ≤ g ≤ G.
[0034] In this embodiment, step 301 is as follows: Step 3011: The normalized real foggy image is processed through the first convolutional layer to obtain the first feature map; the first feature map is processed through the first physical perception feature block to obtain the second feature map; the second feature map is processed through the first downsampling module to obtain the third feature map. Step 3012: Process the third feature map through the second convolutional layer to obtain the fourth feature map; process the fourth feature map through the second physical sensing feature block to obtain the fifth feature map; process the fifth feature map through the second downsampling module to obtain the sixth feature map; Step 3013: Process the sixth feature map through the third convolutional layer to obtain the seventh feature map; process the seventh feature map through the third physical sensing feature block to obtain the eighth feature map; process the eighth feature map through the third downsampling module to obtain the ninth feature map; Step 3014: Process the ninth feature map through the fourth convolutional layer to obtain the encoder output feature map; Step 303 is as follows: Step 3031: Process the bottleneck output feature map through the first upsampling module to obtain the first upsampling feature map; concatenate the first upsampling feature map and the eighth feature map channel to obtain the tenth feature map; process the tenth feature map through the fifth convolutional layer to obtain the eleventh feature map; process the eleventh feature map through the first physical feature extraction block to obtain the twelfth feature map. Step 3032: Process the twelfth feature map through the second upsampling module to obtain the second upsampling feature map; concatenate the second upsampling feature map and the fifth feature map channel to obtain the thirteenth feature map; process the thirteenth feature map through the sixth convolutional layer to obtain the fourteenth feature map; process the fourteenth feature map through the second physical feature extraction block to obtain the fifteenth feature map; Step 3033: Process the fifteenth feature map through the third upsampling module to obtain the third upsampling feature map; concatenate the third upsampling feature map and the second feature map channel to obtain the sixteenth feature map; process the sixteenth feature map through the seventh convolutional layer to obtain the seventeenth feature map; process the seventeenth feature map through the third physical feature extraction block to obtain the eighteenth feature map; Step 3034: Process the eighteenth feature map through the eighth convolutional layer to obtain the decoded output feature map.
[0035] In this embodiment, step 304 is as follows: Step 3041: Process the second feature map through a Conv1 convolutional layer to obtain the first intermediate feature map, and process the fifth feature map through a Conv2 convolutional layer to obtain the second intermediate feature map; Step 3042: The eighth feature map is processed by global average pooling, global max pooling and Conv3 convolutional layer respectively to obtain the third intermediate feature map, the fourth intermediate feature map and the fifth intermediate feature map. The fifth intermediate feature map is upsampled by 1 to obtain the sixth intermediate feature map. Step 3043: Add the sixth intermediate feature map and the second intermediate feature map element by element to obtain the seventh intermediate feature map; the seventh intermediate feature map is then upsampled by 2 to obtain the eighth intermediate feature map; Step 3044: Add the eighth intermediate feature map and the first intermediate feature map element by element to obtain the ninth intermediate feature map, and process the ninth intermediate feature map through a Conv4 convolutional layer, a ReLU function and a Conv5 convolutional layer to obtain the physical hybrid action feature map. Step 3045: Concatenate the third intermediate feature map and the fourth intermediate feature map through channels to obtain the concatenated feature map, and then pass the concatenated feature map through an MLP network to obtain the feature vector.
[0036] In this embodiment, step 305 is as follows: Step 3051: The normalized real foggy image is processed using the dark channel prior algorithm to obtain the prior atmospheric light A0 and the prior transmittance map t0. Step 3052: Select the first 6 data points from the feature vector as the mean, variance, green channel component, variance, blue channel component, and variance of the red channel component of atmospheric light, respectively. Add the mean, variance, and variance of the red channel component to the three components of the prior atmospheric light A0 to obtain the corrected mean, variance, and variance of the red channel component. The 7th and 8th data points in the feature vector are used as the variance and mean of saturation, and the 9th and 10th data points in the feature vector are used as the variance and mean of contrast. Step 3053: Add the first channel image of the physical mixed motion feature map and the prior transmittance map t0 to obtain the mean map of the transmittance map, and use the second channel image of the physical mixed motion feature map as the variance map of the transmittance map. Add 1.1 to each pixel value in the 3rd and 4th channel images of the physical hybrid action feature map to obtain the corrected 3rd and 4th channel images, and use the corrected 3rd and 4th channel images as the α parameter map and β parameter map of the gating map; Step 3054: Based on the corrected red channel component mean, red channel component variance, corrected green channel component mean, green channel component variance, corrected blue channel component mean, and blue channel component variance, obtain the normal distribution of atmospheric light; based on the variance and mean of saturation, obtain the normal distribution of saturation; based on the variance and mean of contrast, obtain the normal distribution of contrast. Based on the mean and variance plots of the transmission map, the normal distribution of each pixel value on the transmission map is obtained; Based on the α-parameter map and β-parameter map of the gated graph, the beta distribution of each pixel value on the gated graph is obtained; Step 3055: Randomly sample the values of each pixel on the gated graph to obtain the gated graph; Random sampling is performed based on the normal distribution of each pixel value in the transmission image to obtain each pixel value in the transmission image; each pixel value in the transmission image is then processed sequentially by the sigmoid function and the Clamp(0.1,1.0) function to obtain each corrected pixel value in the transmission image, thus obtaining the corrected transmission image; Random sampling is performed based on the normal distribution of atmospheric light to obtain the atmospheric light component A of any channel. Then, according to A´=sigmoid(A)×0.75+0.25, the corrected atmospheric light component A´ of any channel is obtained; where sigmoid(A)×0.75+0.25. () is the operation of the sigmoid function; Random sampling is performed based on the normal distribution of saturation to obtain the saturation S, and the corrected saturation S' is obtained according to S' = 1.0 + 1.0 × tanh(S); where tanh( ) represents the operation of the tanh function; Random sampling is performed based on the normal distribution of contrast to obtain the contrast C, and the corrected contrast C' is obtained according to C'=1.0+0.6×tanh(C); Step 3056: Following the method in step 3055, obtain 6 sets of corrected transmission maps, gated maps, corrected atmospheric light, corrected saturation, and corrected contrast.
[0037] In this embodiment, step 306 is as follows: Step 3061: According to J(j)=[I(j)-A´] / t(j)+A´, obtain the j-th pixel value J(j) in any channel after dehazing; where I(j) is the j-th pixel value in any channel of the normalized real hazy image, A´ is the corrected atmospheric light component of any channel, t(j) is the j-th pixel value in the corrected transmission image, j is a positive integer, the value range of j is 1~N, and N is the total number of pixels; Step 3062: According to J(j)´=[J(j)-0.5]×C´+0.5, obtain the value J(j)´ of the j-th pixel in any channel after contrast enhancement; Step 3063: Repeat steps 3061 and 3062 multiple times to obtain the red channel component, green channel component and blue channel component after contrast enhancement. Step 3064: Process according to gray=0.299R+0.587G´+0.114B to obtain the grayscale image gray; where R is the red channel component after contrast enhancement, G´ is the green channel component after contrast enhancement, and B is the blue channel component after contrast enhancement. Step 3065: According to Ji´=Ji×S´+gray×(1-S´), obtain the saturation-enhanced image Ji´ of any channel; where Ji is any channel component after contrast enhancement; Step 3066: According to Ji´´=Ji´+Gk⊙Jri, obtain any channel synthesis map Ji´´; where Gk is the gated map, ⊙ is the Hadamard product operation, and Jri is any channel map in the decoded output feature map; Step 3067: Repeat steps 3065 and 3066 multiple times to obtain a composite image of three channels, which is then combined to obtain a fused physical dehazing image; Step 3068: Following the methods of steps 3061 to 3067, input 6 different sets of corrected transmission maps, gated maps, corrected atmospheric light, corrected saturation, and corrected contrast to obtain 6 sets of fused physical dehazing images.
[0038] In this embodiment, step 307 is as follows: Step 3071: Input the fused physically dehazed image into the no-reference image quality assessment model MUSIQ to obtain the first index Rmusiq, and obtain the corrected first index Rm according to Rm=(Rmusiq / 100-0.5)×10; Step 3072: Input the fused physically dehazed image into the Natural Image Quality Evaluator (NIQE) to obtain the second index Rniqe. According to Rni = -(Rniqe - 3.8) × 2.5, the second index Rni after the first correction is obtained. Then, after processing by the Clamp (-6.0, 2.0) function, the second index Rn after the second correction is obtained. Step 3073: Obtain the perceived quality reward Rgz according to Rgz=Rm+Rn; Step 3074: Process the fused physically dehazed image and positive cue words through the CLIP encoder to obtain the positive semantic alignment reward Rz; process the fused physically dehazed image and negative cue words through the CLIP encoder to obtain the negative semantic alignment reward Rf; obtain the semantic reward Rcl according to Rcl=(Rz-Rf)×50; Step 3075: The fused physical dehazing image is processed based on the corrected transmission map and the corrected atmospheric light inversion to obtain a hazy physical image; the mean absolute error (Means) between the hazy physical image and the normalized real hazy image is obtained; and the structural consistency reward (Rp) is obtained according to Rp=-Means. Step 3076: Based on Rt=2×Rgz+2×Rcl+0.1×Rp, the total reward Rt is obtained; Step 3077: Repeat steps 3071 to 3076 multiple times to obtain 6 total rewards corresponding to 6 sets of fused physical dehazing images.
[0039] In this embodiment, the specific process of step four is as follows: The computer uses the Adam optimizer, inputting real foggy images and real clear images from the training set, and trains the defogging policy network using the compound reward loss until a set number of training rounds are reached, resulting in a well-trained defogging policy network. The specific process of step five is as follows: The computer inputs any subsequent real foggy image into the trained dehazing strategy network, and selects the fused physical dehazing image corresponding to the physical action with the highest sampling probability for correcting the transmission map, gating map, atmospheric light, saturation, and contrast. Then, the pixel value of each channel of the fused physical dehazing image is multiplied by 255 and inversely normalized to obtain the dehazing image.
[0040] In this embodiment, when constructing the physical hybrid action module in step two, the physical hybrid action space is established in conjunction with the dark channel prior in step 305. This allows the action exploration of the transmittance map and global atmospheric light to revolve around a physically reasonable area, thereby narrowing the search range, improving exploration efficiency, and enhancing training stability. At the same time, by using action components such as saturation parameters, contrast parameters, and spatial gating maps, visual enhancement can be further achieved on the basis of physical constraints, thereby balancing physical interpretability and subjective visual quality, and improving the robustness and generalization ability of dehazing real scene images.
[0041] In this embodiment, traditional reinforcement learning involves multi-step decision-making, which is computationally expensive and slow to converge. In contrast, this invention models dehazing as a single-step decision-making process, allowing the network to output all action parameters at once, which greatly reduces inference latency and is suitable for real-time applications. Furthermore, all operations required for dehazing (physical parameters, enhancement parameters, and spatial gating) are packaged into a unified hybrid action, enabling reinforcement learning optimization to adjust all parameters simultaneously and avoiding suboptimal solutions or error accumulation that may result from step-by-step optimization. In addition, single-step decision-making is suitable for end-to-end gradient backpropagation, which allows subsequent reinforcement learning reward signals to directly affect the parameter updates of all modules without the need for complex intermediate reward design.
[0042] In this embodiment, when obtaining the distribution of perspective view, gating map, atmospheric light, saturation and contrast in step 305, the different statistical characteristics of different types of action parameters are considered. For example, the parameters of transmittance, atmospheric light, saturation and contrast are suitable for normal distribution; the spatial gating map is suitable for beta distribution. This heterogeneous modeling is more consistent with the actual physical process than a uniform distribution assumption. In addition, the random sampling in step four of the training phase allows the network to explore different action combinations and discover better dehazing strategies; step five uses the maximum probability output to ensure the stability and repeatability of the results.
[0043] In this embodiment, step 306 utilizes the corrected transmittance and atmospheric light to reconstruct the image using an atmospheric scattering model, ensuring the physical consistency of the dehazing results. Compared to directly reverting to a clear image, this reconstruction method is more robust to extreme scenes. In addition, compensation is performed by the enhancement module because the physical model assumes uniform atmospheric light, which often does not hold true in real scenes. The introduction of saturation and contrast parameters can compensate for the shortcomings of the physical model. For example, saturation is adjusted in the sky area to prevent oversaturation, and contrast is increased in the detail area to enhance texture.
[0044] In this embodiment, step 304 is input with the second feature map, the fifth feature map and the eighth feature map so that the subsequently generated gating map can perceive structural information at different scales, which is more refined than single-scale gating and can handle fog and objects of different sizes.
[0045] In this embodiment, the dehazed image output by the decoder in step 3066 contains high-frequency details (texture, edges) extracted by the network from the input image, but directly adding them may lead to noise amplification or artifacts. The gated image achieves spatial adaptive detail compensation through pixel-by-pixel modulation.
[0046] In this embodiment, no real paired dehazing samples are required, and training can be completed under unpaired real image conditions, reducing data acquisition costs. The reinforcement learning action space is explicitly constrained as a combination of transmittance map, global atmospheric light, saturation parameter, contrast parameter and spatial gating map, so that the exploration space has a clear physical meaning and avoids color distortion and structural artifacts caused by unconstrained exploration. By providing actions through dark channel priors and then having the network learn and correct them, the stability of physical priors is preserved while enhancing adaptability in real and complex scenes. By jointly evaluating the dehazing results through multiple composite rewards, the reinforcement learning update direction is simultaneously constrained by perceptual quality, semantic performance, structural consistency, and physical reversibility, thereby improving the final visual effect and enhancing the stability and convergence of the training process. This approach is suitable for dehazing images in real and complex scenes.
[0047] In this embodiment, it should be noted that the GAP module is a global average pooling module; The Gated FFN module is a gated feedforward neural network, and its structure can be found in the paper DarkIR: Robust Low-LightImage Restoration.
[0048] In this embodiment, it should be noted that the probability corresponding to the g-th physical action is... It is the product of the sampling probabilities of correcting the transmission image, gating image, correcting atmospheric light, correcting saturation, and correcting contrast during the g-th physical action.
[0049] In this embodiment, it should be noted that the number of training rounds is set to 6 to achieve the desired training effect.
[0050] In this embodiment, there are multiple bottleneck residual modules, preferably nine. Each bottleneck residual module includes two convolutional layers, with 256 input and output channels for both layers, a kernel size of 3×3, a stride of 1, and padding of 1.
[0051] In this embodiment, the methods for obtaining the second feature map from the first feature map through the first physical sensing feature block, the fifth feature map from the fourth feature map through the second physical sensing feature block, the eighth feature map from the seventh feature map through the third physical sensing feature block, the twelfth feature map from the eleventh feature map through the first physical feature extraction block, the fifteenth feature map from the fourteenth feature map through the second physical feature extraction block, and the eighteenth feature map from the seventeenth feature map through the third physical feature extraction block are all the same. The first, fourth, seventh, eleventh, fourteenth, and seventeenth feature maps are all denoted as input feature maps; the second, fifth, eighth, twelfth, fifteenth, and eighteenth feature maps are all denoted as output intermediate feature maps. Specifically, the process is as follows: Step S1: The input feature map is processed by group normalization 1 to obtain the first middle feature map; wherein, the first middle feature map and the input feature map are the same size; Step S2: Process the first middle feature map through the physical feature module to obtain the second middle feature map; Step S3: Add the input feature map and the second middle feature map to obtain the added feature map; then process the added feature map through group normalization 2 to obtain the third middle feature map. Step S4: Process the third middle feature map through the Gated FFN module to obtain the fourth middle feature map; Step S5: Add the fourth middle feature map and the summed feature map again to obtain the output middle feature map; In this embodiment, the sizes of the first middle feature map, the third middle feature map, the fourth middle feature map, and the output middle feature map are all the same as those of the input feature map; In this embodiment, the specific process of step S2 is as follows: Step S21: Pass the first central feature map through the first extraction branch to obtain the first extracted map; pass the first central feature map through the second extraction branch to obtain the second extracted map; Step S22: Subtract the pixel value of each channel in the first extracted image from 1 to obtain the transition feature map; Step S23: Perform channel-by-channel multiplication on the transition feature map and the second extraction map to obtain the third extraction map; Step S24: Perform a Hadamard product operation on the first middle feature map and the first extracted map to obtain the fourth extracted map; Step S25: Add the third extracted image and the fourth extracted image together to obtain the second central feature map.
[0052] In this embodiment, the size of the first extracted image, the transition feature image, the third extracted image, the fourth extracted image, and the second intermediate feature image is the same as the size of the input feature image. The number of channels in the input feature image is represented by Ab, and the size of the second extracted image is Ab×1×1.
[0053] like Figure 3 As shown, in this embodiment, convolutional layers 1 to 3 have the same structure, and the kernel size is 3×3, the stride is 1, and the padding is 1; the number of kernels in convolutional layer 1 is Ab, the number of kernels in convolutional layer 2 is Ab / 8, and the number of kernels in convolutional layer 3 is Ab. Convolutional layer 4 and convolutional layer 5 have the same structure, with a kernel size of 1×1, a stride of 1, and padding of 0; the number of kernels in convolutional layer 4 is Ab / 8, and the number of kernels in convolutional layer 5 is Ab. like Figure 2 As shown, in this embodiment, the structures of the first to eighth convolutional layers are the same, all including convolutional layers, group normalization, and ReLU functions. The kernel size is 3×3, the stride is 1, and the padding is 1. The number of convolutional kernels in the first convolutional layer is 32, the number of convolutional kernels in the second convolutional layer is 64, the number of convolutional kernels in the third convolutional layer is 128, the number of convolutional kernels in the fourth convolutional layer is 256, the number of convolutional kernels in the fifth convolutional layer is 128, the number of convolutional kernels in the sixth convolutional layer is 64, the number of convolutional kernels in the seventh convolutional layer is 32, and the number of convolutional kernels in the eighth convolutional layer is 3. The first, second, and third downsampling modules all have the same number of channels, but their length and width are half of the original length and width. The first, second, and third upsampling modules all have the same number of channels, but their length and width are twice the original length and width.
[0054] In this embodiment, the size of the image is represented by the number of channels × width × height.
[0055] In this embodiment, the size of the real foggy image and the real clear image is 3×256×256, the size of the first feature map is 32×256×256, the size of the second feature map is 32×256×256, and the size of the third feature map is 32×128×128. The size of the fourth feature map is 64×128×128, the size of the fifth feature map is 64×128×128, and the size of the sixth feature map is 64×64×64. The size of the seventh feature map is 128×64×64, the size of the eighth feature map is 128×64×64, the size of the ninth feature map is 128×32×32; the size of the encoder output feature map is 256×32×32; the size of the bottleneck output feature map is 256×32×32. The size of the first upsampled feature map is 256×64×64, the size of the tenth feature map is 384×64×64, the size of the eleventh feature map is 128×64×64, and the size of the twelfth feature map is 128×64×64. The size of the second upsampled feature map is 128×128×128, the size of the thirteenth feature map is 192×128×128, the size of the fourteenth feature map is 64×128×128, and the size of the fifteenth feature map is 64×128×128. The size of the third upsampled feature map is 64×256×256, the size of the sixteenth feature map is 96×256×256, the size of the seventeenth feature map is 32×256×256, the size of the eighteenth feature map is 32×256×256, and the size of the decoded output feature map is 3×256×256.
[0056] like Figure 4 As shown, in this embodiment, the Conv1 convolutional layer has 128 kernels, a kernel size of 1×1, a stride of 1, and 0 padding; the Conv2 convolutional layer has 128 kernels, a kernel size of 1×1, a stride of 1, and 0 padding; the Conv3 convolutional layer has 128 kernels, a kernel size of 1×1, a stride of 1, and 0 padding. Upsampling 1 and Upsampling 2 have the same number of channels, but the length and width are twice the original length and width; The Conv4 convolutional layer has 64 kernels, a kernel size of 3×3, a stride of 1, and padding of 1. The Conv5 convolutional layer has 4 convolutional kernels, a kernel size of 1×1, a stride of 1, and padding of 0. In this embodiment, the size of the first intermediate feature map is 128×256×256, the size of the second intermediate feature map is 128×128×128, the size of the third intermediate feature map is 128×1×1, the size of the fourth intermediate feature map is 128×1×1, the size of the fifth intermediate feature map is 128×64×64, the size of the sixth intermediate feature map is 128×128×128, and the size of the seventh intermediate feature map is 128×128×128. The size of the eighth intermediate feature map is 128×256×256; the size of the ninth intermediate feature map is 128×256×256; the size of the physical mixed action feature map is 4×256×256; The size of the concatenated feature map is 256×1×1. After passing through the first linear layer of the MLP network, the output is 256×1×1. After passing through the LeakyReLU function and the second linear layer, the output is 10×1×1. That is, the size of the feature vector is 10×1×1.
[0057] In this embodiment, positive prompts are "clear photo", "sharp details", "high contrast", "without fog" or "natural lighting", while negative prompts are "foggy photo", "haze", "smoke", "blur" or "low contrast".
[0058] In this embodiment, real foggy images are collected from the RTTS and URHI datasets in the RESIDE fog image database, and real clear images are collected from the ADE20K database and the OTS dataset in the RESIDE fog image database as training sets.
[0059] In this embodiment, the fused physically dehazed image and positive prompt words are processed by the image encoder and text encoder in the CLIP encoder, respectively, to obtain two vectors. The cosine similarity between the two vectors is denoted as the positive semantic alignment reward Rz. Similarly, the negative semantic alignment reward Rf can be obtained.
[0060] In this embodiment, the implementation was based on the Python 3.10 programming environment and the PyTorch deep learning framework, and all experiments were performed on an NVIDIA GeForce RTX 3090 GPU. The training set contained 4000 foggy images and 6000 clear images. During training, the image size in the training set was randomly cropped to 3×256×256.
[0061] In this embodiment, it should be noted that the CLIP encoder can be referred to in the paper Learning Transferable Visual Models From Natural Language Supervision.
[0062] In this embodiment, four no-reference image quality evaluation metrics are used: Niqe (natural image quality evaluation), CLIP-IQA (CLIP-based image quality evaluation), Musiq (multi-scale image quality evaluation), and MANIQA (multi-dimensional attention image quality evaluation), which are referred to as Niqe, CLIP-IQA, Musiq, and MANIQA, respectively. A lower Niqe value indicates better image naturalness, while higher values for CLIP-IQA, Musiq, and MANIQA indicate better image perceptual quality.
[0063] The CLIP-IQA image quality assessment metric, based on CLIP, uses the CLIP-IQA evaluation network structure from the paper CLIP Image Quality Assessment. Similarly, the MANIQA multi-dimensional attention image quality assessment metric, based on MANIQA, uses the MANIQA evaluation network structure from the paper Multi-dimension Attention Network for Image Quality Assessment.
[0064] In this embodiment, the remaining real foggy images from the RTTS dataset and the URHI dataset are used as test images. The DEANet method, SGDN method, PBD method and the method of this invention are used to defog the test images to obtain multiple defog images. Multiple dehazed images are processed by the Natural Image Quality Evaluator (NIQE) and mean-processed to obtain the Niqe index; multiple dehazed images are processed by the CLIPIQA evaluation network and mean-processed to obtain the CLIP-IQA index; multiple dehazed images are processed by the No-Reference Image Quality Evaluation (MUSIQ) model and mean-processed to obtain the Musiq index; multiple dehazed images are processed by the MANIQA evaluation network and mean-processed to obtain the MANIQA index. Table 1 shows the evaluation indices of the method of this invention and existing methods.
[0065] Table 1 Evaluation Indicators of the Method of the Present Invention and Existing Methods
[0066] As shown in Table 1, the quantitative results of this invention demonstrate superior performance across all evaluation metrics. Specifically, in the Niqe metric, the method achieves a score of 3.841, outperforming DEANet's 4.805, SGDN's 5.716, and PBD's 4.043, indicating that the images obtained by this method better conform to the statistical laws of natural images. In the CLIP-IQA metric, the method achieves a score of 0.404, higher than DEANet's 0.379, SGDN's 0.297, and PBD's 0.252, indicating better overall visual perception quality. In the Musiq metric, the method achieves a score of 60.921, significantly outperforming DEANet's 53.628, SGDN's 44.858, and PBD's 53.194, further demonstrating the advantages of this method in image sharpness, depth, and overall visual quality. On the MANIQA metric, the method of this invention achieved a score of 0.168, which is higher than DEANet's 0.132, SGDN's 0.081, and PBD's 0.101, indicating that the method of this invention performs better in subjective perceived quality evaluation.
[0067] In this embodiment, DEANet, or Detail-Enhanced Attention Network, is a network that enhances attention to details. The DEANet method corresponds to the method in the paper DEA-Net: Single Image Dehazing Based on Detail-Enhanced Convolution and Content-Guided Attention. SGDN stands for Structure Guided Dehazing Network. The SGDN method corresponds to the method in the paper Guided Real Image Dehazing Using YCbCr Color Space. PBD stands for Physics-Based Decomposition, a method based on physical decomposition. The PBD method corresponds to the method in the paper Weakly Supervised Image Dehazing via Physics-Based Decomposition.
[0068] In this embodiment, as Figure 5As shown, the top row is a real foggy image. Using the defogging strategy network trained with the method of this invention, the bottom row is the defogging image. Therefore, this invention can be applied to various real foggy scenes such as bridges, buses, distant mountains, highway traffic, and urban street scenes. The method of this invention can remove fog and effectively restore details, edge contours, and color levels of distant scenes. The defogging results obtained by the method of this invention are clearer and more natural, effectively suppressing residual fog, color distortion, and local artifacts, indicating that the method of this invention has good visual restoration capabilities in complex and realistic degraded scenes.
[0069] The combined image visualization and quantitative evaluation results demonstrate that the method of this invention not only effectively improves the clarity of real foggy images but also balances image naturalness, structure preservation, and overall subjective visual quality. Compared to existing methods, the method of this invention exhibits superior dehazing performance and better generalization ability in real-world unpaired image dehazing tasks, thus verifying the effectiveness of the physical hybrid action, physical prior mechanism, and composite reward reinforcement learning optimization strategy employed in this invention.
[0070] In summary, this invention constructs a physical hybrid action module and a composite reward loss, and trains the network using unpaired real foggy images and real clear images, so that the dehazing strategy network outputs dehazing images with good visual quality and physical interpretability, and has high training efficiency.
[0071] The above description is merely a preferred embodiment of the present invention and does not constitute any limitation on the present invention. Any simple modifications, alterations, or equivalent structural changes made to the above embodiments based on the technical essence of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for dehazing unpaired images based on reinforcement learning and physical hybrid actions, characterized in that, The method includes the following steps: Step 1: Obtain unpaired real foggy images and real clear images; Step 2: Construct a dehazing strategy network; the dehazing strategy network includes an encoder, a bottleneck residual module, a decoder, and a physical hybrid action module; wherein, the physical hybrid action module includes Conv1 convolutional layer, Conv2 convolutional layer, global average pooling, global max pooling, MLP network, Conv3 convolutional layer, upsampling 1, upsampling 2, Conv4 convolutional layer, ReLU function, and Conv5 convolutional layer; the MLP network includes a first linear layer, a LeakyReLU function, and a second linear layer; Step 3: The real foggy image and the real clear image are passed through a defogging strategy network for reinforcement learning to obtain a composite reward loss; Step 4: Train the defogging policy network based on the composite reward loss to obtain the trained defogging policy network; Step 5: Use the trained dehazing strategy network to dehaze subsequent real foggy images to obtain dehazed images; The specific process of step three is as follows: Step 301: Divide the pixel value of each channel of the real foggy image by 255 to normalize it, and obtain the normalized real foggy image; the normalized real foggy image is processed by the encoder to obtain the encoder output feature map. Step 302: Process the encoder output feature map through the bottleneck residual module to obtain the bottleneck output feature map; Step 303: Process the bottleneck output feature map through the decoder to obtain the decoded output feature map; Step 304: The feature maps output by the first physical sensing feature block, the second physical sensing feature block and the third physical sensing feature block in the encoder are processed by the physical hybrid action module to obtain feature vectors and physical hybrid action feature maps; Step 305: Based on the feature vector and physical hybrid action feature map, obtain the distribution of perspective view, gating map, atmospheric light, saturation and contrast, and obtain 6 sets of corrected transmission map, gating map, corrected atmospheric light, corrected saturation and corrected contrast through 6 random sampling and correction of physical actions. Step 306: The normalized real foggy image is processed through 6 sets of corrected transmission map, gate map, corrected atmospheric light, corrected saturation and corrected contrast, and the feature map is decoded and output to obtain 6 sets of fused physical defogging images. Step 307: Based on the 6 sets of fused physical dehazing images, obtain the 6 total rewards corresponding to the 6 sets of fused physical dehazing images; Step 308: Perform Z-score normalization on the six total rewards corresponding to the six sets of fused physically dehazed images to obtain the six normalized values of the total rewards corresponding to the six sets of fused physically dehazed images; Step 309: Input the real clear image, and obtain the fused physical dehazing image corresponding to a random physical action according to the methods of steps 301 to 306. Record it as the clear output image, and obtain the L1 loss between the clear output image and the normalized real clear image. Step 3010, according to Resulting in compound reward loss ;in, Let g be the standardized value of the total reward corresponding to the g-th physical action. Let g be the probability corresponding to the g-th physical action. To calculate the L1 loss between the sharp output image and the normalized true sharp image, G is the number of physical actions, G = 6, g is a positive integer, and 1 ≤ g ≤ G.
2. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 1, characterized in that: The encoder described in step two includes a first convolutional layer, a first physical sensing feature block, a first downsampling module, a second convolutional layer, a second physical sensing feature block, a second downsampling module, a third convolutional layer, a third physical sensing feature block, a third downsampling module, and a fourth convolutional layer; The decoder includes a first upsampling module, a fifth convolutional layer, a first physical feature extraction block, a second upsampling module, a sixth convolutional layer, a second physical feature extraction block, a third upsampling module, a seventh convolutional layer, a third physical feature extraction block, and an eighth convolutional layer; The first physical sensing feature block, the second physical sensing feature block, the third physical sensing feature block, the first physical feature extraction block, the second physical feature extraction block, and the third physical feature extraction block all have the same structure, and each includes a group normalization 1, a physical feature module, a group normalization 2, and a Gated FFN module. The physical feature module includes a first extraction branch and a second extraction branch. The first extraction branch includes a convolutional layer 1, a convolutional layer 2, a ReLU function, a convolutional layer 3, and a Sigmoid function. The second extraction branch includes a GAP module, a convolutional layer 4, a ReLU function, a convolutional layer 5, and a Sigmoid function.
3. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 2, characterized in that: Step 301 is as follows: Step 3011: The normalized real foggy image is processed through the first convolutional layer to obtain the first feature map; the first feature map is processed through the first physical perception feature block to obtain the second feature map; the second feature map is processed through the first downsampling module to obtain the third feature map. Step 3012: Process the third feature map through the second convolutional layer to obtain the fourth feature map; process the fourth feature map through the second physical sensing feature block to obtain the fifth feature map; process the fifth feature map through the second downsampling module to obtain the sixth feature map; Step 3013: Process the sixth feature map through the third convolutional layer to obtain the seventh feature map; process the seventh feature map through the third physical sensing feature block to obtain the eighth feature map; process the eighth feature map through the third downsampling module to obtain the ninth feature map; Step 3014: Process the ninth feature map through the fourth convolutional layer to obtain the encoder output feature map; Step 303 is as follows: Step 3031: Process the bottleneck output feature map through the first upsampling module to obtain the first upsampling feature map; concatenate the first upsampling feature map and the eighth feature map channel to obtain the tenth feature map; The tenth feature map is processed through the fifth convolutional layer to obtain the eleventh feature map; the eleventh feature map is then processed through the first physical feature extraction block to obtain the twelfth feature map. Step 3032: Process the twelfth feature map through the second upsampling module to obtain the second upsampling feature map; concatenate the second upsampling feature map and the fifth feature map channel to obtain the thirteenth feature map; The thirteenth feature map is processed through the sixth convolutional layer to obtain the fourteenth feature map; the fourteenth feature map is then processed through the second physical feature extraction block to obtain the fifteenth feature map. Step 3033: Process the fifteenth feature map through the third upsampling module to obtain the third upsampling feature map; concatenate the third upsampling feature map and the second feature map channel to obtain the sixteenth feature map; The sixteenth feature map is processed through the seventh convolutional layer to obtain the seventeenth feature map; The seventeenth feature map is processed by the third physical feature extraction block to obtain the eighteenth feature map; Step 3034: Process the eighteenth feature map through the eighth convolutional layer to obtain the decoded output feature map.
4. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 3, characterized in that: Step 304 is as follows: Step 3041: Process the second feature map through a Conv1 convolutional layer to obtain the first intermediate feature map, and process the fifth feature map through a Conv2 convolutional layer to obtain the second intermediate feature map; Step 3042: The eighth feature map is processed by global average pooling, global max pooling and Conv3 convolutional layer respectively to obtain the third intermediate feature map, the fourth intermediate feature map and the fifth intermediate feature map. The fifth intermediate feature map is upsampled by 1 to obtain the sixth intermediate feature map. Step 3043: Add the sixth intermediate feature map and the second intermediate feature map element by element to obtain the seventh intermediate feature map; The seventh intermediate feature map is upsampled by 2 to obtain the eighth intermediate feature map; Step 3044: Add the eighth intermediate feature map and the first intermediate feature map element by element to obtain the ninth intermediate feature map, and process the ninth intermediate feature map through a Conv4 convolutional layer, a ReLU function and a Conv5 convolutional layer to obtain the physical hybrid action feature map. Step 3045: Concatenate the third intermediate feature map and the fourth intermediate feature map through channels to obtain the concatenated feature map, and then pass the concatenated feature map through an MLP network to obtain the feature vector.
5. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 4, characterized in that: Step 305 is as follows: Step 3051: The normalized real foggy image is processed using the dark channel prior algorithm to obtain the prior atmospheric light A0 and the prior transmittance map t0. Step 3052: Select the first 6 data points from the feature vector as the mean, variance, green channel component, variance, blue channel component, and variance of the red channel component of atmospheric light, respectively. Add the mean, variance, and variance of the red channel component to the three components of the prior atmospheric light A0 to obtain the corrected mean, variance, and variance of the red channel component. The 7th and 8th data points in the feature vector are used as the variance and mean of saturation, and the 9th and 10th data points in the feature vector are used as the variance and mean of contrast. Step 3053: Add the first channel image of the physical mixed motion feature map and the prior transmittance map t0 to obtain the mean map of the transmittance map, and use the second channel image of the physical mixed motion feature map as the variance map of the transmittance map. Add 1.1 to each pixel value in the 3rd and 4th channel images of the physical hybrid action feature map to obtain the corrected 3rd and 4th channel images, and use the corrected 3rd and 4th channel images as the α parameter map and β parameter map of the gating map; Step 3054: Based on the corrected red channel component mean, red channel component variance, corrected green channel component mean, green channel component variance, corrected blue channel component mean, and blue channel component variance, obtain the normal distribution of atmospheric light; based on the variance and mean of saturation, obtain the normal distribution of saturation; based on the variance and mean of contrast, obtain the normal distribution of contrast. Based on the mean and variance plots of the transmission map, the normal distribution of each pixel value on the transmission map is obtained; Based on the α-parameter map and β-parameter map of the gated graph, the beta distribution of each pixel value on the gated graph is obtained; Step 3055: Randomly sample the values of each pixel on the gated graph to obtain the gated graph; Random sampling is performed based on the normal distribution of each pixel value in the transmission image to obtain each pixel value in the transmission image; each pixel value in the transmission image is then processed sequentially by the sigmoid function and the Clamp(0.1,1.0) function to obtain each corrected pixel value in the transmission image, thus obtaining the corrected transmission image; Random sampling is performed based on the normal distribution of atmospheric light to obtain the atmospheric light component A of any channel. Then, according to A´=sigmoid(A)×0.75+0.25, the corrected atmospheric light component A´ of any channel is obtained; where sigmoid() is the sigmoid function operation. Random sampling is performed based on the normal distribution of saturation to obtain the saturation S, and the corrected saturation S' is obtained according to S'=1.0+1.0×tanh(S); where tanh() is the tanh function operation; Random sampling is performed based on the normal distribution of contrast to obtain the contrast C, and the corrected contrast C' is obtained according to C'=1.0+0.6×tanh(C); Step 3056: Following the method in step 3055, obtain 6 sets of corrected transmission maps, gated maps, corrected atmospheric light, corrected saturation, and corrected contrast.
6. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 5, characterized in that: Step 306 is as follows: Step 3061: According to J(j)=[I(j)-A´] / t(j)+A´, obtain the j-th pixel value J(j) in any channel after dehazing; where I(j) is the j-th pixel value in any channel of the normalized real hazy image, A´ is the corrected atmospheric light component of any channel, t(j) is the j-th pixel value in the corrected transmission image, j is a positive integer, the value range of j is 1~N, and N is the total number of pixels; Step 3062: According to J(j)´=[J(j)-0.5]×C´+0.5, obtain the value J(j)´ of the j-th pixel in any channel after contrast enhancement; Step 3063: Repeat steps 3061 and 3062 multiple times to obtain the red channel component, green channel component and blue channel component after contrast enhancement. Step 3064: Process according to gray=0.299R+0.587G´+0.114B to obtain the grayscale image gray; where R is the red channel component after contrast enhancement, G´ is the green channel component after contrast enhancement, and B is the blue channel component after contrast enhancement. Step 3065: According to Ji´=Ji×S´+gray×(1-S´), obtain the saturation-enhanced image Ji´ of any channel; where Ji is any channel component after contrast enhancement; Step 3066: According to Ji´´=Ji´+Gk⊙Jri, obtain any channel composite map Ji´´; where Gk is the gated map, ⊙ is the Hadamard product operation, and Jri is any channel map in the decoded output feature map; Step 3067: Repeat steps 3065 and 3066 multiple times to obtain a composite image of three channels, which is then combined to obtain a fused physical dehazing image; Step 3068: Following the methods of steps 3061 to 3067, input 6 different sets of corrected transmission maps, gated maps, corrected atmospheric light, corrected saturation, and corrected contrast to obtain 6 sets of fused physical dehazing images.
7. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 6, characterized in that: Step 307 is as follows: Step 3071: Input the fused physically dehazed image into the no-reference image quality assessment model MUSIQ to obtain the first index Rmusiq, and obtain the corrected first index Rm according to Rm=(Rmusiq / 100-0.5)×10; Step 3072: Input the fused physically dehazed image into the Natural Image Quality Evaluator (NIQE) to obtain the second index Rniqe. According to Rni = -(Rniqe - 3.8) × 2.5, the second index Rni after the first correction is obtained. Then, after processing by the Clamp (-6.0, 2.0) function, the second index Rn after the second correction is obtained. Step 3073: Obtain the perceived quality reward Rgz according to Rgz=Rm+Rn; Step 3074: Process the fused physically dehazed image and positive cue words through the CLIP encoder to obtain the positive semantic alignment reward Rz; process the fused physically dehazed image and negative cue words through the CLIP encoder to obtain the negative semantic alignment reward Rf; obtain the semantic reward Rcl according to Rcl=(Rz-Rf)×50; Step 3075: The fused physical dehazing image is processed based on the corrected transmittance map and the corrected atmospheric light inversion to obtain a hazy physical image; and the mean absolute error (MEAN) between the hazy physical image and the normalized real hazy image is obtained. Based on Rp=-Means, the structural consistency reward Rp is obtained; Step 3076: According to Rt=2×Rgz+2×Rcl+0.1×Rp, the total reward Rt is obtained; Step 3077: Repeat steps 3071 to 3076 multiple times to obtain 6 total rewards corresponding to 6 sets of fused physical dehazing images.
8. The unpaired image dehazing method based on reinforcement learning and physical hybrid actions according to claim 1, characterized in that: The specific process of step four is as follows: The computer uses the Adam optimizer, inputting real foggy images and real clear images from the training set, and trains the defogging policy network using the compound reward loss until a set number of training rounds are reached, resulting in a well-trained defogging policy network. The specific process of step five is as follows: The computer inputs any subsequent real foggy image into the trained dehazing strategy network, and selects the fused physical dehazing image corresponding to the physical action with the highest sampling probability for correcting the transmission map, gating map, atmospheric light, saturation, and contrast. Then, the pixel value of each channel of the fused physical dehazing image is multiplied by 255 and inversely normalized to obtain the dehazing image.
Citation Information
Patent Citations
End-to-end image defogging method based on multi-feature fusion
CN114742719A
Non-paired image defogging method based on cyclic diffusion model
CN119991497A
