Tobacco leaf quality prediction method and readable storage medium

By using the method of fusion model of prior feature weight optimization and CNN-LSTM in tobacco leaf quality prediction, the problem of low prediction accuracy in the prior art is solved, and a higher accuracy and stability of tobacco leaf quality prediction is achieved.

CN120163495APending Publication Date: 2025-06-17HUNAN TOBACCO REDRYING CO LTD CHENZHOU REDRYING FACTORY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510251994.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

The existing tobacco leaf quality prediction technology is difficult to meet the tobacco industry's demand for high-precision and intelligent quality prediction, especially when dealing with complex nonlinear relationships and multi-source heterogeneous data, the prediction accuracy is not high.

Method used

The tobacco leaf quality prediction method based on the prior feature weight optimization and CNN-LSTM fusion model is adopted, and the tobacco leaf quality evaluation results are generated through the steps of data collection and preprocessing, prior feature weight optimization, CNN-LSTM model construction and model evaluation.

Benefits of technology

It significantly improves the accuracy and stability of tobacco leaf quality prediction, can better handle complex data relationships, and provides a quality prediction solution with more practical application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163495A_ABST
    Figure CN120163495A_ABST
Patent Text Reader

Abstract

The invention discloses a tobacco leaf quality prediction method based on prior feature weight optimization and a CNN-LSTM fusion model and a readable storage medium. Comprising steps; the method comprises the following steps: 1, collecting and preprocessing data; step 2, priori feature weight optimization is carried out; step 3, constructing a CNN-LSTM fusion model; 4, evaluating the model; and step 5, generating a quality evaluation result of the to-be-predicted tobacco leaves, inputting historical production data and images of the to-be-predicted tobacco leaves into the trained CNN-LSTM fusion model, and generating the quality evaluation result of the to-be-predicted tobacco leaves. According to the method, efficient processing of multi-dimensional data in the tobacco leaf redrying process is achieved, and the accuracy of tobacco leaf quality prediction and the stability of the model are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the field of tobacco leaf quality prediction, and in particular, to a tobacco leaf quality prediction method and a readable storage medium based on prior feature weight optimization and CNN-LSTM fusion model. Background Art

[0002] The quality of tobacco leaves plays a decisive role in the product quality of the tobacco industry, and it is affected by many complex factors interacting with each other. Traditional tobacco leaf quality prediction methods mainly focus on empirical models based on statistical analysis and simple regression analysis of single-source data.

[0003] Empirical models based on statistical analysis often rely on a large number of field trials and manual experience summaries. For example, by observing the relationship between factors such as fertilizer application amount and climate conditions during the tobacco leaf growth process for a long time, a linear or non-linear regression equation is constructed for prediction. However, this method has obvious limitations. Its fitting ability for complex non-linear relationships is poor, and it is difficult to capture the deep interaction between multiple factors. When faced with massive and multi-source heterogeneous data, such as high-dimensional meteorological data and soil composition data in the planting environment, and multi-parameter data in the processing technology, traditional empirical models cannot fully mine the effective information in the data, resulting in low prediction accuracy.

[0004] With the development of information technology, some machine learning methods have been applied to tobacco leaf quality prediction. For example, a prediction model is constructed using the decision tree algorithm, and the quality of tobacco leaves is predicted by layer-by-layer division of data features. However, decision trees are prone to overfitting, especially when dealing with large-scale and complex data, and their generalization ability is weak. Neural networks have also been tried in this field, but early neural network structures were simple, with deficiencies in feature extraction and spatio-temporal information fusion, and their advantages were not fully utilized.

[0005] In addition, in terms of data processing, previous studies have mostly not paid attention to the reasonable allocation of feature weights. Features from different sources and with different degrees of importance are often treated equally, masking the role of some key features, while irrelevant or redundant features may interfere with the prediction effect of the model. Moreover, in model construction, most have not effectively integrated spatial features and time series features, and cannot comprehensively reflect the impact of the dynamic changes in the planting environment and processing technology on the formation of tobacco leaf quality during the formation process. To sum up, the existing tobacco leaf quality prediction technologies are difficult to meet the needs of the tobacco industry for high-precision and intelligent quality prediction, and there is an urgent need for a new and more effective prediction method. Summary of the Invention

