## 3 Proposed Method
### Channel and Spatial Attention Module  
In foggy weather adaptive detection, there is noisy interference contained in extensive coverage areas, mainly from the fog itself. Extracting the attention region can help our model to resist the interference of the noisy information and focus on the useful objects. In object detection, both the category and localization accuracy of the object are important for the final detection result. The channel attention mechanism is mainly used to inform the network about what needs attention, while the spatial attention mechanism is mainly used to inform the network where attention is needed. Therefore, we propose to add the convolutional block attention module [25] into the Backbone; the structure is shown in Figure 3.  
We defined the input features as \(F\in\mathbb{R}^{C\times H\times W}\) and the final refined features as \(F^{\prime\prime}\in\mathbb{R}^{C\times H\times W}\). The channel attention was denoted as \(M_{c}\), and the channel attention formula is shown in Equation (2). Firstly, the input feature was passed through two parallel _MaxPool_ layers and _AvgPool_ layers, which changed the feature from \(C\times H\times W\) to \(C\times 1\times 1\); then, it was passed through the shared Multilayer Perceptron (MLP) module. The two postactivation results were obtained in the MLP module. The two results were summed element by element to obtain the output of the channel attention using the sigmoid function \(\sigma\). The output result was multiplied by the original, which changed the feature map size back to \(C\times H\times W\).  
\[M_{c}(F)=\sigma(MLP(AvgPool(F))+MLP(MaxPool(F)))=\sigma(W_{1}(W_{0}(F_{avg}^{c }))+W_{1}(W_{0}(F_{max}^{c}))), \tag{2}\]  
Figure 3: The channel and spatial attention module.  
where \(F^{c}_{avg}\) and \(F^{c}_{max}\) denoted the average-pooled features and max-pooled features, respectively. \(W_{0}\in\mathbb{R}^{C/r\times C}\) and \(W_{1}\in\mathbb{R}^{C\times C/r}\) were shared for both inputs, and the ReLU activation function was followed by \(W_{0}\); \(r\) was the reduction ratio.  
Then, the spatial attention was denoted as \(M_{s}\), and its formula as shown in Equation (3). The output of the channel attention was pooled to obtain two \(1\times H\times W\) feature maps and was then spliced by a Concat operation. The spliced output was converted into a 1-channel feature map by the convolution operation \(f\); then, the spatial attention feature was obtained using the sigmoid function \(\sigma\). The output result was multiplied by the original, which changed the feature map size back to \(C\times H\times W\).  
\[M_{s}(F)=\sigma(f[AvgPool(F);MaxPool(F)]=\sigma(f[F^{s}_{avg};F^{s}_{max}]), \tag{3}\]  
where \(f\) represented a convolution operation with a filter size of \(7\times 7\).  
Finally, the attention process of the convolutional block attention module can be summarized as shown in Equation (4):  
\[\begin{split} F^{\prime}&=M_{c}(F)\otimes F\\ F^{\prime\prime}&=M_{s}(F^{\prime})\otimes F^{ \prime},\end{split} \tag{4}\]  
where \(\otimes\) denotes the element-by-element multiplication. \(F\) denotes the intermediate feature as input; \(F^{\prime}\) denotes the channel-refined feature; and \(F^{\prime\prime}\) denotes the final refined feature.