Coffee producing area tracing method based on pyrazine fingerprint coupling stoichiometry and machine learning

By combining pyrazine fingerprinting with chemometrics and machine learning, along with high-performance liquid chromatography and various machine learning algorithms, the problems of subjectivity and low distinguishability in coffee origin identification have been solved, achieving high-precision coffee origin traceability and providing scientific and reliable technical support.

CN121595747APending Publication Date: 2026-03-03JIASHAN COMPIZINE BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511815610.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies for coffee origin identification and quality evaluation suffer from high subjectivity and low differentiation. They lack systematic analysis of the complex chemical fingerprint spectrum of coffee and have failed to achieve intelligent classification.

Method used

A coffee origin classification model was constructed by combining pyrazine fingerprinting with chemometrics and machine learning. Chromatographic data of coffee samples were collected by high performance liquid chromatography, and a common pattern control fingerprint spectrum was established. The model was then constructed by combining cluster analysis, principal component analysis and machine learning algorithms (such as random forest, decision tree, support vector machine and deep neural network).

Benefits of technology

It has achieved intelligent and high-precision identification of coffee origins, with an accuracy rate of up to 95.8%, providing scientific and reliable technical support for coffee quality control and origin traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121595747A_ABST
    Figure CN121595747A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of food quality analysis and machine learning, and provides a pyrazine fingerprint coupled stoichiometry and machine learning coffee origin tracing method, which sequentially comprises the following steps: pretreating coffee samples from different origins, and collecting chromatographic data of pyrazine compounds by adopting high performance liquid chromatography; establishing a fingerprint spectrum and carrying out similarity analysis; carrying out preliminary identification by utilizing a chemometrics method, exploring sample differences through clustering analysis and principal component analysis, and screening out five key chromatographic peaks with variable importance projection values greater than 1 based on an orthogonal partial least square method; and finally, by taking the key chromatographic peak data as input, constructing a coffee producing area classification model by utilizing a machine learning algorithm to realize accurate identification of the to-be-detected coffee producing area. Therefore, the defects of the traditional method in the aspects of accuracy and intelligence are overcome, and reliable technical support is provided for coffee quality control and origin traceability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of food quality analysis and machine learning technology, and in particular to a method for coffee origin traceability using pyrazine fingerprinting coupled with chemometrics and machine learning. Background Technology

[0002] As an important global economic crop, coffee has gained widespread recognition for its nutritional value and health benefits, and has gradually developed into an important product in the global beverage market. Therefore, coffee has become one of the most important economic crops in the world.

[0003] Pyrazines are heterocyclic compounds commonly found in pharmaceuticals and natural products. Studies have shown that pyrazine compounds possess antibacterial, antiviral, and antitumor activities. For example, modern pharmacological research indicates that tetramethylpyrazine in coffee is considered helpful in treating cardiovascular and cerebrovascular diseases, while 2,5-dimethylpyrazine is an important substrate or intermediate for hypoglycemic and antilipidemic drugs, including glipizide and acipimox. Furthermore, as many as 81 pyrazine compounds have been identified in coffee aroma, including 2-methylpyrazine, 2,3-dimethylpyrazine, 2,5-dimethylpyrazine, trimethylpyrazine, 2-ethyl-3-methylpyrazine, and tetramethylpyrazine. Pyrazine compounds are major contributors to coffee aroma and flavor; these compounds are formed during coffee roasting, and their content and type directly affect the flavor of coffee.

[0004] High-performance liquid chromatography (HPLC) offers high sensitivity, efficiency, precision, and resolution, with its advantages particularly evident in the detection of volatile compounds. Fingerprint analysis is a comprehensive and quantitative analytical method that can elucidate the complexity and correlation of components. Constructing fingerprint profiles is an effective method for chemical component identification and quality control; therefore, fingerprint analysis is considered an effective method for evaluating the quality of natural medicines.

[0005] Identifying coffee origin and evaluating its quality is crucial for international trade and consumer choice. Traditional methods rely primarily on sensory evaluation or single chemical component analysis, which suffers from high subjectivity and low discrimination. While HPLC technology has been used for food component analysis, current techniques are mostly limited to the detection of specific compounds, lacking systematic analysis of the complex chemical fingerprint of coffee and failing to incorporate machine learning for intelligent classification. Therefore, a comprehensive method integrating chemical fingerprinting and machine learning models is needed to improve the accuracy and efficiency of coffee origin identification. Summary of the Invention