[0006] In view of the above-mentioned defects of the prior art, the technical problems to be solved by the present invention include:

[0007] How to design a tobacco leaf quality prediction method to overcome the above technical problems.

[0008] To achieve the above object, the present invention provides a tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model, including the steps;

[0009] Step 1: Data collection and preprocessing;

[0010] Step 2: Perform prior feature weight optimization;

[0011] Step 3: Construct a CNN-LSTM fusion model;

[0012] Step 4: Evaluate the model;

[0013] Step 5: Generate the quality evaluation result of the tobacco leaf to be predicted. Input the historical production data and images of the tobacco leaf to be predicted into the trained CNN-LSTM fusion model to generate the quality evaluation result of the tobacco leaf to be predicted.

[0014] Further, in step 1, the images of tobacco leaves after threshing, the parameters during the re-drying process, and the data of tobacco leaf quality indicators are collected through sensors. The process parameter data and image data are preprocessed respectively, and then the two types of processed data are aligned and fused according to the time stamp to construct a multi-source data matrix.

[0015] Further, in step 2, the Pearson correlation coefficient is used to calculate the correlation coefficient between each feature and the tobacco leaf quality indicator, and the random forest algorithm is used to evaluate the importance. The two are weighted and fused to obtain a comprehensive feature importance evaluation value. According to the distribution of the feature importance evaluation value, a dynamic threshold is set, and the threshold is dynamically adjusted according to the feature performance after each model training iteration and the weight is optimized to construct a feature priority matrix.

[0016] Further, in step 3, a CNN-LSTM fusion model is constructed. CNN is used to extract spatial features, and LSTM is used to learn temporal features. The output of CNN and the time series data are used as the input of LSTM.

[0017] Further, in step 4, the root mean square error RMSE, the mean absolute error MAE, and the determination coefficient R 2 index are used to analyze the index judgment performance. If not satisfied, adjust the parameters until the model performance meets the requirements.

[0018] Further, step 1 is specifically as follows,

[0019] First, complete the parameter collection of the tobacco leaf images after threshing, the re-drying process, and the data collection of the tobacco leaf quality indicators. After the tobacco leaf threshing process, collect multi-perspective and multi-region tobacco leaf images, including the front and back of the tobacco leaves and images of different parts, to comprehensively reflect the appearance characteristics of the tobacco leaves; in the re-drying process, collect the process data of the tobacco leaf processing and the historical quality evaluation data;

[0020] Secondly, preprocess the collected parameter data, indicator data, and image data respectively, including:

[0021] Preprocessing of data: Clean the sensor data collected, remove outliers and incorrect data, and then perform normalization processing on the cleaned data. Use the linear normalization formula to map data with different physical dimensions to the [0, 1] interval;

[0022] Preprocessing of image data: Use functions in the OpenCV library to perform grayscale conversion, filtering, segmentation, and feature extraction operations. Among them, the median filter uses a 3×3 filter window, the Otsu threshold method is used for image segmentation, and the segmentation result is optimized through morphological operations. The erosion and dilation kernel sizes are 3×3 pixels. Finally, extract the leaf features, including calculating the midrib ratio, area, perimeter, and shape factor of the leaf;

[0023] Finally, align and fuse the two types of processed data according to the timestamp to construct a multi-source data matrix.

[0024] Furthermore, the specific content of step 2 is as follows:

[0025] Perform prior feature weight optimization. First, evaluate the importance of features, calculate the correlation coefficient between each feature and the tobacco leaf quality indicators using the Pearson correlation coefficient, and analyze the strength of the linear relationship between the features and the quality indicators; for feature X and quality indicator Y, with n samples, the Pearson correlation coefficient expression:

[0026]

[0027] where x i and y i are the i-th sample values of feature X and quality indicator Y respectively, and are the sample means of feature X and quality indicator Y respectively;

