Method for predicting moisture content at outlet of tobacco shred manufacturing process based on time sequence

Through the prediction method based on the Transformer model, the limitations of traditional models in time series data prediction are solved, the prediction accuracy and efficiency are improved, and the accurate prediction of the moisture content of tobacco outlet is achieved.

CN118917686AInactive Publication Date: 2024-11-08CHINA TOBACCO YUNNAN IND

Patent Information

Application Number
CN202410966290.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-11-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional linear and nonlinear models have limitations in the prediction of time series data, especially when processing actual engineering time series data, they face the problems of parameter selection, slow training speed, insufficient dynamic attributes and easy to fall into local minimum values. , resulting in unsatisfactory prediction results.

Method used

Using the prediction method based on the Transformer model, by obtaining historical data, filtering feature variables, batch processing and patching, using multi-head attention mechanism and nonlinear activation function, optimize the prediction model parameters, and maintaining timing with the additive position coding matrix , perform depth encoding and output prediction.

Benefits of technology

It improves the time series prediction accuracy, reduces the algorithm time complexity, saves calculation costs, and improves the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917686A_ABST
    Figure CN118917686A_ABST
Patent Text Reader

Abstract

The invention relates to a tobacco shred manufacturing process outlet moisture content prediction method based on a time sequence, and the method comprises the steps: obtaining historical data of equipment, and constructing a historical time sequence; performing batch processing on the historical time sequence to obtain a batch data set; performing patching processing on the batch data set to obtain a patch time sequence; inputting each characteristic variable into a model framework channel; using an additive position coding matrix to maintain the patch time sequence, and using a multi-head attention mechanism to carry out depth coding on the patch time sequence to obtain multi-head attention mechanism output; and carrying out double-layer linear transformation on the output of the multi-head attention mechanism, carrying out residual connection by adopting a nonlinear activation function, and carrying out flattening layer and linear head processing to obtain a final output outlet moisture content prediction result. According to the method, the outlet moisture content of the tobacco shreds is predicted based on historical data, so that the time sequence prediction precision is improved, the algorithm time complexity is reduced, and the calculation cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of multivariate time series data analysis, and in particular to a method for predicting moisture content at an outlet of a tobacco manufacturing process based on a time series. Background Art

[0002] Time series forecasting is a data analysis method that uses historical data to predict future data. It has extremely high application value in the fields of industry, economy, meteorology, geology, hydrology, etc. Accurately predicting and analyzing various time series data can not only bring significant economic benefits, but also produce far-reaching social benefits. Due to the complex nonlinear characteristics of the actual system and the mutual influence between some features, traditional linear models and nonlinear models have certain limitations in the theoretical analysis and practical application of single variable and multivariate time series data.

[0003] Drying tobacco is an important step in tobacco processing, and the outlet moisture content is a key indicator for evaluating the quality of tobacco. The process mainly involves drying and dehydrating the tobacco, while improving the elasticity and filling performance of the tobacco, thereby improving the overall quality of the tobacco and meeting the requirements of rolling. Therefore, predicting the outlet moisture content of tobacco based on historical data is of great value to the industry. Currently popular prediction methods often rely on neural networks to build prediction models, and determine the parameter configuration of the network through spatial reconstruction theory in order to conduct time series prediction research. Although these methods perform well in theoretical simulation data, they face the problem of parameter selection when processing actual engineering time series data. In addition, due to the slow training speed of neural networks, insufficient dynamic properties, and the tendency to fall into local minima, the prediction effect in practical applications is not ideal. Summary of the invention

[0004] The purpose of the present invention is to predict the outlet moisture content of shredded tobacco based on historical data, and to provide a method for predicting the outlet moisture content of shredded tobacco manufacturing process based on time series.

[0005] In order to achieve the above-mentioned object of the invention, the embodiment of the present invention provides the following technical solutions:

[0006] The method for predicting the moisture content of the outlet of the tobacco manufacturing process based on time series includes the following steps:

[0007] Step 1, obtaining historical data of the equipment, screening out characteristic variables including the target variable, and constructing a historical time series; the target variable is the outlet moisture content;

[0008] Step 2: Batch process the historical time series to obtain a batch data set;

[0009] Step 3, patching the batched data set to obtain a patch time series;

[0010] Step 4: Input each feature variable into the Transformer model framework channel, and jointly optimize the prediction model parameter threshold by considering channel independence; use the additive position encoding matrix to maintain the patch temporal sequence, use the multi-head attention mechanism to deeply encode the patch time series, and obtain the multi-head attention mechanism output;

[0011] In step 5, the output of the multi-head attention mechanism is transformed by a double-layer linear transformation, and a nonlinear activation function is used for residual connection. After a flattening layer and linear head-to-head processing, the final output of the outlet moisture content prediction result is obtained.

