*4.2. Band Selection Using Optimization Algorithms (PF2 and PF3)*

The *PF2* and *PF3* aim to use optimization algorithms in order to find the most relevant bands able to perform an accurate classification of the brain tumors, using the lower possible number of features. The evaluation of both processing frameworks was performed using the reduced training dataset, and a data partition scheme following a leave-one-patient-out cross-validation to create the SVM model and evaluate the results (see Figure 3b,c). In these processing frameworks, the six test HS images were evaluated with different optimization algorithms to find out which offers the best results. In addition, in case of *GA* and *PSO* algorithms (PF2), two different metrics were employed to evaluate the selected bands: *OAPenalized* (OA\_P) and *FoMPenalized* (FoM\_P). In summary, the band selection techniques evaluated were: *GA* using *OAPenalized* (PF2-GA-OA\_P); *PSO* using *OAPenalized* (PF2-PSO-OA\_P); *GA* using *FoMPenalized* (PF2-GA-FoM\_P); *PSO* using *FoMPenalized* (PF2-PSO-FoM\_P) and *ACO* using 60 bands (PF3-ACO-60). Furthermore, all the results were compared with the reference values obtained with the *PF1* using 128 bands (PF1-128).

Figure 7 shows the boxplot results of the OA and the normal, tumor and hypervascularized tissue sensibilities obtained after the evaluation of the *GA*, *PSO* and *ACO* algorithms. The *ACO* algorithm was evaluated selecting different numbers of bands (20, 40, 60, 80 and 100), but only the results obtained with 60 bands have been reported because they were found to be the most competitive ones. Figures S3 and S4 in the supplementary material present the detailed results obtained with the *ACO* algorithm. Figure 7a shows the OA results of all the techniques, where it should be noted that the median values are around 80%, offering the PF2-GA-OA\_P the best result. However, the results obtained in the tumor sensitivity boxplot (Figure 7b) shows that the technique that uses the *GA* algorithm with the *FoMPenalized* metric (PF2-GA-FoM\_P) provides the best results, achieving a tumor sensitivity median of ~79%. This represents an increment of ~21% with respect to the PF2-GA-OA\_P method. On the other hand, in Figure 7c, it can be seen that the results of the normal tissue sensitivity are similar in both cases (PF2-GA-OA\_P and PF2-GA-FoM\_P), with a median value of 89% and 90%, respectively. The same behavior can be observed in the hypervascularized tissue sensitivity results (Figure 7d). As can be observed in Figure 8, the MCC metric, which takes into account the unbalance of the test labeled dataset, shows the same behavior as the other metrics. Thus, the PF2-GA-FoM\_P is the method that provides on average the best results. This is especially highlighted in the tumor class results.

Figure 9 illustrates the qualitative results represented in the classification maps obtained for each method. These maps allow visualization of the identification of the different structures for each class found in the complete HS cube, i.e., it is possible to visually evaluate the results obtained in the non-labeled pixels of the HS test cubes. In addition, this figure indicates the number of bands selected with each method for each HS test cube. Figure 9a shows the synthetic RGB images for each HS test cube, indicating the location of the tumor area surrounded by a yellow line, while Figure 9b shows the classification results obtained with the reference method (PF1-128).

**Figure 7.** Boxplot results of the leave-one-patient-out cross-validation obtained for each processing framework. (**a**) Overall accuracy. (**b**) Tumor tissue sensitivity. (**c**) Normal tissue sensitivity. (**d**) Hypervascularized tissue sensitivity.

**Figure 8.** Boxplot results of the Matthews correlation coefficient (MCC) metric using the leave-one-patient-out cross-validation obtained for each processing framework. (**a**) Tumor tissue. (**b**) Normal tissue. (**c**) Hypervascularized tissue.

**Figure 9.** Classifications maps of the test database. (**a**) Synthetic RGB images with a yellow line identifying the tumor area. (**b**) Reference results using 128 bands. (**c**) Results of the *GA* algorithm using *OAPenalized*. (**d**) Results of the *PSO* algorithm using *OAPenalized*. (**e**) Results of the *GA* algorithm using *FoMPenalized*. (**f**) Results of the *PSO* algorithm using *FoMPenalized*. (**g**) Results of the *ACO* algorithm using the 60 bands per image.

Considering these images as reference, it is observed that the results in all cases are very similar. Nonetheless, when analyzing the images one-by-one, in the case of the first image, *P008-01*, it is observed that using either PF2-PSO-OA\_P (Figure 9d) or PF3-ACO-60 (Figure 9g) the results are more accurate with fewer false positives. The best case that visualizes the *P008-02* image is the PF2-GA-FoM\_P (Figure 9e), since it is observed a higher number of tumor pixels in the area of the tumor. As for the *P012-01*, all the techniques visualize the tumor area correctly, but the PF1-128 (Figure 9b) is the one that shows fewer false positives pixels. In the case of *P012-02*, the best technique is the PF2-GA-FoM\_P (Figure 9e) due to it shows less false positive pixels. With respect to the *P015-01* image, it is observed that using PF2-GA-OA\_P (Figure 9d) and PF2-GA-FoM\_P (Figure 9e) the tumor area is clearly identified, although they have a small group of false positives in the upper left image due to some extravasated blood out of the parenchymal area. Finally, image *P020-01* offers practically the same result in all cases without a successful identification of the tumor area, even in the reference results. Regarding the number of bands selected to perform the classification, the PF2-GA-OA\_P and PF2-GA-FoM\_P are the methods that achieved the less number of bands for each HS test image, being lower than 18 bands in all the cases.

After conducting a thorough analysis of the results obtained, it was observed that the best technique, which provided the best balance between qualitative and quantitative results, is the PF2-GA-FoM\_P. Quantitatively, the GA-FoM\_P provided the best average OA value of 78% (improving ~4% with respect to the reference results with 128 bands) and the best median tumor sensitivity value of 79%, which represents an increment of ~21% with respect to the best solution provided with the other optimization approaches. Moreover, the GA-FoM\_P increases the tumor sensitivity value in 30% with respect to the reference results.