[0028] Use the random forest algorithm to construct a decision tree model, determine its importance score by calculating the contribution degree of the feature to the reduction of node impurity during the construction of the decision tree, and fuse the two weighted to obtain a comprehensive feature importance evaluation value. Among them, the comprehensive importance evaluation value expression:

[0029] I = w1 × r xy+w2×score rf

[0030] where r xy is the correlation coefficient and score rf is the importance score of the random forest.

[0031] Furthermore, step 3 is specifically as follows:

[0032] Build the CNN model part. Based on the optimized feature data as input, construct a convolutional neural network to extract the spatial features in the fusion data. First, the input layer receives the fusion feature data optimized by the prior feature weights, and sets multiple convolutional layers to keep the data size consistent. After each convolutional layer, a batch normalization layer is connected to accelerate the training convergence speed of the model and improve the stability of the model. Then, connect a ReLU activation function layer to introduce non-linearity. Immediately following each convolutional layer is a pooling layer to reduce the dimension of the feature map output by the convolutional layer. Finally, the output of the CNN is used as the input part of the subsequent LSTM network;

[0033] Build a three-layer LSTM network. The first layer extracts short-term dependence features, the second layer captures long-term trends, and the third layer integrates data for output; the three-layer LSTM parallel network processes the input data, and a Dropout layer is added between each layer to randomly discard some neurons; perform a linear transformation on the output of each LSTM layer and use the ReLU activation function to increase non-linear features; add a fully connected layer after the LSTM layer to map the output of the LSTM layer to the target value and perform weighted averaging to obtain the final fusion output;

[0034] Fuse the CNN and LSTM models. The output of the CNN is used as one of the inputs of the LSTM to jointly learn the spatio-temporal features of the data. During the training process, adopt the Adam optimization algorithm's adaptive learning rate adjustment strategy, use the mean square error as the loss function, calculate the gradient through the backpropagation algorithm and update the weight parameters of the model. At the same time, to prevent overfitting, adopt the L2 regularization method.

[0035] Furthermore, step 4 is specifically as follows: Evaluate the model, use the test set data to evaluate the trained model, and calculate the root mean square error RMSE, mean absolute error MAE, and determination coefficient R 2 indexes to analyze the performance of the indexes for judgment. If not satisfied, adjust the parameters or the structure and retrain.

[0036] A computer-readable storage medium stores program codes therein, and the program codes can be called by a processor to execute the method as described above.

[0037] Compared with the prior art solution, the technical effect of the present invention lies in:

[0038] In view of the insufficient utilization of existing technology data and the low model accuracy, a large amount of data has been accumulated in tobacco leaf production. However, the existing technology fails to fully explore the potential value therein and cannot accurately describe the complex relationships among multiple factors in the tobacco leaf threshing and redrying process, resulting in limited accuracy of the prediction model and difficulty in meeting the requirements of the modern tobacco industry for precise control of high-quality tobacco leaf production. The present invention adopts a CNN-LSTM fusion model architecture to achieve the complementary advantages of CNN and LSTM, deeply excavate the spatio-temporal features in the data related to tobacco leaf quality, and demonstrate significant advantages in terms of prediction accuracy and stability. Compared with a single-layer LSTM model or a traditional model based on statistical analysis, it can better handle the complex data relationships in tobacco leaf quality prediction and provide a more practical quality prediction solution.

[0039] Regarding the unreasonable setting of feature weights in the existing technology, traditional feature selection methods rely on fixed thresholds and cannot adapt to the dynamic change characteristics of data in the tobacco leaf quality prediction scenario. They are prone to ignoring latent features with low frequency but potentially key impacts, thereby affecting the model's ability to capture key features and reducing the prediction accuracy and reliability of the model. The present invention adopts a dynamic threshold adjustment and weight optimization mechanism to improve the model learning efficiency, enabling it to converge faster to a better parameter configuration. It accurately highlights key features and reduces the interference of redundant features, significantly improving the prediction accuracy and more accurately predicting the quality of tobacco leaves. It enhances the model's adaptability to changes in different environments and data distributions and maintains good performance in the complex and changeable tobacco leaf production environment.

