An image dehazing method based on adaptive feature fusion

The image defogging method through adaptive feature fusion uses lightweight coding units and residual enhancement bottleneck modules to extract and enhance features, and performs adaptive fusion and upsampling through efficient decoding units to solve the defogging effect in the existing technology. It solves unideal problems and achieves high-quality dehazed image reconstruction, reducing color distortion and incomplete dehazing.

CN114627002BInactive Publication Date: 2024-09-27SOUTH CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210120101.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-07
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing technologies tend to violate a priori assumptions when dehazing images, resulting in inaccurate estimates of transmittance maps and unsatisfactory dehazing effects. In addition, deep learning-based methods have problems with color distortion and insufficient dehazing.

Method used

An image defogging method based on adaptive feature fusion is adopted to extract deep features through lightweight coding units, the residual enhancement bottleneck module enhances features, and the efficient decoding unit performs adaptive fusion and upsampling to gradually restore image resolution and reduce color distortion. , generate high-quality dehazed images.

Benefits of technology

It achieves effective haze removal while reducing color distortion, reconstructing higher-quality dehazed images, improving dehazing performance, and making up for the edge and color detail information lost by the network in the forward process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114627002B
    Figure CN114627002B
Patent Text Reader

Abstract

The present invention discloses an image defogging method based on adaptive feature fusion, comprising the following steps: S1, extracting initial shallow features from an input foggy image; S2, obtaining deep features from the initial shallow features through first and second lightweight coding units in sequence; S3, enhancing the deep features using a residual enhancement bottleneck module; S4, effectively and adaptively fusing the deep features and shallow features using first and second efficient decoding units, while restoring the image resolution; S5, reducing the dimension and refining the output of the second efficient decoding unit to generate a final defogging image. Through the method of the present invention, less color distortion can be generated while effectively removing fog, and a higher quality defogging image can be reconstructed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and image processing, and in particular to an image defogging method based on adaptive feature fusion. Background Art

[0002] Under foggy conditions, the reflected light generated by the surface of the scene is scattered and absorbed by a large number of tiny water droplets, aerosols and other suspended particles in the atmosphere during the propagation process, and is attenuated when it reaches the imaging device, causing the images obtained by the computer vision system to show reduced contrast, blurred edges, dark colors and other phenomena, which will seriously affect the subsequent work of the computer vision system. Therefore, dehazing foggy images has important practical needs and research significance.

[0003] Early dehazing methods mainly estimated the atmospheric light value and the transmittance map of the foggy image through prior or assumption, and then substituted them into the classic atmospheric scattering model to invert and estimate the corresponding fog-free image. However, such algorithms are prone to violate prior assumptions in practice, resulting in inaccurate estimation of the transmittance map, which makes the dehazing effect unsatisfactory.

[0004] In recent years, with the continuous development of deep learning, more and more deep learning-based methods have been applied to the field of image dehazing to achieve direct end-to-end dehazing that does not rely on the atmospheric scattering model, and have achieved good results. However, there are still some shortcomings, such as color distortion and incomplete dehazing. Summary of the invention

[0005] The purpose of the present invention is to solve the above defects in the prior art and provide an image defogging method based on adaptive feature fusion. The method uses a lightweight coding unit to extract features to obtain higher quality deep features; further enhances the deep features through a residual enhancement bottleneck module; uses an efficient decoding unit to refine the shallow features and adaptively fuse them with the deep features, while gradually upsampling to restore the image resolution; through the method of the present invention, less color distortion can be generated while effectively removing fog, and a higher quality defogging image can be reconstructed.

[0006] The purpose of the present invention can be achieved by adopting the following technical solutions:

[0007] An image defogging method based on adaptive feature fusion, the image defogging method comprising the following steps:

[0008] S1, perform initial shallow feature extraction on the input foggy image;

[0009] S2, the initial shallow features are sequentially passed through the first and second lightweight coding units to obtain deep features, the first and second lightweight coding units each include a downsampling module and K lightweight feature extraction modules, first, the shallow features with half the size are obtained through the downsampling module, and then the shallow features are extracted through the lightweight feature extraction module to obtain deep features with richer semantic information;

