Tobacco comprehensive quality classification method based on machine deep learning algorithm

Using machine deep learning algorithms and random forest methods to screen key indicators of tobacco leaves, combined with K-means clustering and various machine learning models, the problem of accuracy of tobacco leaf comprehensive quality evaluation and classification is solved, and the stability of tobacco leaf module assembly and processing is improved. sex and homogeneity.

CN118535940APending Publication Date: 2024-08-23HONGYUN HONGHE TOBACCO (GRP) CO LTD

Patent Information

Application Number
CN202410717508.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The existing technology has problems in the comprehensive quality evaluation and classification of tobacco leaves, such as difficulty in screening multi-dimensional indicators, low judgment accuracy, and reliance on human subjective experience. Misjudgments are prone to occur especially in the case of large amounts of data.

Method used

The random forest method based on machine deep learning algorithm is used to rank tobacco leaf quality indicators based on replacement importance, node purity, mean accuracy and Gini coefficient. The key indicators are screened through the Pareto principle, and K-means clustering and multi-function are used. Perform ten-fold cross-validation on multiple machine learning models, and select the classification category and model with the lowest average false positive rate.

Benefits of technology

It improves the scientificity and effectiveness of tobacco leaf comprehensive quality screening and classification, ensures the stability and fidelity of evaluation results, and provides a more reliable basis for tobacco leaf module assembly and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535940A
    Figure CN118535940A
Patent Text Reader

Abstract

The invention belongs to the technical field of tobacco leaf control, particularly relates to a tobacco leaf comprehensive quality classification method based on a machine deep learning algorithm, and aims to solve the problems that a tobacco leaf comprehensive quality classification evaluation method lacks at present and module assembling and processing parameter presetting lacks basis. Through the comprehensive application of the Pareto principle, the K-means classification method and the 10-fold cross validation method, the reasonability of selection of the screening characteristic variables and the classification model is improved, the stability and fidelity of the evaluation result are ensured, and a more scientific and effective statistical analysis method is provided for screening and classification of the tobacco leaves based on the comprehensive quality. The evaluation method is convenient to operate, simple and practical, and has good industrial application value and popularization and application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of tobacco leaf control, and in particular relates to a method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm. Background Art

[0002] Scientific and accurate evaluation of tobacco leaf quality helps guide tobacco leaf raw material production, procurement and industrial application. The industry has many testing and evaluation indicators for tobacco leaf quality, covering sensory evaluation, appearance quality, chemical composition, physical indicators, grade structure and other dimensions. There are many evaluation indicators and some indicators are inconvenient to detect, which increases the difficulty of tobacco leaf quality analysis and comprehensive quality evaluation, and it is difficult to guide subsequent module assembly and processing parameter preset. The quality of incoming tobacco leaves fluctuates greatly due to factors such as year, origin, and variety. In the leaf beating and redrying process, in order to improve the quality stability of the formula module and the demand for homogenized production, most of them use formula beating to combine single-grade primary tobacco leaves into module formulas to improve the use value of raw materials and the stability of the formula. The principle of modular formula combination is to combine according to the similarity of tobacco leaf quality. Since the physical properties and grade structure of raw tobacco leaves (i.e., first-cured tobacco leaves) will affect the quality control of leaf moistening, leaf beating, and redrying processes in the leaf threshing and redrying process, and the chemical composition and sensory evaluation indicators of raw tobacco leaves will affect the availability of modular formulas, it is very necessary to conduct comprehensive quality evaluation and classification of raw tobacco leaves (i.e., first-cured tobacco leaves) before leaf threshing and redrying.

[0003] Therefore, it is particularly important to select appropriate methods, screen the complex indicators of tobacco leaves, and distinguish and classify tobacco leaves based on comprehensive quality. In recent years, scholars in the industry have conducted extensive research and explored a series of statistical analysis methods, such as: gray correlation analysis method, artificial neural network classification model, principal component analysis, cluster analysis and fuzzy mathematics. Among them, principal component analysis and cluster analysis are the most widely used. Principal component analysis is a statistical analysis method that converts multiple indicators into a few unrelated comprehensive indicators and reflects as much information as possible about the original variables; cluster analysis is a multivariate statistical analysis technique that classifies the research object according to its characteristics. It classifies indicators with similar properties into one category, making the indicators of the same category homogeneous. However, both methods have certain defects. The principal component analysis method is based on multivariate regression analysis, and the robustness of its multivariate regression model prediction is not high, and the judgment accuracy fluctuates greatly; the rationality of the number of classifications in cluster analysis depends on human subjective experience, and when the amount of data is large, it is easy to make misjudgments. And there is no method for distinguishing and classifying raw materials. Summary of the invention

