## 3 Modeling and Algorithms
### CASD-Assisted PCSSR  
Based upon the CASD metric defined in Section 3.1, we now describe how to generate the graph for the LP algorithm by using the PCSSR flow. To start with, the PCSSR-based graph generation method is derived from the typical SR-based method. For every sample, the SR based method aims to encode  
Figure 2: A graphical illustration of the CASD algorithm. (**a**) The raw dataset with A–F six samples, where A, F are the labeled samples with the same class and the rest are unlabeled samples to be predicted. The subscript below each sample shows its pixel location in the hyperspectral data. (**b**) Construct a complete undirected graph where each vertex represents a sample and the edge between every two samples is weighted by their Euclidean distance. (**c**) A and F are the labeled samples with the same class, so reweight the edge between them by zero. (**d**) For every two vertices, compute the shortest path between them (the shortest path between A and C is marked in magenta). (**e**) Update the weight between every two vertices with the length of the shortest path between them. The new edge weight is called “the class adjusted spatial distance”. it as a sparse linear combination of the other samples [13; 14]. The typical SR model is formulated as follows:  
\[W=argmin\|W\|_{1}\text{ s.t. }X=XW,diag(W)=0,\ \ W\geq 0, \tag{4}\]  
where \(X\) denotes all the samples in training set and testing set: \(\|\cdot\|\) represents the L-1 norm. By solving this regularization model, we can obtain the graph weight matrix \(W\) demanded in the following LP process. Furthermore, due to the complex working environment and contamination during the data transmission, many hyperspectral images are corrupted by different types and amounts of noises, two common types of which are stripping noise and salt-and-pepper noise. Therefore, considering the corrupted data and the noise during collection, the method can be rewritten as follow to enhance the robustness against noises:  
\[W=argmin\frac{1}{2}\|X-XW\|_{F}^{2}+\lambda\|W\|_{1}\text{ s.t. }diag(W)=0,\ \ W\geq 0, \tag{5}\]  
where \(X\) denotes all the samples in training set and testing set and \(\lambda\) is a tradeoff parameter that controls the sparsity of \(W\). In the next step, we come to a point of divergence from the original paper--the original PCSSR paper next introduces a probabilistic class structure term \(P=[P_{i};P_{u}]\in\mathbb{R}^{n\times c}\) where \(P_{ij}\) represents the possibility that a sample \(i\) belongs to the class \(j\), and then calculates the distance matrix \(M\) based on the probabilistic class structure \(P\), where \(M_{ij}=\frac{1}{2}\|P_{i}-P_{j}\|^{2}\). It is necessary to state that, in the original PCSSR paper, the probabilistic class structure \(P\) is generated through a standard SR process, and one of the aims of our work is to introduce the spatial information into the PCSSR. Therefore, instead of computing the probabilistic class structure, we run Algorithm 1, as proposed in Section 3.1, to get the CASD information between each two samples and apply the CASD information as the new distance matrix \(M\), where \(M_{ij}\) measures the distance between the i-th and j-th sample. If the two samples are close to each other (by category or in spatial), \(M_{ij}\) will be a small number, which means they are similar to each other. The additional regularizer for graph edge matrix \(W\) is as follows:  
\[R(W)=\sum_{i,j}\left|W_{ij}\cdot M_{ij}\right| \tag{6}\]  
Obviously, to acquire a smaller \(R(W)\), \(W_{ij}\) needs to be small when \(M_{ij}\) is a large number. By this regularizer, the linkage between two far-away samples will be regularized into a weak linkage.