White spirit yield prediction method based on machine learning algorithm

By combining machine learning algorithms with winemaking technology and the physical and chemical parameters of the mash entering the cellar, a liquor production prediction model was constructed, which solved the problem of lagging liquor production management, achieved real-time prediction of liquor production and precise control of production quality, and supported the stability and accuracy of intelligent brewing.

CN120633901APending Publication Date: 2025-09-12KWEICHOW MOUTAI COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510642067.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies are unable to achieve real-time feedback and effective control of liquor production, resulting in lagging production quality management and difficulty in achieving the stability and accuracy of intelligent brewing.

Method used

A machine learning algorithm is used in combination with winemaking process parameters and the physical and chemical parameters of the mash entering the cellar. The liquor production is predicted through random forest or XGBoost models, and the hyperparameters are tuned using Bayesian optimization or genetic algorithm to construct a liquor production prediction model.

Benefits of technology

It achieves real-time prediction and precise control of liquor production, improves the real-time feedback capability of production quality management, and supports the stability and accuracy of intelligent brewing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120633901A_ABST
    Figure CN120633901A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of white spirit brewing, and particularly relates to a white spirit yield prediction method based on a machine learning algorithm, which comprises the following steps: (1) obtaining wine making process data and / or pit-entering fermented grain physical and chemical data; (2) processing the data obtained in the step (1); (3) screening out characteristic variables which have great influence on the model as modeling characteristics; and (4) constructing a Baijiu yield prediction model, the model being selected from a random forest or XGBoost, and hyper-parameters of the model being adjusted and optimized by a Bayesian optimization algorithm or a genetic algorithm. The baijiu yield prediction method provided by the invention is high in accuracy and has important significance for developing intelligent brewing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of liquor brewing, and in particular relates to a liquor yield prediction method based on a machine learning algorithm. Background Art

[0002] With technological advancements and innovations, the liquor industry is accelerating the development of intelligent brewing technology. Intelligent brewing is a goal of innovation in traditional industries. The core of intelligent brewing lies in stabilizing liquor production and quality. To achieve intelligent brewing from traditional manual processes, the development of a quality prediction system is a key approach. Currently, predicting liquor production based on the "production process" of sauce-flavor liquor is of great significance for intelligent brewing. Yield, a result of the quality of the fermented mash, is a key goal of production management. Process optimization and improvement also directly impact liquor production. However, because yield is used to evaluate production quality and process improvements, it has a significant lag and can only serve as a reference for the next round of production, without providing real-time feedback. Therefore, predicting yield based on the "production process" is crucial for production quality control.

[0003] Baijiu production involves steaming and gelatinizing grains, spreading and airing the grains to add koji, and then fermenting them in piles and storing them in cellars. These three key steps determine the physical and chemical properties and microbial biomass of the mash upon storage, indirectly determining baijiu yield. The direct result of process implementation is the state of the mash entering the cellar. Current understanding of the mash entering the cellar primarily encompasses the microbial fermentation substrates starch and reducing sugars, the microbial metabolites total acid, acetic acid, lactic acid, and ethanol during the pile fermentation process, and the moisture content. The state of the mash entering the cellar directly determines the fermentation process within the cellar. Typically, fermentation within the cellar occurs naturally and anaerobic, with little human intervention. Therefore, baijiu yield and quality are often considered to be determined by gelatinization, saccharification, and microbial enrichment. Correlating the process of each step with the physical and chemical characteristics of the mash entering the cellar and predicting baijiu yield is scientifically sound. Therefore, it is crucial to combine the baijiu production process with the physical and chemical characteristics of the mash entering the cellar to predict baijiu yield, providing timely feedback on the quality of the mash entering the cellar and assisting in cellaring timing decisions. Summary of the Invention

[0004] In some embodiments, the present invention provides a method for predicting wine production, which predicts the amount of wine based on winemaking process parameters or physical and chemical parameters of the mash entering the cellar, wherein the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, Daqu dosage, average qu mixing temperature, air-drying room temperature, average piling temperature, average piling temperature and stacking time, and the physical and chemical parameters of the mash entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content.

[0005] In some embodiments, the winemaking process parameters are selected from the amount of Daqu used and the stacking time. The physical and chemical parameters of the fermented mash entering the cellar are selected from the ethanol content and the starch content.

[0006] In some embodiments, the wine yield is determined based on the functional relationship between the winemaking process parameters or the physical and chemical parameters of the mash entering the cellar and the wine yield, and the functional relationship can be obtained through a machine learning algorithm.

[0007] In some embodiments, the machine learning algorithm is selected from Random Forest or XGBoost.

[0008] In some embodiments, the machine learning algorithm is further subjected to hyperparameter tuning, and the hyperparameter tuning method is selected from a Bayesian optimization algorithm or a genetic algorithm.

[0009] In some embodiments, the wine is white wine.

[0010] In some embodiments, the Bayesian optimization algorithm optimization step includes: selecting random forest or XGBoost model hyperparameters and setting the hyperparameter value range; using BayesianOptimization() to search for hyperparameters, setting the maximum value of the number of initial points init_points used to fit the Gaussian process and the number of iterations n_iter of Bayesian optimization, and after the optimization is completed, obtaining the optimal hyperparameter combination according to the optimal optimization goal.

[0011] In some implementation schemes, the maximum value of init_points is 5-100.

[0012] In some implementation schemes, the maximum value of init_points is 5-50.

[0013] In some implementations, the maximum value of init_points is 10.

[0014] In some implementation schemes, the maximum value of n_iter is 5-200.

[0015] In some implementation schemes, the maximum value of n_iter is 5-100.

[0016] In some implementation schemes, the maximum value of n_iter is 50.

[0017] In some embodiments, the optimization objective is an evaluation index obtained after retraining the model using hyperparameter combinations obtained under different numbers of Bayesian optimization iterations.

[0018] In some embodiments, the evaluation index includes R 2 , MAE, MSE and RMSE.

[0019] In some embodiments, the genetic algorithm optimization step includes: selecting random forest or XGBoost model hyperparameters, setting the hyperparameter value range and the number of genetic algorithm iterations; randomly generating initial individuals, each individual is equivalent to a combination of the hyperparameters with different values, and iterating through crossover, mutation and selection operations; when the set number of iterations is completed, the individual with the highest fitness value is the optimal hyperparameter combination of the model.

[0020] In some embodiments, the crossover includes single-point crossover, two-point crossover, multi-point crossover, partial matching crossover, uniform crossover, mixed crossover, sequential crossover, position-based crossover, order-based crossover, cyclic crossover, or subpath crossover.

[0021] In some embodiments, the crossing comprises a mixed crossing.

[0022] In some embodiments, the mutation comprises a Gaussian mutation, an inversion mutation, a transversion mutation, a crossover mutation, or a bit flip mutation.

[0023] In some embodiments, the mutation comprises a Gaussian mutation.

[0024] In some embodiments, the selection comprises tournament selection, roulette wheel selection, truncation selection, random traversal selection, or elite selection.

[0025] In some embodiments, the selection comprises a tournament selection.

[0026] In some embodiments, the number of iterations is 5-100 times.

[0027] In some embodiments, the number of iterations is 5-50 times.

[0028] In some embodiments, the number of iterations is 10.

[0029] In some embodiments, the number of the initial individuals is 10 to 200.

[0030] In some embodiments, the number of the initial individuals is 10 to 100.

[0031] In some embodiments, the number of the initial individuals is 20 to 80.

[0032] In some embodiments, the random forest model hyperparameters include one or more of the number of decision trees n_estimators, the maximum depth of the tree max_depth, the minimum number of node split samples min_samples_split, the minimum number of leaf node samples min_samples_leaf, the maximum number of features involved in the judgment when the node splits max_features, whether to use bootstrap sampling, and the node division criterion criterion.