[0006] To address the aforementioned shortcomings, the present invention aims to provide a coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning. This method overcomes the deficiencies of traditional methods in terms of accuracy and intelligence, providing reliable technical support for coffee quality control and origin traceability.

[0007] To achieve the above objectives, this invention provides a coffee origin traceability method based on pyrazine fingerprinting coupled with chemometry and machine learning, comprising the following steps: S1. Sample pretreatment: Extract, centrifuge, and filter coffee samples from different origins to prepare the test solution; S2. Fingerprint acquisition: The test solution is analyzed by high performance liquid chromatography to acquire chromatographic data of pyrazine compounds; S3. Fingerprint chromatogram establishment and similarity analysis: Collect chromatographic data of coffee from multiple origins, generate a control fingerprint chromatogram with a common pattern, and perform similarity analysis. S4. Preliminary Chemometric Identification: Based on the coffee chromatographic data described in S3, cluster analysis and principal component analysis were used to explore the natural grouping of samples and the differences in the population. An orthogonal partial least squares method was established to screen out 5 chromatographic peaks with an importance projection value greater than 1. S5. Machine learning model construction and identification: Using the five chromatographic peaks selected in step S4 as input data, a coffee origin classification model is trained using machine learning algorithms, and the origin of the coffee sample to be tested is identified through this model.

[0008] As a further improvement, after step S2 and before step S3, step S2a, analytical method validation, is included: the reliability of the high performance liquid chromatography analytical method in step S2 is validated through one or more of the following experiments: precision, stability and repeatability.

[0009] As a further improvement, in step S1, the sample pretreatment process includes: accurately weighing 2g of sample coffee bean powder, placing it in a 100 mL conical flask, adding 30%~90% methanol to make up to 10~100 mL, ultrasonically extracting at room temperature for 15~45 min, centrifuging and taking the supernatant, filtering it through a 0.22 μm filter membrane to obtain the test solution.

[0010] As a further improvement, in step S2, the chromatographic conditions of the high-performance liquid chromatography (HPLC) are as follows: the detection wavelength of the HPLC is 258~278 nm; the chromatographic column is a Sunfire C18 column with dimensions of 4.6 mm × 250 mm, a packing particle size of 5 μm, a pore size of 100 Å, and a column temperature of 40 °C; the mobile phase is: phase A is an aqueous solution containing 0.1% trifluoroacetic acid and 0.1% formic acid, phase B is acetonitrile, and the flow rate is 1.0 mL / min; the detection wavelength is 258~278 nm, and the injection run time is 30 min.

[0011] As a further improvement, in step S2, the elution method of the high-performance liquid chromatography is gradient elution, and the procedure is as follows: From 0 to 13 minutes, mobile phase A was maintained at 92% and mobile phase B at 8%. Over 13–14 minutes, mobile phase A decreased linearly from 92% to 85%, while mobile phase B increased linearly from 8% to 15%. Between 14 and 22 minutes, mobile phase A linearly increased from 85% to 92%, while mobile phase B linearly decreased from 15% to 8%. For 22-30 minutes, mobile phase A is maintained at 92% and mobile phase B is maintained at 8%.

[0012] As a further improvement, in step S5, the machine learning algorithm specifically includes: the construction of a random forest model, the construction of a decision tree model, the construction of a support vector machine model, the construction of a K-nearest neighbor algorithm model, and the construction of a deep neural network model; when constructing the above machine learning models, the dataset is divided into a training set and a test set in a ratio of 8:2, of which 96 data points are used for training and 24 data points are used for testing.

[0013] As a further improvement, the structure of the deep neural network model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The training parameters of the deep neural network model are: batch size 32, learning rate 0.001, training epochs 1000, and the input data is standardized.

[0014] As a further improvement, in step S3, the fingerprint spectrum comparison conditions are to use the median method or the mean method, and the time window width is 0.1~0.2 min.

[0015] Due to the adoption of the above technical solution, the beneficial effects of the present invention are as follows: The method is highly innovative: it integrates high performance liquid chromatography (HPLC) fingerprinting technology with chemometrics and its learning to create a brand-new systematic coffee traceability solution.