[0012] Compared with the prior art, the present invention has the following beneficial effects: the present invention predicts the outlet moisture content of tobacco based on historical data, aiming to improve the accuracy of time series prediction, reduce the time complexity of the algorithm, and save computing costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 is a flow chart of the method of the present invention;

[0015] Figure 2 It is a schematic diagram of the structure of the method of the present invention;

[0016] Figure 3 This is a schematic diagram of data dimension conversion in the present invention;

[0017] Figure 4 This is a schematic diagram of the prediction results of Example 2 of the present invention. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0019] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance, or implying any such actual relationship or order between these entities or operations. In addition, the terms "connected", "connected", etc. can be directly connected between elements, or indirectly connected via other elements.

[0020] Embodiment 1:

[0021] Cut tobacco drying is an important step in tobacco processing. The moisture content at the outlet is a key indicator for evaluating the quality of cut tobacco. The step mainly involves drying and dehydrating the cut tobacco while improving the elasticity and filling performance of the cut tobacco, thereby improving the overall quality of the cut tobacco and making it meet the requirements of rolling. The present invention is achieved through the following technical solutions: Figure 1 As shown, the method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series includes the following steps:

[0022] Step 1: Obtain the historical data of the device, filter out the characteristic variables containing the target variable, and construct the historical time series.

[0023] like Figure 2 As shown in the figure, considering that the multivariate time series prediction itself is not only affected by previous data, but also depends on other feature constraints, in order to ensure the accuracy of model prediction, all feature variables including the target variable will be comprehensively considered to predict the target variable.

[0024] The data acquisition source of this scheme is the historical data of the outlet moisture content prediction task in the roller-type thin plate drying machine tobacco processing equipment on the production line. The target variable is the outlet moisture content, and it is necessary to obtain all the characteristic variables containing the target variable, such as the current and power of the equipment. The correlation analysis technology is used to preliminarily screen the characteristic factors with strong correlation with the characteristics, and the gradient boosting tree algorithm is combined to select the characteristic variables with stronger importance to construct the historical time series x∈R M×L , the length of the historical time series x is L, and the input feature dimension is M.

[0025] Step 2: Batch process the historical time series to obtain a batch data set.

[0026] like Figure 3 As shown in the figure, batch processing technology is introduced to divide the historical time series data into batches with fixed sample length and fixed number of samples, allowing parallel processing of data samples and training each group of batch samples in an iterative manner. Given a batch size of B, an input length of each batch of I, and a prediction length of each batch for the target variable of O, the total number of samples is N Y for:

[0027] N Y =LI-O+1

[0028] The batch size is N B When:

[0029]

[0030] As an example, assume that the length of the historical time series x is L = 1000, the input length of each batch is I = 12, and the prediction length of each batch for the target variable is O = 6, then the sample length is I + O = 18, and the number of samples is N. Y :

[0031] Sample 1: 1-18;

[0032] Sample 2: 2-19; ......

[0034] Sample N Y :983~1000.

[0035] After batch processing, a batch data set is obtained. The input sample set can be constructed for the input sample For the output samples, the output sample set y can be constructed (i) ∈R 1×B×O , where i∈(1,2,...,N B ), represents the input sample data of the i-th batch after batch processing, y (i)Represents the output sample data of the i-th batch.

[0036] Step 3: Patching the batched data set to obtain a patch time series.

[0037] The time span of the characteristic variables of each batch of samples is relatively large, which increases the model training cost and time complexity to a certain extent, and the prediction results are prone to overfitting, underfitting and other phenomena. For this reason, patch processing technology is adopted to divide each group of batch samples into multiple overlapping and non-overlapping patch data sets to ensure that data is not lost while retaining the original key information.

[0038] Please continue to see Figure 3 Specifically, given a patch length of P and a step size of S, a time window sliding strategy is adopted to determine the patch time series That is, for each patch, the time series advances S units, that is, each time point is not regarded as a token, but each time period is regarded as a token of model input.

[0039] If the patch length P is greater than the step length S, the length of the last patch will be less than the original set patch length P. The tail filling method is used to determine the last patch sequence, that is, the number of patches is:

[0040]

[0041] If the patch length P approaches the step length S, then there exists N P →I / S.

[0042] This generates a new patch time series:

[0043] As an example, assume P = 4, S = 2, I = 12, and the input sample set The sample data in is [1,2,...,12], then the input sample set of the first batch is 6 groups of patches can be formed:

[0044] Group 1: 1, 2, 3, 4;

[0045] Group 2: 3, 4, 5, 6;

[0046] Group 3: 5, 6, 7, 8;

[0047] Group 4: 7, 8, 9, 10;

[0048] Group 5: 9, 10, 11, 12;

