# Person Search via Deep Integrated Networks
## 3 Overview of the Deep Integrated Networks for Person Search
### Pedestrian Detection Network
#### 3.1.2 Region Proposal Network  
One important step for object detection algorithms is to predict where the object appears. Not only the location but also the object scale is diverse, and a pyramid was used to detect objects with various sizes by repeatedly smoothing and subsampling the original image. In [67], a sliding window was applied to classify whether or not an object exists. However, if the following classification algorithm is complex, processing and classifying each sliding window will be time-consuming. Hence, in [68], a selective search [69; 70] was used to predict the object location; however, the improvement was limited. In [35], a network called RPN (Figure 2) was proposed. The RPN can predict the object coordinate. It consists of one \(3\times 3\) convolution layer in the front of the network and receives the feature map from the output of the fifth sharing convolutional layer. The feature maps with the size of \(\mathrm{W}\times\mathrm{H}\) pixels were assumed after the input was processed by the \(3\times 3\) convolution layer. The \(k\) multiple rectangles (\(k=9\) in the experiments) with aspect ratios of \(0.5\), \(1\) and \(2\) are sliding for each pixel in the feature map, meaning that objects with different sizes may be detected. Two branches of the RPN were designed: the network branch, which classifies whether the rectangle contains the object, and the regression branch, which estimates the transformation parameters for each rectangle, respectively. Figure 2 illustrates an example of a feature map with a size of \(\mathrm{W}\times\mathrm{H}\) pixels, a bounding box (rectangle), and a bounding box with different aspect ratios. The network branch consisted of one \(1\times 1\) convolutional layer and one softmax layer to estimate the foreground (object) or background probability of rectangles. The softmax layer consists of a function that takes real numbers as an input and normalizes each number into a probability proportional to the exponentials of the input numbers. Note that the number of \(1\times 1\) kernels was \(2k\) (\(18\) in the experiment), which corresponded to the probability of the object or background for each rectangle. The object candidates (i.e., proposals) can be obtained in the following softmax layer. In contrast, the regression branch consisted of one \(1\times 1\) convolutional layer, and regression was applied to refine the coordinate of the rectangle. Note that the number of \(1\times 1\) kernels was \(4k\) (\(36\) in the experiment), which corresponded to the coordinate for each rectangle (i.e., the x- and y-coordinate of the centre of the rectangle) and the rectangle's width and height. Linear regression for the bounding box [35] aims to minimize the error between the coordinates of a rectangle \(A=[x_{A},y_{A},w_{A},h_{A}]\), and the corresponding ground truth, \(G=[x_{G},y_{G},w_{G},h_{G}]\), which refers to the correct answer for each training sample provided by ourselves. The shift relation between \(A\) and \(G\) can be represented as follows [35]:  
\[\left[ \begin{array}{c}x_{G}\\ y_{G}\end{array} \right]=\left[ \begin{array}{cc}d(x_{A})&0\\ 0&d(y_{A})\end{array} \right]\left[ \begin{array}{c}w_{A}\\ h_{A}\end{array} \right]+\left[ \begin{array}{c}x_{A}\\ y_{A}\end{array} \right] \tag{4}\]  
where \(d(x_{A})\) and \(d(y_{A})\) are the shift parameters in x- and y-coordinates. The scale difference can be represented as follows:  
\[\left[ \begin{array}{c}w_{G}\\ h_{G}\end{array} \right]=\left[ \begin{array}{cc}exp(d(w_{A}))&0\\ 0&exp(d(h_{A}))\end{array} \right]\left[ \begin{array}{c}w_{A}\\ h_{A}\end{array} \right] \tag{5}\]