[0016] Precise and efficient identification: Key differential flavor markers are accurately identified through orthogonal partial least squares discriminant analysis (OPLS-DA); and an identification model is built using deep neural network (DNN) algorithm, achieving an accuracy of up to 95.8%, thus realizing intelligent and high-precision origin identification.

[0017] The results are scientific and reliable: By combining principal component analysis (PCA) and cluster analysis (HAC), the differences in the chemical characteristics of coffee from different origins and the credibility of the model were verified from multiple dimensions, and the conclusions are scientific and reliable.

[0018] High theoretical and practical value: It not only deepens the theoretical understanding of the coffee flavor formation mechanism, but also provides direct technical support and theoretical basis for quality control, standardization and product traceability in the coffee industry. Attached Figure Description

[0019] Figure 1 This is an overview diagram of the technical flow of the present invention; Figure 2 The superimposed fingerprint spectrum (S1~S40) and the reference spectrum (R) of the present invention are shown. Figure 3 This is the HPLC chromatogram of the mixed reference solution of the present invention; Figure 4 This is a dendrogram of coffee sample clustering analysis according to the present invention; Figure 5 This is a principal component analysis score chart of the coffee sample according to the present invention; Figure 6 The diagram shows the analysis results of the orthogonal partial least squares method of the present invention, where a is the score diagram of the orthogonal partial least squares method, b is the VIP value, and c is the permutation test diagram. Figure 7 The diagram shows the ROC curve and confusion matrix of the random forest model of the present invention, where a is the ROC curve of the random forest model and b is the confusion matrix of the random forest model. Figure 8 The diagram shows the ROC curve and confusion matrix of the decision tree model of the present invention, where a is the ROC curve of the decision tree model and b is the confusion matrix of the decision tree model. Figure 9 The diagram shows the ROC curve and confusion matrix of the support vector machine model of the present invention, where a is the ROC curve of the support vector machine model and b is the confusion matrix of the support vector machine model. Figure 10 The diagram shows the ROC curve and confusion matrix of the K-nearest neighbor algorithm model of the present invention, where a is the ROC curve of the K-nearest neighbor algorithm model and b is the confusion matrix of the K-nearest neighbor algorithm model. Figure 11 The diagram shows the accuracy, loss curve, ROC curve, and confusion matrix of the CNN model of this invention, where A is the accuracy diagram of the CNN model, B is the loss curve diagram of the CNN model, C is the ROC curve diagram of the CNN model, and D is the confusion matrix diagram of the CNN model. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0021] This invention provides a method for coffee origin traceability based on pyrazine fingerprinting coupled with chemometry and machine learning, comprising the following steps: S1. Sample pretreatment: Classify coffee samples from different origins, accurately weigh 2g of coffee bean powder, place them in a 100mL conical flask, add 50%~70% methanol to a final volume of 10~100mL, and extract by ultrasonication at room temperature for 15~45min. After extraction, place the sample in a centrifuge, centrifuge for 10min, collect the supernatant, filter it through a 0.22μm filter membrane, and place it in another sample bottle to obtain the test solution. S2. Fingerprint Acquisition: The test solution was analyzed using high-performance liquid chromatography (HPLC) to acquire chromatographic data of pyrazine compounds. The HPLC conditions were as follows: detection wavelength: 258–278 nm; column: Sunfire C18 column, 4.6 mm × 250 mm, packing particle size: 5 μm, pore size: 100 Å; column temperature: 40 °C; mobile phase: phase A: aqueous solution containing 0.1% trifluoroacetic acid and 0.1% formic acid; phase B: acetonitrile; flow rate: 1.0 mL / min; detection wavelength: 258–278 nm; injection run time: 30 min; gradient elution program: 0–13 min, mobile phase A maintained at 92%, mobile phase B maintained at 8%; 13–14 min… At 1 min, mobile phase A linearly decreased from 92% to 85%, and mobile phase B linearly increased from 8% to 15%; at 14-22 min, mobile phase A linearly increased from 85% to 92%, and mobile phase B linearly decreased from 15% to 8%; at 22-30 min, mobile phase A remained at 92%, and mobile phase B remained at 8%.

[0022] Analytical method validation: The reliability of the high-performance liquid chromatography (HPLC) analytical method in step S2 is validated through one or more of the following experiments: precision, stability, and repeatability.

