Construction method of interpretable prediction model of white spirit quality and prediction method of white spirit quality

Through the combination of XGBoost model and SHAP value, hyperparameters are adjusted and flavor substance characteristics are screened to construct a liquor quality prediction model, which solves the objectivity and interpretability problems of liquor quality prediction in the existing technology and achieves efficient and accurate liquor quality. Prediction and counterfeit wine identification.

CN118760987APending Publication Date: 2024-10-11GUIZHOU MOUTAI WINERY GRP XIJIU CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411028298.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing technology is difficult to achieve objective and accurate prediction and discrimination of liquor quality, mainly due to a single detection method, lack of interpretability of the model and insufficient sample size, resulting in uneven quality of liquor and difficulty in identifying fake liquor.

Method used

The XGBoost model is used in combination with grid search and cross-validation methods to adjust hyperparameters, and the characteristic importance of flavor substances is calculated and screened through SHAP values ​​to build a liquor quality prediction model to achieve simple, efficient, objective and accurate prediction of liquor quality.

Benefits of technology

It achieves efficient and accurate prediction of liquor quality, reduces the number of flavor detection indicators, improves the interpretability of the model, reduces costs, and improves the accuracy of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760987A_ABST
    Figure CN118760987A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of Baijiu quality detection and evaluation, and relates to a Baijiu quality interpretable prediction model construction method and a Baijiu quality prediction method. The construction method comprises the following steps: (1) acquiring flavor substance information in white spirit samples with different qualities; (2) hyper-parameters of the XGBoost model are adjusted based on a grid search and cross validation method, and trained XGBoost model parameters are obtained; (3) obtaining a feature importance sorting result of the flavor substances based on an SHAP mode, and screening modeling features; and (4) on the basis of the trained XGBoost model parameters and the modeling features obtained by screening, constructing an XGBoost white spirit quality prediction model. The XGBoost prediction model constructed by the construction method provided by the invention can realize simple, efficient, objective and accurate prediction of the quality of the white spirit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of liquor quality detection and evaluation, and relates to a method for constructing an explainable prediction model for liquor quality and a method for predicting liquor quality. Background Art

[0002] Liquor is mainly made from grains such as sorghum, and various kinds of koji are used as saccharification and fermentation agents. After solid-state fermentation, solid-state distillation, storage and blending, an alcoholic beverage product with ethanol as the main component and rich in thousands of trace ingredients is finally obtained. In recent years, as people attach more importance to traditional culture and pursue a healthy lifestyle, consumers have begun to pay more attention to the quality and health attributes of liquor. However, due to the influence of the complex brewing process and huge flavor system of liquor, the styles of liquors from different regions, brands and grades vary greatly. At present, the judgment of liquor quality mainly relies on the sensory evaluation of professionals, and its sensory results are greatly affected by the subjective influence of the tasters. At the same time, due to the lack of objective and effective instruments and flavor discrimination analysis, the quality of liquor on the market is uneven, and various fake liquors often appear as good ones, making it very difficult for consumers to judge.

[0003] Although researchers have used instrumental analysis results to build liquor quality evaluation models, many studies have a single detection method that cannot more comprehensively characterize the flavor chemical information of liquor; or many discriminant models are only preliminarily constructed, without interpretability, or have not yet formed a stable and mature mathematical model. At the same time, since the data volume of instrumental analysis results is large and messy, with a lot of redundant information, it is relatively difficult to screen out evaluation indicators with important characteristics. In addition, sample size is also a key factor in building a model. Only when the sample size is large enough can the recognition ability of the model be improved. However, many studies still have problems such as small sample size, which is one of the reasons why the quality judgment and prediction of liquor cannot be objectively achieved. In addition, in the current research field, the combination of machine learning and medicine is relatively close and mature, but it is less used in the field of food flavor research.

[0004] Based on this, the present invention aims to provide a method for constructing an explainable prediction model for liquor quality, so as to achieve more accurate and objective prediction and discrimination of liquor quality. Summary of the invention

[0005] The present invention aims to provide a method for constructing a liquor quality prediction model and a method for predicting liquor quality.

[0006] According to a first aspect of the present invention, the present invention provides a method for constructing an interpretable prediction model for liquor quality, the construction method comprising the following steps:

[0007] (1) Obtaining flavor information in liquor samples of different qualities;

[0008] (2) Based on grid search and cross-validation methods, the hyperparameters of the XGBoost model are adjusted to obtain the trained XGBoost model parameters;

[0009] (3) Obtain the feature importance ranking results of flavor substances based on the SHAP method and screen the modeling features;

[0010] (4) Based on the trained XGBoost model parameters and the screened modeling features, an XGBoost liquor quality prediction model is constructed.

[0011] In some embodiments of the present invention, in step (1), obtaining the flavor substance information in liquor samples of different qualities includes: performing joint detection and qualitative and quantitative analysis on the flavor substances in the liquor samples of different qualities based on GC-FID, LLME-GC-MS and HPLC techniques, respectively, and superimposing the qualitative and quantitative results obtained by the three techniques to obtain the flavor substance information.

[0012] In some embodiments of the present invention, GC-FID detection includes: pre-treating the liquor sample to obtain a sample to be tested; and detecting the sample to be tested based on GC-FID technology.

[0013] In some embodiments of the present invention, in the GC-FID detection, the GC-FID conditions used include: the chromatographic column is a DB-WAX UI chromatographic column (30m×0.25mm×0.25μm).

[0014] In some embodiments of the present invention, in the GC-FID detection, the GC-FID conditions used also include: injection port temperature 245-255°C; injection volume: 0.5-1.5 μL; split ratio: 28-32:1; column flow: 0.5-1.5 mL / min.

[0015] In some embodiments of the present invention, in the GC-FID detection, the GC-FID conditions used also include: the temperature program is: start at 28-320°C, hold for 2.5-3.5min, heat to 85-95°C at 2.5-3.5°C / min, then heat to 175-185°C at 4.5-5.5°C / min, and hold for 20-30min; the temperature of the hydrogen flame ionization detector is: 245-255°C.