[0010] S3, using the residual enhancement bottleneck module to further enhance the deep features and prevent the network performance from degrading due to gradient disappearance, the residual enhancement bottleneck module consists of 3 residual blocks;

[0011] S4. Use the first and second efficient decoding units to adaptively fuse the deep features and shallow features effectively and simultaneously restore the image resolution. Both the first and second efficient decoding units include a dual attention refinement module, an adaptive feature fusion module and an upsampling module. First, the dual attention refinement module is used to refine the shallow features and filter out the invalid redundant information in the shallow features. Then, the adaptive feature fusion module is used to effectively fuse the refined shallow features and deep features to compensate for the information loss in the downsampling process. Finally, the upsampling module is used to further expand the size of the fused features.

[0012] S5. Reduce the dimension and refine the output of the second efficient decoding unit to generate a final defogging image.

[0013] Furthermore, in step S1, the initial shallow features containing a large amount of information such as rich colors and edge details are extracted from the input foggy image through a 3×3 convolutional layer and a nonlinear activation unit ReLU to enhance the subsequent feature extraction effect. The expression is as follows:

[0014] f0=σ(conv 3×3 (I)) (1)

[0015] Among them, I represents the input foggy image, σ represents the nonlinear activation function ReLU, conv 3×3 It represents the convolution with a convolution kernel of 3×3, and f0 represents the extracted shallow features.

[0016] Furthermore, the lightweight feature extraction module first extracts the input features through a 1×1 convolutional layer and a 3×3 convolutional layer, and then uses channel separation. The split) operation divides the preliminary extraction results into two branches so that different feature extraction operations can be performed later to enrich the feature information. One branch consists of a 1×3 deep convolution layer and a 3×1 deep convolution layer. The combination of one-dimensional decomposition convolution and deep convolution can introduce fewer parameters and calculations than general standard convolutions, thereby reducing the complexity of the model to efficiently extract features. The other branch consists of a 1×3 deep expansion convolution layer and a 3×1 deep expansion convolution layer. The combination of one-dimensional decomposition convolution, deep convolution and expansion convolution can make the network have a larger receptive field in feature extraction on the basis of reducing the number of parameters, and can solve the grid artifact problem caused by only containing a single expansion convolution. By performing feature extraction of different scales on the two branches, the feature expression ability of the network can be enhanced, thereby obtaining richer feature information. After that, the results of the output of the two branches are spliced ​​in the channel dimension and then added to the input features. The residual connection is used here to prevent the network performance from degrading due to the disappearance of the gradient. Finally, the channel shuffle operation is used for reorganization to ensure that information flows between different branches, making the information of each branch richer. The expression is as follows:

[0017] f1,f2=split(conv 3×3 (conv 1×1 (f input ))) (2)

[0018] f concat =concat(DWConv 1×3 (DWConv 3×1 (f1)),DDWConv 1×3,r (DDWConv 3×1,r (f2))) (3)

[0019]

[0020] Among them, f input Represents the input of the lightweight feature extraction module, conv 1×1 Indicates that the convolution kernel is 1×1 convolution, conv 3×3 represents a convolution with a convolution kernel of 3×3, split represents a channel separation operation, f1 and f2 represent two branch features obtained by channel separation, and DWConv 1×3 Indicates that the convolution kernel is 1×3 depth convolution, DWConv 3×1 Indicates that the convolution kernel is 3×1 depth convolution, DDWConv 1×3,rDenotes a deep dilated convolution with a kernel of 1×3 and a dilation rate of r, DDWConv 3×1,r represents a deep dilated convolution with a convolution kernel of 3×1 and a dilation rate of r. concat represents concatenating two feature maps in the channel dimension. concat represents the features after splicing, is pixel-by-pixel addition, shuffle represents channel shuffling operation, f output Represents the output of the lightweight feature extraction module.

[0021] Furthermore, the dual attention refinement module is composed of a channel attention layer and a spatial attention layer connected in series. First, the weight of each channel of the input feature is adaptively learned through the channel attention layer, and the input feature is calibrated channel by channel using the weight. Then, the spatial attention layer is used to learn and calibrate the weight at the spatial level. The dual attention refinement module can eliminate useless information such as fog in shallow features as much as possible in both channel and spatial dimensions, realize adaptive selection of useful features and suppression of redundant features, and improve the subsequent fusion effect with deep features.

