Age grading for Aedes aegypti, CA-origin
To investigate the spectral variations associated with mosquito aging, we analyzed the SERS spectra of CA-origin female mosquitoes collected at different ages. The CA-origin (female) was reared at the CA site and collected on day 1 (n = 17), day 7 (n = 15), day 14 (n = 15), and day 21(n = 17). In Fig. 2A, the SERS spectra for day 1 are notably distinct from those of the subsequent days, primarily due to the lower intensity observed at the peak of 726 cm−1 (adenine). Additionally, the intensities at the 797 cm−1 (tryptophan), 836 cm−1 (tyrosine), and 1022 cm−1 (phenylalanine, C–H in-plane bending) peaks are significantly higher for day 1 than for days 7, 14, and 21. This trend is consistent with our previous observations [37, 38]. Days 7, 14, and 21 display greater similarity in their SERS characteristics, especially when compared to the distinct signature observed for day 1. For instance, the peak intensity at 726 cm−1 (adenine) gradually decreased, and peaks at 797 cm−1 (tryptophan), 836 cm−1 (tyrosine), and 1022 cm−1 (phenylalanine, C–H in-plane bending) increased from day 7 to day 14 but decreased on day 21. These patterns suggest that biochemical changes over time result in a convergence in molecular features.

Age classification and regression analysis for mosquitoes collected for the CA-origin. A Average SERS spectra of mosquitoes collected on days 1, 7, 14, and 21 at the CA-origin. B Confusion matrix showing the accuracy of the model in classifying mosquito samples by collection day. C t-SNE plot illustrating the clustering of mosquito samples based on collection day. D Regression analysis comparing the actual versus predicted collection days. E Predicted mosquito age (mean ± standard deviation)
The ANN model demonstrated a strong capability to distinguish between these time points, albeit with some misclassifications. As illustrated in Fig. 2B, the model achieved overall accuracy of 84%, compared to 62% for non-ANN models (Table 1). It accurately classified all 73 spectra from day 1 without misclassifications, and correctly identified 45 out of 64 spectra from day 7, with some overlap in the predictions for days 14 and 21. For day 14, the model correctly identified 58 out of 62 spectra, again with minor misclassifications primarily between days 7 and 21. Day 21 presented the greatest challenge for the model, with 50 out of 70 spectra correctly classified and some predictions incorrectly assigned to day 14. These results suggest that while the model performs well, especially for the earlier days, the spectral similarities between later days (day 14 and day 21) make precise classification more difficult.
The t-SNE analysis (Fig. 2C) further supports these findings. Samples from day 1 (blue dots) form a distinct and well-separated cluster, while samples from days 7 (orange dots), 14 (green dots), and 21 (red dots) form somewhat distinct but overlapping clusters. This overlap likely reflects the gradual molecular changes in the samples over time, making perfect categorical classification more challenging.
To determine the predicted accuracy based on individual mosquitoes rather than individual spectra, a voting mechanism with a 55% threshold was applied (Additional file 1: Table S1). Specifically, each mosquito generated 20 spectra, and each spectrum was independently classified into an age group. If at least 55% (11 out of 20) of the spectra for a mosquito were assigned to the same age, the mosquito was classified into that age group. This method accounts for spectral variability while ensuring robust mosquito-level classification. As shown in Additional file 1: Table S1, all test mosquitoes met this threshold and were correctly assigned to their actual age group, resulting in 100% mosquito-level classification accuracy. This demonstrates the model’s reliability in accurately determining mosquito ages across various days. In comparison, when the same voting mechanism was applied to the non-ANN models, the performance was considerably lower (Additional file 1: Table S2). For day 1, all five mosquitoes were correctly predicted, but for day 7, only two out of four were successfully classified. For day 14, no mosquitoes were accurately predicted, while for day 21, four out of five were correctly classified. This resulted in an overall accuracy of 61% for the non-ANN models, further emphasizing the superior performance of the ANN approach.
Due to the difficulty of precise categorical prediction for mosquito age without a voting mechanism, we also evaluated the model’s capability to perform continuous age prediction (i.e., allowing outputs such as 4.2 days) through ANN-regression. The scatter plot (Fig. 2D) presents the correlation between actual and predicted ages, with the blue line indicating perfect correlation and the red dots showing model predictions. The regression analysis yielded a high R-value of 0.96 and an RMSE of 2.18 days, indicating strong predictive accuracy, especially when compared to the non-ANN models (R = 0.84, RMSE = 4.26 days; Table 1). As shown in Fig. 2D, predictions for day 1 closely aligned with actual values, with red dots clustering tightly around the line of perfect correlation. In contrast, predictions for days 7, 14, and 21 displayed greater spread, suggesting decreased precision at higher ages, likely due to overlapping spectral features. To further assess prediction variability, we summarized the mean and standard deviation of predicted ages for each actual day (Fig. 2E). While the predicted means remained close to the true values across all age groups, the standard deviations increased slightly with age. This further supports the observation that spectral similarity among older mosquitoes can make fine-scale age differentiation more difficult.
Age grading for Aedes aegypti, TH-origin
Similarly, we applied the same model to classify and predict the age of female TH mosquitoes collected on day 3 (n = 10), day 10 (n = 10), and day 18 (n = 10). The SERS spectra (Fig. 3A) revealed distinct biochemical changes over time, with notable differences at the peaks 797 cm−1 (tryptophan), 836 cm−1 (tyrosine), and 1022 cm−1 (phenylalanine, C–H in-plane bending). Particularly noteworthy is the peak at 653 cm−1 (C–S stretching), which becomes markedly dominant on day 10. This pattern aligns with our previous findings [38].

