# Single-Shot Object Detection with Split and Combine Blocks
## 3 Method
### Dense Predictions  
We use feature maps \(\{F_{3},F_{4},F_{5}\}\) with downsampling strides of 8, 16, and 32 compared to the input to predict the bounding box. The method of bounding box regression draws on a variety of novel ideas from recent works. For each level, the network finally outputs feature maps \(\widehat{Y}\in C\times H\times W\). The input image is divided into H \(\times\) W grids; one grid is responsible for one object. Evaluated on an COCO dataset, we set \(C=84\) including four offsets \(t_{x}\), \(t_{y}\), \(t_{w}\), \(t_{h}\), and 80 object categories. The highest category score of each prediction bounding box is used to represent the confidence, thus simplifying the calculation. For each bounding box, the center point coordinate, width, and height are as follows:  
\[\begin{cases}b_{x}=\sigma(t_{x})+x\\ b_{y}=\sigma(t_{y})+y\\ b_{w}=w\times e^{t_{w}}\\ b_{h}=h\times e^{t_{h}}\end{cases} \tag{3}\]  
The center coordinate is limited at a certain grid by _sigmoid_ function \(\sigma\), \((x,y)\) donates the coordinate of the upper left corner of the grid, the \(w\), \(h\) are the width and height of anchor box which is generated by guided anchoring mechanism [36]. During training and test, we assign an anchor box to each grid. For instance, if input resolution is \(416\times 416\), the number of proposal is \(416/32\times 416/32+416/16\times 416/16+416/8\times 416/8=3549\).  
Figure 5: Illustration of network design. (**a**) PANet; (**b**) our SC-PANet; (**c**) our SC-fusion block.  
We extract the center point coordinates of the ground truth onto feature maps \(Y\in 80\times H\times W\) and refer the ground truth centers as positive locations, and all others are negative. However, such a simple distinction mechanism can cause a huge imbalance between positive and negative samples, which has an adverse effect on network training. Therefore, we attempt to alleviate this problem by redefining positive and negative samples during training [37]. As shown in Figure 6, the locations close to the ground truth center can still generate high-quality bounding boxes, and we think these boxes can also contribute to the network leaning. A fraction of negative locations are defined as candidate locations, and the boundary boxes generated by these positions incorporate the calculation of the gradient. These candidate locations are near the positive locations, and theoretically can generate a high-quality bounding box which has at least 0.7 intersection over union (IoU) with the ground truth box. For each object, the maximum \(L2\) distance between candidate location and ground truth center is indicated by \(r\), which is closely related to ground truth size. A set of cosine decay confidences are assigned to these candidate locations:  
\[confidence=cos(0.5\pi\times\frac{d}{r}) \tag{4}\]  
where the \(d\) is the \(L2\) distance between candidate locations and ground truth center. These confidences are placed on feature maps \(Y\), and take the maximum in the overlapping part of adjacent candidate locations with the same class, if overlaps occur. The category loss function is as follows:  
\[L_{c}=\sum\begin{cases}(1-\widehat{Y}_{80})^{\alpha}log(\widehat{Y}_{80})& if\ Y=1\\ (1-Y)^{\beta}(\widehat{Y}_{80})log(1-\widehat{Y}_{80}),&otherwise\end{cases} \tag{5}\]  
where \(\alpha=2\) and \(\beta=4\) are hyper-parameters of the focal loss, \(\widehat{Y}_{80}\) is category prediction of feature maps \(\widehat{Y}\), and the \((1-Y)\) attracts more attention from the network on hard examples. The offsets \(t_{x}\), \(t_{y}\) are trained with a binary cross entropy loss function, and \(b_{w}\), \(b_{h}\) are trained with an \(L1\) loss. Furthermore, a Generalized Intersection over Union (GIoU) [38] loss function is exploited to better optimize the regression of bounding box, especially in the extreme case of no overlap. Aggregate all parts to form the overall training objective.