Knowledge-guided multi-perception attention network image defogging method
By designing knowledge distillation and a multi-sensory attention module, the difficulty of image dehazing on resource-limited devices is solved, achieving efficient image dehazing effect and flexibility, and improving the performance of the dehazing network.
Patent Information
- Application Number
- CN202311511909.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-14
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-11-14
AI Technical Summary
Existing image dehazing methods are cumbersome to deploy on resource-limited devices, and deep learning-based methods ignore intermediate steps, failing to provide additional flexibility and efficient dehazing results.
We employ knowledge distillation to learn clear image features from the teacher network, design a multi-sensory attention module to guide the student network, and construct a lightweight multi-sensory attention network for image dehazing through multi-scale and multi-level feature extraction.
Achieving high-quality image dehazing on resource-constrained devices improves the performance and flexibility of the dehazing network, reduces parameter size, and performs well on multiple datasets.
Smart Images

Figure CN117557473B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image defogging, and particularly relates to a knowledge-guided multi-perception attention network image defogging method. BACKGROUND
[0002] Image defogging is an important task in computer vision, which aims to recover a clear image from a hazy image affected by atmospheric scattering. Image defogging has a wide range of practical applications, such as unmanned aerial vehicle aerial photography, outdoor monitoring, autonomous driving, and remote sensing, etc. However, it also faces challenges such as complex physical model of fog formation, ill-posed problem, and nonlinearity.
[0003] Currently, the methods of image defogging mainly include prior knowledge-based methods and deep learning-based methods. Prior knowledge-based methods use some assumptions or rules to estimate unknown variables in the fog model, such as transmittance and atmospheric light, to obtain a defogging image. This kind of method is usually simple and efficient, but also has some limitations, such as over-simplification of prior knowledge, poor adaptability to real scenes, etc. Deep learning-based methods use convolutional neural networks (CNN) to learn the complex nonlinear mapping relationship between hazy images and clear images, or indirectly estimate unknown variables in the fog model through the network, thereby realizing image defogging. This kind of technology usually can obtain better defogging effect and visual perception, but also needs more computing resources and training data, and does not fully utilize the information of clear images. SUMMARY
[0004] In view of the deficiencies of the prior art, the purpose of the present application is to provide a knowledge-guided multi-perception attention network image defogging method. The present application is based on knowledge distillation, which learns a smaller student model from a larger teacher model, providing a possibility for model deployment on resource-limited mobile or embedded devices. The teacher network can fully exploit the feature information of clear haze-free images, providing knowledge guidance for the student network defogging, making the defogging result closer to the real defogging image style. In the hidden layer transformation process from hazy images to haze-free images, the present application designs a multi-perception attention module, which can provide more flexibility for feature transformation.
[0005] To achieve the above purpose, the present application provides the following technical scheme: a knowledge-guided multi-perception attention network image defogging method, comprising the following steps:
[0006] (1) Obtain a dataset and divide it into a training set and a test set according to a suitable ratio. For example, obtain a synthetic objective testing set (SOTS) in a real single image dehazing (RESIDE) dataset. Randomly divide the dataset into a training set and a test set according to a certain ratio from an outdoor image dataset (SOTS-outdoor) in the SOTS, and pre-process the data.
[0007] (2) Construct a teacher network model and pre-train it. The teacher network is an end-to-end dehazing network with an encoder-decoder structure.
[0008] (3) Construct a student network model and design a knowledge distillation process. The student network is an end-to-end dehazing network with an encoder-decoder structure.
[0009] (4) Load the pre-trained teacher network and fix the parameters to guide the decoding process of the student network, and train the student network.
[0010] As preferred: step (1) specifically includes the following aspects:
[0011] (1.1) We pre-process the paired images in the dataset as follows: first, read in the corresponding images and perform a resize operation to change them to 256*256 size, and then convert them to tensor type in pytorch.
[0012] (1.2) In addition to the SOTS-outdoor dataset, we train and test the method on the SOTS-indoor, New York University dataset (NYU), real uniform haze dataset (Outdoor / Indoor), non-uniform haze (NH-haze) and dense haze (Dense-haze) datasets.
[0013] As preferred: step (2) specifically includes the following aspects:
[0014] (2.1) The teacher network is a multi-scale feature fusion pyramid attention network, which is composed of network deconvolution modules inserted at the head of the network and after downsampling, downsampling modules, teacher multi-perception attention modules, and upsampling modules and deep-shallow feature fusion modules (SDF). The structure of the deep-shallow feature fusion module is as shown in Figure 2 The feature fusion process from the deep layer and the shallow layer is as shown in formulas (1), (2) and (3):
[0015] sdf 1 / 4 =σ(α1)*CA(sf 1 / 4) + (1 - σ(α1))
[0016] * CA(upsampling(sdf 1 / 4 )) (1)
[0017] sdf 1 / 2 = σ(α2) * CA(sdf 1 / 2 ) + (1 - σ(α2))
[0018] * CA(upsampling(sdf 1 / 4 )) (2)
[0019] sdf1= σ(α3) * CA(sdf1) + (1 - σ(α3))
[0020] * CA(upsampling(sdf 1 / 2 )) (3)
[0021] sdf 1 / 4 , sdf 1 / 2 , sdf1 represent the fused features with respect to the input image size 1 / 4, 1 / 2 and the same size respectively, α1, α2 and α3 are all learnable parameters, σ(*) is the sigmoid operator, upsampling(*) is the up-sampling operation.
[0022] (2.2) Feature map processing procedure of the teacher multi-perception attention module (as shown in Fig. Figure 3 (a)). First, the feature maps go through parallel 1x1 convolutional transformations. Then, they pass through the multi-perception module and the channel attention module, and multiply the results to obtain the final attention weights att t . These weights are used to weight the original features x t , resulting in the final weighted output The processing procedure is shown in equation (4) and equation (5).
[0023] att t = mp(conv 1*1 (x t )) * ca(conv 1*1 (x t )) (4)
[0024]
[0025] mp(*) and ca(*) are the multi-perception module and the channel attention module respectively, conv 1*1 (*) is the 1x1 convolutional operation.
[0026] (2.3) The loss function of the teacher network uses the L1-based reconstruction loss L rec and the perception loss Lperc The purpose of using the perception loss is to make the defogged image not only close to the real haze-free image in pixels, but also similar to the real haze-free image in style features. The reconstruction loss L rec and the perception loss L perc are respectively shown in formula (6) and formula (7).
[0027]
[0028]
[0029] The loss function of the teacher network is as follows:
[0030]
[0031] wherein, is the defogged image output by the network, y is the clear image, is a pre-trained network. is calculated when x, is the jth layer feature in x. If the jth layer represents a convolutional layer, is a feature map with a shape of C j ×H j ×W j , β is a regularization coefficient, I is a haze image, C j , H j , W j are the length, width and channel number of the feature map respectively.
[0032] (2.4) Using the clear image in the public data set, the teacher network is trained by minimizing the loss function in (4.2), and the optimal parameter model is saved to obtain the optimal pre-trained teacher network.
[0033] As preferred: step (3) specifically comprises the following aspects:
[0034] (3.1) The student network is composed of a network deconvolution module interspersed in the network head and after down-sampling, a down-sampling module, a student multi-perception attention module, and an up-sampling module and a shallow and deep feature fusion module (SDF). The student multi-perception attention module is designed to be simplified and has fewer parallel channel attention modules than the teacher multi-perception attention module.
[0035] (3.2) Assuming that the paired haze image in the training set is I and the haze-free image is J, the paired I and J are used to train the student network, and at the same time we input the corresponding J into the pre-trained teacher network to obtain the corresponding feature of the decoder, i.e. the feature (f mpa ) generated by the last multi-perception module, up-sampling 1 / 2 size and up-sampling to the input size (fup1 ). Using the designed knowledge distillation regularization loss L kg Align the features of the student network at corresponding positions with the features of the teacher network.
[0036] (3.3) Multi-sensory attention module in student network (such as Figure 3 (b) Feature map processing process. First, the feature maps are transformed into 1x1 convolutions. Then, they pass through the multi-perception module to generate the final attention weights att s These weights are used to carefully weight the original features x s After 1x1 convolution transformation, the final output is generated The processing process is shown in equations (8) and (9).
[0037] att s =mp(conv 1*1 (x s )) (8)
[0038]
[0039] mp(*) is the response Figure 3 The multi-sensory module shown ( Figure 3 (c)), conv 1*1 (*) is a 1x1 convolution operation.
[0040] (3.4) In order to increase the robustness of the model and make the dehazing results closer to the real image, we use the perceptual loss L perc , contrast loss L contrast To shorten the distance between the dehazed image and the haze-free image and move away from the hazy image, we add the knowledge distillation loss L mentioned in (3.2) and (2.3) kg and reconstruction loss L rec As the regularization term of the loss function. The overall loss function is defined as shown in formula (10):
[0041] L total =L rec +αL perc +βL contrast +γL kg (10)
[0042] α, β, and γ represent the coefficients of the corresponding regularization terms.
[0043] (3.5) The fog-free image J in the paired images is input into the teacher network, and the paired foggy and fog-free images I and J are input into the student network. By minimizing L total , to update the parameters of the student network.
[0044] As preferred: step (3.4) specifically includes the following aspects:
[0045] A, contrast loss: through contrast learning, we can regard the hazy image as a negative sample and the clear image as a positive sample. In order to make the network output close to the positive sample and far away from the negative sample, the deep features are extracted from the network output using the VGG network, and the hazy image and the corresponding clear image are as shown in formula (11):
[0046]
[0047] is the hidden layer feature extracted by the fixed pre-trained model, for the i-th layer, ω i is the corresponding coefficient. Dis(a, b) calculates the L1 loss between features a and b.
[0048] B, knowledge guided loss: if we regard image reconstruction as a coding-decoding process, most of the deep learning-based defogging methods only use the clear image itself as the basic fact of loss function design. In order to guide the defogging process, we use the autoencoder network trained by the clear image as the teacher network to provide guidance to the corresponding decoder features of the student network. Specifically, when we train the defogging student network for pairs of haze and clear images, we also input the clear image into the pre-trained teacher network, and then use the knowledge guided regularization term to shorten the distance between the decoder features of the student network and the teacher network. In addition, we give a weight coefficient for each feature level to further increase the flexibility of guidance, as shown in formula (12):
[0049] L kg = α1|T mpa -S mpa |1+ α2|T up1 / 2 -S up1 / 2 |1+ α3|T up1 -S up1 |1 (12)
[0050] In this equation, the subscripts mpa, up1 / 2 and up1 respectively represent the last multi-perception attention module, and the features generated by the first and second up-sampling modules, which respectively up-sample the features to half the size of the input and the same size. α1, α2 and α3 are the corresponding coefficients.
[0051] With the above technical solutions, the present application has the following characteristics:
[0052] Image dehazing is an important computer vision task that aims to recover a clear image from a hazy, dim image. Most existing deep learning dehazing methods are result-oriented, ignoring the intermediate steps, and it is also difficult to deploy cumbersome deep models on resource-limited devices. In addition, the fixed-size convolution kernel and single perception attention mechanism cannot provide additional flexibility for the mapping from dim images to clear images. This work proposes a new knowledge distillation method to guide the intermediate process of dehazing to improve the performance of the dehazing network. Specifically, we train a teacher network on clear images, which can learn useful features from clear images, and then we select the deep layers of the network, i.e., the decoding process, to transfer the knowledge represented by these features to a lightweight student network. In addition, we design a multi-perception attention module and perform heterogeneous design on this module for the teacher network and the student network to extract multi-scale and multi-level features of dim images, thereby enhancing the performance of the student network. We conduct experiments on multiple public image dehazing datasets, and the results show that this method achieves a good trade-off between reducing the parameter size and maintaining high-quality dehazing effects compared to other algorithms. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 A schematic diagram of the dehazing network model (KMAN) of the embodiment of the present application;
[0054] Figure 2 A schematic diagram of the deep and shallow feature fusion module (SDF) of the embodiment of the present application;
[0055] Figure 3 A schematic diagram of the multi-perception attention module (MPA) of the embodiment of the present application.
[0056] Figure 4 A dehazing effect diagram of the embodiment of the present application. DETAILED DESCRIPTION
[0057] The present application will be further described below in conjunction with the drawings and embodiments.
[0058] As Figure 1 shown, the present application proposes an image dehazing method based on a multi-perception attention network guided by knowledge, and the specific implementation steps are as follows:
[0059] (1) Obtain the dataset and divide it into training set and test set according to the appropriate proportion. For example, obtain the synthetic objective testing set (SOTS) in the real single image dehazing (RESIDE) dataset. From the outdoor image dataset (SOTS-outdoor) therein, randomly select 450 pairs of images as the training set, and the remaining 50 pairs of images as the test set, and preprocess the data.
[0060] (2) Construct a teacher network model and pretrain it. The teacher network is an end-to-end dehazing network with an encoder-decoder structure.
[0061] (3) Construct a student network model and design a knowledge distillation process. The student network is an end-to-end dehazing network with an encoder-decoder structure.
[0062] (4) Load the pre-trained teacher network and fix the parameters, guide the decoding process of the student network, and train the student network.
[0063] The specific implementation process of step (1) is as follows:
[0064] (1.1) We preprocess the paired images in the dataset as follows: first, read in the corresponding images and resize them to 256*256, and then convert them to tensor type in pytorch.
[0065] (1.2) In addition to the SOTS-outdoor dataset, we train and test the method on the SOTS-indoor, New York University dataset (NYU), real uniform haze dataset (Outdoor / Indoor), non-uniform haze (NH-haze) and dense haze (Dense-haze) datasets.
[0066] The specific implementation process of step (2) is as follows:
[0067] (2.1) The teacher network is a multi-scale feature fusion pyramid attention network, which is composed of network deconvolution modules (ND) inserted at the head of the network and after downsampling, downsampling modules, teacher multi-perception attention modules (MPA-T), and upsampling modules and shallow-deep feature fusion modules (SDF). The structure of SDF is shown in Figure 2 The feature fusion process from the deep and shallow layers is shown in equations (1), (2) and (3):
[0068] sdf 1 / 4 =σ(α1)*CA(sf1 / 4 )+(1 - σ(α1))
[0069] *CA(df 1 / 4 ) (1)
[0070] sdf 1 / 2 = σ(α2) * CA(sf 1 / 2 ) + (1 - σ(α2))
[0071] *CA(upsampling(sdf 1 / 4 )) (2)
[0072] sdf1= σ(α3) * CA(sf1) + (1 - σ(α3))
[0073] *CA(upsampling(sdf 1 / 2 )) (3)
[0074] sdf 1 / 4 , sdf 1 / 2 , sdf1 represent the fused features with respect to the input image size 1 / 4, 1 / 2 and the same size respectively, α1, α2 and α3 are all learnable parameters, σ(*) is the sigmoid operator, upsampling(*) is the up-sampling operation.
[0075] (2.2) Feature map processing procedure of the teacher multi-perception attention module (as shown in Figure 3 (a)). First, the feature maps are transformed by parallel 1x1 convolution. Then, they pass through the multi-perception module and the channel attention module, and the results are multiplied to obtain the final attention weights att t . These weights are used to weight the original features x t , resulting in the final weighted output The processing procedure is shown in equation (4) and equation (5).
[0076] att t = mp(conv 1*1 (x t )) * ca(conv 1*1 (x t )) (4)
[0077]
[0078] mp(*) and ca(*) correspond to the multi-perception module Figure 3 (c)) and the channel attention module Figure 3 (d)) shown in Figure 3 , conv 1*1 (*) is the 1x1 convolution operation.
[0079] (2.3) The loss function of the teacher network uses an L1-based reconstruction loss L rec and a perceptual loss L perc The purpose of using the perceptual loss is to make the defogged image not only close to the real haze-free image in pixels, but also similar to the real haze-free image in style features. The reconstruction loss L rec and the perceptual loss L perc are respectively shown in formula (6) and formula (7).
[0080]
[0081]
[0082] The loss function of the teacher network is shown in the following formula:
[0083]
[0084] wherein, is the defogged image output by the network, y is the clear image, is a pre-trained network. is calculated when x, is the jth layer feature in the network. If the jth layer represents a convolutional layer, is a feature map with a shape of C j ×H j ×W j , β is a regularization coefficient, which is set to 0.001 according to the experimental effect, I is the haze image, C j , H j , W j are the length, width and channel number of the feature map respectively.
[0085] (2.4) An auto-encoding training is performed on the network using 500 clear haze-free images J in SOTS, and the network parameter model after 100 rounds of training is saved to obtain a pre-trained teacher network.
[0086] As preferred: step (3) specifically includes the following aspects:
[0087] (3.1) The student network is composed of a network deconvolution module interposed in the network head and after down-sampling, a down-sampling module, a student multi-perception attention module, and an up-sampling module and a shallow-deep feature fusion module (SDF). The student multi-perception attention module is simplified compared with the teacher multi-perception attention module, and the parallel channel attention module is omitted.
[0088] (3.2) Assume that the paired foggy image in the training set is I and the fog-free image is J. Use the paired I and J to train the student network. At the same time, we input the corresponding J into the pre-trained teacher network to obtain the features corresponding to the decoder, that is, the features generated by the last MPA module (f mpa ), upsample to 1 / 2 size and upsample to the input size (f up1 ). Using the designed knowledge distillation regularization loss L kg Align the features of the student network at corresponding positions with the features of the teacher network.
[0089] (3.3) Multi-sensory attention module in student network (such as Figure 3 (b) Feature map processing. First, the feature maps undergo a 1x1 convolution. Then, they pass through the multi-perception module to produce the final attention weights atts. These weights are used to carefully weight the original features x s After 1x1 convolution transformation, the final output is generated The processing process is shown in equations (8) and (9).
[0090] att s =mp(conv 1*1 (x s )) (8)
[0091]
[0092] mp(*) is Figure 3 The multi-sensory module shown ( Figure 3 (c)), conv 1* 1(*) is a 1x1 convolution operation.
[0093] (3.4) In order to increase the robustness of the model and make the dehazing results closer to the real image, we use the perceptual loss L perc , contrast loss L contrast To shorten the distance between the dehazed image and the haze-free image and to move away from the hazy image, we add the knowledge distillation loss L mentioned in (3.2) and (2.3). kg and reconstruction loss L rec As the regularization term of the loss function. The overall loss function is defined as shown in formula (10):
[0094] L total =L rec +αL perc +βL contrast +γL kg (10)
[0095] α, β and γ represent the coefficients of the corresponding regularization terms, which are set to 0.1, 0.1 and 0.1 according to the experimental results.
[0096] (3.5) The haze-free image J in the paired image is input into the teacher network, and the paired haze and haze-free images I and J are input into the student network. The parameters of the student network are updated by minimizing L total , and the PSNR index of the test model on the test set is tested every round. The corresponding model with the optimal PSNR in 100 rounds is saved.
[0097] The contrast loss and knowledge-guided loss in step (3.4) are described as follows:
[0098] A. Contrast loss: Through contrast learning, we can regard the hazy image as a negative sample and the clear image as a positive sample. In order to make the network output close to the positive sample and far away from the negative sample, the VGG network is used to extract deep features from the network output, and the hazy image and the corresponding clear image, as shown in formula (11):
[0099]
[0100] is the hidden layer feature extracted by the fixed pre-trained model, is used for the ith layer, and ω i is the corresponding coefficient. Dis(a, b) calculates the L1 loss between features a and b.
[0101] B. Knowledge-guided loss: If we regard image reconstruction as a coding-decoding process, most deep learning-based defogging methods only use the clear image itself as the basic fact of loss function design. In order to provide guidance for the defogging process, we use the autoencoder network trained by the clear image as the teacher network to provide guidance to the features of the corresponding decoder of the student network. Specifically, when we train the defogging student network for pairs of haze and clear images, we also input the clear image into the pre-trained teacher network, and then use the knowledge-guided regularization term to shorten the distance between the decoder features of the student network and the teacher network. In addition, we give a weight coefficient for each feature level to further increase the flexibility of guidance, as shown in formula (12):
[0102] L kg = α1|T mpa -S mpa |1+ α2|T up1 / 2 -S up1 / 2 |1+ α3|T up1 -S up1 |1 (12)
[0103] In the equation, the subscripts mpa, up1 / 2 and up1 represent the last multi-perception attention module, and the features generated by the first and second up-sampling modules, respectively, which up-sample the features to half the size of the input and the same size, respectively. alpha1, alpha2 and alpha3 are the corresponding coefficients, which are set to 1 / 8, 1 and 1, respectively, according to experimental results.
[0104] In practical applications:
[0105] The present application provides a kind of multi-perception attention network image defogging method based on knowledge guide, can carry out defogging in end-to-end mode, and mainly consists of two stages: the first stage: using clear image training an auto-encoding network of encoder-decoder structure as teacher network;Second stage, load and fix teacher network parameters, after the end of hidden layer space mapping, guide student network gradually restore clear image without fog, as shown in Figure 4 (First row is hazy image, second row is defogged image).
[0106] Particularly, the present application designs a multi-perception attention module in the hidden layer space mapping part of the defogging network model. After the defogging network model is constructed, the loss is calculated according to the designed loss function, and the parameters are updated iteratively to directly defog the hazy image.
[0107] The above embodiments are only used to further illustrate the present application, and cannot be understood as limiting the scope of protection of the present application. The skilled in the art can make some non-essential improvements and adjustments to the present application according to the content of the above application, which fall within the scope of protection of the present application.
Claims
1. A knowledge-guided multi-perception attention network image defogging method, characterized in that, The method comprises the following steps: (1) obtaining a data set and dividing it into a training set and a test set according to a proper ratio; randomly dividing the data set into a training set and a test set according to a certain ratio, and preprocessing the data; (2) constructing a teacher network model and pretraining the same, the teacher network being an end-to-end defogging network with an encoder-decoder structure; (3) constructing a student network model and designing a knowledge distillation process, the student network being an end-to-end defogging network with an encoder-decoder structure; (4) loading the pre-trained teacher network and fixing the parameters, guiding the decoding process of the student network, and training the student network; The teacher network is composed of a network deconvolution module interposed after a network head and a down-sampling module, a teacher multi-perception attention module, and an up-sampling module and a deep-shallow layer feature fusion module; the teacher network is trained by using clear images to minimize a loss function; the teacher multi-perception attention module is composed of a 1x1 convolution module and a double channel composed of a multi-perception module and a 1x1 convolution module and a channel attention module; the deep-shallow layer feature fusion module is composed of a channel attention module and a learnable parameter, and the process of fusing deep and shallow layer features is as shown in the following formula: sdf 1 / 4 = σ(α1) * CA(sf1 / 4) + (1 - σ(α1)) *CA(df 1 / 4 ) sdf 1 / 2 = σ(α2) * CA(sf 1 / 2 ) + (1 - σ(α2)) * CA (upsampling (sdf 1 / 4 )) sdf1=σ(α3)*CA(sf1)+(1-σ(α3)) * CA (upsampling (sdf 1 / 2 )) sdf 1 / 4 , sdf 1 / 2 , sdf1 respectively represent the fused features with respect to the input image size 1 / 4, 1 / 2 and the same size, a1, a2 and a3 are all learnable parameters, σ(*) is the sigmoid operator, and upsampling(*) is the up-sampling operation.
2. The knowledge-guided multi-perception attention network image defogging algorithm according to claim 1, characterized in that: The student network of step (3) is composed of a network deconvolution module interposed after a network head and a down-sampling module, a student multi-perception attention module, and an up-sampling module and a deep-shallow layer feature fusion module; the student multi-perception attention module is designed in a simplified manner and has fewer parallel channel attention modules than the teacher multi-perception attention module; the knowledge distillation process of step (3) comprises the following specific steps: Assuming that the paired foggy image in the training set is I, and the haze-free image is J, the student network is trained using the paired J and J, while the corresponding J is input into the pre-trained teacher network to obtain the corresponding features of the decoder, i.e. the features generated by the last multi-perception module (f mpa ), upsampled to 1 / 2 size and upsampled to the input size (f up1 ); using the designed knowledge distillation regularization loss L kg align the features at the corresponding positions of the student network and the teacher network.
3. The knowledge-guided multi-perception attention network image defogging algorithm according to claim 2, characterized in that, The teacher multi-perception attention module in the teacher network, the data processing process and the loss function are further described as follows: (3.1) Teacher multi-perception attention module feature map processing process: first, the feature maps are transformed by parallel 1x1 convolution; then, they pass through the multi-perception module and the channel attention module, and the results are multiplied to obtain the final attention weight att t ; these weights are used to weight the original features x t , to produce the final weighted output of the teacher multi-perception attention module The processing process is as follows: att t = mp(conv 1* 1(x t )*ca(conv1*1(x t )) mp(*) and ca(*) are multi-perception module and channel attention module, respectively, conv 1*1 (*) is a 1x1 convolution operation; (3.2) Loss function definition: The loss function uses a L1-based reconstruction loss L rec and a perceptual loss L perc The purpose of using the perceptual loss is to make the defogged image not only close to the real haze-free image in pixels, but also similar to the real haze-free image in style features. The reconstruction loss L rec and the perceptual loss L perc is as follows: The loss function of the teacher network is as shown in the following formula: wherein, is the dehazed image output by the network, y is the clear image, is the pre-trained network; is calculated when x, is the jth layer feature in x; if the jth layer represents a convolutional layer, is a feature map of shape C j x H j x W j , β is a regularization coefficient, I is a haze image, C j , H j , W j are the length, width and channel number of the feature map, respectively; (3.3) training the teacher network by using clear images in a public data set to minimize the loss function in (4.2) and saving an optimal parameter model to obtain an optimal pre-trained teacher network.
4. The knowledge-guided multi-perception attention network image defogging algorithm according to claim 3, characterized in that, The student multi-perception attention module data processing process and the knowledge distillation process can be further described as: (4.1) feature map processing process of the multi-perception attention module in the student network: first, the feature map is subjected to 1x1 convolution transformation; Then, they pass through a multi-sense module to produce the final attention weights att s ; these weights are used to weight the original features x s ; After a 1x1 convolutional transform, a final output is produced The process is shown in the following equation: att s = mp(conv 1*1 (x s )) mp(*) is a multi-perception module and channel attention module, conv 1*1 (*) is a 1 x 1 convolution operation; (4.2) Knowledge distillation process: In order to increase the robustness of the model and make the defogging result closer to the real image, we use the perception loss L perc , the contrast loss L contrast to pull the distance between the defogging image and the haze-free image, and away from the haze image, plus the knowledge distillation loss L kg mentioned in claim 3 and the reconstruction loss L rec as the loss function regularization term; the total loss function is defined as follows: L total = L rec + αL perc + βL contrast + γL kg a, b and g represent coefficients of the corresponding regularization terms, the loss function L of knowledge distillation kg as shown in the following formula: L kg = a1|T mpa - S mpa |1 + a2|T up1 / 2 - S up1 / 2 |1 + a3|T up1 - S up1 |1 The subscripts mpa, up1 / 2 and up1 represent the last multi-perception attention module, and the features generated by the first and second up-sampling modules, which up-sample the features to half of the input size and the same size, respectively; a1, a2 and a3 are the corresponding coefficients; the contrast loss L contrast As shown in the following formula: i = 1, 2, 3, …, n, is the hidden layer feature extracted by the fixed pre-trained model, for the i-th layer, ω i is the corresponding coefficient; Dis(a, b) calculates the L1 loss between features a and b; (4.3) input the haze-free image J in the paired image into the teacher network, input the paired haze and haze-free images I and J into the student network, and update the parameters of the student network by minimizing L total .
Citation Information
Patent Citations
Image defogging method based on comparative learning and knowledge distillation
CN113744146A