## 3 Results
### Application Based on the Selected Wavelengths  
The VIS-NIR spectrum encompasses a vast range of 2101 wavelengths, rendering the equipment required to capture the entire spectrum prohibitively expensive for widespread utilization in authenticating organic leafy vegetables within the market. While employing the most pivotal wavelengths in LDA classification yields remarkable results, it is imperative to recognize that the adjacent wavelengths should not be disregarded as inconsequential. Consequently, by meticulously considering the selected wavelengths and their associated importance values and locations, as Figure 6 shows, we can strategically curtail the cost of the spectrometer by discerningly identifying and selecting a judicious subset of bands from the full VIS-NIR spectrum. In doing so, we strike an optimal balance between cost-effectiveness and the retention of essential spectral information necessary for accurate authentication and classification.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Method**} & \multirow{2}{*}{**Wavelengths**} & **Sensitivity** & **Specificity** & **Accuracy** & **F1** \\  & & **(\%)** & **(\%)** & **(\%)** & **(\%)** \\ \hline
**SS** & First 10 & 87.6 & 94.6 & 91.1 & 90.6 \\  & Last 10 & 77.9 & 91.3 & 84.7 & 83.3 \\
**RF** & First 10 & 84.7 & 91.6 & 88.0 & 87.7 \\  & Last 10 & 77.0 & 87.1 & 82.2 & 80.8 \\
**ANOVA** & First 10 & 84.6 & 90.9 & 87.7 & 87.3 \\  & Last 10 & 76.0 & 85.4 & 80.4 & 79.8 \\ \hline \hline \end{tabular} The wavelengths were sorted in descending order of importance. Abbreviations: SS, stability selection; RF, random forest; ANOVA, analysis of variance.  
\end{table}
Table 5: Classification results of the testing set of the stem spectra by using selected wavelengths.  
Table 6 and Figure 7 present the LDA classification outcomes of the testing set obtained using these selected bands in the leaf spectra and stem spectra. Notably, their classification accuracies and f1 scores surpass those achieved by employing a number of selected wavelengths as described in Section 3.3.2.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Spectra** & **Sensitivity (\%)** & **Specificity (\%)** & **Accuracy (\%)** & **F1 (\%)** \\ \hline
**Leaf** & 98.3 & 98.4 & 98.3 & 98.3 \\
**Stem** & 97.1 & 100 & 98.3 & 98.5 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Classification results of the testing set by using selected bands in visible and near-infrared spectrum (550–910 nm and 1380–1500 nm for the leaf spectra, 750–900 nm and 1700–1820 nm for the stem spectra).  
Figure 6: Chosen bands derived from the wavelengths (all the dots) selected by genetic algorithm, along with the locations of their first 10 significant wavelengths (the red dots) evaluated by the stability selection method. (**a**) The leaf spectra (550–910 nm, and 1380–1500 nm). (**b**) The stem spectra (750–900 nm and 1700–1820 nm).  
Figure 7: Confusion matrices of the classification results of the testing set by using selected bands in the visible and near-infrared spectrum. (**a**) The leaf spectra (550–910 nm and 1380–1500 nm). (**b**) The stem spectra (750–900 nm and 1700–1820 nm).  
The excellent classification results unequivocally validate the practicality and dependability of employing the number, significance, and placement of the chosen wavelengths to ascertain the suitable VIS-NIR bands. It also substantiates the viability and efficacy of utilizing a discerning selection of suitable VIS-NIR bands in combination with LDA for accurate classification of organic and non-organic leafy vegetable spectra.