[0023] Precision experiment: Six coffee samples from the same batch were taken and test solutions were prepared separately. The samples were continuously injected for chromatographic analysis. The chromatographic peak of 2,6-dimethylpyrazine (peak 10) was used as the reference peak. The relative retention time and relative peak area of ​​each common peak were calculated (RSD). Stability test: Take coffee samples from the same batch and prepare test solutions separately. After incubation at room temperature for 0, 2, 4, 8, 12 and 24 hours, perform chromatographic analysis and record the chromatographic data. Use 2,6-dimethylpyrazine (peak 10) as the reference peak and calculate the relative retention time and relative peak area of ​​the common peak.

[0024] Repeatability test: Take coffee samples from the same batch and prepare test solutions separately. Inject the samples sequentially for chromatographic analysis. Use 2,6-dimethylpyrazine (peak 10) as the reference peak and calculate the RSD of the relative retention time and relative peak area of ​​the common peak.

[0025] S3. Fingerprint chromatogram establishment and similarity analysis: Collect chromatographic data of coffee from multiple production areas, and use the "Chinese Herbal Medicine Fingerprint chromatogram Similarity Evaluation System" (2012 version) to import the chromatograms of coffee from different regions, generate a common pattern control fingerprint chromatogram, and perform similarity analysis. The sample chromatograms are set to reference the chromatograms using the median method or the mean method, and the time window width is 0.1~0.2 min. S4. Preliminary Chemometric Identification: Based on the coffee chromatographic data described in S3, cluster analysis and principal component analysis were used to explore the natural grouping of samples and the differences in the population. An orthogonal partial least squares method was established to screen out 5 chromatographic peaks with an importance projection value greater than 1. S5. Machine Learning Model Construction and Identification: Using the five chromatographic peaks selected in step S4 as input data, a coffee origin classification model is trained using the construction of a random forest (RF) model, a decision tree (RT) model, a support vector machine (SVM) model, a k-nearest neighbor (KNN) algorithm model, and a deep neural network (DNN) model. The specific process is as follows: (a) RF Model Construction: ① Read the data. ② Extract features and labels; ③ Divide the dataset into training and test sets; ④ Create a random forest model; ⑤ Train the model; ⑥ Predict the test set; ⑦ Evaluate the model; (b) RT model construction: Same as (a), except that the random forest in ④ is replaced with a decision tree; (c) SVM model construction: Same as (a), except that the random forest in ④ is replaced with a support vector machine; (d) KNN model construction: Same as (a), except that the random forest in ④ is replaced with the K-nearest neighbor algorithm; (e) Construction of classification model of deep neural network (DNN): Same as (a), except that the random forest in ④ is replaced with deep neural network.

[0026] The structure of the deep neural network model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The training parameters of the deep neural network model are: batch size 32, learning rate 0.001, training epochs 1000, and the input data is standardized.

[0027] When constructing the aforementioned machine learning model, the dataset was divided into a training set and a test set in an 8:2 ratio, with 96 data points used for training and 24 data points used for testing. The machine learning model was then used to identify the origin of the coffee samples being tested.

[0028] Example 1: A method for tracing the origin of coffee using pyrazine fingerprinting coupled with chemometrics and machine learning, comprising the following steps (three groups of samples are processed and tested in the same batch): (1) Accurately weigh 2g of coffee bean powder, place it in a 100 mL conical flask, add 70% methanol to make up to 20 mL, extract by ultrasonication at room temperature for 45 min, place it in a centrifuge, centrifuge for 10 min, take the supernatant, filter it, filter it through a 0.22 μm filter membrane, place it in another sample bottle, and wait for testing.

[0029] (2) Validity of the liquid chromatography method and chromatograms: The reliability of the fingerprint analysis method was verified through precision, stability, and repeatability experiments. Chromatographic data were recorded, and 2,6-dimethylpyrazine (peak 6) was used as the reference peak in the chromatographic data analysis. The relative retention time, relative peak area, and RSD of the common peaks were calculated. The results are summarized in Table 1. The RSDs in the table are all less than 3%, indicating that the method has good precision, stability, and repeatability.

[0030]