[0016] In some embodiments of the present invention, in the GC-FID detection, the GC-FID conditions used also include: DB-WAX UI chromatographic column (30m×0.25mm×0.25μm); injection port temperature 250°C; injection volume: 1μL; split ratio: 30:1 (carrier gas: nitrogen (purity ≥99.999%)); column flow: 1mL / min; heating program: start at 30°C, hold for 3min, increase the temperature to 90°C at 3°C / min, do not hold, then increase the temperature to 180°C at 5°C / min, and hold for 25min; the hydrogen flame ionization detector temperature is: 250°C.

[0017] In some embodiments of the present invention, LLME-GC-MS detection includes: pre-treating the liquor sample to obtain a sample to be tested; and detecting the sample to be tested based on LLME-GC-MS technology.

[0018] In some embodiments of the present invention, in the LLME-GC-MS detection, the sample pretreatment includes: diluting the liquor sample to a set alcohol content, adding sodium chloride to saturation, adding an internal standard and an extraction solvent, shaking, standing and separating the layers to obtain a sample to be tested.

[0019] In some embodiments of the present invention, in the LLME-GC-MS detection, the GC conditions used include: the chromatographic column is a DB-FFAP chromatographic column (60m×0.25mm×0.25μm).

[0020] In some embodiments of the present invention, in the LLME-GC-MS detection, the GC conditions used also include: the injection port temperature and the gas chromatography detector temperature are 245-255°C, helium is used as the carrier gas, the flow rate is 1.0-1.5mL / min, and non-split injection.

[0021] In some embodiments of the present invention, the GC conditions used in the LLME-GC-MS detection also include: the programmed temperature conditions are: the initial temperature is 35-45°C, maintained for 0.5-1.5 min, increased to 95-100°C at 2.0-3.0°C / min, maintained for 0.8-1.2 min, increased to 155-165°C at 2.5-3.5°C / min, increased to 225-235°C at 4.5-5.5°C / min, and maintained for 8-12 min.

[0022] In some embodiments of the present invention, in the LLME-GC-MS detection, the MS conditions used include: using an EI ion source and an electron energy of 65-75eV, setting the ion source temperature to 225-235°C, the quadrupole temperature to 145-155°C, and the scanning range to m / z 30-550.

[0023] In some embodiments of the present invention, in the LLME-GC-MS detection, the GC conditions used include: using a DB-FFAP chromatographic column (60m×0.25mm×0.25μm, J&W Scientific), the injection port temperature and the gas chromatography detector temperature are 250°C, helium is used as a carrier gas (purity ≥99.999%), the flow rate is 1.2mL / min, and non-split injection; the program temperature conditions are: the initial temperature is 40°C and maintained for 1min, increased to 100°C at 2.5°C / min, maintained for 1min, increased to 160°C at 3°C / min without maintaining, increased to 230°C at 5°C / min, and maintained for 10min; the MS conditions used include: using an EI ion source and an electron energy of 70eV, setting the ion source temperature to 230°C, the quadrupole temperature to 150°C, and the scanning range to m / z 30-550.

[0024] In some embodiments of the present invention, HPLC detection includes: pre-treating the liquor sample to obtain a sample to be tested; and detecting the sample to be tested based on HPLC technology.

[0025] In some embodiments of the present invention, in the HPLC detection, the HPLC conditions used include: the chromatographic column is ZORBAX SB-C18 (4.6×150 mm 5-Micron).

[0026] In some embodiments of the present invention, in the HPLC detection, the HPLC conditions used also include: the mobile phase is 100% KH2PO4, pH = 2.0-2.5. Preferably, the concentration of KH2PO4 is 0.01-0.04 mol / L; preferably, the preparation method of the mobile phase includes: weighing KH2PO4, adding ultrapure water to dissolve, constant volume, adjusting the pH to 2.0-2.5, and filtering with a 0.22μm water filter membrane; preferably, H3PO4 is used for pH adjustment.

[0027] In some embodiments of the present invention, in the HPLC detection, the HPLC conditions used also include: detection wavelength of 205-215 nm, column oven 25-35° C., mobile phase flow rate 0.5-1.5 mL / min, injection volume 0.5-1.5 μL.

[0028] In some embodiments of the present invention, in step (2), the hyperparameters of the XGBoost model are adjusted based on the grid search and cross-validation method to obtain the trained XGBoost model parameters, including: firstly constructing a prediction model using conventional parameters for the training set data obtained after standardization; and adjusting the hyperparameters of the XGBoost model using the grid search and cross-validation method.

[0029] In some embodiments of the present invention, the initial construction of a prediction model using conventional parameters for the training set data obtained after standardization includes: using the quantitative data of flavor substances as independent variables, the quality of the wine sample as the dependent variable, setting the model parameters to multi:softmax, and specifying the number of classification categories.

[0030] In some embodiments of the present invention, the use of grid search and cross-validation methods to adjust the hyperparameters of the XGBoost model includes: using the trainControl function to set the cross-validation parameters, then using the expand.grid function to set the grid search parameters, and then passing the cross-validation parameters, grid search parameters, and data for the preliminary construction of the prediction model to the train function for training to find the optimal parameters.

[0031] In some embodiments of the present invention, the trained XGBoost model parameters are: objective = "multi:softmax", num_class = 4, nrounds = 50, max_depth = 5, eta = 0.1, gamma = 0, colsample_bytree = 0.8, min_child_weight = 2, subsample = 0.

[0032] In some embodiments of the present invention, in step (3), the feature importance ranking results of flavor substances are obtained based on the SHAP method, and the modeling features are screened, including: calculating the Shapley values ​​of flavor substances by the SHAP method, and ranking the importance of flavor substances and gradient stratified sampling based on the calculated Shapley values; based on the flavor substance information corresponding to different gradient stratification ratios, performing XGBoost modeling using the trained XGBoost model parameters, evaluating the classification performance of the constructed XGBoost model, and screening the modeling features based on the evaluation results.

[0033] In some embodiments of the present invention, the flavor substance information corresponding to different gradient stratification ratios includes: characteristic flavor substance information corresponding to the top 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, and 100% of the ranking.

