# An Aircraft Object Detection Algorithm Based on Small Samples in Optical Remote Sensing Image
## 2 Theoretical Analysis and Methods
### Fusion Algorithm
#### 2.2.1 Clustering Algorithm  
In order to discover interesting groups, cluster analysis is applied to a variety of scientific areas [35]. In this paper, mean shift cluster algorithm is used to cluster points which are the result of weak and small object detection algorithm. Mean Shift, a method of nonparametric probability density estimation, was originally proposed by [PERSON] et al. [36]. [PERSON] [37] defined a family of kernel functions, which made the contribution of drift to the mean drift vector different with the difference of sample and drift point; secondly, he set a weight coefficient, which made the importance of different sample points different.  
Let \(X\) be the n-dimensional Euclidean space \(\mathbb{R}^{n}\). Then, donate the \(i\)th component of \(x\in X\) by \(x_{i}\), and the norm of \(x\in X\) is a non-negative number \(\|\)\(x\)\(\|\). A function K: X\(\rightarrow\)R is said to be a kernel if there exist a profile \(k\): \([0,\infty]\)\(\rightarrow\)R  
\[K(x)=k\Big{(}\|x\|^{2}\Big{)}, \tag{3}\]  
where \(k\) is nonnegative, nonincreasing and piecewise continuous.  
Figure 5: The result graph of proposed method. (**a**,**c**) Threshold segmentation map; (**b**,**d**) Circles with radii of the circumference centered on the points in (**a**) and (**c**) is marked on the original image.  
Let K be a kernel and \(\omega\): S\(\rightarrow\)(\(0,\infty\)) a weight function. Then, with the kernel K at \(x\in X\), the sample mean is:  
\[m(x)=\frac{\sum\limits_{s\in\mathbb{S}}K(s-x)\omega(s)s}{\sum\limits_{s\in \mathbb{S}}K(s-x)\omega(s)}, \tag{4}\]  
Let T be a finite set (cluster centers). The evolution of T in the form of iterations T\(\leftarrow\)m(T) is called a mean shift algorithm.  
Let X be the d-dimensional Euclidean space, R\({}^{\text{d}}\). Donate the \(i\)th component of \(x\in X\) by \(x_{i}\), and the mean vector at \(x\in X\) is:  
\[M_{h}(x)=\frac{1}{k}\sum\limits_{x_{i}\in\mathbb{S}_{h}}(x_{i}-x), \tag{5}\]  
and \(S_{h}\) refers to a spherical filed with a radius with \(h\).  
\[S_{h}(x)=\left\{y\middle|(y-x)(y-x)^{T}\leq h^{2}\right\}, \tag{6}\]  
With the kernel function and sample weight, the mean vector at \(x\in X\) is  
\[M_{h}(x)=\frac{\sum\limits_{x_{i}\in\mathbb{S}_{h}}K\Big{(}\frac{x_{i}-x}{h} \Big{)}\omega(x_{i})(x_{i}-x)}{\sum\limits_{x_{i}\in\mathbb{S}_{h}}K\Big{(} \frac{x_{i}-x}{h}\Big{)}\omega(x_{i})}, \tag{7}\]  
where \(\omega(x_{i})\) is the weight of the sample \(x_{i}\), and \(\sum\limits_{x_{i}\in X}\omega(x_{i})=1\).  
In the process of the proposed algorithm, firstly, calculate the mean vector \(M_{h}\left(x\right)\) between a random point \(A\) in the sample and its surrounding radius with \(h\). Then, the next drift direction of this point is calculated, that is \(A=M_{h}\left(x\right)+A\). At the new center \(A\), the previous steps repeat to iterate out the new center. When the point no longer moves, it forms a cluster with the surrounding points, and all the points encountered during this iteration should be grouped into this cluster. Calculate the distance between this cluster and the other cluster, and merge into the same cluster if the distance is less than the threshold, and form a new cluster if it's not satisfied. Finally, repeat the previous steps until all points in the sample are accessed.  
According to our experience, \(h\) take to be twice the radius of the circumference. After clustering the filtered results on Figure 5, the resulting graph is shown in Figure 6. Compared with other algorithms, Mean Shift can automatically discover cluster structure without specifying the number of clusters.