## 3 Results
### Identification of Samples with High Flavonoid Content Levels from Deep Learning Predictions  
The ResNet1D architecture with wavelet features was utilized for predictions, with each sample evaluated through a ten-fold cross-validation process repeated five times. Predictions from individual models were aggregated, and the median value was calculated as the final score for each sample. Scores approaching 1.0 indicated high confidence in predicting elevated flavonoid content. The ROC curve calculated from final scores and labels is presented in Figure 4A, yielding an AUC of 0.8696 and accuracy of 0.8210 (determined using [PERSON]'s J statistic). Using this statistic, we identified an optimal threshold of 0.3188 that balances sensitivity and specificity. The red dot on the ROC curve in Figure 4A represents the optimal operating point (false positive rate: 0.1724, true positive rate: 0.8187). Samples with scores greater than or equal to this threshold were classified as normal-to-high flavonoid content level, while those below the threshold were classified as low flavonoid content level. The distribution of flavonoid contents between these two groups showed significant difference (\(p\)-value = 1.0439 \(\times\) 10\({}^{-14}\)) as shown in the boxplot in Figure 4B. A complete list of samples with their prediction scores is presented in Table S1. To identify samples with high confidence predictions, we selected those with scores greater than or equal to 0.95. This selection yielded 113 samples with confirmed normal-to-high flavonoid levels. These samples represented 18 different cultivars collected from various locations in Thailand, including both commercial varieties (Green and Red) and local accessions. Analysis of the harvest cuts revealed a distinct pattern in our dataset. Among the selected samples, there was a clear predominance of Cut 3 samples (78 samples, 69.0%) compared to Cut 2 samples (35 samples, 31.0%). Cut 3 samples generally showed higher flavonoid content, ranging from 9.10 to 45.02 mg rutin/gDW, with particularly high levels observed in samples from Damnoen Saduak, Ratchaburi (45.02 mg rutin/gDW) and Kamphaeng Saen, Nakhon Pathom (43.52 mg rutin/gDW). In contrast, Cut 2 samples exhibited a different range of flavonoid content, typically between 4.97 and 29.52 mg rutin/gDW, with the highest content found in samples from  
Figure 3: ROC curves and performance comparison of **(A)** ResNet1D and CNN1D models using different types of feature transformations and **(B)** the same algorithms integrated with recursive feature Elimination with cross-validation (FFECV). The performances of Gabor-like filtering with RFECV are identical to those without RFECV. This is because RFECV had no impact on the configuration with Gabor-like filtering, as the number of Gabor-like filtering features (96) was below the preset minimum threshold of 150 features. Mueang Lampang, Lampang (29.52 mg rutin/gDW). To statistically assess the observed differences, we performed a Mann-Whitney U test comparing flavonoid content between Cut 2 and Cut 3 samples (score \(\geq\) 0.95). The test confirmed a significant difference between the two groups (\(p\)-value = 2.1202 \(\times\) 10\({}^{-10}\)), supporting the pattern that Cut 3 samples tend to have higher flavonoid levels. The prediction scores also showed interesting cut-related patterns. While both cuts achieved high prediction scores (\(\geq\)0.95), Cut 3 samples dominated the highest-scoring range (>0.999), suggesting that the model identified more distinctive spectral features associated with flavonoid content in these samples. This pattern might be attributed to the plants' physiological maturity in the third harvest cycle or potentially more favourable environmental conditions during this growth period. Table 4 shows the top 25 samples with the highest prediction scores (0.999962 to 0.999999). Within this subset, 23 samples were from Cut 3 and only two samples from Cut 2, further emphasizing the dominance of Cut 3 samples among the highest-confidence predictions.