Multi-scale adaptive image defogging method based on Transform architecture
By combining a multi-level hierarchical encoder based on the Transformer architecture and a dynamic gated attention module with dilated convolution and self-attention mechanisms, the computational burden and detail recovery problems of existing image dehazing methods in complex scenes are solved, achieving efficient and stable image dehazing effects suitable for intelligent vision systems.
Patent Information
- Application Number
- CN202511740857.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-04-10
AI Technical Summary
Existing image dehazing methods suffer from excessive computational burden, poor local detail recovery, and insufficient multi-scale feature fusion when dealing with complex scenes, making it difficult to achieve stable and efficient dehazing results in real-world scenarios.
We employ a multi-level hierarchical encoder based on the Transformer architecture and a dynamic gated attention module, combined with dilated convolution and self-attention mechanisms, to extract multi-level features and perform adaptive fusion. We also optimize image restoration by incorporating the loss function of an atmospheric physics model.
While maintaining computational efficiency, it improves the dehazing effect of images, can adaptively process non-uniform haze, restore clear details, and generate realistic dehazed images, making it suitable for intelligent vision systems.
Smart Images

Figure CN121837075A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision, and particularly relates to a multi-scale adaptive image defogging method based on a Transformer architecture. BACKGROUND
[0002] Under complex weather conditions, suspended particles in the atmospheric medium can cause multiple scattering of incident light, resulting in visual degradation of the image captured by the imaging sensor, specifically manifested as dynamic range compression, color feature shift and texture structure blurring. Such degradation not only hinders human eye observation and judgment, but also has a serious impact on intelligent perception systems that rely on accurate image input (such as unmanned environmental perception, remote sensing feature recognition, intelligent security monitoring, etc.). Therefore, developing an image defogging algorithm that can adapt to complex scenes and maintain stable performance has become an important topic with both research depth and application value.
[0003] Traditional defogging methods are usually based on the physical model of atmospheric scattering, and the image restoration is realized by estimating two key parameters of medium transmittance and global atmospheric light intensity. In this framework, classic algorithms such as dark channel prior find local extreme values in specific color channels to estimate the transmittance distribution. This kind of method can obtain satisfactory defogging effect under ideal atmospheric conditions, but when facing the real world, such as uneven distribution of fog and haze, complex and changeable lighting conditions, etc., the parameter estimation is easy to produce significant deviation, resulting in color distortion, halo artifacts and other problems in the restored image, and the high computational burden also limits its application in real-time systems.
[0004] The rise of deep learning has promoted the development of data-driven defogging technology. End-to-end learning methods based on convolutional neural networks directly map from hazy images to clear images, bypassing the complex physical parameter estimation process. This kind of method shows good generalization ability and processing efficiency when the training data is sufficient. However, due to the local characteristics of convolution operation, it is difficult for this kind of network to establish semantic association between distant pixels in the image. When dealing with large-area thick fog or spatially varying fog, it often appears that the defogging is not thorough and the details are not recovered enough. In addition, the multi-scale feature fusion strategy commonly used in existing methods lacks dynamic response ability to changes in fog density, which restricts the performance of the model in complex scenes.
[0005] Inspired by the success of natural language processing, researchers began to introduce the Transformer architecture into the image restoration task. The core self-attention mechanism can establish the mutual correlation between global pixels, providing a new solution for modeling long-range dependencies in images. The pioneer work such as Vision Transformer processes the image by dividing it into a sequence of blocks and shows the potential to break through the traditional convolutional network in the dehazing task. However, the computational complexity of the standard Transformer architecture increases quadratically with the growth of image size, making it difficult to be directly applied to high-resolution image processing; at the same time, its ability to extract local detail features is relatively weak, which can easily lead to over-smoothing and texture loss in the restored image.
[0006] Recent studies attempt to balance computational efficiency and model performance through improved Transformer architecture (such as Vision Dehaze Transformer which introduces local window attention mechanism). Although these methods alleviate the problem of computational complexity to some extent, there are still obvious deficiencies in local feature enhancement and multi-scale feature adaptive fusion. It is particularly noteworthy that most existing methods fail to effectively incorporate atmospheric optical physics priors, which limits their generalization performance in real complex scenes.
[0007] In summary, the core challenge in the current image dehazing field is how to strengthen the recovery effect of image detail features while maintaining efficient global modeling ability, establish an adaptive processing mechanism for non-uniform haze distribution, and ensure the stability and practicality of the algorithm in real scenes. The solution to this series of problems will directly promote the development of the next generation of intelligent visual systems. SUMMARY
[0008] The purpose of the present application is to provide a multi-scale adaptive image dehazing method based on Transformer architecture to improve the dehazing effect.
[0009] The purpose of the present application can be achieved by the following technical solutions: A multi-scale adaptive image dehazing method based on Transformer architecture, comprising the following steps: An image to be dehazed is input into a pre-constructed dehazing model based on Transformer architecture, and a dehazed image is output, wherein the dehazing model based on Transformer architecture includes an encoder with a multi-level hierarchical structure, an improved cavity Transformer block and a dynamic gate attention module connected with each level of the encoder in turn, and a decoder, and the step of outputting the dehazed image comprises: extracting initial features from the image to be dehazed The encoder employs a multi-level hierarchical structure to extract features from different levels; Based on the features at different levels, the improved hollow Transformer block of the corresponding level is used to perform feature transformation to obtain features that include both local and global features. For features at different levels, including both local and global features, the dynamic gating attention module is used for adaptive fusion to obtain the corresponding enhanced features. Based on the corresponding enhancement features, a decoder is used to reconstruct the image, and finally a dehazed image is obtained.
[0010] Furthermore, the operational expression for the feature transformation is: , In the formula, For the first Output characteristics of hierarchically improved perforated Transformer blocks. This is a standard Swin Transformer block used to extract global features. For the first The input features of the hierarchy, that is, the first Features extracted by the hierarchical encoder This is a convolution operation with a hole ratio of d=2, used to enhance the ability to capture local high-frequency information.
[0011] Furthermore, the Swin Transformer block employs a sliding window self-attention mechanism, calculating attention weights within a local sliding window to extract the features encompassing both local and global aspects based on these attention weights. The operational expression for the Swin Transformer block is as follows: , , In the formula, For attention output, This is a multi-head self-attention mechanism. For layer normalization operation, The input features are those of the Swing Transformer block. The enhanced feature representation after processing the Swing Transformer block is used for further processing in subsequent network layers or as the final output. This refers to the computational operations of a multilayer perceptron.
[0012] Further, a hole convolution enhancement module is introduced after the multi-layer perceptron of each Swin Transformer block to expand the receptive field by using hole convolution and enhance the richness of local information at different levels, wherein the processing steps of the Swin Transformer block introducing the hole convolution enhancement module include: The input feature of the Swin Transformer block is set as First, the layer normalization processing is performed, and then the window multi-head self-attention mechanism is used for processing to obtain the attention output: , The layer normalization processing is performed on the attention output and sent to the multi-layer perceptron, and the input feature is input into the hole convolution enhancement module, and there is: , The operation expression of the hole convolution in the hole convolution enhancement module is: , In the formula, is the attention output, is the multi-head self-attention mechanism, is the layer normalization operation, is the input feature of the Swin Transformer block, is the output feature of the MLP sub-layer in the Swin Transformer block, is the operation of the multi-layer perceptron, is the output feature of the hole convolution enhancement module, is the hole convolution operation, is the input feature of the fourth block of the hole convolution enhancement module, is the learnable parameter in the formula; The outputs of the two branches are fused through the residual connection to obtain the output of the Swin Transformer block, which is represented as: , In the formula, is the output of the Swin Transformer block, is the result of the input feature processed by the hole convolution layer.
[0013] Further, the processing steps of the dynamic gated attention module include: The features containing local and global features at a certain level are set as The global response of each channel is calculated by global average pooling, which is represented as: , In the formula, is the global response of the channel, , is the height and width of the feature map, is the entire channel vector at the spatial position ; Based on the global response of each channel, the channel weight is generated by a two-layer fully connected network , wherein the operation of the fully connected network is: , In the formula, is the operation of the fully connected network, , are the first and second layer fully connected weight matrices respectively, is the ReLU activation function, is the Sigmoid activation function; According to the channel weight , the input feature is acted on by element-wise multiplication in the channel dimension to obtain the channel calibrated feature: , In the formula, is the channel calibrated feature, is the channel weight, denotes element-wise weighting in the channel dimension; The channel calibrated feature is transformed by convolution operation, and the spatial weight is obtained by Sigmoid activation function: , In the formula, is the spatial weight, denotes a 3x3 standard convolution layer, is the Sigmoid activation function; The channel calibrated feature is weighted by the spatial weight to obtain the enhanced feature, denoted as: , In the formula, is the enhanced feature.
[0014] Further, the decoder adopts a progressive upsampling strategy for image reconstruction.
[0015] Furthermore, the loss function used during training of the Transformer-based dehazing model is: , In the formula, For the complete mixed loss function, For physical loss function, For the perceptual loss function, Let L1 be the reconstruction loss function.
[0016] Furthermore, the expression for the physical loss function is: , , , In the formula, , As weight, The gradient of transmittance, A Atmospheric light estimated by the network, For real atmospheric light, For the output image, Transmittance, For the input foggy image, To prevent small constants from being divided by zero.
[0017] Furthermore, the expression for the perceptual loss function is: , In the formula, For VGG-19 k Feature mapping of layers, For the output image, This is the original image.
[0018] Furthermore, the expression for the L1 reconstruction loss function is: , In the formula, For the output image, This is the original image.
[0019] Compared with the prior art, the present invention has the following beneficial effects: (1) The traditional convolutional neural network has defects in establishing long-range dependency of images, and the standard Transformer architecture faces the problems of heavy computing burden and poor local detail recovery, the fog removal model based on the Transformer is proposed, the model architecture extracts features of different levels through a multi-level hierarchical structure encoder, the encoder structure effectively expands the receptive field of the model while ensuring the computing efficiency, and the global context information capture and high-frequency detail feature extraction are considered, and the dynamic gating attention module is used to dynamically adjust the attention weight to respectively couple and calibrate the feature channels and spatial positions, so that the model can adaptively integrate the significant information of different scale features, and the adaptability to spatially varying fog is significantly enhanced, thereby improving the fog removal effect of the image.
[0020] (2) The model architecture can simultaneously improve the representation ability of the model to the macro scene and micro texture of the image under approximately linear computing load by deeply integrating the attention mechanism with global perception ability and the dilated convolution focusing on local features, thereby effectively avoiding the field limitation of the traditional convolution operator and the computing redundancy problem of the standard self-attention mechanism.
[0021] (3) The dynamic gating attention module designed in the application gives the model scene perception ability, so that it can adjust the fusion mode of multi-level features according to the fog density and distribution characteristics of different regions of the image, and the intelligent fusion mechanism ensures that the fog areas with uneven density can realize accurate degradation removal and clear detail reconstruction.
[0022] (4) The application adopts a multi-modal supervision optimization strategy, combines the explicit constraint based on the atmospheric physical model with the data-driven deep perception learning, the joint optimization framework guides the generated results of the model to be credible in physical principle and realistic and natural in subjective vision, and the unity of the restored image in objective accuracy and subjective quality is achieved.
[0023] (5) The loss function designed in the application considers the physical consistency, perception quality and pixel-level reconstruction accuracy in the optimization process, so as to realize high-quality fog removal image recovery with more physical rationality.
[0024] (6) In the evaluation on multiple authoritative public data sets, the application shows leading performance in quantitative indicators and visual contrast. The model constructed has a compact parameter size and efficient inference ability, and shows excellent cross-scene generalization performance, which provides a feasible technical scheme for practical deployment in intelligent vision systems such as automatic driving, security monitoring, remote sensing observation and the like which have strict requirements on real-time performance and accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1A method flowchart of the present application; Figure 2 A whole network model framework of the present application; Figure 3 A schematic diagram of a dynamic gated attention module of the present application; Figure 4 A comparison diagram of defogging effects of the present application on a synthetic data set; Figure 5 A comparison diagram of defogging effects of the present application on a real data set. DETAILED DESCRIPTION
[0026] The present application will be described in detail below in conjunction with the accompanying drawings and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present application, and gives a detailed implementation and specific operation process, but the protection scope of the present application is not limited to the following embodiments.
[0027] The present embodiment provides a multi-scale adaptive image defogging method based on a Transformer architecture, which utilizes Figure 2 The defogging model based on Transformer is implemented, which mainly includes a multi-level hierarchical structure encoder, an improved dilated Transformer block and a dynamic gated attention module connected with each level encoder in turn, and a decoder. Specifically, as Figure 1 The method includes the following steps: Step 1, obtaining an image to be defogged, using a multi-level hierarchical structure encoder to extract features of different levels, and using an improved dilated Transformer block of the corresponding level to transform the features, to obtain features containing local and global features.
[0028] As Figure 2 shown, the encoder of the present model adopts a four-level hierarchical structure, and each level generates a feature map gradually reduced in size through spatial downsampling, with resolutions of 1 / 4, 1 / 8, 1 / 16 and 1 / 32 of the input image. Each layer is composed of an improved dilated Transformer block (Dilated Swin Block, DSB), which combines the local-global modeling capability of dilated convolution and Swin Transformer, effectively enhancing the feature expression at different scales. This design combines the self-attention mechanism of Swin Transformer and the local detail enhancement capability of dilated convolution, which can capture global context information while enhancing the representation capability of local high-frequency details, making the defogged image more clear and natural.
[0029] Assuming that the input image is , after initial feature extraction, an initial feature map The encoder is composed of four stages of feature extraction, which extracts four levels of features respectively. The first level of feature is set as The second level of feature is set as The third level of feature is set as The fourth level of feature is set as , wherein, is a standard Swin Transformer block responsible for extracting global features, is a convolutional layer with a dilation rate d = 2, which is used to enhance the ability to capture local high-frequency information.
[0030] Swin Transformer adopts a sliding window self-attention (Window-based Multi-Head Self-Attention, W-MSA) mechanism to calculate attention weights within a local window to reduce computational complexity. Specifically, for input feature , the calculation process of the Swin Transformer block is as follows: , , wherein, is layer normalization (Layer Normalization), is a multi-layer perceptron (Multi-Layer Perceptron). The self-attention mechanism can model long-distance dependencies, thereby improving the preservation of global information in the defogging process. However, Swin Transformer mainly relies on local window calculation of attention, which lacks sufficient modeling ability of local high-frequency features, which may lead to loss of edge and texture information.
[0031] To make up for this defect, the embodiment introduces a parallel empty convolution enhancement module after the multi-layer perceptron (MLP) module of each Swin Transformer block. The module uses empty convolution to expand the receptive field, thereby capturing more rich local information at different scales. Input feature is first subjected to layer normalization, and then processed by the window multi-head self-attention mechanism: , Next, the attention output is subjected to a second layer normalization and sent into the MLP layer, while the original input is sent into the empty convolution branch: , For the convolutional layer with a dilation rate d = 2, the calculation formula is as follows: , where, is the convolution kernel, is the input feature. Finally, the outputs of the two branches are fused through a residual connection: , The dilated convolution can expand the receptive field while keeping the resolution unchanged, effectively extracting local detail information in the haze area, and complementing the global modeling ability of the Swin Transformer block.
[0032] Step 2, for different levels of features containing local and global information, a dynamic gated attention module is used for adaptive fusion to obtain the corresponding enhanced features.
[0033] In order to adaptively enhance multi-scale features, the embodiment of the present application designs a dynamic gated attention module (DGAM) as shown in Figure 3 The module is independent of the dilated Swin block (DSB) in the encoder and is located in the decoding stage, and is specifically responsible for adaptively fusing the features output by the DSB at each scale. Through channel attention (CA) and spatial attention (SA) mechanisms, the feature expression ability is adaptively adjusted in different scales and regions.
[0034] In the dynamic gated attention module, the channel weight generation link takes the multi-scale features processed by the previous stage as input. The input feature is the feature map output by the dilated Swin block (DSB) at each scale in the encoder, and the global response of each channel is calculated through global average pooling (GAP), and the mathematical expression is as follows: , Then, a two-layer fully connected network (MLP) is used to generate the channel weight , where the hidden layer dimension is set to to reduce the calculation cost. The whole calculation process is as follows: , where, and are the first and second fully connected weight matrices, is the ReLU activation function, is the Sigmoid activation function.
[0035] Finally, the calculated channel weight The input features are operated by element-wise multiplication in the channel dimension to obtain the channel-aligned features: , where, represents element-wise weighting in the channel dimension. Secondly, the channel-aligned features are transformed by a 3x3 convolution, and the spatial weights are obtained by Sigmoid activation: , where, represents a 3x3 standard convolution layer, which is used to interact with the features in different spatial positions, and then obtain adaptive attention in the spatial dimension.
[0036] Since the output spatial weights have the form of a single-channel feature map, they can be used to weight the features in different positions, so that the model can pay more attention to important areas and reduce the interference of background noise. In the gating feature fusion stage, the channel-aligned features are weighted by the spatial weights to generate the final enhanced features: , where this process realizes dynamic adjustment of the contribution of features in different spatial positions, focusing on global transmittance estimation in dense fog areas, and enhancing the recovery ability of local texture information in edge and detail areas.
[0037] Step 3: Based on the corresponding enhanced features, the decoder is used to reconstruct the image, and the final dehazed image is obtained.
[0038] After obtaining the enhanced features at different levels, the decoder uses a progressive upsampling strategy for image reconstruction. Through the transpose convolution layer, the spatial resolution is gradually restored, and the encoder features at the corresponding scale are fused through the jump connection. Finally, the dehazed reconstructed image is output through the 1x1 convolution layer, completing the end-to-end mapping from the feature space to the image space.
[0039] In order to balance the physical law constraints and visual perception quality in the dehazing task, a hybrid loss function is designed, which is composed of physical constraint loss, perception loss and L1 reconstruction loss to ensure the consistency of the generated image in physical reasonableness and subjective quality.
[0040] First, the physical constraint loss Based on the atmospheric scattering model, the goal is to weaken the dependence on paired real labels and guide the model to generate more physically reasonable results. Since the model does not explicitly output transmittance t and atmospheric light A, an explicit physical modeling + back estimation strategy is adopted to estimate the approximate value of t and A from the input foggy image and the model output image .
[0041] Specifically, first, based on the empirical prior, the atmospheric light A is estimated from The average value of the 0.1% brightest pixels is used as the estimation result. Then, according to the atmospheric scattering model: , The transmittance estimation expression can be derived as follows: .
[0042] where is a small constant to prevent division by zero, and is set to 0.01 in this paper. Then, the gradient of the transmittance map is calculated to constrain its spatial smoothness, and the consistency between the estimated atmospheric light A and the real atmospheric light in the synthetic data is supervised using L2 loss, which constitutes the physical loss term: , where represents the gradient of the transmittance, which is constrained by the L1 norm to avoid artifacts caused by excessive oscillation. A is the network-estimated atmospheric light, and A is the real atmospheric light, which is measured by L2 loss to make the network comply with the real scene Second, the perceptual loss uses a pre-trained VGG-19 network to extract high-level semantic features and constrain the similarity between the generated image and the real clear image in the feature space. It is defined as follows: , where represents the k-th layer of VGG-19 feature mapping, and conv3_3 and conv4_3 are selected as the feature extraction layers to balance texture details and high-level semantic information. This loss effectively reduces the over-smoothing problem that may be introduced by pixel-level loss, making the dehazing result more realistic in vision.
[0043] In addition, the L1 reconstruction loss directly constrains the pixel-level error between the dehazed image and the real clear image, and its expression is as follows: , Compared with L2 loss, L1 loss is more robust to outliers, which makes the model avoid over-blurring while restoring the structure of the image.
[0044] Finally, by combining the above losses by weighting, a complete hybrid loss function is formed: , This loss function simultaneously considers physical consistency, perceptual quality and pixel-level reconstruction accuracy in the optimization process, thereby achieving a more physically reasonable high-quality defogging image restoration. Through Figure 4 and Figure 5 It can be observed from the visual comparison that the embodiment can achieve significant improvement in defogging effect under various fog and haze conditions.
[0045] The above functions, if realized in the form of software function units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0046] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, such as object-oriented programming languages Java and interpreted scripting languages JavaScript, etc.
[0047] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in one or more flow or blocks
[0048] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in one or more flow or blocks
[0049] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps in one or more flow or blocks
[0050] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the appended claims are intended to cover all such variations and modifications as falling within the scope of the application.
[0051] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A multi-scale adaptive image dehazing method based on Transformer architecture, characterized in that, Includes the following steps: The process involves acquiring an image to be dehazed, inputting it into a pre-built dehazing model based on the Transformer architecture, and outputting a dehazed image. The dehazing model includes an encoder with a multi-level hierarchical structure, an improved hollow Transformer block and a dynamically gated attention module connected sequentially to each level of the encoder, and a decoder. The steps for outputting the dehazed image include: Initial features are extracted from the image to be dehazed. The encoder employs a multi-level hierarchical structure to extract features from different levels; Based on the features at different levels, the improved hollow Transformer block of the corresponding level is used to perform feature transformation to obtain features that include both local and global features. For features at different levels, including both local and global features, the dynamic gating attention module is used for adaptive fusion to obtain the corresponding enhanced features. Based on the corresponding enhancement features, a decoder is used to reconstruct the image, and finally a dehazed image is obtained.
2. The multi-scale adaptive image dehazing method based on Transformer architecture according to claim 1, characterized in that, The operational expression for the feature transformation is: , In the formula, For the first Output characteristics of hierarchically improved perforated Transformer blocks. This is a standard SwinTransformer block used to extract global features. For the first The input features of the hierarchy, that is, the first Features extracted by the hierarchical encoder This is a convolution operation with a hole ratio of d=2, used to enhance the ability to capture local high-frequency information.
3. The multi-scale adaptive image dehazing method based on Transformer architecture according to claim 2, characterized in that, The Swin Transformer block employs a sliding window self-attention (W-MSA) mechanism, calculating attention weights within a local sliding window to extract the features encompassing both local and global aspects. The computational expression for the Swin Transformer block is as follows: , , In the formula, For attention output, This is a multi-head self-attention mechanism. For layer normalization operation, The input features are those of the SwinTransformer block. The enhanced feature representation after processing the Swing Transformer block is used for further processing in subsequent network layers or as the final output. This refers to the computational operations of a multilayer perceptron.
4. The multi-scale adaptive image dehazing method based on Transformer architecture according to claim 3, characterized in that, Each of the Swin Transformer blocks introduces a dilated convolution enhancement module in parallel after the multilayer perceptron to expand the receptive field using dilated convolution and enhance the richness of local information at different levels. The processing steps of the Swin Transformer block with the dilated convolution enhancement module include: Set the input characteristics of the Swing Transformer block as follows: First, layer normalization is performed, and then the multi-head self-attention mechanism of the window is used for processing to obtain the attention output: , The attention output is subjected to layer normalization and fed into a multilayer perceptron, while the input features are... The input dilated convolution enhancement module contains: , The operational expression for dilated convolution in the dilated convolution enhancement module is as follows: , In the formula, For attention output, This is a multi-head self-attention mechanism. For layer normalization operation, The input features are those of the Swing Transformer block. For the Swin Transformer block MLP The output features of the sub-layer This refers to the computational operations of a multilayer perceptron. The output features of the dilated convolution enhancement module, For dilated convolution operations, The input features are for the fourth block of the dilated convolutional augmentation module. for Learnable parameters in; By fusing the outputs of the two branches through residual connections, the final output of the Swing Transformer block is obtained, as follows: , In the formula, This is the output of the Swing Transformer block. This is the result after the input features have been processed by a dilated convolutional layer.
5. The multi-scale adaptive image dehazing method based on Transformer architecture according to claim 1, characterized in that, The processing steps of the dynamic gating attention module include: Define a certain level as containing both local and global features. The global response of each channel is calculated using global average pooling, and is expressed as follows: , In the formula, For the global response of the channel, , For the height and width of the feature map, for In spatial location The entire channel vector on; Based on the global response of each channel, channel weights are generated through a two-layer fully connected network. The computational operations of the fully connected network are as follows: , In the formula, This is a fully connected network operation. , These are the weight matrices for the first and second fully connected layers, respectively. It is the ReLU activation function. Use the Sigmoid activation function; According to the channel weight The input features are applied through element-wise multiplication along the channel dimension. The characteristics obtained after channel calibration are as follows: , In the formula, Features after channel calibration For channel weights, This represents element-wise weighting along the channel dimension; The features after channel calibration are processed through convolution operations. Perform the transformation and obtain the spatial weights using the Sigmoid activation function: , In the formula, Spatial weights, This represents a standard 3×3 convolutional layer. Use the Sigmoid activation function; Through the spatial weights Features after channel calibration After weighting, the enhanced features are obtained, represented as: , In the formula, To enhance features.
6. The multi-scale adaptive image dehazing method based on Transformer architecture according to claim 1, characterized in that, The decoder employs a progressive upsampling strategy for image reconstruction.
7. The multi-scale adaptive image dehazing method based on Transformer architecture according to claim 1, characterized in that, The loss function used during training of the dehazing model based on the Transformer architecture is: , In the formula, For the complete mixed loss function, For physical loss function, For the perceptual loss function, Let L1 be the reconstruction loss function.
8. A multi-scale adaptive image dehazing method based on Transformer architecture according to claim 7, characterized in that, The expression for the physical loss function is: , , , In the formula, , As weight, The gradient of transmittance, A Atmospheric light estimated by the network, For real atmospheric light, For the output image, Transmittance, For the input foggy image, To prevent small constants from being divided by zero.
9. A multi-scale adaptive image dehazing method based on Transformer architecture according to claim 7, characterized in that, The expression for the perceptual loss function is: , In the formula, For VGG-19 k Feature mapping of layers, For the output image, This is the original image.
10. A multi-scale adaptive image dehazing method based on Transformer architecture according to claim 7, characterized in that, The expression for the L1 reconstruction loss function is: , In the formula, For the output image, This is the original image.