Tobacco harvesting maturity identification method and equipment based on Lasso-Boruta-gcfrest algorithm

Through the method based on the Lasso-Boruta-gcforest algorithm, the morphology, color and texture characteristics of the tobacco leaf images were extracted, and a multi-grained cascade forest model was constructed, which solved the problem of low reliability in judging the maturity of tobacco leaf harvesting, and achieved high-accurate maturity prediction.

CN119600337APending Publication Date: 2025-03-11HENAN AGRICULTURAL UNIVERSITY +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411639944.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The human subjective judgment of tobacco leaf maturity is low, and it is difficult for the existing technology to effectively identify the maturity of tobacco leaf.

Method used

Using the method based on the Lasso-Boruta-gcforest algorithm, we use to obtain the image information of tobacco leaves, extract the morphology, color and texture features, perform feature screening and hyperparameter optimization, and build a multi-grained cascade forest model for maturity prediction.

Benefits of technology

The reliability and accuracy of the judgment of maturity of tobacco leaves is improved, and the average accuracy rate of prediction of different maturity levels reaches 94.52%, effectively identifying the maturity of tobacco leaves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600337A_ABST
    Figure CN119600337A_ABST
Patent Text Reader

Abstract

The invention relates to a method for identifying harvesting maturity of tobacco leaves. The method comprises the following steps: acquiring image information of the tobacco leaves and maturity category information corresponding to the image information; extracting an image feature value corresponding to the mature category information in the image information; performing feature screening on the image feature values to obtain image fusion feature values; performing maturity prediction on the image fusion feature value according to a multi-granularity cascade forest optimization model after hyper-parameter optimization by adopting a genetic algorithm to obtain a prediction result; performing model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result; and determining a training set and a test set of the multi-granularity cascade forest optimization model according to the evaluation result. According to the technical scheme, compared with other models, the GCF has more comprehensive performance on tobacco maturity prediction, the GCF hyper-parameters are optimized through the genetic algorithm (GA), the model performance is further improved, and the average accuracy rate of different maturity prediction reaches 94.52%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field, and in particular to a method, system, readable storage medium and computer equipment for identifying the maturity of harvested tobacco leaves based on a Lasso-Boruta-gcforest algorithm. Background Art

[0002] The appearance quality of tobacco leaves includes factors such as maturity, color, oil content, identity, structure, and chromaticity. Maturity is the first factor in tobacco production and plays an important role in shaping the industrial availability of tobacco leaves. It is generally believed that tobacco leaves with good harvest maturity are easy to bake, and the tobacco leaves after curing have the best processing resistance, excellent physical properties, the most coordinated internal chemical composition, a relatively high total amount of neutral aroma components, and relatively ideal sensory quality. In the past, tobacco leaf maturity identification relied on methods such as colorimetry, SPAD value detection, and spectral information. The application scenarios were limited by factors such as collection convenience and processing timeliness. With the rise of computer vision technology, the use of image processing technology for intelligent discrimination of fresh tobacco leaf maturity has become a research hotspot in recent years. For example, Xie Binyao extracted the color features and texture features of the target image and used the deep learning algorithms Alex Net and VGG16Net to establish a corresponding tobacco leaf maturity identification model, with an accuracy rate of more than 90% for different leaf positions. Wang Ruiqi, Du Pengcheng, etc. used the lightweight network You Only Look Once (YOLO) V5 algorithm to extract different maturity features of fresh tobacco leaves and constructed a tobacco leaf maturity detection model. Dai Yingpeng et al. proposed an intelligent discrimination method for fresh tobacco leaf maturity images based on fuzzy illumination processing by constructing the membership probability relationship between the yellow area and the maturity of fresh tobacco leaves. Although the use of deep learning models with powerful performance has become one of the mainstream methods in practical problems such as image recognition, natural language processing and bioinformatics, deep learning algorithms have a large number of hyperparameters, require a large number of initializations before training, consume a large number of training samples, and have high data annotation costs. Therefore, in some scenarios, traditional machine learning algorithms still have unique advantages due to their high computational efficiency and strong interpretability.

[0003] Multi-granularity cascade forest (GCF) is a method proposed by Zhou in 2017 to build deep modules based on non-differentiable modules. It is an integrated method that simulates deep learning architectures. It combines the advantages of random forests with the hierarchical feature extraction capabilities of deep learning. The GCF algorithm has the characteristics of few hyperparameters, low computational overhead, and easy parallelization. In addition, its model complexity is automatically determined in a data-dependent manner. By constructing a multi-layer random forest structure, hierarchical feature extraction is achieved, thereby achieving or even exceeding the performance of deep neural networks without the need for a large amount of labeled data. Xu Huihuang et al. used the GCF algorithm to construct an osteoporotic fracture prediction model. Under the condition of considering genetic factors, the generalization performance of the model is better than that of logistic, gradient boosting decision tree, and random forest models. At present, the application of the GCF algorithm in tobacco-related fields has not been reported, and it is worth further experimentation. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.