Age classification and regression analysis for mosquitoes collected for the TH-origin. A Average SERS spectra of mosquitoes collected on days 3, 10, and 18 at the TH-origin. B Confusion matrix showing the accuracy of the model in classifying mosquito samples by collection day. C t-SNE plot illustrating the clustering of mosquito samples based on collection day. D Regression analysis comparing the actual versus predicted collection days. E Predicted mosquito age (mean ± standard deviation)
As illustrated in Fig. 3B, the model achieved overall accuracy of 86% (Table 1) in classifying TH mosquito samples across the three time points: day 3, day 10, and day 18. The model exhibited consistent classification performance, correctly identifying 32 out of 39 spectra for day 3, 32 out of 36 spectra for day 10, and 31 out of 36 spectra for day 18. When the non-ANN model was used, the overall accuracy decreased to 68%, reflecting its limitations in handling complex spectral data (Table 1). While there were some minor misclassifications, specifically overlaps between days 3 and 10, and between days 10 and 18, the overall results indicate that the model maintained comparable accuracy for each day. This balanced performance suggests that the model is effective in distinguishing between these age groups, even in the presence of similar spectral features.
The t-SNE analysis presented in Fig. 3C further supports these findings, showing distinct clusters for days 3, 10, and 18. There is minimal overlap between the clusters for days 3 and 10, as well as between days 10 and 18. This limited overlap in the t-SNE plot aligns with the high classification accuracy indicated in the confusion matrix, suggesting that the model is effectively distinguishing between the time points based on their unique molecular features.
Using a voting mechanism with a 55% threshold (Additional file 1: Table S1), the model again achieved 100% accuracy for mosquitoes in the test set. In contrast, when the non-ANN model was used, the overall performance decreased to 67% (Additional file 1: Table S3), with three out of three mosquitoes correctly classified for day 3 and day 10, but none successfully predicted for day 18.
Regression analysis (Fig. 3D) showed a strong correlation (R = 0.95) and an RMSE of 1.82 days, indicating high predictive accuracy (Table 1). The red dots representing predictions for days 3 and 18 are closely clustered around the line of perfect correlation, indicating good precision for these age groups. In contrast, predictions for day 10 show greater dispersion, suggesting reduced precision likely due to increased spectral variability among intermedia mosquitoes, which can make accurate age differentiation more challenging. This trend is further supported by the summary statistics in Fig. 3E. The predicted means for all age groups remained close to the actual values (3.70, 9.06, and 17.60), but the standard deviation was highest for day 10 (2.09), reflecting more variability in predictions. Compared with the non-ANN model (R = 0.88, RMSE = 2.90), the ANN model demonstrated superior capability in handling complex and variable spectral data.
Impact of sex—age grading for TH Aedes aegypti, female and male
We also evaluate the robustness of our model, trained on female mosquitoes, in age grading across sexes. The average SERS spectra for males and females (Additional file 1: Figure S1A) show differences in peak intensities. Females exhibited higher intensities at 1349 cm−1 and 726 cm−1 (related to adenine), while males showed lower intensities at 1611 cm−1 (melanin, C=C stretching) and 631 cm−1 (C–C–C bending). Both ANN and t-SNE analysis (Additional file 1: Figure S1B and C) demonstrated a clear spectral separation between male and female samples.
Unsurprisingly, when the model trained on females was applied directly to classify and predict the age of male mosquitoes, as well as for combined male and female samples from the TH site, all performance metrics decreased (Table 1). These results suggest that models trained on mosquitoes of a single sex may not generalize well to a different sex. Therefore, sex-specific data collection is crucial for achieving accurate age predictions across sexes.
Impact of origin—age grading for all mosquitoes collected from both origins
The average SERS spectra from CA and TH origins (Additional file 1: Figure S2A) clearly reveal distinct molecular fingerprints between these two groups. Specifically, the peaks at 1102 cm−1 (C–C/C–N stretching), 892 cm−1 (C–H bending), 726 cm−1 (adenine), and 631 cm−1 (C–C–C bending) are significantly higher in the CA-origin than the TH-origin. These differences suggest variations in the molecular composition and concentration between mosquitoes from the two strains, likely reflecting differences in both geographic origin and laboratory rearing methods. Both ANN models and t-SNE analysis (Additional file 1: Figure S2B and C) further supported these findings.
To assess model robustness across different origins, we tested it on all female spectral data from both CA and TH origins. The overall accuracy dropped to 80% (Table 1), lower than the accuracy achieved on individual datasets. Figure 4A shows that the model performed well in classifying day 1 and day 21 samples, correctly identifying 70 out of 73 and 59 out of 71 samples, respectively. However, it struggled with the intermediate days, particularly day 10 and day 18, where spectral similarities led to more misclassifications. The t-SNE plot (Fig. 4B) confirms this, showing more overlap between days 7, 10, 14, and 18 in the combined dataset.

