MedElevator Войти в исследования
← Поиск публикаций

DOI 10.1093/jaoacint/qsaf022

Медицинская библиотека · Journal of AOAC International · 2026

Rapid Authentication of Plant-Based Milk Alternatives by Coupling Portable Raman Spectroscopy With Machine Learning.

Le Hieu M, Li Tianqi, Villareal Jimena G, Gao Jie, Hu Yaxi

СтатьяПеревод в очереди

Аннотация

BACKGROUND

Plant-based milk alternatives (PBMA) are increasingly popular due to rising lactose intolerance and environmental concerns over traditional dairy products. However, limited efforts have been made to develop rapid authentication methods to verify their biological origin.

OBJECTIVE

In this study, we developed a rapid, on-site analytical method for the authentication and identification of PBMA made by six different plant species using a portable Raman spectrometer coupled with machine learning.

METHODS

Unprocessed PBMA (i.e., blended raw nut/grain) and processed PBMA that mimic the industrial processing procedures (i.e., filtration and pasteurization) were prepared in the laboratory and subjected to Raman spectral collection without any sample preparation. Three machine learning algorithms (i.e., k-nearest neighbor [KNN], support vector machine [SVM], and random forest [RF]) were tested and compared.

RESULTS

RF achieved the best performance in recognizing the plant sources for the unprocessed PBMA, with accuracies of 96.88 and 95.83% in the cross-validation and test set prediction, respectively. Due to small sample size and risk of overfitting, classification models for the biological origin of processed PBMA were constructed by combining Raman spectra of the unprocessed and processed samples. Again, RF models achieved the highest accuracy in identifying the species, i.e., 94.27% in cross-validation and 94.44% in prediction.

CONCLUSIONS

These results indicated that the portable Raman spectrometer captured the chemical fingerprints that can effectively identify the plant species of different PBMA. Using this nondestructive Raman spectroscopic-based method, the overall analysis from sample to answer was completed within 5 min, providing inspection laboratories a rapid and reliable screening tool to ensure the authenticity of the biological origin of PBMA.

HIGHLIGHTS: This study presents a novel method for rapid and nondestructive identification of the plant sources of PBMA (both unprocessed and processed) based on the Raman spectroscopic technique and machine learning algorithms.

Другие публикации по теме

Spectrum Analysis, RamanMachine LearningSupport Vector MachineMilk
Для цитирования: Le Hieu M, Li Tianqi, Villareal Jimena G, Gao Jie, Hu Yaxi. Rapid Authentication of Plant-Based Milk Alternatives by Coupling Portable Raman Spectroscopy With Machine Learning.. Journal of AOAC International. 2026. DOI: 10.1093/jaoacint/qsaf022.

Перевод полного текста: Перевод в очереди

Полный текст источника

https://creativecommons.org/licenses/by-nc-nd/4.0/ This is an Open Access article distributed under the terms of the Creative Commons Attribution-NonCommercial-NoDerivs licence ( https://creativecommons.org/licenses/by-nc-nd/4.0/ ), which permits non-commercial reproduction and distribution of the work, in any medium, provided the original work is not altered or transformed in any way, and that the work is properly cited. For commercial re-use, please contact reprints@oup.com for reprints and translation rights for reprints. All other permissions can be obtained through our RightsLink service via the Permissions link on the article page on our site—for further information please contact journals.permissions@oup.com.

Текст сохранён. Часть иллюстраций пока доступна только в первоисточнике; загрузка будет проверена повторно.

Over the last decade, developing new alternatives of healthy foods has been a key focus of the food industry in response to the growing demands of consumers. The global market for plant-based milk alternatives (PBMA) is anticipated to surpass $62 billion in revenue by 2030 ( 1 ). Nowadays, consumers are becoming more aware of both the health and the environmental benefits of PBMA compared to their dairy counterparts ( 2 ). Moreover, over 50% of South American, African, Asian, and European population and 70% of African Americans are lactose intolerant ( 2–4 ), making PBMA an essential option. Ethical concerns about animal rights also drive a significant shift toward plant-based diets. The food and beverage industries are rapidly adapting to this trend and are expanding product variety from soy milk to nut milks (almonds, peanut, cashews, etc.) and grain milks (rice, oat, etc.). With the rapid growth in the demand for plant-based products, some producers exploit the market by selling fraudulent items. Expensive nuts, like walnuts, may be adulterated with cheaper alternatives like peanuts and soy to boost profit margins ( 5 ). This fraud has economic consequences, causing losses for both genuine companies and the end consumers, and poses public health risks, as the adulterants can be common allergens. Therefore, developing accurate and robust methods for authenticating the biological origin of PBMA has become a key focus for food scientists and the food industry.

Numerous authentication methods have been developed in recent years in an attempt to safeguard liquid food from fraudulent activities. These authentication techniques include chromatography-based detection (e.g., high-performance liquid chromatography [LC]) ( 6 ), spectroscopic techniques (e.g., UV-Vis spectroscopy ( 7 ), infrared spectroscopy ( 8 ), nuclear magnetic resonance spectroscopy ( 9 )), and qualitative DNA analysis ( 10 ). These techniques, often used in parallel, help ensure the authenticity, quality, and safety of liquid food by detecting adulterants, verifying biological and geographical origins, and identifying unique components present in certain food matrixes. Wang et al. provided an extensive overview on employing near-infrared spectroscopy (NIR) for quality analysis, classification, and authentication of liquid foods, including alcoholic beverages, nonalcoholic beverages, and dairy products ( 11 ). Regarding plant-based products, while substantial studies on the authentication of nuts and grains exist, only a few reported the use of analytical methods for the authentication of PBMA. DNA-based methods, such as PCR and DNA barcoding ( 5 , 10 ), appear to be dominant for the identification of plant species. Despite being highly effective, DNA-based methods are time consuming and costly, due to their reliance on expensive thermocyclers and DNA sequencing systems ( 10 ). High-resolution mass spectrometry (MS) has also been experimented with a wide range of ionization methods to enhance the sensitivity and efficiency of MS system in detecting foreign residuals ( 12 ), as well as coupled with LC for the classification of nuts ( 6 ). Although these LC-MS-based methods are faster and generating comprehensive results, the high capital cost, complexity of operation, and the need for trained personnel have restricted their wide applications. In addition, LC generates large volumes of hazardous waste during operation, which contradicts United Nations Sustainable Development Goals ( 13 ). Circumventing these disadvantages, Raman spectroscopy emerges as a promising solution for identifying the plant sources of PBMA.

