# Object Detection Network Based on Feature Fusion and Attention Mechanism
## 3 Methods
### Faster R-CNN Detector  
Faster R-CNN combines the feature extraction net, region proposal net, and classification and regression into a network. Recently, many methods have been proposed based on Faster R-CNN. Figure 4 illustrates the Faster R-CNN architecture.  
From Figure 4 we can see that Faster R-CNN architecture contains four main modules:  
_Feature extraction network._ Faster R-CNN uses the VGG-16 net to generate convolution feature maps. We know that Faster R-CNN supports any size of input images because the images are normalized before entering the network. We assume that the normalized image size is m\({}^{*}\)n. After the convolution layers in the VGG-16 net, the size of the image changes to (m/16) \(\times\)(n/16). The convolution feature map is (m/16) \(\times\) (n/16) \(\times\) 512, which is shared for the region proposal network (RPN) and fully connected layers.  
_Region Proposal Network (RPN)._ R-CNN and Faster R-CNN use selective search (SS) as external modules independent of the object detection architecture. Object proposal methods include methods  
Figure 4: The architecture of Faster R-CNN. Faster R-CNN combines feature extraction net, region proposal net, and classification and regression into a network.  
Figure 3: The process of padding. The size of the input image is \((\mathrm{M}\times\mathrm{N})\). After padding(pad=1), the image size becomes \((\mathrm{M}+2)\times(\mathrm{N}+2)\).  
based on grouping super-pixels [30] and methods based on sliding windows [31]. Faster R-CNN uses the region proposal network (RPN) to generate detection proposals. The anchor mechanism is the most important part of RPN. An anchor is centered at the sliding window in question. Multiple scale windows are required due to different object sizes and length to width ratios. The anchor gives a reference window size that different sizes of windows are obtained in three scales and three aspect ratios. In the region proposal network (RPN), the feature map convolutes with a 3 \(\times\) 3 sliding window first. Then, the output divides into two ways by the 1 \(\times\) 1 convolution kernel. The softmax function is used to classify anchors (foreground or background). The offset of anchors' bounding box regression can also be obtained to get the precise proposal. The two network branches are combined to obtain the proposal regions.  
_ROI (Region Of Interest) Pooling._ The RoI pooling layer obtains a fixed size of the proposal feature map using the proposal regions and feature map in the RPN and VGG-16.  
_Classification and regression._ The proposal feature map calculates the probability vector, which represents the category of proposals by the full connect layer and softmax function. Additionally, it obtains the position offset to get a more accurate proposal by using bounding box regression.  
The steps of Faster R-CNN are as follows:  
1. Input test image;
2. Extract about a 2000 proposal region from the image using the selective search algorithm;
3. Input the image into the VGG-16 net for feature extraction;
4. Mapp the proposal region to the feature map;
5. Generate a fixed size feature map in the RoI pooling layer; and
6. Perform classification and bounding box regression.