Frequency domain and spatial domain adaptive collaborative modeling image defogging method
An image dehazing method that uses adaptive collaborative modeling in the frequency and spatial domains solves the problem of unstable dehazing effect in existing technologies by utilizing a frequency domain enhanced attention module and a dynamic feature fusion module, and achieves high-quality image restoration under non-uniformly distributed fog or dense fog conditions.
Patent Information
- Application Number
- CN202610099682.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-15
AI Technical Summary
Current mainstream dehazing algorithms struggle to guarantee the stability and clarity of dehazing effects when faced with non-uniformly distributed fog or dense fog.
An image dehazing method employing adaptive collaborative modeling in the frequency and spatial domains is proposed. By combining a shallow feature extraction module, a frequency domain enhanced attention encoder, and a frequency domain enhanced attention decoder with a frequency domain enhanced attention module, a dual-branch feature supplementation module, and a dynamic feature fusion module, the stability and clarity of the dehazing effect are improved.
It improves the stability and clarity of image dehazing, especially under non-uniformly distributed fog or dense fog conditions, significantly enhancing image restoration quality and detail reproduction capabilities.
Smart Images

Figure CN122048716A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image restoration technology, and in particular to an image dehazing method that uses adaptive co-modeling in the frequency and spatial domains. Background Technology
[0002] Vision plays a crucial role in human perception and understanding of the world, and images are an important medium for visual information. Therefore, image information has become an indispensable part of daily life. With the rapid development of computer vision and image processing technologies, image processing techniques have been widely applied in various fields, such as traffic monitoring, object detection, object tracking, autonomous vehicles, and remote sensing systems. These applications typically require the analysis of high-quality images or videos. However, adverse weather conditions such as fog can affect the visibility of scenes. Images captured in foggy conditions are affected by atmospheric particulate scattering, leading to reduced contrast and color changes, which significantly degrades the quality of the captured image and thus reduces the performance of visual tasks.
[0003] In the development of deep learning dehazing algorithms, early solutions were mostly based on the Atmospheric Scattering Model (ASM). This model can clearly explain the physical processes of foggy imaging. The core idea is to generate transport maps through a network and combine them with the original fog image to restore a clear image. This design significantly reduced the model complexity of the dehazing network and became the core technical path for early deep learning dehazing.
[0004] Currently, significant progress has been made in non-ASM end-to-end deep learning dehazing algorithms. These methods do not rely on physical models; they can directly output dehazing results through various network structures based solely on the input fog map. Common approaches include encoder-decoder architectures, generative adversarial networks (GANs), attention mechanism networks, and Transformer-based networks.
[0005] However, existing mainstream defogging algorithms still have obvious limitations: most of them are optimized for sparse and uniformly distributed fog scenes, and when faced with non-uniformly distributed fog or dense fog, they often cannot guarantee the stability and clarity of the defogging effect. Summary of the Invention
[0006] To address the aforementioned problems in the prior art, this invention employs an image dehazing method based on adaptive co-modeling in the frequency and spatial domains. The method includes: acquiring a hazy image; inputting the hazy image into a trained image dehazing model to obtain a dehazed image; the image dehazing model includes: a shallow feature extraction module, a frequency domain enhanced attention encoder, and a frequency domain enhanced attention decoder; the training process of the image dehazing model includes:
[0007] S1. Obtain the foggy image dataset, which includes multiple foggy images. and its fog-free image Fog images will be included. Input the shallow feature extraction module to obtain preliminary features. ;
[0008] S2, Preliminary characteristics Input frequency domain augmented attention encoder to obtain high-level features ;
[0009] S3, Advanced Features Input frequency domain enhanced attention decoder to obtain residual features ;
[0010] S4, Fog Image Its residual characteristics Add them together to get the dehazed image. ;
[0011] S5. Based on the foggy image Haze-free images and dehazed images Calculate the loss function value, update the parameters of the image dehazing model based on the loss function value, and obtain the trained image dehazing model when the loss function value is minimized.
[0012] The beneficial effects of this invention are:
[0013] 1. This invention introduces a frequency domain enhanced attention module during the encoding and decoding process, constructing a dehazing model that adaptively and collaboratively models the frequency and spatial domains, thereby improving the stability and clarity of the dehazing effect. 2. The frequency domain enhanced attention module of this invention captures different frequency components in the image by introducing a frequency domain module. These components reflect information at different scales of the image. By introducing an attention module, the frequency domain enhanced attention module can selectively enhance the frequency components that are crucial to the dehazing task, while suppressing noise and irrelevant information, thereby improving the stability and clarity of the dehazing effect. 3. This invention introduces a dual-branch feature supplementation module in the frequency domain module, enabling the network to comprehensively consider global information and local details, which helps to improve the image restoration quality and detail restoration capability. 4. The decoder of this invention introduces a dynamic feature fusion module, which extracts features at different scales from the feature map to capture rich detail information. Through the dynamic feature fusion mechanism, it effectively integrates features from different scales, thereby improving the stability and clarity of the dehazing effect. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the structure of the image dehazing model provided in an embodiment of the present invention;
[0015] Figure 2 This is a structural diagram of the frequency domain enhanced attention module provided in an embodiment of the present invention;
[0016] Figure 3 This is a structural diagram of the dual-branch feature supplementation module provided in an embodiment of the present invention;
[0017] Figure 4 This is a structural diagram of the dynamic feature fusion module provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] like Figure 1 As shown, this embodiment of the invention employs an image dehazing method using adaptive co-modeling in the frequency and spatial domains, comprising: acquiring a hazy image; inputting the hazy image into a trained image dehazing model to obtain a dehazed image; the image dehazing model includes: a shallow feature extraction module, a frequency domain enhanced attention encoder, and a frequency domain enhanced attention decoder; the training process of the image dehazing model includes:
[0020] S1. Obtain the foggy image dataset, which includes multiple foggy images. and its fog-free image Fog images will be included. Input the shallow feature extraction module to obtain preliminary features. Where H and W are the height and width of the image;
[0021] In this implementation, the datasets used are O-HAZE, DENSE-HAZE, NH-HAZE-20, NH-HAZE-21, and NH-HAZE-23. O-HAZE contains 45 pairs of foggy images and corresponding clear, fog-free images of outdoor scenes. DENSE-HAZE is characterized by dense and uniform fog scenes; this dataset contains 55 pairs of real dense fog images and corresponding fog-free images of various outdoor scenes. These dense fog images were generated by a professional fog machine. The images are almost indistinguishable from the original objects, making dehazing significantly more difficult compared to regular datasets. The NH-HAZE dataset consists of a set of real non-uniform fog images and corresponding fog-free image pairs. The non-uniform fog was introduced using a professional fog generator to simulate real foggy conditions. Based on their shooting and release dates, it can be further divided into NH-HAZE-20, NH-HAZE-21, and NH-HAZE-23, with 40, 25, and 55 image pairs respectively. More detailed information can be found in the table below:
[0022]
[0023] In one embodiment, the foggy image dataset is preprocessed, including image normalization, cropping, rotation, and other processing, to ensure data quality and improve model training efficiency.
[0024] The shallow feature extraction module consists of N shallow feature extraction layers connected in series; the shallow feature extraction module is used for foggy images. The processing includes:
[0025] Foggy image Inputting the first shallow feature extraction layer yields preliminary features at the first scale. ;
[0026] Foggy image Inputting the second shallow feature extraction layer yields preliminary features at the second scale. ;
[0027] Preliminary features of the second scale Inputting the third shallow feature extraction layer yields preliminary features at the third scale. ;
[0028] Preliminary features of the previous scale Input the current shallow feature extraction layer to obtain preliminary features at the current scale. ;
[0029] Repeat the previous step until the preliminary features output by the last shallow feature extraction layer are obtained. ;
[0030] Combine the preliminary features output from each shallow feature extraction layer Preliminary characteristics were obtained. .
[0031] In this embodiment, the first shallow feature extraction layer is The convolutional layer, and the remaining shallow feature extraction layers, in sequence include: average pooling layer, Convolutional layers and Depthwise separable convolutional layers, N = 4; the initial feature sizes output by each shallow feature extraction layer are respectively... , , , .
[0032] S2, Preliminary characteristics Input frequency domain augmented attention encoder to obtain high-level features ;
[0033] The frequency domain enhanced attention encoder consists of N frequency domain enhanced attention modules connected in series; the frequency domain enhanced attention encoder processes the initial features... The processing includes:
[0034] S21, Preliminary features of the first scale Inputting the first frequency domain enhanced attention module yields high-level features at the first scale. ;
[0035] S22, High-level features at the first scale Downsampling is performed to obtain the downsampled features at the second scale. The downsampling features of the second scale Preliminary features of the second scale The features are added together and then input into the second frequency domain enhanced attention module to obtain the high-level features at the second scale. ;
[0036] S23, High-level features at the next higher scale (n-1) Perform downsampling to obtain the downsampled features at the current scale n. The downsampled features at the current scale n and preliminary features at the current scale n The features are added together and then input into the current frequency domain enhanced attention module to obtain the high-level features at the current scale n. ;
[0037] S24. Repeat step S23 until the high-level features output by the last frequency domain enhanced attention module are obtained. ;
[0038] S25. Combine the high-level features output by each frequency domain enhanced attention module. To obtain advanced features .
[0039] In one embodiment, the number of frequency domain enhanced attention modules is four, and the dimensions of the high-level features output by each frequency domain enhanced attention module are respectively... , , , .
[0040] like Figure 2 As shown, the frequency domain enhanced attention module includes a frequency domain module and an attention module. The frequency domain enhanced attention module processes its input features by inputting the input features into the frequency domain module and inputting the output of the frequency domain module into the attention module to obtain the output features of the frequency domain enhanced attention module.
[0041] In one embodiment, the number of frequency domain modules is 2, and the number of attention modules is 4.
[0042] The purpose of the frequency domain module is to capture different frequency components of the image to understand local frequencies. The frequency domain module includes: a first normalization layer, an FFT layer, a weighted gated layer, an IFFT layer, a DBFC, a second normalization layer, and a dual-scale gated feedforward block. Among them, DBFC is a dual-branch feature supplementation module, FFT is Fast Fourier Transform, and IFFT is Inverse Fast Fourier Transform.
[0043] The frequency domain module processes its input features including:
[0044] The input features are fed into the first normalization layer and DBFC respectively to obtain the normalized feature map and the frequency domain supplementary feature map;
[0045] The output of the first normalized layer is input into the FFT layer to transform the physical space into the frequency domain space, thus obtaining the frequency domain feature map;
[0046] The Fast Fourier Transform is:
[0047]
[0048] in, Normalized feature map The 2D FFT result, i.e., the frequency domain feature map, and These are the number of rows and columns of the normalized feature map, respectively. and These are the x and y coordinates in the image coordinate system. and These are coordinates in the frequency domain. and Corresponding to the normalized feature maps at and Frequency components in the direction, It is the imaginary unit.
[0049] The output of the FFT layer is input into the weighted gate layer to obtain the weighted frequency domain feature map. ;in, These are learnable weight parameters used to determine the weight of each frequency component in order to properly capture the lines and edges of the image;
[0050] The output of the weighted gated layer is input into the IFFT layer to transform the frequency domain space back into the physical space, thus obtaining the frequency domain enhanced feature map.
[0051] The inverse fast Fourier transform is:
[0052]
[0053] in, It is a 2D IFFT result, i.e., a frequency domain enhanced feature map.
[0054] The output of the IFFT layer is added to the output of the DBFC layer, and the result is input into the second normalization layer. The output of the second normalization layer is input into the dual-scale gated feedforward block, and the output of the dual-scale gated feedforward block is added to the input of the second normalization layer to obtain the output features of the frequency domain module.
[0055] The dual-scale gated feedforward module is an existing module, first proposed in "PENG YT, CHEN YR, CHEN GR, et al. Histoformer: Histogram-Based Transformer for Efficient Underwater ImageEnhancement[J]. IEEE Journal of Oceanic Engineering, 2024: 1-14". Its idea is to overcome the limitations of single-range, single-scale convolution in modeling the correlation of dynamically distributed degenerate features. It extracts multi-scale, multi-range features through two parallel paths: 5×5 depthwise convolution and dilated 3×3 depthwise convolution, and introduces a gating mechanism to achieve adaptive feature fusion.
[0056] For images with uneven dense fog, performing only frequency domain processing may lead to inaccurate local feature capture, and the frequency domain typically only focuses on the frequency components of the image, failing to adequately process global features or deep semantic information. Therefore, to address these shortcomings, this step introduces a dual-branch feature supplementation module (DBFC) to further extract both global and local features of the image, and extracts deep semantic information through multi-level convolution.
[0057] Specifically, such as Figure 3 As shown, DBFC includes a global feature extraction branch and a local feature extraction branch; DBFC processes its input features including:
[0058] The input features are segmented by channels to obtain two segmentation features;
[0059]
[0060] Where x is the input feature, These are two segmentation features.
[0061] The two segmentation features X and Y are input into the global feature extraction branch and the local feature extraction branch, respectively, to obtain the global features. and local features ;
[0062] In the global feature extraction branch, the input features are reduced in dimensionality using global average pooling, and then feature transformation is performed through fully connected layers and one-dimensional convolutional layers respectively to capture global information of the image and obtain global features. .
[0063] Specifically, the global feature extraction branch includes: a global average pooling layer (AvgPool), a one-dimensional convolutional layer, a fully connected layer, and a gating mechanism layer;
[0064] Segmentation features The input global average pooling layer (AvgPool) reduces the spatial dimensionality of the features and extracts global information to obtain the features. .
[0065]
[0066] in, This represents the global average pooling function.
[0067] Features The features are then further fused along the channel dimension and reduced in dimensionality by inputting them into a one-dimensional convolutional layer and a fully connected layer, respectively, resulting in two... Feature vector , :
[0068]
[0069]
[0070] in, This represents the output after one-dimensional convolution. Represents a one-dimensional convolution function. Indicates the number of channels. This represents the output after passing through the fully connected layer. Represents the fully connected layer function, by convolution kernel accomplish.
[0071] two Feature vector , Transpose each one to obtain two C feature vectors , ;
[0072] two Feature vector , Each of them and their transposed form C feature vectors , By performing cross-multiplication, the correlation between the two can be captured at different granularities, resulting in two... C characteristic matrix;
[0073]
[0074]
[0075] in, and The two obtained respectively C characteristic matrix, representing and The weight matrix is given by i and j, where i and j are the indices of the channel number C, respectively.
[0076] On the channel dimension, respectively for the two Adding the characteristic matrices of C together yields two... Feature vector , ;
[0077] two Feature vector , The input gating mechanism layer yields two results. feature , :
[0078]
[0079]
[0080] in, Here, P is the Sigmoid activation function, and P is the learnable weight parameter of the gating mechanism layer.
[0081] two feature , The features are added together, and the Sigmoid activation function is used to process the added features to obtain the feature weights W.
[0082] +
[0083] The feature weight W is multiplied by the segmentation feature X to extract the global features of the image. :
[0084]
[0085] In the local feature extraction branch, multiple convolutional layers are used to perform convolution operations on the input features to capture local details and texture information in the image, thereby obtaining local features. ;
[0086] Specifically, the local feature extraction branch includes: First Convolutional layers, depthwise separable convolutional modules, and the second Convolutional layer;
[0087] The segmentation feature Y is input into the first... Convolutional layers directly process the original high-dimensional features to retain more detailed information; the segmentation features Y are input into the depthwise separable convolutional module to further extract deeper semantic information; the first... The outputs of the convolutional layer and the depthwise separable convolutional module are added together, and the summed features are input into the second layer. Convolutional layers yield local features. .
[0088] The specific formula is as follows:
[0089]
[0090] in, for Convolutional layer This represents a depthwise separable convolutional module.
[0091] Depthwise separable convolutional module It includes multiple layers of depthwise separable convolutional layers and GELU activation function layers connected in sequence, the first... Depthwise separable convolutional layers with GELU activation function are represented as follows: G is the GELU activation function.
[0092] In this embodiment, the number of depthwise separable convolutional and GELU activation function layers is 4.
[0093] global features and local features The summation yields the output features of DBFC, i.e., the frequency domain supplementary feature map.
[0094] The attention module includes: a first normalization layer, DHSA, a second normalization layer, and a dual-scale gated feedforward block; among which, DHSA is a dynamic range histogram attention module.
[0095] Dynamic range histogram attention is an existing technique, first proposed in "PENG YT, CHEN YR, CHEN GR, et al. Histoformer: Histogram-Based Transformer for Efficient Underwater Image Enhancement[J]. IEEE Journal of Oceanic Engineering, 2024: 1-14". Its idea is to divide the pixel values of an image into different histogram bins according to their intensity values.
[0096] The attention module processes its input features by: inputting the input features into the first normalization layer, inputting the output of the first normalization layer into the DHSA, adding the output of the DHSA to the input features, inputting the sum into the second normalization layer, inputting the output of the second normalization layer into the dual-scale gated feedforward block, and adding the sum of the output of the DHSA and the input features to the output of the dual-scale gated feedforward block to obtain the output features of the attention module.
[0097] S3, Advanced Features Input frequency domain enhanced attention decoder to obtain residual features ;
[0098] The frequency domain enhanced attention decoder includes multiple frequency domain enhanced attention modules connected in series, with a dynamic feature fusion module between adjacent frequency domain enhanced attention modules; the frequency domain enhanced attention encoder processes the initial features... The processing includes:
[0099] S31, The high-level features at the Nth scale Input the Nth frequency domain enhanced attention module to obtain the enhanced features at the Nth scale. ;
[0100] S32, Enhancement features at the Nth scale Upsampling is performed to obtain the upsampled features at the (N-1)th scale. Upsample the features at the (N-1)th scale and high-level features at the N-1 scale The features are added together, and the summed features are input into the dynamic feature fusion module before the (N-1)th frequency domain enhancement attention module to obtain the fused features; the fused features are then input into the (N-1)th frequency domain enhancement attention module to obtain the high-level feature enhancement features at the (N-1)th scale. ;
[0101] S33, High-level features of the next higher scale N-n+1 Perform downsampling to obtain the downsampled features at the current scale Nn. ; downsample the features at the current scale Nn and high-level features at the current scale Nn The features are added together, and the summed features are input into the dynamic feature fusion module before the Nn-th frequency domain enhancement attention module to obtain the fused features; the fused features are then input into the Nn-th frequency domain enhancement attention module to obtain the high-level feature enhancement features at the Nn-th scale. ;
[0102] S34. Repeat step S33 until the enhanced features output by the first frequency domain enhanced attention module are obtained. ;
[0103] S35, Enhance the features output by the first frequency domain enhanced attention module. Mapping to the dimensions of the hazy image yields residual features. .
[0104] The decoder's structure is similar to the encoder's, but the difference lies in the presence of a dynamic feature fusion module after each decoder. Traditional feature fusion methods are relatively simple in processing and have limited expressive power. These methods typically just concatenate or add features from different dimensions, and this linear combination makes it difficult to fully explore and utilize the complex relationships between features. To improve the effect of feature fusion, a dynamic feature fusion module is designed to better explore and utilize feature information, further enhancing the dehazing effect. Placing the dynamic feature fusion module after the residual connection between the decoder and encoder results allows the model to utilize not only the global information captured by the encoder but also the local details provided by the decoder, achieving more refined feature fusion. This design allows the model to enhance its ability to capture key information while maintaining the high-dimensional structure of the feature space. The dynamic feature fusion module learns the interrelationships between different features and dynamically adjusts the channel weights of the feature map, enabling the fused feature map to more accurately reflect the essential attributes of the image.
[0105] like Figure 4 As shown, the dynamic feature fusion module processes its input features in the following ways:
[0106] Apply two consecutive steps to the input feature F. convolution , to obtain features and ;
[0107] The specific formula is as follows:
[0108]
[0109] Features Perform max pooling, then perform depthwise separable convolution on the max pooled features, and finally combine the depthwise separable convolution features with the feature vectors. variance Add, and then perform the following steps on the added features. Convolution, The convolutional features are then activated using GELU, and the activated features are upsampled. The upsampled features are then compared with the original features. Multiply to obtain the characteristics ;
[0110] The specific formula is as follows:
[0111]
[0112] in, This represents the GELU activation function. It is the max pooling function. Indicates an upsampling operation. This represents a depthwise separable convolution.
[0113] Features Perform depthwise separable convolution, and then process the features obtained from the depthwise separable convolution. Convolution, The convolutional features are then subjected to GELU activation, and the GELU-activated features are then... Convolution, to obtain features ;
[0114] The specific formula is as follows:
[0115]
[0116] Features With features Add them together to obtain the features. ; Features Multi-scale depthwise separable convolutions and upsampling are performed to obtain detailed features. ; detail features With features The features are added together to obtain the final output features of the dynamic feature fusion module. .
[0117] Features Multi-scale depthwise separable convolution and upsampling includes:
[0118]
[0119]
[0120] in, This indicates that depthwise separable convolutions with different kernel sizes i are possible. , It is a splicing operation along the channel dimension.
[0121] S4, Fog Image Its residual characteristics Add them together to get the dehazed image. ;
[0122] S5. Based on the foggy image Haze-free images and dehazed images Calculate the loss function value, update the parameters of the image dehazing model based on the loss function value, and obtain the trained image dehazing model when the loss function value is minimized.
[0123] loss function ;in, As weight, For fog-free images With dehazed images Pixel-level similarity loss, For fog-free images With dehazed images The block-level linear correlation loss.
[0124] Pixel-level similarity loss: ;in, It is an L1 norm.
[0125] Block-level linear correlation loss:
[0126] ;
[0127] in, The index representing the pixels of the image. These represent fog-free images. Dehazed images The average value of all pixels, These represent fog-free images. Dehazed images The standard deviation of all pixels is between [−1, 1]. The function is most effective when two images are perfectly correlated. The value reaches 1, while in the case of negative correlation, the value reaches -1.
[0128] During training, the AdamW optimizer was used with an initial learning rate of 0.0001 and a batch size of 1. The model was implemented in PyTorch on an NVIDIA V100 Tensor Core.
[0129] Another aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned image dehazing method of adaptive co-modeling in the frequency domain and spatial domain.
[0130] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An image dehazing method based on adaptive co-modeling in the frequency and spatial domains, characterized in that, include: Obtain a foggy image, input the foggy image into a trained image dehazing model, and obtain a dehazed image; The image dehazing model includes: a shallow feature extraction module, a frequency domain enhanced attention encoder, and a frequency domain enhanced attention decoder; the training process of the image dehazing model includes: S1. Obtain the foggy image dataset, which includes multiple foggy images. and its fog-free image Fog images will be included. Input the shallow feature extraction module to obtain preliminary features. ; S2, Preliminary characteristics Input frequency domain augmented attention encoder to obtain high-level features ; S3, Advanced Features Input frequency domain enhanced attention decoder to obtain residual features ; S4, Fog Image Its residual characteristics Add them together to get the dehazed image. ; S5. Based on the foggy image Haze-free images and dehazed images Calculate the loss function value, update the parameters of the image dehazing model based on the loss function value, and obtain the trained image dehazing model when the loss function value is minimized.
2. The image dehazing method based on adaptive co-modeling of frequency and spatial domains according to claim 1, characterized in that, The shallow feature extraction module includes N shallow feature extraction layers connected in series. The shallow feature extraction module for foggy images The processing includes: Foggy image Inputting the first shallow feature extraction layer yields preliminary features at the first scale. ; Foggy image Inputting the second shallow feature extraction layer yields preliminary features at the second scale. ; Preliminary features of the second scale Inputting the third shallow feature extraction layer yields preliminary features at the third scale. ; Preliminary features of the previous scale Input the current shallow feature extraction layer to obtain preliminary features at the current scale. ; Repeat the previous step until the preliminary features output by the last shallow feature extraction layer are obtained. ; Combine the preliminary features output from each shallow feature extraction layer Preliminary characteristics were obtained. .
3. The image dehazing method based on adaptive co-modeling of the frequency domain and spatial domain according to claim 1, characterized in that, The frequency domain enhanced attention encoder consists of N frequency domain enhanced attention modules connected in series; preliminary features Including preliminary features at multiple scales N is the number of scales; the frequency domain enhanced attention encoder applies initial features The processing includes: S21, Preliminary features of the first scale Inputting the first frequency domain enhanced attention module yields high-level features at the first scale. ; S22, High-level features at the first scale Downsampling is performed to obtain the downsampled features at the second scale. The downsampling features of the second scale Preliminary features of the second scale The features are added together and then input into the second frequency domain enhanced attention module to obtain the high-level features at the second scale. ; S23, High-level features at the next higher scale (n-1) Perform downsampling to obtain the downsampled features at the current scale n. The downsampled features at the current scale n and preliminary features at the current scale n The features are added together and then input into the current frequency domain enhanced attention module to obtain the high-level features at the current scale n. ; S24. Repeat step S23 until the high-level features output by the last frequency domain enhanced attention module are obtained. ; S25. Combine the high-level features output by each frequency domain enhanced attention module. To obtain advanced features .
4. The image dehazing method based on adaptive co-modeling of frequency domain and spatial domain according to claim 3, characterized in that, The frequency domain enhanced attention module includes a frequency domain module and an attention module. The frequency domain enhanced attention module processes its input features by inputting the input features into the frequency domain module and inputting the output of the frequency domain module into the attention module to obtain the output features of the frequency domain enhanced attention module.
5. The image dehazing method based on adaptive co-modeling of frequency domain and spatial domain according to claim 4, characterized in that, The frequency domain module includes: a first normalization layer, an FFT layer, a weighted gating layer, an IFFT layer, a DBFC layer, a second normalization layer, and a dual-scale gated feedforward block; the frequency domain module processes its input features including: The input features are fed into the first normalization layer and the DBFC respectively. The output of the first normalization layer is fed into the FFT layer. The output of the FFT layer is fed into the weighted gating layer. The output of the weighted gating layer is fed into the IFFT layer. The output of the IFFT layer is added to the output of the DBFC. The result of the addition is fed into the second normalization layer. The output of the second normalization layer is fed into the dual-scale gated feedforward block. The output of the dual-scale gated feedforward block is added to the input of the second normalization layer to obtain the output features of the frequency domain module. Among them, DBFC is a dual-branch feature supplementation module, FFT is Fast Fourier Transform, and IFFT is Inverse Fast Fourier Transform.
6. The image dehazing method based on adaptive co-modeling of frequency domain and spatial domain according to claim 5, characterized in that, DBFC includes a global feature extraction branch and a local feature extraction branch. DBFC processes its input features by: segmenting the input features into channels to obtain two segmented features; inputting the two segmented features into the global feature extraction branch and the local feature extraction branch respectively to obtain global features and local features; and adding the global features and local features to obtain the output features of DBFC, namely the frequency domain supplementary feature map.
7. The image dehazing method based on adaptive co-modeling of frequency domain and spatial domain according to claim 4, characterized in that, The attention module includes: a first normalization layer, DHSA, a second normalization layer, and a dual-scale gated feedforward block; the attention module processes its input features including: The input features are input into the first normalization layer, the output of the first normalization layer is input into the DHSA, the output of the DHSA is added to the input features, the result of the addition is input into the second normalization layer, the output of the second normalization layer is input into the dual-scale gated feedforward block, the result of the addition of the DHSA output to the input features and the output of the dual-scale gated feedforward block is added to obtain the output features of the attention module; where DHSA is a dynamic range histogram attention module.
8. The image dehazing method based on adaptive co-modeling of frequency domain and spatial domain according to claim 1, characterized in that, The frequency domain enhanced attention decoder includes multiple frequency domain enhanced attention modules connected in series, with a dynamic feature fusion module between two adjacent frequency domain enhanced attention modules; Advanced features Including high-level features at multiple scales Frequency domain enhanced attention encoder for initial features The processing includes: S31, The high-level features at the Nth scale Input the Nth frequency domain enhanced attention module to obtain the enhanced features at the Nth scale. ; S32, Enhancement features at the Nth scale Upsampling is performed to obtain the upsampled features at the (N-1)th scale. Upsample the features at the (N-1)th scale and high-level features at the N-1 scale The features are added together, and the summed features are input into the dynamic feature fusion module before the (N-1)th frequency domain enhancement attention module to obtain the fused features; the fused features are then input into the (N-1)th frequency domain enhancement attention module to obtain the high-level feature enhancement features at the (N-1)th scale. ; S33, High-level features of the next higher scale N-n+1 Perform downsampling to obtain the downsampled features at the current scale Nn. ; downsample the features at the current scale Nn and high-level features at the current scale Nn The features are added together, and the summed features are input into the dynamic feature fusion module before the Nn-th frequency domain enhancement attention module to obtain the fused features; the fused features are then input into the Nn-th frequency domain enhancement attention module to obtain the high-level feature enhancement features at the Nn-th scale. ; S34. Repeat step S33 until the enhanced features output by the first frequency domain enhanced attention module are obtained. ; S35, Enhance the features output by the first frequency domain enhanced attention module. Mapping to the dimensions of the hazy image yields residual features. .
9. The image dehazing method based on adaptive co-modeling of frequency domain and spatial domain according to claim 1, characterized in that, The dynamic feature fusion module processes its input features in the following ways: Perform two consecutive operations on the input features. Convolution yields features and ; Features Perform max pooling, then perform depthwise separable convolution on the max pooled features, and finally combine the depthwise separable convolution features with the feature vectors. variance Add, and then perform the following steps on the added features. Convolution, The convolutional features are then activated using GELU, and the activated features are upsampled. The upsampled features are then compared with the original features. Multiply to obtain the characteristics ; Features Perform depthwise separable convolution, and then process the features obtained from the depthwise separable convolution. Convolution, The convolutional features are then GELU activated, and the activated features are then... Convolution yields features ; Features With features Add them together to obtain the features. ; Features Multi-scale depthwise separable convolution and upsampling are performed to obtain detailed features; these detailed features are then combined with other features. The features are added together to obtain the output features of the dynamic feature fusion module.
10. The image dehazing method based on adaptive co-modeling of frequency and spatial domains according to claim 1, characterized in that, loss function ;in, As weight, For fog-free images With dehazed images Pixel-level similarity loss, For fog-free images With dehazed images The block-level linear correlation loss.