White spirit quality evaluation method and device
Through the neural network model and quality feature contribution module, the quality evaluation of liquor is carried out based on quality feature data, which solves the subjective problems existing in traditional methods and achieves a more accurate and reliable quality evaluation of liquor.
Patent Information
- Application Number
- CN202510365700.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-06-27
AI Technical Summary
Traditional liquor quality evaluation methods rely on artificial sensory judgment, and there is great subjectivity and uncertainty, making it difficult to accurately reflect the quality characteristics of liquor.
A neural network model is used to evaluate the quality of liquor based on quality feature data, create a quality feature-quality evaluation database, and obtain the quality evaluation score of liquor through training models. At the same time, a quality feature contribution module is introduced to analyze the contribution degree of each quality feature.
It improves the accuracy and reliability of liquor quality evaluation, can more objectively reflect the quality characteristics of liquor, and maintains the real-time effectiveness of the evaluation by regularly updating the database and model.
Smart Images

Figure CN120218743A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of brewing, and specifically to a method and device for evaluating the quality of Chinese liquor. Background Art
[0002] Chinese liquor has a long brewing history and a wide consumer group in China. Traditional evaluation of Chinese liquor quality mostly relies on manual sensory judgment, usually by senior liquor tasters or experts subjectively scoring through indicators such as color, aroma, taste, and style. Although this method has been used in the industry for a long time, due to individual sensory differences and environmental factors, the evaluation results often have great subjectivity and uncertainty. Summary of the Invention
[0003] In order to improve the accuracy of Chinese liquor quality evaluation and obtain quality characteristics that play a key role in Chinese liquor quality, the present application provides a method and device for evaluating the quality of Chinese liquor.
[0004] The technical solution adopted by the present invention to solve the above problems is as follows:
[0005] A method for evaluating the quality of Chinese liquor, comprising:
[0006] Step 1, create a quality characteristic-quality evaluation database, including quality characteristic data and corresponding quality evaluation scores;
[0007] Step 2, based on a neural network model, with the quality characteristic data as the input and the quality evaluation score as the output, create a Chinese liquor quality evaluation model, and train the Chinese liquor quality evaluation model based on the quality characteristic-quality evaluation database;
[0008] Step 3, embed a quality characteristic contribution module for analyzing the contribution degree of each quality characteristic into the trained Chinese liquor quality evaluation model;
[0009] Step 4, obtain the quality characteristics of the liquor sample to be predicted, perform quality evaluation prediction based on the Chinese liquor quality evaluation model, and determine the key quality characteristics according to the contribution degree of each quality characteristic.
[0010] Further, the quality characteristic data includes: total esters, total acids, fusel oil, solids, ethyl acetate, ethyl lactate, ethyl butyrate, ethyl caproate, acetic acid, butyric acid, caproic acid, methanol, n-propanol, n-butanol, isobutanol, n-pentanol, isopentanol, ethyl palmitate, ethyl oleate, ethyl linoleate, turbidity parameter, and alcohol content parameter.
[0011] Further, the data items of the quality evaluation score include color, aroma, taste, and style, and the quality evaluation score is the weighted sum of the four scores.
[0012] Further, the specific steps for training the Chinese liquor quality evaluation model based on the quality characteristic-quality evaluation database are:
[0013] Divide the data in the quality characteristic-quality evaluation database into a training set and a test set;
[0014] Use the quality evaluation scores in the quality characteristic-quality evaluation database as the true output labels;
[0015] Train a neural network model with the training set. During the training process, compare the predicted values of the neural network model with the corresponding true output labels, calculate the corresponding loss function, and optimize the model through the backpropagation of the neural network;
[0016] Verify the neural network model with the test set. When the corresponding loss function is less than the loss function threshold and the determination coefficient value between the predicted value and the corresponding true output label is greater than the determination coefficient threshold, use the corresponding neural network model as the liquor quality evaluation model.
[0017] Furthermore, determine the initial weights according to the statistical characteristics of the quality characteristic data; the initial weight calculation formula is:
[0018]
[0019] In the formula, is the initial weight of the i-th quality characteristic data, N is the total number of quality characteristic data; φ i is the variance value of the i-th quality characteristic data;
[0020] During the model training process, adjust the weight allocation of each feature in real time through the attention mechanism, and the calculation formula is:
[0021]
[0022] In the formula, w i is the weight of the i-th quality characteristic data, x i is the i-th quality characteristic data, f(x i ) is the importance score of the i-th quality characteristic, and N is the total number of quality characteristic data.
[0023] Furthermore, it also includes regularly updating the quality characteristic-quality evaluation database and adjusting the liquor quality evaluation model according to the updated data.
[0024] Furthermore, the processing steps of the quality characteristic contribution module are:
[0025] Calculate the SHAP value of each quality characteristic data for the prediction result through the SHAP algorithm;
[0026] Evaluate the contribution degree of each quality characteristic data according to the calculated SHAP value;
[0027] Sort the contribution degrees of all quality characteristic data, and select the top A quality characteristics with the highest contribution degrees as the key quality characteristics.
[0028] Furthermore, when creating the quality characteristic-quality evaluation database, it also includes: preprocessing the data.
[0029] A liquor quality evaluation device, including:
[0030] A data collection module: Obtain the quality characteristic data of the sample liquor and the corresponding quality evaluation scores, and form a quality characteristic-quality evaluation data set;
[0031] A model construction module: Based on the neural network model, use the quality characteristic data as the input and the quality evaluation score as the output to create a liquor quality evaluation model, and train the liquor quality evaluation model based on the quality characteristic-quality evaluation data set;
[0032] A feature contribution calculation module: Analyze the contribution degrees of each quality characteristic based on the liquor quality evaluation model;
[0033] A feature acquisition module: Obtain the quality characteristic data of the liquor sample to be evaluated;
[0034] A prediction and recognition module: Obtain the predicted result of the quality evaluation score of the liquor sample to be evaluated based on the liquor quality evaluation model, and determine the key quality characteristics based on the contribution degrees of each quality characteristic data.
[0035] Furthermore, it also includes:
[0036] An abnormal alarm module: Used to regularly obtain the actual quality evaluation score of the liquor sample. When the determination coefficient value between the quality evaluation score predicted by the liquor quality evaluation model and the actual quality evaluation score is lower than the preset threshold, trigger an alarm, and update the quality characteristic-quality evaluation data set and the liquor quality evaluation model.
[0037] The beneficial effects of the present invention compared with the prior art are as follows: A liquor quality evaluation model is created based on the quality characteristic data and the corresponding quality evaluation scores, and the quality evaluation is completed based on the liquor quality evaluation model, with higher accuracy; The contribution degree of the quality characteristics is introduced based on the liquor quality evaluation model, and the quality characteristics that play a key role in the quality evaluation can be determined by calculating the contribution degree of the quality characteristics, which is more convenient to use; The reliability of the model is regularly inspected through the abnormal alarm module, and the quality characteristic-quality evaluation database is regularly updated, and the liquor quality evaluation model is adjusted according to the updated data to maintain the real-time effectiveness of the liquor quality evaluation model, which is more reliable to use; By determining the quality characteristics that play a key role in the quality evaluation, it can provide a reference for the optimization of the subsequent brewing production process and quality improvement. Description of the Drawings
[0038] Figure 1It is a flow chart of the method for evaluating the quality of Chinese liquor;
[0039] Figure 2 It is a schematic diagram of the change of loss value during the training process of the Chinese liquor quality evaluation model;
[0040] Figures 3 - 6 They are respectively schematic diagrams of the comparison between the actual values and predicted values of color, aroma, taste and style;
[0041] Figure 7 It is a schematic diagram of the structure of the Chinese liquor quality evaluation device. Detailed implementation manners
[0042] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the following further detailed description of the present invention is provided in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0043] As Figure 1 shown, the method for evaluating the quality of Chinese liquor includes:
[0044] Step 1: Create a quality feature-quality evaluation database, including quality feature data and corresponding quality evaluation scores. Among them, the quality feature data includes: the contents of compounds such as total esters, total acids, fusel oil, solids, ethyl acetate, ethyl lactate, ethyl butyrate, ethyl caproate, acetic acid, butyric acid, caproic acid, methanol, n-propanol, n-butanol, isobutanol, n-pentanol, isopentanol, ethyl palmitate, ethyl oleate, ethyl linoleate, etc., and also includes turbidity parameters and alcohol content parameters. The quality evaluation score data items include color, aroma, taste and style, and the quality evaluation score is the weighted sum of the four scores.
[0045] In order to improve data accuracy, when creating the quality feature-quality evaluation database, this embodiment also preprocesses the data, such as removing missing values or abnormal values in the quality feature-quality evaluation dataset.
[0046] Step 2: Based on the neural network model, using the quality feature data as the input and the quality evaluation score as the output, create a Chinese liquor quality evaluation model, and train the Chinese liquor quality evaluation model based on the quality feature-quality evaluation database.
[0047] Neural network models such as MLP, LSTM, RNN, CNN, Transformer, etc. can also be combined models of the above models. When predicting the four qualities of color, aroma, taste and style, one model can be used to output four results at the same time, or multiple independent sub-models can be used to predict one of the qualities of color, aroma, taste and style respectively.
[0048] After obtaining the four scores of color, aroma, taste and style, perform weighted summation on them to obtain the final quality evaluation score, that is, Score品质 = w 色 × Score 色 + w 香 × Score 香 + w 味 × Score 味 + w 格 × Score 格 , where Score 品质 , Score 色 , Score 香 , Score 味 , Score 格 are respectively the quality evaluation score of the baijiu sample, the color score of the baijiu sample, the aroma score of the baijiu sample, the taste score of the baijiu sample, the style score of the baijiu sample, and w 色 , w 香 , w 味 , w 格 are the corresponding weights respectively.
[0049] To eliminate the influence of different data magnitudes, before inputting the data into the model, the quality characteristic data and quality evaluation data can also be normalized. The sklearn.preprocessing.StandardScaler function can be used to standardize the data into a normal distribution with a mean of 0 and a standard deviation of 1.
[0050] The specific steps for training the baijiu quality evaluation model based on the quality characteristic-quality evaluation database are as follows: Divide the data in the quality characteristic-quality evaluation database into a training set and a test set; Use the quality evaluation scores in the quality characteristic-quality evaluation database as the true output labels; Train the neural network model with the training set. During the training process, compare the predicted values of the neural network model with the corresponding true output labels, calculate the corresponding loss function, and optimize the model through the backpropagation of the neural network; Validate the neural network model with the test set. When the corresponding loss function is less than the loss function threshold, use the corresponding neural network model as the baijiu quality evaluation model.
[0051] In this embodiment, the SmoothL1 loss function is used, and its expression is:
[0052]
[0053] Where x is the model prediction value, y is the model target value, and β is the smoothing threshold. Other loss functions can also be used, such as mean squared error, mean absolute error, etc., which are not restricted here. In this embodiment, the coefficient of determination value between the predicted value of the test set and the corresponding true output label is used to evaluate the model performance. In this embodiment, the coefficient of determination threshold is 0.8, that is, it is considered that when the coefficient of determination value between the predicted value of the test set and the corresponding true output label is greater than the threshold 0.8, the model training is considered completed.
[0054] In this embodiment, the schematic diagram of the change of the loss value during the training process is as Figure 2 shown.
[0055] In addition, the liquor quality evaluation model of this embodiment optimizes the response to different quality characteristic data through an adaptive weight allocation mechanism, specifically including:
[0056] When the model is initially trained, the initial weights are determined according to the statistical characteristics of the quality characteristic data; when the model is periodically fine-tuned and updated based on the transfer learning method, the initial weights are determined according to the contribution degree of each quality characteristic data; the initial weight calculation formula is:
[0057]
[0058] Where is the initialization weight of the i-th quality characteristic data, N is the total number of quality characteristic data; when determining the initialization weight according to the statistical characteristics of the quality characteristic data, φ i is the variance value of the i-th quality characteristic data, and when determining the initialization weight according to the contribution degree of each quality characteristic data, φ i is the mean value of the SHAP values of the i-th quality characteristic data;
[0059] During the model training process, the weight allocation of each feature is adjusted in real time through the attention mechanism, and the calculation formula is:
[0060]
[0061] Where w i is the weight of the i-th quality characteristic data, x i is the i-th quality characteristic data, f(x i ) is the importance score of the i-th quality characteristic, usually calculated by the attention layer neural network, and N is the total number of quality characteristic data.
[0062] The regular fine-tuning and updating of the model based on the transfer learning method means that the liquor quality evaluation model is updated as the quality feature-quality evaluation database is regularly updated. Specifically, it includes: after accumulating new data, retraining specific layers of the model to maintain the stability of historical data; using transfer learning technology to perform incremental updates on the existing model to reduce computational costs; and ensuring the model performance through the validation set of the quality feature-quality evaluation database after the update is completed.
[0063] In this embodiment, the weights of color, aroma, taste, and style are taken as 1.0, 2.5, 5.0, and 1.5 respectively. Since the initial scores of color, aroma, taste, and style are all on a 10-point scale, the liquor quality score after weighting is on a 100-point scale, that is, 100 points is the best and 0 points is the worst. The scores of color, aroma, taste, and style are 10 points, 25 points, 50 points, and 15 points respectively. The schematic diagram of the quality evaluation results of the test set is as Figures 3 - 6 shown. The coefficient of determination (R 2 ) between the predicted value and the true value in the test set data of color, aroma, taste, and style is not less than 0.8, and the coefficient of determination of aroma and style is not less than 0.9. It can be considered that the prediction accuracy of the liquor quality evaluation model is good.
[0064] Step 3: To facilitate knowing the quality features that play a key role in the quality evaluation determination, in this embodiment, a quality feature contribution module for analyzing the contribution degree of each quality feature data is embedded in the trained liquor quality evaluation model. The processing steps of the quality feature contribution module are as follows:
[0065] Step 31: Calculate the SHAP value of each quality feature data for the prediction result through the SHAP algorithm;
[0066] Step 32: Evaluate the contribution degree of each quality feature data according to the calculated SHAP value;
[0067] Step 33: Sort the contribution degrees of all quality feature data, and select the top A quality feature data with the highest contribution degrees as the key quality features, where A can be set according to actual needs.
[0068] Among them, the SHAP algorithm can be expressed as:
[0069]
[0070] In the formula, φ j is the SHAP value of the quality feature data j; N is the set of all quality feature data; S is the subset of quality feature data that does not include the quality feature data j; v(S) is the output value of the model when only the subset S is included; v(S∪{j}) is the output value of the model when the subset S and the feature data j are included; |S| is the size of the subset S; and |N| is the total number of quality feature data.
[0071] Step 4: Obtain the quality characteristic data of the wine sample to be predicted, classify it based on the white wine quality evaluation model, and determine the key quality characteristics according to the contribution degree of each quality characteristic data.
[0072] This embodiment also provides a white wine quality evaluation device, as Figure 7 shown, including:
[0073] Data collection module: Obtain the quality characteristic data of the sample wine sample and the corresponding quality evaluation score data, and form a quality characteristic-quality evaluation data set;
[0074] Model construction module: Based on the neural network model, use the quality characteristic data as the input and the quality evaluation score as the output to create a white wine quality evaluation model, and train the white wine quality evaluation model based on the quality characteristic-quality evaluation data set;
[0075] Feature contribution calculation module: Analyze the contribution degree of each quality characteristic based on the white wine quality evaluation model;
[0076] Feature acquisition module: Obtain the quality characteristic data of the wine sample to be evaluated;
[0077] Prediction and recognition module: Obtain the predicted result of the quality evaluation score of the wine sample to be evaluated based on the white wine quality evaluation model, and determine the key quality characteristics according to the contribution degree of each quality characteristic data.
[0078] Furthermore, an abnormal alarm module: used to regularly obtain the actual quality evaluation score of the wine sample. When the determination coefficient value between the quality evaluation score predicted by the white wine quality evaluation model and the actual quality evaluation score is lower than the preset threshold, trigger an alarm and update the quality characteristic-quality evaluation database and the white wine quality evaluation model. The abnormal alarm module facilitates monitoring the prediction accuracy of the white wine quality evaluation model, so as to adjust the white wine quality evaluation model in a timely manner.
Claims
1. A method for evaluating liquor quality, characterized in that: include: Step 1: Create a quality feature-quality evaluation database, including quality feature data and corresponding quality evaluation scores; Step 2: Based on the neural network model, the quality feature data is used as input and the quality evaluation score is used as output to create a liquor quality evaluation model, and the liquor quality evaluation model is trained based on the quality feature-quality evaluation database; Step 3: embedding a quality feature contribution module for analyzing the contribution of each quality feature into the trained liquor quality evaluation model; Step 4: Obtain the quality characteristics of the wine sample to be predicted, perform quality evaluation prediction based on the liquor quality evaluation model, and determine the key quality characteristics according to the contribution of each quality characteristic.
2. The liquor quality evaluation method according to claim 1, characterized in that: The quality characteristic data include: total esters, total acids, fusel oil, solids, ethyl acetate, ethyl lactate, ethyl butyrate, ethyl caproate, acetic acid, butyric acid, caproic acid, methanol, n-propanol, n-butanol, isobutanol, n-pentanol, isopentanol, ethyl palmitate, ethyl oleate, ethyl linoleate, turbidity parameters and alcohol content parameters.
3. The liquor quality evaluation method according to claim 1, characterized in that: The data items for quality evaluation score include color, aroma, taste and price, and the quality evaluation score is the weighted sum of the four scores.
4. The liquor quality evaluation method according to claim 1, characterized in that: The specific steps for training the liquor quality evaluation model based on the quality feature-quality evaluation database are as follows: Divide the data in the quality feature-quality evaluation database into a training set and a test set; The quality feature-quality evaluation score in the quality evaluation database is used as the true output label; Train the neural network model with the training set. During the training process, compare the predicted value of the neural network model with the corresponding true output label, calculate the corresponding loss function, and optimize the model through the back propagation of the neural network. The neural network model is verified with the test set. When the corresponding loss function is less than the loss function threshold, and the determination coefficient between the predicted value and the corresponding true output label is greater than the determination coefficient threshold, the corresponding neural network model is used as the liquor quality evaluation model.
5. The liquor quality evaluation method according to claim 4, characterized in that: When the model is first trained, the initial weight is determined according to the statistical characteristics of the quality feature data; the initial weight calculation formula is: In the formula, is the initial weight of the i-th quality feature data, and N is the total number of quality feature data; φ i is the variance value of the i-th quality characteristic data; During the model training process, the weight distribution of each feature is adjusted in real time through the attention mechanism. The calculation formula is: In the formula, w i is the weight of the i-th quality feature data, x i is the i-th quality characteristic data, f(x i ) is the importance score of the i-th quality feature, and N is the total number of quality feature data.
6. The liquor quality evaluation method according to claim 1, characterized in that: It also includes regularly updating the quality characteristics-quality evaluation database and adjusting the liquor quality evaluation model according to the updated data.
7. The liquor quality evaluation method according to claim 1, characterized in that: The processing steps of the quality characteristic contribution module are: The SHAP value of each quality feature data pair prediction result is calculated by SHAP algorithm; According to the calculated SHAP value, the contribution of each quality characteristic data is evaluated; Sort the contribution of all quality feature data, and select the A quality features with the highest contribution as key quality features.
8. The liquor quality evaluation method according to any one of claims 1 to 7, characterized in that: When creating a quality feature-quality evaluation database, it also includes: preprocessing the data.
9. A liquor quality evaluation device, characterized in that: include: Data collection module: obtain the quality characteristic data of the sample wine and the corresponding quality evaluation score to form a quality characteristic-quality evaluation data set; Model building module: Based on the neural network model, the quality feature data is used as input and the quality evaluation score is used as output to create a liquor quality evaluation model, and the liquor quality evaluation model is trained based on the quality feature-quality evaluation data set; Feature contribution calculation module: Analyze the contribution of each quality feature based on the liquor quality evaluation model; Feature acquisition module: obtains the quality feature data of the wine sample to be evaluated; Prediction and recognition module: Based on the liquor quality evaluation model, the quality evaluation score prediction results of the liquor sample to be evaluated are obtained, and the key quality characteristics are determined based on the contribution of each quality characteristic data.
10. The liquor quality evaluation device according to claim 9, characterized in that: Also includes: Abnormal alarm module: used to regularly obtain the actual quality evaluation score of wine samples. When the determination coefficient between the quality evaluation score predicted by the liquor quality evaluation model and the actual quality evaluation score is lower than the preset threshold, an alarm is triggered, and the quality feature-quality evaluation data set and the liquor quality evaluation model are updated.