[0005] To this end, the purpose of the present invention is to provide a method and device for identifying the maturity of tobacco leaves at harvest based on the Lasso-Boruta-gcforest algorithm, which can solve the problem of low reliability of subjective judgment of maturity of flue-cured tobacco in the field.

[0006] To achieve the above-mentioned object, the technical solution of the first aspect of the present invention provides a method for identifying the maturity of tobacco leaves harvested based on the Lasso-Boruta-gcforest algorithm, comprising:

[0007] Acquiring image information of tobacco leaves and maturity category information corresponding to the image information;

[0008] extracting an image feature value corresponding to the mature category information from the image information;

[0009] Performing feature screening on the image feature values ​​to obtain image fusion feature values;

[0010] The maturity of the image fusion feature value is predicted according to a multi-granularity cascade forest optimization model after hyperparameter optimization using a genetic algorithm to obtain a prediction result;

[0011] Performing a model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result;

[0012] The training set and the test set of the multi-granularity cascade forest optimization model are determined according to the evaluation results.

[0013] In the above technical solution, preferably, obtaining the image information of the tobacco leaves and the maturity category information corresponding to the image information includes:

[0014] According to the maturity characteristics of the tobacco leaf main veins and leaf surface in the image information, the tobacco leaves are marked as under-mature, moderately mature and over-mature grades, and a total of 6 maturity category information of the middle leaves and upper leaves are obtained.

[0015] In any of the above technical solutions, preferably, the image feature values ​​include morphological features consisting of at least length Length, width Width, area Area, perimeter Perimeter and roundness Roundness, color features consisting of at least redness value R, greenness value G, blueness value B, brightness value L, red-green channel value a, yellow-blue channel value b, hue value H, saturation S, lightness V and grayscale value Gray, and texture features consisting of at least contrast contrast, dissimilarity dissimilarity homogeneity energy energy, correlation value correlation, angular second-order moment value ASM and entropy value entropy.

[0016] In the above technical solution, preferably, the feature screening of the image feature value includes:

[0017] The image feature value is standardized using Z-score, and the expression is: Among them, Z B represents the image feature standard value, Z represents the image feature value, represents the average value of the image feature value, and σ represents the standard deviation;

[0018] The image feature standard value is initially optimized according to the Lasso linear regression model to obtain the initial fusion feature value of the image, which is expressed as:

[0019] Where N is the number of samples, p is the number of features, and y i is the target value of the ith observation, x ij is the value of the jth characteristic variable of the ith observation, β j is the coefficient of the jth feature, β 0 is the intercept term, λ is the regularization parameter;

[0020] The target features are screened out from the initial fusion feature values ​​of the image according to the Boruta algorithm to obtain the image fusion feature values.

[0021] In the above technical solution, preferably, the maturity prediction of the image fusion feature value is performed according to the multi-granularity cascade forest optimization model after the hyperparameter optimization is performed using a genetic algorithm, including:

[0022] Using a sliding window with a width of n and a step length of s to perform sliding sampling on the m-dimensional image fusion feature value to obtain a feature sub-sample;

[0023] The feature subsamples are trained by random forest and completely random forest classifiers, and each classifier is trained to obtain a w-dimensional category probability vector;

[0024] After concatenating the category probability vectors, a concatenated feature vector of 2×[(mn) / s+1]×w dimensions can be obtained;

[0025] The spliced ​​feature vectors are spliced ​​twice level by level in a multi-granularity cascade forest optimization model to obtain the prediction result;

[0026] Among them, the step size of the sliding window of the multi-granularity cascade forest optimization model after hyperparameter optimization using genetic algorithm is 6, the minimum sample for splitting in the node is 13, the number of random forest classifiers in the cascade layer is 5, and the number of trees in a single random forest is 115.

[0027] In the above technical solution, preferably, the preset evaluation indicators include:

[0028] Accuracy index:

[0029] Recall metric:

[0030] Taking into account indicators:

[0031] Among them, TP represents the samples predicted as positive, FP represents the samples predicted as positive, FN represents the samples predicted as negative, and TN represents the samples predicted as negative.

[0032] In the above technical solution, preferably, the ratio of the training set to the test set of the multi-granularity cascade forest optimization model is 8:2.

[0033] The technical solution of the second aspect of the present invention provides a tobacco leaf harvest maturity identification system based on the Lasso-Boruta-gcforest algorithm, comprising:

[0034] An acquisition module is configured to acquire image information of tobacco leaves and maturity category information corresponding to the image information;