[0033] In some embodiments, the XGBoost model hyperparameters include one or more of the number of weak learners n_estimators, the maximum depth of the tree max_depth, the learning rate learning_rate, the row sampling ratio subsample, the column sampling ratio colsample_bytree, the minimum instance weight of the child node and min_child_weight, the minimum loss function reduction required for node splitting gamma, the L2 regularization term lambda and the L1 regularization term alpha.

[0034] In some embodiments, the present invention provides a method for constructing a drinking capacity prediction model, the method comprising the following steps:

[0035] S1: Acquiring data: The data includes wine production and corresponding winemaking process parameters and / or physical and chemical parameters of the fermented grains in the cellar;

[0036] S2: Processes the data obtained by S1.

[0037] S3: Screening modeling features: Use the processed winemaking process parameters and / or the physical and chemical parameters of the fermented mash obtained in S2 as feature variables, and the output of each steamer of liquor as the response variable. Rank the feature variables by importance and screen to obtain modeling features.

[0038] S4: Constructing a prediction model: using the modeling features as feature variables and the output of each steamer of liquor as a response variable, training a machine learning algorithm to obtain a prediction model, wherein the machine learning algorithm is selected from random forest or XGBoost;

[0039] The method further includes performing hyperparameter tuning on the prediction model, wherein the hyperparameter tuning method is selected from a Bayesian optimization algorithm or a genetic algorithm.

[0040] In some embodiments, the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, Daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time.

[0041] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content.

[0042] In some embodiments, the winemaking process parameters are selected from the amount of Daqu used and the stacking time.

[0043] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar are selected from ethanol content and starch content.

[0044] In some embodiments, the wine is white wine.

[0045] In some embodiments, in step S2, the processing includes processing duplicates, missing values, and outliers in the data and standardizing the data.

[0046] In some embodiments, the method for processing the duplicates is direct elimination.

[0047] In some embodiments, the method for processing missing values ​​includes direct elimination or median filling.

[0048] In some embodiments, the outlier detection method includes an IQR method, a robust Mahalanobis distance method, or a local outlier factor method.

[0049] In some embodiments, the method for processing the outliers is direct elimination.

[0050] In some embodiments, the data normalization comprises normalizing the data using a z-score method.

[0051] In some embodiments, in step S3, the method for screening modeling features is selected from Pearson correlation analysis, Spearman correlation analysis, or cross-validation recursive feature elimination method.

[0052] In some embodiments, the modeling features include winemaking process parameters and / or physical and chemical parameters of the mash entering the cellar.

[0053] In some embodiments, the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, Daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time.

[0054] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content.

[0055] In some embodiments, the winemaking process parameters are selected from the amount of Daqu used and the stacking time.

[0056] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar are selected from ethanol content and starch content.

[0057] In some embodiments, the number of the modeling features is 2-200.

[0058] In some embodiments, the number of the modeling features is 3-100.

[0059] In some embodiments, the number of the modeling features is 4-15.

[0060] In some embodiments, step S4 further includes dividing the data into a training set and a validation set.

[0061] In some embodiments, 60%-80% of the data is a training set, and 20%-40% is a validation set.

[0062] In some embodiments, 70% of the data is a training set and 30% is a validation set.

[0063] In some embodiments, step S4 further includes evaluating the prediction model.

[0064] In some embodiments, the evaluation index of the prediction model includes R 2 , MAE, MSE and RMSE.

[0065] In some embodiments, the Bayesian optimization algorithm optimization step includes: selecting random forest or XGBoost model hyperparameters, setting hyperparameter value ranges, performing hyperparameter search using BayesianOptimization(), setting a maximum value for the number of initial points init_points used to fit the Gaussian process and the number of Bayesian optimization iterations n_iter, and after the optimization is completed, obtaining an optimal hyperparameter combination based on the optimal optimization objective.

[0066] In some implementation schemes, the maximum value of init_points is 5-100.

[0067] In some implementation schemes, the maximum value of init_points is 5-50.

[0068] In some implementations, the maximum value of init_points is 10.

[0069] In some implementation schemes, the maximum value of n_iter is 5-200.

[0070] In some implementation schemes, the maximum value of n_iter is 5-100.

[0071] In some implementation schemes, the maximum value of n_iter is 50.

[0072] In some embodiments, the optimization objective is an evaluation index obtained after retraining the model using hyperparameter combinations obtained under different numbers of Bayesian optimization iterations.

[0073] In some embodiments, the evaluation index includes R 2 , MAE, MSE and RMSE.

[0074] In some embodiments, the genetic algorithm optimization step includes selecting hyperparameters of a random forest or XGBoost model, setting a range of values ​​for the hyperparameters, and a number of genetic algorithm iterations. Initial individuals are randomly generated, each corresponding to a set of hyperparameter combinations with different values, and the algorithm is iterated through crossover, mutation, and selection. Upon completing the set number of iterations, the individual with the highest fitness value is deemed to be the optimal hyperparameter combination for the model.

[0075] In some embodiments, the crossover includes single-point crossover, two-point crossover, multi-point crossover, partial matching crossover, uniform crossover, mixed crossover, sequential crossover, position-based crossover, order-based crossover, cyclic crossover, or subpath crossover.

[0076] In some embodiments, the crossing comprises a mixed crossing.

[0077] In some embodiments, the mutation comprises a Gaussian mutation, an inversion mutation, a transversion mutation, a crossover mutation, or a bit flip mutation.

[0078] In some embodiments, the mutation comprises a Gaussian mutation.

[0079] In some embodiments, the selection comprises tournament selection, roulette wheel selection, truncation selection, random traversal selection, or elite selection.

[0080] In some embodiments, the selection comprises a tournament selection.

[0081] In some embodiments, the number of iterations is 5-100 times.

[0082] In some embodiments, the number of iterations is 5-50 times.

[0083] In some embodiments, the number of iterations is 10.

[0084] In some embodiments, the number of the initial individuals is 10 to 200.

[0085] In some embodiments, the number of the initial individuals is 10 to 100.

[0086] In some embodiments, the number of the initial individuals is 20 to 80.

[0087] In some embodiments, the random forest model hyperparameters include one or more of the number of decision trees n_estimators, the maximum depth of the tree max_depth, the minimum number of node split samples min_samples_split, the minimum number of leaf node samples min_samples_leaf, the maximum number of features involved in the judgment when the node splits max_features, whether to use bootstrap sampling, and the node division criterion criterion.

[0088] In some embodiments, the XGBoost model hyperparameters include one or more of the number of weak learners n_estimators, the maximum depth of the tree max_depth, the learning rate learning_rate, the row sampling ratio subsample, the column sampling ratio colsample_bytree, the minimum instance weight of the child node and min_child_weight, the minimum loss function reduction required for node splitting gamma, the L2 regularization term lambda and the L1 regularization term alpha.

[0089] In some embodiments, the present invention provides a method for predicting wine yield, comprising the following steps:

[0090] S1: Get data.

[0091] S2: Input the data obtained in S1 into the alcohol consumption prediction model constructed by the method for constructing an alcohol consumption prediction model provided by the present invention, and output the predicted wine production.

[0092] In some embodiments, the data include winemaking process parameters or physical and chemical parameters of the mash entering the cellar.

[0093] In some embodiments, the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, Daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time.

[0094] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content.

[0095] In some embodiments, the winemaking process parameters are selected from the amount of Daqu used and the stacking time.

[0096] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar are selected from ethanol content and starch content.

[0097] In some embodiments, the wine is white wine.

[0098] In some embodiments, the present invention provides a wine production prediction system, comprising the following modules:

[0099] Data acquisition module, used to collect winemaking process parameters and / or physical and chemical parameters of wine mash entering the cellar;

[0100] A data processing module is used to process the data collected by the data collection module, including removing duplicates, processing missing values, processing outliers or normalizing the data, and dividing the data into a training set and a validation set;

[0101] The feature optimization section is used to screen modeling features, wherein the modeling features are selected from the winemaking process parameters and / or the physical and chemical parameters of the fermented grains after being processed by the data processing module;