[0022] Furthermore, the adaptive feature fusion module first adds the shallow features and deep features of the same size pixel by pixel, and then uses two branches of different scales to extract channel attention weights, one of which uses a global average pooling layer and two 1×1 convolutional layers to extract channel attention weights with global context, and the other branch directly uses two 1×1 convolutional layers to extract channel attention weights with local context. After that, the output weights of the two branches are added pixel by pixel and normalized using the sigmoid function to obtain the adaptive fusion weights with the same size as the input shallow features, and finally the adaptive fusion weights are used. The fusion features are obtained by weighted averaging the shallow features and deep features. Compared with some fusion methods that only provide fixed linear combinations, such as simple direct addition or channel splicing, this adaptive feature fusion module allows the network to learn the relative importance between the corresponding elements of the shallow features and the deep features, and promotes the information negotiation between the shallow and deep features to improve the fusion effect, thereby effectively compensating for the edge, color and other detail information lost by the network in the forward process, so that the network can effectively eliminate the fog while maintaining rich edge details and more natural colors, thereby improving the defogging quality. The calculation process of the adaptive feature fusion module is expressed as follows:

[0023]

[0024]

[0025]

[0026]

[0027] Among them, GAP is the global average pooling function, H and W represent the length and width of the feature map f respectively, and f C is the Cth channel of feature map f, f low-level represents shallow features, f high-level Represents deep features, is pixel-by-pixel addition, f add Represents the features after pixel-by-pixel addition, conv 1×1 represents a convolution with a convolution kernel of 1×1, σ2 is a nonlinear activation function Sigmoid, and W represents an adaptive fusion weight. is pixel-by-pixel multiplication, f fusion Represents fusion features.

[0028] Furthermore, in step S5, the output result of the second efficient decoding unit is reduced in dimension and local context information is exchanged through a 3×3 convolutional layer and a nonlinear activation unit Sigmoid to refine the decoding result, thereby generating a final defogging image, and the expression is as follows:

[0029] J = σ3(conv 3×3 (f de )) (9)

[0030] Among them, J represents the final generated dehazed image, f de represents the output result of the second efficient decoding unit, σ3 represents the nonlinear activation function Sigmoid, conv 3×3 Indicates a convolution with a convolution kernel of 3×3.

[0031] Furthermore, the channel separation operation split is to divide the input feature map into two groups in the channel dimension direction. By grouping the input feature map using the channel separation operation, it is convenient to perform different feature extraction operations on different groups in the subsequent step to obtain richer feature information.

[0032] Furthermore, the process of the channel shuffle operation is as follows:

[0033] Assume that the input layer features are initially divided into g groups through the channel separation operation, the number of channels in each group of features is n, and the total number of channels is g×n. Channel shuffling first splits the channel dimension g×n into two dimensions (g,n), then transposes it to (n,g), and finally adjusts the shape to dimension g×n to achieve the reorganization of the feature map. Since the channel separation operation may cause some information loss when the feature map is grouped, it is necessary to perform channel exchange later. The channel shuffling operation is essentially a channel exchange operation. Since the information contained in different channels in the same group may be the same, if some channels are exchanged between different groups, information exchange can be performed. This makes the information of each group richer, and naturally more features can be extracted, which is conducive to obtaining better results.

[0034] Compared with the prior art, the present invention has the following advantages and effects:

[0035] (1) The image defogging algorithm based on adaptive feature fusion provided by the present invention can directly learn the mapping relationship between the input image and the clear image, and realize the defogging of the foggy image in an end-to-end manner;

[0036] (2) The image defogging algorithm based on adaptive feature fusion provided by the present invention uses a lightweight feature extraction module to expand the receptive field and enhance the feature extraction capability while introducing fewer parameters and computational complexity, so as to better extract effective deep features and solve the problem of grid artifacts;

[0037] (3) The image defogging algorithm based on adaptive feature fusion provided by the present invention adopts a dual attention refinement module to eliminate useless information such as fog in shallow features as much as possible in both channel and spatial dimensions, enhance the subsequent fusion effect with deep features, and thus improve the defogging quality;