[0040] Regarding the difficulty of data fusion in the existing technology, tobacco leaf production involves multi-source data, such as process parameter data and image data, etc. There are differences in the acquisition frequencies, formats, etc. of each data source. The existing technology lacks effective data fusion methods and it is difficult to integrate these multi-source heterogeneous data into a unified format suitable for model training, affecting the model's utilization of comprehensive information. The present invention adopts a multi-source data fusion method of constructing a multi-modal data matrix to fully utilize the information from different data sources, enrich the model input data, enable the model to more comprehensively consider the impacts of various factors on tobacco leaf quality, improve the accuracy of the model's prediction of tobacco leaf quality, and reduce the prediction deviation caused by insufficient information from a single data source. It provides a more complete and reliable data basis for subsequent model training and analysis, and helps to explore deeper relationships and laws in the data.

[0041] In view of the single feature importance assessment in the prior art, in the past, when evaluating the importance of features on tobacco leaf quality, a single assessment method was mostly used, such as only based on correlation analysis or simple statistical indicators, which failed to fully consider the comprehensive impact of features on tobacco leaf quality at different levels (such as linear relationships, contributions to model classification or regression accuracy, etc.), resulting in inaccurate and incomplete feature importance assessment. The comprehensive feature importance assessment method of the present invention evaluates feature importance more comprehensively and accurately, avoiding the limitations of a single assessment method. It provides a reasonable basis for feature screening and weight allocation, so that more attention is paid to important features during model training, further improving model training efficiency and prediction accuracy. It helps to identify features that may be overlooked in traditional methods but have an important impact on tobacco leaf quality, and optimize model construction and performance.

[0042] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following describes several preferred embodiments of the present invention with reference to the drawings in the specification, so that the technical content is clearer and easier to understand. The present invention can be embodied in many different forms of embodiments, and the protection scope of the present invention is not limited to the embodiments mentioned in the text.

[0045] This embodiment proposes a tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model, which mines hidden features that are difficult to identify in traditional methods but have key influences, thereby improving the prediction accuracy and stability of the model. By introducing the CNN-LSTM fusion model structure, the spatiotemporal characteristics of the data can be effectively extracted. CNN extracts spatial features, such as texture, shape and color features in tobacco leaf images, and local feature relationships in the data; LSTM learns temporal features, such as the impact of changes in environmental and management data over time on tobacco leaf quality. The combination of the two enables the model to better understand the complex process of tobacco leaf quality formation and further improve the prediction accuracy. This method provides a more scientific and flexible decision support tool for tobacco leaf quality control, and provides a theoretical basis for intelligent management and quality optimization in the tobacco industry.

[0046] like Figure 1 As shown, the method of this embodiment includes the following steps:

[0047] Step 1: Data collection and preprocessing. Collect data on the images of tobacco leaves after threshing, the parameters during the re-drying process, and the tobacco leaf quality indicators through sensors. Preprocess the process parameter data and image data separately, and then align and fuse the two types of processed data according to the timestamp to construct a multi-source data matrix;

[0048] Step 2: Optimize the prior feature weights. Calculate the correlation coefficients between each feature and the tobacco leaf quality indicators using the Pearson correlation coefficient, evaluate the importance using the random forest algorithm, and fuse the two by weighting to obtain a comprehensive feature importance evaluation value. Set a dynamic threshold according to the distribution of the feature importance evaluation values, and dynamically adjust the threshold and optimize the weights according to the feature performance after each model training iteration to construct a feature priority matrix;

[0049] Step 3: Construct a CNN-LSTM fusion model. Construct a CNN-LSTM fusion model, where CNN is used to extract spatial features and LSTM is used to learn temporal features. The output of CNN and the time series data are used as the input of LSTM.