[0004] The purpose of the present invention is to provide a method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm to solve the problems in the above-mentioned background technology. Specifically, by using machine deep learning algorithms such as random forests, the quality evaluation indicators of tobacco leaves in multiple dimensions are screened, and the key chemical indicators with greater contribution to the quality are identified and screened. The principle of screening is that the indicator detection is convenient, the instruments used are essential instruments in the production workshop, and have a greater impact on the comprehensive quality of tobacco leaves. And a variety of methods are used to compare the screened indicators in multiple dimensions to screen out key indicators.

[0005] To achieve the above objectives, this application is implemented through the following technical solutions:

[0006] A method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm adopts the following steps:

[0007] S1. Sampling and evaluating the tobacco raw materials involved in production to obtain the test sample data of sensory evaluation index, appearance quality index, chemical composition index, physical index and grade structure index of the tobacco raw materials;

[0008] S2. Import the test sample data of step S1 into the system, use the permutation importance, node purity, mean accuracy and Gini coefficient in the random forest method to feature sort the importance of indicators, and make a horizontal comparison of multiple methods, select variables according to the Pareto principle, and obtain key indicators;

[0009] S3, performing K-means clustering based on the selected key indicators and the data subsets obtained after the screening, obtaining the cluster center point and outputting the sample classification category;

[0010] S4. Use multiple machine learning methods such as decision trees, random forests, and neural networks to establish multiple classification evaluation models, and simultaneously perform a ten-fold cross-check to calculate the average misclassification rate of the classification evaluation models obtained by various machine learning algorithms, and finally select the classification category and classification evaluation model with the lowest average misclassification rate;

[0011] S5. Use the classification and evaluation model to classify and identify new raw materials to guide module assembly and production processing.

[0012] Furthermore, the chemical composition indicators in step S1 consist of 12 indicators, including total alkaloids, total sugar, reducing sugar, total nitrogen, potassium ions, chloride ions, sugar-alkali ratio, nitrogen-alkali ratio, potassium-alkali ratio, ccui, starch and protein.

[0013] Furthermore, after the test sample data is imported into the system in step S2, the test sample data is preprocessed using R language in the Rstudio graphical interface.

[0014] Furthermore, in step S2, the permutation importance, node purity, mean accuracy and Gini coefficient in the random forest method all use the Pareto principle to select the top 80% of the contribution rates.

[0015] Furthermore, in step S3, the sample classification category is 3-5 categories.

[0016] Furthermore, the multiple category evaluation models established in step S4 are respectively decision tree classification, bagging classification, neural network classification, random forest classification, nearest neighbor method classification, support vector machine classification and kernel support vector machine classification.

[0017] The beneficial effects of the present invention are:

[0018] In view of the lack of classification and evaluation methods for the comprehensive quality of tobacco leaves, the lack of basis for module combination and processing parameter preset, based on the random forest algorithm, through the comprehensive application of the Pareto principle, the K-means classification method, and the 10-fold cross-validation method, the rationality of the selection of screening feature variables and classification models is improved, the stability and fidelity of the evaluation results are guaranteed, and a more scientific and effective statistical analysis method is provided for the screening and classification of tobacco leaves based on comprehensive quality. The evaluation method described in the invention is convenient to operate, simple and practical, and has good industrial application value and promotion and application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flowchart of the present invention.

[0020] Figure 2 Figure 2 is a graph of variable evaluation based on permutation importance.

[0021] Figure 3 It is a graph based on node purity importance evaluation.

[0022] Figure 4 This is an importance evaluation diagram based on mean accuracy.

[0023] Figure 5 This is an importance evaluation chart based on the Gini coefficient.

[0024] Figure 6 Schematic diagram of the distribution of three cluster samples. DETAILED DESCRIPTION

[0025] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings. The following embodiments are merely exemplary and can only be used to explain and illustrate the technical solution of the present invention, but cannot be construed as limiting the technical solution of the present invention.

[0026] The random forest algorithm is a machine learning combination algorithm based on decision trees (CART) proposed by Breiman in 2001. Compared with the above analysis methods, it has better noise tolerance and extrapolation predictability. In recent years, due to the huge advantage of processing high-frequency real-time data, random forests have been widely used in the fields of economy, finance, biology, tobacco, etc. There are two methods of random forests: regression and classification. When the research variable is a continuous variable, random forest regression (Random Forest for Regression) is used for analysis; when the research variable is a categorical variable, random forest classification (Random Forest for Classification) is used for analysis. The tobacco chemical composition data sample is a categorical variable and belongs to the category of classification methods.