[0035] a feature extraction module, configured to extract image feature values ​​corresponding to the mature category information from the image information;

[0036] A feature screening module is configured to perform feature screening on the image feature values ​​to obtain image fusion feature values;

[0037] A maturity prediction module is configured to perform maturity prediction on the image fusion feature value according to a multi-granularity cascade forest optimization model after hyperparameter optimization using a genetic algorithm to obtain a prediction result;

[0038] A model performance evaluation module is configured to perform model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result;

[0039] The model input data determination module is configured to determine the training set and the test set of the multi-granularity cascade forest optimization model according to the evaluation results.

[0040] The technical solution of the third aspect of the present invention provides a readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the tobacco leaf harvest maturity identification method based on the Lasso-Boruta-gcforest algorithm provided by the technical solution of the first aspect are implemented.

[0041] The technical solution of the fourth aspect of the present invention provides a computer device, including a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to implement the steps of the tobacco leaf harvest maturity identification method based on the Lasso-Boruta-gcforest algorithm provided by the technical solution of the first aspect above.

[0042] Compared with the prior art, the advantages of the tobacco harvest maturity identification method and device based on the Lasso-Boruta-gcforest algorithm provided by the present invention are: the morphology, color and texture features of tobacco images with different maturity are obtained by using image processing technology, and the Lasso and Boruta algorithms are integrated to reduce the dimension of the original features and select the features that have an important impact on maturity prediction. Compared with other models, GCF has more comprehensive performance in tobacco maturity prediction. The genetic algorithm (GA) is used to optimize the GCF hyperparameters, which further improves the model performance, and the average accuracy of prediction of different maturity reaches 94.52%. The GCF optimization model can effectively identify the maturity of tobacco leaves and has good application potential. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0044] Figure 1 A flowchart of a method for identifying the maturity of harvested tobacco leaves according to an embodiment of the present invention is shown;

[0045] Figure 2 A flowchart of step S3 according to an embodiment of the present invention is shown;

[0046] Figure 3 A flowchart of step S4 according to an embodiment of the present invention is shown;

[0047] Figure 4 Shows example images of tobacco leaves of different maturity levels;

[0048] Figure 5 The flowchart of the multi-granularity cascade forest model is shown;

[0049] Figure 6 The screening results of the data features are shown;

[0050] Figure 7 Model SHAP interpretation is shown;

[0051] Figure 8 The structure block diagram of the tobacco harvest maturity identification system involved in the embodiment of the present invention is shown. DETAILED DESCRIPTION

[0052] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0053] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0054] like Figure 1 As shown, according to an embodiment of the present invention, a method for identifying tobacco leaf harvest maturity based on the Lasso-Boruta-gcforest algorithm includes:

[0055] S1, obtaining image information of tobacco leaves and maturity category information corresponding to the image information;

[0056] S2, extracting image feature values ​​corresponding to the mature category information from the image information;

[0057] S3, performing feature screening on the image feature values ​​to obtain image fusion feature values;

[0058] S4, predicting the maturity of the image fusion feature value according to the multi-granularity cascade forest optimization model after the hyperparameter optimization is performed using a genetic algorithm to obtain a prediction result;

[0059] In this step, the multi-granularity cascade forest model consists of a multi-granularity scanning structure and a cascade forest structure. It is a deep model different from a deep neural network and has the advantages of fewer parameters, lower training difficulty, and less data requirement. The model principle is as follows Figure 5 shown.

[0060] S5, performing a model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result;

[0061] S6, determining a training set and a test set of the multi-granularity cascade forest optimization model according to the evaluation results.

[0062] In the above embodiment, preferably, obtaining the image information of the tobacco leaves and the maturity category information corresponding to the image information includes:

[0063] According to the maturity characteristics of the tobacco leaf main veins and leaf surface in the image information, the grades are marked as under-mature (M1), moderately mature (M2) and over-mature (M3), and a total of 6 maturity category information of the middle leaves and upper leaves are obtained.

[0064] In this embodiment, if Figure 4 As shown in the figure, the maturity of tobacco leaves is marked according to the maturity characteristics of the main veins and leaf surface, and divided into under-mature (M1), moderately mature (M2) and over-mature (M3) grades, and 6 maturity categories of middle leaves and upper leaves are obtained, which are marked as: CM1, CM2, CM3, BM1, BM2 and BM3. There are obvious differences in external characteristics between tobacco leaves of different categories, such as CM1 leaf surface presents 60% to 70% yellow-green, and the main vein turns white by about 1 / 2; CM2 leaf surface presents 70% to 80% light yellow, and the main vein turns white by about 2 / 3; CM3 leaf surface presents 80% to 90% light yellow, and the main vein turns white by about 3 / 4. Images of tobacco leaves of different maturity were taken and sample labels were made, and a total of 990 samples were obtained (including 320 under-mature, 420 moderately mature, and 250 over-mature).