[0034] In some embodiments of the present invention, the modeling features are flavor substances and their content information corresponding to the top 40% or 20%-60% of the feature importance ranking.

[0035] According to a second aspect of the present invention, the present invention also provides a method for predicting liquor quality, the method comprising the following steps:

[0036] (1) Obtaining flavor substance information in the liquor sample to be predicted;

[0037] (2) Inputting the flavor substance information into an XGBoost prediction model constructed by any of the construction methods described in the first aspect of the present invention, and predicting the quality of the liquor sample to be predicted based on the input result of the XGBoost prediction model.

[0038] In some embodiments of the present invention, the predicting the quality of the liquor sample to be predicted includes: predicting the grade of the liquor sample to be predicted and / or the authenticity of the liquor sample to be predicted; wherein the grades include: low-grade, mid-grade, high-grade, and super high-grade.

[0039] In some embodiments of the present invention, when predicting the grade of the liquor sample to be predicted, the information of the flavor substances includes: at least one of propanol, 2-ethyl-6-methylpyrazine, furfural, lactic acid, 2-pentanol, benzaldehyde, isovaleric acid, 2-pentanone, 2,3-butanediol, ethyl isovalerate, diethoxymethane, ethyl decanoate, ethyl furoate, ethyl benzoate, ethyl 2-hydroxybutyrate, phenylethyl acetate, ethyl heptanoate, 2,3-dimethyl-5-ethylpyrazine, ethyl hexanoate, acetic acid, sec-butyl alcohol, isobutyraldehyde, diethyl succinate, ethyl butyrate, 2,5-dimethylpyrazine, 1,2-propylene glycol, phenylacetaldehyde, heptanoic acid, hexanoic acid, ethyl oleate, 4-methylphenol, 2-heptanone, n-pentanol, ethyl octanoate, ethyl dodecanoate, octanol, isobutyric acid, and n-hexanol and their corresponding content data.

[0040] In some embodiments of the present invention, when predicting the authenticity of the liquor sample to be predicted, the information of the flavor substances includes: at least one of 2-pentanone, 3-octanol, ethyl heptadecanoate, ethyl 2-hydroxybutyrate, isovaleraldehyde, 2-nonanone, isobutanol, propanol, propionaldehyde, isopentyl acetate, ethyl butyrate, valeric acid, isobutyraldehyde, ethyl lactate, 2-heptanone, ethyl phenylacetate, ethyl octanoate, and ethyl pentadecanoate and their corresponding content data.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] The present invention provides a method for constructing a liquor quality prediction model. In the construction method provided by the present invention, the hyperparameters of the XGBoost model are first adjusted based on a grid search and a cross-validation method to obtain the trained XGBoost model parameters, and then based on the XGBoost model parameters obtained after the training, the importance of flavor material features is calculated by a SHAP value, and the modeling features are screened by sorting and gradient stratified screening. Finally, the XGBoost liquor quality prediction model is constructed based on the XGBoost model parameters obtained after the training and the modeling parameters, so that the constructed XGBoost prediction model can achieve simple, efficient, objective and accurate predictions of liquor quality. In the screening process of the modeling features, the present invention uses the SHAP value to calculate the feature importance, and performs sorting and gradient stratified screening, which can obtain the optimal number of important feature flavor compounds, can achieve a significant reduction in flavor detection indicators, reduce costs, and achieve the interpretability of the prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flowchart of an embodiment of the present invention;

[0044] Figure 2 This is a graph showing the performance evaluation results of the explainable prediction model for different grades of Maotai-flavor liquor in Example 1 of the present invention;

[0045] Figure 3 This is a result diagram of feature screening of explainable prediction models for different grades of Maotai-flavor liquor in Example 1 of the present invention;

[0046] Figure 4 This is a graph showing the accuracy test results of the explainable prediction model for different grades of Maotai-flavor liquors in Example 1 of the present invention;

[0047] Figure 5 This is a graph showing the influence of important features of the explainable prediction model on the output value of different grades of Maotai-flavor liquor in Example 1 of the present invention;

[0048] Figure 6 This is a graph showing the performance evaluation results of the explainable prediction model for the authenticity of Maotai-flavor liquor according to Example 2 of the present invention;

[0049] Figure 7 This is a result diagram of feature screening of an explainable prediction model for authenticity of Maotai-flavor liquor according to Example 2 of the present invention;

[0050] Figure 8 This is a graph showing the accuracy test results of the explainable prediction model for the authenticity of Maotai-flavor liquor according to Example 2 of the present invention;

[0051] Fig. 9 This is a diagram showing the influence of important features of the explainable prediction model for the authenticity of Maotai-flavor liquor on the output values ​​in Example 2 of the present invention. DETAILED DESCRIPTION

[0052] The technical solution of the present invention is further described below by specific embodiments, which do not limit the protection scope of the present invention. Some non-essential modifications and adjustments made by others based on the concept of the present invention still fall within the protection scope of the present invention.

[0053] Example 1

[0054] 1. Sample collection

[0055] Different grades of Maotai-flavor liquors were collected from the market, including 41 samples of ultra-high-end Maotai-flavor liquors (>1,000 yuan), 97 samples of high-end Maotai-flavor liquors (700 yuan to 1,000 yuan), 105 samples of mid-range Maotai-flavor liquors (400 yuan to 700 yuan), and 125 samples of low-end Maotai-flavor liquors (<400 yuan), totaling 368 samples.

[0056] 2. Collect qualitative and quantitative data on flavor substances in each wine sample

[0057] 1. Combined gas chromatography-flame ionization detector (GC-FID), liquid-liquid microextraction-gas chromatography-mass spectrometry (LLME-GC-MS) and high performance liquid chromatography (HPLC) were used to detect the flavor substances of each wine sample.

[0058] (1) Detection of wine samples using GC-FID technology:

[0059] Sample pretreatment: Take 10 mL of wine sample and place it in a reserve bottle, add 200 μL of mixed internal standard solution (tert-amyl alcohol: 297.46 mg / L, n-amyl acetate: 297.59 mg / L, 2-ethylbutyric acid: 302.37 mg / L), mix well, take 2 mL and dispense it into a sample injection bottle to obtain the sample to be tested;

