## 2 Methods
### SA Attention Mechanism  
The SA attention mechanism can allocate the limited computing resources to the section with the highest amount of information in the image, which can gather the attention of the network model from the recognized object and reduce the influence of the image background better. Therefore, the SA module was introduced to enhance the attention of the network, highlight the key features, and improve the detection accuracy of the algorithm under the conditions of low illumination, target occlusions, and small targets.  
In neural network learning, there are mainly two kinds of attention mechanisms: channel and spatial. The Convolutional Block Attention Module (CBAM) [36] combines channel and spatial attention mechanisms to achieve a better performance; however it produces a high amount of computation and is difficult to converge. The SA attention module uses a shuffle unit to simultaneously combine channel and spatial attention mechanisms. As shown in Figure 6, feature graph \(X\) with an input size of \(H\)\(\times\)\(W\)\(\times\)\(C\) is divided into g groups along the channel size, where g utilizes 64 to obtain the matrix [\(X_{1}\),..., \(X_{\text{g}}\)], and then divides each feature graph \(X_{\text{k}}\) (\(X_{\text{k}}\) size is \(H\)\(\times\)\(W\)\(\times\)\(C\)/g) into \(X_{\text{k}1}\), \(X_{\text{k}2}\) (\(X_{\text{k}1}\) and \(X_{\text{k}2}\) sizes are both \(H\)\(\times\)\(W\)\(\times\)\(C\)/2g) along the channel; \(X_{\text{k}1}\) and \(X_{\text{k}2}\) are processed by channel and spatial attention mechanism, respectively. Channel attention begins with Global Average Pooling (\(GAP\)), utilizing the following expression:  
\[s=GAP(X_{\text{k}1})=\frac{1}{H\times W}\sum_{i=1}^{H}\sum_{j=1}^{W}X_{\text{k} 1}(i,j) \tag{9}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Input Size** & **Type** &
\begin{tabular}{c} **Output Channel** \\ **Number** \\ \end{tabular} & **Stride** \\ \hline \(416\times 416\times 3\) & Conv \(3\times 3\) & 32 & 2 \\ \(208\times 208\times 32\) & Block1 & 16 & 1 \\ \(208\times 208\times 16\) & Block2 & 24 & 2 \\ \(104\times 104\times 24\) & Block1 & 24 & 1 \\ \(104\times 104\times 24\) & Block2 & 32 & 2 \\ \(52\times 52\times 32\) & Block1 & 32 & 1 \\ \(52\times 52\times 32\) & Block1 & 32 & 1 \\ \(52\times 52\times 32\) & Block1 & 64 & 1 \\ \(52\times 52\times 64\) & Block1 & 64 & 1 \\ \(52\times 52\times 64\) & Block1 & 64 & 1 \\ \(52\times 52\times 64\) & Block1 & 64 & 1 \\ \(52\times 52\times 64\) & Block2 & 96 & 2 \\ \(26\times 26\times 9 Then, continue with the scale operation, use parameter scaling \(W_{1}\) and move channel vector \(b_{1}\), and finally continue with the activation function \(\sigma\) processing:  
\[X^{\prime}{}_{k1}=\sigma(W_{1}s+b_{1})\cdot X_{k1} \tag{10}\]  
The spatial attention operation first performs the Group Norm (GN) and then performs the same operation as the channel attention mechanism. The specific expression is as follows:  
\[X^{\prime}{}_{k2}=\sigma(W_{2}\cdot GN(X_{k2})+b_{2})\cdot X_{k2} \tag{11}\]  
Finally, channel and spatial attention mechanism are fused, so that there are two-directional attention mechanisms on each divided feature graph, and the divided feature graph is shuffled to realize the flow of cross-group information along the channel dimension.