Raman spectroscopy is a nondestructive and rapid technique, capable of accurately fingerprinting the chemical composition of complex sample matrixes. The analysis can be performed directly on liquid samples with minimal to no sample preparation, shortening the analysis time while reducing the complexity of sample handling. Raman spectroscopy has been widely applied in the agri-food industry for safety and quality control, classification, quantification, and adulteration detection ( 14 ). Raman spectroscopy has also demonstrated its ability to effectively differentiate a wide variety of products, including red meat (beef, venison, and lamb) ( 15 ), different types of fish ( 16 , 17 ), fruits and vegetables (olive oils of different quality) ( 18 ), fruits with varying geographical and botanical origin ( 19 ), dairy products (butter adulterated with margarine) ( 20 , 21 ), cheese brands discrimination ( 22 ), milk from different animals ( 23 ), and beverages (alcohol with different origins ( 24 ), coffee ( 25 )). While there are numerous studies on the classification of different nuts and grains in an attempt to detect potential adulterants ( 5 , 6 , 26 , 27 ), there has been no study exploring the feasibility of Raman spectroscopy for the identification of the plant sources of PBMA.

This study presents a novel method for classifying the plant sources of PBMA based on Raman spectral fingerprints and chemometric and machine learning models. Data preprocessing and machine learning algorithms were designed and optimized to achieve a high authentication accuracy. The impact of processing (i.e., filtration and pasteurization) on chemical composition of PBMA was also investigated, while machine learning algorithms were also applied for the authentication of processed samples.

Experimental

Materials and Method

PBMA samples preparation .—Products of intact raw almonds, cashews, macadamias, oats, pistachios, and walnuts were purchased from multiple sources, including grocery stores in Ottawa, ON, Canada and online platforms such as Amazon.

Samples of unprocessed PBMA were prepared by mixing 30 g of raw nuts/grains with 120 mL of distilled water in a Ninja blender (model SS101C) and blended in extraction mode for 90 s. A total of 144 unprocessed PBMA samples were prepared, comprising 24 biological replicates for each type of plant source. The prepared PBMA were stored in 50 mL microcentrifuge tubes at –20 °C for later usage. Aliquots of 1 mL of each sample were also prepared to avoid repeated freeze-thaw cycles on the samples.

To account for the impact of processing on chemical composition, filtered (F) as well as filtered and pasteurized (F&P) PBMA samples were also prepared. Filtration step could be used for PBMA production in catering setups, while filtration and pasteurization better mimic products typically found in grocery stores. Briefly, filtration was achieved by filtering the PBMA samples prepared in the laboratory through commercial grade ultra-fine-mesh strainer bags, while pasteurization was achieved by heating the filtered samples in a water bath maintained at 70°C for 30 min. These processed samples were stored at –20 °C for later usage. In total, 10 F samples and 10 F&P samples were prepared for each species.

Raman spectra collection .—The Raman spectra of PBMA were collected in the laboratory following the sample preparation. Raman spectra were collected in two batches with 3 months in between using a portable Raman spectrometer equipped with a 785 nm diode laser (EZRaman I-7A1S, Enwave Optronics, Inc., Irvine, CA, USA). Briefly, 2 mL of each PBMA sample was transferred into a 2.0 mL clear 8–425 mm glass vial (Jg Finneran) and positioned in the sample holder for spectral collection. The Raman spectral were collected at the maximum laser power of 282 mW over the wavenumber range of 100–2200 cm −1 , with an integration time of 60 s. A boxcar smoothing of 5 and automated baseline correction were applied to preprocess the spectral data. Each spectrum was exported to a .txt file, which contains the wavenumber in the first column and the signal intensity in the second column.

Preprocessing of Raman spectra .—To simplify the spectra preprocessing, spectral alignment was performed to combine individual spectrum into a single .txt file, which contains the wavenumber in the first column, and signal intensity of each sample in the following columns. First, the spectra were auto-scaled to minimize the batch-to-batch variation potentially caused by changes in the Raman spectrometer (e.g., laser power and sensitivity of detector) between batches. Additional spectral preprocessing procedures were optimized for downstream classification modeling. Specifically, different algorithms and parameters of normalization (i.e., area under curve and min-max) and spectral smoothing (i.e., polynomial order and derivative order) were tested using the Rampy ( 28 ) package in Python 3. Details of preprocessing methods and their impact on the classification results are described in the Supplemental Text S1 and S2 . After comparing the performance of different algorithms ( see Supplemental Table S1 and Figure S1 ), the optimal spectral preprocessing procedure includes a separate autoscaling for each batch, followed by an area-under-curve normalization, without derivatization.

Chemometric analysis and machine learning.— To evaluate the feasibility of Raman spectroscopy for the differentiation of PBMA made of different plant species, chemometric and machine learning algorithms, specifically unsupervised principal component analysis (PCA) and supervised support vector machines (SVM), k-nearest neighbor (KNN) and random forest (RF), were employed. These models were constructed based on the Scikit-Learn package in Python 3 ( 29 ).