[0031] (3) Fingerprint chromatogram establishment and similarity analysis: Chromatograms of coffee from different origins were collected. Following the "Evaluation System for Similarity of Fingerprint Chromatograms of Traditional Chinese Medicine", chromatograms of coffee from different regions were imported to obtain a fingerprint chromatogram library. The results are as follows: Figure 2 As shown, 10 common fingerprint peaks were identified. By comparing with the determined reference standards, 9 chromatographic peaks were identified, namely pyrazine (peak 1), tetramethylpyrazine (peak 2), 2-methylpyrazine (peak 3), 2,3,5-trimethylpyrazine (peak 4), 2,3-dimethylpyrazine (peak 5), 2,6-dimethylpyrazine (peak 6), 2,5-dimethylpyrazine (peak 7), 2-ethylpyrazine (peak 8), and 2-ethyl-3-methylpyrazine (peak 9).

[0032] (4) Establishment of coffee origin identification method: Import the relative peak areas of each common peak into the software for cluster analysis. The results are as follows: Figure 4As shown, when the discrimination distance is 5, the 40 batches of coffee samples clustered into 5 categories: S1-S8 clustered into category 1, S17-S24 into category 2, S25-S32 into category 3, S9-S16 and S33-S40 into category 4, and S25-S32 into category 5. The HAC analysis results show that samples from Yunnan, Ethiopia, and Colombia each clustered into one category, while samples from Brazil and Indonesia clustered into another, indicating that samples from these two traditional producing regions may have similarities.

[0033] (5) Establishment of coffee origin identification models: Random forest machine learning classification models were established, such as... Figure 7 As shown, the ROC curve and confusion matrix both demonstrate that the model achieves the best classification performance on categories 1, 3, and 4. However, on categories 0 and 2, the model's classification performance and accuracy are poor, with a significant number of misclassifications.

[0034] In this embodiment, 10 common fingerprint peaks were successfully identified, and 9 of them were identified as pyrazine compounds. Through cluster analysis, 40 batches of samples were naturally clustered into 5 categories according to their place of origin, which basically matched the geographical origin, and preliminarily proved the chemical differences of coffee from different places of origin. The random forest model showed good performance in some categories, verifying the potential of machine learning for origin traceability.

[0035] Example 2: A method for coffee origin traceability based on pyrazine fingerprinting coupled with chemometry and machine learning, comprising the following steps: (1) Accurately weigh 2g of coffee bean powder, place it in a 100 mL conical flask, add 70% methanol to make up to 20 mL, extract by ultrasonication at room temperature for 45 min, place it in a centrifuge, centrifuge for 10 min, take the supernatant, filter it, filter it through a 0.22 μm filter membrane, place it in another sample bottle, and wait for testing.

[0036] (2) Validity of liquid chromatography method and spectral analysis: The reliability of the fingerprint analysis method was verified through precision, stability, and repeatability experiments. Standard curves for nine pyrazine standards were established using X: concentration (mg / L) and Y: peak area (AU). The limits of detection and quantitation of the HPLC method were calculated, and the results are shown in Table 2. The calculation results show that the lowest limit of detection for alkylpyrazines is 0.009 mg / L and the lowest limit of quantitation is 0.029 mg / L. The limits of detection and quantitation for the nine alkylpyrazines are relatively low, indicating that the accuracy and sensitivity of this method are high.

[0037]

[0038] (3) Fingerprint chromatogram establishment and similarity analysis: Chromatograms of coffee from different origins were collected. Using the "Similarity Evaluation System for Fingerprint Chromatograms of Traditional Chinese Medicine" (2012 edition), the HPLC chromatograms of nine alkylpyrazines were imported to establish the HPLC chromatogram of the mixed reference solution. The results are as follows: Figure 3 As shown, 10 common fingerprint peaks were identified. By comparing with the determined reference standards, 9 chromatographic peaks were identified, namely pyrazine (peak 1), tetramethylpyrazine (peak 2), 2-methylpyrazine (peak 3), 2,3,5-trimethylpyrazine (peak 4), 2,3-dimethylpyrazine (peak 5), 2,6-dimethylpyrazine (peak 6), 2,5-dimethylpyrazine (peak 7), 2-ethylpyrazine (peak 8), and 2-ethyl-3-methylpyrazine (peak 9).