[0049] Group 6: 11, 12, 12, 12;

[0050] The new patch time series is

[0051] Step 4: Input each feature variable into the Transformer model framework channel, and jointly optimize the prediction model parameter threshold by considering channel independence; use the additive position coding matrix to maintain the patch temporal sequence, and use the multi-head attention mechanism to deeply encode the patch time series to obtain the multi-head attention mechanism output.

[0052] The number of channels C of the Transformer model framework is set, and each feature variable is input into the model framework channel. The number of channels C is consistent with the dimension M of the feature variable, that is, each channel contains only one univariate time series, but shares the same model weight, considering channel independence to jointly optimize the prediction model parameter threshold.

[0053] Through the linear projection matrix ω p Patch time series Mapped into the D-dimensional space of the Transformer model, using the learnable additive position encoding matrix ω pos To maintain the patch time series The temporal nature of the model input time series

[0054]

[0055] Among them, ω p ∈R D×P ;ω pos ∈R D×N ;

[0056] A multi-head attention mechanism is adopted, and the number of attention heads is set to H. The setting of attention heads allows the method of the present invention to process data in parallel in multiple representation subspaces, thereby effectively capturing information of feature variables in different aspects. Set the query weight matrix Key weight matrix Sum weight matrix For each attention head, the input time series is transformed into Convert to query matrix Key Matrix Sum Matrix where h∈(1,2,...,H), d k The data dimension of each attention head is to evenly distribute the D-dimensional space to each h, specifically:

[0057]

[0058] in,

[0059] Query Matrix and key matrix Perform a dot product operation, through Generate scaled attention score matrix The specific calculation is as follows:

[0060]

[0061] in, The scaled scores are normalized by the SoftMax function, the attention score matrix is ​​converted into a probability matrix, and then Perform product operation to get multi-head attention output The specific calculation is as follows:

[0062]

[0063] in, represents the output of the h-th attention head, Attention represents the attention mechanism, and SoftMax represents the activation function.

[0064] In step 5, the output of the multi-head attention mechanism undergoes a two-layer linear transformation, uses a nonlinear activation function for residual connection, and undergoes flattening layer and linear head-to-head processing to obtain the final output prediction result.

[0065] Outputting multi-head attention Perform a double-layer linear transformation and use the nonlinear activation function RELU for residual connection. The specific calculation is as follows:

[0066]

[0067] in, Express The result after double-layer linear transformation and residual connection; ω1 and ω2 are weight matrices of linear transformation; b1 and b2 are bias terms; RELU represents nonlinear activation function; is the output matrix after linear transformation, and

[0068] Batch normalization is performed through BatchNorm. The specific calculation is as follows:

[0069]

[0070] in, Express The result after batch normalization; μ, σ 2are the batch mean and variance; γ is a learnable scaling parameter; β is a learnable offset parameter; δ is a division by zero error parameter.

[0071] The data is reduced in dimension through the flattening layer, and the prediction result is finally obtained through the linear head. The specific calculation is as follows:

[0072]

[0073]

[0074] Among them, z (i) Express The result after dimensionality reduction processing, flatten represents dimensionality reduction processing; ω3 represents the weight matrix; b3 represents the bias; represents the predicted value, and

[0075] Embodiment 2:

[0076] This embodiment is experimentally verified on the basis of the above embodiment 1. The input length I is set to 24, 36, and 48, the prediction length O is set to 24, the step length S is set to 8, and the slice length P is set to 12 and 24 to perform time series prediction. The prediction results are as follows: Figure 4 As shown, the solid line is the true value and the dotted line is the predicted value. The prediction task evaluation indicators of this embodiment include root mean square error (RMSE), mean absolute error (MAE) and mean absolute percentage error (MAPE). Please refer to Table 1 for the evaluation indicator results.

[0077] Table 1. Results of prediction task evaluation indicators

[0078]

[0079] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. Prediction method of moisture content at the outlet of tobacco manufacturing process based on time series, Features: The following steps are involved: Step 1, obtaining historical data of the equipment, screening out characteristic variables including the target variable, and constructing a historical time series; the target variable is the outlet moisture content; Step 2: Batch process the historical time series to obtain a batch data set; Step 3, patching the batched data set to obtain a patch time series; Step 4: Input each feature variable into the Transformer model framework channel, and jointly optimize the prediction model parameter threshold by considering channel independence; use the additive position encoding matrix to maintain the patch temporal sequence, use the multi-head attention mechanism to deeply encode the patch time series, and obtain the multi-head attention mechanism output; In step 5, the output of the multi-head attention mechanism is transformed by a double-layer linear transformation, and a nonlinear activation function is used for residual connection. After a flattening layer and linear head-to-head processing, the final output of the outlet moisture content prediction result is obtained.

2. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 1, Features: The step 1 specifically includes the following steps: using correlation analysis technology to preliminarily screen feature factors with strong feature correlation, combining the gradient boosting tree algorithm to select feature variables with stronger importance, and constructing the historical time series x∈R M×L , the length of the historical time series x is L, and the input feature dimension is M.

3. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 2, Features: The step 2 specifically includes the following steps: Given a batch size of B, and the input length of each batch is I, and the prediction length of each batch for the target variable is O, the total number of samples is N Y for: The batch size is N B When: After batch processing, a batch data set is obtained, and an input sample set is constructed for the input sample. Construct output sample set y for output samples (i) ∈R 1×B×O , where i∈(1,2,...,N B ), represents the input sample data of the i-th batch after batch processing, y (i) Represents the output sample data of the i-th batch.

4. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 3, Features: The step 3 specifically comprises the following steps: Given a patch length of P and a step size of S, a time window sliding strategy is adopted to determine the patch time series If the patch length P is greater than the step length S, the length of the last patch will be less than the original set patch length P. The tail filling method is used to determine the last patch sequence, that is, the number of patches is: If the patch length P is equal to the step length S, then there exists N P =I / S; This generates a new patch time series:

5. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 1, Features: In step 4, each feature variable is input into the Transformer model framework channel, and the step of jointly optimizing the prediction model parameter threshold by considering channel independence includes: The number of channels C of the Transformer model framework is set, and each feature variable is input into the model framework channel. The number of channels C is consistent with the dimension M of the feature variable. Each channel contains only one univariate time series, but shares the same model weight. Channel independence is considered to jointly optimize the prediction model parameter threshold.

6. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 4, Features: In step 4, the step of using an additive position coding matrix to maintain the temporal order of patches includes: Through the linear projection matrix ω p Patch time series Mapped into the D-dimensional space of the Transformer model, using the learnable additive position encoding matrix ω pos To maintain the patch time series The temporal nature of the model input time series Among them, oh p ∈R D×P Oh pos ∈R D×N ; 7. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 6, Features: In step 4, the step of deeply encoding the patch time series using the multi-head attention mechanism to obtain the output of the multi-head attention mechanism includes: Set the number of attention heads to H and the query weight matrix Key weight matrix Sum weight matrix For each attention head, the input time series is transformed into Convert to query matrix Key Matrix Sum Matrix where h∈(1,2,...,H), d k The data dimension of each attention head is to evenly distribute the D-dimensional space to each h, specifically: in, Query Matrix and key matrix Perform a dot product operation, through Generate scaled attention score matrix The specific calculation is as follows: in, The scaled scores are normalized by the SoftMax function, the attention score matrix is ​​converted into a probability matrix, and then Perform product operation to get multi-head attention output The specific calculation is as follows: in, represents the output of the h-th attention head, Attention represents the attention mechanism, and SoftMax represents the activation function.

8. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 7, Features: In step 5, the step of performing a double-layer linear transformation on the output of the multi-head attention mechanism and using a nonlinear activation function for residual connection includes: Outputting multi-head attention Perform a double-layer linear transformation and use the nonlinear activation function RELU for residual connection. The specific calculation is as follows: in, Express The result after double-layer linear transformation and residual connection; ω 1 ,ω 2 is the weight matrix of linear transformation; b 1 、b 2 is the bias term; RELU represents the nonlinear activation function; is the output matrix after linear transformation, and 9. The method for predicting the moisture content at the outlet of the tobacco manufacturing process based on time series according to claim 8, Features: In step 5, the step of obtaining the final output prediction result after flattening layer and linear head processing includes: Batch normalization is performed through BatchNorm. The specific calculation is as follows: in, Express The result after batch normalization; μ, σ 2 are the mean and variance within the batch; γ is a learnable scaling parameter; β is a learnable offset parameter; δ is a division by zero error parameter; The data is reduced in dimension through the flattening layer, and the prediction result is finally obtained through the linear head. The specific calculation is as follows: Among them, z (i) Express The result after dimensionality reduction processing, flatten represents dimensionality reduction processing; ω 3 represents the weight matrix; b 3 Indicates the offset; represents the predicted value, and

Citation Information

Patent Citations

  • Object behavior prediction method and system based on knowledge distillation, equipment and medium

    CN114840638A

  • Machine learning-based tobacco shred moisture change analysis method in single tobacco shred making machine

    CN116602435A

  • Cut tobacco dryer moisture dynamic prediction method based on double attention mechanisms and XGBoost

    CN117494007A

  • Crop growth related trend prediction method and device, electronic equipment and storage medium

    CN118246601A

  • Load prediction method for computing power network

    CN118277093A

Cited By

  • Wireless intelligent material moisture detection method and device

    CN120142397A