# A Novel Spectral-Spatial Classification Method for Hyperspectral Image at Superpixel Level
## 2 The Proposed HSI Classification Method at Superpixel Level
### Superpixel-To-Superpixel Similarity  
For HSI classification at superpixel level, it is basically important to measure the similarity of two superpixels appropriately, since the classification results are highly dependent on it. A simple way is to replace the similarity of two superpixels with the similarity of their centroids to classify HSI. Obviously, doing so will result in the loss of too much pixel information. In [40], a set-to-set distance was defined based on an affine hull model and the singular value decomposition. [PERSON] et al. used a combination of Gaussian kernel technique, Log-Euclidean distance of a covariance matrix and Euclidean spectral distance to construct a weight between two connected superpixels [41]. By using a domain transform recursive filtering and \(k\) nearest neighbor rule (KNN), [PERSON] et al. [47] gave a representation of the distance between superpixels. These work make an effective attempt for HSI classification at superpixel level. However, the selection of the optimal parameters and computational complexity will bring some difficulties to the application of these methods. The LMPNN rule [48] can be regarded as the improvement of KNN [49], local mean-based k-nearest neighbor rule [50], and the pseudo nearest neighbor rule [51]. In the LMPNN algorithm, a point-to-set distance can be calculated by using the pseudo nearest neighbor and weighted distance. Inspired by the LMPNN rule, this work suggests a novel superpixel-to-superpixel similarity by extending the point-to-set distance in the LMPNN algorithm to the set-to-set similarity. Specifically, for a given HSI, we adopt the improved SLIC algorithm to segment it into superpixels, denoted by \(\text{HSI}=S_{1}\cup S_{2}\cup\cdots\cup S_{M}\). Suppose that superpixel \(S_{i}\) be made up of \(n_{i}\) pixels, say \(S_{i}=\big{(}\mathbf{x}_{1}^{i},\ \mathbf{x}_{2}^{i},\cdots,\mathbf{x}_{n_{i}}^{i}\big{)}\). The similarity \(s\big{(}S_{i},\ S_{p}\big{)}\) between superpixel \(S_{i}\) and \(S_{p}\) is calculated as follows. 1. Compute the similarity between pixel \(\mathbf{x}_{i}^{i}\) and each pixel \(\mathbf{x}_{j}^{p}\) by Equation (4). Sort \(\mathbf{x}_{1}^{p},\ \mathbf{x}_{2}^{p},\cdots,\mathbf{x}_{n_{p}}^{p}\) in an ascending order according to the corresponding similarities, represented as \(\mathbf{x}_{1}^{p},\ \mathbf{x}_{2}^{p},\cdots,\mathbf{x}_{n_{p}}^{p}\). 2. Calculate local mean vector \(\mathbf{\overline{x}}_{m}^{p}\) of the first \(m\) nearest pixels of pixel \(\mathbf{x}_{i}^{i}\), \[\mathbf{\overline{x}}_{m}^{p}=\frac{1}{m}\sum\
olimits_{1}^{m}\mathbf{x}_{l}^{p}.\] (10) \[S_{spec}\big{(}\mathbf{x}_{i}^{i},\ \mathbf{\overline{x}}_{1}^{p}\big{)},\ S_{ spec}\big{(}\mathbf{x}_{i}^{i},\ \mathbf{\overline{x}}_{2}^{p}\big{)},\ \cdots,\ S_{ spec}\big{(}\mathbf{x}_{i}^{i},\ \mathbf{\overline{x}}_{n_{p}}^{p}\big{)}\] are their corresponding similarities obtained by Equation (4). 3. Calculate the similarity \(s\big{(}\mathbf{x}_{i}^{i},\ S_{p}\big{)}\) between pixel \(\mathbf{x}_{i}^{i}\) and superpixel \(S_{p}\), \[s\big{(}\mathbf{x}_{i}^{i},S_{p}\big{)}=\sum\
olimits_{m=1}^{n_{p}}\frac{1}{m}S_ {spec}\big{(}\mathbf{x}_{i}^{i},\mathbf{\overline{x}}_{m}^{p}\big{)}.\] (11)
4. Arrange \(s\big{(}\mathbf{x}_{1}^{i},\ S_{p}\big{)},\ s\big{(}\mathbf{x}_{2}^{i},\ S_{p}\big{)}, \cdots,s\big{(}\mathbf{x}_{n_{i}}^{i},\ S_{p}\big{)}\) in an ascending order according to their values, represented as \(s\big{(}\mathbf{x}_{1}^{i},\ S_{p}\big{)},\ s\big{(}\mathbf{x}_{2}^{i},\ S_{p}\big{)}, \cdots,s\big{(}\mathbf{x}_{n_{i}}^{i},\ S_{p}\big{)}\). The similarity \(s\big{(}S_{iIt is can be seen from Equation (12) that the spectral features of all pixels in these two superpixels are taken into account when computing the defined similarity. In spite of this, the effect of noise pixels on similarity is also effectively weakened because they are assigned smaller weights.