[0039] (4) Establishment of coffee origin identification method: The relative peak areas of each common peak are imported into the software, and a model based on principal component analysis is established. The results are as follows: Figure 5 As shown, samples from Yunnan, Ethiopia, and Colombia are completely distinguishable; however, some samples from Indonesia and Brazil overlap, and the PCA results are consistent with the HCA results.

[0040] (5) Establishment of coffee origin identification model: A decision tree machine learning classification model was established, and the results are as follows: Figure 8 As shown, the RT model performs very well in classifying categories 1 and 3, with almost no misclassifications. However, the RT model performs poorly in classifying categories 0 and 2, exhibiting more misclassifications and requiring further optimization.

[0041] This embodiment demonstrates that the HPLC method possesses high sensitivity and accuracy for nine alkylpyrazines. Principal component analysis results and cluster analysis corroborate each other, reinforcing the reliability of the conclusions. The performance of the decision tree model reveals the advantages of different algorithms, providing a basis for subsequent model selection.

[0042] Example 3: A method for coffee origin traceability based on pyrazine fingerprinting coupled with chemometry and machine learning, comprising the following steps: (1) Accurately weigh 2g of coffee bean powder, place it in a 100 mL conical flask, add 70% methanol to make up to 20 mL, extract by ultrasonication at room temperature for 45 min, place it in a centrifuge, centrifuge for 10 min, take the supernatant, filter it, filter it through a 0.22 μm filter membrane, place it in another sample bottle, and wait for testing.

[0043] (2) Validity of liquid phase method and chromatogram: The reliability of fingerprint analysis method is verified through precision, stability and repeatability experiments, and chromatographic data are recorded.

[0044] (3) The chromatograms of 40 batches of coffee from different origins were analyzed using the software "Similarity Evaluation System for Chromatographic Fingerprints of Traditional Chinese Medicine" (2012 version).

[0045] (4) Establishment of coffee origin identification method: The relative peak areas of each common peak were imported into the software, and a model based on principal component analysis was established. The eigenvalues ​​and variance contribution rates of the principal components were calculated. The results are shown in Table 3. With the eigenvalue > 1 as the threshold, three principal components were obtained, accounting for 55.1%, 19% and 13.2% of the total variance, respectively. They together account for 87.3% of the total variance, which means that they can be used to represent most of the information of the original 10 common peaks.

[0046] (5) Establishment of coffee origin identification model: A support vector machine machine learning classification model was established, and the results are as follows: Figure 9 The SVM model performs exceptionally well in class 3, with almost no misclassifications. However, it performs poorly in classes 0, 2, and 4, exhibiting numerous misclassifications, indicating that the SVM model is unsuitable for handling the feature distribution of this dataset.

[0047]

[0048] This embodiment quantifies the variance contribution of the data through principal component analysis, confirming that the first three principal components can represent 87.3% of the original information, thus providing a scientific basis for data dimensionality reduction. The conclusion that the SVM model performs poorly on this dataset is of significant reference value, indicating the need to select a more suitable model to handle such complex chemical feature data.

[0049] Example 4 A method for coffee origin traceability based on pyrazine fingerprinting coupled with chemometry and machine learning, comprising the following steps: (1) Accurately weigh 2g of coffee bean powder, place it in a 100 mL conical flask, add 70% methanol to make up to 20 mL, extract by ultrasonication at room temperature for 45 min, place it in a centrifuge, centrifuge for 10 min, take the supernatant, filter it, filter it through a 0.22 μm filter membrane, place it in another sample bottle, and wait for testing.

[0050] (2) Validity of liquid phase method and chromatogram: The reliability of fingerprint analysis method is verified through precision, stability and repeatability experiments, and chromatographic data are recorded.

[0051] (3) The chromatograms of 40 batches of coffee from different origins were analyzed using the software "Similarity Evaluation System for Chromatographic Fingerprints of Traditional Chinese Medicine" (2012 version).

