## 3 Model Structure
### CSPNet-Attention  
The CSPNet-Attention mechanism, building upon the foundation of the Cross Stage Partial Network (CSPNet) [14], was developed to mitigate the computational demands imposed by extensive inference calculations observed in prior works while also addressing the redundancy of gradient information during the network optimization process. The inception of the Cross Stage Partial Network aimed to harmonize the first and final feature maps of network stages, thereby accommodating gradient variability. CSPNet streamlines the optimization of the F-function (the mapping from the input \(x_{0}\) to target \(y\)) by predominantly integrating feature maps from the initial and terminal stages of the network, thus curtailing computational load. The optimization formula is delineated as follows in Equation (3):  
\[y=M([x_{0^{\prime}},T(F(x_{0^{\prime\prime}}))]) \tag{3}\]  
In the CSPNet-Attention framework, the input \(x_{0}\) is bifurcated into two segments along the channel dimension, represented as \(x_{0}=[x_{0^{\prime}},x_{0^{\prime\prime}}]\), where \(T\) signifies the transition function employed to truncate the gradient flow across \(H_{1}\), \(H_{2}\),..., \(H_{K}\), where \(H_{K}\) refers to the operating function of the \(kth\) layer in a Convolutional Neural Network (CNN). This function usually consists of a set of convolutional layers and a nonlinear activation function. Essentially, \(H_{k}\) represents the computational process within the \(kth\) layer of the network.  
\(M\) represents the transition function designated for amalgamating the bifurcated segments. Given an input within \(R^{L\times d}\), where \(L\) symbolizes the input length and \(d\) the input dimension, it is partitioned by the dimension into \(X=\left[X_{1}^{L\times d_{1}},X_{2}^{L\times d_{2}}\right]\), essentially dividing the input into two components. Here, \(X_{1}\), after transiting through a one-dimensional convolutional layer A, is concatenated at the block's conclusion, while \(X_{2}\) serves as the input to the self-attention block B. The outputs of A and B are concatenated across dimensions to formulate the entire block's output. The output matrix of the first level in the CSPNet-Attention architecture is articulated as follows in Equation (4):  
\[Y=\left[\frac{Y_{1}}{Y_{2}}\right]=\left[\frac{X_{1}W_{c}}{Concat(A(X_{2h})W_{ h})_{h=1}^{H}}\right] \tag{4}\]  
In the CSPNet-Attention framework, \(A(X_{2h})\) signifies the scaled dot product attention within the \(hth\) self-attention block, where \(W_{h}\) represents the \(d_{h}\times d_{h}\) linear projection matrix. Here, \(H\) denotes the number of heads, \(d_{h}\) specifies the dimension of each head, and \(W_{c}\) is the weight matrix for the one-dimensional convolutional layer, with dimensions \(d/2\times d/2\). The formulation updates the weights within CSPNet-Attention as follows in Equation (5):  
\[W_{h}^{\prime}=f(g_{2},W_{h}) \tag{5}\] \[W_{c}^{\prime}=f(g_{1},W_{c})\]  
In this framework, \(f\) represents the weight update function, while \(g\) signifies the gradient propagated along the \(ith\) path. Notably, the network integrates the gradient of the segmented part independently, illustrating a distinct approach to gradient processing within the network.  
The overall network architecture of CSPNet-Attention is shown in Figure 3 below:In this network architecture, a bifurcation splits the input along its dimensionality. A self-attentive block, having half the input's dimensionality, processes the left segment. Meanwhile, a \(1\times 1\) convolutional layer directly routes the right segment to the end of the entire block.