## 2 Materials and Methods
### Improved Loss Function of CSPD-YOLO Model  
Intersection over union (IoU) is one of the most commonly used evaluation criteria for current deep neural networks, denoted by the overlap ratio between the predicted box and the ground truth. The complete intersection over union (CIoU) [50] was adopted to replace mean square error in this paper, and the loss function of CSPD-YOLO model was defined in Formula (3), which was divided into three parts: the CIoU loss function \(L_{\text{CIoU}}\), confidence loss function \(L_{\text{conf}}\), and classification loss function \(L_{\text{cls}}\). The CIoU loss function \(L_{\text{CIoU}}\), confidence loss function \(L_{\text{conf}}\), and classification loss function \(L_{\text{cls}}\) are defined in Formulas (4)-(6), respectively.  
\[L_{\text{OSS}} =L_{\text{CIoU}}+L_{\text{conf}}+L_{\text{cls}} \tag{3}\] \[L_{\text{CIoU}} =1-IoU+\frac{\rho^{2}}{m^{2}}+\alpha\cdot v\] (4) \[\alpha =\frac{\rho}{(1-IoU)+\
u}\] \[v =\frac{4}{n^{2}}(\arctan\frac{\varpi}{h}-\arctan\frac{\varpi}{h})\] \[L_{\text{conf}} =\sum\limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{B}10^{bj}_{ij}[C_{ ij}\cdot\log\bigl{(}\overline{C}_{ij}\bigr{)}+\bigl{(}1-C_{ij}\bigr{)}\cdot\log \bigl{(}1-\overline{C}_{ij}\bigr{)}]\] (5) \[+\lambda_{nobv}\sum\limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{B}1^{ nobj}_{ij}\bigl{[}C_{ij}\cdot\log\bigl{(}\overline{C}_{ij}\bigr{)}+\bigl{(}1-C_{ij} \bigr{)}\cdot\log\bigl{(}1-\overline{C}_{ij}\bigr{)}\bigr{]}\]  
Figure 5: The structure of feature pyramid network.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Feature Layer** & **Type** & **Filters** & **Size** & **Output** \\ \hline \multirow{3}{*}{3\(\times\)} & \multirow{3}{*}{Large} & Convolutional & 128 & \(1\times 1/1\) & \multirow{3}{*}{} \\  & & Convolutional & 256 & \(3\times 3/1\) & \\  & & Residual & & & 256 \(\times\) 52 \(\times\) 52 \\ \hline \multirow{3}{*}{3\(\times\)} & \multirow{3}{*}{Medium} & Convolutional & 256 & \(1\times 1/1\) & \multirow{3}{*}{} \\  & & Convolutional & 512 & \(3\times 3/1\) & \\  & & Residual & & & 512 \(\times\) 26 \(\times\) 26 \\ \hline \multirow{3}{*}{3\(\times\)} & \multirow{3}{*}{Small} & Convolutional & 512 & \(1\times 1/1\) & \multirow{3}{*}{} \\  & & Convolutional & 1024 & \(3\times 3/1\) & \\ \cline{1-1}  & & Residual & & & 1024 \(\times\) 13 \(\times\) 13 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The parameters of three residual units.  
\[L_{\text{cls}}=\sum_{i=0}^{S^{2}}1_{ij}^{obj}\sum_{c\in class}\left[P_{ij}(c) \cdot\log\left(\overline{P}_{ij}(c)\right)+\left(1-P_{ij}(c)\right)\cdot\log \left(1-\overline{P}_{ij}(c)\right)\right] \tag{6}\]  
Specifically, in Formulas (3)-(6), \(S^{2}\) denotes the number of grids in the image, and B refers to the number of bounding boxes generated by each grid. \(\rho^{2}\) is the Euclidean distance between the center point of the predicted box and ground truth, and \(m\) is the diagonal distance of the smallest closure area that contains both the predicted box and the ground truth. \(\left(\overline{w},\overline{h}\right)\) is the width and height of the predicted box, and \(\left(w,h\right)\) is the width and height of ground truth. \(1_{ij}^{obj}\) denotes whether an object falls in the \(j\)th predicted box of grid \(i\). \(\overline{C}_{ij}\) and \(C_{ij}\) are the predicted confidence and true confidence, and \(\overline{P}_{ij}(c)\) and \(P_{ij}(c)\) are the predicted probability and true probability of object classification, respectively.