[0038] (4) The image dehazing algorithm based on adaptive feature fusion provided by the present invention utilizes an adaptive feature fusion module to adaptively fuse refined shallow features and deep features, which can effectively compensate for the edge, color and other detail information lost by the network in the forward process, thereby effectively eliminating fog while maintaining rich edge contours and reducing color distortion, further improving the dehazing performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0040] Figure 1 It is a structural schematic diagram of an image defogging method based on adaptive feature fusion disclosed in the present invention;

[0041] Figure 2It is a structural schematic diagram of a lightweight feature extraction module in the present invention;

[0042] Figure 3 Schematic diagram of the process of channel separation and channel shuffling operation in the present invention; wherein, Figure 3 (a) is a schematic diagram of channel separation operation. Figure 3 (b) is a schematic diagram of channel shuffling operation;

[0043] Figure 4 It is a structural diagram of the adaptive feature fusion module in the present invention;

[0044] Figure 5 It is a structural schematic diagram of an adaptive fusion weight generation module of an adaptive feature fusion module in the present invention;

[0045] Figure 6 This is a comparison chart of the defogging effects of different defogging methods of the present invention on the SOTS dataset, where: Figure 6 (a) is a synthetic foggy image. Figure 6 (b) is a schematic diagram of the dehazing results of the DCP method. Figure 6 (c) is a schematic diagram of the dehazing results of the CAP method. Figure 6 (d) is a schematic diagram of the dehazing results of the AOD-Net method. Figure 6 (e) is a schematic diagram of the dehazing results of the GCANet method. Figure 6 (f) is a schematic diagram of the dehazing results of the EPDN method. Figure 6 (g) is a schematic diagram of the defogging result of the method of the present invention, Figure 6 (h) is the real haze-free image used as reference. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Example 1

[0048] like Figure 1 As shown, this embodiment provides an image defogging method based on adaptive feature fusion, which uses a lightweight coding unit to extract features to obtain richer deep features; further enhances the deep features through a residual enhancement bottleneck module; uses an efficient decoding unit to refine the shallow features and adaptively fuse them with the deep features, and gradually upsamples to restore the image resolution, specifically including the following steps:

[0049] S1. Perform initial shallow feature extraction on the input foggy image, specifically:

[0050] The initial shallow features are extracted from the input foggy image through a 3×3 convolutional layer and a nonlinear activation unit ReLU. The expression is as follows:

[0051] f0=σ(conv 3×3 (I)) (1)

[0052] Among them, I represents the input foggy image, σ represents the nonlinear activation function ReLU, conv 3×3 represents a convolution with a convolution kernel of 3×3, and f0 represents the features extracted by the convolution layer.

[0053] S2. The initial shallow features are passed through the first and second lightweight coding units to obtain richer deep features. The first and second lightweight coding units each include a downsampling module and K lightweight feature extraction modules. First, the shallow features with half the size are obtained through the downsampling module. Then, the shallow features are extracted through the lightweight feature extraction module to obtain deep features with richer semantic information. Specifically:

[0054] Lightweight feature extraction modules such as Figure 2 As shown in the figure, the input features are first extracted through 1×1 convolutional layers and 3×3 convolutional layers. Then, the channel split operation is used to divide the preliminary extraction results into two branches, one of which is composed of 1×3 deep convolutional layers and 3×1 deep convolutional layers, and the other is composed of 1×3 deep expansion convolutional layers and 3×1 deep expansion convolutional layers. After that, the output results of the two branches are spliced ​​in the channel dimension and then added to the input features. Finally, the channel shuffle operation is used to reorganize to ensure that information flows between different branches. The expression is as follows:

[0055] f1,f2=split(conv 3×3 (conv 1×1 (f input ))) (2)

[0056] f concat =concat(DWConv 1×3 (DWConv 3×1 (f1)),DDWConv 1×3,r (DDWConv 3×1,r (f2))) (3)

[0057]