[0102] An optimized prediction model module is used to construct a model based on the modeling features selected by the feature optimization module and perform hyperparameter tuning on the model to obtain an optimized prediction model. The model is selected from a random forest or XGBoost, and the hyperparameter tuning method is selected from a Bayesian optimization algorithm or a genetic algorithm;

[0103] The output prediction module is used to input the data processed by the data processing module into the optimized prediction model module to obtain the wine output prediction result.

[0104] In some embodiments, the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, Daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time.

[0105] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content.

[0106] In some embodiments, the winemaking process parameters are selected from the amount of Daqu used and the stacking time.

[0107] In some embodiments, the physicochemical parameters of the fermented mash entering the cellar are selected from ethanol content and starch content.

[0108] In some embodiments, the wine is white wine.

[0109] In some embodiments, the method for processing missing values ​​includes direct elimination or median filling.

[0110] In some embodiments, the outlier detection method includes an IQR method, a robust Mahalanobis distance method, or a local outlier factor method.

[0111] In some embodiments, the method for processing the outliers is direct elimination.

[0112] In some embodiments, the normalization process is to normalize the data using the z-score method.

[0113] In some embodiments, the method for screening modeling features is selected from Pearson correlation analysis, Spearman correlation analysis, or cross-validation recursive feature elimination.

[0114] In some embodiments, the number of the modeling features is 2-200.

[0115] In some embodiments, the number of the modeling features is 3-100.

[0116] In some embodiments, the number of the modeling features is 4-15.

[0117] In some embodiments, the random forest model hyperparameters include one or more of the number of decision trees n_estimators, the maximum depth of the tree max_depth, the minimum number of node split samples min_samples_split, the minimum number of leaf node samples min_samples_leaf, the maximum number of features involved in the judgment when the node splits max_features, whether to use bootstrap sampling, and the node division criterion criterion.

[0118] In some embodiments, the XGBoost model hyperparameters include one or more of the number of weak learners n_estimators, the maximum depth of the tree max_depth, the learning rate learning_rate, the row sampling ratio subsample, the column sampling ratio colsample_bytree, the minimum instance weight of the child node and min_child_weight, the minimum loss function reduction required for node splitting gamma, the L2 regularization term lambda and the L1 regularization term alpha.

[0119] In some embodiments, the present invention provides the wine yield prediction method, the method for constructing the wine yield prediction model, or the application of the wine yield prediction system in the winemaking field.

[0120] In some embodiments, the application comprises an application for wine production prediction.

[0121] In some embodiments, the application includes an application for liquor production prediction.

[0122] In some implementations, an XGBoost model is constructed to predict wine yield using ethanol, daqu dosage, piling time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid as feature variables. The model also uses genetic algorithms to optimize hyperparameters. This model achieves over 90% accuracy in predicting wine yield.

[0123] In some embodiments, a random forest model is constructed to predict wine yield using ethanol, daqu dosage, piling time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid as feature variables. The model also uses a Bayesian algorithm to optimize hyperparameters. This model achieves an accuracy rate of over 92% when predicting wine yield. BRIEF DESCRIPTION OF THE DRAWINGS

[0124] Figure 1 QQ Plot diagram of some characteristic variables.

[0125] Figure 2 The results of Pearson correlation analysis of each variable are shown.

[0126] Figure 3 The results of the Spearman correlation analysis are shown for each variable.

[0127] Figure 4 shows the result of feature selection using random forest combined with recursive elimination and cross-validation. A is the importance ranking of different feature variables, and B is the effect of different numbers of feature variables on the generalization ability of the random forest model.

[0128] Figure 5 Comparison of evaluation results of different models.

[0129] Figure 6 The results of 5-fold cross-validation are used to determine the stability of the prediction capabilities of Random Forest, XGBoost, and KNN, which have better model screening performance.

[0130] Figure 7 Bayesian optimization learning curves for Random Forest and XGBoost models.

[0131] Figure 8 Compare the evaluation results of Random Forest or XGBoost models with different hyperparameter tuning methods. DETAILED DESCRIPTION

[0132] The following is a detailed description of the technical solution of the present invention, which does not limit the scope of protection of the present invention. Non-essential modifications and adjustments made by others based on the concept of the present invention still fall within the scope of protection of the present invention.

[0133] The experimental methods in the following examples without specifying specific conditions were all based on conventional techniques in the art or the conditions recommended by the manufacturers; the reagents or instruments used without specifying the manufacturers were all conventional products that can be purchased commercially.

[0134] Unless otherwise defined, the definition of all technical and scientific terms used herein is the same as that familiar to those skilled in the art. In addition, any method and material similar or equivalent to the described content can be applied to the present invention, and preferred methods and materials are described in the specific embodiments.

[0135] In this article, the professional terms in this field are defined as follows:

[0136] Outliers: A dataset contains one or more abnormally large or small values ​​due to errors in data entry, measurement, testing, or processing. These extreme values ​​are called outliers. The presence of outliers can have many negative effects on statistical data, such as reducing the persuasiveness and credibility of the statistics.

[0137] IQR: Interquartile range, also known as the interquartile range, is defined as Q3 - Q1. Q1 is the first quartile of the data, Q2 is the second quartile, and Q3 is the third quartile. Data outside Q3 + 1.5 IQR or Q1 - 1.5 IQR are considered outliers.

[0138] Local Outlier Factor (LOF) is an algorithm used to detect local density anomalies. It identifies local outliers by comparing the density of a data point with its neighbors. The core idea of ​​the LOF method is that if a data point is located in a low-density area and its neighbors are in higher-density areas, the point is likely an outlier. Conversely, if the density of a data point is similar to that of its neighbors, the point is considered a normal point.

[0139] Robust Mahalanobis Distance: The robust Mahalanobis distance uses the minimum covariance determinant to estimate the mean and covariance. This robustness is less affected by non-normal distributions, making it more resilient to outliers and more robust than the traditional Mahalanobis distance. It can provide more accurate outlier detection when the data does not meet the normal distribution assumption. The Mahalanobis distance is a common distance metric in metric learning, used to assess the similarity between data.

[0140] The Minimum Covariance Determinant (MCD) is a statistical method for obtaining mean and covariance estimates. The Mahalanobis distance is commonly used to determine whether a sample is an outlier. Directly calculating the mean and covariance estimates of a dataset can be easily affected by outliers, leading to inaccurate Mahalanobis distance calculations and, in turn, affecting the determination of discrete values. Therefore, the MCD is used to obtain more robust mean and covariance estimates, resulting in a more accurate Mahalanobis distance calculation.

[0141] Cross-validation: A practical statistical method for dividing a data sample into smaller subsets. Specifically, within a given set of data, the majority of the samples are used to build the model, while a smaller subset is retained for prediction using the newly built model. The prediction errors for this smaller subset are then calculated, and the sum of the squares is recorded. This process continues until all samples have been predicted once and only once. Compared to a simple training and validation set, cross-validation can prevent accidental data splitting and improve the assessment of the model's generalization ability. Cross-validation can better assess the model's predictive ability.

[0142] Pearson correlation analysis: A method used to measure the strength of a linear relationship between two variables. It quantifies the linear relationship by calculating the covariance and standard deviation of the two variables. The Pearson correlation coefficient ranges from -1 to 1, where 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no linear relationship.

[0143] Spearman correlation analysis is a nonparametric statistical method used to assess the rank correlation between two variables. It measures correlation based on the rank of the variables, rather than relying on specific numerical values. It is particularly useful for datasets that do not follow a normal distribution or contain outliers. The Spearman correlation coefficient ranges from -1 to 1, where 1 indicates a perfect positive correlation, -1 indicates a perfect negative correlation, and 0 indicates no correlation.

[0144] Recursive Feature Elimination with Cross-Validation (RFECV) is a feature selection method. RFECV uses cross-validation to determine the importance of each feature subset and select the one with the best performance. It automatically selects the optimal number of features and also assesses the stability of feature subsets.

