# DLMFCOS: Efficient Dual-Path Lightweight Module for Fully Convolutional Object Detection
## 3 Proposed Method
### Loss Function  
The loss function of the proposed method consists of classification, regression, and centrality types. Focal loss [24], generalized intersection over union (GIoU) [25], and center loss are used, respectively. The purpose of classification loss is to mitigate the increased recall in object detection resulting from the imbalanced foreground and background sampling. We use focus loss as the classification loss, which improves cross-entropy, as formulated in Equation (8):  
\[Loss_{CE}(p,y)= \begin{cases}-\log(p)&\text{if }y=1\\ -\log(1-p)&\text{otherwise,}\end{cases}  \tag{8}\]  
where \(p\) and \(y\) represent the output value of the network and the ground truth, where the input value is \(p\in\mathbb{R}^{H\times W\times C}\), respectively. The cross-entropy loss function compares the classification value generated by the deep learning model with the correct value and outputs the error. In this case, if cross-entropy is used, the entire loss is dominated by a sample that is relatively easy to classify (easy sample). Therefore, the focus loss provides the needed relative increase in the loss of hard samples by assigning weights to easy samples. Equations (9) and (10) formulate the focus loss:  
\[p_{t}= \begin{cases}p&\text{if }y=1\\ 1-p&\text{otherwise.}\end{cases}  \tag{9}\]  
\[Loss_{Focal}=-\alpha(1-p_{t})^{\gamma}\cdot\log(p_{t}). \tag{10}\]  
where \(p_{t}\) is either the correct or approximately correct value. As this value increases, the loss function becomes smaller compared with the conventional cross-entropy loss function. Conversely, the loss increases as the value gets farther away from correct. If the value is zero, the function becomes the standard cross-entropy function in which the hyperparameters limit the contribution of focus loss. The proposed method uses optimal values \(\alpha=2\) and \(\gamma=0.25\) based on the data analyzed by [PERSON] and [PERSON] [24]. GIoU is used as the regression loss function. The contemporary version uses a smooth L1 loss that regresses the distance between the predicted and correct coordinates. However, calculating a precise regression loss is difficult when the distance is constant. Therefore, the intersection-over-union (IoU) becomes attractive. However, when IoU is used as a regression loss function, if there is no intersection between the predicted coordinates and the  
Figure 8: Detection head structures: (**a**) conventional method, (**b**) the proposed method. C = Conv: convolution. correct answer, or if a large error occurs, the loss may lead to a local minimum. Therefore, the GIoU is constructed as shown in Equation (11):  
\[Loss_{GIoU}=1-\text{IoU}+\frac{|C-B\cup B^{GT}|}{|C|}. \tag{11}\]  
where \(C\) is the smallest bounding box that encompasses the predicted and correct values. This is the area obtained by subtracting the union of the two areas by transforming the warning value and correct answer into the bounding box. The \(1-GIoU\) variant was used, and its maximum value was set to two. The minimum was zero. Finally, we use centerness loss, which weighs whether objects are centered during inference. The centerness loss determines whether an object is centered or not. Therefore, the loss is calculated using binary cross entropy (BCE), a special form of cross entropy. \[Centerness\ =\sqrt{\frac{\min\cap(l^{*},r^{*})}{\max(l^{*},r^{*})}\ \times\ \frac{\min\cap(l^{*},b^{*})}{\max \left(l^{*},b^{*}\right)}}, \tag{12}\]  
In this case, \(l\), \(r\), \(t\), and \(b\) denote the left, right, top, and bottom of the predicted coordinates, respectively. Equation (12) [14]: shows that the center loss approaches one as the predicted bounding box approximates the center; otherwise, it approaches zero. Therefore, the center loss is calculated using binary cross-entropy, which is the binary form of cross-entropy, as shown in Equation (13). \[Loss_{Centerness}(p,y)=-(p\cdot\log y+(1-p)\cdot\log(1-y)). \tag{13}\]  
In this case, \(p\) is the predicted value, and \(y\) is the correct answer value.