# AspectNet: Aspect-Aware Anchor-Free Detector for Autonomous Driving
## 3 Proposed Method
### Sample Definition Method  
The single-stage detector has always been plagued by the imbalance of positive and negative samples. The reason that the accuracy of the two-stage detector is higher than that of the single-stage detector is because the two-stage detector uses RPN or other selection methods in the early stage to alleviate the imbalance of positive and negative samples. The performance gap between anchor-free and anchor-based detectors is caused by the difference in the sample definition method of positive and negative samples. Therefore, selecting an appropriate method for determining positive and negative samples is the key to designing object detectors. Most center-based anchor-free methods select one ground truth center point as a positive sample or select all points in the ground truth box as positive samples. The former causes serious imbalance problems, whereas the latter causes the model to focus too much on complex samples, which results in the loss being unstable  
Figure 4: Unstable traffic object detection. Bounding boxes with different aspect ratios can make the decision module make wrong judgments. For example, the monocular ranging algorithm obtains different results and affects the decision of automatic emergency braking.  
and difficult to decrease. In this paper, a sample definition method is proposed based on a center-based anchor-free detector for object detection tasks in autonomous driving.  
All ground truth center points \(p=\left(\frac{x_{1}+x_{2}}{2},\frac{y_{1}+y_{2}}{2}\right),\ x_{i}\in\mathbb{R},\ y_{i}\in \mathbb{R}\) are mapped to a heatmap \(Y\in[0,1]^{\frac{W}{K}\times\frac{H}{K}\times C}\), where \(W\) and \(H\) are the width and height of the input image \(I\in\mathbb{R}^{W\times H\times 3}\), respectively, \(R\) is a down-sampling factor, and \(C\) is the number of categories that use an aspect-aware Gaussian kernel \(Y_{xyc}\) given as follows and demonstrated in Figure 5:  
\[Y_{xyc}=\exp\left(-\frac{2h^{2}\left(x-\widetilde{p}_{x}\right)^{2}+2w^{2} \left(y-\widetilde{p}_{y}\right)^{2}}{\left(wh\sigma_{p}\right)^{2}}\right), \tag{3}\]  
where \(\sigma_{p}\) is an object size-adaptive standard deviation, \(w\) and \(h\) are the width and height of the object bounding box, respectively, and \(\widetilde{p}=\left|\frac{p}{K}\right|\) is a low-resolution equivalent of each ground truth center point \(p=\left(\frac{x_{1}+x_{2}}{2},\frac{y_{1}+y_{2}}{2}\right)\). \(Y_{xyc}\) represents the degree of influence of this point on the center point of the object. \(Y_{xyc}=1\) corresponds to the center point of the object, whereas \(Y_{xyc}=0\) is the background. Positive samples are defined as the points \(Y_{xyc}\geq\tau_{1}\) and negative samples as the points \(Y_{xyc}\leq\tau_{2}\). Points \(\tau_{2}<Y_{xyc}<\tau_{1}\) are ignored sample points, where \(\tau_{1}\) and \(\tau_{2}\) are hyperparameters that control the number of positive samples. In this paper, \(\tau_{1}=0.5,\ \text{and}\ \tau_{2}=0.1\) are chosen. By proposing the positive sample area, the ignored sample area, and the negative sample area, our model can effectively pay attention to the relationship between the features of the object itself and the background without paying too much attention to the edges of the object, which can also avoid the overfitting of object bounding box edges. The definition of positive samples is also related to the aspect ratio of objects, making the sample definition method more efficient and concentrated. Thus, the problem of the positive and negative sample imbalance can be alleviated.