An interactively guided dual-branch image dehazing model and image processing method
Through the interactively guided dual-branch image dehazing model, combined with Transformer and CNN, the CPA block is used to extract global and local features, which solves the problem of poor image dehazing effect in the existing technology and achieves better image reconstruction quality and details. reserve.
Patent Information
- Application Number
- CN202410747203.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing image dehazing methods, especially those based on CNN and Transformer neural networks, have the problem of over-focusing on edge and texture information, resulting in blurry and rough image reconstruction, or distortion, and difficulty in adapting to diverse scenes.
An interactively guided dual-branch image dehazing model is proposed, combining Transformer and CNN, through multi-layer Transformer blocks and CNN layers, using the channel and pixel attention modules of the CPA block to extract global and local features, and restore the image through the CNN decoder details, forming a U-Net network to preserve the original details.
Effectively combine global and local features to improve the image dehazing effect, reduce redundant information, enhance attention to key features, significantly improve the quality of image reconstruction, and avoid the loss of detailed information.
Smart Images

Figure CN118314036B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an interactively guided dual-branch image defogging model and an image processing method. Background Art
[0002] Image dehazing is an important task in computer vision and image processing. It is used to restore foggy images to clean images. Image dehazing can serve a variety of advanced vision tasks, including target detection, video surveillance, and unmanned driving, and has important applications in many fields.
[0003] Early image dehazing methods generally considered the impact of particle scattering in the atmosphere and used mathematical formulas to derive the parameters of atmospheric scattering. However, the priors of this derivation are derived based on empirical knowledge and are usually difficult to adapt to a variety of scenarios. When the scene does not meet these priors, these prior-based dehazing algorithms often output some unexpected effects, such as causing image distortion.
[0004] In recent years, image dehazing methods based on deep learning have gradually become mainstream, among which image dehazing methods based on CNN (convolutional neural network) and Transformer neural network are increasingly used. However, the convolution mechanism of CNN determines that it will be limited to a smaller receptive field, resulting in excessive focus on edge and texture information. On the contrary, the Transformer neural network does not pay much attention to local information, which often leads to undesirable blur and rough details in image reconstruction. This leads to poor dehazing effect when using CNN or Transformer neural network alone.
[0005] It can be seen that the existing technology needs to be improved and enhanced. Summary of the invention
[0006] The purpose of this application is to provide an interactively guided dual-branch image defogging model and image processing method, which can utilize the difference relationship between global and local features to effectively combine CNN and Transformer for image defogging, and combine the advantages of both to improve the defogging effect.
[0007] In a first aspect, the present application provides an interactively guided dual-branch image dehazing model for dehazing an image, comprising an input layer, a Transformer branch, a CNN branch, multiple CPA blocks, a CNN decoder, and an output layer;
[0008] The Transformer branch includes multiple layers of serially connected Transformer blocks, the CNN branch includes multiple layers of first CNN layers, and the number of the Transformer blocks, the first CNN layers and the CPA blocks is the same;
[0009] An input end of the Transformer branch and an input end of the CNN branch are both connected to the input layer;
[0010] The output of the Transformer block of each layer is added to the output of the first CNN layer of the same layer and then input into a CPA block to obtain a weight matrix output by the CPA block, which is used to multiply the output of the first CNN layer of the same layer to obtain the guide output corresponding to the first CNN layer of the same layer; the guide output corresponding to the first CNN layer of each layer before the first CNN layer of the last layer is input into the first CNN layer of the next layer respectively, and the guide output corresponding to the first CNN layer of the last layer is added to the output of the Transformer block of the last layer and then input into the CNN decoder;
[0011] The output end of the CNN decoder is connected to the output layer.
[0012] The interactively guided dual-branch image dehazing model extracts the global information of the image through the Transformer blocks of each layer of the Transformer branch, which is used to guide the first CNN layer of each layer to focus on the effective local information in the image under the guidance of the CPA block, and finally restores the image details through the CNN decoder, thereby obtaining a haze-free image that better retains the global and local features and improves the dehazing effect.
[0013] Preferably, the CPA block includes a channel attention module and a pixel attention module;
[0014] The pixel attention module includes a first average pooling layer, a first maximum pooling layer, a first convolutional layer and a first Sigmoid activation function layer, the input end of the first average pooling layer and the input end of the first maximum pooling layer are both connected to the input end of the CPA block, the output end of the first average pooling layer and the output end of the first maximum pooling layer are cascaded and connected to the input end of the first convolutional layer, and the output end of the first convolutional layer is connected to the input end of the first Sigmoid activation function layer;
[0015] The channel attention module includes a second average pooling layer, a second maximum pooling layer, an FC fully connected layer, and a second Sigmoid activation function layer, the input end of the second average pooling layer and the input end of the second maximum pooling layer are both connected to the input end of the CPA block, the output of the second average pooling layer is added to the output of the second maximum pooling layer and then input into the FC fully connected layer, and the output end of the FC fully connected layer is connected to the input end of the second Sigmoid activation function layer;
[0016] The output of the first Sigmoid activation function layer, the output of the second Sigmoid activation function layer, and the input of the CPA block are multiplied together as the output of the CPA block.
[0017] The channel attention module in the CPA block is used to model the global information of the entire channel, which can capture the global importance of each channel of the input feature map, reduce redundant information, and increase the attention to key features; the pixel attention module is used to model the local information of each pixel position, which can capture the importance of each position of the input feature map, enhance the model's perception of the local features of the input image, and pay more attention to details; the CPA block combines the channel attention module and the pixel attention module to give full play to their respective advantages, so that the model can pay attention to channels and pixels at the same time, and has the ability to extract local features and global features, which can better guide the first CNN layer to effectively capture information in the feature space, thereby improving the performance of the model.
[0018] Preferably, the CNN decoder includes multiple layers of second CNN layers connected in series, the number of the second CNN layers is the same as the number of the first CNN layers, and the CNN branch is connected to the CNN decoder to form a U-Net network.
[0019] Connecting the CNN branch with the CNN decoder to form a U-Net network helps preserve the details of the original image and avoid the loss of detail information due to network training.
[0020] Specifically, the guided output corresponding to the i-th first CNN layer is added to the output of the ni-th second CNN layer and then input into the n-i+1-th second CNN layer, where i is a positive integer and i∈[1, n-1], and n is the number of layers of the first CNN layer and the second CNN layer.
[0021] Preferably, the first CNN layer and the Transformer block are each provided with four layers, and the CPA block is provided with four layers.
[0022] Preferably, the Transformer branch further includes a second convolutional layer and a downsampling layer sequentially connected to the front side of the first-layer Transformer block.
[0023] Since the operation of the Transformer block is more complex than that of the CNN layer, the amount of calculation of the Transformer block is much larger than that of the CNN layer. Therefore, adding a downsampling layer to the Transformer branch and downsampling the image before inputting the Transformer block can reduce the amount of calculation of the Transformer block, increase the receptive field, and prevent the features extracted by the Transformer block from being repeated with the features extracted by the first CNN layer.
[0024] Preferably, the Transformer block includes a normalization layer, and the normalization layer performs the following operations:
[0025] ;
[0026] Among them, y is the output of the normalization layer, x is the feature map input to the normalization layer, is the mean value of x, is the standard deviation of x, To learn the scaling factor, is the deviation factor, and is the weight, and is the deviation parameter and F(·) is the main block function.
[0027] Preferably, the sliding window mechanism of the Transformer block adopts a reflection filling mechanism to fill the size of the edge window to the set window size.
[0028] Preferably, the Transformer block aggregates information between neighboring windows by the following operations:
[0029] ;
[0030] in, is the aggregation result, Q is the query matrix, K is the key matrix, V is the value matrix, is the transposed matrix of K, d is the dimension of the query matrix and the key matrix, B is the relative position bias parameter, is V before window division, is the softmax function, is the convolution function.
[0031] In a second aspect, the present application provides an image processing method, based on the interactively guided dual-branch image defogging model described above, comprising the steps of:
[0032] A1. Obtain the image to be dehazed;
[0033] A2. Input the image to be defogged into the interactively guided dual-branch image defogging model to obtain a haze-free image output by the interactively guided dual-branch image defogging model.
[0034] Beneficial effect: The interactively guided dual-branch image defogging model and image processing method provided by the present application extract the global information of the image through the Transformer blocks of each layer of the Transformer branch, so as to guide the first CNN layer of each layer to focus on the effective local information in the image under the guidance of the CPA block, and finally restore the image details through the CNN decoder, so as to obtain a haze-free image that better retains the global features and local features, thereby improving the defogging effect; it can be seen that the interactively guided dual-branch image defogging model and image processing method can utilize the difference relationship between global and local features to effectively combine CNN and Transformer to perform image defogging, and comprehensively improve the defogging effect by combining the advantages of both. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of the structure of the interactively guided dual-branch image dehazing model provided in an embodiment of the present application.
[0036] Figure 2 Figure 2 is a schematic diagram of the structure of the CPA block.
[0037] Figure 3 A flowchart of an image processing method provided in an embodiment of the present application.
[0038] Figure 4 This is the first set of comparison images.
[0039] Figure 5 This is the second set of comparison images.
[0040] Explanation of numbers: 1. Input layer; 2. Transformer branch; 201. Transformer block; 202. Second convolutional layer; 203. Downsampling layer; 3. CNN branch; 301. First CNN layer; 4. CPA block; 401. Channel attention module; 4011. Second average pooling layer; 4012. Second maximum pooling layer; 4013. FC fully connected layer; 4014. Second Sigmoid activation function layer; 402. Pixel attention module; 4021. First average pooling layer; 4022. First maximum pooling layer; 4023. First convolutional layer; 4024. First Sigmoid activation function layer; 5. CNN decoder; 501. Second CNN layer; 6. Output layer. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0042] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0043] Please refer to Figure 1 , Figure 1 It is an interactively guided dual-branch image dehazing model in some embodiments of the present application, which is used to dehaze an image, including an input layer 1, a Transformer branch 2, a CNN branch 3, multiple CPA blocks 4 (channel pixel attention blocks), a CNN decoder 5 and an output layer 6;
[0044] Transformer branch 2 includes multiple layers of serially connected Transformer blocks 201, CNN branch 3 includes multiple layers of first CNN layers 301, and the number of Transformer blocks 201, first CNN layers 301 and CPA blocks 4 is the same;
[0045] The input of Transformer branch 2 and the input of CNN branch 3 are both connected to input layer 1;
[0046] The output of each Transformer block 201 is added to the output of the first CNN layer of the same layer and then input into a CPA block 4 to obtain a weight matrix output by the CPA block 4, which is used to multiply the output of the first CNN layer 301 of the same layer to obtain the guide output corresponding to the first CNN layer 301 of the same layer (for example, the output of the i-th Transformer block 201 is added to the output of the i-th first CNN layer 301 and then input into the i-th CPA block 4 to obtain the weight matrix output by the i-th CPA block 4, and the weight matrix output by the i-th CPA block 4 is multiplied by the output of the i-th first CNN layer 301 to obtain the guide output corresponding to the i-th first CNN layer 301, i is any positive integer less than n, n is the number of Transformer blocks 201 and the first CNN layer 301, which is also equal to the number of CPA blocks 4);
[0047] The guided outputs corresponding to the first CNN layers 301 of each layer before the last first CNN layer 301 (i.e., the first CNN layers 301 of the 1st to the n-1th layers) are input to the first CNN layers 301 of the next layer (i.e., the guided output corresponding to the first CNN layer 301 of the i-th layer is input to the first CNN layer 301 of the i+1th layer), and the guided output corresponding to the last first CNN layer 301 (i.e., the first CNN layer 301 of the nth layer) is added to the output of the last Transformer block 201 (i.e., the Transformer block 201 of the nth layer) and then input to the CNN decoder 5;
[0048] The output end of the CNN decoder 5 is connected to the output layer 6.
[0049] The interactively guided dual-branch image defogging model extracts the global information of the image through the Transformer blocks 201 of each layer of the Transformer branch 2, and guides the first CNN layer 301 of each layer to focus on the effective local information in the image under the guidance of the CPA block 4, and finally restores the image details through the CNN decoder 5, so as to obtain a fog-free image that better retains the global features and local features, and improves the defogging effect. It can be seen that the interactively guided dual-branch image defogging model can use the difference relationship between global and local features to effectively combine CNN and Transformer to perform image defogging, and combine the advantages of both to improve the defogging effect.
[0050] Specifically, see Figure 2 , CPA block 4 includes a channel attention module 401 and a pixel attention module 402;
[0051] The pixel attention module 402 includes a first average pooling layer 4021, a first maximum pooling layer 4022, a first convolutional layer 4023 and a first Sigmoid activation function layer 4024, the input end of the first average pooling layer 4021 and the input end of the first maximum pooling layer 4022 are both connected to the input end of the CPA block 4, the output end of the first average pooling layer 4021 and the output end of the first maximum pooling layer 4022 are cascaded and connected to the input end of the first convolutional layer 4023, and the output end of the first convolutional layer 4023 is connected to the input end of the first Sigmoid activation function layer 4024;
[0052] The channel attention module 401 includes a second average pooling layer 4011, a second maximum pooling layer 4012, an FC fully connected layer 4013 and a second Sigmoid activation function layer 4014, the input end of the second average pooling layer 4011 and the input end of the second maximum pooling layer 4012 are both connected to the input end of the CPA block 4, the output of the second average pooling layer 4011 and the output of the second maximum pooling layer 4012 are added and input to the FC fully connected layer 4013, and the output end of the FC fully connected layer 4013 is connected to the input end of the second Sigmoid activation function layer 4014;
[0053] The output of the first Sigmoid activation function layer 4024, the output of the second Sigmoid activation function layer 4014 and the input of the CPA block 4 are multiplied together as the output of the CPA block 4.
[0054] The operation performed by the channel attention module 401 is expressed by the following formula:
[0055] ;
[0056] in, is the output of the channel attention module 401, is the input of CPA block 4, is the average pooling function, is the maximum pooling function, is the fully connected function, is a Sigmoid activation function. The channel attention module 401 is used to model the global information of the entire channel, and can capture the global importance of each channel of the input feature map, reduce redundant information, and increase the focus on key features.
[0057] The operation performed by the pixel attention module 402 is expressed as follows:
[0058] ;
[0059] in, is the output of pixel attention module 402, The pixel attention module 402 is used to model the local information of each pixel position, which can capture the importance of each position of the input feature map, enhance the model's perception of the local features of the input image, and pay more attention to details.
[0060] The operation performed by CPA block 4 is expressed as follows:
[0061] ;
[0062] in, is the output of CPA block 4. The CPA block 4 combines the channel attention module 401 and the pixel attention module 402 to give full play to their respective advantages, so that the model can pay attention to channels and pixels at the same time, and has the ability to extract local features and global features, which can better guide the first CNN layer 301 to effectively capture information in the feature space, thereby improving the performance of the model.
[0063] Preferably, see Figure 1 , the CNN decoder 5 includes multiple layers of second CNN layers 501 connected in series, the number of second CNN layers 501 is the same as the number of first CNN layers 301, and the CNN branch 3 is connected to the CNN decoder 5 to form a U-Net network.
[0064] The connection between the CNN branch 3 and the CNN decoder 5 to form a U-Net network helps to preserve the details of the original image and avoid the loss of detail information due to network training.
[0065] Specifically, see Figure 1 , for any i (i is a positive integer and i∈[1,n-1], n is the number of the first CNN layer 301 and the second CNN layer 501), the guide output corresponding to the i-th first CNN layer 301 is added to the output of the ni-th second CNN layer 501 and then input into the n-i+1-th second CNN layer 501, thereby, the CNN branch 3 is connected to the CNN decoder 5 to form a U-Net network.
[0066] Among them, the number of the first CNN layer 301, the Transformer block 201 and the CPA block 4 can be set according to actual needs. Preferably, the first CNN layer 301 and the Transformer block 201 are each provided with four layers, and the CPA block 4 is provided with four layers, which can not only ensure a better dehazing effect, but also avoid low processing efficiency caused by too many first CNN layers 301, Transformer blocks 201 and CPA blocks 4.
[0067] For example Figure 1In the figure, n=4, the guided output corresponding to the first CNN layer 301 of the first layer is added to the output of the second CNN layer 501 of the third layer and then input into the second CNN layer 501 of the fourth layer, the guided output corresponding to the first CNN layer 301 of the second layer is added to the output of the second CNN layer 501 of the second layer and then input into the second CNN layer 501 of the third layer, and the guided output corresponding to the first CNN layer 301 of the third layer is added to the output of the second CNN layer 501 of the first layer and then input into the second CNN layer 501 of the second layer.
[0068] In some preferred embodiments, see Figure 1 , Transformer branch 2 also includes a second convolutional layer 202 and a downsampling layer 203 which are sequentially connected to the front side of the first layer Transformer block 201.
[0069] Since the operation of the Transformer block 201 is more complex than that of the CNN layer, the amount of calculation of the Transformer block 201 is much larger than that of the CNN layer. Therefore, adding a downsampling layer 203 to the Transformer branch 2 and downsampling the image before inputting the Transformer block 201 can reduce the amount of calculation of the Transformer block 201, improve the operation speed, increase the receptive field, and prevent the features extracted by the Transformer block 201 from being repeated with the features extracted by the first CNN layer 301.
[0070] Preferably, the Transformer block 201 includes a normalization layer (all Transformer modules in the prior art include a normalization layer), and the normalization layer performs the following operations (this is one of the improvements of the present application to the existing Transformer module):
[0071] ;
[0072] Among them, y is the output of the normalization layer, x is the feature map of the input normalization layer, is the mean value of x, is the standard deviation of x, To learn the scaling factor, is the deviation factor, and is the weight, and is the deviation parameter ( , , , , and Through learning and training, F(·) is the main block function (i.e., the operation function performed by the main block of the normalization layer). The above normalization layer can preserve the mean and standard deviation of the image, ensuring that the restored image has the contrast and brightness of the original image.
[0073] Furthermore, the sliding window mechanism of the Transformer block 201 adopts a reflection filling mechanism to fill the size of the edge window to the set window size, thereby avoiding missing image edge information and improving network performance.
[0074] Furthermore, Transformer block 201 aggregates information between neighboring windows by the following operations:
[0075] ;
[0076] in, is the aggregation result, Q is the query matrix, K is the key matrix, V is the value matrix, is the transposed matrix of K, d is the dimension of the query matrix and the key matrix, B is the relative position bias parameter, is V before window division, is the softmax function, is the convolution function. It is equivalent to adding a convolution layer after the aggregation operation of the existing Transformer module. Because the existing attention mechanism aggregates the information within the window and inevitably ignores the information between windows, convolution can be used to aggregate the information between neighboring windows.
[0077] Specifically, the first CNN layer 301 and the second CNN layer 501 are both composed of a convolutional layer and a ReLU activation function layer.
[0078] After being trained, the interactively guided dual-branch image defogging model can be used for image defogging processing. Specifically, the training can be performed using an existing training method, which is not limited here.
[0079] refer to Figure 3 The present application provides an image processing method, based on the interactively guided dual-branch image defogging model mentioned above (referring to the trained interactively guided dual-branch image defogging model), comprising the steps of:
[0080] A1. Obtain the image to be dehazed;
[0081] A2. Input the image to be defogged into the interactively guided dual-branch image defogging model to obtain a haze-free image output by the interactively guided dual-branch image defogging model.
[0082] Figure 4 and Figure 5A comparison chart of the defogging results of the image processing method of the present application and several existing image processing methods (hereinafter referred to as comparison methods) is shown, wherein the comparison method includes using an image defogging Transformer with a transmission-aware 3D position embedding function to perform defogging (the output result is Figure 4 b and Figure 5 b) Defogging using the visual tranformer for single image defogging (the output is Figure 4 c and Figure 5 c), using the feature fusion attention network for single image defogging (the output is Figure 4 d and Figure 5 d in), using the attention-based multi-scale image defogging network for defogging (the output result is Figure 4 e and Figure 5 e) and dehazing using a multi-scale enhanced dehazing network using dense feature fusion technology (the output result is Figure 4 f and Figure 5 f in Figure 4 a and Figure 5 The a in the figure are two fog source images, Figure 4 h and Figure 5 The h in the figure are two real fog-free images, Figure 4 g and Figure 5 The g in the figure are the defogging results obtained by using the image processing method of the present application.
[0083] from Figure 4 and Figure 5 It can be seen that except for the image processing method of the present application, all the comparison methods have blurred detail contours and obvious residual haze after defogging. The image processing method of the present application can remove fog more effectively.
[0084] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0085] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0087] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0088] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An interactively guided dual-branch image defogging model for defogging an image, characterized in that: It includes input layer (1), Transformer branch (2), CNN branch (3), multiple CPA blocks (4), CNN decoder (5) and output layer (6); The Transformer branch (2) includes multiple layers of serially connected Transformer blocks (201), the CNN branch (3) includes multiple layers of first CNN layers (301), and the number of the Transformer blocks (201), the first CNN layers (301) and the CPA blocks (4) is the same; The input end of the Transformer branch (2) and the input end of the CNN branch (3) are both connected to the input layer (1); The output of the Transformer block (201) of each layer is added to the output of the first CNN layer (301) of the same layer and then input into a CPA block (4) to obtain a weight matrix output by the CPA block (4), which is used to multiply the output of the first CNN layer (301) of the same layer to obtain a guide output corresponding to the first CNN layer (301) of the same layer; the guide outputs corresponding to the first CNN layer (301) of each layer before the first CNN layer (301) of the last layer are input into the first CNN layer (301) of the next layer respectively, and the guide output corresponding to the first CNN layer (301) of the last layer is added to the output of the Transformer block (201) of the last layer and then input into the CNN decoder (5); The output end of the CNN decoder (5) is connected to the output layer (6); The CNN decoder (5) comprises a plurality of second CNN layers (501) connected in series, the number of the second CNN layers (501) is the same as the number of the first CNN layers (301), and the CNN branch (3) is connected to the CNN decoder (5) to form a U-Net network; The guided output corresponding to the first CNN layer (301) of the i-th layer is added to the output of the second CNN layer (501) of the ni-th layer and then input into the second CNN layer (501) of the n-i+1-th layer, where i is a positive integer and i∈[1, n-1], and n is the number of layers of the first CNN layer (301) and the second CNN layer (501).
2. The interactively guided dual-branch image dehazing model according to claim 1, characterized in that: The CPA block (4) includes a channel attention module (401) and a pixel attention module (402); The pixel attention module (402) comprises a first average pooling layer (4021), a first maximum pooling layer (4022), a first convolutional layer (4023) and a first Sigmoid activation function layer (4024), the input end of the first average pooling layer (4021) and the input end of the first maximum pooling layer (4022) are both connected to the input end of the CPA block (4), the output end of the first average pooling layer (4021) and the output end of the first maximum pooling layer (4022) are cascaded and connected to the input end of the first convolutional layer (4023), and the output end of the first convolutional layer (4023) is connected to the input end of the first Sigmoid activation function layer (4024); The channel attention module (401) comprises a second average pooling layer (4011), a second maximum pooling layer (4012), an FC fully connected layer (4013) and a second Sigmoid activation function layer (4014), the input end of the second average pooling layer (4011) and the input end of the second maximum pooling layer (4012) are both connected to the input end of the CPA block (4), the output of the second average pooling layer (4011) and the output of the second maximum pooling layer (4012) are added and then input into the FC fully connected layer (4013), and the output end of the FC fully connected layer (4013) is connected to the input end of the second Sigmoid activation function layer (4014); The output of the first Sigmoid activation function layer (4024), the output of the second Sigmoid activation function layer (4014), and the input of the CPA block (4) are multiplied to form the output of the CPA block (4).
3. The interactively guided dual-branch image dehazing model according to claim 1, characterized in that: The first CNN layer (301) and the Transformer block (201) are both provided with four layers, and the CPA block (4) is provided with four layers.
4. The interactively guided dual-branch image dehazing model according to claim 1, characterized in that: The Transformer branch (2) further includes a second convolutional layer (202) and a downsampling layer (203) which are sequentially connected to the front side of the first-layer Transformer block (201).
5. The interactively guided dual-branch image dehazing model according to claim 1, characterized in that: The Transformer block (201) includes a normalization layer, and the normalization layer performs the following operations: ; Among them, y is the output of the normalization layer, x is the feature map input to the normalization layer, is the mean value of x, is the standard deviation of x, To learn the scaling factor, is the deviation factor, and is the weight, and is the deviation parameter and F(·) is the main block function.
6. The interactively guided dual-branch image dehazing model according to claim 1, characterized in that: The sliding window mechanism of the Transformer block (201) adopts a reflection filling mechanism to fill the size of the edge window to the set window size.
7. The interactively guided dual-branch image dehazing model according to claim 6, characterized in that: The Transformer block (201) aggregates information between neighboring windows by the following operations: ; in, is the aggregation result, Q is the query matrix, K is the key matrix, V is the value matrix, is the transposed matrix of K, d is the dimension of the query matrix and the key matrix, B is the relative position bias parameter, is V before window division, is the softmax function, is the convolution function.
8. An image processing method, characterized in that: The interactively guided dual-branch image defogging model according to any one of claims 1 to 7 comprises the following steps: A1. Obtain the image to be dehazed; A2. Input the image to be defogged into the interactively guided dual-branch image defogging model to obtain a haze-free image output by the interactively guided dual-branch image defogging model.