[0065] In any of the above embodiments, preferably, the image feature values ​​include morphological features consisting of at least length Length, width Width, area Area, perimeter Perimeter and roundness Roundness, color features consisting of at least redness value R, greenness value G, blueness value B, brightness value L, red-green channel value a, yellow-blue channel value b, hue value H, saturation S, lightness V and grayscale value Gray, and texture features consisting of at least contrast contrast, dissimilarity dissimilarity homogeneity energy energy, correlation value correlation, angular second-order moment value ASM and entropy value entropy.

[0066] Before extracting image features, mean filtering, median filtering and bilateral filtering algorithms are used to pre-process the image for denoising. Among them, the median filtering algorithm shows a good smoothing effect, and can maintain the boundary and texture features of the image while denoising. Finally, the median filter is selected to improve the image quality, and the maximum inter-class variance method and mathematical morphology methods are used to segment the image. After the pre-processing, the target image features are extracted based on the color space model and gray-level co-occurrence matrix, including morphological features (length Length, width Width, area Area, perimeter Perimeter and roundness Roundness), color features (redness value R, greenness value G, blueness value B, brightness value L, red and green channel value a, yellow and blue channel value b, hue value H, saturation S, brightness V and gray value Gray) and texture features (contrast, dissimilarity, homogeneity, energy value energy, correlation value correlation, angular second-order moment value ASM and entropy value entropy). The feature values ​​of all sample images are calculated, and the range of feature values ​​of tobacco leaf images with different maturity levels is shown in Table 1.

[0067] Table 1 Image feature values ​​of tobacco leaves at different maturity levels

[0068]

[0069] like Figure 2 As shown, in the above embodiment, preferably, S3, performing feature screening on the image feature value includes:

[0070] S31, using Z-score to standardize the image feature value, the expression is: Among them, Z B represents the image feature standard value, Z represents the image feature value, represents the average value of the image feature value, and σ represents the standard deviation;

[0071] S32, performing initial feature optimization on the image feature standard value according to the Lasso linear regression model to obtain the image initial fusion feature value, which is expressed as:

[0072] Where N is the number of samples, p is the number of features, and y i is the target value of the ith observation, x ij is the value of the jth characteristic variable of the ith observation, β j is the coefficient of the jth feature, β 0 is the intercept term, λ is the regularization parameter, and the regularization parameter λ is used to control the complexity of the model. By changing λ, the selection of variables is adjusted so that the coefficients of unimportant variables are compressed to 0;

[0073] S33, selecting target features from the initial fusion feature values ​​of the image according to the Boruta algorithm to obtain the image fusion feature values;

[0074] In this step, the Boruta algorithm is a feature screening algorithm based on the random forest algorithm. The algorithm can screen out variables that are highly important to the target variable from many feature variables, and can obtain the importance ranking of the feature variables to provide the best classification accuracy for the selected feature variables.

[0075] like Figure 3 As shown, in the above embodiment, preferably, S4, predicting the maturity of the image fusion feature value according to the multi-granularity cascade forest optimization model after the hyperparameter optimization using the genetic algorithm, includes:

[0076] S41, using a sliding window with a width of n and a step length of s to perform sliding sampling on the m-dimensional image fusion feature value to obtain a feature subsample;

[0077] S42, training the feature subsamples by using random forest and completely random forest classifiers, and obtaining a w-dimensional category probability vector after each classifier is trained;

[0078] S43, after concatenating the category probability vectors, a concatenated feature vector of 2×[(mn) / s+1]×w dimensions can be obtained;

[0079] S44, the spliced ​​feature vectors are spliced ​​twice level by level in a multi-granularity cascade forest optimization model to obtain the prediction result;

[0080] Among them, the step size of the sliding window of the multi-granularity cascade forest optimization model after hyperparameter optimization using genetic algorithm is 6, the minimum sample for splitting in the node is 13, the number of random forest classifiers in the cascade layer is 5, and the number of trees in a single random forest is 115.

[0081] In this embodiment, the genetic algorithm (GA) is a global optimization random search method that can solve the problem through the evolutionary process that embodies the evolutionary mechanism without understanding all the characteristics of the problem. By imitating the biological evolution process of natural selection in nature, the chromosomes are evaluated using an evaluation function, and alternative solution sets are generated through genetic operations such as replication, crossover and mutation. As the population evolves, individuals with low evaluation scores are eliminated with a relatively high probability, thereby obtaining the optimal solution to the problem.