Two data sets were defined in this study: the unprocessed PBMA dataset and the combined PBMA data set. The unprocessed PBMA data set only contains Raman spectra of unprocessed samples. Accounting for the impact of commercial processing procedures on chemical composition, a second data set (i.e., combined PBMA data set) containing Raman spectra of both the unprocessed and processed PBMA samples (i.e., F and F&P samples) was prepared. Each data set was randomly split into a training set for calibration and cross-validation and a testing set for prediction. Specifically, the unprocessed data set was split into 60% for training and 40% for prediction. For the combined data set, the unprocessed spectra were split using the same ratio as above, while the F and F&P spectra were split into 80% for training and 20% for validation due to the smaller number of samples available in this study. Details of the number of samples can be found in Supplemental Table S2 .

Machine learning algorithms were performed on both the unprocessed and combined PBMA data sets. Performance of the classification algorithms was evaluated based on the overall model accuracy and species-specific specificity, sensitivity, precision, F1-score, and the area under curve of the receiver operating characteristic (AUC-ROC) of calibration, leave-one-out cross-validation (LOO-CV) and prediction models. Calculation of the parameters are summarized below ( 30 ):

where TP = true positive, TN = true negative, FP = false positive, and FN = false positive.

Results and Discussion

Raman Spectral Fingerprints of PBMA

To generate representative Raman spectral fingerprints of PBMA, the spectra for each species were averaged to obtain a single spectrum. Three averaged spectra were generated for each species, corresponding to PBMA processed using three different methods: unprocessed ( Figure 1 ), filtered ( see Supplemental Figure S2A ), and filtered and pasteurized ( see Supplemental Figure S2B ).

Иллюстрация — в первоисточнике ↗

Figure 1. Averaged Raman spectra of unprocessed PBMA samples. The PBMA samples include almond (Al), cashew (Ca), macadamia (Ma), oat (Oa), pistachio (Pi), and walnut (Wa).

For the unprocessed PBMA samples ( Figure 1 ), regardless of the plant species, the spectra share similar shape and characteristic peaks, with some variations in signal intensities. A summary of peak assignment is presented in Table 1 . Most of the Raman bands observed in the fingerprint region are attributed to lipids and proteins ( 31 ), whose contents are crucial in the discrimination of plant sources. Excluding the two widest bands contributed by the vial (460–530 cm −1 and 1280–1420 cm −1 bands, as shown in Supplemental Figure S3 ), the highest Raman peak for PBMA at 1440 cm −1 except for oat is attributed to the CH 2 deformation vibration of saturated fatty acid, which was also observed in previous studies for almond ( 32 ), peanut ( 33 ), and pistachio ( 27 ). The low intensity of this peak in the oat samples corresponds to the notably lower lipid content of oats compared to other plant species used for PBMA ( 34 ). The Raman peak at 1655 cm −1 is assigned to the C=C stretching vibration of polyunsaturated cis fatty acids and amide I in protein structure in the samples ( 32 ). Similarly, due to a lower lipid content, the averaged spectrum had a weaker intensity in oat. The peak at 1743 cm −1 , being almost absent in oat spectrum, is also attributed to a lipid structure of the C=O stretching of triglyceride. The Raman peaks at 1550 cm −1 , 1264 cm −1 , 1083 cm −1 corresponding to amide II vibration of protein structure, CH in-plane bending modes of ethylene groups ( 8 ), and C-C and C-H stretches in starch content ( 8 , 27 ), respectively, appeared to be similar among all species. Moreover, oat samples exhibited unique starch peaks at 1120 cm −1 , 935 cm −1 , and 478 cm −1 , which are either absent or barely visible in the other samples ( 35 ). Especially, the widely known marker peak 478 cm −1 is characterized by pyranose ring of amylose and amylopectin, confirming the substantially higher starch content in oat samples ( 36 ).

Table 1.
Peak assignments of Raman spectra.

WavenumberAssignment ( 8 , 27 , 32 , 33 , 35 , 36 )
1743C=O stretching of ester groups of triglyceride
1655C=C stretching vibration of polyunsaturated cis fatty acids/Amide I
1505–1560v(C=C)/Trytophan/Amide II
1440CH 2 deformation of fatty acid
1345–1350Peak from the vial
1309CH 3 /CH 2 twisting or bending mode of lipid
1264CH in-plane bending modes of ethylene groups/Lipids
1118C-C mobility of hydrocarbon chains/Lipid
1083C-C mobility of hydrocarbon chains/Lipid
975Lipid/=C-H out of plane deformation
805–900Symmetric CCC stretches
600–755Out of plane deformation of olefinic CH and OH groups
470–490Pyranose ring of amylose and amylopectin

The spectra of filtered samples retained similar shape to the pre-filtered unprocessed ones, conserving most of the peaks that appeared prior to the filtration process, although with reduced intensity ( see Supplemental Figure S2A ). This is the result of reduced concentration of solid particulates after filtration, which can influence the Raman scattering efficiency. Higher particulates content in unprocessed samples can lead to increased scattering, producing higher-intensity peaks. The two fatty acid bands at 1655 cm −1 and 1440 cm −1 in the filtered PBMA made with nuts had lower intensities compared to the corresponding ones in the pre-filtered group (i.e., unprocessed), except for that of walnut. Oat sample remains to have the lowest lipid content and highest starch content, as explained above.

When subjected to pasteurization process, a substantial decrease in the intensities of the characteristic peaks was observed ( see Supplemental Figure S2B ), which may be caused by the denaturation of chemicals in the samples. A study found that heating almond milk to a temperature between 55 and 75 °C caused denaturation and partial aggregation of proteins, leading to the lower intensity of the peaks at wavenumber of 1655 cm −1 and 1440 ( 37 ). The 1440 cm −1 band of walnut sample is almost absent in pasteurized samples, indicating the extensive degradation of the lipids in walnut, possibly attributed to the susceptibility of polyunsaturated fatty acids that are of higher amount in walnuts ( 38 ). In addition, pasteurization broke down the starch in oat milk ( 39 ), resulting in the disappearance of several bands attributed to the constituents of starch. For example, the intensity of the peak at wavenumber of 1120 cm −1 decreased nearly to the level of nut samples, while the 478 cm −1 band can be observed on the same intensity as pistachio.

