## 2 Target Detection Method
### The Development History of Faster R-CNN  
R-CNN is a milestone in the application of the CNN method to the target detection problem. It was proposed by RBG in 2014. Based on the good feature extraction and classification performance of CNN, the target detection problem is transformed through the method of Region Proposal. The steps of using R-CNN for target detection are listed as follows:  
1. Input the image;
2. Use the selective search algorithm to extract about 2000 Region Proposals, from top to bottom, in the image;
3. Warp each Region Proposal to a size of 227 \(\times\) 227 and input it to the CNN. The output of the fc7 layer is used as a feature;
4. Input the CNN features extracted by each Region Proposal into SVM for classification;
5. Perform border regression for the Region Proposal classified by SVM, and use the bounding box regression value to correct the original suggestion window. Generate prediction window coordinates. On the Pascal VOC 2012 data set, R-CNN increased the verification index map for target detection to 53.3%, which is a full 30% improvement over the previous best results. However, R-CNN also has some obvious problems: fine-tuning the network + training SVM + training frame regressor, the steps are very cumbersome, and training is time-consuming, occupying a large space, using GPU to accelerate the VGG16 [19] model to process an image requires 47 s, and the CNN features are not learned and updated during the support vector machine (SVM) and regression process. In response to these problems of R-CNN, in 2015, fast R-CNN [20] was improved on the basis of R-CNN. Compared with R-CNN, the main difference of fast R-CNN is that a RoI pooling layer is added after the last convolutional layer to make each suggestion window generate a fixed-size feature map. The loss function uses a multi-task loss function (multi-task loss). The bounding box regression is directly added to the CNN network for training, and the target classification and bounding box regression are corrected at the same time after the fully connected layer. Its target detection steps are listed as follows:  
1. Input the image;
2. Use the selective search algorithm to extract 2000 or so proposal windows (Region Proposals), from top to bottom, in the image;
3. Input the entire picture into CNN for feature extraction;
4. Map the suggestion window to the last layer of the convolutional feature map of CNN;
5. Use the RoI pooling layer to generate a fixed-size feature map for each suggestion window;
6. Use Softmax Loss (probability of detection classification) and Smooth L1 Loss (bounding box regression) as a joint training for classification probability and bounding box regression. Fast R-CNN normalizes the entire image, sends it directly to the CNN, and adds suggestion box information to the feature map output by the final convolutional layer, so that the previous CNN operations can be shared and the test speed is accelerated. During training, only one image needs to be sent to the network. Each image extractsCNN features and suggested regions at one time. The training data is directly entered into the loss layer in the GPU memory, so that the first few layers of features in the candidate region do not need to be recalculated, thus improving the speed of training; fast R-CNN implements both category judgment and location regression using deep networks, so no additional storage is needed; thus, memory space is saved. Because of the proposal of RoI pooling, there is no need to input for corp and wrap operations, thereby avoiding pixel loss and cleverly solving the problem of scale scaling. Although fast R-CNN has made a big leap in speed, it still takes more than 2 s to detect a picture, which cannot meet the requirements from time to time. This is mainly because it consumes a lot of time during the region proposal stage and does not run well on the GPU. For this reason, faster R-CNN [6] was proposed in 2017, and it has two main differences from fast R-CNN.