[0027] The present invention is based on the random forest algorithm, and through the comprehensive application of the Pareto principle, the K-means classification method, and the ten-fold cross-validation method, the rationality of screening characteristic variables and selecting classification models is improved, the stability and fidelity of the evaluation results are ensured, and a more scientific and effective classification model is established for the comprehensive quality classification and discrimination of tobacco leaves.

[0028] The specific implementation process is as follows: import the data set into the system, use R language and Rstudio graphical interface to preprocess the data, first rank the variables by importance, then select the variables according to the Pareto principle, then perform K-means clustering on the selected data subsets, obtain the cluster center and output the sample classification category, finally use the 10-fold cross-validation method to calculate the average error rate of the classification model obtained by various machine learning algorithms, and finally select the classification category and classification model with the lowest average error rate, such as Figure 1 shown.

[0029] The present application provides a method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm, using the following steps:

[0030] S1. Sampling, evaluation and testing are carried out based on the tobacco raw materials involved in production, and a large amount of testing data such as sensory evaluation, appearance quality, chemical composition (conventional chemistry, aroma components and volatile components, etc.), physical indicators, grade structure, etc. of the tobacco raw materials are obtained.

[0031] S2. Import the test sample data into the system, use R language and Rstudio graphical interface to preprocess the data, use the permutation importance, node purity, mean accuracy and Gini coefficient in the random forest method to rank the importance of indicators, and make a horizontal comparison of multiple methods. Then, select variables according to the Pareto principle to obtain key indicators.

[0032] S3. Perform K-means clustering based on the selected key indicators and the data subset obtained after the screening to obtain the cluster center point and output the sample classification category.

[0033] S4. Use decision trees, random forests, neural networks and other machine learning methods to establish multiple category evaluation models. Perform a ten-fold cross-check with each other and calculate the average error rate of the classification models obtained by various machine learning algorithms. Finally, select the classification category and classification model with the lowest average error rate.

[0034] S5. Use the classification and evaluation model to classify and identify new raw materials to guide module assembly and production processing.

[0035] The technical solution of this application is based on the tobacco leaf quality evaluation of conventional chemical indicators. This application selects six conventional chemical indicators: total alkaloids, total sugars, reducing sugars, total nitrogen, potassium ions, and chloride ions; four conversion variables: sugar-alkali ratio, nitrogen-alkali ratio, potassium-chlorine ratio, and CCUI. In addition to starch and protein, two easily measurable indicators, there are a total of 12 indicators.

[0036] 1. Selection of indicators:

[0037] 1) Random Forest-Permutation Importance Index Selection:

[0038] Using the permutation importance in random forest, the importance ranking of 12 indicators is obtained, such as Figure 2 As shown, from Figure 2 It can be seen that the most important indicator is the sugar-alkali ratio, and the lowest indicator is potassium ion. Use the Pareto chart to select the indicators with the top 80% contribution rate. Figure 2 (Right) It can be seen that at least the first 8 indicators need to be selected: sugar-alkali ratio, protein, total plant alkaloids, reducing sugar, starch, total sugar, ccui, and total nitrogen. Among these 8 indicators, 6 are independent, and 2 indicators can be calculated using independent indicators.

[0039] 2) Random Forest - Node Purity Index Selection:

[0040] Using the importance of node purity in random forest, the importance order of 12 indicators is obtained, see Figure 3 (Left), the sugar-alkali ratio is the largest, followed by chloride ion, and the smallest is protein. In order to obtain the Pareto chart of the index contribution rate, all indicators were translated, and the results were Figure 3 (right).

[0041] Select the indicators with the top 80% contribution rate. It can be seen from the figure that at least the first 8 indicators need to be selected: sugar-alkali ratio, chloride ion, nitrogen-alkali ratio, potassium-chlorine ratio, CCUI, reducing sugar, total plant alkaloids, and total nitrogen, which are slightly different from the indicators selected by the previous evaluation criteria.

[0042] 3) In random forests, mean accuracy index selection:

[0043] Using the importance of mean accuracy in random forest, the importance order of 12 indicators is obtained, such as Figure 4 (Left), the sugar-alkaloid ratio is the largest, followed by total plant alkaloids, and the smallest is potassium ion. The Pareto chart is used to select the top 80% of the indicators with the highest contribution rate. Figure 4 (Right) It can be seen that at least the first 8 indicators need to be selected for the contribution rate to reach 80%. The first 8 indicators are: sugar-alkali ratio, total plant alkaloids, protein, reducing sugar, total sugar, starch, ccui, and total nitrogen.

[0044] 4) Random Forest-Gini Coefficient Indicator Selection:

[0045] Using the importance of the Gini coefficient in random forest, the importance order of the 12 indicators is obtained, such as Figure 5 (Left), the sugar-alkali ratio is the largest, followed by total sugar, and the smallest is potassium ion. The Pareto chart is used to select the indicators with the top 80% contribution rate for the indicator importance. Figure 5 (Left) A Pareto diagram of substitution importance is given. It can be seen from the figure that at least the first 10 indicators need to be selected: sugar-alkali ratio, total sugar, reducing sugar, total nitrogen, total alkaloids, protein, starch, CCUI, chloride ion, and nitrogen-alkali ratio.

[0046] Considering the above four indicators at the same time, Table 1 gives the importance ranking of the four indicators.

[0047] Table 1 Selection of conventional chemical indicators

[0048]

[0049] Only the first 8 indicators are needed for substitution importance, node purity and mean accuracy, and 10 indicators are needed for the evaluation of the Gini coefficient. As can be seen from Table 1, some of the indicators selected by the four methods are common indicators, such as sugar-alkali ratio, total nitrogen, ccui, starch and reducing sugar, and the rationality of these indicators is relatively high. In terms of the total number of selected variables, the first three methods are suitable. Therefore, for conventional chemical indicators, we selected the indicators to be obtained by substitution gravity of one of the first three to establish an evaluation model. Since it is objectively difficult to determine the quality of physical and chemical indicators, the cluster analysis method is used to classify the raw materials using physical and chemical indicators, and combine factors such as appearance and sensory organs to set standards for the quality of each category, thereby determining the quality of different types of tobacco leaves.

[0050] 2. Classification of selected indicators:

[0051] The eight variables selected by using replacement importance are: sugar-alkali ratio, protein, total alkaloids, reducing sugar, starch, total sugar, ccui, and total nitrogen. First, the classification information is given, and then the quality discrimination model is established using the classification information. Taking into account the different situations of tobacco leaf quality grading, the situations of 3, 4, and 5 categories are considered at the same time. First, the number of samples in different categories is as follows: Figure 2 shown.

[0052] Table 2 Number of samples in each category obtained by K-means clustering

[0053]

[0054] In the case of three categories, there are 42 samples in the first category, 36 samples in the second category, and 5 samples in the third category. The classification is extremely uneven, and the number of samples in the third category is relatively small.

[0055] In the four-category case, there are 5 samples in the first category, 31 samples in the second category, 32 samples in the third category, and 17 samples in the fourth category. Except for the first category with a smaller number of samples, there is not much difference between the other three categories.

[0056] In the case of five categories, there are 17 samples in the first category, 12 samples in the second category, 23 samples in the third category, 28 samples in the fourth category, and 5 samples in the fifth category. The classification is extremely uneven, with the number of samples in the first category being relatively small.

[0057] 1. There are three types of situations:

[0058] The values ​​of the class centers of the three categories are shown in Table 3:

[0059] Table 3 Center of each index of k-means clustering (3 categories)

[0060]

[0061] From the centers of the three categories, we can see that the difference ratios between different categories are quite obvious, and the distinction between different categories is quite clear.

[0062] The classification details of each sample are shown in Table 4:

[0063] Table 4 Details of k-means clustering samples divided into three categories

[0064]

[0065] 2. The four categories are shown in Table 5:

[0066] Table 5 Center of each index of k-means clustering (4 categories)

[0067]

[0068] From the centers of the four categories, it can be seen that the difference ratios of different categories are quite obvious, and the distinction between different categories is relatively clear, as shown in Table 6:

[0069] Table 6 K-means clustering sample classification details (4 categories)

[0070]

[0071] 3. The five categories are shown in Table 7:

[0072] Table 7 Center of each index of k-means clustering (5 categories)

[0073]

[0074] From the centers of the five categories, we can see that the differences between the different categories are also obvious, and the distinction between the different categories is relatively clear, as shown in Table 8:

[0075] Table 8 K-means clustering sample classification details (5 categories)

[0076]

[0077] 4. Cluster distribution visualization Figure 6 As shown, when divided into four categories, the samples can basically be distinguished, when divided into three categories, the samples are too concentrated, and when divided into five categories, the samples overlap too much.

