# Deep Fusion Feature Based Object Detection Method for High Resolution Optical Remote Sensing Images
## 4 Size-Scalable Candidate Region Proposal Algorithm
### BING Algorithm  
The binarized normed gradients (BING) algorithm is a very simple, but highly efficient region proposal algorithm, which is essentially a two-stage cascade classifier. The first stage uses a multi-scale sliding window to scan the image, and each window is scaled to a uniform size of 8 \(\times\) 8, while a linear scoring model is used:  
\[s_{l}=\langle w,g_{l}\rangle \tag{1}\]  
\[l=(i,x,y) \tag{2}\]  
where \(s_{l}\) is the filter score, \(g_{l}\) is the window feature, and \(l,i,(x,y)\) are the location size and top left corner coordinates of the window, respectively.  
The windows with a higher score for each size are selected as the possible candidate windows. During this period, the number of true objects in each size is counted, and the sliding window score is only applied to the size with the objects' number exceeding a certain threshold. The first-stage linear model \(w\) is trained by a linear SVM, and the NG features (norm of the gradients) of the real object windows and random sampling background windows are taken as positive and negative samples, respectively.  
In the second stage, considering the different possibilities for different window sizes containing a object, such as the square window of 64 \(\times\) 64 is more likely to contain an object than the 5 \(\times\) 128 one, a score calibrator is trained for each size. We update the score for each candidate window:  
\[o_{l}=v_{i}\times s_{l}+t_{i} \tag{3}\]  
where \(v_{i},t_{i}\in R\) are the calibration coefficients that are learned for different sizes. This step is necessary only if you need to reorder the candidate windows obtained in one stage. The learning of the parameters \(v_{i}\) and \(t_{i}\) is also performed by the linear SVM.  
The biggest contribution of the BING algorithm is the improvement of detection speed. In order to speed up the feature extraction and scoring process, the algorithm uses the idea of model binary approximation [26; 27]. The linear model \(w\) is approximated by a set of binary basis vectors \(\alpha_{j}\):  
\[w\approx\sum_{j=1}^{N_{w}}\beta_{j}\alpha_{j} \tag{4}\]  
where \(N_{w}\) denotes the number of basis vectors, \(\alpha_{j}\in\{-1,1\}\)[64] denotes a base vector, and \(\beta_{j}\) denotes the corresponding coefficients.  
Further, representing each \(\alpha_{j}\) by using a binary vector and its complement: \(\alpha_{j}=\alpha_{j}^{+}-\overline{\alpha_{j}^{+}}\), where \(\alpha_{j}^{+}\in\{0,1\}\)[64]. These transforms allow subsequent scoring calculations for a binarized feature just using fast BITWISE and stand bit counteroperations, as shown in Equation (5):  
\[w,b\approx\sum_{j=1}^{N_{w}}\beta_{j}\left(2a_{j}^{+},b-|b|\right) \tag{5}\]  
However, the NG features are real numbers, and how to binarize the NG features to speed up the calculation is one of the difficulties of the algorithm. This algorithm approximates the NG feature values (each saved as a BYTEvalue) using the top \(N_{g}\) binary bits of the BYTE values. Thus, a 64-dimensional NG feature \(g_{l}\) can be approximated by \(N_{g}\) binarized normed gradient (BING) features:  
\[g_{l}\approx\sum_{k=1}^{N_{g}}2^{8-k}b_{k,l} \tag{6}\]  
Therefore, the score for whether or not an image window contains an object can be approximated as:  
\[s_{l}=w,g_{l}\approx\sum_{j=1}^{N_{w}}\beta_{j}\sum_{k=1}^{N_{g}}2^{8-k}\left( 2a_{j}^{+},b-\left|b_{k,l}\right|\right) \tag{7}\]  
where \(2^{8-k}\left(2a_{j}^{+},b-\left|b_{k,l}\right|\right)\) can be computed using fast CPU atomic operation: BITWISE and POPCNTSSEoperators, which speeds up the calculation.