[0082] Table 2 shows the parameter settings of the GCF model. The GA algorithm is used to optimize the hyperparameters of the model. Compared with the unoptimized model, the GA algorithm adjusts the hyperparameters in the multi-granular scanning structure and the cascade forest structure layer. The multi-granular scanning window size is adjusted to 6, the minimum sample for splitting in the node is 13, the number of random forest classifiers in the cascade layer is 5, and the number of trees in a single random forest is 115. During the model training process, the original features are first input into the multi-granular scanning structure, concatenated to form a new feature vector, and then input into the cascade forest structure and concatenated with the category probability vector output by each level of the forest model; and so on, each cascade layer takes the output of the previous layer as input and outputs the processed information to the next layer. The maximum value of the output of the last layer is the final prediction result.

[0083] Table 2 Parameter settings of multi-granularity cascade forest model

[0084]

[0085] In the above embodiment, preferably, the preset evaluation index includes:

[0086] Accuracy index:

[0087] Recall metric:

[0088] Taking into account indicators:

[0089] Among them, TP represents the samples predicted as positive, FP represents the samples predicted as positive, FN represents the samples predicted as negative, and TN represents the samples predicted as negative.

[0090] In the above embodiment, preferably, the ratio of the training set to the test set of the multi-granularity cascade forest optimization model is 8:2.

[0091] Specific example

[0092] The 54-dimensional features were screened by Lasso and Boruta algorithms. The Lasso model controls the compression degree of the regression coefficient by adjusting the penalty coefficient alpha. As the alpha value increases, unimportant features are gradually excluded, and only features that have a significant impact on target prediction are retained. 32 variables including Length, R_mean, R_std, Gray_contrast and Gray_dissimilarity are selected as the optimal feature subset ( Figure 6 A, B). Figure 6C is the feature importance ranking based on the Boruta algorithm. 42 features are retained, among which feature width ranks last among the morphological features and is eliminated during the iteration process. Among the color features, V_std, V_mean and S_std are ranked first, while Gray_std and l_std are ranked last. Among the texture features, Gray_mean, Gray_dissimilarity and Gray_homogeneity are rated highly, while Gray_energy and G_energy are rated the lowest. Figure 6 D is the overlap of the features screened by the Lasso and Boruta algorithms. The two algorithms have a total of 30 features (Length, L / W Ratio, R_mean, R_std, and Gray_contrast, etc.) as modeling feature inputs, and other non-overlapping nodes are considered to be unimportant features.

[0093] Model Training

[0094] The training set was divided into 80%, 60%, 40%, 20% and 10% ratios respectively, and the tobacco maturity recognition model based on the GCF algorithm was established. The recognition results under different training set ratios are shown in Table 3. The results show that with the increase of the training set ratio, the recognition effect of the model is getting better and better; when the training set ratio is 80%, the model accuracy, recall rate and F 1 The values ​​(harmonic mean of precision and recall) are 93.20%, 93.6% and 93.6% respectively, and the model performance reaches the best state.

[0095] Table 3 Recognition results of tobacco leaf maturity under different training set ratios

[0096]

[0097] Model Performance Evaluation

[0098] In view of the impact of data set division on model performance, the split ratio of the training set and the test set is set to 8:2. Table 4 shows the performance evaluation of the GCF recognition model for tobacco leaves of different maturity. The results show that GCF has the best recognition effect on over-ripe middle leaves and under-ripe upper leaves. 1 The values ​​of F and F were 95.05% and 92.47% respectively, but the recognition effect of the middle leaves was poor. 1 The value is 85.44%.

[0099] Table 4 Recognition results of GCF model

[0100]

[0101]

[0102] Model comparison

[0103] In order to verify the recognition effect of GCF on tobacco leaf maturity, GCF was compared with KNN, RF, SVM, and XGBoost models under the same data sample. As shown in Table 5, compared with the other five models, GCF showed more stable recognition results, and the evaluation index values ​​for the prediction of different maturity of the middle and upper tobacco leaves were close, and its overall performance was the best. Using the GA algorithm to optimize the GCF hyperparameters improved the model performance, among which the prediction of the maturity of the middle leaves was the most obvious, and F 1 The value increased by 5.3%. GA-GCF has higher evaluation index values ​​in predicting underripe middle leaves, moderately ripe leaves and upper leaves. In addition, the recognition effect of the LightGBM model is second only to GCF, and the performance of various evaluation indicators is also better than other models.

[0104] Table 5 Recognition effects of different models

[0105]

[0106]

[0107] KNN is a statistical pattern recognition method. Its idea is to calculate the distance between samples of unknown categories and samples of known categories, find the K nearest neighbor samples with the smallest distance to the samples of unknown categories based on the distance metric, and identify the type of unknown samples based on the principle of "the minority obeys the majority". Select the distance metric function, generally the Euclidean distance, calculate the distance value between the sample to be tested and the neighboring samples and sort them. The calculation formula is as follows: In the formula: x is the sample to be classified; y is the sample of known category; n represents the data dimension; i and k are the sample numbers.

