# SAR Image Aircraft Target Recognition Based on Improved YOLOv5
## 3 Materials and Methods
### Integration of the Coordinate Attention Module  
In order to avoid the lack of feature extraction capability caused by the use of the SE-Ghost-C3 lightweight network, we aimed to incorporate the attention mechanism with the backbone network of YOLOv5. The SE attention mechanism only pays attention to the interdependencies among the channels, ignoring the spatial information. The BAM [35] and CBAM mechanisms consider both the channel and spatial information, but they only capture local information. We adopted the CA mechanism, which better captures both the channels' relationships and the long-range dependencies with precise positional information [23]. The CA mechanism can be plugged into our networks to improve the accuracy with little additional computing overhead. The structure of the CA mechanism is shown in Figure 3.  
In Figure 3, \(X\) is the input feature map and \(Y\) is the output feature map with weights after the CA operation. In order to capture the precise spatial information, \(X\) is subjected to the \(X\) avg pool and \(Y\) avg pool of each channel to obtain \(z^{h}\) and \(z^{w}\). The formula is as follows:  
\[z_{c}^{h}(h)=\frac{1}{W}\sum_{0\leq i\leq W}x_{c}(h,i) \tag{19}\]  
\[z_{c}^{w}(w)=\frac{1}{H}\sum_{0\leq i\leq H}x_{c}(j,w) \tag{20}\]  
Figure 2: Structure of the Ghost-Conv and SE-Ghost-C3 modules.  
where \(z_{c}^{h}(h)\) represents the output of the \(c\)th channel at height \(h\) and \(z_{c}^{w}(w)\) represents the output of the \(c\)th channel at width \(w\). Moreover, \(z^{h}\) and \(z^{w}\) are concatenated along the spatial dimension and sent into a shared convolution layer \(F_{1}\) with a kernel size of \(1\times 1\) to compress the channels' dimension to obtain \(F\), whose dimension is reduced by r times. Following this, the batch-normalization (BN) operation and the ReLU non-linear activation function are used to obtain \(f\), which is shown as follows:  
\[f=\delta\Big{(}F_{1}\Big{(}\Big{[}z^{h},z^{w}\Big{]}\Big{)}\Big{)} \tag{21}\]  
The feature map \(f\) is divided into two tensors along the spatial dimension to obtain \(f^{h}\) and \(f^{w}\). Then, they are sent separately into the convolution layer \(F_{h}\) and \(F_{w}\) with a kernel size of \(1\times 1\) to recover the original dimensions. Following this, the sigmoid activation function is used to obtain the attention weights \(g^{h}\) and \(g^{w}\), which are shown as follows:  
\[g^{h}=\sigma\Big{(}F_{h}\Big{(}f^{h}\Big{)}\Big{)} \tag{22}\]  
\[g^{w}=\sigma(F_{w}(f^{w})) \tag{23}\]  
Finally, the output \(Y\) of the CA mechanism can be written as follows:  
\[y_{c}(i,j)=x_{c}(i,j)\times g_{c}^{h}(i)\times g_{c}^{w}(j) \tag{24}\]  
Due to the special imaging mechanism of SAR, the scattering points of aircraft targets in SAR images are highly discrete, and the correlation between each aircraft component is weak, as shown in Figure 4a. The environment of the airport is relatively complex, and structures such as vehicles and terminal buildings can easily form stronger scattering spots, which interfere with the scattering of aircraft targets, as shown in Figure 4b. These problems increase the difficulty in recognizing aircraft targets. The CA mechanism can effectively improve the accuracy of recognizing aircraft targets.