[0050] Step 4: Evaluate the model. Calculate the root mean square error RMSE, mean absolute error MAE, and determination coefficient R 2 indexes to analyze the performance of the index judgment. If not satisfied, adjust the parameters until the model performance meets the requirements;

[0051] Input the historical production data and images of the tobacco leaves to be predicted into the trained CNN-LSTM fusion model to generate the quality evaluation results of the tobacco leaves to be predicted.

[0052] Through the above steps, a trained CNN-LSTM network model is finally generated. In practical applications, input the historical data of the tobacco leaves to be predicted into the trained model, combined with the corresponding environmental data, to obtain accurate quality prediction results, so as to provide a scientific basis for quality control and process optimization in the tobacco leaf production process.

[0053] The following is a specific description of each step.

[0054] In Step 1 of this embodiment, first complete the data collection of the images of tobacco leaves after threshing, the parameters during the re-drying process, and the tobacco leaf quality indicators. After the tobacco leaf threshing process, collect multi-view and multi-region tobacco leaf images, including the front, back, and images of different parts of the tobacco leaves, to comprehensively reflect the appearance characteristics of the tobacco leaves; in the re-drying process, collect the process data of tobacco leaf processing and historical quality evaluation data;

[0055] Secondly, preprocess the collected parameter data, index data, and image data respectively, including:

[0056] Preprocessing of data: Clean the sensor data collected, remove outliers and incorrect data, and then perform normalization on the cleaned data. Use the linear normalization formula to map data with different physical dimensions to the interval [0, 1] for subsequent data fusion and analysis.

[0057] Preprocessing of image data: Use functions in the OpenCV library for grayscaling, filtering, segmentation, and feature extraction operations. Among them, median filtering uses a 3×3 filtering window, the Otsu threshold method is used for image segmentation, and the segmentation result is optimized through morphological operations. The erosion and dilation kernel sizes are 3×3 pixels. Finally, extract leaf features including calculating the midrib ratio, area, perimeter, and shape factor of the leaf, etc.

[0058] Finally, align and fuse the two types of processed data according to the timestamp to construct a multi-source data matrix.

[0059] In step 1, the specific method of fusing the environmental data and operation data in the tobacco leaf re-drying process is as follows:

[0060] (1) Timestamp alignment

[0061] When collecting data, accurately record the collection time, and then establish a unified time index system. The timestamp can be used as the index key to construct a database table to store data, so that the corresponding sensor data and image data can be quickly found according to the time later. Since the collection frequencies of parameter data, index data, and image data are different, precise alignment is required, and interpolation methods can be used;

[0062] (2) Data fusion

[0063] Adopt the method of constructing a multi-modal data matrix to construct a multi-source data matrix X, and its expression is as follows:

[0064]

[0065] Using the timestamp as the index, take the data such as temperature, humidity, steam flow rate, mesh belt speed, and leaf features collected at the same moment as column elements to form the data matrix X. Each row of the matrix can represent the multi-dimensional feature data of a timestamp. \(T\) represents the temperature at the \(i\)-th sampling time point, \(H\) represents the humidity at the \(i\)-th sampling time point, \(S\) represents the steam flow rate at the \(i\)-th sampling time point, \(V\) represents the mesh belt speed at the \(i\)-th sampling time point, \(R\) represents the midrib ratio of the leaf, \(A\) represents the leaf area, \(P\) represents the leaf perimeter, \(F\) represents the shape factor; \(T_{i}\) seq,i The time series data of the \(i\)-th time point.

[0066] In step 2 of this embodiment, prior feature weight optimization is performed. First, the importance of features is evaluated. The Pearson correlation coefficient is used to calculate the correlation coefficient between each feature and the tobacco leaf quality index, and the strength of the linear relationship between the feature and the quality index is analyzed. For feature X and quality index Y, with a sample size of n, the expression of the Pearson correlation coefficient is:

[0067]

[0068] where x i and y i are the i-th sample values of feature X and quality index Y respectively, and are the sample means of feature X and quality index Y respectively.

