Traffic image defogging method based on wavelet convolution and semantic-content guidance fusion
By employing wavelet convolution and semantic-content guided fusion, this method addresses the issues of insufficient training data coverage and high computational complexity in existing traffic image dehazing methods. It achieves a lightweight dehazing model, improving the adaptive capability and dehazing performance in complex foggy environments, and is suitable for intelligent traffic monitoring and autonomous driving systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-24
AI Technical Summary
Existing traffic image dehazing methods suffer from limitations in generalization ability due to insufficient training data coverage when facing complex and ever-changing haze phenomena. They also have high computational complexity, making it difficult to meet real-time processing requirements.
We employ a wavelet convolution and semantic-content guided fusion approach. By extracting features through multi-scale wavelet convolution and performing adaptive fusion, combined with grouped convolution gating and attention mechanisms, we achieve a lightweight dehazing model that adapts to the characteristics of fog and haze in specific traffic environments.
While reducing data dependence and computational costs, it improves the model's rapid adaptive capability and defogging performance in unknown haze environments, making it suitable for real-time processing in intelligent traffic monitoring and autonomous driving systems.
Smart Images

Figure CN121353135B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of traffic image processing, and particularly relates to a traffic image defogging method based on wavelet convolution and semantic-content guided fusion. BACKGROUND
[0002] Under the background of rapid development of intelligent transportation and automatic driving, visual perception system has become the core link to ensure road safety and traffic efficiency. However, under the conditions of fog, haze, smoke and other low-visibility weather, the images collected by monitoring cameras and vehicle-mounted cameras often have problems such as decreased contrast, blurred structure and lost details, which directly affect the reliability of key tasks such as vehicle detection, lane line identification and traffic sign identification. A large number of researches and traffic accident data show that the incidence of traffic accidents under foggy weather is significantly higher than that under sunny weather, so an effective image defogging method is of great significance to improve the stability and safety of the traffic system under complex weather. Although the existing deep learning defogging methods have made significant breakthroughs in performance, they are generally highly dependent on large-scale training data and have high computational complexity, making them difficult to be directly applied to vehicle-mounted terminals and roadside edge devices with limited computing power. Although the existing traffic image defogging methods have made significant progress, they still face many challenges:
[0003] 1. Serious dependence on large data sets and lack of generalization: Traffic scenes have high complexity and diversity, and are influenced by multiple factors such as road environment, climate condition, geographical location and time period, so the manifestation of fog and haze is significantly different. In order to effectively train a complex deep defogging model, a large amount of high-quality paired training data is usually required. When the training data is insufficient to cover the fog and haze characteristics of the target traffic scene, the model performance is likely to decline, and its generalization ability in new environments is difficult to guarantee, resulting in limited adaptability in different urban roads or severe weather conditions.
[0004] 2. High computational complexity: In order to pursue the ultimate performance, many advanced traffic image defogging methods often use deep, wide and computationally intensive network structures. Such models have very high demand for computing resources, making it difficult to meet the real-time and deployment requirements in actual traffic applications. In intelligent traffic monitoring, automatic driving systems or vehicle-mounted embedded devices, computing resources and response speed are strictly limited, making it difficult for complex defogging models to be directly applied to real-time traffic environments.
[0005] In summary, the existing defogging methods often have limited generalization ability due to insufficient training data coverage when facing complex and variable fog and haze phenomena in real traffic scenes, and are difficult to meet real-time processing requirements due to high computational requirements. The coexistence of "strong data dependence" and "high computational cost" makes it particularly difficult to train a defogging model in real time for each specific foggy traffic environment. Therefore, there is an urgent need to develop a new lightweight defogging architecture that can quickly adapt to the fog and haze characteristics in a specific traffic environment with only a small amount of target scene samples and achieve high-quality, strong generalization defogging effects at a low computational cost. SUMMARY
[0006] The purpose of the present application is to provide a traffic image defogging method based on wavelet convolution and semantic-content guided fusion. It can improve the model's rapid self-adaptation ability to unknown fog and haze environment under limited sample conditions, reduce data dependence and computational cost, and still maintain excellent defogging performance and generalization performance.
[0007] Technical scheme: The traffic image defogging method based on wavelet convolution and semantic-content guided fusion of the present application comprises the following steps:
[0008] Step 1, collect foggy images and pre-process the images, and use the processed images as the input of the model;
[0009] Step 2, set the initialization model parameters, including the parameters of the encoder, decoder and feature transformation layer, and the training parameters;
[0010] Step 3, the encoder performs feature enhancement through multi-scale wavelet convolution, then extracts features through multi-scale convolution kernels, realizes multi-scale feature fusion based on an adaptive fusion strategy, uses an image block embedding module for down-sampling, divides the image into a plurality of fixed-size image blocks, maps each image block to a high-dimensional feature vector, and generates an embedded feature map;
[0011] Step 4, input the embedded feature map into the feature transformation layer, fuse the deep semantic features through multi-scale wavelet convolution, and perform up-sampling through the image block restoration module, use the semantic-content guided fusion module to fuse the up-sampled features with the shallow features output by the encoder, and obtain the fused features;
[0012] Step 5, input the fused features into the decoder, gradually restore the image size through multi-scale wavelet convolution and the image restoration module, and use the semantic-content guided fusion module to combine the shallow detail features of the encoder, and finally output the defogging image;
[0013] Step 6, training the model, calculating the structural similarity index and peak signal-to-noise ratio of the output defogging image and the real image, retaining the best model and judging whether the preset iteration number is reached, if not, returning to step 3, and obtaining the optimal defogging model parameter after reaching the iteration number, and applying it to traffic image defogging.
[0014] Further, step 1 specifically comprises the following steps:
[0015] Step 1.1, reading the OTS dataset and the SOTS dataset of the RESIDE dataset, randomly extracting foggy images in the OTS dataset for training the model, and randomly extracting foggy images in the SOTS dataset for testing;
[0016] Step 1.2, randomly cropping a patch with a size of 256x256 from the foggy image, and then using two data enhancement techniques, including: 90° or 180° or 270° rotation and vertical or horizontal flip.
[0017] Further, step 3 specifically comprises the following steps:
[0018] Step 3.1, in the multi-scale wavelet convolution, first process the features using the channel attention module and the spatial attention module, then perform channel expansion through a 1x1 point convolution layer; then use ReLU to introduce nonlinearity and use BN to normalize, to obtain the expanded feature map X CAS ;
[0019] Step 3.2, the expanded feature map X CAS is sent to multiple parallel deep convolution branches, which respectively extract features from multiple scale receptive fields using different size convolution kernels, and the specific description is shown in formula (1):
[0020] (1)
[0021] Where, {K1, K2, K3}={1, 3, 5} represents different convolution kernel sizes, represents the ReLU activation function, which is used to introduce a nonlinear transformation; represents batch normalization, represents a depth separable convolution;
[0022] Step 3.3, after multi-scale convolution, a channel shuffle operation is used to break the static channel distribution between the features of each branch, enhance cross-scale information interaction, and the shuffled features are restored to the target channel number through a 1x1 convolution and BN, to obtain the final output:
[0023] (2)
[0024] in, This indicates a convolution with a 1×1 kernel, used to adjust the number of output channels and achieve inter-channel information fusion of feature maps. This indicates a channel shuffling operation, which facilitates information exchange between channels with different characteristics.
[0025] Step 3.4: Construct wavelet transform WT and inverse wavelet transform IWT using convolution based on the following four sets of filters:
[0026] (3)
[0027] WT(X)=[ X LL , X LH , X HL , X HH ]=Conv([ f LL , f LH , f HL , f HH ],X) (4)
[0028] in, This represents a low-pass filter that preserves low-frequency information of an image, such as its overall structure and contours. This indicates a horizontal high-pass filter, which can extract vertical edge and horizontal texture details from an image, helping to restore the blurred horizontal structure in fog. This represents a vertical high-pass filter, used to extract horizontal edge and vertical texture details from an image and enhance vertical contour information. This represents a diagonal high-pass filter used to capture details and corner features along the diagonal direction of an image, further refining complex textures; X LL It is a low-frequency component, while X LH X HL X HH These are the horizontal, vertical, and diagonal high-frequency components of X, respectively; X represents the input feature. Indicates the convolution operation;
[0029] because , , and An orthogonal basis is formed, therefore the inverse wavelet transform (IWT) is obtained through transpose convolution:
[0030] (5)
[0031] in, This represents the features obtained by inverse wavelet transform reconstruction; Indicates transposed convolution;
[0032] Step 3.5: Recursively separate the feature map processed by the multi-scale convolution module into high-frequency and low-frequency components using wavelet decomposition; apply small-kernel depthwise convolution to the frequency components, and fuse the processed features back to the original space step by step through inverse wavelet reconstruction, finally obtaining the output X of the multi-scale wavelet convolution module. MSWC ;
[0033] Step 3.6: Divide the image into multiple fixed-size image blocks through convolution operations, map each image block into a high-dimensional feature vector, and finally generate an embedded feature map to complete downsampling;
[0034] Step 3.7: Repeat the combination of multi-scale wavelet convolution and downsampling layer, and input the result into the feature transformation layer.
[0035] Furthermore, step 4 specifically includes the following steps:
[0036] Step 4.1: Use multi-scale wavelet convolution to fuse deep features;
[0037] Step 4.2: Upsampling is achieved through the image patch restoration module. After receiving the feature representation output by the embedding module, the number of feature channels is expanded through convolution operation. The channels are rearranged using PixelShuffle to restore the image shape and then transmit it to the next step.
[0038] Step 4.3: Use the semantic-content guided fusion module to fuse low-level features and their corresponding high-level features. First, process the features through global average pooling across spatial dimensions, global max pooling across spatial dimensions, and global average pooling across channel dimensions to obtain the spatial and channel weights W. S and W C ;
[0039] Step 4.4: Perform an addition operation on W. S and W C The data are then merged together, concatenated with the original input, and each channel is rearranged through channel shuffling. Finally, a 7×7 convolution and a sigmoid activation function are applied to obtain the final spatial importance map W.
[0040] ]=Conv([ C 7×7 LL W C + W S ]))) (6)
[0041] in, This represents the Sigmoid activation function, which maps any real number input to the interval (0, 1). This represents a grouped convolution with a kernel size of 7×7, where X represents the input feature;
[0042] The weighted summation is applied to both low-level features and corresponding high-level features:
[0043] (7)
[0044] in, Indicates the characteristics after preliminary processing. This indicates a convolution with a kernel size of 1×1, used to adjust the number of output channels; Represents underlying features. This represents the high-level features corresponding to the low-level features;
[0045] Step 4.5: Use the grouped convolutional gating module to obtain the gated features F. gate The specific formula is as follows:
[0046] (8)
[0047] in, This represents the characteristics of the input gating module, GC low and GC high These represent grouped convolutions used for low-level and high-level features, respectively.
[0048] Step 4.6: Gated feature F gate Incorporating the initial processed features F fuse In the process, the final fusion feature F is obtained. scg :
[0049] (9)
[0050] Here, α is a learnable weight coefficient.
[0051] Furthermore, in step 6, the model is trained, using mathematical formula 10:
[0052] (10)
[0053] in, represents the mean absolute error loss, which essentially measures the average absolute difference between the network-predicted image and the ground truth image at the pixel level. y represents the ground truth image corresponding to the foggy image. Represents a dehazed image, y i It is the true value of the i-th sample. Let N represent the predicted value of the i-th sample, and N be the number of samples.
[0054] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method of the present invention.
[0055] The present invention also discloses a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of the method of the present invention.
[0056] The present invention also discloses a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method of the present invention.
[0057] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:
[0058] (1) This invention combines multi-scale deep convolution and attention mechanism, and introduces wavelet transform to take into account both spatial domain and frequency domain modeling, achieving efficient feature extraction while ensuring lightweight model.
[0059] The input image first undergoes multi-scale deep convolution processing, extracting feature representations at different scales and receptive fields through parallel convolutional kernels of various sizes. This captures multi-level texture structures and contextual information. An adaptive fusion strategy dynamically integrates these multi-scale features to accurately characterize the non-uniform distribution of fog. Simultaneously, the network incorporates channel attention and spatial attention mechanisms, enabling it to adaptively focus on key regions and significant texture features, further enhancing the effectiveness of feature representation. Building upon this, wavelet convolution is introduced, combining multi-level frequency analysis and reversibility. This effectively suppresses fog background interference while preserving image details, achieving a larger receptive field and better capturing low-frequency information in the input, resulting in improved performance for defogging tasks. The collaborative framework of multi-scale deep convolution and wavelet transform achieves complementary modeling in the spatial and frequency domains. Combined with attention mechanisms and residual interaction strategies, it effectively improves the selectivity and anti-interference ability of feature representation, significantly reducing model complexity and computational overhead while enhancing the network's robustness and generalization ability. This makes it particularly suitable for edge computing scenarios requiring real-time processing, such as intelligent transportation.
[0060] (2) In this invention, a grouped convolutional gating mechanism is introduced into the content-guided attention mechanism to capture long-range spatial dependencies and suppress redundant features, thereby maintaining the semantic continuity and structural integrity of the scene.
[0061] By replacing the residual raw input features in the traditional attention-based feature fusion module with gated features processed by a grouped convolutional gating mechanism, a shift from static skip connections to semantically guided fusion is achieved. A grouped convolutional structure with a large receptive field is used to model the global context, and gating signals are extracted from high-level semantic features. This guides the network to dynamically adjust the information flow of different channels and spatial locations during the fusion process, gradually combining feature maps and attention coefficients. The network adaptively learns how to activate key features more effectively and suppress irrelevant features, thereby improving the expressive and discriminative power of the fusion result. Attached Figure Description
[0062] LH This is a diagram showing the overall structure of a traffic image dehazing method based on multi-scale wavelet convolution and semantic-content guided fusion.
[0063] HL This is a model architecture diagram of a multi-scale wavelet convolution module;
[0064] HH This is a model architecture diagram for the semantic-content-guided fusion module.
[0065] ]=Conv([ The flowchart shows the dehazing process of a traffic image dehazing method based on wavelet convolution and semantic-content guided fusion.
[0066] LL A comparison chart of the defogging effects of different defogging methods in the SOTS-indoor test set;
[0067] LH A comparison chart showing the defogging effects of different defogging methods on the SOTS-outdoor test set. Detailed Implementation
[0068] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0069] The present invention provides a traffic image dehazing method based on wavelet convolution and semantic-content guided fusion, comprising the following steps:
[0070] Step 1. Preprocess the synthesized foggy image, crop it into appropriately sized patches, and randomly rotate or flip it by a certain degree.
[0071] 1.1 Read the OTS and SOTS datasets, subsets of the RESIDE dataset. Randomly select 1000 pairs of images from the OTS dataset to train the model, and randomly select 300 images from the SOTS dataset for testing.
[0072] 1.2 Randomly crop a 256×256 patch from the original image and then apply two data augmentation techniques: rotation of 90° or 180° or 270° and vertical or horizontal flipping.
[0073] Step 2. Set the initial model parameters, including the parameters of the encoder, decoder, and feature transformation layer, as well as training-related parameters;
[0074] 2.1 Model architecture as follows HL As shown, the overall structure adopts an encoding-decoding symmetrical architecture, including key stages such as feature extraction, downsampling, feature fusion, and upsampling reconstruction. 1. Input image I∈R B×3×H×WB represents the batch size, i.e., the number of images processed in a single forward propagation; 3 represents the number of channels in the input image, corresponding to the three color channels of a color RGB image; H×W represents the spatial resolution of each image, i.e., its height and width. Feature embedding is performed through the PatchEmbed module, which uses a 3×3 kernel, stride 1, and padding 1 convolution operation to map the input 3-channel image to an initial 24-channel feature embedding, maintaining the spatial resolution at H×W. 2. Shallow texture and structural information are extracted through multi-scale wavelet convolution and a self-attention mechanism, maintaining the output dimension at B×24×H×W. 3. At this point, the first feature used for multi-scale feature fusion, skip1, is saved. 4. The first downsampling is performed using a convolution with a stride of 2, reducing the spatial resolution to H / 2×W / 2 and expanding the number of channels to 48. 5. The second multi-scale wavelet convolution module is then used, maintaining the 48-channel features at this resolution for deep semantic modeling. 6. Save the skip2 feature for multi-scale feature fusion. 7. Perform a second downsampling step of 2, reducing the resolution to H / 4×W / 4 and expanding the number of channels to 96. 8. In the feature transformation layer, use the multi-scale wavelet convolution module again to extract global contextual semantic information. 9. In the decoding stage, a first upsampling is performed with a stride of 2, restoring the feature size to H / 2×W / 2, while reducing the number of channels from 96 to 48. 10. At the same resolution, the semantic-content guided fusion module deeply fuses skip2 with the current feature through a multi-branch fusion module, with the output still being B×48×H / 2×W / 2. 11. After extracting features through multi-scale wavelet convolution, a second upsampling is performed with a stride of 2, restoring the resolution to H×W, while reducing the number of channels to 24. 12. The semantic-content guided fusion module fuses the upsampled features with the shallow skip1 features to restore edge and detail information, and adds the residuals to the original features, resulting in an output of B×24×H×W. 13. Further feature corrections are performed on the fusion result, while maintaining the same output dimension. 14. A 3×3 convolutional PatchUnembed module (padding 1, stride 1) is used to map the 24-channel feature map into a 4-channel feature map, where one channel represents transmittance (K) and three channels represent the bias term (B). Finally, image reconstruction is completed according to the physical imaging model.
[0075]
[0076] Where ⊙ represents pixel-by-pixel and channel-by-channel multiplication, and I represents a foggy image.
[0077] 2.2 The model architecture of the multi-scale wavelet convolution module is as follows: HHAs shown. 1. In the channel attention block, global average pooling and global max pooling are performed on the input x to obtain two vectors of size B×C×1×1; after two 1×1 convolutions, ReLU activation function and sigmoid mapping, the channel attention weights W are generated. c W c 1. Multiply the original features channel by channel. 2. In the spatial attention module, first compress along the channel dimension using max pooling and average pooling to generate two 2D feature maps. Then, concatenate the two attention maps along the channel dimension. Next, use a 7×7 convolution to enhance the contextual relationship between features. Then, apply Sigmoid activation to calculate attention weights, and finally apply them to the input feature x. 3. First, expand the channels using 1×1 point convolutions. Then, execute three depthwise separable convolutions in parallel with kernel sizes of 1×1, 3×3, and 5×5, stride 1, and padding 0, 1, and 2 respectively. Add the three outputs element by element, then perform a channel shuffling operation to enhance cross-channel information interaction, and project back to the channels using 1×1 convolutions. 4. Based on HaarWT, construct wavelet transform and inverse wavelet transform. Apply 2D wavelet decomposition convolution to the input data. The convolution kernel size is equivalent to the wavelet kernel, stride=2, and boundary padding is used. The data shape becomes B×4C×H / 2×W / 2. 5. Frequency domain convolution processing: Process the frequency domain features using depthwise separable convolution, where kernel=5×5, stride=1, padding=2, and groups=4C. A learnable scaling module is used to multiply each channel by an initial scaling factor to control the contribution of different sub-bands. The processed frequency domain tensor shape remains B×4C×H / 2×W / 2. 6. Restore the processed frequency domain tensor to a four-sub-band structure, then concatenate them in sub-band order. Subsequently, perform transposed convolution on each channel (parameters corresponding to the decomposition filter, stride=2, padding aligned), and reconstruct to the original resolution step by step using inverse transform to obtain the reconstructed frequency domain features. 7. Perform a set of lightweight depthwise convolutions in the spatial domain on the input x, where groups=C, kernel=5×5, stride=1, padding=2, and pass through a learnable scaling module to obtain spatial convolution features. Finally, add the frequency domain reconstruction features and spatial convolution features element by element to obtain the module output.
[0078] 2.3 The model architecture of the semantic-content guidance fusion module is as follows: ]=Conv([ As shown. 1. The low-level feature F low and corresponding high-level features F highThe initial fused features are obtained by element-wise addition. Then, in the channel attention branch, adaptive global average pooling is performed on the fused features, outputting a shape of [B,C,1,1]. This output is then processed by two pointwise convolutions and ReLU activation to obtain the channel attention weights. 3. The spatial attention branch performs global average pooling and global max pooling on the fused features along the channel dimension, concatenating them into a tensor of [B,2,H,W]. 4. The result is input into a convolutional layer with a kernel size of 7×7, padding of 3, and stride of 1 to generate a spatial attention map. Finally, the channel and spatial attention processing results are added together to obtain the primary fused feature map. 5. Expand and concatenate the primary fused feature map with the initial fused features, then feed it into a grouped convolutional layer (kernel=7, stride=1, padding=3, groups=C) for processing. The output is activated by a sigmoid function to generate the final spatial importance map W. Then, it is applied to the low-level features and corresponding high-level features through a weighted summation method, and then passed through a 1×1 convolutional layer to generate the output features. The specific formula is as follows:
[0079] LL C 7×7 LH W C + W S ])))
[0080]
[0081] in, This represents the Sigmoid activation function, which maps any real number input to the interval (0, 1). This indicates a grouped convolution with a kernel size of 7×7, where X represents the initial fused feature obtained by adding the low-level feature to its corresponding high-level feature; Indicates the characteristics after preliminary processing. This indicates a convolution with a kernel size of 1×1, used to adjust the number of output channels; Represents underlying features. This represents the high-level features that correspond to the low-level features.
[0082] 6. The grouped convolutional gating module and the channel spatial attention module simultaneously receive low-level features and corresponding high-level features, and apply a 3×3 grouped convolutional gating (GC) to them respectively. low and GC high 7. After batch normalization (BN), the convolution results are fused by element-wise addition, and intermediate feature representations are obtained through ReLU non-linear activation. 8. This feature is further compressed into a single-channel feature map using 1×1 convolution and BN, and mapped to [0,1] using the Sigmoid activation function to form attention coefficients. 9. These attention coefficients are multiplied element-wise with the input feature x to obtain the gated feature F. gate Then it is incorporated into the pre-processed feature Ffuse In the process, the final fusion feature F is obtained. scg The specific formula is shown below:
[0083]
[0084]
[0085] in, This represents the characteristics of the input gating module, GC low and GC high α represents the grouped convolutions used for low-level features and high-level features, respectively; α is a learnable weight coefficient.
[0086] 2.4 The hyperparameter settings are as follows: batch size is set to 32, image patch size is set to 256, the maximum number of training epochs is 300, the AdamW optimizer is used for parameter updates, and the initial learning rate of the generator is set to 0.0004. During training, horizontal flipping and rotations of random degrees are used as data augmentation methods. Performance is evaluated on the validation set every 5 epochs.
[0087] During training, optimization is achieved by minimizing the pixel-by-pixel difference between the fog-free image predicted by the network and its corresponding ground truth image. The L1 loss function is used as the training objective to constrain the network's learning process, as shown in the following formula:
[0088]
[0089] represents the mean absolute error loss, which essentially measures the average absolute difference between the network-predicted image and the ground truth image at the pixel level. y represents the ground truth image corresponding to the foggy image. Represents a dehazed image, y i It is the true value of the i-th sample. Let N represent the predicted value of the i-th sample, and N be the number of samples.
[0090] Step 3. Encoder design as follows HL As shown;
[0091] 3.1 In multi-scale wavelet convolution, features are first processed using channel attention and spatial attention modules. Then, a 1×1 pointwise convolutional layer is used for channel expansion to enhance feature representation. Finally, ReLU is used to introduce nonlinearity and BN is used for normalization to obtain the expanded feature map X. CAS ;
[0092] 3.2 Expand the feature map X CASThe data is fed into multiple parallel deep convolutional branches, each using a different kernel size to extract features from receptive fields at multiple scales. See the formula for a detailed description:
[0093]
[0094] Where {K1,K2,K3}={1,3,5} represents different convolution kernel sizes. This represents the ReLU activation function, used to introduce nonlinear transformations. This indicates batch normalization, which standardizes the distribution of each batch of data to accelerate training and improve model stability. Depthwise separable convolution can significantly reduce the number of parameters and computational cost;
[0095] 3.3 After multi-scale convolution, a channel shuffling operation is used to break the static channel distribution between features in each branch, enhancing cross-scale information interaction. The shuffled features are restored to the target number of channels through a 1×1 convolution and BN, yielding the final output:
[0096]
[0097] in, This indicates a convolution with a 1×1 kernel, used to adjust the number of output channels and achieve inter-channel information fusion of feature maps. This indicates a channel shuffling operation, which facilitates information exchange between channels with different characteristics.
[0098] 3.4 Construct wavelet transform (WT) and inverse wavelet transform (IWT) using convolution based on the following four sets of filters:
[0099]
[0100] HH X ]=Conv([ , X LL , X LH , X HL HH f ]=Conv([ , f LL , f LH , f HL ],X)
[0101] in, This represents a low-pass filter that preserves low-frequency information of an image, such as its overall structure and contours. This indicates a horizontal high-pass filter, which can extract vertical edge and horizontal texture details from an image, helping to restore the blurred horizontal structure in fog. This represents a vertical high-pass filter, used to extract horizontal edge and vertical texture details from an image and enhance vertical contour information. This represents a diagonal high-pass filter used to capture details and corner features along the diagonal direction of an image, further refining complex textures; X LL It is a low-frequency component, while X LH X HL X HHThese are the horizontal, vertical, and diagonal high-frequency components of X, respectively; X represents the input feature. Indicates the convolution operation;
[0102] because , , and An orthogonal basis is formed, therefore the inverse wavelet transform (IWT) is obtained through transpose convolution:
[0103]
[0104] in, This represents the features obtained by inverse wavelet transform reconstruction; Indicates transposed convolution;
[0105] 3.5 Wavelet decomposition is used to recursively separate the feature map processed by the multi-scale convolutional module into high-frequency and low-frequency components. Then, a small-kernel depthwise convolution is applied to these frequency components, and the processed features are gradually fused back into the original space through inverse wavelet reconstruction, finally obtaining the output X of the multi-scale wavelet convolutional module. MSWC ;
[0106] 3.6 The image is divided into multiple fixed-size image blocks through convolution operations, and each image block is mapped to a high-dimensional feature vector to finally generate an embedded feature map, thus completing downsampling;
[0107] 3.7 Repeat the combination of multi-scale wavelet convolution and downsampling layer, and input the result into the feature transformation layer.
[0108] Step 4. Design of the feature transformation layer as follows HH As shown;
[0109] 4.1 Using multi-scale wavelet convolution to fuse deep features;
[0110] 4.2 Upsampling is achieved through the image patch restoration module. After receiving the feature representation output by the embedding module, the number of feature channels is expanded through convolution operation. Channel shuffling operation is used to rearrange the channels, restore the image shape, and then transmit it to the next step.
[0111] 4.3 The semantic-content guided fusion module is used to fuse low-level features and their corresponding high-level features. First, the features are processed through operations such as global average pooling across spatial dimensions, global max pooling across spatial dimensions, and global average pooling across channel dimensions to obtain the spatial and channel weights W. S and W C ;
[0112] 4.4 Adding W using an addition operation S and W CThe data are then merged together, concatenated with the original input, and each channel is rearranged through channel shuffling. Finally, a 7×7 convolution and a sigmoid activation function are applied to obtain the final spatial importance map W.
[0113] ]=Conv([ C 7×7 LL W C + W S ])))
[0114] in, This represents the Sigmoid activation function, which maps any real number input to the interval (0, 1). This represents a grouped convolution with a kernel size of 7×7;
[0115] Then, a weighted summation method is used to apply it to the low-level features and the corresponding high-level features:
[0116]
[0117] in, This indicates the characteristics after preliminary processing, where, Indicates the characteristics after preliminary processing. This indicates a convolution with a kernel size of 1×1, used to adjust the number of output channels; Represents underlying features. This represents the high-level features that correspond to the low-level features.
[0118] Step 4.5 Use the grouped convolutional gating module to obtain the gated features F gate The specific formula is as follows:
[0119]
[0120] in, This represents the characteristics of the input gating module, GC low and GC high These represent grouped convolutions used for low-level and high-level features, respectively.
[0121] Step 4.6 Gating feature F gate Incorporating the initial processed features F fuse In the process, the final fusion feature F is obtained. scg :
[0122]
[0123] Where α is a learnable weight coefficient.
[0124] Step 5. Decoder design as follows LH As shown;
[0125] 5.1 Multi-scale wavelet convolution is used to restore the image size, and image blocks are restored through further upsampling to restore the image shape and transmit it to the next stage;
[0126] 5.2 Use the semantic-content guided fusion module to fuse shallow detail features of the encoder;
[0127] 5.3 Finally, the original image size is restored through multi-scale wavelet convolution, and the dehazed image is output.
[0128] Step 6. The goal of dehazing training is to obtain a model that minimizes the loss:
[0129]
[0130] in, represents the mean absolute error loss, which essentially measures the average absolute difference between the network-predicted image and the ground truth image at the pixel level. y represents the ground truth image corresponding to the foggy image. Represents a dehazed image, y i It is the true value of the i-th sample. Let N represent the predicted value of the i-th sample, and N be the number of samples.
[0131] Step 7. After updating the training parameters of the encoder, decoder, and feature transformation layer, return to steps 3, 4, and 5 to continue training the model. Test the trained model on the test set every five training iterations and retain the model parameters that achieve the best PSNR and SSIM values.
[0132] After model training, this traffic image dehazing network can generate high-quality, clear, and realistic fog-free images, effectively restoring scene details and color information obscured by fog. This network can be widely applied to traffic scene image processing under various complex weather conditions, significantly improving the visual perception capabilities of autonomous driving and intelligent traffic monitoring systems in low-visibility environments. This solves the problem of decreased recognition accuracy due to fog in traffic vision tasks, promoting the safety and reliability of intelligent transportation systems.
[0133] Example
[0134] This invention compares five different state-of-the-art dehazing algorithms: Dark Channel Prior (DCP), Feature Fusion Attention Network (FFA-Net), Dehazing Correction Network (Dehamer), Dehazeformer, and Detail Enhancement Attention Network (DEA-Net). Table 1 shows the results of the method of this invention and other state-of-the-art image dehazing algorithms on the D-HAZY and SOTS datasets. The dehazing method of this invention achieves the best performance on the D-HAZY dataset with 31.52 dB PSNR and 0.976 SSIM. Furthermore, it also achieves first place on the SOTS dataset with 30.31 dB PSNR and 0.965 SSIM. In addition, this invention uses the number of parameters (#Param.) and the number of floating-point operations (#FLOP) as the main indicators of computational efficiency. It can be seen that the method of this invention achieves the best dehazing effect using only 0.791M training parameters and the least amount of computation. Early dehazing algorithms based on prior knowledge, such as DCP, required no training parameters, but their dehazing assumptions were overly idealistic and difficult to adapt to the complex and ever-changing real-world haze environment, resulting in poor performance on both synthetic and real data. While recent state-of-the-art (SOTA) methods have made significant progress in performance, they generally suffer from a heavy dependence on large-scale training data. Convolutional Neural Network (CNN)-based methods, such as FFA-Net and DEA-Net, typically rely on deep convolutions and skip connections to model local features, gradually expanding the receptive field. However, convolution is inherently a local operation with limited ability to model global dependencies; therefore, they must rely on a large number of training samples to cover different haze distributions to learn robust features. When training samples are insufficient, convolutional models often fail to capture the complex changes in fog at different scales, easily leading to insufficient detail recovery and over-smoothing. Dehamer and Dehazeformer fully utilize self-attention mechanisms, significantly enhancing global feature modeling capabilities and demonstrating superior performance on large-scale datasets. However, self-attention mechanisms have a large number of parameters and high computational complexity, making their dependence on the number of training samples even more pronounced. With limited data, such methods are prone to overfitting, leading to models that overly rely on the specific scene semantics of the training set and lack cross-scene generalization ability. In contrast, the traffic image dehazing method based on wavelet convolution and semantic-content guidance proposed in this invention uses wavelet convolution to decompose features into low-frequency and high-frequency components: the low-frequency part preserves structural contours, while the high-frequency part enhances texture and edge details. This explicit frequency decomposition is interpretable and reduces reliance on large-scale training samples. The semantic-content feature fusion module integrates grouped convolution and attention mechanisms, suppressing redundant information and strengthening key features through dual semantic and content guidance, further improving adaptability in small-sample scenarios.Thanks to this structural design, the traffic image dehazing method based on wavelet convolution and semantic-content guidance can achieve superior dehazing performance under resource constraints.
[0135] Table 1
[0136]
[0137] This invention demonstrates visual comparison results between its method and various classic and state-of-the-art defogging methods on SOTS-indoor and SOTS-outdoor test sets, such as... HL and HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH ]=Conv([ LL LH HL HH As shown, due to the use of prior assumptions, the prior-based DCP is prone to color distortion and over-enhancing artifacts in thick fog scenes, making the overall image look unnatural. FFA-Net restores color in most areas of the processed image, but color distortion still exists on distant objects and small objects near the image edges. Dehazeformer enhances global modeling capabilities by improving the Swing Transformer, but it is prone to overfitting under small data conditions, leading to local texture loss or color deviation in the dehazing results. DEA-Net introduces a powerful content-guided attention mechanism and detail-enhancing convolution to enhance feature learning and improve dehazing performance, achieving ideal dehazing results even on small datasets; however, its required parameters and computational cost significantly exceed those of the method proposed in this invention. In summary, the traffic image dehazing method based on wavelet convolution and semantic-content guidance proposed in this invention exhibits significant advantages in visual effects. The dehazed image is clear with natural colors and appropriate contrast, and the overall perceptual quality is significantly better than other methods, fully verifying that the proposed method still possesses strong generalization and excellent visual performance under limited sample conditions.
[0138] Overall, this method not only improves the confidence and accuracy of target detection tasks but also enhances the robustness of the detection model under complex weather conditions. This performance improvement is attributed to the design that combines multi-scale convolution and wavelet convolution with an efficient feature fusion module, which balances local detail recovery with global context modeling. This allows the network to fully recover detailed features obscured by fog and provide clearer and more reliable image representations for downstream tasks.
Claims
1. A traffic image dehazing method based on wavelet convolution and semantic-content guided fusion, characterized in that, Includes the following steps: Step 1: Acquire foggy images and preprocess them, then use the processed images as input to the model; Step 2: Set the initial model parameters, including the parameters of the encoder, decoder, and feature transformation layer, as well as the training parameters; Step 3: The encoder performs feature enhancement through multi-scale wavelet convolution, then extracts features through multi-scale convolution kernels, and achieves multi-scale feature fusion based on an adaptive fusion strategy. The image patch embedding module is used for downsampling, dividing the image into multiple fixed-size image patches, mapping each image patch to a high-dimensional feature vector, and generating an embedded feature map. Step 4: Input the embedded feature map into the feature transformation layer, use multi-scale wavelet convolution to fuse the deep semantic features, and use the image patch restoration module to upsample the features. Use the semantic-content guided fusion module to fuse the upsampled features with the shallow features output from the encoder to obtain the fused features. Step 4 specifically includes the following steps: Step 4.1: Use multi-scale wavelet convolution to fuse deep features; Step 4.2: Upsampling is achieved through the image patch restoration module. After receiving the feature representation output by the embedding module, the number of feature channels is expanded through convolution operation. The channels are rearranged using PixelShuffle to restore the image shape and then transmit it to the next step. Step 4.3: Use the semantic-content guided fusion module to fuse low-level features and their corresponding high-level features. First, process the features through global average pooling across spatial dimensions, global max pooling across spatial dimensions, and global average pooling across channel dimensions to obtain the spatial and channel weights W. S and W C ; Step 4.4: Perform an addition operation on W. S and W C The data are then merged together, concatenated with the original input, and each channel is rearranged through channel shuffling. Finally, a 7×7 convolution and a sigmoid activation function are applied to obtain the final spatial importance map W. (6); in, This represents the Sigmoid activation function, which maps any real number input to the interval (0, 1). This represents a grouped convolution with a kernel size of 7×7, where X represents the input feature; The weighted summation is applied to both the low-level features and the corresponding high-level features: (7); in, Indicates the characteristics after preliminary processing. This indicates a convolution with a kernel size of 1×1, used to adjust the number of output channels; Represents underlying features. This represents the high-level features corresponding to the low-level features; Step 4.5: Use the grouped convolutional gating module to obtain the gated features F. gate The specific formula is as follows: (8); in, This represents the characteristics of the input gating module, GC low and GC high These represent grouped convolutions used to process low-level and high-level features, respectively. Step 4.6: Gated feature F gate Incorporating the features F after preliminary processing fuse In the process, the final fusion feature F is obtained. scg : (9); Where α is a learnable weight coefficient; Step 5: Input the fused features into the decoder, and gradually restore the image size through multi-scale wavelet convolution and image restoration module. At the same time, use semantic-content guided fusion module to combine the shallow detail features of encoder, and finally output the dehazed image. Step 6: Train the model, calculate the structural similarity index and peak signal-to-noise ratio between the output dehazed image and the real image, retain the model with the best performance and determine whether the preset number of iterations has been reached. If not, return to step 3. After reaching the number of iterations, obtain the parameters of the dehazed model with the best performance and apply it to traffic image dehazing.
2. The traffic image dehazing method based on wavelet convolution and semantic-content guided fusion according to claim 1, characterized in that, Step 1 specifically includes the following steps: Step 1.1: Read the OTS and SOTS datasets, subsets of the RESIDE dataset. Randomly select foggy images from the OTS dataset for training the model, and randomly select foggy images from the SOTS dataset for testing. Step 1.2: Randomly crop a 256×256 patch from the foggy image, and then apply two data augmentation techniques, including: 90° or 180° or 270° rotation and vertical or horizontal flip.
3. The traffic image dehazing method based on wavelet convolution and semantic-content guided fusion according to claim 1, characterized in that, Step 3 specifically includes the following steps: Step 3.1: In multi-scale wavelet convolution, features are first processed using channel attention and spatial attention modules, followed by channel expansion through a 1×1 pointwise convolutional layer; then, ReLU is used to introduce nonlinearity and BN is used for normalization to obtain the expanded feature map X. CAS ; Step 3.2: Expand the feature map X CAS The data is fed into multiple parallel deep convolutional branches, each using a different sized kernel to extract features from receptive fields at multiple scales. The specific details are as follows: (1); Where {K1,K2,K3}={1,3,5} represents different convolution kernel sizes. This represents the ReLU activation function, used to introduce nonlinear transformations; Indicates batch normalization, This represents depthwise separable convolution; Step 3.3: After multi-scale convolution, a channel shuffling operation is used to break the static channel distribution between features in each branch, enhancing cross-scale information interaction. The shuffled features are restored to the target number of channels through a 1×1 convolution and BN, yielding the final output. (2); in, This indicates a convolution with a 1×1 kernel, used to adjust the number of output channels and achieve inter-channel information fusion of feature maps. This indicates a channel shuffling operation, which facilitates information exchange between channels with different characteristics. Step 3.4: Construct wavelet transform WT and inverse wavelet transform IWT using convolution based on the following four sets of filters: (3); (4); in, This indicates a low-pass filter that preserves the low-frequency information of the image; This represents a horizontal high-pass filter that extracts vertical edge and horizontal texture details from an image. This represents a vertical high-pass filter that extracts horizontal edge and vertical texture details from an image and enhances vertical contour information. This represents a diagonal high-pass filter, used to capture details and corner features along the diagonal direction of an image, refining complex textures; X LL It is a low-frequency component, while X LH X HL X HH These are the horizontal, vertical, and diagonal high-frequency components of X, respectively; X represents the input feature. Indicates the convolution operation; because , , and An orthogonal basis is formed, therefore the inverse wavelet transform (IWT) is obtained through transpose convolution: (5); in, This represents the features obtained by inverse wavelet transform reconstruction; Indicates transposed convolution; Step 3.5: Recursively separate the feature map processed by the multi-scale convolution module into high-frequency and low-frequency components using wavelet decomposition; apply small-kernel depthwise convolution to the frequency components, and fuse the processed features back to the original space step by step through inverse wavelet reconstruction, finally obtaining the output X of the multi-scale wavelet convolution module. MSWC ; Step 3.6: Divide the image into multiple fixed-size image blocks through convolution operations, map each image block into a high-dimensional feature vector, and finally generate an embedded feature map to complete downsampling; Step 3.7: Repeat the combination of multi-scale wavelet convolution and downsampling layer, and input the result into the feature transformation layer.
4. The traffic image dehazing method based on wavelet convolution and semantic-content guided fusion according to claim 1, characterized in that, In step 6, the model is trained, and its mathematical formula is 10: (10); in, represents the mean absolute error loss, which measures the average absolute difference between the network-predicted image and the ground truth image at the pixel level; y represents the ground truth image corresponding to the foggy image. Represents a dehazed image, y i It is the true value of the i-th sample. Let N represent the predicted value of the i-th sample, and N be the number of samples.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.
6. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.
7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method of claim 1.
Citation Information
Patent Citations
Image defogging method based on adaptive feature fusion
CN114627002A
Emergency image defogging method based on wavelet transform frequency domain characteristics
CN120125469A