Explorative Analysis of Raman Spectra of PBMA Samples

As explained above, the portable Raman spectrometer detected intensity changes in proteins, lipids, and carbohydrates, the major molecular constituents of nuts. However, no obvious trend correlating to the plant species of PBMA was identified by the naked eye, making it impossible to establish a definitive cutoff value or intensity range for different types of PBMA samples. The differences become even more subtle after processing procedures, indicating the need for statistical tools to facilitate pattern recognition.

PCA was applied to the spectra of unprocessed samples to initially investigate the ability of Raman spectroscopy in identifying patterns of different PBMA. To minimize the spectral variation between batches ( see Supplemental Figure S1 ), spectra in different batches were normalized and auto-scaled separately ( see Supplemental Text S1 and S2 ). The PCA score plot of the preprocessed spectra ( Figure 2A ) demonstrated that 46% of the total variance in the data set was captured by Principal Component 1 (PC1) (34%) and Principal Component 2 (PC2) (12%). As expected, oat samples were separated completely from the other PBMA samples. This distinction can be attributed to their drastically different composition in lipids and starch as discussed in the above section. For the other types of PBMA, although intra-species samples cluster together with a few exceptions, there are overlaps between the inter-species samples. Of all the nut samples, pistachio showed the best separation, followed by macadamia and cashew PBMA samples, with limited inter-species overlapping. However, three pistachio samples are observed near almond and walnut clusters, indicating chemical similarities among these plant sources. Almond and walnut samples show severe overlap, occupying the same area in the score plot. Previous studies that investigated the chemical composition of walnut and almond also observed similarities in their fatty acid content ( 38 ) and other nutrients ( 40 ). In general, all nut samples appeared in close vicinity to each other with some overlapping. Thus, more effective machine learning algorithms need to be explored to better differentiate PBMA species based on Raman spectral information.

Иллюстрация — в первоисточнике ↗

Figure 2. PCA score plot constructed using A) 144 Raman spectra of unprocessed PBMA samples (unprocessed data set), and B) 264 Raman spectra of both unprocessed and processed PBMA samples (combined data set). For each data set, the data was auto-scaled and normalized with AUC. The PBMA samples include almond (Al), cashew (Ca), macadamia (Ma), oat (Oa), pistachio (Pi), and walnut (Wa).

Commercial PBMA products are usually processed by filtration and pasteurization. To investigate the impact of these processing procedures on the Raman active molecules and on the authentication performance, we created a combined data set consisting of both unprocessed and processed samples (as described in method section).

Again, PCA was applied to explore the similarities of the processed samples and the unprocessed samples. Similar to the PCA score plot for unprocessed samples, this new plot demonstrated clear separation of oat samples from others, except for one FP sample clustering with macadamia. While unprocessed cashew and macadamia samples remain distinct, their processed samples severely overlap. Processed almond, cashew, macadamia, and walnut samples clustered together near –20 on PC1 and 0 on PC2, indicating high similarity in their Raman spectra. Pistachio samples are more scattered with the central point not overlapping with other plant species, but nine of them overlapped with the walnut and almond clusters. Overall, processed PBMA samples of nut species clustered closer together than the unprocessed samples, further confirming the need of supervised machine learning algorithms for the authentication of plant species of PBMA.

Preliminary Testing of Supervised Classification Algorithms

Preliminary testing of three algorithms (i.e., SVM, KNN, RF) was conducted using LOO-CV on the training set of the unprocessed data set. For SVM, linear kernel obtained a low accuracy of 80.21% ( see Supplemental Figure S4 ), indicating a nonlinear trend in the data set. Thus, radial basis function kernel was chosen for SVM to capture the underlying complex patterns. For KNN, the highest accuracy in LOO-CV was observed at k = 4 among the tested k value from 1 to 10 inclusively ( see Supplemental Figure S5 ). Lastly, in RF, the performance generally improves with a higher number of estimators (i.e., decision trees), but this comes with a tradeoff of making the model more computationally expensive. To find the optimal parameter, RF models were constructed with different number of estimators using a grid search. No substantial improvement was observed in the performance of RF once the number of estimators reached 100 ( see Supplemental Figure S6 ). Therefore, to ensure the rapidness and efficiency of the method from sample to answer, 100 estimators was determined to be optimal for the RF model.

The performance of the three machine learning models was assessed based on the results of LOO-CV ( Figure 3A–C ) and test set prediction ( Figure 3D–F ) for the unprocessed data set. CV results demonstrated notable differences in accuracy and misclassification patterns among the three algorithms. The SVM classifier achieved an accuracy of 93.75% in CV, where most classifications aligned with the true labels. However, minor misclassifications occurred, such as one almond, one cashew, and two oat samples incorrectly labeled as pistachio. These errors indicated that SVM struggles with subtle spectral similarities between closely related classes. On the other hand, the KNN classifier performed the best with an accuracy of 96.88% in CV, demonstrating fewer errors overall. While it perfectly classified most classes, two almond samples were misclassified as walnut, and one macadamia sample was confused with cashew. The RF classifier had an accuracy of 95.83% in CV, slightly better than SVM but lower than KNN. It achieved 100% accuracy on oat and pistachio samples but misclassified one sample for each of the other species. Overall, KNN emerged as the most accurate model, followed by RF and SVM.

Иллюстрация — в первоисточнике ↗

Figure 3. Confusion matrices of the classification results for cross-validation (A, B, C) and test set classification (D, E, F) for unprocessed PBMA data set obtained using SVM (A, D), KNN (B, E), and RF (C, F), based on the normalized and auto-scaled Raman spectral data set.