[0060] The samples to be tested were detected based on GC-FID technology: the GC-FID conditions used were: DB-WAX UI chromatographic column (30m×0.25mm×0.25μm); injection port temperature 250°C; injection volume: 1μL; split ratio: 30:1 (carrier gas: nitrogen (purity ≥99.999%)); column flow rate: 1mL / min; heating program: start at 30°C, hold for 3min, increase to 90°C at 3°C / min, do not hold, then increase to 180°C at 5°C / min, hold for 25min; hydrogen flame ionization detector temperature: 250°C.

[0061] (2) Testing of wine samples using LLME-GC-MS technology

[0062] Sample pretreatment: Pipette 10 mL of wine sample diluted to 10% vol, add sodium chloride to saturation, add 10 μL of internal standard (2-octanol: 16.1 mg / L), add 2 mL of ether:pentane (1:1), vortex for 3 min, let stand and separate, then pipette the upper organic phase into the injection bottle to obtain the sample to be tested;

[0063] The samples to be tested were detected based on the LLME-GC-MS technology: the GC conditions used were: a DB-FFAP chromatographic column (60m×0.25mm×0.25μm, J&W Scientific), the injection port temperature and the gas chromatography detector temperature were 250°C, helium was used as the carrier gas (purity ≥99.999%), the flow rate was 1.2mL / min, and non-split injection was performed; the programmed temperature conditions were: the initial temperature was 40°C and maintained for 1min, increased to 100°C at 2.5°C / min, maintained for 1min, increased to 160°C at 3°C / min without maintaining, increased to 230°C at 5°C / min, and maintained for 10min; the MS conditions used were: an EI ion source and an electron energy of 70eV, the ion source temperature was set to 230°C, the quadrupole temperature was 150°C, and the scanning range was m / z 30-550.

[0064] (3) Using HPLC technology to test wine samples

[0065] Sample pretreatment: Take 1 ml of wine sample and filter it through a 0.22 μm organic filter membrane to obtain the sample to be tested;

[0066] The samples to be tested were detected based on HPLC technology: the HPLC conditions used were: chromatographic column: ZORBAXSB-C18 (4.6×150mm 5-Micron); mobile phase: 100% KH2PO4 (0.02mol / L), pH=2.3; detection wavelength 208nm, column oven 30°C, mobile phase flow rate 0.8mL / min, injection volume 1μL; the mobile phase was prepared as follows: accurately weigh 2.72g KH2PO4 in a beaker, dissolve it with an appropriate amount of ultrapure water and transfer it to a 1000mL volumetric flask, dilute to the scale with ultrapure water, adjust the pH to 2.3 with H3PO4, and filter with a 0.22μm water filter membrane.

[0067] 2. Perform qualitative analysis of flavor compounds on the data obtained from the test

[0068] After completing the detection in step 1 above, the compounds detected in the wine sample are qualitatively identified using NIST spectral library search, standard sample comparison, and retention index (RI).

[0069] 3. Quantitative analysis of flavor compounds detected in wine samples

[0070] (1) GC-FID and LLME-GC-MS use the internal standard curve method for quantification. The specific steps are as follows:

[0071] A 53% vol alcohol aqueous solution and a 10% vol ethanol-saturated sodium chloride aqueous solution are used as standard curve solvents, and a standard stock solution of a known concentration of the analyte is added, and gradient dilution is performed to prepare a series of standard compound solutions; an internal standard solution consistent with the sample is added, and GC-FID and LLME-GC-MS detection and analysis are performed respectively. The detection conditions are consistent with the corresponding aforementioned methods, wherein GC-MS adopts selected characteristic ion monitor (SIM) scanning for determination; the peak area ratio of the analyte to the corresponding internal standard substance is used as the ordinate, and the mass concentration ratio is used as the abscissa, a standard curve is drawn, and each detected compound in the sample is accurately quantified.

[0072] (2) HPLC uses the external standard curve method for quantification, and the specific steps are as follows:

[0073] Using 53% vol alcohol aqueous solution as the standard curve solvent, add known concentration standards for gradient dilution to establish the standard curve of each substance to measure the content of each substance.

[0074] 3. Constructing a prediction model for different grades / quality of Maotai-flavor liquor based on SHAP value and XGBoost

[0075] (1) The qualitative and quantitative data sets of flavor substances corresponding to the above-mentioned different grades of wine samples were randomly split into 80% training sets and 20% test sets, and the data were standardized, including centering and scaling;

[0076] (2) Using the training set data obtained after the above-mentioned standardization process, the prediction model was initially constructed using conventional parameters, with the quantitative data of flavor substances as the independent variable and the wine sample grade (low-end, mid-end, high-end, and ultra-high-end) as the dependent variable. The model parameters were set to multi:softmax, and the number of classification categories was specified to be 4;

[0077] (3) Use grid search and cross-validation methods to adjust hyperparameters. The specific steps are as follows: first use the trainControl function to set the cross-validation parameters, then use the expand.grid function to set the grid search parameters, and then pass the data, cross-validation parameters, and grid search parameters used to initially construct the prediction model in step (2) to the train function to train and find the optimal parameters. After training, the optimal model parameter combination is: objective = "multi:softmax", num_class = 4, nrounds = 50, max_depth = 5, eta = 0.1, gamma = 0, colsample_bytree = 0.8, min_child_weight = 2, subsample = 0.9; finally, use xgboost::xgb.DMatrix to convert the data in step (2) into the format required for xgboost modeling, and then pass the data and the optimal parameter combination to the xgb.train function to establish a prediction model. Among them, nrounds: the number of training iterations; max_depth: the maximum depth of the tree; eta: learning rate; gamma: the minimum loss reduction during tree construction; colsample_bytree: controls the proportion of randomly extracted features; min_child_weight: the minimum sum of weights required for a child object; subsample: controls the proportion of random sampling.