[0052] (4) Establishment of coffee origin identification method: The relative peak areas of each common peak are imported into the software, and a model based on orthogonal partial least squares method is established. The results are as follows: Figure 6As shown, the variable importance in projection (VIP) results of the 10 feature variables obtained through OPLS-DA are as follows: Figure 4 As shown in D. Using VIP>1 as a measure of significant effect, five differential markers were found. These chemical components contribute significantly to distinguishing coffee from different regions, suggesting that these five chemical components may be the differential components of coffee from different regions. The significance of their effects, ranked from largest to smallest, is as follows: pyrazine > tetramethylpyrazine > 2,6-dimethylpyrazine > 2,5-dimethylpyrazine > 2-ethylpyrazine. In this analysis, the model independent variable fit index (R²) is used. 2 X) is 0.921, and the dependent variable fit index (R) is... 2 Y) is 0.838, and the model prediction index (Q) is 0.838. 2 The R² and Q values ​​are 0.796. 2 All values ​​exceeded 0.500, indicating that the model has good stability and predictive ability. After 200 permutation tests, the Q values ​​in the figure... 2 The intersection of the regression line with the vertical axis is less than zero, indicating that the model does not exhibit overfitting and that the model validation is effective. Therefore, the results are considered suitable for the identification and analysis of coffee from different regions.

[0053] (5) Establishment of a coffee origin identification model: A deep neural network machine learning classification model was established, and the results are as follows: Figure 10 As shown, the model performs very well in classification across all categories, especially with an AUC of 1.00 for categories 0, 1, 2, and 3, indicating perfect classification performance in these categories. The confusion matrix shows the comparison between the predicted results and the actual labels for the 24 validation set samples. The confusion matrix reveals some cross-classification errors between categories 4 and 2, likely due to their high feature similarity. Furthermore, the model achieves an accuracy of 95.8% on the test set, demonstrating excellent overall classification performance. The training results show that both training and validation accuracy curves increase synchronously, gradually stabilizing at around 90%, and exhibiting good generalization ability on the validation set. Simultaneously, the training and validation loss curves gradually decrease, stabilize, and eventually converge, indicating good model training without overfitting or underfitting during training.

[0054] In this embodiment, VIP analysis clearly points out that five components, including pyrazine and tetramethylpyrazine, are key to distinguishing the place of origin, providing clear chemical basis for tracing the source. The constructed OPLS-DA model is stable and has strong predictive ability. The final constructed DNN model achieves an accuracy of 95.8%, and the training process is good with no overfitting, which fully demonstrates the superiority of the technical solution of this invention.

[0055] Example 5: A method for coffee origin traceability based on pyrazine fingerprinting coupled with chemometry and machine learning, comprising the following steps: (1) Accurately weigh 2g of coffee bean powder, place it in a 100 mL conical flask, add 50%~70% methanol to make up to 10~20 mL, extract by ultrasonication at room temperature for 30~90 min, put it in a centrifuge, centrifuge for 10 min, take the supernatant, filter it, filter it through a 0.22 μm filter membrane, place it in another sample bottle, and wait for testing.

[0056] (2) Validity of liquid phase method and chromatogram: The reliability of fingerprint analysis method is verified through precision, stability and repeatability experiments, and chromatographic data are recorded.

[0057] (3) The chromatograms of 40 batches of coffee from different origins were analyzed using the software "Similarity Evaluation System for Chromatographic Fingerprints of Traditional Chinese Medicine" (2012 version).

[0058] (4) Establishment of coffee origin identification method: Import the relative peak areas of each common peak into the software and perform cluster analysis, principal component analysis and orthogonal partial least squares method.

[0059] (5) Establishment of coffee origin identification models: Random Forest, Decision Tree, Support Vector Machine, and Deep Neural Network models were established. Based on the ROC curve and confusion matrix, the precision, recall, and F1 score of the models on the test data were calculated. The results are shown in Table 4. The DNN model performed best in all indicators, especially in accuracy, precision, recall, and F1 score, which were far superior to other models, with all indicators reaching over 90%. This indicates that the model is suitable for the classification study of coffee from different roasting origins. Further comparative analysis revealed that the RF and RT models performed relatively similarly, with both models achieving an accuracy of over 70%. The SVM model was less stable, with lower performance in all indicators. In summary, compared with other models, the DNN feature classification method performed better in all evaluation indicators. Therefore, overall, the DNN method is more effective and has better specific identification capabilities.

[0060]

[0061] This embodiment demonstrates that the method is applicable across a wide range of preprocessing parameters and exhibits good robustness. By comprehensively comparing four mainstream models using multiple metrics such as accuracy, recall, and F1 score, the data clearly shows that the DNN model significantly outperforms other models in all scoring metrics, providing the optimal strategy selection for implementing this invention.

