# Hyperspectral Superpixel-Wise Glioblastoma Tumor Detection in Histological Samples
## 3 Experimental Results  
### SLIC Hyperparameter Selection  
There are two hyperparameters to be configured on SLIC algorithm: the number of target superpixels (\(K\)) and the weight parameter (\(m\)), which balances the contribution of the spectral and the spatial distance. For machine learning, the superpixels will be used as input to a supervised classifier. The main motivation for the use of a superpixel algorithm in the proposed processing framework is to extract the most salient spectral information from each HS image. Therefore, the subsequent superpixel-based classification can be affected if the spectral information within each superpixel does not belong to spectrally consistent areas, i.e., if some superpixels contain pixels with significant different spectral signatures. For this reason, we evaluated the effect of varying both \(K\) and \(m\) in the mean intra-cluster distance (Equation (11)), where \(c_{j}\) is the centroid of the superpixel \(j\), and \(x_{i}\) represents a pixel on the image assigned to such a superpixel. The lower \(D_{IC}\), the most similar pixels within a superpixel. \[D_{IC}=\frac{1}{K}\sum_{j=1}^{K}\frac{1}{N_{i}}\sum_{i=1}^{N_{i}}d_{SA}\Big{(} c_{j},x_{i}\Big{)}+\left(\frac{d_{S}\Big{(}c_{j},x_{i}\Big{)}}{S}\right)\cdot m \tag{11}\]  
To select the optimal hyperparameters for the SLIC segmentation, we ran the SLIC segmentation with different \(K\) and \(m\) values and calculated the corresponding intra-cluster distance. We analyzed values of \(K\) ranging from 64 to 1024, while the values for \(m\) varied from 0.005 to 0.1. In Figure 6, we present the results of these experiments, showing the mean \(D_{IC}\) for each hyperparameter. First, we can observe that with an increased number of superpixels, \(K\), the lower inter-cluster distance is achieved. The rationale of this behavior is the following. If the number of superpixels is low, a pixel may be assigned to a superpixel for spatial similarity. On the contrary, if the number of superpixels is high, each superpixel is more likely to reject pixels which are not spectrally similar. For this reason, we selected the maximum value of \(K\), 1024. Second, the value of \(m\) equalizes the importance of both the spectral and the spatial distance during the superpixel assignment. Low values of \(m\) reduce the importance of the spatial proximity, while prioritizing the importance of the spectral similarity. As can be observed in Figure 6B, the greater values of \(m\) result in greater intra-cluster distance. The rationale for this behavior is the following. Large values of \(m\) result in the spatial distance outweighing the spectral distance, and superpixels are likely to include pixels that are spatially closer, more than spectrally different. For this reason,we selected a value of \(m=0.01\) to provide relevance to the spatial information, while keeping the inter-cluster distance low. An example of the variation of the SLIC results depending on \(K\) is represented on Figure 7. If \(K\) is low, the area covered by a single superpixel is high, and could result in a mixture of different elements in a superpixel. As \(K\) increases, the area covered by each superpixel decreases, resulting in more compact superpixels. Figure 6 shows that low values of \(K\) (64 and 256) produce superpixels that are comprised of pixels from different materials. Additionally, for large values of \(K\) (512 and 1024), the superpixels are able to isolate pixels from single materials. In this application, we used the superpixels as a spectral summary of the current HS image. For this reason, the presence of superpixels with heterogenous spectra may lead to inaccurate predictions during supervised classification. In this research, we empirically selected \(K=1024\), which was shown to provide spectrally compact areas. An example of this effect can be observed in Figure 8 for different regions of an image. In this application, we would expect the superpixels to be spectrally coherent.