# Classification of Hyperspectral Images Based on Supervised Sparse Embedded Preserving Projection
## 3 Supervised Sparse Embedded Preserving Projection  
SPP is an unsupervised algorithm that ignores the label information of samples, and the objective function only considers the sparse reconstruction error, which does not reflect the local structural relationship of samples. A supervised sparse embedded preserving projection (SSEPP) algorithm was proposed on the basis of SPP. SSEPP not only used the label information of samples to construct the weight matrix, which found the manifold structural information of the data and enhanced the discrimination ability of the projection subspace, but also minimized the spacing between the same class samples. Assume the sample set \(X=\{x_{1},x_{2},\ldots,x_{n}\}\), where \(x_{i}\) is the \(i^{\text{th}}\) sample of \(X\). To improve the objective function of the SPP algorithm, the objective function of SSEPP was recast as the following optimization problem:  
\[J\left(\text{ }V\right)=\min_{V}\sum_{i=1}^{N}\left\|\text{ }V^{T}x_{i}-V^{T}XS_{i}g_{ij}\right\|^{2}, \tag{10}\]  
where \(V\) represented a projection vector and \(g_{ij}\) was a weight matrix, that is, the set of weights among all the samples. The definition was as follows:  
\[g_{ij}=\left\{ \begin{array}{ll}\left(1-\left(\frac{\left\|x_{i}-x_{1} \right\|}{\sigma}\right)^{2}\right)^{2},&\text{if }l(x_{i})\,=l(x_{j})\\ 0,&\text{else}\end{array} \right.. \tag{11}\]  
In Equation (11), if \(x_{i}\) and \(x_{j}\) both belong to the same class, the weight value is not 0. When the distance between \(x_{i}\) and \(x_{j}\) is closer, the value is smaller. This was used to enhance the discrimination ability of the projection subspace. After a few simple algebraic operations, the objective function was optimized to:  
\[ \begin{array}{ll}J\left(\text{ }V\right)&=\min\sum\limits_{i=1}^{N}\left\|V^{T }x_{i}-V^{T}XS_{i}g_{ij}\right\|^{2}\\ &=\min V^{T}x\left[I-(sg)^{T}-sg+(sg)(sg)^{T}\right]x^{T}V\end{array}  \tag{12}\]  
In order to obtain a more stable numerical solution, the above problem regarding the minimization of the objective function was converted into a maximization problem:  
\[J\left(\text{ }V\right)=\max V^{T}xS_{\alpha}x^{T}V, \tag{13}\]  
where \(S_{\alpha}=(sg)^{T}-sg+(sg)(sg)^{T}\) is a sparse reconstruction matrix. The SPP objective function only considers the reconstruction error. On this basis, SSEPP considers the same class spacing and minimizes the error of samples in the same class in the projection space by establishing the objective function. If \(y_{i}=V^{T}x_{i}\), \(y_{j}=V^{T}x_{j}\) is the projection of the different training samples in the projection space, the objective function can be recorded as follows:  
\[\min_{V}\frac{1}{2}\sum_{i,j}\left\|y_{i}-y_{j}\right\|^{2}P_{ij}, \tag{14}\]  
where \(P_{ij}=\left\{ \begin{array}{ll}1,&\text{if}\quad l\left(x_{i}\right)=l \left(x_{j}\right)\\ 0,&\text{others}\end{array} \right..\) After some simple operations, the objective function can be converted into the following:\[= \min_{V}\frac{1}{2}\mathrm{tr}\left\{\sum_{i,j}\|y_{i}-y_{j}\|^{2}P_{ij}\right\}\] \[= \min\mathrm{tr}\left\{V^{T}XS_{g}X^{T}V\right\}\]  
where \(S_{\beta}=D-P\), \(D\) is a diagonal matrix and \(d_{ii}=\sum_{i}P_{ii}\) is a diagonal element. By combining Equation (13) and Equation (15), the multi-objective optimization function of the SSEPP algorithm was obtained:  
\[\max\frac{\mathrm{tr}\left(\ V^{T}XS_{a}X^{T}V\right)}{\mathrm{tr}\left(\ V^{T}XS_{g}X^{T}V\right)}. \tag{16}\]  
The SSEPP objective function not only highlights the role of a sample's label, but also minimizes the sparse reconstruction error while minimizing the distance between samples of the same class so that the same class sample projection is more compact. Equation (16) was solved by using the following generalized value eigenvalue decomposition problem:  
\[XS_{a}X^{T}V=\lambda XS_{\beta}X^{T}V. \tag{17}\]  
The eigenvalues given by the above equation are sorted in descending order, allowing us to obtain the projection matrix \(V=[v_{1},v_{2},\ldots,v_{n}]\), which corresponded to the \(n\) maximum eigenvalues.