[0062] In summary, this study employed HPLC technology to conduct in-depth analysis of alkylpyrazines in coffee from different origins, achieving the analysis of these substances. Combining fingerprinting and chemometric analysis, differential markers in coffee were successfully identified. Furthermore, this study constructed machine learning classification models for five coffee origins, with the deep neural network model achieving an accuracy rate of 95.8%, providing theoretical basis and technical support for coffee research.

[0063] Of course, the present invention may have other various embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and modifications according to the present invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.

Claims

1. A coffee origin traceability method based on pyrazine fingerprinting coupled with chemostometry and machine learning, characterized in that, Includes the following steps: S1. Sample pretreatment: Extract, centrifuge, and filter coffee samples from different origins to prepare the test solution; S2. Fingerprint acquisition: The test solution is analyzed by high performance liquid chromatography to acquire chromatographic data of pyrazine compounds; S3. Fingerprint chromatogram establishment and similarity analysis: Collect chromatographic data of coffee from multiple origins, generate a control fingerprint chromatogram with a common pattern, and perform similarity analysis. S4. Preliminary Chemometric Identification: Based on the coffee chromatographic data described in S3, cluster analysis and principal component analysis were used to explore the natural grouping of samples and the differences in the population. An orthogonal partial least squares method was established to screen out 5 chromatographic peaks with an importance projection value greater than 1. S5. Machine learning model construction and identification: Using the five chromatographic peaks selected in step S4 as input data, a coffee origin classification model is trained using machine learning algorithms, and the origin of the coffee sample to be tested is identified through this model.

2. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning according to claim 1, characterized in that, The procedure following step S2 and preceding step S3 includes S2a, analytical method validation: the reliability of the high-performance liquid chromatography analytical method in step S2 is validated through one or more of the following experiments: precision, stability, and repeatability.

3. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometry and machine learning according to claim 1, characterized in that, In step S1, the sample pretreatment process includes: accurately weighing 2g of sample coffee bean powder, placing it in a 100 mL conical flask, adding 30%~90% methanol to make up to 10~100 mL, ultrasonically extracting at room temperature for 15~45 min, centrifuging and taking the supernatant, filtering it through a 0.22 μm filter membrane to obtain the test solution.

4. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning according to claim 1, characterized in that, In step S2, the chromatographic conditions of the high-performance liquid chromatography (HPLC) are as follows: the detection wavelength of the HPLC is 258~278 nm; the chromatographic column is a Sunfire C18 column with dimensions of 4.6 mm × 250 mm, a packing particle size of 5 μm, a pore size of 100 Å, and a column temperature of 40 °C; the mobile phase is: phase A is an aqueous solution containing 0.1% trifluoroacetic acid and 0.1% formic acid, phase B is acetonitrile, and the flow rate is 1.0 mL / min; the detection wavelength is 258~278 nm, and the injection run time is 30 min.

5. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning according to claim 4, characterized in that, In step S2, the elution method of the high-performance liquid chromatography is gradient elution, and the procedure is as follows: From 0 to 13 minutes, mobile phase A was maintained at 92% and mobile phase B at 8%. Over 13–14 minutes, mobile phase A decreased linearly from 92% to 85%, while mobile phase B increased linearly from 8% to 15%. Between 14 and 22 minutes, mobile phase A linearly increased from 85% to 92%, while mobile phase B linearly decreased from 15% to 8%. For 22-30 minutes, mobile phase A is maintained at 92% and mobile phase B is maintained at 8%.

6. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning according to claim 1, characterized in that, In step S5, the machine learning algorithm specifically includes: the construction of a random forest model, the construction of a decision tree model, the construction of a support vector machine model, the construction of a K-nearest neighbor algorithm model, and the construction of a deep neural network model; when constructing the above machine learning models, the dataset is divided into a training set and a test set in a ratio of 8:2, of which 96 data points are used for training and 24 data points are used for testing.

7. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning according to claim 6, characterized in that, The deep neural network model consists of an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The training parameters of the deep neural network model are: batch size 32, learning rate 0.001, training epochs 1000, and the input data is standardized.

8. The coffee origin traceability method based on pyrazine fingerprinting coupled with chemometrics and machine learning according to claim 1, characterized in that, In step S3, the fingerprint spectrum comparison conditions are to use the median method or the mean method, and the time window width is 0.1~0.2 min.