# Multi-Input Attention Network for Dehazing of Remote Sensing Images
## 3 Materials and Methods
### Network Architecture
#### 3.2.3 Attention Module  
Inspired by the attention mechanisms widely applied in the field of image vision [41; 42], we introduce the attention module in the feature extraction of the input data. The attention module can reinforce the focusing capability of the model. It enables the system to emphasize important information and suppress relatively irrelevant information so that the system can effectively extract non-uniform haze features. For the feature maps of Band 11 and Band 12 after Double Convolutional Layer and Band 5, Band 6 and Band 7 after the Downsampling Layer, the attention module infers the attention of the image along two independent dimensions of channel and space in turn. Then, the attention map is multiplied with the feature map after Downsampling and Upsampling in the backbone network, which is then fused with the feature map of the backbone network. The process is formulated in Formula (3). \[F^{*}=\mu_{m}(A_{i}\bigotimes F)+F \tag{3}\]  
where \(A_{i}\) is the attention map generated after different attention modules. \(F\) is the feature map of the backbone network with size \(C\times H\times W\). \(F^{*}\) is the output feature map after the fusion with the attention modules, and \(\mu_{m}\) is the correction coefficient. Different bands impact the final haze removal in different ways. Therefore, different bands have different correction coefficients for feature fusion. The feature extraction correction coefficient for Band 11 and Band 12 is \(\mu_{m}=0.5\), while the correction coefficient for Band 5, Band 6 and Band 7 is \(\mu_{m}=0.3\). The channel attention module generates channel attention maps using the channel relationship between features. Each feature map is achieved by a feature detector, which focuses on meaningful features. The structure of the channel attention module is shown in Figure 6a. Global max pooling and global average pooling are used to compress the spatial dimension of feature maps. The global max pooling and global average pooling can be expressed by Formulas (4) and (5). \[g_{m}=H_{mp}(F_{C})=\max_{(i,j)\in X_{C}}X_{C}(i,j) \tag{4}\]  
\[g_{a}=H_{ap}(F_{C})\frac{1}{H\times W}\sum_{i=1}^{H}\sum_{j=1}^{W}X_{C}(i,j) \tag{5}\]  
\(H_{mp}\) and \(H_{ap}\) perform global max pooling and global average pooling for input feature map \(F_{C}\) of size \(H\times W\). \(X_{C}(i,j)\) is the value of channel \(C\) at \((i,j)\). The size of the feature maps after compression is \(C\times 1\times 1\). Since the feature map contains rich information, we chose Leaky ReLU as the activation function instead of Sigmoid, which is widely used in the attention structure to suppress gradient vanishing. The process of channel attention module is formulated in Formula (6). \[A_{C}=\delta(Conv(\delta(Conv(g_{m})))+Conv(\delta(Conv(g_{a})))) \tag{6}\]  
where \(A_{C}\) is the channel weight of the output. \(\delta\) is Leaky ReLU function, and Conv is \(1\times 1\) convolution. The spatial attention module generates the spatial attention feature map by using the internal spatial relationship between features. It focuses on different spatial information within a feature map. The structure of the spatial attention module is shown in Figure 6b. In the channel dimension, MaxPool and AveragePool are used to aggregate the channel information of the feature map. The processes of MaxPool and AveragePool are formulated in Formulas (7) and (8). \[F_{max}=\max_{C}X(i,j) \tag{7}\]  
\[F_{avg}=avg_{C}X(i,j) \tag{8}\]After obtaining the maximum and average values of each pixel of the input feature map \(X(i,j)\) on the C channels, two cross-channel feature maps of size \(1\times H\times W\) (\(F_{max}\) and \(F_{avg}\)) are generated. Finally, they are concatenated through a convolutional layer into a 2D spatial attention feature map output. The process of spatial attention module is formulated in Formula (9). \[A_{S}=\delta(Conv([MaxPool(F_{S});AvgPool(F_{S})])) \tag{9}\]  
where \(A_{S}\) is the spatial weight of the output. \(\delta\) is Leaky ReLU function, and Conv is \(7\times 7\) convolution.