[0069] The decision tree model is constructed using the random forest algorithm. The importance score of a feature is determined by calculating its contribution to reducing the node impurity during the construction of the decision tree. The two are weighted and fused to obtain a comprehensive feature importance evaluation value. The expression of the comprehensive importance evaluation value is:

[0070] I = w1 × r xy + w2 × score rf

[0071] where r xy is the correlation coefficient and score rf is the importance score of the random forest.

[0072] Therefore, in step 2, a dynamic threshold is set according to the distribution of the feature importance evaluation values. The calculation process of the dynamic threshold includes:

[0073] First, calculate statistical quantities such as the mean μ weighted , standard deviation σ weighted , upper threshold, and lower threshold of the feature importance evaluation values.

[0074] The weighted mean formula:

[0075] The standard deviation formula:

[0076] where x i is the historical value of the feature, w i is the weight of each element, and N is the number of samples. The dynamic threshold is set according to the weighted mean and standard deviation.

[0077] The upper threshold is Threshold upper = μ weighted + k·σ weighted

[0078] The lower threshold is Thresholdlower = μ weighted - k·σ weighted ,

[0079] μ weighted and σ weighted are the mean and standard deviation within the current window, and is an adjustment factor whose value can be determined based on prior knowledge and is used to control the sensitivity. Features above the threshold are determined as dominant features, and those below the lower threshold are recessive features;

[0080] Finally, after each model training iteration, the threshold is dynamically adjusted according to the performance of the feature in the current model:

[0081] new_threshold = α·current_threshold+(1 - α)·new_value

[0082] where is the smoothing parameter, ranging from [0, 1], and is used to balance the current threshold and the newly calculated value.

[0083] Furthermore, in the process of dynamic adjustment of weights, first calculate the actual contribution of the feature in the model. If the contribution of the feature is greater than expected, appropriately increase its threshold range to increase the probability of this feature in subsequent feature selection; conversely, if the feature contribution is small, reduce its threshold range, and it may even be filtered out; at the same time, re-evaluate the importance of the feature according to the new threshold and adjust the feature weights.

[0084] According to the results of feature importance evaluation and dynamic threshold screening, construct a feature priority matrix such as Y:

[0085]

[0086] where N in the first column represents a certain feature, such as temperature, leaf midrib rate, steam flow, humidity, etc., and the second column is the priority ranking. Features that show higher importance and contribution in multiple iterations are ranked in the front of the matrix, while some features with smaller contributions and lower importance in the model are ranked at the end of the matrix.

[0087] In step 3 of this embodiment, constructing and training a CNN - LSTM model includes:

[0088] For the part of building the CNN model, based on the optimized feature data as the input, a convolutional neural network is constructed to extract the spatial features in the fusion data. First, the input layer receives the fusion feature data optimized by the prior feature weights. Multiple convolutional layers are set to maintain the consistency of the data size. After each convolutional layer, a batch normalization layer is connected to accelerate the convergence speed of model training and improve the stability of the model. Then, a ReLU activation function layer is connected to introduce non-linear factors. A pooling layer follows immediately after each convolutional layer to reduce the dimension of the feature map output by the convolutional layer. Finally, the output of the CNN is used as the input part of the subsequent LSTM network.

[0089] Build a three-layer LSTM network. The first layer extracts short-term dependence features, the second layer captures long-term trends, and the third layer integrates data for output. The three-layer LSTM parallel network processes the input data. Dropout layers can be added between each layer to randomly discard some neurons to prevent overfitting and improve the generalization ability of the model. A linear transformation is performed on the output of each LSTM layer, and the ReLU activation function is used to increase non-linear features. A fully connected layer is added after the LSTM layer to map the output of the LSTM layer to the target value, and a weighted average is performed to obtain the final fusion output.

[0090] Fuse the CNN and LSTM models. The output of the CNN is used as one of the inputs of the LSTM to jointly learn the spatio-temporal features of the data. During the training process, the Adam optimization algorithm's adaptive learning rate adjustment strategy is adopted. The mean squared error (MSE) is used as the loss function, and the gradient is calculated through the backpropagation algorithm to update the weight parameters of the model. At the same time, to prevent overfitting, the L2 regularization method is adopted.

