# KCFS-YOLOv5: A High-Precision Detection Method for Object Detection in Aerial Remote Sensing Images
## 3 Improvements of the KCFS-YOLOv5
### Coordinate Attention Module  
The attention mechanism module converges the algorithm vision through the network adaptive update weight and information screening [30]. The algorithm used in the present research, The Coordinate Attention (CA) [42] modules is embedded in the bottom of the backbone network of YOLOv5. The CA module is built as depicted in Figure 4. The feature representation of objects in various environments can be enhanced with the help of these modules. CA is a convolutional attention mechanism that combines the channel attention and position information, which realizes attention extraction in different dimensions of channel and space of feature maps. In contrast to channel attention, which uses two-dimensional global pooling to convert the input into a single feature vector, CA disassembles the channel attention into one-dimensional features in two distinct directions. The input feature map  
Figure 4: The conventional Coordinated Attention module. Figure 3: The process of generating subsequent cluster centers. is a tensor of arbitrary size X = [\(x_{1}\), \(x_{2}\), \(\cdots\), \(x_{C}\)] where \(C\) is the number of channels in the feature map, H is the height of the feature map, and W stands for the width of the feature map. First, an average pooling kernel measuring (1, \(W\)) and (\(H\), 1) is used to encode each channel in horizontal and vertical coordinates, respectively. At height \(h\) and width \(w\), the outputs of the \(c\)-\(th\) channel are formulated as follows:  
\[z_{c}^{h}(h)=\frac{1}{W}\sum_{0\leq i\leq W}x_{c}(h,i) \tag{4}\]  
\[z_{c}^{w}(w)=\frac{1}{H}\sum_{0\leq i\leq H}x_{c}(j,w) \tag{5}\]  
These two transformations result in feature fusion in the height and width directions of the space. The convolution kernel which has size one is used to transform the two feature maps, and an intermediate feature map \(f\in\mathbb{R}^{C/r\times(H+W)}\) containing both horizontal and vertical spatial information is generated. The formula is shown below:  
\[f=\delta(F_{1}([z^{h},z^{w}])) \tag{6}\]  
where \(r\) is the ratio of Down-sampling. Second, the spatial dimension of the middle feature map \(f\) will be divided into two distinct tensors, \(f^{th}\) and \(f^{w}\). Furthermore, a convolution kernel which has size one will be used to convert the two processed feature maps \(f^{w}\) and \(f^{h}\) to the same number of channels as X, as given by:  
\[g^{h}=\sigma(F_{h}(f^{h})) \tag{7}\]  
\[g^{w}=\sigma(F_{w}(f^{w})) \tag{8}\]  
where \(\sigma\) is the activation function called sigmoid. The processed feature map \(f^{h}\) and \(f^{w}\) will be generalized as the attention weight of the system, and the final output is given by:  
\[y_{c}(i,j)=x_{c}(i,j)\times g_{c}^{h}(i)\times g_{c}^{w}(j) \tag{9}\]  
Coordinate attention integrates more location information and semantic information on the previous attention mechanism such as CBAM, so that the network can learn the feature map and achieve higher detection accuracy in the multi-size object detection task. Here, the CA module is inserted into the bottom of the backbone network to strengthen the capabilities of the backbone network to extract and learn semantic features of different dimensions. This structure can make the backbone network better obtain the pre-training weight, and Figure 5 displays the model comparison results. As Figure 5 shows, the colors of different regions indicate the degree of the attention module in the network to different positions of the image. The more the color tends to blue, the higher the attention of the network to the region. From the results, adding the CA module enhances the capability of feature extraction of the object in deep network. Aiming at the distribution characteristics of tiny objects and important location information in the aerial remote sensing images. Based on the conventional feature extraction network, more location information and semantic information are retained in the specific multi-size object feature extraction, which lays the foundation for the subsequent detection process.