[0078] (4) The Shapley values ​​are calculated by the SHAP method to characterize the importance of flavor substance characteristics. The specific steps are: passing the model established in step (3) and the training data in step (2) to the shapviz function to calculate Shapley values ​​and sort them; using the gradient stratified sampling method to screen and obtain the optimal number of important characteristic flavor compounds. The specific steps are: first, the flavor data in step (1) are sorted from high to low according to the Shapley values, and then the data are divided into 80% training set and 20% test set; then the top 10%, top 20%, top 30%, top 40%, top 50%, top 60%, top 70%, top 80%, top 90%, and top 100% of the data in the training set are respectively extracted and modeled using the optimal parameters of step (3), and predictions are made in the test set. At the same time, the accuracy, precision, recall, F1 score, Kappa coefficient, and receiver operating characteristic curve (AUC) are used to evaluate the model performance. The evaluation results are shown in Table 1. Among them, Accuracy is the accuracy rate, which indicates the proportion of samples correctly predicted by the model to the total samples; Precision is the accuracy, which refers to the proportion of samples predicted by the model as positive that are actually positive; Recall is the recall rate, which refers to the proportion of samples correctly predicted as positive by the model among all samples that are actually positive; F1 Score is the F1 score, which is the harmonic mean of Precision and Recall, and is used to measure the balanced performance of the model. Kappa is the Kappa statistic, which is used to measure the consistency of the classification model and compare the difference between the classification results and random classification. AUC is the area under the receiver operating characteristic curve, which is used to measure the performance of the classification model.

[0079] Table 1 Model evaluation results under different characteristic substance ratios

[0080]

[0081] Based on the evaluation results presented in Table 1, when the top 40% of the characteristic flavor substance information in terms of importance is selected and input into the prediction model established in step (3), the corresponding Accuracy, Precision, and AUC of the model reach the highest values, that is, the classification performance of the prediction model is the best under the above conditions.

[0082] Therefore, based on the above screening of modeling features, the characteristic flavor substances ranked in the top 40% by importance calculated by SHAP were finally selected as modeling features, and the XGBoost prediction model was constructed based on the model parameters trained in step (3). The characteristic flavor substances ranked in the top 40% by importance and their corresponding SHAP values ​​are shown in Table 2.

[0083] Table 2 The top 40% characteristic flavor substances and their corresponding SHAP values

[0084]

[0085]

[0086] In addition, the XGBoost nested SHAP method was used to calculate the positive and negative effects of each important characteristic flavor compound on the quality of different grades of Maotai-flavor liquor, further explaining the relationship between important characteristic compounds and the grade of Maotai-flavor liquor. Figure 5 As shown, the length of the bar represents the average impact of the feature on the model prediction, and the color of the point represents the impact of the feature value of a certain sample. Orange indicates a strong feature value impact, and purple indicates a weak feature impact. When orange points appear more in positive impact and purple points appear more in negative impact, it means that this feature is positively correlated with the model output; when orange points appear more in negative impact and purple points appear more in positive impact, it means that this feature is negatively correlated with the model output. For example, among low-end products, it can be seen from the bar that C43 (propanol) has the greatest impact on the model output, indicating that C43 (propanol) is generally more explanatory; and orange points appear more in negative impact and purple points appear more in positive impact, indicating that C43 (propanol) is negatively correlated with the model output.

[0087] 4. Prediction of liquor quality / grade

[0088] Based on the XGBoost prediction model constructed in step 3, the different grades of the Maotai-flavor liquor samples are predicted: the characteristic flavor substances and content data of the top 40% in the test set are input into the XGBoost prediction model constructed in step 3, and the corresponding Maotai-flavor liquor grade prediction results are output. The results are shown in Table 3:

[0089] Table 3 Prediction results of different grades of Maotai-flavor liquor

[0090] grade Forecast quantity Correct number Number of errors Low End 22 22 0 Mid-range 24 23 1 High-end 15 14 1 Ultra high-end 12 11 1

[0091] According to the results shown in Table 3, the XGBoost prediction model constructed by the present invention predicts the grade of Maotai-flavor liquor, and the prediction accuracy for low-end Maotai-flavor liquor is 100%, the prediction accuracy for mid-range Maotai-flavor liquor is 95.8%, the prediction accuracy for high-end Maotai-flavor liquor is 93.3%, and the prediction accuracy for ultra-high-end Maotai-flavor liquor is 91.7%. The prediction results of low-end, mid-end, high-end, and ultra-high-end Maotai-flavor liquor samples are comprehensively analyzed, and the accuracy is 95.9%, which is relatively high.

[0092] Example 2

[0093] 1. Sample collection

[0094] We collected 368 genuine high-end Maotai-flavor liquor products (priced between 700 and 1,000 yuan) and 43 counterfeit products of the corresponding grade on the market.

[0095] 2. Collecting qualitative and quantitative data of flavor substances in each wine sample: Same as Example 1;

[0096] 3. Constructing a prediction model for genuine and fake Maotai-flavor liquor based on SHAP value and XGBoost

[0097] (1) The qualitative and quantitative data sets of flavor substances corresponding to the authentic and fake wine samples were randomly split into 80% training sets and 20% test sets, and the data were standardized, including centering and scaling;

[0098] (2) Using the training set data obtained after the above standardization process, the prediction model was initially constructed using conventional parameters, with the quantitative data of flavor substances as the independent variable and the authenticity of the wine sample as the dependent variable. The model parameters were set to multi:softmax, and the number of classification categories was specified to be 2;

[0099] (3) Use grid search and cross-validation to adjust hyperparameters. The specific steps are as follows: first use the trainControl function to set the cross-validation parameters, then use the expand.grid function to set the grid search parameters, and then pass the data, cross-validation parameters, and grid search parameters in step (2) to the train function to train and find the optimal parameters. The best model parameter combination obtained by training is objective = "multi:softmax", num_class = 2, nrounds = 50, max_depth = 3, eta = 0.1, gamma = 0, colsample_bytree = 0.5, min_child_weig ht=4, subsample=0.6; finally, use xgboost::xgb.DMatrix to convert the data in step (2) into the format required by xgboost modeling, and then pass the data and the optimal parameter combination to the xgb.train function to build a prediction model; where nrounds: the number of training iterations; max_depth: the maximum depth of the tree; eta: the learning rate; gamma: the minimum loss reduction during tree construction; colsample_bytree: controls the proportion of randomly extracted features; min_child_weight: the minimum sum of weights required for a child object; subsample: controls the proportion of random sampling.

