## 2 Methods
### Multitask Loss Function  
We use a multitask loss function \(Loss_{total}\) to train FENet. The total loss is defined as a weighted sum of the classification loss (\(Loss_{cls}\)), the localization loss (\(Loss_{loc}\)), and center-ness loss (\(Loss_{centness}\)).  
\[Loss_{Total}=\lambda_{1}\;Loss_{cls}+\lambda_{2}\;Loss_{loc}+\lambda_{3}\;Loss _{centness}, \tag{7}\]  
where \(\lambda_{1}\), \(\lambda_{2}\), and \(\lambda_{3}\) are the balance parameters between each task loss. In this study, we set \(\lambda_{1}=\lambda_{2}=\lambda_{3}=1.0\). The center-ness loss \(Loss_{centness}\) is the cross-entropy loss used in FCOS.  
The classification loss \(Loss_{cls}\) is the focal loss [36], defined as:  
\[Loss_{cls}(p)=-\alpha_{t}(1-p_{t})^{\gamma}\log(p_{t}), \tag{8}\]  
\[p_{t}=\left\{\begin{array}{ccc}p&if\;\;label=1\\ 1-p&otherwise\end{array}\right., \tag{9}\]  
where \(\alpha_{t}\in[0,\;1]\) is a balance factor between positive and negative samples, \(\gamma\in[0,\;5]\) is a focusing parameter for easy and hard samples.  
_IoU_ loss is commonly used for bounding box regression, but it could not accurately reflect the degree of overlap between predicted box and ground-truth box [23]. As shown in Figure 5a,b, the _IoU_ of the ground-truth box and the predicted box cannot reflect the validity of the detection under the same value of _IoU_. Complete-_IoU_ (CIoU) loss can indicate the relationship between the ground-truth and predicted box by calculating the distance of the two box centers [37]. Figure 5c,d show the situation that the incorrectly predicted box results in a smaller loss. The red box represents the predicted box \(b^{pred}\), and the green box represents the ground-truth box \(b^{st}\). \(d\) denotes the distance of center of \(b^{pred}\) and \(b^{st}\), and \(c\) denotes the diagonal length of the smallest enclosing box that covers \(b^{pred}\) and \(b^{st}\). When \(d\) is unchangeable, the ratio of \(d\) and \(c\) in Figure 5c is higher than that in Figure 5d, which means that the predicted box in Figure 5d is better than that in Figure 5d. Obviously, the model cannot recognize the optimal prediction box in this case.  
Figure 5: Illustration of CIoU loss. CIoU loss takes the _IoU_, distance of centers, and aspect ratio into consideration and is conducive to model training. (**a**,**b**) indicate that the relationship of ground-truth box and predicted box in different cases can be evaluated by calculating the distance of the two box centers; (**c**,**d**) illustrate that the detection results can be evaluated by the aspect ratio when the distance of centers is unchangeable.  
CIoU loss can be used to evaluate the quality of the predicted box according to the aspect ratios. Therefore, we use CIoU loss for bounding box regression, which has taken into consideration three geometric parameters simultaneously.  
\[Loss_{loc}=1-IoU+\frac{\rho^{2}\Big{(}center^{bprat},\ center^{bgt}\Big{)}}{c^{2}}+ \alpha\upsilon, \tag{10}\]  
\[v=\frac{4}{\pi}\Big{(}arctan\frac{wgt}{hs^{gt}}-arctan\frac{w}{h}\Big{)}^{2} \tag{11}\]  
\[a=\frac{v}{(1-IoU)+v} \tag{12}\]  
where \(center^{bprat}\) and \(center^{bgt}\) denote the center points of predicted boxes and ground-truth boxes, respectively. \(\rho(\cdot)\) denotes the Euclidean distance of the two points and \(\upsilon\) measures the consistency of the box aspect ratio and \(\alpha\) is a trade-off parameter.