# Spectra-Based Selective Searching for Hyperspectral Anomaly Detection
## 2 Materials and Methods
### Measurement of Spectral Similarity  
Consider a 3-D hyperspectral cube by \(X=\{x_{i}\}_{i=1}^{n}\) in \(\mathbb{R}^{d}\), where \(n\) denotes the number of pixels in the HSI, \(d\) represents the number of spectral bands, and \(x_{i}\) represents the spectrum of each pixel of the HSI, which can be regarded as a vector quantity with each entry of the vector representing the reflectance value at each spectral band. Therefore, each pixel spectral curve is an efficient tool for describing the characteristics of the corresponding ground object. The spectral similarity criterion demonstrates the similarity degree between two given spectral curves. Generally, there are two types of spectral similarity criteria. One is a numerical index that mainly describes the difference in radiant luminance of ground objects, such as Euclidean distance (ED) and Lance distance (LD, also known as the Canberra distance) [42]. The other is the shape index, which mainly describes the difference in waveform among spectral curves, such as the spectral angle measure (SAM) and correlation coefficient (\(r\)). Neither the numerical index nor the shape index can fully reflect the degree of similarity between spectral vectors. In this study, the numerical index and shape index are combined to accurately describe the similarity between spectra. To determine the appropriate similarity criterion according to the specific situation of the spectral curve, the information entropy of the spectral difference curve is introduced. First, as the name suggests, the spectral difference curve is obtained by subtracting the two spectra and taking the absolute value. When the spectral curves of two pixels are similar in shape but different in the overall amplitude, the spectral difference curve can be approximated as a straight line with a slope of zero. When there is a significant difference in the shapes of the spectral curves of the two pixels, the spectral difference curve is a curve with obvious fluctuations. The information entropy of the spectral difference curve can be used to describe the nature of the spectral curve difference to dynamically determine the similarity criterion. The information entropy [43] of the spectral difference curve is defined as  
\[Ent=-\sum_{t=1}^{d}P_{t}\text{lg}(P_{t}) \tag{1}\]  
Figure 1: Flowchart of the proposed algorithm. where \(P_{t}=x_{t}/\sum\limits_{t=1}^{d}x_{t}\) is the probability of the \(t^{th}\) value in the spectral difference vector \(x\). The larger the \(Ent\), the more obvious the difference between the shapes of the spectral curves. When \(Ent=0\), the shapes of the spectral curves are completely consistent. Lance distance [42] is selected as the numerical index of spectral similarity in the proposed Triple-S algorithm because it is not sensitive to singular values and can suppress noise very well. In addition, the LD value ranges from zero to one, which is convenient for combining with the shape index. The Lance distance can be expressed as  
\[LD=\frac{1}{d}\sum\limits_{t=1}^{d}\frac{\left|x_{it}-x_{it}\right|}{x_{it}+x _{it}} \tag{2}\]  
where \(x_{it}\) and \(x_{it}\) are the entries of the two spectral vectors in the \(t^{th}\) band, respectively. SAM [39] is a widely used criterion to evaluate the shape similarity of two spectral vectors by calculating the angle between two spectral vectors \(x_{i}\) and \(x_{j}\), and the angle can be calculated by  
\[\text{sa}=\arccos\left(\frac{x_{i}\cdot x_{j}}{\left\|x_{i}\right\|\cdot \left\|x_{j}\right\|}\right) \tag{3}\]  
The obtained angle intuitively shows the similarity of the spectral curves in shape. The value range of Equation (3) is from 0 to \(\pi\). The smaller the angle, the more similar the two spectral curves are. The correlation coefficient [39] is another common criterion to describe the similarity of two spectral vector shapes.