[0100] (4) The importance of flavor characteristics is measured by calculating Shapley values ​​using the SHAP method. The specific steps are: passing the model established in step (3) and the training data in step (1) to the shapviz function to calculate Shapley values ​​and sort them; using the gradient stratified sampling method to screen and obtain the best number of important characteristic flavor compounds. The specific steps are: first, sorting the flavor data in step (1) from high to low according to Shapley values, and then splitting the data into 80% training set and 20% test set; then extracting the top 10%, top 20%, top 30%, top 40%, top 50%, top 60%, top 70%, top 80%, top 90%, and top 100% of the data in the training set, respectively, using the best parameters in step (3) to build a model, and predicting in the test set, and using accuracy, precision, recall, F1 score, Kappa coefficient, and receiver operating characteristic curve (AUC) to evaluate the model performance. The evaluation results are shown in Table 4.

[0101] Table 4 Model evaluation results under different characteristic substance ratios

[0102] Feature gradient layer ratio Accuracy Precision Recall F1 Kappa AUC 10% 0.972 0.981 0.950 0.964 0.929 0.981 20% 1.000 1.000 1.000 1.000 1.000 1.000 30% 1.000 1.000 1.000 1.000 1.000 1.000 40% 1.000 1.000 1.000 1.000 1.000 1.000 50% 1.000 1.000 1.000 1.000 1.000 1.000 60% 1.000 1.000 1.000 1.000 1.000 1.000 70% 0.972 0.983 0.938 0.958 0.916 0.983 80% 0.972 0.982 0.944 0.961 0.923 0.982 90% 0.972 0.981 0.955 0.966 0.933 0.981 100% 0.972 0.980 0.958 0.968 0.936 0.980

[0103] Based on the evaluation results presented in Table 4, when the characteristic flavor substance information of the top 20%, 30%, 40%, 50%, and 60% in importance order is selected and input into the prediction model established by step (3), the corresponding Accuracy, Precision, and AUC of the model reach the highest values. At the same time, F1 and Kappa also reach the highest values. That is, the prediction model has the best classification performance under the above conditions.

[0104] Therefore, based on the above screening of modeling features, the characteristic flavor substances ranked in the top 20% by importance calculated by SHAP were finally selected as modeling features, and the XGBoost prediction model was constructed based on the model parameters trained in step (3). The characteristic flavor substances ranked in the top 20% by importance and their corresponding SHAP values ​​are shown in Table 5.

[0105] Table 5 The top 20% characteristic flavor substances and their corresponding SHAP values

[0106]

[0107]

[0108] In addition, the XGBoost nested SHAP method was used to calculate the positive and negative effects of each important characteristic compound on the authenticity of Maotai-flavor liquor, further explaining the relationship between important characteristic compounds and the authenticity of Maotai-flavor liquor. Fig. 9 As shown, the length of the bar represents the average impact of the feature on the model prediction, and the color of the point represents the impact of the feature value of a certain sample. Orange indicates a strong feature value impact, and purple indicates a weak feature impact. When orange points appear more in positive impact and purple points appear more in negative impact, it means that this feature is positively correlated with the model output; when orange points appear more in negative impact and purple points appear more in positive impact, it means that this feature is negatively correlated with the model output. For example, C84 (2-pentanone) has the greatest impact on the model output and has a strong explanatory power; in fake wine, orange points appear more in negative impact and purple points appear more in positive impact, indicating that C84 (2-pentanone) is negatively correlated with the model output; on the contrary, the opposite is true for real wine.

[0109] 4. Prediction of authentic and fake liquor

[0110] Based on the XGBoost prediction model constructed in step 3, the authenticity of the Maotai-flavor liquor samples is predicted: the characteristic flavor substances and content data of the top 20% in the test set are input into the XGBoost prediction model constructed in step 3, and the corresponding Maotai-flavor liquor authenticity prediction results are output. The results are shown in Table 6:

[0111] Table 6 Prediction results of authenticity of Maotai-flavor liquor

[0112] category Forecast quantity Correct number Number of errors Fake wine 7 7 0 Real wine 29 29 0

[0113] According to the results shown in Table 6, the XGBoost prediction model constructed by the present invention can predict the authenticity of Maotai-flavor liquor with a prediction accuracy of 100%, which can accurately predict the authenticity of Maotai-flavor liquor.

[0114] Comparative Example 1

[0115] 1. Sample collection: same as in Example 1;

[0116] 2. Collecting qualitative and quantitative data of flavor substances in each wine sample: Same as Example 1;

[0117] 3. Constructing a prediction model for different grades / quality of Maotai-flavor liquor based on SHAP value and XGBoost: Based on Example 1, the difference between Example 1 and Example 1 is that, in step (3), conventional parameters, model parameters adjusted by grid search, and model parameters adjusted by cross-validation method are used as parameters for constructing the model, respectively, to construct the prediction model; wherein, A. Establishing a model with conventional parameters, the parameters are: objective = "multi:softmax", num_class = 4, nrounds = 10; B. Model parameters adjusted by grid search: the specific method is: first use the expand.grid function to set the grid search parameters, and then pass the data and grid search parameters of step (2) to the train function for training and finding the optimal parameters; C. Model parameters adjusted by cross-validation method: the specific method is: first use the trainControl function to set the cross-validation parameters, and then use the data and cross-validation parameters of step (2) to pass to the train function for training and finding the optimal parameters.

[0118] Finally, the top 40% of the characteristic flavor substances ranked by importance calculated by SHAP were used as modeling features, and the XGBoost prediction model was constructed based on conventional parameters, model parameters adjusted by grid search, and model parameters adjusted by cross-validation. The classification performance of the constructed model was evaluated based on Accuracy, Precision, Recall, F1, Kappa, and AUC. The results are shown in Table 7:

[0119] Table 7 Evaluation results of each prediction model

