Online moisture detection method and device based on model prediction
Through the online moisture detection method and device based on model prediction, the moisture prediction model is constructed using the autocorrelation mechanism and feedforward network, the problems of unstable drying effect and high energy consumption under the traditional control method are solved, efficient and accurate prediction of the moisture content of tobacco silk is achieved, and the quality and production efficiency of silk making are improved.
Patent Information
- Application Number
- CN202411893837.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-15
AI Technical Summary
The traditional wire dryer control method relies on manual experience and simple PID control, making it difficult to adapt to the frequent changes in the variety of tobacco varieties and process parameters, resulting in unstable drying effect, high energy consumption, and difficult to ensure product quality.
The online moisture detection method and device based on model prediction is adopted to obtain the historical data of tobacco wire, build a historical data set, build a moisture prediction model based on the autocorrelation mechanism and feedforward network, and perform model training to achieve real-time prediction of the moisture value of tobacco wire.
It improves the accuracy and stability of tobacco moisture prediction, reduces manual intervention, reduces energy consumption, improves the quality of wire making, and promotes the intelligent and green development of the tobacco industry.
Smart Images

Figure CN119829911A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of online moisture detection of cut tobacco, and in particular to an online moisture detection method and device based on model prediction. Background Art
[0002] The tobacco drying machine is a key equipment in cigarette production. Its main function is to dry the tobacco to the target moisture content to ensure the quality and production efficiency of cigarettes. During the drying process of the tobacco drying machine, the moisture value of the tobacco is an important indicator to measure the drying effect, which directly affects the physical and chemical properties and processing performance of the tobacco. The traditional tobacco drying machine control method mainly relies on manual experience and simple PID control, which is difficult to adapt to the frequent changes in tobacco varieties and process parameters, resulting in unstable drying effect, high energy consumption, and difficult to ensure product quality.
[0003] As modern industry's requirements for precise control and energy saving and consumption reduction continue to increase, data-driven forecasting models have gradually become a hot topic of research. However, existing time series forecasting methods often face challenges such as insufficient accuracy, insufficient capture of long-term dependencies, and limited generalization capabilities when processing complex industrial data.
[0004] In view of this, the inventor, based on many years of production design experience in this field and related fields, has designed an online moisture detection method and device based on model prediction after repeated experiments, in order to solve the problems existing in the prior art. Summary of the invention
[0005] The object of the present invention is to provide an online moisture detection method and device based on model prediction, which can predict the moisture value of cut tobacco in the drying process of a cut tobacco drying machine in real time.
[0006] In order to achieve the above-mentioned object of the invention, the present invention proposes an online moisture detection method and device based on model prediction, wherein the online moisture detection method comprises:
[0007] Acquire historical data of tobacco at n moments in the process of making tobacco, wherein the historical data includes process variables and moisture values of tobacco at corresponding moments;
[0008] Constructing a historical data set based on the historical data at n moments;
[0009] A moisture prediction model is constructed based on a time series prediction model of an autocorrelation mechanism, wherein the moisture prediction model encodes and decodes an input sequence through an autocorrelation mechanism and a feedforward network;
[0010] Training the moisture prediction model using the historical data set;
[0011] The trained moisture prediction model is used to perform online moisture detection on shredded tobacco.
[0012] The present invention also proposes an online moisture detection device based on model prediction, wherein the online moisture detection device comprises:
[0013] A data acquisition module is used to collect multiple process variable data of tobacco in the drying process of the tobacco drying machine in real time;
[0014] Data processing module, used for preprocessing multiple process variable data, including data cleaning, exception processing, noise processing and data standardization;
[0015] Feature selection and extraction module, which performs feature selection and feature extraction on multiple process variable data;
[0016] The moisture prediction module receives multiple pre-processed process variable data and combines the self-attention mechanism and feed-forward network to detect the moisture content of tobacco;
[0017] The output module is used to output the moisture detection results of the tobacco in real time.
[0018] The present invention also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the steps of the above method when executed by a processor.
[0019] The present invention further provides a computer device, comprising a memory and a processor, wherein a computer program that can be run on the processor is stored in the memory, wherein the steps of the above method are implemented when the processor executes the computer program.
[0020] Compared with the prior art, the present invention has the following characteristics and advantages:
[0021] The present invention proposes an online moisture detection method and device based on model prediction, which constructs a new time series prediction model Autoformer by introducing an autocorrelation mechanism and a sequence decomposition block. Its autocorrelation mechanism is based on the periodic calculation dependency of the time series, which effectively improves the periodic modeling capability and replaces the traditional self-attention mechanism. At the same time, the sequence decomposition block decomposes the input sequence into trend terms and seasonal terms, and models them separately, further improving the prediction accuracy. Autoformer extracts features through the encoder, and the decoder combines the autocorrelation mechanism and the sequence decomposition results to efficiently predict future values, which is particularly suitable for the prediction of tobacco moisture with complex periodicity.
[0022] The present invention proposes an online moisture detection method and device based on model prediction, which can solve the problems of high labor intensity and low efficiency of manual calibration in the prior art. Through automatic zeroing or calibration operation, manual intervention is reduced, the automation level is improved, and the risk caused by manual operation errors is reduced.
[0023] The present invention proposes an online moisture detection method and device based on model prediction. The process variables of the moisture value of tobacco at the corresponding moment include the moisture of the inlet material, the outlet temperature, the actual value of the cylinder wall temperature, the steam pressure, the opening of the steam valve, the hot air steam flow, the opening of the dehumidification damper, the dehumidification negative pressure, the actual value of the outlet material temperature, and the moisture content. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings described herein are only for explanation purposes and are not intended to limit the scope of the present invention in any way. In addition, the shapes and proportional dimensions of the various components in the figures are only schematic, used to help understand the present invention, and are not specifically limited to the shapes and proportional dimensions of the various components of the present invention. Those skilled in the art can select various possible shapes and proportional dimensions to implement the present invention according to the teachings of the present invention.
[0025] Figure 1 It is a schematic flow chart of the online moisture detection method based on model prediction of the present invention. DETAILED DESCRIPTION
[0026] The details of the present invention can be more clearly understood with reference to the accompanying drawings and the description of the specific embodiments of the present invention. However, the specific embodiments of the present invention described herein are only used for the purpose of explaining the present invention and cannot be understood as limiting the present invention in any way. Under the guidance of the present invention, technicians can conceive of any possible variations based on the present invention, which should all be considered to belong to the scope of the present invention.
[0027] The present invention proposes an online moisture detection method and device based on model prediction, wherein the online moisture detection method comprises:
[0028] Acquire historical data of tobacco at n moments in the process of making tobacco, wherein the historical data includes process variables and moisture values of tobacco at corresponding moments;
[0029] Constructing a historical data set based on the historical data at n moments;
[0030] A moisture prediction model is constructed based on a time series prediction model of an autocorrelation mechanism, wherein the moisture prediction model encodes and decodes an input sequence through an autocorrelation mechanism and a feedforward network;
[0031] Training the moisture prediction model using the historical data set;
[0032] The trained moisture prediction model is used to perform online moisture detection on shredded tobacco.
[0033] The present invention proposes an online moisture detection method and device based on model prediction, which realizes efficient and accurate prediction of the moisture value of cut tobacco in the cigarette making process through feature selection and extraction, combined with the self-attention mechanism and the time series prediction model of the feedforward network, thereby optimizing the intelligent control of the cut tobacco drying machine or the cutter, improving the cut tobacco quality, reducing energy consumption, and promoting the development of the tobacco industry towards intelligence and greenness.
[0034] The online moisture detection method and device based on model prediction proposed in the present invention are arranged on the output device of a shredder or a shredder, and perform online moisture detection on the shredded tobacco output by the shredder or the shredder, so as to obtain the moisture data of the shredded tobacco in real time and quickly. According to the detected moisture data, not only can the shredder or the shredder be quickly and intelligently controlled, but also data support can be provided for subsequent process steps, thereby improving the quality of cigarette production.
[0035] The online moisture detection method based on model prediction proposed in the present invention can also be arranged in other devices that need to detect the moisture content of shredded tobacco to achieve online detection of the moisture content of shredded tobacco.
[0036] In an optional embodiment of the present invention, the online moisture detection method further includes preprocessing the historical data of cut tobacco. By preprocessing the historical data of cut tobacco to standardize the data, noise and outliers in the data can be removed, the model's ability to identify key features is enhanced, the reliability of the prediction results is improved, the model can treat each feature more fairly, the convergence speed of the model is accelerated, and the comparability between different features is improved.
[0037] Specifically, preprocess the historical data of tobacco and collect historical data in the process of cigarette making, including process variables and the moisture value of tobacco at the corresponding time. Select appropriate data preprocessing methods to clean and feature engineer the data. The data collection process is as follows: suppose the tobacco making system has m process variables and 1 tobacco moisture value, with a total of n historical data at a time. Organize the data into matrix X and vector y: Data collection: Extract relevant process variables and tobacco moisture values at the corresponding time from the database or historical data file of the tobacco making system. Ensure that the timestamps of the data are aligned and check the integrity of the data.
[0038] $X=[x_1,x_2,...,x_n]^T$,
[0039] In an optional example of this implementation, preprocessing includes data cleaning, exception processing, noise processing and data standardization. The preprocessing step strictly cleans and standardizes the historical data of cut tobacco, which can significantly improve the efficiency of model training and the accuracy of prediction, and can more accurately capture the changing law of the moisture value of cut tobacco and improve the reliability of moisture prediction.
[0040] Data cleaning:
[0041] Missing value processing: For missing values, linear interpolation formula can be used to estimate:
[0042] $x_i=(1-t)*x_{i-1}+t*x_{i+1}$, where $t=(i-i_1) / (i_2-i_1)$, $i_1$ and $i_2$ are the time indices before and after the missing value respectively.
[0043] Abnormality handling: Using the 3-σ principle, data outside the range of $μ±3σ$ is considered as abnormal value and deleted, where $μ$ and $σ$ are the mean and standard deviation of the data respectively. Abnormal values may be caused by sensor failure, data transmission error, etc.
[0044] Noise processing: Use smoothing filtering methods (such as moving average, median filtering) to remove high-frequency noise in the data and improve data quality. Using moving average filtering, assuming the window size is k, the smoothing value at the i-th moment is:
[0045] $x_i=(x_{ik / 2}+...+x_i+...+x_{i+k / 2}) / k$;
[0046] Data standardization: Standardize the feature matrix X so that the mean of each feature is 0 and the variance is 1: This helps speed up the convergence of the model and improves the comparability of different features.
[0047] $X_{norm}=(X-μ) / σ$, where $μ$ and $σ$ are the mean and standard deviation vectors of each feature respectively.
[0048] In an optional embodiment of the present invention, the moisture prediction model includes: an encoder, which uses a multi-head self-attention mechanism and an autocorrelation mechanism to capture the long-distance dependencies between different time steps in the input time series, extracts features from the historical data and outputs a target sequence containing the features of the time series data; a sequence decomposition block, which decomposes the target sequence into trend items and seasonal items; a decoder, which uses an autocorrelation mechanism and sequence decomposition to predict the trend items and seasonal items respectively, and outputs the prediction results after combining the two. By introducing the autocorrelation mechanism and sequence decomposition block. The autocorrelation mechanism effectively improves the periodic modeling capability based on the periodic calculation dependency of the time series, replacing the traditional self-attention mechanism. At the same time, the sequence decomposition block decomposes the input sequence into trend items and seasonal items, and models them separately, further improving the prediction accuracy. Autoformer extracts features through the encoder, and the decoder combines the autocorrelation mechanism and the sequence decomposition results to efficiently predict future values, which is particularly suitable for tobacco moisture prediction with complex periodicity.
[0049] Build a prediction model (Auto Former): Auto Former is a time series prediction model based on the self-attention mechanism. It consists of two parts: an encoder and a decoder. The encoder is used to extract the feature representation of the input sequence, and the decoder is used to generate the predicted value of the target sequence.
[0050] Define the model structure: Let the number of layers of the encoder and decoder be L, the number of self-attention heads be H, and the hidden layer size of the feedforward network be $d_{ff}$, then:
[0051] Encoder: Uses a multi-head self-attention mechanism to capture long-range dependencies between different time steps in the input sequence. Each self-attention head can focus on different aspects of the sequence.
[0052] Decoder: It also uses the multi-head self-attention mechanism to predict the target value at the next moment based on the output of the encoder and the generated target sequence.
[0053] In an optional embodiment of the present invention, feature selection is performed on historical data, including: using a minimum redundancy maximum correlation algorithm to select top k features with the highest correlation with the moisture value of the cut tobacco from the process variables.
[0054] In the online moisture detection method based on model prediction of the present invention, the minimum redundancy maximum correlation (mRMR) algorithm is used to screen out the top k features with the highest correlation with the moisture value of tobacco from a large number of process variables, and feature selection is performed to improve the accuracy of model prediction. Among them, the online moisture detection method using the mRMR algorithm for feature selection effectively improves the prediction accuracy of the model, reduces the computational burden in the model training and prediction process, focuses on the most relevant features, and improves the generalization ability of the model.
[0055] Feature Selection:
[0056] Using the mRMR (minimum redundancy maximum correlation) algorithm, select a feature subset that is highly correlated with the moisture value of the tobacco but has low redundancy with each other. This helps reduce the complexity of the model and improve generalization ability. Using the mRMR algorithm, let the feature set be F and the target variable be y, then the optimal feature subset S satisfies:
[0057] $max(Σ_{f∈S}I(f;y)-(1 / |S|)*Σ_{f,f'∈S}I(f;f'))$, where $I(·)$ denotes the mutual information.
[0058] In the online moisture detection method of the present invention, the maximum relevance minimum redundancy (mRMR) method is used to select the best features with the highest correlation with the moisture content. The mRMR algorithm is a powerful feature selection method that aims to identify a subset from the original feature set that is highly correlated with the target variable (maximum relevance) while minimizing redundancy (minimum redundancy)
[36] . Given a set of input features X and a target variable y, the mutual information I(x; y) is defined as follows:
[0059]
[0060] where p(x) and p(y) are the marginal probability density functions of x and y, respectively. The larger the mutual information, the more information x contains about y, indicating a stronger correlation between the two.
[0061] The mRMR algorithm selects a feature subset S (m < n) that maximizes the following objective function:
[0062]
[0063] where I(x i ; y) represents the mutual information between the feature x i and the target variable y, and I(x i ; x j ) represents the mutual information between the feature x i and x j . The first term in the objective function measures the correlation between the selected features and the target variable, while the second term measures the redundancy between the selected features. The mRMR algorithm incrementally selects features by adding the feature that maximizes the objective function at each step until the desired number of features is reached. In the online moisture detection method of the present invention, mRMR is applied to select the top k features with the largest amount of information for predicting the moisture content, where k is a hyperparameter adjusted according to the validation performance.
[0064] In an alternative embodiment of the present invention, feature extraction is performed on historical data, including: constructing new combined features according to process knowledge; extracting time-series features from historical data. By performing feature extraction on historical data, the online moisture detection method of the present invention can significantly improve the accuracy and reliability of moisture prediction. The constructed combined features enable the model to understand the cigarette making process from different perspectives and enhance the sensitivity of the model to changes in the process state.
[0065] Specifically, new combined features are constructed according to process knowledge, such as: new combined features are constructed according to process knowledge, such as the ratio, difference, etc. of different variables, to better characterize the process state.
[0066] $z_i=x_i^{(1)} / x_i^{(2)}$, which represents the ratio of feature 1 to feature 2 at the i-th moment
[0067] Time series characteristics: Considering the time series characteristics of the silk making process, some time domain features can be extracted, such as lag terms, sliding window statistics, etc., to capture the dynamic trend of variables.
[0068] $x_i^{(lag)}=x_{il}$, which represents the l-step lag value of the feature at the i-th moment
[0069] $x_i^{(avg)}=(x_{iw / 2}+...+x_i+...+x_{i+w / 2}) / w$, which represents the sliding average of the feature at the i-th moment, and the window size is w
[0070] In an optional embodiment of the present invention, when the moisture prediction model is trained, the mean square error is used as the loss function, and the back propagation algorithm and the Adam optimizer are used to optimize the model parameters. Using the mean square error as the loss function, combined with the training method of the back propagation algorithm and the Adam optimizer, the online moisture detection method of the present invention can achieve fast and accurate prediction of the moisture value of tobacco. MSE as a loss function makes the model more sensitive to large errors, which helps the model to pay more attention to large errors and minimize them. The back propagation algorithm ensures the correct propagation of the gradient, thereby accurately updating the network weights. The adaptive learning rate adjustment mechanism of the Adam optimizer enables the model to automatically adjust the learning rate at different training stages, avoiding the problem that the learning rate is difficult to adjust in the traditional optimization method.
[0071] Specifically, set the model hyperparameters: such as the number of layers L of the encoder and decoder, the number of self-attention heads H, the hidden layer size $d_{ff}$ of the feedforward network, etc. These hyperparameters can be tuned by methods such as grid search or Bayesian optimization.
[0072] Model training: Let the training set be T and use mean square error as the loss function:
[0073] $MSE=(1 / |T|)*Σ_{(x,y)∈T}(y_{pred}-y)^2$;
[0074] The loss function is minimized and the model parameters are updated through the back-propagation algorithm and Adam optimizer.
[0075] In an optional embodiment of the present invention, the online moisture detection method further includes: after the model training is completed, the performance of the moisture prediction model is evaluated using the root mean square error and the mean absolute percentage error. The root mean square error (RMSE) and the mean absolute percentage error (MAPE) are used to evaluate the model performance. The comprehensive evaluation of these two indicators enables us to fully understand the prediction performance of the model in practical applications and ensure the accuracy and reliability of moisture prediction.
[0076] Specifically, in the model evaluation, let the test set be E, and use the root mean square error and mean absolute percentage error to evaluate the model performance:
[0077] $RMSE=sqrt((1 / |E|)*Σ_{(x,y)∈E}(y_{pred}-y)^2)$;
[0078] $MAPE=(100 / |E|)*Σ_{(x,y)∈E}|y_{pred}-y| / |y|$.
[0079] The present invention proposes an online moisture detection method and device based on model prediction. Model application: deploying the trained Auto Former model $f(·)$ into the online system to predict the moisture value of cut tobacco in real time: Model application: deploying the trained Auto Former model into the online system to receive the cut tobacco production process data in real time to predict the moisture value of cut tobacco in the future. According to the deviation between the predicted value and the measured value, the automatic zeroing or calibration operation is triggered.
[0080] $y_{pred}=f(x_{new})$, where $x_{new}$ is the newly collected process variable data.
[0081] Model update: Regularly retrain and fine-tune the model using newly collected data $D_{new}$:
[0082] $f_{new}=Train(f,D_{new})$, where $Train(·)$ represents the model training function.
[0083] Over time, the silk-making process may change, causing the model performance to degrade. Therefore, the model needs to be retrained and fine-tuned regularly using newly acquired data to adapt to changes in the process.
[0084] The present invention also proposes an online moisture detection device based on model prediction, wherein the online moisture detection device includes: a data acquisition module, used to collect multiple process variable data of tobacco in the drying process of a tobacco drying machine in real time; a data processing module, used to preprocess the multiple process variable data, the preprocessing includes data cleaning, exception processing, noise processing and data standardization; a feature selection and extraction module, which performs feature selection and feature extraction on the multiple process variable data; a moisture prediction module, which receives the preprocessed multiple process variable data, and performs tobacco moisture detection in combination with a self-attention mechanism and a feedforward network; an output module, which is used to output the moisture detection result of the tobacco in real time.
[0085] The online moisture detection device of the present invention can realize efficient and accurate monitoring of the moisture content of tobacco shreds during the drying process of the tobacco drying machine. Among them, the data acquisition module ensures the real-time acquisition of data and provides a basis for subsequent processing; the preprocessing step of the data processing module ensures the quality and consistency of the data and provides accurate input for the model; the feature selection and extraction module improves the prediction ability of the model by identifying and utilizing key features; the moisture prediction module uses advanced self-attention mechanism and feedforward network to accurately predict the moisture content of tobacco shreds, providing a scientific basis for the optimization of the silk-making process; the real-time feedback mechanism of the output module enables the silk-making process to be adjusted instantly according to the prediction results, thereby improving product quality, reducing energy consumption, and improving production efficiency. The online moisture detection device of the present invention improves the accuracy and efficiency of tobacco shred moisture detection, can make the moisture detection process automated and intelligent, and greatly improves the efficiency and accuracy of moisture detection.
[0086] The present invention also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the steps of the above method when executed by a processor.
[0087] The present invention further provides a computer device, comprising a memory and a processor, wherein a computer program that can be run on the processor is stored in the memory, wherein the steps of the above method are implemented when the processor executes the computer program.
[0088] The detailed explanation of the above-mentioned embodiments is only intended to explain the present invention so as to facilitate a better understanding of the present invention. However, these descriptions cannot be interpreted as limitations on the present invention for any reason. In particular, the various features described in different embodiments may also be arbitrarily combined with each other to form other embodiments. Unless there is a clear description to the contrary, these features should be understood to be applicable to any embodiment and are not limited to the described embodiments.
Claims
1. An online moisture detection method based on model prediction, characterized in that: The online moisture detection method comprises: Acquire historical data of tobacco at n moments in the process of making tobacco, wherein the historical data includes process variables and moisture values of tobacco at corresponding moments; Constructing a historical data set based on the historical data at n moments; A moisture prediction model is constructed based on a time series prediction model of an autocorrelation mechanism, wherein the moisture prediction model encodes and decodes an input sequence through an autocorrelation mechanism and a feedforward network; Training the moisture prediction model using the historical data set; The trained moisture prediction model is used to perform online moisture detection on shredded tobacco.
2. The online moisture detection method based on model prediction as claimed in claim 1, characterized in that: The online moisture detection method further includes preprocessing the tobacco historical data.
3. The online moisture detection method based on model prediction as claimed in claim 2, characterized in that: The preprocessing includes data cleaning, anomaly processing, noise processing and data standardization.
4. The online moisture detection method based on model prediction as claimed in claim 1, characterized in that: The moisture prediction model includes: The encoder uses a multi-head self-attention mechanism and an autocorrelation mechanism to capture the long-distance dependencies between different time steps in the input time series, extract features from the historical data, and output a target sequence containing the features of the time series data; A sequence decomposition block decomposes the target sequence into a trend term and a seasonal term; The decoder uses the autocorrelation mechanism and sequence decomposition to predict the trend item and the seasonal item respectively, and outputs the prediction result after combining the two.
5. The online moisture detection method based on model prediction as claimed in claim 1, characterized in that: Performing feature selection on the historical data includes: The minimum redundancy maximum correlation algorithm is used to select the top k features with the highest correlation with the moisture value of the tobacco from the process variables.
6. The online moisture detection method based on model prediction as claimed in claim 1, characterized in that: Performing feature extraction on the historical data includes: Based on process knowledge, construct new combination features; Extracting time series features from the historical data.
7. The online moisture detection method based on model prediction as claimed in claim 1, characterized in that: When the moisture prediction model is trained, mean square error is used as the loss function, and the back propagation algorithm and Adam optimizer are used to optimize the model parameters.
8. The online moisture detection method based on model prediction as claimed in claim 1, characterized in that: The online moisture detection method also includes: After the model training was completed, the root mean square error and mean absolute percentage error were used to evaluate the performance of the moisture prediction model.
9. An online moisture detection device based on model prediction, characterized in that: The online moisture detection device comprises: A data acquisition module is used to collect multiple process variable data of tobacco in the drying process of the tobacco drying machine in real time; A data processing module, used for preprocessing a plurality of process variable data, wherein the preprocessing includes data cleaning, exception processing, noise processing and data standardization; Feature selection and extraction module, which performs feature selection and feature extraction on multiple process variable data; The moisture prediction module receives multiple pre-processed process variable data and combines the self-attention mechanism and feed-forward network to detect the moisture content of tobacco; The output module is used to output the moisture detection results of the tobacco in real time.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer device comprising a memory and a processor, wherein a computer program capable of running on the processor is stored in the memory, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.