For classification of unknown samples (i.e., prediction), despite the overlaps discussed in the PCA plot, all three algorithms achieved 100% accuracy for identifying almond, cashew, and oat samples, as demonstrated in the diagonal squares of each confusion matrix ( Figure 3D–F ). In addition, RF achieved 100% accuracy for macadamia and walnut, while SVM and KNN misidentified some samples in either species. All algorithms demonstrated difficulty in classifying pistachio, with accuracies being 75, 62.5, 75% for SVM, KNN, and RF, respectively. Notably, all misidentified pistachio samples were recognized as almond, which can be explained by their similarities in the lipid and protein content ( 38 ). Overall, the RF model achieved the highest prediction accuracy of 95.83%, followed by SVM (93.75%) and KNN (91.67%).

Our results suggested that RF is the best model among the three algorithms for identifying PBMA plant sources based on their Raman spectra. While KNN achieved the highest accuracy in CV, its performance dropped to 91.67% for the prediction of new samples. In contrast, RF maintained consistent accuracy of 95.83% across both CV and test sets, demonstrating superior robustness and generalizability. In addition, RF is known for its ability to efficiently capture the patterns of complex data types, including high-dimensional, nonlinear data sets such as spectral data ( 41 ). As such, RF was further investigated and optimized for the authentication of PBMA.

Tuning of RF Hyperparameters

In the RF classifier, hyperparameters like the number of trees, maximum tree depth, and maximum features can affect the performance. Tuning these parameters can potentially enhance the performance of the classification. Therefore, an extensive grid search with six different hyperparameters was performed on the unprocessed data set. The hyperparameter details were recorded in Supplemental Table S3 , with the best combination of hyperparameters in bold red font. This combination achieved a 95.83% accuracy in CV. Although no improvement was observed over the nonoptimized model ( Figure 3C ) due to the small sample size, the fine-tuned parameters are expected to be beneficial when the data set grows.

In addition to tuning hyperparameters, we extracted the important features that contributed most substantially to the classification using the built-in extraction function of RF. Specifically, we evaluated the RF model’s performance using different numbers of top features (i.e., from 100 to 500 features with a step size of 50 features). Supplemental Figure S7 shows the classification accuracy corresponding to each selection. The model achieved a peak CV accuracy of 96.88% using the top 150 or 250 features, improving from 95.83% without feature selection. This result highlights the effectiveness of the RF feature extraction function for the removal of unnecessary information, such as instrumental noise and intra-species variations. Since the goal was to maintain sufficient features to account for potential variation, a feature number of 250 was selected as the optimal for model construction.

Additionally, the Raman shift values and chemical information of the top 100 (out of 250) features were also investigated ( see Supplemental Figure S8 ). The features near the two peaks representing fatty acids (at 1440 cm −1 and 1655 cm −1 ) were the most prominent, with 15 and 16 features, respectively, highlighting their significant contribution to the classification model. Five features in the region of pyranose ring around 480 cm −1 were involved. Features around the peaks 975, 1083, and 1118 cm −1 were also used for RF model construction with lower frequencies. The remaining features scattered around the unidentified peaks at 900, 818, 737, and 685 cm −1 , indicating that while well-known fatty acid peaks are key contributors, subtle features also play a significant role in differentiating the plant species. Notably, the peaks attributed to the vial (1345 cm −1 to 1350 cm −1 ) were not identified as key features by RF, indicating that they did not affect the classification performance of the model.

Note that hyperparameter tuning and feature selection are model-specific, with each model requiring unique parameters and feature sets tailored to the target data set. Optimal hyperparameters for different data sets were determined during model construction. This section demonstrates, as an example, the optimization procedure of the RF classifier for the unprocessed PBMA data set.

Identification of plant species in unprocessed PBMA samples.— Following the optimization of hyperparameters and feature selection of RF classifier for the unprocessed PBMA data set, we further investigated the classification performance by comparing its calibration, cross-validation, and test results.

The model achieved 100% accuracy in calibration ( Figure 4A ) and 96.88% accuracy in LOO CV ( Figure 4B ; see Supplemental Table S4 ), indicating a minimal overfitting. All macadamia, oat, and pistachio samples were correctly classified, while almond, macadamia, and walnut each had one misclassification. Validation of this RF model using the external test set further confirmed the robustness of the model ( Figure 4C ; see Supplemental Table S5 ). While the prediction accuracy (i.e., 95.83%) was slightly lower than that of the LOO-CV, all species were correctly identified except for pistachio. Despite overlaps between almond and walnut in PCA analysis, the highly accurate results highlighted the reliability of RF algorithms for classification and its sensitivity to subtle differences in the data.

Although the application of Raman spectroscopy combined with chemometric analysis in plant-based milk studies is still emerging, these techniques have been extensively utilized for the classification of plant oils and flours. For instance, Zhao and others ( 42 ) reported that RF achieved a high accuracy of 92.9% for the classification of eight different plant oils based on Raman spectral data set, while Ozen et al. provided a comprehensive review of studies leveraging Raman spectroscopy and chemometrics for the analysis of edible oils ( 43 ), emphasizing the growing relevance of this approach. While identification of adulterated samples was not a focus of our study, the six-way classification for PBMA species has provided insight and solid foundation for future efforts in detecting PBMA adulteration using Raman spectroscopy and machine learning algorithms.

Identification of plant species in processed PBMA samples (F and F&P).— As mentioned, commercial plant-based milk products typically undergo industrial processes like filtration and pasteurization, which introduce chemical changes ( 37 ). Thus, further investigation of species identification for processed samples is thus needed.