[0120] Parameter adjustment method Accuracy Precision Recall F1 Kappa AUC General parameters 0.641 0.607 0.601 0.604 0.497 0.747 Grid Search 0.788 0.750 0.737 0.738 0.705 0.813 Cross-validation 0.722 0.671 0.639 0.642 0.610 0.779 Example 1 0.945 0.954 0.864 0.886 0.921 0.975

[0121] According to the results presented in Table 7, the classification performance of the XGBoost prediction model constructed based on conventional parameters, model parameters adjusted by grid search, or model parameters adjusted by cross-validation method is poor.

[0122] Comparative Example 2

[0123] 1. Sample collection: same as in Example 1;

[0124] 2. Collecting qualitative and quantitative data of flavor substances in each wine sample: Same as Example 1;

[0125] 3. Constructing a prediction model for different grades / quality of Maotai-flavor liquor based on SHAP value and XGBoost: Based on Example 1, the difference of Example 1 is that, in step (4), Feature importance and permutationimportance are used respectively to calculate the importance of flavor substance features and gradient stratified sampling is used for screening, and performance comparison is performed with the optimal sampling ratio; wherein, the specific steps of calculating and screening the importance of flavor substance features using Feature importance are as follows: first, the data in step (2) is converted into the format required for xgboost modeling by using xgboost::xgb.DMatrix, and then the data in this format and the model established in step (3) are passed to the xgb.importance function for importance calculation; the specific steps of calculating and screening the importance of flavor substance features using permutation importance are as follows: the data in step (2) and the model established in step (3) are passed to the perm_importance function for importance calculation.

[0126] Finally, the feature flavor substance information without feature screening (i.e., all features), the top 40% of the importance ranking calculated by SHAP, the top 30% of the importance ranking calculated by Feature importance, and the top 40% of the importance ranking calculated by permutation importance were used as modeling features, and the XGBoost prediction model was constructed based on the model parameters trained in step (3) of Example 1. The classification performance of the constructed model was evaluated based on Accuracy, Precision, Recall, F1, Kappa, and AUC, and the results are shown in Table 8:

[0127] Table 8 Evaluation results of each prediction model

[0128]

[0129] According to the results presented in Table 8, the classification performance of the XGBoost prediction model constructed by using the model parameters obtained by training in step (3) of Example 1 without feature screening (full flavor substance features), the feature flavor substance information in the top 30% of the importance ranking calculated by Featureimportance, and the feature flavor substance information in the top 40% of the importance ranking calculated by permutationimportance as modeling features, respectively, was significantly deteriorated.

[0130] Comparative Example 3

[0131] 1. Sample collection: same as in Example 1;

[0132] 2. Collecting qualitative and quantitative data of flavor substances in each wine sample: Same as Example 1;

[0133] 3. Constructing prediction models of different grades / quality of Maotai-flavor liquor based on SHAP value and XGBoost: Based on Example 1, the difference of Example 1 is that in step (3) of the comparative example, prediction models are constructed based on SVM, random forest and logistic regression models respectively;

[0134] Finally, the top 40% of the characteristic flavor substances ranked by importance calculated by SHAP were used as modeling features, and the XGBoost prediction model was constructed based on SVM, random forest, and logistic regression models. The classification performance of the constructed model was evaluated based on Accuracy, Precision, Recall, F1, Kappa, and AUC. The results are shown in Table 9:

[0135] Table 9 Evaluation results of each prediction model

[0136] Model Name Accuracy Precision Recall F1 Kappa AUC SVM 0.777 0.779 0.712 0.720 0.685 0.853 Random Forest 0.875 0.841 0.858 0.848 0.825 0.910 Logistic Regression 0.690 0.671 0.645 0.651 0.567 0.786 Example 1 0.945 0.954 0.864 0.886 0.921 0.975

[0137] According to the results presented in Table 9, the classification performance of the prediction models constructed based on SVM, random forest, and logistic regression are all worse than that of the XGBoost prediction model based on SHAP in Example 1.

[0138] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of the present invention are within the scope of protection of the present invention.

Claims

1. A method for constructing a liquor quality prediction model, characterized in that: The construction method comprises the following steps: (1) Obtaining flavor information in liquor samples of different qualities; (2) Based on grid search and cross-validation methods, the hyperparameters of the XGBoost model are adjusted to obtain the trained XGBoost model parameters; (3) Obtain the feature importance ranking results of flavor substances based on the SHAP method and screen the modeling features; (4) Based on the trained XGBoost model parameters and the screened modeling features, an XGBoost liquor quality prediction model is constructed.

2. The construction method according to claim 1, characterized in that: In step (1), obtaining the flavor substance information in the liquor samples of different qualities includes: performing joint detection and qualitative and quantitative analysis on the flavor substances in the liquor samples of different qualities based on GC-FID, LLME-GC-MS and HPLC techniques, respectively, and superimposing the qualitative and quantitative results obtained by the three techniques to obtain the flavor substance information.

3. The construction method according to claim 2, characterized in that: The GC-FID detection includes: pre-treating the liquor sample to obtain the sample to be tested; detecting the sample to be tested based on the GC-FID technology; wherein the GC-FID conditions used include: the chromatographic column is a DB-WAX UI chromatographic column (30m×0.25mm×0.25μm); Preferably, the GC-FID conditions used also include: injection port temperature 245-255°C; injection volume: 0.5-1.5 μL; split ratio: 28-32:1; column flow: 0.5-1.5 mL / min; Preferably, the GC-FID conditions used also include: a temperature program of: starting at 28-320°C, holding for 2.5-3.5 min, heating to 85-95°C at 2.5-3.5°C / min, then heating to 175-185°C at 4.5-5.5°C / min, and holding for 20-30 min; The temperature of the hydrogen flame ionization detector is: 245-255℃.