[0145] Quantile-Quantile Plot: A statistical graph used to compare the quantiles of two sets of data to determine whether they are roughly the same. The QQ plot evaluates the distribution characteristics of data by comparing the quantiles of the observed values ​​with the quantiles of the expected values.

[0146] R 2 : Coefficient of determination, which reflects the reliability and accuracy of the regression model in explaining the changes in the dependent variable. Its value ranges from 0 to 1. 2 The closer the value is to 1, the better the model fits the data and the higher the degree of explanation of the independent variable to the dependent variable. On the contrary, when R 2 The closer the value is to 0, the worse the model fits the data.

[0147] MAE: Mean Absolute Error, a statistical metric used to measure the average difference between predicted and actual values. It is the average of the absolute differences between the predicted and true values. A smaller MAE indicates that the model's predictions are closer to the true values ​​and the model's accuracy is higher. MSE: Mean Squared Error, is commonly used to evaluate the difference between a model's predicted values ​​and the true values. It measures the model's predictive performance by calculating the average of the squared errors between the predicted and true values. A smaller MSE indicates a more accurate model's predictions; a larger MSE indicates a greater prediction error.

[0148] RMSE: Root Mean Square Error, a common metric for measuring the difference between predicted and actual values, is the square root of the mean of the squares of the differences between the predicted and true values. A smaller RMSE indicates a closer prediction to the true value, and a higher accuracy.

[0149] OLS: Ordinary Least Squares Regression Model, a widely used linear regression model, is mainly used to estimate the parameters of the linear regression model. It aims to find the optimal linear equation by minimizing the sum of squares of the error terms to describe the relationship between the dependent variable and the independent variable.

[0150] Lasso: Least Absolute Shrinkage and Selection Operator, a linear regression algorithm for feature selection and model regularization.

[0151] Random Forest: A decision tree-based ensemble learning algorithm that uses random feature selection and random sample selection when building each decision tree, and averages or votes on multiple decision trees to obtain the final prediction result.

[0152] XGBoost: A decision tree-based ensemble learning algorithm. It iteratively generates multiple weak learners. Each weak learner is fitted on samples that were incorrectly predicted by the previous weak learner. The final prediction is then obtained by weighted accumulation of all the weak learners' predictions.

[0153] Neural Network: A machine learning algorithm that mimics the interconnectedness and signal transmission of neurons in the human brain. It generates outputs by weighted summation of input signals and processing them through nonlinear activation functions. Neural networks are composed of a large number of interconnected nodes (or "neurons"), forming a complex network structure capable of processing complex data inputs and performing various tasks such as classification, regression, and pattern recognition.

[0154] KNN: K-nearest neighbor algorithm, a supervised learning algorithm widely used in data mining and machine learning, can be used for classification and regression problems.

[0155] Baseline: In machine learning, a baseline is a simple, easy-to-implement benchmark model used for comparison with more complex machine learning models. A baseline model is typically a simplified approach that doesn't involve many advanced techniques and optimizations, but it provides a starting point to help researchers evaluate the performance of other models. When developing and optimizing machine learning models, if a model's performance doesn't significantly outperform the baseline, it may indicate a problem with the model and requires further improvement.

[0156] Bayesian optimization learning curve: The trend of model performance over time or iteration number when using Bayesian optimization methods for hyperparameter tuning.

[0157] Iterations: The number of times a model updates its parameters using a batch of data during training.

[0158] Bayesian Optimization: Bayesian Optimization, or Bayes for short, is a strategy for global function optimization, particularly suitable for computationally expensive black-box functions (such as hyperparameter tuning in machine learning models). Its core concept is to construct a surrogate model (usually a Gaussian process) and gradually select optimal parameters to effectively find the global optimal solution. Bayesian optimization can effectively explore the parameter space without requiring extensive computing resources, offering greater efficiency and rigor.

[0159] Genetic Algorithm (GA) is a method that simulates the natural evolutionary process to search for optimal solutions. Using mathematical methods and computer simulation, this algorithm transforms the problem-solving process into a process similar to the crossover and mutation of chromosome genes in biological evolution. When solving complex combinatorial optimization problems, it can typically achieve better results faster than conventional optimization algorithms.

[0160] Fitness: A measure of an individual's advantage in survival within a population, used to distinguish between "good" and "bad" individuals. Fitness is calculated using a fitness function. A fitness function, also called an evaluation function, primarily determines an individual's fitness based on its characteristics.

[0161] Hybrid crossover: A crossover operator designed for real-number coded individuals in genetic algorithms that generates offspring by linear interpolation or expanding the parent gene range. It is suitable for continuous optimization problems.

[0162] Gaussian mutation: A mutation operation method that improves the local search performance of the genetic algorithm in the key search area. During the mutation, a random number with a normal distribution with mean μ and variance σ2 is used to replace the original gene value.

[0163] Tournament selection: A method that randomly selects a certain number of individuals and picks the one with the highest fitness.

[0164] Grid Search: GridSearchCV, or GSCV for short, is a method that exhaustively searches all possible parameter combinations, uses cross-validation to evaluate the performance of each combination, and ultimately returns the parameter combination with the best performance. It is often used to tune the hyperparameters of machine learning models.

[0165] Randomized Search: Randomized Search CV (RSCV) is a hyperparameter optimization method based on random search. It finds the best hyperparameter combination and improves model performance by randomly selecting combinations in a given hyperparameter space and using cross-validation to evaluate model performance.

[0166] In the embodiments herein, the average steaming time is the mean of the steaming time of each steamer in the same cellar (the steaming time refers to the time when the mash is placed in the steamer during the winemaking process); the gelatinization time is the mean of the time from the end of the upper steamer to the lower steamer in each steamer in the same cellar; the gelatinization pressure is the steam pressure in the cellar during the gelatinization process; the amount of Daqu is the mean of the mass of Daqu added to each steamer of mash in the same cellar during the mixing process; the average mixing temperature is the average temperature of each steamer of mash in the same cellar during the mixing process; the air-drying room room temperature is the average temperature in the air-drying room where each steamer of mash in the same cellar is piled up for fermentation after mixing; the average piling temperature is the average temperature of the mash from the second to the second to last steamers in the same cellar after they are spread out to dry and mixed with koji and piled together; the average piling temperature is the average temperature of the mash in the first steamer of the same cellar after they are spread out to dry and mixed with koji; the piling time is the time for the mash to be piled up and fermented in the air-drying room after mixing with koji.

[0167] In the examples herein, unless otherwise specified, data processing, model screening, model evaluation, and yield prediction are all completed in Python, as shown in Table 1 below:

[0168] Table 1 Data packets used in the present invention

[0169]

[0170]

[0171]

[0172] In the examples herein, Ethanol refers to ethanol content (g / 100g fermented mash), D dose refers to the amount of Daqu used (kg), Sf_time refers to stacking time (min), Starch refers to starch content (g / 100g fermented mash), G_time refers to gelatinization time (min), TA refers to total acid content (mL / g), LA refers to lactic acid content (g / 100g fermented mash), RS refers to residual sugar (g / 100g fermented mash), Moisture refers to moisture content (%), Tz_time refers to average steaming time (min), R_temperature refers to airing room temperature (°C), Dm_temperature refers to average koji mixing temperature (°C), Sf_temperature 1 refers to average piling temperature (°C), Sf_temperature 2 refers to average piling temperature (°C), AA refers to acetic acid content (g / 100g fermented mash), and Gv_pressue refers to gelatinization pressure (MPa).

[0173] In this article, "total acid", "total acid content" and "TA" are used interchangeably; "residual sugar", "residual sugar", "RS" and "residual sugar content" are used interchangeably; "starch", "starch" and "starch content" are used interchangeably; "moisture", "moisture" and "moisture content" are used interchangeably; "acetic acid", "AA" and "acetic acid content" are used interchangeably; "ethanol", "Ethanol" and "ethanol content" are used interchangeably; "lactic acid", "LA" and "lactic acid content" are used interchangeably.