[0078] 3. Machine Learning Modeling and Accuracy of Evaluation Model:

[0079] For the above three classification models, seven discriminant models were established, including decision tree, bagging, neural network (nnet), random forest classification, nearest neighbor method classification (kknn), support vector machine (svm) and kernel support vector machine (ksvm). The ten-fold cross validation method was used to test the accuracy of different models, and finally the evaluation model under different classification conditions was determined.

[0080] The different categories of situations are shown in Table 9:

[0081] Table 9 Machine learning misjudgment rate

[0082]

[0083] Among the models with different classification situations, the model with the lowest error rate is the random forest classification model with five categories, and the model with the highest error rate is the decision tree model with five categories. The error rates of other classification situations with five categories are obviously higher, all concentrated at around 15%, indicating that the error rate has a certain relationship with the classification situation. Therefore, the model established by the random forest method is the most reliable.

[0084] The evaluation model established using conventional chemical composition only requires 8 indicators. From the perspective of judgment accuracy, the accuracy of selecting 7 variables is lower than that of 18 variables, but the difference is not too large. Most of them are less than 15%, which is within an acceptable range.

[0085] In the feature screening process of this technical solution, the Pareto principle is used to select the variables of the data set participating in the regression verification for the sorted features. On the one hand, the experiment is carried out based on the theory, which largely avoids the influence of subjective selection on the experiment. On the other hand, it also shows that the tobacco leaf feature variables obtained by screening have certain rationality.

[0086] In this technical solution, the number of classification categories can be flexibly adjusted in the process of classifying data subsets using K-means, which provides more experimental samples for further cross-validation using machine learning algorithms, thereby supporting and verifying the rationality of the finally selected classification model.

[0087] In the regression verification process, ten-fold cross validation was used to ensure the stability and fidelity of the evaluation results to a large extent. In addition, a variety of machine learning algorithms were applied to cross-validate the data set, and finally the classification model obtained by the learner with the lowest average misclassification rate was selected. The whole process ensured the rationality of the selection of the classification model.

[0088] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm, characterized in that: Use the following steps: S1. Sampling and evaluating the tobacco raw materials involved in production to obtain the test sample data of sensory evaluation index, appearance quality index, chemical composition index, physical index and grade structure index of the tobacco raw materials; S2. Import the test sample data of step S1 into the system, use the permutation importance, node purity, mean accuracy and Gini coefficient in the random forest method to feature sort the importance of indicators, and make a horizontal comparison of multiple methods, select variables according to the Pareto principle, and obtain key indicators; S3, performing K-means clustering based on the selected key indicators and the data subset obtained after the screening, obtaining the cluster center point and outputting the sample classification category; S4. Use multiple machine learning methods such as decision trees, random forests, and neural networks to establish multiple classification evaluation models, and simultaneously perform a ten-fold cross-check to calculate the average misclassification rate of the classification evaluation models obtained by various machine learning algorithms, and finally select the classification category and classification evaluation model with the lowest average misclassification rate; S5. Use the classification and evaluation model to classify and identify new raw materials to guide module assembly and production processing.

2. The method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm according to claim 1, characterized in that: The chemical composition indicators in step S1 include 12 indicators, including total alkaloids, total sugars, reducing sugars, total nitrogen, potassium ions, chloride ions, sugar-alkali ratio, nitrogen-alkali ratio, potassium-alkali ratio, ccui, starch and protein.

3. The method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm according to claim 1, characterized in that: Step S2: After the test sample data is imported into the system, the test sample data is preprocessed using the R language in the Rstudio graphical interface.

4. The method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm according to claim 1, characterized in that: In step S2, the permutation importance, node purity, mean accuracy and Gini coefficient in the random forest method all use the Pareto principle to select the top 80% of the contribution rates.

5. The method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm according to claim 1, characterized in that: In step S3, the sample classification category is 3-5.

6. The method for classifying the comprehensive quality of tobacco leaves based on a machine deep learning algorithm according to claim 1, characterized in that: The multiple category evaluation models established in step S4 are decision tree classification, bagging classification, neural network classification, random forest classification, nearest neighbor method classification, support vector machine classification and kernel support vector machine classification.

Citation Information

Patent Citations

  • Apparatus and method for classifying a tobacco sample into one of a predefined set of taste categories

    CN109640708A

Cited By

  • Tobacco leaf producing area classification method and device based on fusion auxiliary label and image reconstruction

    CN121434884A