[0108] RF algorithm random forest is a bagging algorithm in ensemble learning, which makes predictions by voting or averaging multiple decision trees. When generating a random forest, the model randomly selects h features from the entire feature set H as training input, builds a decision tree, and determines the split attribute based on the strategy of reducing the Gini index. The calculation formula is as follows:

[0109] Where: T is the number of samples, K is the number of categories in the sample, P k is the frequency of category k appearing in sample T.

[0110] SVM is a supervised learning algorithm that implements nonlinear classification by mapping data into a high-dimensional space and then finding the best splitting hyperplane in that space. Support vectors are the data points closest to the splitting hyperplane, and they determine the position of the hyperplane.

[0111] When used for regression problems, support vector machines seek a bisection method to minimize the "distance" to the farthest sample point on the hyperplane, following the technique of transforming the data using the kernel trick to find the best output boundary. Points within the boundary satisfy:

[0112]

[0113] Where: w is the weight vector, a is the input variable, is a high-dimensional feature space, and c is a bias constant.

[0114] XGBoost is an ensemble learning model based on CART trees, which combines the prediction values ​​of multiple trees as the final result. Compared with the traditional GBDT (Gradient Boosting Decision Tree) algorithm, it has significant improvements in calculation speed and accuracy. Its objective function is:

[0115]

[0116] Where: d is the number of samples, K is the number of boosted trees, y d is the dth sample x d The predicted value of ∑ u Ω(f u ) represents the complexity of u trees.

[0117] LightGBM (Light GradientBoosting Machine) is an efficient algorithm based on gradient boosting decision trees. It has the advantages of fast training and low memory consumption, and supports parallel processing of massive data. It accelerates training and improves accuracy by discretizing continuous data into histograms, and uses the gain method to extract features. The LightGBM objective function is expressed as:

[0118]

[0119] Where: O (t) is the objective function value, n is the number of samples, y i is the observed value, is the t-th model prediction value, and Ω represents the model regularization term.

[0120] In order to demonstrate the model, the qualified tobacco leaf maturity GCF identification model was deployed online (https: / / gcforest-b9f2dykgpfr4bt6bfkkosw.streamlit.app). Figure 7As shown in A, the ROC curve is used to show the recognition effect of the GCF model on different maturity levels. The model has the best prediction effect on under-ripe tobacco leaves, followed by over-ripe tobacco leaves. The Shapley Additive exPlanations (SHAP) interpretation tool was used to analyze the contribution of each variable to the prediction results. It was found that in the identification of under-ripe tobacco leaves, R_mean, H_mean, S_mean, R_correlation and Grey_correlation are the most important. Among them, R_mean, R_correlation and Grey_correlation have a negative effect on under-ripe prediction, while H_mean and S_mean have a positive effect on under-ripe prediction ( Figure 7 B). Different from the under-ripe category, in the identification of ripe tobacco leaves, the increase of G_correlation value has a positive effect on the prediction of ripeness, while H_mean feature has a negative effect on the discrimination of ripeness ( Figure 7 C). The performance of over-ripe and under-ripe features is also different. Among the top 5 features in terms of importance, R_mean, H_mean and S_mean have a negative impact on under-ripe identification, while Grey_correlation and b_std show a positive impact ( Figure 7 D).

[0121] The simulation accuracy of the prediction model is affected by the feature selection of the data set. Adams et al. believed that reasonable feature selection can eliminate noise in the data and improve model performance. The Boruta algorithm is a feature screening algorithm based on the random forest algorithm. The algorithm can screen out variables with strong importance to the target variable from many feature variables, and can obtain the importance arrangement of feature variables to provide the best classification accuracy for the selected feature variables. Lasso is a feature selection method that adds the L1 norm to the objective function. It can select features with strong significance, thereby realizing the dimensionality reduction of high-dimensional data. This study combines the Lasso and Boruta algorithms to screen 54-dimensional image features and mine features that have an important influence on model prediction. It is found that 30 features such as B_correlation, a_mean, L / WRatio, G_correlation, H_mean, R_mean and Roundness are the main factors affecting the prediction of tobacco leaf maturity. The common features of the two algorithms are used as model inputs to reduce the data dimension and improve the model operation efficiency. Color is an important basis for judging the maturity of tobacco leaves. As tobacco leaves mature, chlorophyll in the leaves degrades and the color of tobacco leaves changes from green to yellow. In this study, 20 color features were extracted from tobacco leaf images. It was found that the redness value (R_mean and R_std) in the RGB color space, the red and green channel value a, the yellow and blue channel value b in the Lab color space, and the hue value H and saturation S in the HSV color space were important factors affecting the judgment of tobacco leaf maturity.