4. The construction method according to claim 2, characterized in that: LLME-GC-MS detection includes: pre-treating liquor samples to obtain samples to be tested; testing the samples to be tested based on LLME-GC-MS technology; Preferably, the sample pretreatment comprises: diluting the liquor sample to a set alcohol content, adding sodium chloride to saturation, adding an internal standard and an extraction solvent, shaking, standing and separating layers, and obtaining a sample to be tested; Preferably, the GC conditions used include: the chromatographic column is a DB-FFAP chromatographic column (60m×0.25mm×0.25μm); Preferably, the GC conditions used also include: the injection port temperature and the gas chromatography detector temperature are 245-255°C, helium is used as the carrier gas, the flow rate is 1.0-1.5 mL / min, and non-split injection; Preferably, the GC conditions used also include: the programmed temperature conditions are: the initial temperature is 35-45°C, maintained for 0.5-1.5 min, increased to 95-100°C at 2.0-3.0°C / min, maintained for 0.8-1.2 min, increased to 155-165°C at 2.5-3.5°C / min, increased to 225-235°C at 4.5-5.5°C / min, maintained for 8-12 min; Preferably, the MS conditions used include: using an EI ion source and an electron energy of 65-75 eV, setting the ion source temperature to 225-235° C., the quadrupole temperature to 145-155° C., and the scanning range to m / z 30-550.

5. The construction method according to claim 2, characterized in that: HPLC detection includes: pre-treating liquor samples to obtain samples to be tested; testing the samples to be tested based on HPLC technology; Preferably, the HPLC conditions used include: the chromatographic column is ZORBAX SB-C18 (4.6×150 mm 5-Micron); Preferably, the HPLC conditions used also include: mobile phase is 100% KH2PO4, pH=2.0-2.5; detection wavelength is 205-215nm, column oven is 25-35°C, mobile phase flow rate is 0.5-1.5mL / min, injection volume is 0.5-1.5μL.

6. The construction method according to claim 1, characterized in that: In step (2), the hyperparameters of the XGBoost model are adjusted based on the grid search and cross-validation method to obtain the trained XGBoost model parameters, including: firstly constructing a prediction model using conventional parameters on the training set data obtained after the standardization process; adjusting the hyperparameters of the XGBoost model using the grid search and cross-validation method; Preferably, the initial construction of a prediction model using conventional parameters for the training set data obtained after standardization includes: using the quantitative data of flavor substances as independent variables, the quality of the wine sample as the dependent variable, setting the model parameters to multi:softmax, and specifying the number of classification categories; Preferably, the use of grid search and cross validation methods to adjust the hyperparameters of the XGBoost model includes: using the trainControl function to set the cross validation parameters, then using the expand.grid function to set the grid search parameters, and then passing the cross validation parameters, grid search parameters and data for preliminary construction of the prediction model to the train function for training and finding the optimal parameters; Preferably, the parameters of the trained XGBoost model are: objective = "multi:softmax", num_class = 4, nrounds = 50, max_depth = 5, eta = 0.1, gamma = 0, colsample_bytree = 0.8, min_child_weight=2, subsample=0.

7. The construction method according to claim 1, characterized in that: In step (3), the SHAP method is used to obtain the feature importance ranking results of flavor substances, and the modeling features are screened, including: calculating the Shapley values ​​of flavor substances by the SHAP method, and performing importance ranking and gradient stratified sampling of flavor substances based on the calculated Shapley values; performing XGBoost modeling based on the flavor substance information corresponding to different gradient stratification ratios by using the trained XGBoost model parameters, and evaluating the classification performance of the constructed XGBoost model respectively, and screening the modeling features based on the evaluation results; Preferably, the flavor substance information corresponding to the different gradient stratification ratios includes: characteristic flavor substance information corresponding to the top 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% of the ranking; Preferably, the modeling features are flavor substances and their content information corresponding to the top 40% or 20%-60% of the feature importance ranking.

8. A method for predicting liquor quality, characterized in that: The prediction method comprises the following steps: (1) Obtaining flavor substance information in the liquor sample to be predicted; (2) Inputting the flavor substance information into the XGBoost prediction model constructed by the construction method described in any one of claims 1 to 7, and predicting the quality of the liquor sample to be predicted based on the input result of the XGBoost prediction model.

9. The prediction method according to claim 8, characterized in that: Predicting the quality of the liquor sample to be predicted includes: predicting the grade of the liquor sample to be predicted and / or the authenticity of the liquor sample to be predicted; wherein the grades include: low-grade, mid-grade, high-grade, and super high-grade.

10. The prediction method according to claim 9, characterized in that: When predicting the grade of the liquor sample to be predicted, the information of the flavor substances includes: at least one of propanol, 2-ethyl-6-methylpyrazine, furfural, lactic acid, 2-pentanol, benzaldehyde, isovaleric acid, 2-pentanone, 2,3-butanediol, ethyl isovalerate, diethoxymethane, ethyl decanoate, ethyl furoate, ethyl benzoate, ethyl 2-hydroxybutyrate, phenylethyl acetate, ethyl heptanoate, 2,3-dimethyl-5-ethylpyrazine, ethyl hexanoate, acetic acid, sec-butyl alcohol, isobutylaldehyde, diethyl succinate, ethyl butyrate, 2,5-dimethylpyrazine, 1,2-propylene glycol, phenylacetaldehyde, heptanoic acid, hexanoic acid, ethyl oleate, 4-methylphenol, 2-heptanone, n-pentanol, ethyl octanoate, ethyl dodecanoate, octanol, isobutyric acid, and n-hexanol, and their corresponding content data; Preferably, when predicting the authenticity of the liquor sample to be predicted, the information of the flavor substances includes: at least one of 2-pentanone, 3-octanol, ethyl heptadecanoate, ethyl 2-hydroxybutyrate, isovaleraldehyde, 2-nonanone, isobutanol, propanol, propionaldehyde, isopentyl acetate, ethyl butyrate, valeric acid, isobutyraldehyde, ethyl lactate, 2-heptanone, ethyl phenylacetate, ethyl octanoate, and ethyl pentadecanoate and their corresponding content data.

Citation Information

Cited By

  • Intelligent silicon-based OLED yield prediction method and device and storage medium

    CN119784219A

  • Method for constructing Baijiu sensory characteristic and quality expression prediction model

    CN119846107A

  • Mulberry wine quality prediction system and method based on multi-dimensional data fusion

    CN121071845A

  • Pork flavor quality marker screening and evaluation index construction method

    CN121231727A