[0058] Among them, finput Represents the input of the lightweight feature extraction module, conv 1×1 Indicates that the convolution kernel is 1×1 convolution, conv 3×3 Indicates a convolution with a convolution kernel of 3×3, split indicates a channel separation operation, and the specific process is as follows Figure 3 As shown in (a), this operation divides the input feature map into two groups in the channel dimension direction. f1 and f2 represent the two branch features obtained by channel separation. DWConv 1×3 Indicates that the convolution kernel is 1×3 depth convolution, DWConv 3×1 Indicates that the convolution kernel is 3×1 depth convolution, DDWConv 1×3,r Denotes a deep dilated convolution with a kernel of 1×3 and a dilation rate of r, DDWConv 3×1,r represents a deep dilated convolution with a convolution kernel of 3×1 and a dilation rate of r. concat represents concatenating two feature maps in the channel dimension. concat represents the features after splicing, To add pixel by pixel, shuffle means channel shuffle operation, the specific process is as follows Figure 3 As shown in (b), assuming that the input layer features are initially divided into g groups through channel separation operation, the number of channels in each group of features is n, and the total number of channels is g×n. Channel shuffling first splits the channel dimension g×n into two dimensions (g,n), then transposes it to (n,g), and finally adjusts the shape to dimension g×n, thereby realizing the reorganization of the feature map. By default, g=2, f output Represents the output of the lightweight feature extraction module.

[0059] In this embodiment, the number of lightweight feature extraction modules of the first lightweight coding unit is set to K=3, and the expansion rate of the deep dilated convolution in each lightweight feature extraction module is set to r=1, 1, 1 respectively; the number of lightweight feature extraction modules of the second lightweight coding unit is taken as K=4, and the expansion rate of the deep dilated convolution in each lightweight feature extraction module is taken as r=1, 3, 6, 12 respectively; the values ​​of K and r in this embodiment do not constitute a limitation on the technical solution of the present invention;

[0060] Using a hybrid convolution including decomposed convolution, depthwise convolution and dilated convolution in a lightweight feature extraction module can expand the receptive field to better extract effective deep features while introducing fewer parameters and computation; channel separation and channel shuffling techniques can also help us eliminate redundant calculations, reduce the number of parameters, and thus speed up model training; by designing different dilation rates for each lightweight feature extraction module, the grid artifact problem caused by only a single dilated convolution can be solved while increasing the diversity of the receptive field.

[0061] S3, using the residual enhancement bottleneck module to further enhance the deep features while preventing the network performance from degrading, the residual enhancement bottleneck module consists of 3 residual blocks;

[0062] Generally speaking, as the depth of the neural network increases, it usually produces better network performance, but a network that is too deep will bring great challenges to network weight optimization, which can easily lead to gradient disappearance and network performance degradation. To solve this problem, 3 residual blocks are embedded in the bottleneck structure to enhance the features while preventing the degradation of network performance due to gradient disappearance.

[0063] S4, using the first and second efficient decoding units to effectively and adaptively fuse the deep features and the shallow features, while restoring the image resolution, each of the efficient decoding units includes a dual attention refinement module, an adaptive feature fusion module and an upsampling module, firstly, the dual attention refinement module is used to refine the shallow features, and the invalid redundant information in the shallow features is filtered out, then, the refined shallow features and deep features are effectively fused through the adaptive feature fusion module to compensate for the information loss in the downsampling process, and finally, the upsampling module is used to further expand the size of the fused features, specifically:

[0064] The dual attention refinement module consists of a channel attention layer and a spatial attention layer connected in series. First, the channel attention layer adaptively learns the weight of each channel of the input feature, and uses the weight to calibrate the input feature channel by channel. Then, the spatial attention layer is used to learn and calibrate the weights at the spatial level.

[0065] Shallow features may contain a lot of erroneous and useless information such as fog. If they are directly fused with deep features, the accuracy of the entire neural network will decrease. Therefore, the channel and spatial attention mechanism is integrated into the defogging network to make the network pay more attention to dense fog areas and high-frequency areas, and learn and calibrate the weights of features at the channel and spatial levels, so as to filter out invalid information such as fog in shallow features, so as to improve the subsequent fusion effect with deep features and achieve a positive auxiliary role in network defogging.

