# Quadratic Clustering-Based Simplex Volume Maximization for Hyperspectral Endmember Extraction
## 2 Proposed Methods
### Spatial Clustering  
Spatial clustering can be achieved by superpixel segmentation algorithms. Here, the simple linear iterative clustering (SLIC) algorithm commonly used in two-dimensional image processing is enhanced for HSIs, as it has significant advantages in terms of calculation speed, memory efficiency and segmentation performance [28; 29]. The enhancement mainly focuses on the adjustment to the clustering criterion, making it better meet the need of regional homogeneity in partitions. The details of spatial clustering are as follows.  
The HSI is first divided into blocks with the size of s \(\times\) s as the initial clustering state. Take the center of each block as the cluster center. Considering that the centers located at the edge in the image may affect the clustering performance, the principal component analysis (PCA) is performed, and the projection of the image to the first principal component is chosen to calculate the gradient. The pixel with the lowest gradient in each block is regarded as new cluster center. In addition, PCA has good denoising effect, and the first principal component contains most of the information in the HSI.  
Since good spatial homogeneity makes the representative endmembers more accurate, it is our primary consideration in determining the clustering principle. In some studies, clustering strategies have been developed to produce superpixels with regular sizes and shapes but poor spectral similarity, which is not suitable for us [30]. In this work, the combination of \(\mathrm{ED_{spe}}\) and SAD provides constraints on spectral similarity as spectral measurement, and spatial Euclidean distance (\(\mathrm{ED_{spa}}\)) is utilized as the spatial measurement. They are formulated as follows:  
\[\mathrm{ED_{spa}}=\sqrt{\left(\mathrm{x_{i}-\ \hat{x}_{i}}\right)^{2}+\left( \mathrm{y_{i}-\ \hat{y}_{i}}\right)^{2}}/\mathrm{L}, \tag{1}\]  
\[\mathrm{ED_{spe}}=\sqrt{\|\mathbf{v_{i}-\ c_{i}}\|_{2}^{2}/\mathrm{b}}, \tag{2}\]  
\[\mathrm{SAD}=\cos^{-1}\left(\frac{<\mathbf{v_{i},\mathbf{c_{i}}>}}{\|\mathbf{ v_{i}}\|\cdot\|\mathbf{c_{i}}\|}\right), \tag{3}\]  
where \(\left(\mathrm{x_{i},y_{i}}\right)\) refers to the location of a given pixel in the image, \(\left(\ \hat{x}_{i},\ \hat{y}_{i}\right)\) is the center location of the partition that contains the pixel, \(\mathrm{L}\) is the length of the diagonal for the search scope used to normalize the \(\mathrm{ED_{spa}}\), \(\mathbf{v_{i}}\) and \(\mathbf{c_{i}}\) are the spectra of the pixel and the cluster center respectively, and \(\mathrm{b}\) is the number of bands in the HSI.  
Thereby, the spatial measurement \(\mathrm{D_{spa}}\) and the spectral measurement \(\mathrm{D_{spe}}\) are defined as follows:  
\[\mathrm{D_{spa}}=\mathrm{ED_{spa}}, \tag{4}\]  
\[\mathrm{D_{spe}}=\frac{\left(\mathrm{ED_{spe}}+\mathrm{SAD}\right)}{2}. \tag{5}\]  
The clustering criterion \(\mathrm{D}\) is defined as follows:  
\[\mathrm{D}=\lambda_{1}\times\mathrm{D_{spa}}+\left(1\ -\ \lambda_{1}\right) \times\mathrm{D_{spe}}, \tag{6}\]  
where \(\lambda_{1}\) is a weighting factor to balance \(\mathrm{D_{spa}}