[0174] Example 1 A method for constructing a liquor production prediction model

[0175] 1. Get data

[0176] The process data of brewing liquor (average steaming time, gelatinization time, gelatinization pressure, daqu dosage, average qu mixing temperature, air-drying room room temperature, average piling temperature, average piling temperature and piling time), physical and chemical index data of mash entering the cellar (total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content) and liquor production data were obtained, totaling 1506 sets of data.

[0177] The process data comes from the production department of Kweichow Moutai Co., Ltd.; the methods for determining total acid content, residual sugar content, starch content, moisture content, and ethanol content refer to the near-infrared spectroscopy analysis method in Method 2 of T / CBJ 004-2018 "General Analysis Method for Solid-State Fermentation Grains." The method for determining lactic acid and acetic acid content is based on the near-infrared spectroscopy analysis method for testing the lactic acid and acetic acid contents of the mash entering the cellar.

[0178] Some examples of the data obtained are shown in Table 2 below:

[0179] Among them, total acid refers to the number of milliliters of 0.1M sodium hydroxide consumed by 1g of fermented mash. For example, 1.97mL / g total acid means that 1g of fermented mash sample consumes a total of 1.97mL of 0.1M sodium hydroxide.

[0180] The residual sugar content refers to the number of grams of reducing sugar (calculated as glucose) remaining in 100g of fermented mash sample. For example, if the residual sugar is 4.06g / 100g of fermented mash, it means that the number of grams of reducing sugar contained in 100g of fermented mash sample converted into glucose is 4.06g.

[0181] The starch content refers to the number of grams of starch (calculated as glucose) in 100g of fermented mash sample. For example, if the starch content is 34.53g / 100g of fermented mash, it means that the number of grams of starch contained in 100g of fermented mash sample converted into glucose is 34.53g.

[0182] The ethanol content, lactic acid content or acetic acid content refers to the number of grams of ethanol, lactic acid or acetic acid contained in 100g of fermented mash sample. For example, if the ethanol content is 0.22g / 100g of fermented mash, it means that 0.22g of ethanol is contained in every 100g of fermented mash sample.

[0183] Moisture content refers to the ratio of the mass of water in the mash sample to the total mass of the mash sample. For example, 41.71% moisture content means that 100g of mash sample contains 41.71g of water.

[0184] Table 2 Partial data information

[0185]

[0186] 2. Processing Data

[0187] 2.1 Duplicate values: Delete completely duplicate data in the dataset;

[0188] 2.2 Missing values: Fill in the median or directly delete a small number of missing samples;

[0189] 2.3 Outliers: Check samples with extreme distributions in the variables and remove data outside Q3+1.5IQR or Q1-1.5IQR according to the IQR method; use QQ Plot (Quantile-Quantile Plot) to visually check the deviation of data distribution from the normal distribution. By comparing the quantiles of the sample distribution with the quantiles of the theoretical normal distribution through QQ Plot, it is found that only some of the characteristic variables show normal distribution. Figure 1 QQ Plots of some characteristic variables are displayed. For this situation, we use Robust Mahalanobis Distance combined with Local Outlier Factor (LOF) for outlier analysis. Robust Mahalanobis Distance uses sklearn.covariance.MinCovDet for robust covariance estimation, thereby identifying outliers, while LOF uses sklearn.neighbors.LocalOutlierFactor for outlier identification.

[0190] LOF detected 77 abnormal samples, and Robust Mahalanobis Distance detected 17 abnormal samples. The outliers detected by different methods may overlap. The detected abnormal samples were directly eliminated, leaving 1419 sets of data information.

[0191] 3. Screening Modeling Features

[0192] The average steaming time, gelatinization time, gelatinization pressure, daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature, piling time, total acid, residual sugar, starch, moisture, acetic acid, ethanol, and lactic acid were the characteristic variables, and the average output of liquor per steamer in each cellar (abbreviated as steamer output) was the response variable.

[0193] 3.1 Use the cor function of R language to perform Pearson correlation analysis between variables. The results are as follows Figure 2 shown.

[0194] 3.2 Use the cor function of R language to perform spearman correlation analysis between the variables. The results are as follows Figure 3 shown.

[0195] 3.3 Use Random Forest combined with Cross-Validation Recursive Feature Elimination (RFECV) to select modeling feature variables. Use Random Forest Regressor in the sklearn library of Python to rank the importance of feature variables. The results are as follows Figure 4A As shown in the figure, we use RFECV in sklearn.feature_selection in Python to build a random forest model according to the importance of feature variables. Each time we build a model, we add the feature variable with the next highest importance until all 16 feature variables are built. This is to determine the impact of the number of feature variables on the model and to observe the trend of model performance through the feature selection curve. The results are shown in the figure. Figure 4B shown.

[0196] In the Pearson correlation analysis results ( Figure 2 ) and Spearman correlation analysis results ( Figure 3 ), it can be clearly seen that the characteristic variable gelatinization pressure has almost no correlation with the response variable (i.e., steamer output), and also has almost no correlation with other variables.

[0197] Depend on Figure 4A It can be seen that the four characteristic variables that have the greatest impact on the model are ethanol, Daqu dosage, stacking time and starch, and gelatinization pressure has the weakest impact on the model. Figure 4B As can be seen, the accuracy and stability of the models constructed by incorporating four or more characteristic variables showed minimal differences. Taking into account the impact of each characteristic variable on the model, the remaining 15 characteristic variables (ethanol, daqu dosage, piling time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid) were used to fit the model.

[0198] In summary, the range set for Gv_pressure has little impact on the response variable. This indicator may be a process parameter with relatively mature control, which often means that it is effectively controlled within a reasonable range, and therefore has little impact on the response variable. The process-related parameters that have a greater impact on the model may reflect their more direct impact on yield in actual production.

[0199] 4. Model Screening

[0200] 4.1 Data loading and standardization: Use StandardScaler in the Python sklearn library to perform z-score standardization on the feature data to eliminate the influence of the dimension and the variable’s own variation and numerical size, and ensure that the scale of each feature is consistent.

[0201] 4.2 Dataset division: The 1419 sets of data were divided into a training set (993 sets) and a validation set (426 sets) in a ratio of 7:3.

[0202] 4.3 Constructing a Prediction Model: The 15 feature variables screened in step 3 were used as modeling feature variables. Linear Regression, Lasso Regression, Random Forest Regressor, XGBoost Regression, MLP Regressor, and K-Nearest Neighbor Regressor from the Python sklearn library were used to construct OLS, Lasso, Random Forest, XGBoost, Neural Network, and KNN models, respectively.

[0203] The relevant parameters of each model are as follows (adjustable parameters not mentioned are default values):

[0204] OLS (Ordinary Least Squares Regression): Use LinearRegression() without regularization.

[0205] Lasso (L1 regularized regression): alpha = 0.1 (L1 regularization term), max_iter = 10000 (maximum number of iterations).

[0206] Random Forest: n_estimators = 100 (number of decision trees), random_state = 42 (random seed).

[0207] XGBoost Regression (XGBoost): n_estimators = 100 (number of weak learners), random_state = 42 (random seed).

[0208] Neural Network (MLP): hidden_layer_sizes = (10, 10) (hidden layer size), max_iter = 500 (maximum number of iterations), random_state = 42 (random seed).

[0209] K-nearest neighbor regression (KNN): n_neighbors = 5 (number of nearest neighbors).

[0210] 4.4 Model evaluation: Calculate the evaluation index for the training set and validation set, take the OLS modeling effect as the baseline, and output R 2 , MAE and RMSE, the results are shown in Figure 5 From the model screening results, Random Forest, XGBoost and KNN performed better than OLS, Lasso and Neural Network.