[0091] In step 4 of this embodiment, the model is evaluated. The trained model is evaluated using the test set data, and the root mean square error RMSE, mean absolute error MAE, and determination coefficient R 2 metrics are calculated to analyze the performance of the index judgment. If not satisfied, the parameters or structure are adjusted and retrained.

[0092] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program is stored. This program can be executed by a microprocessor to automatically complete the data processing, feature optimization, and CNN-LSTM model training and prediction processes.

[0093] The present invention proposes a tobacco leaf quality prediction method based on the optimization of prior feature weights and the combination of CNN-LSTM. For the key parameters in the tobacco leaf re-drying process, by analyzing the process characteristics and data distribution rules, important features are determined and initial weights are assigned to them. The local spatial features of the input data are extracted by CNN, and the time series dependence information is mined in combination with LSTM, so as to establish a prediction model. The initial feature weights are dynamically adjusted through an optimization algorithm, enabling the model to adaptively highlight the importance of key features. This method realizes the efficient processing of multi-dimensional data in the tobacco leaf re-drying process, and significantly improves the accuracy of tobacco leaf quality prediction and the stability of the model.

[0094] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1 a process or multiple processes and / or blocks Figure 1 a device for the functions specified in a block or multiple blocks.

[0095] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements in the process Figure 1 a process or multiple processes and / or blocks Figure 1 a device for the functions specified in a block or multiple blocks.