Initially, the RF model trained on the unprocessed PBMA (i.e., model described in the previous section) was directly applied to the processed PBMA samples to investigate the generalizability of the model. As expected, the model exhibited poor performance on the processed samples, with a low overall accuracy of 53.33% ( see Supplemental Figure S9 ). This result underscored the discrepancy between the spectra of unprocessed and processed PBMA samples, showing the challenge in classifying processed samples. To address this, a new RF classification model using the Raman spectra of the processed PBMA data set ( see Supplemental Table S2 ), with optimized hyperparameters listed in the Supplemental in Table S6 , was constructed. This model ( see Supplemental Figure S10 ) provided improved performance compared to the previous one, achieving 100% accuracy in calibration, 89.58% accuracy in LOO-CV, and 91.67% accuracy in test set classification. Despite the improvement, the substantial decrease in accuracy between calibration and LOO-CV indicated the presence of model overfitting, hindering the generalizability of the model. Therefore, a third RF model was constructed using a combined PBMA data set, which included the unprocessed and processed samples. The optimal hyperparameters for the classifier built on the combined data set are provided in Supplemental Table S7 . Only plant species were labeled since the goal of this study is to classify PBMA based on the plant species rather than by processing methods.

The performance of the calibration, LOO-CV, and test set classification of RF classification model on the combined PBMA data set is illustrated in Figure 5 . The calibration results achieved a 100% accuracy with no misclassifications ( Figure 5A ; see Supplemental Table S8 ), while the accuracy only decreased slightly to 94.27% in LOO-CV ( Figure 5B ; see Supplemental Table S9 ), indicating improved robustness compared to the previous model. Although the model achieves 100% accuracy for oat and macadamia samples in LOO-CV, some misclassifications were observed for cashew (four samples), almond (two samples), pistachio (two samples), and walnut (three samples). Further validation of the model using the test set demonstrated an accuracy comparable to that of LOO-CV (i.e., 94.44%, Figure 5C ), with all almond, cashew, and macadamia samples identified correctly. Only four samples belonging to oat, walnut, or pistachio were misidentified. Of these misidentified samples, only the oat one was processed (F&P sample), while the other three were unprocessed. Despite having fewer samples in the training set, 23 out of 24 processed samples were correctly identified. This indicates that mixing samples from different processing methods is an effective strategy to classify processed PBMA samples. Furthermore, doing so does not impede the robustness of the RF algorithm, as the test set prediction accuracies for unprocessed PBMA data set (95.83%) and combined PBMA data set (94.44%) were highly comparable.

Classification by SVM and KNN with features selected by RF.— Although RF is effective for PBMA classification, it is known to be more computationally expensive than KNN and SVM ( 44 ). Furthermore, SVM may perform better with lower-dimensional data sets ( 45 ). To simplify the analysis and reduce cost, one additional strategy was investigated to improve the performance of KNN and SVM models. Specifically, KNN and SVM models were constructed using the Raman spectral features selected by the RF model. This strategy was tested for both unprocessed and combined PBMA data sets ( Figures 6 and 7 ), and the accuracies of prediction of these models with selected features were compared with the previous models constructed using all features (i.e., models used for preliminary testing). Improvements were observed for SVM classification models on both data sets. For unprocessed PBMA testing data, prediction accuracy improved by 2.08% after feature selection ( Figure 6A and B ), with one additional walnut sample correctly identified. Similarly, combined PBMA test set showed a 2.77% accuracy increase, surpassing RF's accuracy ( Figure 6C and D ). This improvement was driven by macadamia and walnut samples, which achieved 100% accuracy after feature selection, up from 83.33%. In contrast to SVM, the KNN classifier only showed improvement for the unprocessed PBMA data set after feature selection, with an increase of 4.16% in prediction accuracy ( Figure 7A and B ). Pistachio samples continued to be misclassified, although misclassifications reduced slightly from four samples to two samples. For the combined PBMA data set, KNN achieved no accuracy gain, maintaining 91.67% before and after feature selection ( Figure 7C and D ). Overall, 3 out of 4 SVM and KNN models demonstrated improved performance. These results highlighted the effectiveness of the feature selection for preserving key features while removing noise. This approach is especially beneficial for machine learning algorithms, like SVM, that work well with data seta of lower dimensions.

Иллюстрация — в первоисточнике ↗

Figure 4. Confusion matrices showing the calibration result (A), cross-validation result (B), and the prediction result of test set (C) of RF model on unprocessed PBMA data set.

Иллюстрация — в первоисточнике ↗

Figure 5. Confusion matrices showing the calibration result (A), cross-validation result (B), and the prediction result of test set (C) of RF model on combined PBMA data set.

Иллюстрация — в первоисточнике ↗

Figure 6. Test set prediction results of SVM classifier for unprocessed PBMA data set (A, B) and combined PBMA data set (C, D) before and after feature selection by RF.

Иллюстрация — в первоисточнике ↗

Figure 7. Test set prediction results of KNN classifier for unprocessed PBMA data set (A, B) and combined PBMA data set (C, D) before and after feature selection by RF.

Conclusion

Raman spectra of six PBMA species, obtained with a portable Raman spectrometer, were processed with machine learning algorithms to identify plant species. Preliminary tests confirmed the effectiveness of RF for the authentication of plant species in PBMA. After parameter tuning and feature selection, the RF model constructed for the Raman spectral of unprocessed samples achieved an overall accuracy of 95.83% for prediction. The RF algorithm also achieved a high overall accuracy of 94.44% for the test set of the combined data set including both unprocessed and processed samples. The high accuracy of the result confirmed the effectiveness of using combined data set (i.e., regardless of processing) for the authentication of plant species of PBMA. With the addition of more samples into the training set, the performance of RF classifiers is expected to further improve. Additionally, feature selection using RF’s importance function improved the performance of SVM and KNN models by effectively reducing redundant features and noise. The former improved the prediction accuracy by 2.08 and 2.77% for unprocessed and combined PBMA data sets, respectively, while the latter enhanced the accuracy for the unprocessed PBMA data set by 4.16%. Requiring <2 min for spectral acquisition and <1 min for classification, the Raman spectroscopy and machine learning-based method has significant potential to be adopted by inspection and testing laboratories for rapid and accurate authentication of PBMA and agri-food products.