[0211] 4.55-fold cross validation: Use the cross_val_score function in the sklearn library of Python to further perform 5-fold cross validation on Random Forest, XGBoost and KNN, which performed well in model evaluation, and calculate the corresponding evaluation indicators (R 2 , MAE and RMSE). Through cross-validation, we can evaluate the performance of each model under different data partitions and then determine whether the prediction ability of the model is stable. Figure 6 From the results of 5-fold cross-validation, the Random Forest model is the best, followed by XGBoost, and KNN is the worst.

[0212] 5. Hyperparameter Tuning

[0213] 5.1 Determine the parameter adjustment strategy with the help of Bayesian optimization method

[0214] Based on step 4, we further optimized the hyperparameters of Random Forest, the best performing model, and XGBoost, the second best model, using Bayesian optimization. The specific steps are as follows:

[0215] (1) Define rf_model_train() and xgb_model_train() as the objective functions: rf_model_train() trains the RandomForestRegressor and returns the negative mean square error (MSE) as the optimization target. xgb_model_train() trains the XGBRegressor and also returns the negative MSE as the optimization target.

[0216] (2) Use BayesianOptimization() to search for hyperparameters and optimize by maximize(init_points=10,n_iter=50). The closer the optimization target negative MSE is to 0, the better the optimization effect. The init_points is the number of initial points used to fit the Gaussian process, and the n_iter is the number of iterations of Bayesian optimization.

[0217] (3) After the optimization is completed, the best hyperparameters are extracted and used to retrain the model using RandomForestRegressor.fit() and XGBRegressor.fit().

[0218] The optimized hyperparameters of Random Forest and XGBoost constructed with 15 feature variables are shown in Table 3.

[0219] Table 3 Hyperparameters of Bayesian Optimized Random Forest and XGBoost

[0220]

[0221] Bayesian optimization learning curve is as follows Figure 7 As shown. Figure 7 It can be clearly seen that the Random Forest model tends to be stable after 10 iterations. XGBoost has poor stability, but performs better than Random Forest in some Iterations.

[0222] This shows that Random Forest performs relatively stably, with limited room for parameter tuning. In contrast, XGBoost's model performance fluctuates significantly as parameters are adjusted, indicating a significant impact of these parameters on model performance. This implies that XGBoost has a larger parameter tuning space and requires more complex tuning strategies to search for the optimal parameter combination. Grid search exhaustively enumerates all possible hyperparameter combinations to find the optimal one, but this is computationally expensive. Random search randomly samples within a preset range, reducing computational costs. Bayesian optimization uses surrogate models to intelligently select hyperparameters, offering high efficiency and adaptability. Genetic algorithms simulate biological evolution and offer strong global search capabilities.

[0223] Taking into account Figure 4B The results showed minimal differences in accuracy and stability between models constructed with four and more characteristic variables. Therefore, we further performed hyperparameter optimization on models incorporating four characteristic variables (ethanol, starch, koji dosage, and piling time) and 15 characteristic variables (ethanol, koji dosage, piling time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid). Random Forest was optimized using two optimization methods: Bayesian optimization and genetic algorithm, while XGBoost was optimized using four methods: grid search, random search, Bayesian optimization, and genetic algorithm. These optimizations were then compared with untuned Random Forest and XGBoost models to identify the optimal model and optimization method combination.

[0224] 5.2 Bayesian Optimization

[0225] (1) The specific steps for data loading, standardization, and data set division are shown in step 4.

[0226] (2) A Random Forest model was constructed that included four characteristic variables and 15 characteristic variables. The construction steps were referred to step 4. The four characteristic variables were ethanol, starch, daqu dosage, and stacking time. The 15 characteristic variables were ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid.

[0227] (3) Construct an XGBoost model that incorporates 4 characteristic variables and 15 characteristic variables. The construction steps refer to step 4. The 4 characteristic variables are ethanol, starch, daqu dosage and stacking time. The 15 characteristic variables are ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature and acetic acid.

[0228] (4) 5-fold cross validation: Use the cross_val_score function in the sklearn library of Python to perform 5-fold cross validation on RandomForest and XGBoost, and calculate the corresponding evaluation index (R 2 , MAE, and RMSE).

[0229] (5) Use BayesianOptimization() to search for hyperparameters and optimize by maximize(init_points=10,n_iter=50). The closer the optimization target negative MSE is to 0, the better the optimization effect.

[0230] (6) Extract the best hyperparameters for RandomForestRegressor.fit() and XGBRegressor.fit() to retrain the model, perform 5-fold cross validation, and calculate the corresponding evaluation index (R 2 , MAE, and RMSE).

[0231] The optimized hyperparameters are shown in Table 3.

[0232] 5.3 Genetic Algorithm (GA) Optimization

[0233] (1) The specific steps for data loading, standardization, and data set division are shown in step 4.

[0234] (2) A Random Forest model was constructed that included four characteristic variables and 15 characteristic variables. The construction steps were referred to step 4. The four characteristic variables were ethanol, starch, daqu dosage, and stacking time. The 15 characteristic variables were ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid.

[0235] (3) Construct an XGBoost model that incorporates 4 characteristic variables and 15 characteristic variables. The construction steps refer to step 4. The 4 characteristic variables are ethanol, starch, daqu dosage and stacking time. The 15 characteristic variables are ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature and acetic acid.

[0236] (4) 5-fold cross validation: Use the cross_val_score function in the sklearn library of Python to perform 5-fold cross validation on RandomForest and XGBoost, and calculate the corresponding evaluation index (R 2 , MAE, and RMSE).

[0237] (5) Use deap to implement the genetic algorithm and define the genetic algorithm optimization process, including defining individuals and populations, and fitness function weights, and return RMSE as the optimization target. The smaller the optimization target RMSE, the higher the optimization effect.

[0238] (6) Evolutionary operation: Use blend crossover to generate new hyperparameters, Gaussian mutation to randomly adjust hyperparameters, and tournament selection to select individuals with high fitness. The initial population is set to 20 individuals, and 10 iterations are performed to find the optimal hyperparameters obtained by GA optimization. Blend crossover uses the function cxBlend(), Gaussian mutation uses the function mutGaussian(), and tournament selection uses the function selTournament().

[0239] (7) Extract the best hyperparameters for RandomForestRegressor.fit() and XGBRegressor.fit() to retrain the RandomForest and XGBoost models, perform 5-fold cross validation, and calculate the corresponding evaluation indicators (R 2 , MAE, and RMSE).

[0240] The optimized hyperparameters are shown in Table 4.

[0241] Table 4 Hyperparameters of Random Forest and XGBoost optimized by genetic algorithm

[0242]

[0243] 5.4 Large-scale random search and grid search optimization

[0244] (1) Data loading and standardization, and data set division are shown in step 4.

[0245] (2) Construct an XGBoost model that incorporates 4 characteristic variables and 15 characteristic variables. The construction steps refer to step 4. The 4 characteristic variables are ethanol, starch, daqu dosage and stacking time. The 15 characteristic variables are ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature and acetic acid.

[0246] (3) Use RandomizedSearchCV and GridSearchCV in Python's sklearn.model_selection to perform large-scale random search (RSCV) and grid search (GSCV) on XGBoost. The optimized hyperparameter values ​​are shown in Table 5.

[0247] (4) Extract the best hyperparameters for XGBRegressor.fit() to retrain the XGBoost model, perform 5-fold cross validation, and calculate the corresponding evaluation index (R 2 , MAE, and RMSE).

[0248] The optimized hyperparameters are shown in Table 5.

[0249] Table 5 Hyperparameters of XGBoost optimized by RSCV and GSCV

[0250]

[0251] The results of 5-fold cross validation of two models using different tuning strategies and incorporating different numbers of feature variables are as follows: Figure 8 The naming rule is model-tuning method / number of characteristic variables or model / number of characteristic variables. When the number of characteristic variables is 4, the characteristic variables are ethanol, starch, daqu dosage, and stacking time; when the number of characteristic variables is 15, the characteristic variables are ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average piling temperature, average piling temperature, and acetic acid.

