## 4 Improved Faster-RCNN Algorithm
### Prior Bounding Box Design for the Receptive Field Area in FPN  
The receptive field is the size of the image input layer corresponding to an element in the feature map of the convolutional neural network. The size of the receptive field directly determines the range of information obtained by the feature network on the original image. The range of the theoretical receptive field is much larger than the effective receptive field. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Backbone** & **Layers** & **Parameters** & **Size (M)** \\ \hline Resnet50 & 3 4 6 3 & 25,557,032 & 97.49 \\ Resnext50 & 3 4 6 3 & 25,028,904 & 95.48 \\ Resnext50 & 3 4 6 2 & 20,531,496 & 78.32 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Comparison of network data. Figure 4: The relationship between prior bounding box and receptive field. Figure 3: Resnet50 and Resnext50 structure diagram. As shown in Figure 4, the effective receptive field that plays a real role only accounts for a part of the theoretical receptive field. The influence of the effective information in the receptive field on the output results is Gaussian distribution [18]. The information in the target detection center often occupies the peak position of the Gaussian distribution. Therefore, the design of the prior bounding box should be adapted to the effective receptive field. The size of the detection will directly affect the regression effect of the prior bounding box. A size too large or too small will cause the prior bounding box to deviate from the position of the original real frame, thereby reducing the detection precision. In order to design a prior bounding box that is truly suitable for the effective receptive field, it is necessary to first calculate the size of the receptive field of the feature maps of each layer. The formula for calculating the receptive field is as follows:  
\[ \begin{array}{l}f(n)=(f(n+1)-1)\times\textit{stride}+\textit{ksize}\\ f(n)\ :\ N_{\textit{th}}\ \textit{receptive}\ \textit{filed}\\ \textit{stride}\ :\ N_{\textit{th}}\ \textit{layer}\ \textit{step}\\ \textit{ksize}\ :\ \textit{size}\ \textit{of}\ \textit{convolution}\ \textit{kernel}\ \left(\textit{pooled}\ \textit{kernel}\right)\end{array}  \tag{6}\]  
According to the clustering results of Kmeans, this paper designed FPN [19] into four layers, and its structure is shown in Figure 5. Each layer corresponds to a type of prior bounding box. Here, the P2 layer of FPN is used as an example to illustrate how to reasonably design the size of the prior frame according to the calculated receptive field. P2-P5 in Figure 5 correspond to the predictions of the four prior bounding boxes, respectively. Since the second convolution layer of P2 uses a 3 \(\times\) 3 convolution and a convolution kernel has a stride of 1, the node of the current prediction feature layer, the input area mapped to the previous layer has a size of 5 \(\times\) 5, and then passes through a 1 \(\times\) 1 convolution kernel with a stride of 1. The upper-level input is 3 \(\times\) 3, which is located on the top layer of the feature network input. The size of the receptive field is 43 \(\times\) 43. Therefore, P2's theoretical receptive field is 43 \(\times\) 43. The receptive field of this layer is larger than the minimum UAV size and can be used to detect UAVs. P2 is the smallest receptive field. Therefore, effective receptive fields of the other three layers of FPN also meet the requirements. The average size of the UAV in this paper is 16\({}^{2}\) or so, and the bottom layer of FPN has smaller target features. Thus, the minimum prior bounding box is designed to be the average size of the drone, to make full use of the low-level information to detect as many small drone targets as possible and calculate the size of all layers. After the receptive field, this paper set the prior bounding box size to four categories: 16\({}^{2\(64^{2}\), and \(128^{2}\) to ensure that drones of each size can be selected.