CrediT Author Statement

Hieu Minh Le (Data curation [Equal], Formal analysis [Lead], Methodology [Supporting], Validation [Equal], Writing—original draft [Lead]), Tianqi Li (Data curation [Equal], Methodology [Supporting]), Jimena Villareal(Data curation [Supporting], Methodology [Supporting]), Jie Gao (Funding acquisition [Supporting], Investigation [Equal], Writing—review & editing [Supporting]), and Yaxi Hu (Conceptualization [Lead], Formal analysis [Supporting], Funding acquisition [Lead], Investigation [Equal], Methodology [Equal], Supervision [Lead], Validation [Equal], Writing—review & editing [Lead])

Supplemental Information

Supplemental information is available on the J. AOAC Int . website.

Supplementary Material

Acknowledgments

This study was supported by NSERC Discovery Grant (RGPIN-2022–04892) and Carleton REALISE Seed Grant to Dr. Yaxi Hu and Dr. Jie Gao. The authors would like to thank Dr. Xiaonan Lu at McGill University for generously lending the portable Raman spectrometer and Reyhan Li at Carleton University for her contribution in PBMA sample preparation.

Conflict of Interest

The authors declare no known competing financial interests or personal relationships that could have influenced this study.

References

1 Mekanna A.N. , Issa A. , Bogueva D. , Bou-Mitri C. ( 2024 ) Int. J. Food Sci. Technol . 59 , 8796 – 8805 , 10.1111/ijfs.17517

2 Sethi S. , Tyagi S.K. , Anurag R.K. ( 2016 ) J. Food Sci. Technol . 53 , 3408 – 3423 , 10.1007/s13197-016-2328-3 27777447 PMC5069255

3 Scrimshaw N.S. , Murray E.B. ( 1988 ) Am. J. Clin. Nutr . 48 , 1142 – 1159 , 10.1093/ajcn/48.4.1142 3140651

4 Bayless T.M. , Brown E. , Paige D.M. ( 2017 ) Curr. Gastroenterol. Rep . 19 , 23 , 10.1007/s11894-017-0558-9 28421381

5 Ding Y. , Jiang G. , Huang L. , Chen C. , Sun J. , Zhu C. (2020) J. Sci. Food Agric . 100 , 2372 – 2379 , 10.1002/jsfa.10241 31901140

6 Campmajó G. , Saurina J. , Núñez O. ( 2023 ) Food Control 152 , 109834 , 10.1016/j.foodcont.2023.109834

7 Kalogiouri N.P. , Mitsikaris P.D. , Papadopoulos A.N. , Samanidou V.F. ( 2022 ) Molecules 27 , 1435 , 10.3390/molecules27041435 35209222 PMC8875453

8 Czekus B. , Pećinar I. , Petrović I. , Paunović N. , Savić S. , Jovanović Z. , Stikić R. ( 2019 ) J. Cereal Sci . 87 , 25 – 30 , 10.1016/j.jcs.2019.02.011

9 Lolli V. , Caligiani A. ( 2024 ) Curr. Opin. Food Sci . 58 , 101200 , 10.1016/j.cofs.2024.101200

10 Ding Y. , Jiang G. , Huang L. , Chen C. , Sun J. , Zhu C. ( 2020 ) J. Sci. Food Agric . 100 , 2372 – 2379 , 10.1002/jsfa.10241 31901140

11 Wang L. , Sun D.-W. , Pu H. , Cheng J.-H. ( 2017 ) Crit. Rev. Food Sci. Nutr . 57 , 1524 – 1538 , 10.1080/10408398.2015.1115954 26745605

12 Hong Y. , Birse N. , Quinn B. , Montgomery H. , Wu D. , Rosas da Silva G. , van Ruth S.M. , Elliott C.T. ( 2022 ) NPJ Sci. Food 6 , 14 , 10.1038/s41538-022-00129-3 35149683 PMC8837636

13 Transforming our World: The 2030 Agenda for Sustainable Development | Department of Economic and Social Affairs, https://sdgs.un.org/publications/transforming-our-world-2030-agenda-sustainable-development-17981 (accessed January 14, 2025)

14 Yang D. , Ying Y. ( 2011 ) Appl. Spectrosc. Rev . 46 , 539 – 560 10.1080/05704928.2011.593216

15 Robert C. , Fraser-Miller S.J. , Jessep W.T. , Bain W.E. , Hicks T.M. , Ward J.F. , Craigie C.R. , Loeffen M. , Gordon K.C. ( 2021 ) Food Chem . 343 , 128441 , 10.1016/j.foodchem.2020.128441 33127228

16 Ren L. , Tian Y. , Yang X. , Wang Q. , Wang L. , Geng X. , Wang K. , Du Z. , Li Y. , Lin H. ( 2023 ) Food Chem . 400 , 134043 , 10.1016/j.foodchem.2022.134043 36058043

17 Hu Y. , Huang S.Y. , Lu X. ( 2023 ). Chem . 4 , 100052 , 10.1016/j.greeac.2023.100052

18 Muik B. , Lendl B. , Molina-Díaz A. , Ortega-Calderón D. , Ayora-Cañada M.J. ( 2004 ) J. Agric. Food Chem . 52 , 6055 – 6060 , 10.1021/jf049240e 15453666

19 Berghian-Grosan C. , Magdas D.A. ( 2020 ) Sci. Rep . 10 , 21152 , 10.1038/s41598-020-78159-8 33273608 PMC7713252

20 Nedeljković A. , Rösch P. , Popp J. , Miočinović J. , Radovanović M. , Pudja P. ( 2016 ) Food Anal. Methods 9 , 1315 – 1320 , 10.1007/s12161-015-0317-1

21 Uysal R.S. , Boyaci I.H. , Genis H.E. , Tamer U. ( 2013 ) Food Chem . 141 , 4397 – 4403 , 10.1016/j.foodchem.2013.06.061 23993631