[0066] Adaptive feature fusion module such as Figure 4 and 5As shown in the figure, the shallow features and deep features of the same size are first added pixel by pixel, and then two branches of different scales are used to extract the channel attention weights. One branch uses a global average pooling layer and two 1×1 convolutional layers to extract the channel attention weights with global context, and the other branch directly uses two 1×1 convolutional layers to extract the channel attention weights with local context. After that, the output weights of the two branches are added pixel by pixel and normalized using the sigmoid function to obtain an adaptive fusion weight with the same size as the input shallow feature. Finally, the adaptive fusion weight is used to perform weighted averaging on the shallow features and deep features to obtain the fused features. The expression of the calculation process is as follows:

[0067]

[0068]

[0069]

[0070]

[0071] Among them, GAP is the global average pooling function, H and W represent the length and width of the feature map f respectively, and f C is the Cth channel of feature map f, f low-level represents shallow features, f high-level Represents deep features, is pixel-by-pixel addition, f add Represents the features after pixel-by-pixel addition, conv 1×1 represents a convolution with a convolution kernel of 1×1, σ2 is a nonlinear activation function Sigmoid, and W represents an adaptive fusion weight. is pixel-by-pixel multiplication, f fusion Indicates fusion features;

[0072] In the codec structure, the deeper the number of layers of the encoder, the easier it is for the encoder to lose a lot of spatial information. In order to compensate for the spatial details lost in the encoding downsampling process, it is usually necessary to fuse the semantic information of the deep features and the detail information of the shallow features in the decoder. Most defogging methods simply use the addition or channel splicing method. These operations only provide a fixed linear combination between feature maps, and it is completely unknown whether this combination is suitable for a specific object. The present invention can effectively combine the deep semantic context and the shallow spatial details to compensate for the edge, color and other detail information lost by the network in the forward process by adaptively fusing the shallow features and the deep features, so as to effectively remove the fog while maintaining rich edge details and producing less color distortion, thereby improving the defogging accuracy.

[0073] S5, reducing the dimension and refining the output of the second efficient decoding unit to generate the final defogging image, specifically:

[0074] The output result of the second efficient decoding unit is further reduced and refined through a 3×3 convolutional layer and a nonlinear activation unit Sigmoid. The expression is as follows:

[0075] J = σ3(conv 3×3 (f de )) (9)

[0076] Among them, J represents the final generated dehazed image, f de represents the output result of the second efficient decoding unit, σ3 represents the nonlinear activation function Sigmoid, conv 3×3 Indicates a convolution with a convolution kernel of 3×3.

[0077] Example 2

[0078] In order to verify the effectiveness of the image defogging method based on adaptive feature fusion proposed in the present invention, the method is compared with five existing image defogging methods with good effects, including DCP, CAP, AOD-Net, GCANet and EPDN, in terms of both subjective and objective aspects on a synthetic foggy image dataset.

[0079] A comparative experiment was conducted on a synthetic foggy image dataset, and the ITS indoor synthetic foggy image dataset in the current mainstream RESIDE dataset was selected as the training set to train the network. Specifically, the ITS training set contains 13,990 synthetic indoor foggy images, which are generated by adjusting different fog concentrations from 1,399 indoor clear images. In addition, the SOTS dataset containing 50 real indoor fog-free images and their corresponding 500 indoor synthetic foggy images in the RESIDE dataset was selected as the test set to evaluate the defogging performance of the method of the present invention.

[0080] The entire experiment was conducted on a server powered by NVIDIA TITAN Xp GPUs, and the network was implemented using the PyTorch framework. During network training, the size of all training images was uniformly adjusted to 256×256, and the batch size was set to 8. The entire network was trained for 100 epochs, using the Adam optimizer with an initial learning rate of 0.0001 and a decay of 0.5 every 10 epochs.