[0122] In terms of modeling strategy, the present invention adopts a new decision tree ensemble method GCF, which realizes representation learning through multi-granularity scanning and cascade forest. The former captures information of multiple feature scales by slicing the data at different levels, and the latter gradually improves the prediction ability through multiple random forest layers. When high-dimensional data is input, its representation learning ability can be further enhanced by multi-granularity scanning, which makes GCF have context or structure perception ability. In order to better explain the GCF model, SHAP is used to extract the SHAP value of each maturity category, and the importance and influence of features in different category predictions are clarified. It is found that features such as R_mean, H_mean, S_mean, R_correlation and Grey_correlation play an important role in distinguishing maturity, but their contributions to different maturity categories are different. Among them, S_mean has a positive effect on the identification of under-mature and moderate maturity, and has a significant negative effect on the identification of over-mature categories.

[0123] This study compared the performance of different tobacco leaf maturity prediction models and found that GCF has more comprehensive performance than KNN, RF, SVM, XGBoost and LightGBM models. The model's precision, recall and F1 value are mostly higher than other models. The recognition effect of different maturity categories of middle and upper tobacco leaves is more reliable, and the evaluation index values ​​of different categories are close, indicating that it is feasible to use the GCF algorithm to predict the harvest maturity of flue-cured tobacco leaves.

[0124] In order to improve the performance of the GCF model, the present invention uses the GA algorithm to optimize the hyperparameters of the GCF model. The GA-GCF optimization model improves the prediction performance of tobacco leaf maturity, and performs well in predicting the under-mature, moderately mature, and mature grades of the middle leaves and upper leaves. By comparing and analyzing the evaluation indicators of the KNN, RF, SVM, XGBoost, LightGBM and GCF models, it can be seen that the comprehensive performance of the GCF model is better than other models. In terms of the prediction ability of tobacco leaves in different parts, the prediction effect of GCF and GA-GCF on the maturity of the upper leaves is better than that of the middle leaves. Taking these factors into consideration, GA-GCF is an ideal model for distinguishing the maturity of flue-cured tobacco leaf harvesting strategies. In the future, group intelligent optimization algorithms such as particle swarm optimization, intelligent whale optimization, and intelligent gray wolf optimization will be used to improve these tobacco leaf maturity discrimination models to further verify the prediction ability of the GCF model.

[0125] like Figure 8 As shown, according to another embodiment of the present invention, a tobacco leaf harvest maturity identification system 100 based on the Lasso-Boruta-gcforest algorithm includes:

[0126] An acquisition module 1 is configured to acquire image information of tobacco leaves and maturity category information corresponding to the image information;

[0127] A feature extraction module 2 is configured to extract image feature values ​​corresponding to the mature category information from the image information;

[0128] A feature screening module 3 is configured to perform feature screening on the image feature values ​​to obtain image fusion feature values;

[0129] The maturity prediction module 4 is configured to perform maturity prediction on the image fusion feature value according to a multi-granularity cascade forest optimization model after hyperparameter optimization using a genetic algorithm to obtain a prediction result;

[0130] A model performance evaluation module 5 is configured to perform a model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result;

[0131] The model input data determination module 6 is configured to determine the training set and the test set of the multi-granularity cascade forest optimization model according to the evaluation results.

[0132] Based on the above Figure 5 and Figure 6 The method shown, accordingly, the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the tobacco leaf harvest maturity identification method based on the Lasso-Boruta-gcforest algorithm of any of the above embodiments are implemented.

[0133] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.

[0134] Based on the above Figure 5 and Figure 6 The method shown, and Figure 7 The virtual device embodiment shown, in order to achieve the above-mentioned purpose, the embodiment of the present application also provides a computer device, including a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to implement the steps of the tobacco leaf harvest maturity identification method based on the Lasso-Boruta-gcforest algorithm in any of the above-mentioned embodiments.

[0135] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.

[0136] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0137] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.

[0138] In the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance; the term "plurality" refers to two or more, unless otherwise clearly defined. The terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0139] In the description of the present invention, it is necessary to understand that the directions or positional relationships indicated by terms such as “upper”, “lower”, “left”, “right”, “front” and “back” are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or unit referred to must have a specific direction, be constructed and operated in a specific orientation, and therefore, cannot be understood as a limitation on the present invention.

[0140] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0141] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for identifying tobacco leaf harvest maturity based on the Lasso-Boruta-gcforest algorithm, characterized in that: include: Acquiring image information of tobacco leaves and maturity category information corresponding to the image information; extracting an image feature value corresponding to the mature category information from the image information; Performing feature screening on the image feature values ​​to obtain image fusion feature values; The maturity of the image fusion feature value is predicted according to a multi-granularity cascade forest optimization model after hyperparameter optimization using a genetic algorithm to obtain a prediction result; Performing a model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result; The training set and the test set of the multi-granularity cascade forest optimization model are determined according to the evaluation results.