22 Zhang Z.Y. ( 2020 ) J. Spectrosc . 2020 , 8896535 , 10.1155/2020/8896535

23 Amjad A. , Ullah R. , Khan S. , Bilal M. , Khan A. ( 2018 ) Vib. Spectrosc . 99 , 124 – 129 , 10.1016/j.vibspec.2018.09.003

24 Hategan A.R. , David M. , Berghian-Grosan C. , Magdas D.A. ( 2023 ) Food Chem. X 20 , 100902 , 10.1016/j.fochx.2023.100902 38144738 PMC10739978

25 Hu Q. , Sellers C. , Kwon J.S.I. , Wu H.J. ( 2022 ) Digit. Chem. Eng . 3 , 10.1016/j.dche.2022.100020 PMC9983029 36874955

26 Esteki M. , Vander Heyden Y. , Farajmand B. , Kolahderazi Y. ( 2017 ) Food Control 82 , 31 – 41 , 10.1016/j.foodcont.2017.06.014

27 Taylan O. , Cebi N. , Yilmaz M.T. , Sagdic O. , Ozdemir D. , Balubaid M. ( 2021 ) J. Sci. Food Agric . 101 , 1699 – 1708 , 10.1002/jsfa.10845 33006383

28 Le Losq C. ( 2018 ) Rampy: a Python library for processing spectroscopic (IR, Raman, XAS…) data, Zenodo . Software, https://ui.adsabs.harvard.edu/abs/2018zndo…4715040L

29 Pedregosa F. , Varoquaux G. , Gramfort A. , Michel V. , Thirion B. , Grisel O. , Blondel M. , Prettenhofer P. , Weiss R. , Dubourg V. ( 2011 ) J. Mach. Learn. Res . 12 , 2825 – 2830 , http://jmlr.org/papers/v12/pedregosa11a.html

30 Hu Y. , Zou L. , Huang X. , Lu X. ( 2017 ) Sci. Rep . 7 , 15162 , 10.1038/s41598-017-15389-3 29123198 PMC5680338

31 Singh S.K. , Jha S.K. , Chaudhary A. , Yadava R.D.S. , Rai S.B. ( 2010 ) Pharm. Biol . 48 , 134 – 141 , 10.3109/13880200903059388 20645829

32 Gallier S. , Gordon K.C. , Singh H. ( 2012 ) Food Chem . 132 , 1996 – 2006 , 10.1016/j.foodchem.2011.12.038

33 Zhu P.-F. , Yang Q.-L. , Zhao H.-Y. ( 2022 ) J. Integr. Agric . 21 , 2777 – 2785 , 10.1016/j.jia.2022.07.026

34 U.S. Department of Agriculture (USDA) . ( 2024 ) FoodData Central: Foundation Foods. Version Current , https://fdc.nal.usda.gov

35 Kizil R. , Irudayaraj J. , Seetharaman K. ( 2002 ) J. Agric. Food Chem . 50 , 3912 – 3918 10.1021/jf011652p 12083858

36 Almeida M.R. , Alves R.S. , Nascimbem L.B.L.R. , Stephani R. , Poppi R.J. , de Oliveira L.F.C. ( 2010 ) Anal. Bioanal. Chem . 397 , 2693 – 2701 , 10.1007/s00216-010-3566-2 20213166

37 Devnani B. , Ong L. , Kentish S. , Gras S. ( 2020 ) Food Chem . 325 , 126901 , 10.1016/j.foodchem.2020.126901 32387956

38 Maguire L.S. , O’Sullivan S.M. , Galvin K. , O’Connor T.P. , O’Brien N.M. ( 2004 ) Int. J. Food Sci. Nutr . 55 , 171 – 178 , 10.1080/09637480410001725175 15223592

39 Torbica A. , Pećinar I. , Lević S. , Belović M. , Jovičić M. , Stevanović Z.D. , Nedović V. ( 2023 ) Food Hydrocoll . 140 , 108591 , 10.1016/j.foodhyd.2023.10859

40 Gheise N.J.E. , Riasi A. , Shahneh A.Z. , Naseri V. , Kafilzadeh F. , Bolandnazar A. , Ahmadi F. ( 2023 ) Trop. Anim. Health Prod . 55 , 333 , 10.1007/s11250-023-03750-w 37768412

41 Qi Y. ( 2012 ) in Ensemble Machine Learning , edited by Zhang C. , Ma Y. , Springer , New York, NY , pp. 307–323, 10.1007/978-1-4419-9326-7_11

42 Zhao H. , Zhan Y. , Xu Z. , Nduwamungu J.J. , Zhou Y. , Powers R. , Xu C. ( 2022 ) Food Chem . 373 , 131471 , 10.1016/j.foodchem.2021.131471 34749090 PMC10304463

43 Ozen B. , Cavdaroglu C. , Tokatli F. ( 2024 ) Anal. Methods 16 , 4216 – 4233 , 10.1039/D4AY00562G 38899503

44 Boateng E.Y. , Otoo J. , Abaye D.A. ( 2020 ) J. Data Anal. Inf. Process . 8 , 41 – 57 , 10.4236/jdaip.2020.84020

45 Ahmad I. , Basheri M. , Iqbal M.J. , Rahim A. ( 2018 ) IEEE Access 6 , 33789 – 33795 , 10.1109/ACCESS.2018.2841987

Предметные рубрики MeSH

Подготовка и перевод публикации
Обработка статьи · этапы, ошибки и управление
Загрузка состояния…

История · было → стало

Состояние обновляется каждые 5 секунд, пока блок открыт. Процент показывается только там, где известен объём работы. Пауза останавливает продолжение этапа; текущий запрос к источнику может завершиться.

Тип публикации указан по данным источника. Уровень доказательности автоматически не присваивается.