[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, so that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in a process Figure 1 a process or multiple processes and / or blocks Figure 1 a device for the functions specified in a block or multiple blocks.

[0097] In the above-mentioned specific embodiments, the purpose, technical solutions, and beneficial effects of the present invention are further described in detail. It should be understood that the above-mentioned are only specific embodiments of the present invention, and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.

Claims

1. A tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model, characterized in that: Includes steps: Step 1: Data collection and preprocessing; Step 2: Optimize the prior feature weights; Step 3: CNN-LSTM fusion model construction; Step 4: Model evaluation; Step 5: Generate the quality assessment results of the tobacco leaves to be predicted. Input the historical production data and images of the tobacco leaves to be predicted into the trained CNN-LSTM fusion model to generate the quality assessment results of the tobacco leaves to be predicted.

2. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 1, characterized in that: The step 1 is to collect images of tobacco leaves after threshing, parameters of the re-roasting process, and data on tobacco leaf quality indicators through sensors, pre-process the process parameter data and image data respectively, and then align and fuse the two types of processed data according to timestamps to construct a multi-source data matrix.

3. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 1 is characterized in that: The step 2 is to use the Pearson correlation coefficient to calculate the correlation coefficient between each feature and the tobacco leaf quality index, use the random forest algorithm to evaluate the importance, weightedly fuse the two to obtain a comprehensive feature importance evaluation value, set a dynamic threshold according to the distribution of the feature importance evaluation value, dynamically adjust the threshold and optimize the weight according to the feature performance after each model training iteration, and construct a feature priority matrix.

4. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 1 is characterized in that: The step 3 is to construct a fusion model of CNN-LSTM, where CNN is used to extract spatial features, and LSTM is used to learn temporal features, and the output of CNN and time series data are used as LSTM inputs.

5. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 1 is characterized in that: The step 4 is to calculate the root mean square error RMSE, the mean absolute error MAE and the determination coefficient R 2 Indicators are used to analyze indicators and judge performance. If they are not satisfied, the parameters are adjusted until the model performance meets the requirements.

6. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 2 is characterized in that: The step 1 specifically comprises: First, complete the data collection of tobacco leaf images after threshing, parameters of the redrying process, and tobacco leaf quality indicators. After the tobacco leaf threshing process, multi-angle and multi-region tobacco leaf images are collected, including the front, back, and different parts of the tobacco leaves, to fully reflect the appearance characteristics of the tobacco leaves; In the redrying process, collect tobacco leaf processing data, process data and historical quality assessment data; Secondly, the collected parameter data, index data and image data are preprocessed respectively, including: Data preprocessing: Clean the collected sensor data to remove outliers and erroneous data, and then normalize the cleaned data. Use the linear normalization formula to map data of different physical dimensions to the [0,1] interval. Preprocessing of image data: Use functions in the OpenCV library to perform grayscale, filtering, segmentation, and feature extraction operations. The median filter uses a 3×3 filter window, and the Otsu threshold method is used for image segmentation. The segmentation results are optimized through morphological operations. The erosion and expansion kernel size is 3×3 pixels. Finally, the leaf features are extracted, including the calculation of the leaf rate, area, perimeter, and shape factor. Finally, the two types of processed data are aligned and fused according to timestamps to construct a multi-source data matrix.

7. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 3 is characterized in that: The step 2 is specifically as follows: To optimize the prior feature weights, first evaluate the importance of the features, use the Pearson correlation coefficient to calculate the correlation coefficient between each feature and the tobacco leaf quality index, and analyze the linear relationship strength between the features and the quality index; for feature X and quality index Y, the sample is n, and the Pearson correlation coefficient expression is: where x i and i are the i-th sample values ​​of feature X and quality indicator Y, respectively. and are the sample means of feature X and quality indicator Y respectively; The decision tree model is constructed using the random forest algorithm. The importance score is determined by calculating the contribution of the feature to the reduction of node impurity during the decision tree construction process. The two are weighted and fused to obtain a comprehensive feature importance evaluation value, where the comprehensive importance evaluation value expression is: I=w1×r xy +w2×score rf where r xy is the correlation coefficient, score rf Importance score for random forest.

8. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 4 is characterized in that: The step 3 is specifically as follows: In the CNN model part, based on the optimized feature data as input, a convolutional neural network is constructed to extract spatial features from the fused data. First, the input layer receives the fused feature data after the prior feature weight optimization, and multiple convolutional layers are set to maintain the consistency of data size. A batch normalization layer is connected after each convolutional layer to accelerate the convergence speed of model training and improve the stability of the model; then a ReLU activation function layer is connected to introduce nonlinear factors; A pooling layer is placed after each convolutional layer to reduce the dimension of the feature map output by the convolutional layer, and finally the output of CNN is used as the input of the subsequent LSTM network. A three-layer LSTM network is built. The first layer extracts short-term dependency features, the second layer captures long-term trends, and the third layer integrates data for output. The three-layer LSTM parallel network processes input data, and a Dropout layer is added between each layer to randomly discard some neurons. The output of each LSTM layer is linearly transformed, and the ReLU activation function is used to increase nonlinear features. Add a fully connected layer after the LSTM layer to map the output of the LSTM layer to the target value and perform weighted averaging to obtain the final fusion output; The CNN and LSTM models are integrated, and the output of CNN is used as one of the inputs of LSTM to jointly learn the spatiotemporal characteristics of the data. During the training process, the Adam optimization algorithm is used to adaptively adjust the learning rate. The mean square error is used as the loss function. The back propagation algorithm is used to calculate the gradient and update the weight parameters of the model. At the same time, the L2 regularization method is used to prevent overfitting.

9. The tobacco leaf quality prediction method based on prior feature weight optimization and CNN-LSTM fusion model according to claim 5, characterized in that: Specifically, step 4 is to evaluate the model, use the test set data to evaluate the trained model, and calculate the root mean square error RMSE, mean absolute error MAE and determination coefficient R 2 Indicators are used to analyze the indicators and judge the performance. If they are not satisfied, the parameters are adjusted or the structure is retrained.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Process parameter prediction control method and system in tobacco leaf feeding process, medium and terminal

    CN120802644A

  • Tobacco leaf quality multi-dimensional intelligent evaluation and prediction system fused with large model

    CN121681655A

  • A multi-dimensional intelligent evaluation and prediction system for tobacco quality based on a large model fusion

    CN121681655B

  • Machining process optimization control method for supporting shaft of drive axle of mining truck

    CN121900305A