[0252] For example, XGBoost-GA / 15 is an XGBoost model that incorporates 15 characteristic variables, including ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, air-drying room temperature, average koji mixing temperature, average pile-up temperature, average pile-up temperature, and acetic acid, and uses GA for hyperparameter tuning. RF / 15 is a random forest model that incorporates 15 characteristic variables, including ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, air-drying room temperature, average koji mixing temperature, average pile-up temperature, average pile-up temperature, and acetic acid.

[0253] Depend on Figure 8 As can be seen, the models with better performance include: RF-Bayes / 15, RF / 15, XGBoost-Bayes / 15, XGBoost-GA / 15, and XGBoost-GA / 4. It can be seen that Random Forest performs better when incorporating 15 feature variables (ethanol, daqu dosage, stacking time, starch, gelatinization time, total acid, lactic acid, residual sugar, moisture, average steaming time, airing room temperature, average koji mixing temperature, average pile-up temperature, average pile-up temperature, and acetic acid) than when incorporating 4 feature variables (ethanol, starch, daqu dosage, and stacking time). Regardless of Bayesian tuning, Random Forest has good prediction results when using 15 feature variables. However, XGBoost is different. XGBoost performs poorly without hyperparameter tuning. Because XGBoost has a strong parameter tuning space, incorporating 4 feature variables (ethanol, starch, daqu dosage, and stacking time) for modeling can still achieve good performance by selecting an appropriate parameter tuning strategy.

[0254] Example 2

[0255] The RF-Bayes / 15 model obtained in Example 1 was used for blind sample prediction. The selection of modeling feature variables and the setting of related hyperparameters were the same as in Example 1. The random samples were the liquor production of sand making rounds in a Guizhou winery and the corresponding process data and physical and chemical indicators. The sample size was 8 (different from the samples in Example 1). The experimental results are shown in Table 6.

[0256] Table 6 Comparison between the predicted liquor production per sand making cycle by RF-Bayes / 15 model and the actual liquor production

[0257] Sample No. Actual output (kg) Estimated yield (kg) Prediction accuracy 1 28.81 26.55 92.14% 2 26.93 27.46 101.96% 3 28.75 29.74 103.46% 4 27.80 26.96 96.98% 5 28.38 30.37 107.00% 6 26.42 28.02 106.07% 7 26.83 27.85 103.79% 8 30.92 29.44 95.20%

[0258] Example 3

[0259] The XGBoost-GA / 15 model obtained in Example 1 was used for blind sample prediction. The selection of modeling feature variables and the setting of related hyperparameters were the same as in Example 1. The random sample was the production of liquor from one round of a Guizhou winery and the corresponding process data and physical and chemical indicators. The sample size was 8 (different from the sample in Example 1). The experimental results are shown in Table 7.

[0260] Table 7 Comparison of liquor production predicted by XGBoost-GA / 15 model in round 1 and actual liquor production

[0261]

[0262]

Claims

1. A method for predicting wine production, characterized in that: The amount of the wine is predicted based on the winemaking process parameters or the physical and chemical parameters of the mash entering the cellar, the winemaking process parameters include one or more of the average steaming time, gelatinization time, gelatinization pressure, Daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time, and the physical and chemical parameters of the mash entering the cellar include one or more of the total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content.

2. The method according to claim 1, wherein The winemaking process parameters are selected from the amount of Daqu used and the stacking time; The physical and chemical parameters of the fermented grains entering the cellar are selected from ethanol content and starch content; Preferably, the wine yield is determined based on a functional relationship between the winemaking process parameters or the physical and chemical parameters of the fermented mash entering the cellar and the wine yield, and the functional relationship can be obtained through a machine learning algorithm; Preferably, the machine learning algorithm is selected from Random Forest or XGBoost; Preferably, the machine learning algorithm is further subjected to hyperparameter tuning; the hyperparameter tuning method is selected from a Bayesian optimization algorithm or a genetic algorithm; Preferably, the wine is white wine; Preferably, the Bayesian optimization algorithm optimization step includes: selecting random forest or XGBoost model hyperparameters and setting the hyperparameter value range; using BayesianOptimization() to search for hyperparameters, setting the maximum value of the number of initial points init_points for fitting the Gaussian process and the number of iterations n_iter of Bayesian optimization, and obtaining the optimal hyperparameter combination according to the optimal optimization target after the optimization is completed; Preferably, the maximum value of init_points is 5 to 100; Preferably, the maximum value of init_points is 5 to 50; Preferably, the maximum value of init_points is 10; Preferably, the maximum value of n_iter is 5 to 200; Preferably, the maximum value of n_iter is 5 to 100; Preferably, the maximum value of n_iter is 50; Preferably, the optimization objective is an evaluation index obtained after retraining the model using hyperparameter combinations obtained under different numbers of Bayesian optimization iterations; Preferably, the evaluation index includes R 2 , one or more of MAE, MSE and RMSE; Preferably, the genetic algorithm optimization step includes: selecting random forest or XGBoost model hyperparameters, setting the hyperparameter value range and the number of genetic algorithm iterations; randomly generating initial individuals, each individual is equivalent to a set of hyperparameter combinations with different values, and iterating through crossover, mutation and selection operations; when the set number of iterations is completed, the individual with the highest fitness value is the optimal hyperparameter combination of the model; Preferably, the crossover includes single-point crossover, two-point crossover, multi-point crossover, partial matching crossover, uniform crossover, mixed crossover, sequential crossover, position-based crossover, order-based crossover, cyclic crossover or subpath crossover; Preferably, the crossover comprises a hybrid crossover; Preferably, the mutation comprises a Gaussian mutation, an inversion mutation, a transposition mutation, an exchange mutation or a bit flip mutation; Preferably, the mutation comprises a Gaussian mutation; Preferably, the selection comprises tournament selection, roulette selection, truncation selection, random traversal selection or elite selection; Preferably, said selection comprises a tournament selection; Preferably, the number of iterations is 5-100; Preferably, the number of iterations is 5-50; Preferably, the number of iterations is 10; Preferably, the number of the initial individuals is 10 to 200; Preferably, the number of the initial individuals is 10 to 100; Preferably, the number of the initial individuals is 20 to 80; Preferably, the random forest model hyperparameters include one or more of the number of decision trees n_estimators, the maximum depth of the tree max_depth, the minimum number of node split samples min_samples_split, the minimum number of leaf node samples min_samples_leaf, the maximum number of features involved in the judgment when the node splits max_features, whether to use bootstrap sampling, and the node division standard criterion; Preferably, the XGBoost model hyperparameters include one or more of the number of weak learners n_estimators, the maximum depth of the tree max_depth, the learning rate learning_rate, the row sampling ratio subsample, the column sampling ratio colsample_bytree, the minimum instance weight and min_child_weight of the child node, the minimum loss function drop gamma required for node splitting, the L2 regularization term lambda and the L1 regularization term alpha.

3. A method for constructing a drinking capacity prediction model, characterized in that: The method comprises the following steps: S1: Acquiring data: The data includes wine production and corresponding winemaking process parameters and / or physical and chemical parameters of the fermented grains in the cellar; S2: processes the data obtained by S1; S3: Screening modeling features: The processed winemaking process parameters and / or the physical and chemical parameters of the fermented grains after cellaring obtained in S2 are used as feature variables, and the output of each steamer of liquor is used as the response variable; Sort the feature variables by importance and filter out the modeling features; S4: Constructing a prediction model: using the modeling features as feature variables and the output of each steamer of liquor as a response variable, training a machine learning algorithm to obtain a prediction model, wherein the machine learning algorithm is selected from random forest or XGBoost; The method further includes performing hyperparameter tuning on the prediction model, wherein the hyperparameter tuning method is selected from a Bayesian optimization algorithm or a genetic algorithm.

