Method for identifying different-quality-grade alcohol-sweet base liquor of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models
Through GC-MS combined with multiple machine learning models, the inaccuracy problem caused by the identification of the quality grade of the sauce-flavored liquor is solved, and the quality grade of the sweet base wine with high accuracy and low cost is achieved. Identification, suitable for complex sauce-flavored liquor production environment.
Patent Information
- Application Number
- CN202411682188.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-01-10
AI Technical Summary
The existing method for identifying quality grades of the soy sauce-flavored liquor is dependent on the construction of a single model, resulting in inaccurate identification in complex production environments and lack of digital standards.
Using GC-MS combined with multiple machine learning models, through volatile substance extraction, feature standardization, label coding, data balance and multiple model construction, the best model is selected for the quality level of sweet base wine, achieving high accuracy and stability Identification of good sex.
The accurate quality grade identification of the soy sauce-flavored liquor base wine is achieved, which improves the accuracy of judgment, reduces economic costs, and simplifies the operation process.
Smart Images

Figure CN119291104A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of liquor production, and particularly relates to a method for identifying sweet and alcohol base liquors of different quality grades of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models. Background Art
[0002] Maotai-flavor liquor is one of the main types of liquor in my country. It has the characteristics of mellow body, prominent Maotai aroma, and long-lasting aroma in the empty cup. This unique flavor is closely related to its traditional brewing process. The brewing process of Maotai-flavor liquor is two feedings, nine steamings, eight fermentations, and seven wine extractions. The finished Maotai-flavor liquor needs seven rounds of extraction of the body and blending in different proportions. The body extracted in seven rounds is the basic wine for the finished Maotai-flavor liquor, which is called base wine. The base wine is divided into cellar surface, mellow and sweet, and cellar bottom base wines due to the distillation of fermented grains in different parts of the cellar. Among them, the mellow and sweet base wine is distilled from the fermented grains in the middle part of the cellar. It is the base wine with the largest output and the longest production cycle among different types of base wines. Therefore, the quality of the mellow and sweet base wine directly determines the quality of the finished Maotai-flavor liquor. However, in the actual production process, the quality grade of the base wine often depends on the sensory evaluation and production experience of the winemaker. Therefore, it is urgent to develop a digital standard to distinguish and identify mellow and sweet base wines of different quality grades.
[0003] Existing methods for identifying the quality grade of Maotai-flavor liquor are all focused on finished Maotai-flavor liquor, and the model construction selection is too single and imprecise. There are almost no methods for identifying the sweet and alcohol base liquor of Maotai-flavor liquor and applying multiple models. For example, the patent with the announcement number CN115166170A, entitled "A method for classifying and identifying Maotai-flavor base liquors of different grades", uses GC-MS combined with a neural network model to classify and identify Maotai-flavor base liquors of different grades, establishes a new method for the quality grading of Maotai-flavor liquor base liquors, and provides a numerical basis for further blending of finished liquors. In the announcement number CN115598276A, entitled "A method for judging the quality grade of Maotai-flavor liquor based on the content and ratio of volatile compounds", the content of the main volatile substances of Maotai-flavor liquors of different quality grades and their ratios to four ester substances are used as data sets. Characteristic compounds are screened by partial least squares discriminant analysis and difference multiples, and a Maotai-flavor liquor quality grade discrimination model is successfully established using characteristic values. However, the base wine quality grade identification methods provided by these two methods directly select a single model to build, and there is no professional evaluation of the model performance, which may lead to inaccurate model identification due to data complexity in actual production applications. Summary of the invention
[0004] The present invention aims to provide a method for identifying the sweet and rich base wines of different quality grades of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models. The volatile substances of the sweet and rich base wines are extracted by GC-MS, and a base wine quality grade discrimination model is established by adopting multiple machine learning models. The optimal model is selected for identification application based on model evaluation, thereby realizing the standardized identification of the sweet and rich base wines of Maotai-flavor liquor, which has the advantages of good accuracy, high stability and low economic cost.
[0005] A method for identifying different quality grades of sweet and alcohol base liquors of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models in this scheme includes the following steps:
[0006] S1. Use GC-MS chromatography separation technology to obtain volatile substances in the sweet base wine sample of Maotai-flavor liquor;
[0007] S2, based on the volatile substances obtained in S1, perform feature standardization, label encoding and data balancing on the data;
[0008] S3, feature selection using Lasoo regression;
[0009] S4, build machine learning model: based on the features selected in S3, use logistic regression model, support vector machine model, K-nearest neighbor algorithm, decision tree, random forest, naive Bayes, multi-layer perceptron, gradient boosting tree, adaptive boosting, and extreme gradient boosting model to define and train the model;
[0010] S5, model evaluation: Use accuracy, F1 score, recall, precision and AUC to evaluate the performance of the 10 models obtained in S4 and select the best model;
[0011] S6. Identification application: Obtain the volatile substances of the base wine of the tested Maotai-flavor liquor sweet base wine sample according to the method of S1, and input the best model obtained according to S5 to output the quality grade classification of the tested Maotai-flavor liquor sweet base wine.
[0012] The beneficial effects of the present invention are:
[0013] 1. Volatile flavor substances are key substances that affect the quality grade of the base wine of Maotai-flavor liquor. For example, tetramethylpyrazine in the volatile flavor substances of Maotai-flavor liquor not only has multiple physiologically active functions, but also gives the liquor a roasted, nutty, and other aromas, and is the key volatile substance that presents aroma and taste in Maotai-flavor liquor. Among the volatile substances, hydrogen sulfide, mercaptan, acryl alcohol, and other substances are the key volatile substances that cause the odor of Maotai-flavor liquor. The present invention uses GC-MS separation technology to comprehensively separate and extract various volatile flavor substances of the alcohol sweet base wine of Maotai-flavor liquor, solving the problem that the volatile flavor substances of the alcohol sweet base wine of Maotai-flavor liquor in the prior art are not fully obtained and cannot accurately reflect the quality grade of the base wine.
[0014] 2. The present invention develops a model for distinguishing the quality grade of the alcohol-sweet base wine of the Maotai-flavor liquor using a variety of machine learning models suitable for distinguishing the quality grade of the alcohol-sweet base wine of the Maotai-flavor liquor. The distinguishing model can be called at any time without repeated construction, and has the advantages of simple operation, high distinguishing accuracy and low economic cost.
[0015] Furthermore, the feature standardization described in S2 is to use the StandardScaler function to standardize the feature data; the label encoding is to use LabelEncoder to convert the classification label into a numerical type; the data balancing is to use SMOTE to generate synthetic samples of the minority class, so that the number of samples of each class is close to balanced, thereby reducing the deviation in model training.
[0016] Furthermore, in the S3, make_pipeline is used to construct a pipeline for data preprocessing and model selection, and then the data is standardized by StandardScaler. Then, LassoCV with L1 regularization is used to automatically perform cross-validation to find the nearest regularization parameter, and the non-zero parameter is retained as the final feature.
[0017] Furthermore, the feature standardization in S2 uses the StandardScaler function to standardize the feature data.
[0018] Label encoding in S2 uses LabelEncoder to convert categorical labels into numerical types.
[0019] Data balancing in S2 uses SMOTE to generate synthetic samples of the minority class, so that the number of samples of each class is close to balance, thereby reducing the deviation in model training.
[0020] In S3, feature selection uses make_pipeline to build a pipeline for data preprocessing and model selection. Then the data is standardized by StandardScaler, and then LassoCV with L1 regularization is used to automatically perform cross-validation to find the nearest regularization parameter, and the non-zero parameter is retained as the final feature.
[0021] The logistic regression model parameter in S4 is LogisticRegression(max_iter=200), which is used to process linearly separable data, and the convergence of the optimization process is controlled by the maximum number of iterations 200.
[0022] The support vector machine (SVM) model parameter in S4 is the SVC (probability = True) model, which is used for classification by maximizing the inter-class boundary, and probability = True is enabled to calculate the class probability.
[0023] The parameters of the K-nearest neighbor (KNN) model in S4 are KNeighborsClassifier (n_neighbors=5). The algorithm performs classification through a distance-based voting mechanism.
[0024] The decision tree model parameter in S4 is DecisionTreeClassifier (max_depth = 10), which builds a tree structure by recursively splitting data and limits the maximum depth of the tree to 10 to prevent overfitting.
[0025] The Random Forest model parameters in S4 are RandomForestClassifier(n_estimators=50,max_depth=10,min_samples_leaf=4). It enhances the generalization ability by constructing 50 trees with a depth of 10 and each leaf node contains at least 4 samples for classification.
[0026] The parameters of the Naive Bayes model in S4 are GaussianNB (priors = None, var_smoothing = 1e-9). The model is based on the Bayesian theorem and assumes that the features are independent of each other.
[0027] The model parameters of the multilayer perceptron neural network (MLP) in S4 are MLPClassifier (max_iter = 200, alpha = 0.001). As a feedforward neural network, the maximum number of iterations is set to 200, and the regularization parameter alpha = 0.001 is used to prevent overfitting.
[0028] The parameters of the Gradient Boosting model in S4 are
[0029] GradientBoostingClassifier(learning_rate=0.01,max_depth=5)
[0030] The AdaBoost (adaptive boosting) model parameters in S4 are AdaBoostClassifier (n_estimators = 50, learning_rate = 0.1) and two boosting methods, which use smaller learning rates (0.01 and 0.1) and limit the tree depth (5) to gradually improve the classification performance.
[0031] The XGBoost (extreme gradient boosting) model parameters in S4 are XGBClassifier(use_label_encoder=False,eval_metric='mlogloss',learning_rate=0.01,max_depth=5). As an improved gradient boosting model, the model performance is optimized by setting the learning rate to 0.01 and the maximum tree depth to 5, and logarithmic loss is used as the evaluation criterion.
[0032] In S5, model evaluation uses StratifiedKFold to maintain the consistency of label distribution and performs 5-fold cross validation to ensure that the model sees different data partitions each time it is trained. For each classification model, cross_val_predict is used to calculate the prediction results and evaluate multiple performance indicators.
[0033] Accuracy in S5 refers to the proportion of samples correctly predicted by the model to the total number of samples. It measures the overall correctness of the model. TP (True Positive) means that the true positive prediction is correct, TN (True Negative) means that the negative prediction is correct, FP (False Positive) means false positive errors, and FN (False Negative) means false negative errors.
[0034]
[0035] In S5, recall refers to the proportion of positive samples that the model can correctly identify to all positive samples. It measures the ability of the model to identify positive samples.
[0036]
[0037] In S5, precision refers to the proportion of samples correctly predicted as positive by the model to all samples predicted as positive.
[0038] It reflects the accuracy of the model's predictions.
[0039]
[0040] The AUC score (area under the ROC curve) in S5 is a measure of the model's ability to distinguish between positive and negative samples. The ROC curve plots the relationship between the true positive rate (Recall) and the false positive rate at different thresholds, and the AUC score represents the area under the ROC curve.
[0041] Furthermore, the selection of the best model in S6 is based on the weighted score accuracy':0.2,'f1_score':0.3,'recall':0.2,'precision':0.2,'auc':0.1. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flow chart of the method for identifying sweet base wines of different quality grades according to the present invention;
[0043] Figure 2 Lasso regression feature screening coefficient graph. DETAILED DESCRIPTION
[0044] The following is further described in detail through specific implementation methods:
[0045] A method for identifying different quality grades of sweet and mellow base liquors of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models. Figure 1 As shown, the following steps are included:
[0046] Step S1, extraction of volatile substances in the alcohol-sweet base wine of Maotai-flavor liquor: using chromatographic separation technology to obtain volatile substances in the alcohol-sweet base wine sample of Maotai-flavor liquor. Specifically, the chromatographic separation technology is GC-MS separation technology.
[0047] Step S2, data preprocessing: Based on the volatile substances of the sweet base alcohol of the Maotai-flavor liquor and the sample quality grade obtained in step S1, the data is subjected to feature standardization, label coding and data balancing processing. The specific code is as follows:
[0048] # Split features and labels
[0049] X = data.drop(columns = ['sample', 'Lable']) # Assume that 'sample' and 'Lable' are the columns to be deleted
[0050] y = data['Lable']
[0051] # Label encoding is numeric
[0052] le=LabelEncoder()
[0053] y_encoded=le.fit_transform(y)
[0054] #Use SMOTE to balance data
[0055] smote=SMOTE(random_state=42)
[0056] X_resampled,y_resampled=smote.fit_resample(X,y_encoded)
[0057] Step S3, feature screening: Use Lasoo regression for feature selection. The specific code is as follows:
[0058] #Step 1: Use Lasso for feature selection
[0059] lasso = make_pipeline (StandardScaler (), LassoCV (cv = 10)) # includes standardization and LassoCV
[0060] lasso.fit(X_resampled,y_resampled)
[0061] #Get the best lambda value
[0062] optimal_lambda=lasso.named_steps['lassocv'].alpha_
[0063] print(f'Optimal lambda:{optimal_lambda}')
[0064] #Extract selected features and their coefficients
[0065] feature_names = X.columns
[0066] coef=lasso.named_steps['lassocv'].coef_
[0067] selected_features=np.where(coef!=0)[0]
[0068] selected_feature_names=feature_names[selected_features]
[0069] #Create a DataFrame containing feature names and coefficients
[0070] coef_df=pd.DataFrame({'Feature':feature_names,'Coefficient':coef})
[0071] selected_coef_df=coef_df[coef_df['Coefficient']! =0]
[0072] #Visualize the selected features and their coefficients
[0073] plt.figure(figsize=(12,8))
[0074] plt.barh(selected_coef_df['Feature'],selected_coef_df['Coefficient'])
[0075] plt.xlabel('Coefficient')
[0076] plt.title('Feature Coefficients from Lasso Regression')
[0077] plt.show()
[0078] #Output the selected feature names and coefficients
[0079] print("SelectedFeature Coefficients:")
[0080] print(selected_coef_df)
[0081] Step S4, machine learning model construction: Based on the features filtered in step S3 above, 10 models including LogisticRegression, MLP, Gradient Boosting, AdaBoost, and XGBoost are selected for model definition and training. The specific code is as follows:
[0082] #Step 2: Define the model
[0083] #Use the selected features for subsequent model building
[0084] X_selected=X_resampled[selected_feature_names]
[0085] models = {
[0086] 'Logistic Regression':LogisticRegression(max_iter=200),
[0087] 'SVM':SVC(probability=True),
[0088] 'KNN':KNeighborsClassifier(),
[0089] 'Decision Tree':DecisionTreeClassifier(max_depth=10),
[0090] 'Random Forest':RandomForestClassifier(n_estimators=50,max_depth=10,min_samples_leaf=4),
[0091] 'Naive Bayes':GaussianNB(),
[0092] 'MLP':MLPClassifier(max_iter=200,alpha=0.001),
[0093] 'Gradient Boosting':GradientBoostingClassifier(learning_rate=0.01,max_depth=5),
[0094] 'AdaBoost':AdaBoostClassifier(n_estimators=50, learning_rate=0.1),
[0095] 'XGBoost':XGBClassifier(use_label_encoder=False, eval_metric='mlogloss', learning_rate=0.01, max_depth=5)
[0096] }
[0097] # Initialize the dictionary to store the results
[0098] results = {}
[0099] #Perform cross validation and select StratifiedKFold to maintain the distribution of classes
[0100] cv=StratifiedKFold(n_splits=5,shuffle=True,random_state=42)
[0101] Step S5, model evaluation: Use Accuracy, F1-Score, Recall, Precision and AUC to evaluate the performance of the 10 models in step S4 above. The specific code is as follows:
[0102] #Step 3: Train the model, perform cross-validation and calculate performance metrics
[0103] for name,model in models.items():
[0104] print(f"Training{name}with cross-validation...")
[0105] #Prediction by cross validation
[0106] y_pred=cross_val_predict(model,X_selected,y_resampled,cv=cv, method='predict')
[0107] y_prob=cross_val_predict(model,X_selected,y_resampled,cv=cv,ethod='predict_proba')
[0108] #Calculate evaluation indicators
[0109] accuracy=accuracy_score(y_resampled,y_pred)
[0110] f1=f1_score(y_resampled,y_pred,average='weighted')
[0111]
[0112] #Output model performance indicators
[0113] metrics_df=pd.DataFrame(results).T[['accuracy','f1_score','recall','precision','auc']]
[0114] print(metrics_df)
[0115] Step S6, identification application: the alcohol sweet base wine sample of the tested sauce-flavor liquor is subjected to the above step S1 to obtain the base wine volatile substances, and the best model obtained according to the above step S5 is input to output the quality grade classification of the alcohol sweet base wine of the tested sauce-flavor liquor. The specific code is as follows:
[0116] )
[0118] #Define the weight of each indicator
[0119] weights = {
[0120] 'accuracy':0.2,
[0121] 'f1_score':0.3,
[0122] 'recall':0.2,
[0123] 'precision':0.2,
[0124] 'auc':0.1
[0125] }
[0126] # Calculate the weighted score for each model
[0127] weighted_scores = {}
[0128] for name,metrics in results.items():
[0129] weighted_scores[name]=calculate_weighted_score(metrics,weights)
[0130] #Output weighted scores for each model
[0131] print("\nWeighted Scores for each model:")
[0132] for name,score in weighted_scores.items():
[0133] print(f"{name}:{score:.4f}")
[0134] #Find the model with the highest score
[0135] best_model_name=max(weighted_scores,key=weighted_scores.get)
[0136] print(f"\nBest Model based on weighted score:{best_model_name}")
[0137] #Get the best model
[0138] best_model=models[best_model_name]
[0139] #Step 5: Retrain the best model using the full training set
[0140] best_model.fit(X_selected,y_resampled)#Use the features previously filtered by Lasso and the data set balanced by SMOTE
[0141] #Step 6: Read the new dataset and make predictions
[0142] #Assume that the path of the new data set is 'C:\\Users\\Lee66\\Desktop\\NewData.csv'
[0143] new_file_path='C:\\Users\\Lee66\\Desktop\\Grade-ZL-YC.csv'
[0144] #Read new dataset
[0145] try:
[0146] new_data=pd.read_csv(new_file_path,encoding='ISO-8859-1')#or encoding='GBK'
[0147] except UnicodeDecodeError:
[0148] new_data=pd.read_csv(new_file_path,encoding='GBK')
[0149] #Tip: The new dataset does not contain the label column "Lable", only the feature column
[0150] #Select features consistent with the previously trained model
[0151] X_new = new_data[selected_feature_names] #Select the previously selected features
[0152] #Use the trained best model to predict new data
[0153] y_new_pred=best_model.predict(X_new)
[0154] #Convert the prediction results to quality levels
[0155] y_new_pred_labels=le.inverse_transform(y_new_pred)
[0156] #Add the prediction results to the new dataset
[0157] new_data['Predicted_Quality']=y_new_pred_labels
[0158] # Output a new dataset with predicted quality levels
[0159] print("Predicted Quality Levels forNew Data:")
[0160] print(new_data[['Predicted_Quality']])
[0161] #If you need to save the results as a CSV file
[0162] output_file_path='C:\\Users\\Lee66\\Desktop\\Predicted_Quality_Results.csv'
[0163] new_data.to_csv(output_file_path,index=False,encoding='utf-8-sig')
[0164] print(f"Predicted results saved to:{output_file_path}")
[0165] Experimental procedures
[0166] 1. Sample information
[0167] The samples in this embodiment are derived from 400 Maotai-flavor liquor sweet base liquors provided by the Liquor Inspection Center of Renhuai City, Guizhou Province, wherein the samples include:
[0168] Modeling samples: 100 samples of pure and sweet premium grade, 100 samples of pure and sweet grade one, 100 samples of pure and sweet grade two, and 100 samples of pure and sweet grade three;
[0169] Test samples: 10 samples of mellow and sweet superior grade, 10 samples of mellow and sweet grade one, 10 samples of mellow and sweet grade two, and 10 samples of mellow and sweet grade three.
[0170] 2. Extraction of volatile substances from sweet-alcohol base liquor of Maotai-flavor liquor
[0171] Volatile substances were first extracted by headspace solid phase microextraction (HS-SPME), specifically, aliquots of base wine samples (10 mL, 10% by volume) were aspirated into headspace sample vials (20 mL), and NaCl (3 g) and mixed internal standards (20 μL) were added. A DVB / CAR / PDMS three-phase extraction head was used, preheated at 50°C for 5 min, and flavor substances were extracted and adsorbed for 50 min, and then separated in GC-MS at 250°C for 5 min. The specific conditions of GC-MS were GC-MS using an Agilent gas chromatograph (GC 8860-5977MSD). A DB-WAX column (30 m × 0.25 mm × 0.25 μm; Agilent Technologies, Wilmington, DE, USA) was used with nitrogen (purity ≥ 99.999%) as the carrier gas at a constant flow rate of 2.0 mL / min. The temperature of the olfactory detection port and the injection port was 250 °C. The column temperature was maintained at 40 °C for 2 min, then increased to 100 °C at a rate of 2 °C / min, and then increased at 220 °C at a rate of 4 °C / min for 5 min. Mass spectral data with a mass range of m / z 35 to 350 were acquired in the electron ionization mode with an ionization energy of 70 eV. The temperature of the transfer line and ion source was 230 °C, and the raw data were processed sequentially using an Agilent ChemStation and a Shimadzu workstation. All volatile flavor compounds were identified by comparing their mass spectra with the information provided in the NIST 11 and NIST 17 databases. In addition, their retention indices and mass spectra were compared with those of the authentic compounds under the same conditions.
[0172] 3. Data preprocessing
[0173] The variables and sample information were input, and the data were feature standardized, label encoded, and balanced using Python 3.8 software combined with the Jupyter Notebook platform.
[0174] 4. Feature screening
[0175] Use Lasoo regression for feature selection and retain non-coefficient features as the final screening features, such as Figure 2 shown.
[0176] 5. Machine Learning Model Construction
[0177] Based on the features filtered by the above features, Logistic Regression, SVM, KNN, DecisionTree, Random Forest, Naive Bayes, MLP, Gradient Boosting, AdaBoost, and XGBoost models were selected for model definition and training.
[0178] 6. Model Evaluation
[0179] The performance of the 10 models constructed above was evaluated using Accuracy, F1-Score, Recall, Precision and AUC. The results are shown in Table 1.
[0180] Table 1 Evaluation of different machine learning models
[0181]
[0182] 7. Identification Application
[0183] Based on the above model evaluation, weighted scoring is comprehensively considered to select the optimal model for identification application. The model is comprehensively evaluated. The results are shown in Table 2. It can be seen from Table 2 that the Gradient Boosting model has the highest comprehensive score. Therefore, the Gradient Boosting model is selected as the identification model to discriminate 40 external test samples. The results are shown in Table 3.
[0184] Table 2 Comprehensive evaluation scores of models
[0185]
[0186] Table 3 External test sample verification results
[0187]
[0188] As can be seen from Table 3, the selected Gradient Boostin best model has a discrimination accuracy of 7 / 10=70% for the mellow and sweet grade in the external test samples, a discrimination accuracy of 10 / 10=100% for the first grade of mellow and sweet, a discrimination accuracy of 10 / 10=100% for the second grade of mellow and sweet, and a discrimination accuracy of 10 / 10=100% for the third grade of mellow and sweet. The comprehensive discrimination accuracy is 92.5%, which further shows that the established discrimination model has a good effect on the quality grade identification of the mellow and sweet base wine of the sauce-flavor liquor.
[0189] Obviously, corresponding to the single model direct modeling method, the method provided by this application applies 10 machine learning models and automatically selects the optimal model for identification application based on 5 model evaluations, which not only improves the accuracy of model discrimination but also is more suitable for the actual process of complex and multi-order Maotai-flavor liquor production. At the same time, except for a few consumables required for GC-MS detection in step S1, the whole process basically does not require other consumables, which greatly reduces the economic cost of enterprises. More importantly, the Jupyter Notebook platform uses the python3.8 programming language to provide a lot of packages or functions for building discriminant models. Therefore, the use of python3.8 combined with the Jupyter Notebook platform to build a prediction model can ensure that non-professionals can also easily operate with less training, which greatly avoids the misjudgment caused by the lack of professionalism of the operator, and once the model is built, it only needs to upload the file later to obtain the quality grade of the sweet base wine of Maotai-flavor liquor. The whole set of operations can be completed in about 10 minutes, which greatly reduces the time. This not only avoids the high cost paid by the enterprise to train professional operators, but also improves the work detection efficiency for the enterprise.
Claims
1. A method for identifying different quality grades of sweet base liquor of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models, characterized in that: The following steps are involved: S1. Use GC-MS chromatography separation technology to obtain volatile substances in the sweet base wine sample of Maotai-flavor liquor; S2, based on the volatile substances obtained in S1, perform feature standardization, label encoding and data balancing on the data; S3, feature selection using Lasoo regression; S4, build machine learning model: based on the features selected in S3, use logistic regression model, support vector machine model, K-nearest neighbor algorithm, decision tree, random forest, naive Bayes, multi-layer perceptron, gradient boosting tree, adaptive boosting, and extreme gradient boosting model to define and train the model; S5, model evaluation: Use accuracy, F1 score, recall, precision and AUC to evaluate the performance of the 10 models obtained in S4; S6. Identification application: Obtain the volatile substances of the base wine of the tested Maotai-flavor liquor sweet base wine sample according to the method of S1, and input the best model obtained according to S5 to output the quality grade classification of the tested Maotai-flavor liquor sweet base wine.
2. According to claim 1, a method for identifying different quality grades of sweet base wines of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models, characterized in that: The feature standardization described in S2 is to use the StandardScaler function to standardize the feature data; label encoding is to use LabelEncoder to convert the classification label into a numerical type; data balancing is to use SMOTE to generate synthetic samples of the minority class, so that the number of samples of each class is close to balanced, thereby reducing the deviation in model training.
3. According to claim 2, a method for identifying different quality grades of sweet base wines of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models, characterized in that: In the S3, make_pipeline is used to build a pipeline for data preprocessing and model selection, and then the data is standardized by StandardScaler. Then, LassoCV with L1 regularization is used to automatically perform cross-validation to find the nearest regularization parameter, and the non-zero parameter is retained as the final feature.
4. The method of identifying different quality grades of sweet base wines of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models according to claim 3, characterized in that: The logistic regression model is used to process linearly separable data, and the convergence of the optimization process is controlled by a maximum number of iterations of 200; the decision tree constructs a tree structure by recursively splitting data, and limits the maximum depth of the tree to 10 to prevent overfitting; the random forest is classified by constructing 50 trees with a depth of 10, and each leaf node contains at least 4 samples; the multilayer perceptron sets the maximum number of iterations to 200, and the regularization parameter alpha=0.001 to prevent overfitting; the gradient boosting tree uses a smaller learning rate of 0.01 and a tree depth of 5; Adaptive boosting uses a smaller learning rate of 0.1; finally, the extreme gradient boosting model sets the learning rate to 0.01 and the maximum tree depth to 5, and uses logarithmic loss as the evaluation criterion.
5. The method of identifying different quality grades of sweet base wines of Maotai-flavor liquor based on GC-MS combined with multiple machine learning models according to claim 4, characterized in that: The best model in S6 is selected based on the weighted score accuracy':0.2,'f1_score':0.3,'recall':0.2,'precision':0.2,'auc':0.1.
Citation Information
Patent Citations
T1-stage colorectal cancer lymph node metastasis prediction method and system
CN112037852A
Method for detecting and identifying volatile substances in Maotai-flavor base liquor
CN113917061A
Intelligent and digital classification evaluation method for sensory quality of fen-flavor Fen liquor base liquor
CN113935573A
Baijiu base liquor grading method and system based on artificial intelligence
CN114819719A
Classification and identification method for different grades of Maotai-flavor base liquor
CN115166170A
Cited By
Wine production area identification method and system based on volatile compound analysis and machine learning
CN120927844A