Days classification and regression analysis for mosquitoes collected from both origins. A Confusion matrix showing the accuracy of the model in classifying mosquito samples by collection day. B t-SNE plot illustrating the clustering of mosquito samples based on collection day. C Regression analysis comparing the actual versus predicted collection days. D Predicted mosquito age (mean ± standard deviation)
Figure 4C shows the regression analysis, where the model achieved a strong correlation (R) of 0.93 and an RMSE of 2.52 days (Table 1). While the predictions for days 1 and 21 are closely aligned with the actual mosquito ages, there is greater variability in the predictions for the intermediate days, reflecting the same challenge observed in the classification task. This trend is further supported by the summary in Fig. 4D, where the standard deviations for intermediate ages (days 7 to 18) are higher—particularly for days 10, 14, and 18—indicating increased spectral variability that complicates precise age prediction in these ranges.
To reduce variations caused by differences in rearing locations, we tested the use of degree days instead of chronological days. While degree days improved accuracy for field-aged mosquitoes in our previous study [38], they had a limited impact on model performance in the current dataset. Using degree days, the R-value decreased slightly to 0.91, and the RMSE was 37.45 degree days, approximately equivalent to 2.69 chronological days (Table 1). This indicates that the impact of differing origins cannot be fully mitigated by relying solely on degree days in this case.
Despite the decreased accuracy on individual SERS spectra, applying the same voting mechanism (as previously described) to each individual mosquito, with a threshold set to 55% (see Additional file 1: Table S1), again resulted in 100% accurate classification of mosquitoes in the test set. This demonstrates that the voting strategy effectively mitigates the impact of origin-related variability. In contrast, when the non-ANN model was applied, the overall performance decreased significantly to 37% (Additional file 1: Table S4). The robustness of our model to other domain shifts (such as diverse strains and rearing environments) will be further investigated in future work.