# Object Detection Using Multi-Scale Balanced Sampling
## 3 Proposed Method
### Multi-Scale Sample Discrimination  
The main factors affecting the sample matching in training process are the scale of the anchor box and the labelling result IOU discrimination threshold. The large difference between the scale of the small object and the anchor box makes match difficult under the existing discrimination conditions. For the sampling process of the positive samples, Figure 2a shows the matching results when default shape of FPN anchor boxes is adopted and the discrimination threshold of IOU\(>0.7\), where the red rectangle indicates the manually marked area containing the object. As it is seen, none of the anchor boxes can be successfully matched with the object area. Therefore, the image is unable to guide the network parameter training because it does not contain any positive sample during the the training process. Figure 2b shows the matching results for the case where the scale of the anchor box is reduced by half. The green rectangle indicates the labeled samples in the training set, and the red rectangle indicates the corresponding matching anchor box, the sample matching results are still far from ideal. For small objects, the default IOU threshold of FPN is a stringent condition, resulting in a poor matching even in the case where the anchor box scale is reduced. Also, the design of the anchor boxes should fully consider the objects in the image data set with different sizes. Therefore, simple reduction of the anchor box scale might, in return, result in matching failure for the object samples with a normal size. Hence, it is hard to improve the object matching probability solely by reducing the scale of the anchor box for detecting small objects. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Input** & **Shape** & **Layer** & **Output** \\ \hline \multirow{8}{*}{ResNet-101} & Image & \(600\times 600\times 3\) & \(conv\_1*1,stride2,64\) & Conv1 \\  & Conv1 & \(300\times 300\times 64\) & \(conv\_3*3,maxpool,stride2,64\) & Pool1 \\  & Pool1 & \(150\times 150\times 64\) & \(\begin{bmatrix}conv\_1*1,64\\conv\_3*3,64\\conv\_1*1,256\\conv\_1*1,128\\conv\_3*3,128\\conv\_1*1,512\\conv\_1*1,256\\conv\_3*3,256\\conv\_1*1,1024\\conv\_1*1,512\\conv\_1*1,512\\conv\_3*3,512\\conv\_1*1,2945\\ \end{bmatrix}\times 3\) & Conv2 \\  & Conv2 & \(150\times 150\times 256\) & \(conv\_3*3,128\\conv\_1*1,512\\conv\_1*1,256\\conv\_3*3,256\\conv\_1*1,1024\\conv\_1*1,512\\conv\_3*3,512\\conv\_1*1,2945\\ \end{bmatrix}\times 4\) & Conv3 \\ \multirow{8}{*}{MB-RPN} & Conv3 & \(75\times 75\times 512\) & \(conv\_3*3,256\) & \(MB-RPN_{2}\) \\  & Conv3 & \(38\times 38\times 512\) & \(conv\_3*3,256\) & \(MB-RPN_{3}\) \\  & Conv4 & \(19\times 19\times 1024\) & \(conv\_3*3,256\) & \(MB-RPN_{4}\) \\  & Conv5 & \(10\times 10\times 2048\) & \(conv\_3*3,256\) & \(MB-RPN_{5}\) \\ \hline \multirow{8}{*}{FineTune} & Pool1 & \(14\times 14\times 128\) & \(conv\_3*3,256\) & \(FineTune_{1}\) \\  & Conv2 & \(28\times 28\times 256\) & \(conv\_3*3,256\) & \(FineTune_{2}\) \\ \cline{1-1}  & Conv3 & \(56\times 56\times 374\) & \(conv\_3*3,256\) & \(FineTune_{3}\) \\ \cline{1-1}  & Conv4 & \(112\times 112\times 512\) & \(conv\_3*3,256\) & \(FineTune_{4}\) \\ \cline{1-1}  & Conv5 & \(224\times 224\times 640\) & \(conv\_3*3,256\) & \(FineTune_{5}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Details of Network. To address the above issue, multi-scale positive sampling approach with dynamic IOU discrimination threshold is proposed. The FPN method has designed five scale-level anchor boxes, namely, A1\(\sim\)A5 according to different scale sizes. According to the scale of anchor boxes, the approach divide three different positive sample intervals from smallest anchor size to the biggest, the criteria for levels of are shown as the follow:  
\[\left\{ \begin{aligned} & small\_positive&:a_{i}\in\{A_{1}\}\\ & medium\_positive&:a_{i}\in\{A_{2},A_{3}\}\\ & big\_positive&:a_{i}\in\{A_{4},A_{5}\}\\ \end{aligned} \right.