4. The method according to claim 3, wherein The winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content; Preferably, the winemaking process parameters are selected from the amount of Daqu used and the stacking time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar are selected from ethanol content and starch content; Preferably, the wine is white wine; Preferably, in step S2, the processing includes processing duplicates, missing values, and outliers in the data and data standardization; Preferably, the method for processing the duplicate items is to directly eliminate them; Preferably, the missing value processing method includes direct elimination method or median filling method; Preferably, the outlier detection method includes an IQR method, a robust Mahalanobis distance method, or a local outlier factor method; Preferably, the method for processing the outliers is to directly eliminate them; Preferably, the data normalization comprises normalizing the data using a z-score method.

5. The method according to claim 3, wherein In step S3, the method for screening modeling features is selected from Pearson correlation analysis, Spearman correlation analysis or cross-validation recursive feature elimination method; Preferably, the modeling features include winemaking process parameters and / or physical and chemical parameters of the fermented grains entering the cellar; Preferably, the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content; Preferably, the winemaking process parameters are selected from the amount of Daqu used and the stacking time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar are selected from ethanol content and starch content; Preferably, the number of the modeling features is 2 to 200; Preferably, the number of the modeling features is 3 to 100; Preferably, the number of the modeling features is 4 to 15; Preferably, step S4 further comprises dividing the data into a training set and a validation set; Preferably, 60%-80% of the data is a training set, and 20%-40% is a validation set; Preferably, 70% of the data is a training set and 30% is a validation set; Preferably, the step S4 further includes evaluating the prediction model; Preferably, the evaluation index of the prediction model includes R 2 , MAE, MSE and RMSE.

6. The method according to claim 3, wherein The Bayesian optimization algorithm optimization steps include: selecting random forest or XGBoost model hyperparameters and setting the hyperparameter value range; using BayesianOptimization() to search for hyperparameters, setting the maximum value of the number of initial points init_points for fitting the Gaussian process and the number of iterations n_iter for Bayesian optimization, and obtaining the optimal hyperparameter combination according to the optimal optimization goal after the optimization is completed; Preferably, the maximum value of init_points is 5 to 100; Preferably, the maximum value of init_points is 5 to 50; Preferably, the maximum value of init_points is 10; Preferably, the maximum value of n_iter is 5 to 200; Preferably, the maximum value of n_iter is 5 to 100; Preferably, the maximum value of n_iter is 50; Preferably, the optimization objective is an evaluation index obtained after retraining the model using hyperparameter combinations obtained under different numbers of Bayesian optimization iterations; Preferably, the evaluation index includes R 2 , one or more of MAE, MSE and RMSE; Preferably, the genetic algorithm optimization step includes: selecting random forest or XGBoost model hyperparameters, setting the hyperparameter value range and the number of genetic algorithm iterations; randomly generating initial individuals, each individual is equivalent to a set of hyperparameter combinations with different values, and iterating through crossover, mutation and selection operations; when the set number of iterations is completed, the individual with the highest fitness value is the optimal hyperparameter combination of the model; Preferably, the crossover includes single-point crossover, two-point crossover, multi-point crossover, partial matching crossover, uniform crossover, mixed crossover, sequential crossover, position-based crossover, order-based crossover, cyclic crossover or subpath crossover; Preferably, the crossover comprises a hybrid crossover; Preferably, the mutation comprises a Gaussian mutation, an inversion mutation, a transposition mutation, an exchange mutation or a bit flip mutation; Preferably, the mutation comprises a Gaussian mutation; Preferably, the selection comprises tournament selection, roulette selection, truncation selection, random traversal selection or elite selection; Preferably, said selection comprises a tournament selection; Preferably, the number of iterations is 5-100; Preferably, the number of iterations is 5-50; Preferably, the number of iterations is 10; Preferably, the number of the initial individuals is 10 to 200; Preferably, the number of the initial individuals is 10 to 100; Preferably, the number of the initial individuals is 20 to 80; Preferably, the random forest model hyperparameters include one or more of the number of decision trees n_estimators, the maximum depth of the tree max_depth, the minimum number of node split samples min_samples_split, the minimum number of leaf node samples min_samples_leaf, the maximum number of features involved in the judgment when the node splits max_features, whether to use bootstrap sampling, and the node division standard criterion; Preferably, the XGBoost model hyperparameters include one or more of the number of weak learners n_estimators, the maximum depth of the tree max_depth, the learning rate learning_rate, the row sampling ratio subsample, the column sampling ratio colsample_bytree, the minimum instance weight and min_child_weight of the child node, the minimum loss function drop gamma required for node splitting, the L2 regularization term lambda and the L1 regularization term alpha.

7. A method for predicting wine production, characterized in that: The following steps are involved: S1: Get data; S2: inputting the data obtained in S1 into the alcohol production prediction model constructed by the method according to any one of claims 3 to 6, and outputting the predicted alcohol production; Preferably, the data include winemaking process parameters or physical and chemical parameters of the fermented grains entering the cellar; Preferably, the winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content; Preferably, the winemaking process parameters are selected from the amount of Daqu used and the stacking time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar are selected from ethanol content and starch content; Preferably, the wine is white wine.

8. A wine production prediction system, characterized in that: The system includes the following modules: Data acquisition module, used to collect winemaking process parameters and / or physical and chemical parameters of wine mash entering the cellar; A data processing module is used to process the data collected by the data collection module, including removing duplicates, processing missing values, processing outliers or normalizing the data, and dividing the data into a training set and a validation set; The feature optimization section is used to screen modeling features, wherein the modeling features are selected from the winemaking process parameters and / or the physical and chemical parameters of the fermented grains after being processed by the data processing module; The optimized prediction model module is used to construct a model based on the modeling features selected by the feature optimization module, and perform hyperparameter tuning on the model to obtain an optimized prediction model; the model is selected from random forest or XGBoost, and the hyperparameter tuning method is selected from Bayesian optimization algorithm or genetic algorithm; The output prediction module is used to input the data processed by the data processing module into the optimized prediction model module to obtain the wine output prediction result.

9. The system according to claim 8, wherein The winemaking process parameters include one or more of average steaming time, gelatinization time, gelatinization pressure, daqu dosage, average qu mixing temperature, airing room temperature, average piling temperature, average piling temperature and piling time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar include one or more of total acid content, residual sugar content, starch content, moisture content, acetic acid content, ethanol content and lactic acid content; Preferably, the winemaking process parameters are selected from the amount of Daqu used and the stacking time; Preferably, the physical and chemical parameters of the fermented grains entering the cellar are selected from ethanol content and starch content; Preferably, the wine is white wine; Preferably, the missing value processing method includes direct elimination method or median filling method; Preferably, the outlier detection method includes an IQR method, a robust Mahalanobis distance method, or a local outlier factor method; Preferably, the method for processing the outliers is to directly eliminate them; Preferably, the standardization process is to standardize the data using the z-score method; Preferably, the method for screening modeling features is selected from Pearson correlation analysis, Spearman correlation analysis or cross-validation recursive feature elimination method; Preferably, the number of the modeling features is 2 to 200; Preferably, the number of the modeling features is 3 to 100; Preferably, the number of the modeling features is 4 to 15; Preferably, the random forest model hyperparameters include one or more of the number of decision trees n_estimators, the maximum depth of the tree max_depth, the minimum number of node split samples min_samples_split, the minimum number of leaf node samples min_samples_leaf, the maximum number of features involved in the judgment when the node splits max_features, whether to use bootstrap sampling, and the node division standard criterion; Preferably, the XGBoost model hyperparameters include one or more of the number of weak learners n_estimators, the maximum depth of the tree max_depth, the learning rate learning_rate, the row sampling ratio subsample, the column sampling ratio colsample_bytree, the minimum instance weight and min_child_weight of the child node, the minimum loss function drop gamma required for node splitting, the L2 regularization term lambda and the L1 regularization term alpha.

10. Application of the wine yield prediction method according to claim 1-2 or claim 7, the method for constructing a wine yield prediction model according to any one of claims 3-6, or the wine yield prediction system according to any one of claims 8-9 in the field of winemaking; Preferably, the application includes an application for wine production prediction; Preferably, the application includes an application for liquor production prediction.