2. The method for identifying the maturity of tobacco leaves at harvest according to claim 1, characterized in that: Acquiring the image information of tobacco leaves and the maturity category information corresponding to the image information includes: According to the maturity characteristics of the tobacco leaf main veins and leaf surface in the image information, the tobacco leaves are marked as under-mature, moderately mature and over-mature grades, and a total of 6 maturity category information of the middle leaves and upper leaves are obtained.

3. The method for identifying tobacco leaf harvest maturity according to claim 1 or 2, characterized in that: The image feature values ​​include at least morphological features consisting of length Length, width Width, area Area, perimeter Perimeter and roundness Roundness, at least color features consisting of redness value R, greenness value G, blueness value B, brightness value L, red-green channel value a, yellow-blue channel value b, hue value H, saturation S, lightness V and grayscale value Gray, and at least texture features consisting of contrast contrast, dissimilarity dissimilarity homogeneity energy energy, correlation value correlation, angular second-order moment value ASM and entropy value entropy.

4. The method for identifying the maturity of harvested tobacco leaves according to claim 3, characterized in that: Performing feature screening on the image feature value includes: The image feature value is standardized using Z-score, and the expression is: Among them, Z B represents the image feature standard value, Z represents the image feature value, represents the average value of the image feature value, and σ represents the standard deviation; The image feature standard value is initially optimized according to the Lasso linear regression model to obtain the initial fusion feature value of the image, which is expressed as: Where N is the number of samples, p is the number of features, and y i is the target value of the ith observation, x ij is the value of the jth characteristic variable of the ith observation, β j is the coefficient of the jth feature, β0 is the intercept term, and λ is the regularization parameter; The target features are screened out from the initial fusion feature values ​​of the image according to the Boruta algorithm to obtain the image fusion feature values.

5. The method for identifying the maturity of harvested tobacco leaves according to claim 4, characterized in that: The maturity of the image fusion feature value is predicted according to a multi-granularity cascade forest optimization model after hyperparameter optimization using a genetic algorithm, including: Using a sliding window with a width of n and a step length of s to perform sliding sampling on the m-dimensional image fusion feature value to obtain a feature sub-sample; The feature subsamples are trained by random forest and completely random forest classifiers, and each classifier is trained to obtain a w-dimensional category probability vector; After concatenating the category probability vectors, a concatenated feature vector of 2×[(mn) / s+1]×w dimensions can be obtained; The spliced ​​feature vectors are spliced ​​twice level by level in a multi-granularity cascade forest optimization model to obtain the prediction result; Among them, the step size of the sliding window of the multi-granularity cascade forest optimization model after hyperparameter optimization using genetic algorithm is 6, the minimum sample for splitting in the node is 13, the number of random forest classifiers in the cascade layer is 5, and the number of trees in a single random forest is 115.

6. The method for identifying the maturity of harvested tobacco leaves according to claim 5, characterized in that: The preset evaluation indicators include: Accuracy index: Recall metric: Taking into account indicators: Among them, TP represents the samples predicted as positive, FP represents the samples predicted as positive, FN represents the samples predicted as negative, and TN represents the samples predicted as negative.

7. The method for identifying the maturity of harvested tobacco leaves according to claim 6, characterized in that: The ratio of the training set to the test set of the multi-granularity cascade forest optimization model is 8:

2.

8. A tobacco leaf harvest maturity identification system based on Lasso-Boruta-gcforest algorithm, characterized in that: include: An acquisition module is configured to acquire image information of tobacco leaves and maturity category information corresponding to the image information; a feature extraction module, configured to extract image feature values ​​corresponding to the mature category information from the image information; A feature screening module is configured to perform feature screening on the image feature values ​​to obtain image fusion feature values; A maturity prediction module is configured to perform maturity prediction on the image fusion feature value according to a multi-granularity cascade forest optimization model after hyperparameter optimization using a genetic algorithm to obtain a prediction result; A model performance evaluation module is configured to perform model performance evaluation on the prediction result according to a preset evaluation index to obtain an evaluation result; The model input data determination module is configured to determine the training set and the test set of the multi-granularity cascade forest optimization model according to the evaluation results.

9. A readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the steps of the tobacco leaf harvest maturity identification method based on the Lasso-Boruta-gcforest algorithm as described in any one of claims 1 to 7 are implemented.

10. A computer device, characterized in that: It comprises a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to implement the steps of the tobacco leaf harvest maturity identification method based on the Lasso-Boruta-gcforest algorithm as described in any one of claims 1 to 6.

Citation Information

Cited By

  • Multi-modal data fusion and analysis method for tobacco industry

    CN120354341A