[0081] Figure 6 The subjective visual comparison of the dehazing effects of different methods on 4 synthetic indoor foggy images in the SOTS test set is shown. Figure 6 (a) is a synthetic foggy image. Figure 6(h) is a real fog-free image. The synthetic foggy image is generated by adding fog to the real fog-free image. The DCP method, the CAP method, the AOD-Net method, the GCANet method, the EPDN method and the method of the present invention respectively defog the synthetic foggy image to obtain their own defogged images. Figure 6 (b) to Figure 6 (g) As shown. The defogging images generated by each defogging method are subjectively compared with the real non-fogging image to analyze the defogging effect of each defogging method. It can be seen that the DCP defogging method can remove fog well, but the color of some areas of the defogging result is dark (such as Figure 6 (b) The color of the 2nd, 3rd, and 4th floor Figure 6 The image dehazing results obtained by CAP and AOD-Net still have obvious fog (e.g. Figure 6 (c) and Figure 6 (d) The red wall area in the first image has obvious fog residue); The defogging effect of the GCANet method is relatively ideal, but there is a problem of uneven defogging in some areas (such as Figure 6 (e) The dehazing of the red wall in the first image is uneven); the EPDN method has a better visual effect and more thorough dehazing, but some areas also have dark tones (such as Figure 6 (f) The color of the table in Figures 3 and 4 Figure 6 The corresponding fog-free image area in (h) is darker than that in Figure 6 As shown in (h), compared with the above methods, the method of the present invention has the most thorough defogging, almost no color distortion, can well preserve image detail information, and the generated defogging image is overall closest to the real haze-free image.

[0082] In order to objectively evaluate the defogging performance of the proposed method, the peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) are combined to quantitatively compare the proposed method with other five defogging methods using 500 indoor synthetic haze images of the SOTS test set. The objective evaluation indicators of PSNR and SSIM are used to measure the similarity between the defogging images obtained by each defogging method and the real haze-free images. The higher the PSNR and SSIM values, the higher the image quality after defogging. Table 1 shows the average PSNR and SSIM results of 500 defogging images of different methods. It can be seen that the PSNR and SSIM index values ​​of the proposed method are significantly higher than those of other defogging methods, indicating that the defogging effect of the proposed method is more ideal and the defogging results are closer to the real haze-free images as a whole.

[0083] Table 1. Comparison of the mean values ​​of objective indicators of different dehazing methods on the SOTS test set

[0084] DCP CAP AOD-Net GCANet EPDN Method of the present invention PSNR 19.8398 18.9787 19.7553 28.6970 25.0685 33.4766 SSIM 0.8629 0.8421 0.8582 0.9577 0.9306 0.9895

[0085] In summary, no matter from a subjective or objective perspective, the defogging method proposed in the present invention shows a more ideal defogging effect, substantially eliminating the fog and color distortion of the image, and is closer to the real fog-free image used as a reference.

[0086] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. An image defogging method based on adaptive feature fusion, It is characterized in that The image defogging method comprises the following steps: S1, perform initial shallow feature extraction on the input foggy image; S2, the initial shallow features are sequentially passed through the first and second lightweight coding units to obtain deep features, the first and second lightweight coding units each include a downsampling module and K lightweight feature extraction modules, first, the shallow features with half the size are obtained through the downsampling module, and then the shallow features are extracted through the lightweight feature extraction module to obtain deep features with richer semantic information; S3, using a residual enhancement bottleneck module to enhance the deep features, wherein the residual enhancement bottleneck module is composed of three residual blocks; S4. Adaptively fuse the deep features and the shallow features using the first and second efficient decoding units, and restore the image resolution at the same time. Both the first and second efficient decoding units include a dual attention refinement module, an adaptive feature fusion module, and an upsampling module. First, the dual attention refinement module is used to refine the shallow features and filter out the invalid redundant information in the shallow features. Then, the refined shallow features and deep features are effectively fused through the adaptive feature fusion module to compensate for the information loss in the downsampling process. Finally, the upsampling module is used to further expand the size of the fused features. Among them, the adaptive feature fusion module first adds the shallow features and deep features of the same size pixel by pixel, and then uses two branches of different scales to extract channel attention weights, one of which uses a global average pooling layer and two 1×1 convolutional layers to extract channel attention weights with global context, and the other branch directly uses two 1×1 convolutional layers to extract channel attention weights with local context. After that, the output weights of the two branches are added pixel by pixel and normalized using the sigmoid function to obtain an adaptive fusion weight with the same size as the input shallow feature. Finally, the adaptive fusion weight is used to perform weighted averaging on the shallow features and deep features to obtain the fused features. The expression of the calculation process is as follows: Among them, GAP is the global average pooling function, H and W represent the length and width of the feature map f respectively, and f C is the Cth channel of feature map f, f low-level represents shallow features, f high-level Represents deep features, is pixel-by-pixel addition, f add Represents the features after pixel-by-pixel addition, conv 1×1 represents a convolution with a convolution kernel of 1×1, σ 2 is the nonlinear activation function Sigmoid, W represents the adaptive fusion weight, is pixel-by-pixel multiplication, f fusion Indicates fusion features; S5. Reduce the dimension and refine the output of the second efficient decoding unit to generate a final defogging image.

2. According to the image defogging method based on adaptive feature fusion according to claim 1, It is characterized in that In step S1, the initial shallow features are extracted from the input foggy image through a 3×3 convolutional layer and a nonlinear activation unit ReLU, and the expression is as follows: f 0 =σ(conv 3×3 (I)) (1) Among them, I represents the input foggy image, σ represents the nonlinear activation function ReLU, conv 3×3 Indicates a convolution with a convolution kernel of 3×3, f 0 Represents the extracted shallow features.

3. The image defogging method based on adaptive feature fusion according to claim 1, It is characterized in that The lightweight feature extraction module first performs preliminary extraction of input features through 1×1 convolutional layers and 3×3 convolutional layers, and then uses channel separation operation to divide the preliminary extraction results into two branches, one of which is composed of 1×3 deep convolutional layers and 3×1 deep convolutional layers, and the other is composed of 1×3 deep expansion convolutional layers and 3×1 deep expansion convolutional layers. After that, the output results of the two branches are spliced ​​in the channel dimension and then added to the input features. Finally, the channel shuffle operation is used for reorganization to ensure that information flows between different branches. The expression is as follows: f 1 ,f 2 =split(conv 3×3 (conv 1×1 (f input ))) (2) f concat =concat(DWConv 1×3 (DWConv 3×1 (f 1 )),DDWConv 1×3,r (DDWConv 3×1,r (f 2 ))) (3) Among them, f input Represents the input of the lightweight feature extraction module, conv 1×1 Indicates that the convolution kernel is 1×1 convolution, conv 3×3 represents a convolution with a convolution kernel of 3×3, split represents a channel separation operation, and f 1 and f 2 Represents the two branch features obtained by channel separation, DWConv 1×3 Indicates that the convolution kernel is 1×3 depth convolution, DWConv 3×1 Indicates that the convolution kernel is 3×1 depth convolution, DDWConv 1×3,r Denotes a deep dilated convolution with a kernel of 1×3 and a dilation rate of r, DDWConv 3×1,r represents a deep dilated convolution with a convolution kernel of 3×1 and a dilation rate of r. concat represents concatenating two feature maps in the channel dimension. concat Represents the features after splicing, is pixel-by-pixel addition, shuffle represents channel shuffling operation, f output Represents the output of the lightweight feature extraction module.

4. The image defogging method based on adaptive feature fusion according to claim 1, It is characterized in that The dual attention refinement module is composed of a channel attention layer and a spatial attention layer connected in series. First, the channel attention layer is used to adaptively learn the weight of each channel of the input feature, and the weight is used to calibrate the input feature channel by channel. Then, the spatial attention layer is used to learn and calibrate the weights at the spatial level.

5. The image defogging method based on adaptive feature fusion according to claim 1, It is characterized in that In step S5, the output result of the second efficient decoding unit is further reduced in dimension and refined through a 3×3 convolutional layer and a nonlinear activation unit Sigmoid, and the expression is as follows: J=σ 3 (conv. 3×3 (f de )) (9) Among them, J represents the final generated dehazed image, f de represents the output result of the second efficient decoding unit, σ 3 Represents nonlinear activation function Sigmoid, conv 3×3 Indicates a convolution with a convolution kernel of 3×3.

6. The image defogging method based on adaptive feature fusion according to claim 3, It is characterized in that The channel separation operation split is to divide the input feature map into two groups in the channel dimension direction.

7. The image defogging method based on adaptive feature fusion according to claim 3, It is characterized in that The process of the channel shuffle operation is as follows: Assuming that the input layer features are initially divided into g groups through a channel separation operation, the number of channels in each group of features is n, and the total number of channels is g×n, channel shuffling first splits the channel dimension g×n into two dimensions (g,n), then transposes it to (n,g), and finally adjusts the shape to dimension g×n, thereby realizing the reorganization of the feature map.