# Explainable Two-Layer Mode Machine Learning Method for Hyperspectral Image Classification
## 3 HSI Classification Method in Explainable Two-Layer Mode
### Front-End Learning Layer for Data Re-Expression
#### 3.1.2 Explainable Minimization Problem for SSC  
We compute the average spectral values at each band of \(N\) superpixels. The original matrix \(X\in\mathbb{R}^{mm\times b}\) transfers into \(F\in\mathbb{R}^{N\times b}\). Then, the minimization problem for SSC can be formulated as follows:  
\[min\|F-FZ\|_{F}^{2}+\lambda\|Z\|_{1}\]  
where \(\|Z\|_{1}=\underset{1\leq j\leq b}{max}\sum_{i=1}^{b}|Z_{ij}|\) and \(J(Z)\) in (4) is set to \(\|Z\|_{1}\), which helps to maintain a sparse coefficient matrix \(Z\).  
As described in (1), each band vector is written as a linear combination of other band vectors. It is reasonable in the re-expression procedure to preserve the inherent geometric local structure among the data in order to design a model that can reflect the relationship between the data \(f_{1},f_{2},\ldots,f_{N}\), where \(F=\left(f_{1}^{T},f_{2}^{T},\ldots,f_{N}^{T}\right)^{T}\) and the re-expressed data \(\widetilde{f}_{1},\widetilde{f}_{2},\ldots,\widetilde{f}_{N}\), where \(FZ=\left(\widetilde{f}_{1}^{T},\widetilde{f}_{2}^{T},\ldots,\widetilde{f}_{N} ^{T}\right)^{T}\). The assumption is that if \(f_{i}\) and \(f_{j}\) are in close relationship, their corresponding re-expressed data \(\widetilde{f}_{i},\widetilde{f}_{j}\) should also be close. According to this discussion, we suppose that \(S=\left(s_{ij}\right)\in\mathbb{R}^{N\times N}\) represents a matrix where \(s_{ij}\) quantifies the similarity between the data point \(f_{i}\) and \(f_{j}\). The problem of learning local structure can be formulated as  
\[min\frac{1}{2}\sum_{i,j=1}^{N}\left\|\widetilde{f}_{i}-\widetilde{f}_{j} \right\|_{2}^{2}s_{ij}=\frac{1}{2}\sum_{i,j=1}^{N}\left(\widetilde{f}_{i}- \widetilde{f}_{j}\right)\left(\widetilde{f}_{i}-\widetilde{f}_{j}\right)^{T}s_ {ij}\] \[=\frac{1}{2}\sum_{i,j=1}^{N}\left(\widetilde{f}_{i}f_{i}^{T}+ \widetilde{f}_{j}f_{j}-\widetilde{f}_{j}f_{i}-\widetilde{f}_{j}f_{j}^{T}\right) s_{ij}=\sum_{i,j=1}^{N}\left(\widetilde{f}_{i}\widetilde{f}_{i}^{T}- \widetilde{f}_{i}\widetilde{f}_{j}^{T}\right)s_{ij}\] \[=\sum_{i=1}^{N}\widetilde{f}_{i}d_{i}\widetilde{f}_{i}^{T}-\sum_{ i=1}^{N}\widetilde{f}_{i}s_{ij}\widetilde{f}_{j}^{T}=tr\left(Z^{T}F^{T}DFZ \right)-tr\left(Z^{T}F^{T}SFZ\right)=tr\left(Z^{T}F^{T}LFZ\right)\]where \(L=D-S\) is the Laplacian matrix related to the data, \(S=\left(s_{ij}\right)_{N\times N^{\prime}}\) and \(D\) is a diagonal matrix with diagonal elements \(d_{ii}=\sum_{j=1}^{N}s_{ij}\) for \(i=1,2,\ldots,N\).  
\[s_{ij}=exp\left(-\left\|\widetilde{f}_{i}-\widetilde{f}_{j}\right\|^{2}/2 \sigma^{2}\right),i=1,2,...N, \tag{5}\]  
The explainable minimization problem for SSC is defined as follows:  
\[min\|F-FZ\|_{2,1}^{2}+\lambda_{1}tr\left(Z^{\mathrm{T}}F^{T}LFZ\right)+\lambda _{2}\|Z\|_{2,1}^{2}, \tag{6}\]  
where \(\left\|\cdot\right\|_{2,1}\) denotes the \(l_{2,1}\) norm, \(\left\|Z\right\|_{2,1}=\sum_{j=1}^{b}\left(\sum_{i=1}^{b}z_{ij}\right)^{\frac{ 1}{2}}\).  
The gradient of the objective function in (6) is  
\[\
abla f(Z)=F^{\mathrm{T}}P_{1}FZ-F^{\mathrm{T}}P_{1}F+\lambda_{1}F^{\mathrm{ T}}L\mathrm{F}Z+\lambda_{2}P_{2}Z \tag{7}\]  
We let \(df(Z)/dZ=0\); therefore, we have  
\[Z=\left(F^{\mathrm{T}}P_{1}F+\lambda_{1}F^{\mathrm{T}}L\mathrm{F}+\lambda_{2} P_{2}\right)^{-1}\left(F^{\mathrm{T}}P_{1}F\right) \tag{8}\]  
where \(P_{1}\) and \(P_{2}\) are diagonal matrices. The diagonal elements are  
\[\left(P_{1}\right)_{ii}=1/\sqrt{\sum_{j=1}^{b}\left(F-FZ\right)_{ij}^{2}}, \ \left(P_{2}\right)_{ii}=1/\sqrt{\sum_{j=1}^{b}Z_{ij}^{2}}\]  
We set \(W=(\hat{Z}+\hat{Z}^{T})/2\) where \(\hat{Z}\) is the estimated solution of (5); then, we cluster all band vectors into \(k\) underlying subspaces with the spectral clustering method. Finally, we obtain the selected band set \(B_{k}\); then, after feature selection, the input data to the second layer are \(F_{B_{k}}\in\mathbb{R}^{N\times k}\), obtained with band selection.