Tobacco leaf dry and wet water adding amount prediction method and device, electronic equipment and storage medium
By acquiring the characteristics of tobacco processing time and dry/wet parameters, and using a predictive model, the problem of low accuracy in the PID control method was solved, enabling accurate prediction of the amount of water added to dry and wet tobacco leaves, and improving the quality control of tobacco production.
Patent Information
- Application Number
- CN202511707615.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-20
- Publication Date
- 2026-02-24
AI Technical Summary
In existing technologies, PID control methods cannot effectively capture the relationship between rehydration parameters, resulting in low accuracy in predicting the amount of water added to dry and wet tobacco leaves, which affects the quality of tobacco leaves.
By acquiring the processing time characteristics and dry/wet parameters of tobacco leaves, and processing them using a prediction model, including time feature extraction and model training, the moisture content and water addition coefficient of the output material are determined.
It enables accurate prediction of the amount of water added to dry and wet tobacco leaves, provides accurate data support, and improves the quality control of tobacco production.
Smart Images

Figure CN121562901A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for predicting the amount of moisture added to dry and wet tobacco leaves. Background Technology
[0002] In the cigarette production process, the amount of moisture added to the tobacco leaves is crucial. Rehydration parameters include hot air temperature, inlet material moisture content, steam flow rate, and outlet temperature; fluctuations in any of these parameters can affect the quality of the produced tobacco leaves. For example, excessive fluctuations in inlet material moisture content can lead to a decrease in the amount of tobacco leaves filled, which in turn affects the draw resistance and combustion uniformity of the rolled cigarette.
[0003] In existing technologies, the proportional-integral-derivative (PID) control method is commonly used to control the amount of moisture added to tobacco leaves. However, the PID control method adjusts the current moisture return parameters based on historical moisture return parameters, which fails to capture the relationships between these parameters, resulting in low accuracy in predicting the amount of moisture added to tobacco leaves. Summary of the Invention
[0004] This invention provides a method, device, electronic device, and storage medium for predicting the amount of moisture added to dry and wet tobacco leaves, thereby improving the accuracy of the prediction.
[0005] According to one aspect of the present invention, a method for predicting the amount of moisture added to tobacco leaves when they are dry or wet is provided, the method comprising:
[0006] The first processing time and first dry / wet parameters of the tobacco leaves are obtained. The first processing time includes processing year information, processing month information, and processing day information.
[0007] The first time feature is determined based on the first processing time. The first time feature includes relative year feature, processing month feature and weekday attribute.
[0008] Based on the prediction model, the first time feature and the first dry and wet parameters are processed to obtain the prediction results, which include the moisture content of the outlet material and the water addition coefficient.
[0009] According to another aspect of the present invention, an apparatus for predicting the amount of moisture added to dry tobacco leaves is provided, the apparatus comprising:
[0010] The data acquisition module is used to acquire the first processing time and the first dry and wet parameters of the tobacco leaves. The first processing time includes processing year information, processing month information, and processing day information.
[0011] The first time feature determination module is used to determine the first time feature based on the first processing time. The first time feature includes relative year feature, processing month feature and weekday attribute.
[0012] The prediction result determination module is used to process the first time feature and the first dry and wet parameters based on the prediction model to obtain the prediction result, which includes the moisture content of the outlet material and the water addition coefficient.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory that is communicatively connected to at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the method for predicting the amount of dry and wet tobacco leaves provided in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the method for predicting the amount of dry and wet tobacco leaves provided in any embodiment of the present invention.
[0018] The technical solution of this invention obtains the first processing time and first moisture parameters of tobacco leaves. The first processing time includes processing year information, processing month information, and processing day information, providing accurate and comprehensive data support for subsequent analysis. Based on the first processing time, first time features are determined, including relative year features, processing month features, and weekday attributes, achieving accurate determination of the first time features and providing accurate data support for subsequent analysis and processing. Based on a prediction model, the first time features and the first moisture parameters are processed to obtain prediction results, including the moisture content of the outlet material and the water addition coefficient. This solves the problem of low prediction accuracy of tobacco leaf moisture addition in the prior art, achieving accurate prediction of tobacco leaf moisture addition and providing accurate data support for subsequent tobacco leaf production.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a method for predicting the amount of water added to dry and wet tobacco leaves according to Embodiment 1 of the present invention;
[0022] Figure 2 This is a flowchart illustrating the calculation of a first time feature provided in an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram of the structure of a prediction model provided in an embodiment of the present invention;
[0024] Figure 4 This is a flowchart of a training method for a prediction model provided in Embodiment 2 of the present invention;
[0025] Figure 5 This is a schematic diagram of a parameter adjustment process provided in an embodiment of the present invention;
[0026] Figure 6 This is a schematic diagram of the structure of a tobacco leaf moisture prediction device provided in Embodiment 3 of the present invention;
[0027] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0028] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0030] Example 1
[0031] Figure 1 This is a flowchart of a method for predicting the amount of moisture added to dry and wet tobacco leaves according to Embodiment 1 of the present invention. This embodiment is applicable to situations requiring accurate prediction of the amount of moisture added to dry and wet tobacco leaves. This method can be executed by a device for predicting the amount of moisture added to dry and wet tobacco leaves. This device can be implemented in hardware and / or software and can be configured in the electronic device provided in this embodiment of the invention. The electronic device can be a server, computer, or mobile terminal, such as a mobile phone or tablet computer. Figure 1 As shown, the method for predicting the dry and wet moisture content of tobacco leaves specifically includes the following steps:
[0032] S110. Obtain the first processing time and first dry / wet parameters of the tobacco leaves. The first processing time includes processing year information, processing month information, and processing day information.
[0033] The process of processing tobacco leaves into dry and wet stages includes both drying and wet / dry processing, which can be performed using dry / dry processing equipment. For example, tobacco leaves can be dried using drying equipment, including but not limited to shredders. Tobacco leaves can also be processed using wet / dry processing equipment, including but not limited to loosening and rehumidifying machines. The first processing time is the time when the tobacco leaves enter the wet / dry processing equipment. The first processing time includes processing year, processing month, and processing day information. The processing year information represents the year of wet / dry processing, the processing month information represents the month of wet / dry processing, and the processing day information represents the specific time of wet / dry processing. The first processing time can be in the form of yyyy-mm-dd, where yyyy represents the processing year, mm represents the processing month, and dd represents the processing day. The first wet / dry parameters are the wet / dry process parameters set for the wet / dry processing equipment when processing tobacco leaves. The first wet / dry parameters include hot air temperature, inlet material moisture content, steam flow rate, and outlet temperature. The first processing time and the first wet / dry parameters can be obtained through an application programming interface (API). For example, operators can input the first processing time and first dry / wet parameters of tobacco leaves through input devices on the interactive interface of the device, including but not limited to a mouse and keyboard.
[0034] Specifically, by inputting the first processing time and first dry-wet parameters of tobacco leaves through the input device on the interactive interface of the interactive device, the first processing time and first dry-wet parameters were obtained, providing accurate and comprehensive data support for subsequent analysis.
[0035] S120. Determine the first time feature based on the first processing time. The first time feature includes the relative year feature, the processing month feature, and the weekday attribute.
[0036] The first time feature is data characterizing the time characteristics of the wet and dry processing. The first time feature includes relative year features, processing month features, and weekday attributes. The relative year feature represents data representing the relative year of the wet and dry processing. The processing month feature represents data characterizing the month of the wet and dry processing. The weekday attribute represents data indicating whether the wet and dry processing occurs on a weekday. The first time feature can be determined based on the first processing time. For example, the first processing time can be input into a trained time feature determination model for processing to obtain the first time feature. The time feature determination model includes, but is not limited to, mathematical models and neural network models; no restrictions are placed here.
[0037] Specifically, the first processing time is input into the trained time feature determination model for processing to obtain the first time feature, thus achieving accurate determination of the first time feature and providing accurate data support for subsequent analysis and processing.
[0038] Optionally, before determining the first time feature based on the first processing time, the first processing time can be format-converted to a preset format.
[0039] Optionally, the first time feature is determined based on the first processing time, including: determining the relative year feature based on the processing year information; determining the processing month feature based on the processing month information; determining the weekday attribute based on the processing year information, processing month information, and processing day information; and determining the first time feature based on the relative year feature, processing month feature, and weekday attribute.
[0040] The relative year characteristic can be determined based on the processing year information. For example, it can be determined according to the relative year characteristic calculation formula. Optionally, the relative year characteristic can be determined based on the difference between the processing year information and the base year information. The base year information can be set according to needs; for example, the equipment upgrade year of the dry and wet processing equipment can be set as the base year information; another example is that the year of finalization of the re-moistening process can also be used as the base year information, without limitation. The difference between the processing year information and the base year information can be calculated, and the difference can be used as the relative year characteristic. Alternatively, a weighted value of the difference can be calculated and used as the relative year characteristic. The processing month characteristic can be determined based on the processing month information. To ensure the continuity of months, the processing month information can be encoded to obtain the processing month characteristic. Optionally, the processing month characteristic can be determined based on the sine and cosine information corresponding to the processing month information. The sine and cosine information of the processing month is calculated to construct the processing month features, ensuring the continuity of the months. Seasonal features are also introduced, as different processing months correspond to different seasons, linking different seasons and corresponding climatic factors, thus improving the accuracy of predicting the wet and dry water addition of tobacco leaves. The weekday attribute can be determined based on the processing year, month, and day information. For example, a calendar algorithm is used to process the processing year, month, and day information to determine whether the first processing time is a workday. Optionally, the weekday attribute is determined based on the Boolean information corresponding to the first processing time, which represents whether the first processing time is a workday. The Boolean information is data representing whether the date corresponding to the first processing time is a workday. The Boolean information is a binary description of the weekday attribute. For example, when the date corresponding to the first processing time is a workday, the Boolean information can be set to 0, and the weekday attribute can be set to 0; when the date corresponding to the first processing time is a weekend, the Boolean information can be set to 1, and the weekday attribute can be set to 1. By calculating weekend attributes, weekday and weekend characteristics of dry and wet processing can be captured. The amount of tobacco leaves processed in dry and wet processing differs between weekdays and weekends, which is beneficial for rationally planning the dry and wet processing of tobacco leaves and saving energy. The first time characteristic can be determined based on relative year characteristics, processing month characteristics, and weekday attributes. For example, the relative year characteristics, processing month characteristics, and weekday attributes can be converted into data in a preset format to obtain the first time characteristic.
[0041] Specifically, the relative year feature is determined based on the relative year feature calculation formula; the processing month information is encoded to obtain the processing month feature; the processing year information, processing month information, and processing day information are processed using a calendar algorithm to determine whether the first processing time is a working day; the relative year feature, processing month feature, and weekday attribute are converted into data in a preset format to obtain the first time feature. This effectively captures the linear progression of the year, seasonal information, and weekday and weekend features, which helps improve the accuracy of predicting the dry and wet moisture content of tobacco leaves. For example, see [link to example]. Figure 2 , Figure 2 This is a flowchart of the calculation of a first time feature provided in an embodiment of the present invention.
[0042] For example, the formula for calculating the relative year characteristic is as follows:
[0043] ;
[0044] in, Indicates relative year characteristics; Indicates the first processing time; This represents the base year information. The formula for calculating the processing month characteristic is as follows:
[0045] ;
[0046] ;
[0047] in, Indicates processing month information; Sine wave information representing the processing month; The cosine information represents the processed month information. The sine and cosine information of the processed month information constitute the processed month feature. The formula for calculating the weekday attribute is as follows:
[0048] ;
[0049] in, Indicates the weekday attribute; 1 indicates the weekend; 1 indicates the Boolean information corresponding to the weekend; 0 indicates the Boolean information corresponding to the weekday.
[0050] S130. Based on the prediction model, the first time characteristics and the first dry and wet parameters are processed to obtain the prediction results, which include the moisture content of the outlet material and the water addition coefficient.
[0051] The prediction model is used to predict the amount of moisture added to tobacco leaves during the dry and wet treatment process. The prediction model includes, but is not limited to, mathematical models and neural network models; the choice of model is based on requirements and is not restricted here. The prediction results provide data characterizing the dry and wet treatment effect and guiding the rehumidification operation. The prediction results include the moisture content of the outlet material and the water addition coefficient. The outlet material moisture content is the moisture content of the tobacco leaves after the dry and wet treatment. The water addition coefficient is a coefficient characterizing the amount of water added by the dry and wet treatment equipment. By inputting the first time-series features and the first dry and wet parameters into the trained prediction model for processing, the outlet material moisture content and water addition coefficient are obtained, achieving accurate prediction of the amount of moisture added to tobacco leaves during the dry and wet treatment process, providing accurate data support for subsequent tobacco production.
[0052] It should be noted that during the tobacco leaf drying process, there is no need to predict the moisture addition coefficient. After obtaining the prediction result, it can be processed; for example, the moisture addition coefficient in the prediction result can be set to 0, and the predicted moisture content of the outlet material and the moisture addition coefficient set to 0 can be used for subsequent tobacco leaf production and processing. During the tobacco leaf rehumidification process, it is necessary to predict both the moisture addition coefficient and the moisture content of the outlet material. After obtaining the prediction result, these two parameters can be directly used for subsequent tobacco leaf production and processing. By setting the moisture addition coefficient in the prediction result to 0, the drying and rehumidification processes of tobacco leaves can be effectively distinguished, achieving precise differentiation of tobacco leaf processing steps.
[0053] Optionally, the prediction model includes a first feature extraction module, a second feature extraction module, and a result determination module; wherein, the first feature extraction module extracts features from the first time feature and the first dry / wet parameter to obtain shallow feature information; the second feature extraction module extracts features from the shallow feature information to obtain target feature information; and the result determination module determines the prediction result based on the target feature information.
[0054] The first feature extraction module is a structure that extracts features from the first temporal features and the first wet / dry parameters. The first feature extraction module includes, but is not limited to, fully connected networks and convolutional neural networks.
[0055] Optionally, the activation function of the first feature extraction module can be the hyperbolic tangent function tanh. The shallow feature information is data representing the surface relationship between the first time-varying feature and the first wet / dry parameter. The second feature extraction module is a structure for mining the nonlinear relationship between shallow features. The second feature extraction module includes, but is not limited to, fully connected networks and convolutional neural networks. Optionally, the activation function of the second feature extraction module can be the hyperbolic tangent function tanh. The target feature information is multi-dimensional data used to represent the deep features between the first time-varying feature and the first wet / dry parameter, including, but not limited to, nonlinear and logical relationships. The result determination module is a structure used to determine the prediction result. The result determination module includes, but is not limited to, a regression network. Optionally, the activation function of the result determination module can be the hyperbolic tangent function tanh. For example, see [link to example]. Figure 3 , Figure 3 This is a schematic diagram of a prediction model provided in an embodiment of the present invention. The prediction model includes an input layer, a first feature extraction module, a second feature extraction module, and a result determination module. The input layer is used to convert first temporal features and first wet / dry parameters into a preset format; the first feature extraction module is used to extract shallow feature information from the first temporal features and the first wet / dry parameters in the preset format; the second feature extraction module is used to extract features from the shallow feature information to obtain target feature information; and the result determination module determines the prediction result based on the target feature information.
[0056] For example, the formula for calculating shallow feature information is as follows:
[0057] ;
[0058] ;
[0059] in, This represents the first time-based feature and the first wet / dry parameter, with a dimension of 8. The weight information for the first time feature and the first dry / wet parameter is represented by a dimension of 15×8; The bias information representing the first time feature and the first dry / wet parameter has a dimension of 15×1; This represents the intermediate features obtained by the first feature extraction module through a linear transformation of the first time feature and the first wet / dry parameter; This represents the activation function of the first feature extraction module; This indicates shallow features.
[0060] For example, the formula for calculating target feature information is as follows:
[0061] ;
[0062] ;
[0063] in, Represents shallow feature information; The weight information represents the shallow feature information, with a dimension of 10×15; The bias information representing shallow feature information has a dimension of 10×1; This represents the intermediate features obtained by the second feature extraction module through a linear transformation of the shallow feature information; This represents the activation function of the second feature extraction module; It represents the target's feature information.
[0064] For example, the formula for calculating the prediction result is as follows:
[0065] ;
[0066] in, The forecast results include the moisture content of the exported material and the water addition coefficient. Represents target feature information; The weight information representing the target feature information has a dimension of 2×10; The bias information represents the target feature information and has a dimension of 2×1.
[0067] Optionally, the method for predicting the amount of dry and wet moisture added to tobacco leaves also includes: training the prediction model.
[0068] Training the prediction model and continuously adjusting its parameters until it reaches convergence is achieved and training is complete. This process helps improve the accuracy of the predictions, which in turn improves the accuracy of the prediction results.
[0069] The technical solution of this embodiment obtains the first processing time and first dry-wet parameters of tobacco leaves. The first processing time includes processing year information, processing month information, and processing day information, providing accurate and comprehensive data support for subsequent analysis. Based on the first processing time, the first time characteristics are determined, including relative year characteristics, processing month characteristics, and weekday attributes, achieving accurate determination of the first time characteristics and providing accurate data support for subsequent analysis and processing. Based on the prediction model, the first time characteristics and the first dry-wet parameters are processed to obtain prediction results, including the moisture content of the outlet material and the water addition coefficient, achieving accurate prediction of the dry and wet water addition of tobacco leaves, providing accurate data support for subsequent tobacco leaf production.
[0070] Example 2
[0071] Figure 4This is a flowchart of a training method for a prediction model provided in Embodiment 2 of the present invention. This embodiment is applicable to the training of prediction models. The training method for this prediction model can be executed by a tobacco leaf moisture content prediction device. This device can be implemented in hardware and / or software and can be configured in the electronic device provided in this embodiment of the invention. The electronic device can be a server, computer, or mobile terminal, such as a mobile phone or tablet computer. Figure 4 As shown, the training method for this prediction model specifically includes the following steps:
[0072] S210. Construct the prediction model to be trained.
[0073] S220. Obtain the training dataset, which includes multiple training samples. Each training sample includes a second time feature, a second dry / wet parameter, the expected moisture content of the outlet material, and the expected water addition coefficient.
[0074] The second time feature refers to the data on the time characteristics of the wet and dry processing. This includes relative year characteristics, processing month characteristics, and weekday attributes. The second wet and dry parameter refers to the wet and dry process parameters set for the wet and dry processing equipment when processing tobacco leaves. These parameters include hot air temperature, inlet material moisture content, steam flow rate, and outlet temperature. The expected outlet material moisture content is the target value of the moisture content expected to be achieved after the wet and dry processing of the tobacco leaves. The expected water addition coefficient is the coefficient of water addition by the wet and dry processing equipment when the target moisture content of the tobacco leaves is expected to be achieved after the wet and dry processing. The training dataset can be obtained through a Manufacturing Execution System (MES) or a database. Specifically, obtaining the training dataset through a database provides comprehensive data support for training the prediction model.
[0075] S230. Adjust the parameters of the prediction model to be trained based on multiple training samples.
[0076] In this process, multiple training samples are input into the prediction model to be trained for processing. Based on the processing results of the prediction model, the parameters of the prediction model to be trained are adjusted until a well-trained prediction model is obtained, providing accurate model support for predicting the amount of water added to dry and wet tobacco leaves.
[0077] Figure 5 This is a schematic flowchart illustrating parameter adjustment according to an embodiment of the present invention. The parameter adjustment includes the following steps:
[0078] S231. Based on the prediction model to be trained, the second time feature and the second dry and wet parameters are processed to obtain the predicted moisture content of the outlet material and the predicted water addition coefficient.
[0079] The predicted moisture content of the outlet material is the predicted value of the moisture content of the tobacco leaves after dry and wet treatment. The predicted water addition coefficient is the predicted coefficient of the water addition amount of the dry and wet treatment equipment. By inputting the second time feature and the second dry and wet parameters into the prediction model to be trained, the predicted moisture content of the outlet material and the predicted water addition coefficient can be obtained simultaneously, providing data support for subsequent adjustment of model parameters.
[0080] S232. Determine the loss function based on the expected moisture content of the exported material, the expected water addition coefficient, the predicted moisture content of the exported material, and the predicted water addition coefficient.
[0081] The loss function includes, but is not limited to, mean squared error, mean absolute error, and root mean square error. The loss function is selected based on requirements and is not restricted here. For example, the mean squared error between the expected and predicted moisture content of the exported material, and the mean squared error between the expected and predicted water addition coefficients are calculated. The sum of these mean squared errors is then used as the loss function, achieving precise determination of the loss function.
[0082] It should be noted that the expected moisture content and expected water addition coefficient of the outlet material in the tobacco drying process can be different from those in the tobacco rehumidification process. The expected moisture content and expected water addition coefficient of the outlet material can be set according to production needs, and there are no restrictions here.
[0083] S233. When the loss function is greater than a preset threshold, the gradient information is determined based on the loss function, and the momentum information of the prediction model to be trained is determined based on the gradient information.
[0084] When the loss function exceeds a preset threshold, it indicates that the prediction results of the training prediction model are inaccurate, specifically the prediction of the moisture content of the exported material and the prediction of the water addition coefficient are inaccurate. The model parameters of the training prediction model can be adjusted. Gradient information can be determined based on the loss function. For example, the gradient information can be obtained by calculating the loss function using the gradient information calculation formula. Momentum information can also be determined based on the gradient information. For example, the momentum information can be obtained by calculating the gradient information using the momentum information calculation formula.
[0085] Specifically, when the loss function is greater than a preset threshold, the loss function is calculated according to the gradient information calculation formula to obtain the gradient information; the gradient information is calculated according to the momentum information calculation formula to obtain the momentum information, providing accurate and comprehensive data support for adjusting the model parameters of the prediction model to be trained.
[0086] S234. Adjust the model parameters of the prediction model to be trained based on momentum information.
[0087] Optionally, the momentum information includes first-order momentum information and second-order momentum information; the training method of the prediction model further includes: updating the first-order momentum information and second-order momentum information based on gradient information respectively to obtain updated first-order momentum information and updated second-order momentum information; and adjusting the model parameters based on the updated first-order momentum information and updated second-order momentum information.
[0088] The update of first-order momentum information can be achieved using the momentum update formula. For example, by obtaining the first-order momentum information from the previous training phase and substituting the gradient information and the first-order momentum information from the previous training phase into the momentum update formula, the updated first-order momentum information for the current phase can be obtained. The update of second-order momentum information can also be achieved using the momentum update formula. For example, by obtaining the second-order momentum information from the previous training phase and substituting the gradient information and the second-order momentum information from the previous training phase into the momentum update formula, the updated second-order momentum information for the current phase can be obtained. Model parameters can be adjusted based on the updated first-order and second-order momentum information. For example, by inputting the updated first-order and second-order momentum information into the parameter adjustment formula, the updated model parameters can be obtained. By incorporating gradient information and first-order momentum information from the previous training phase into the momentum information update formula, the updated first-order momentum information for the current phase is obtained. Similarly, by incorporating gradient information and second-order momentum information from the previous training phase into the momentum information update formula, the updated second-order momentum information for the current phase is obtained. This process enables the updating of both first-order and second-order momentum information, providing accurate data support for adjusting model parameters.
[0089] For example, the formula for updating first-order momentum information is as follows:
[0090] ;
[0091] in, This represents the first-order momentum information at stage t; This represents the first-order momentum information at stage t-1; The weight representing the first-order momentum information can be 0.9; Let represent the gradient information at stage t. The update formula for the second-order momentum information is as follows:
[0092] ;
[0093] in, This represents the second-order momentum information at stage t; This represents the second-order momentum information at stage t-1; The weight representing the second-order momentum information can be set to 0.9; This represents the gradient information at stage t.
[0094] Based on the above embodiments, the training method for this prediction model further includes: correcting the first-order momentum information and the second-order momentum information. For example, the correction formula for the first-order momentum information is as follows:
[0095] ;
[0096] in, This indicates the corrected first-order momentum information; This indicates the first-order momentum information before correction; The weight representing the first-order momentum information can be taken as 0.9. The correction formula for the second-order momentum information is as follows:
[0097] ;
[0098] in, This indicates the corrected second-order momentum information; This indicates the second-order momentum information before correction; The weight representing the second-order momentum information can be 0.9.
[0099] For example, the formula for parameter adjustment is as follows:
[0100] ;
[0101] in, Represents the model parameters at stage t; This represents the model parameters for stage t-1; Indicates the learning rate; This represents the first-order momentum information after correction at stage t; This represents the second-order momentum information after correction at stage t; Represents the numerical stability constant; This represents the weight decay coefficient, which is not involved in the calculation and updating of momentum information.
[0102] To prevent gradient explosion during the training of a prediction model, gradient information can be pruned.
[0103] Optionally, the training method for the prediction model further includes: determining the Euclidean distance corresponding to the gradient information based on the gradient information; clipping the gradient information based on the Euclidean distance to obtain clipped gradient information; and determining momentum information based on the clipped gradient information.
[0104] Specifically, by inputting the gradient information into the Euclidean distance calculation formula, the corresponding Euclidean distance can be obtained. Then, the gradient information is clipped based on this Euclidean distance to obtain clipped gradient information. This clipped gradient information is then used to update the momentum information, resulting in updated momentum information. This precise update of momentum information improves the accuracy of the prediction model.
[0105] For example, the formula for clipping gradient information is as follows:
[0106] ;
[0107] in, This represents the gradient information after clipping; This indicates the gradient information before clipping; This represents the Euclidean distance corresponding to the gradient information before clipping. This represents the threshold value, which can be set to 1.
[0108] The technical solution of this embodiment constructs a prediction model to be trained; obtains a training dataset, which includes multiple training samples, each of which includes a second time feature, a second wet / dry parameter, the expected moisture content of the outlet material, and the expected water addition coefficient, providing comprehensive data support for the training of the prediction model; processes the second time feature and the second wet / dry parameter based on the prediction model to be trained to obtain the predicted moisture content of the outlet material and the predicted water addition coefficient, providing data support for subsequent adjustment of model parameters; determines a loss function based on the expected moisture content of the outlet material, the expected water addition coefficient, the predicted moisture content of the outlet material, and the predicted water addition coefficient, achieving accurate determination of the loss function; when the loss function is greater than a preset threshold, determines gradient information based on the loss function, and determines the momentum information of the prediction model to be trained based on the gradient information, providing accurate and comprehensive data support for adjusting the model parameters of the prediction model to be trained; and adjusts the model parameters of the prediction model to be trained based on the momentum information, achieving precise adjustment of the model parameters, which is beneficial to improving the prediction accuracy of the prediction model.
[0109] Example 3
[0110] Figure 6 This is a schematic diagram of a tobacco leaf moisture prediction device provided in Embodiment 3 of the present invention. Figure 6 As shown, the device includes a data acquisition module 310, a first time feature determination module 320, and a prediction result determination module 330.
[0111] The data acquisition module 310 is used to acquire the first processing time and the first dry-wet parameters of the tobacco leaves. The first processing time includes processing year information, processing month information, and processing day information. The first time feature determination module 320 is used to determine the first time features based on the first processing time. The first time features include relative year features, processing month features, and weekday attributes. The prediction result determination module 330 is used to process the first time features and the first dry-wet parameters based on the prediction model to obtain the prediction results. The prediction results include the moisture content of the exported material and the water addition coefficient.
[0112] The technical solution of this embodiment acquires the first processing time and first dry-wet parameters of tobacco leaves through a data acquisition module. The first processing time includes processing year information, processing month information, and processing day information, providing accurate and comprehensive data support for subsequent analysis. A first time feature determination module determines first time features based on the first processing time. The first time features include relative year features, processing month features, and weekday attributes, achieving accurate determination of the first time features and providing accurate data support for subsequent analysis and processing. A prediction result determination module processes the first time features and first dry-wet parameters based on a prediction model to obtain prediction results. The prediction results include the moisture content of the outlet material and the water addition coefficient, achieving accurate prediction of the dry and wet water addition of tobacco leaves and providing accurate data support for subsequent tobacco leaf production.
[0113] Based on the above embodiments, optionally, the first time feature determination module 320 is further configured to: determine the relative year feature based on the processing year information; determine the processing month feature based on the processing month information; determine the weekday attribute based on the processing year information, processing month information and processing day information; and determine the first time feature based on the relative year feature, processing month feature and weekday attribute.
[0114] Optionally, the first time feature determination module 320 is also used to: determine the relative year feature based on the difference between the processing year information and the reference year information; determine the processing month feature based on the sine and cosine information corresponding to the processing month information; and determine the weekday attribute based on the Boolean information corresponding to the first processing time, wherein the Boolean information indicates whether the first processing time is a working day.
[0115] Optionally, the prediction model includes a first feature extraction module, a second feature extraction module, and a result determination module; wherein, the first feature extraction module extracts features from the first time feature and the first dry / wet parameter to obtain shallow feature information; the second feature extraction module extracts features from the shallow feature information to obtain target feature information; and the result determination module determines the prediction result based on the target feature information.
[0116] Optionally, the tobacco leaf dry and wet water addition prediction device also includes a model training module for training the prediction model.
[0117] Optionally, the model training module is also used for: constructing a prediction model to be trained; obtaining a training dataset, which includes multiple training samples, each training sample including a second time feature, a second wet / dry parameter, a desired outlet material moisture content, and a desired water addition coefficient; adjusting the parameters of the prediction model to be trained based on multiple training samples, wherein the parameter adjustment process is as follows: processing the second time feature and the second wet / dry parameter based on the prediction model to be trained to obtain the predicted outlet material moisture content and the predicted water addition coefficient; determining a loss function based on the desired outlet material moisture content, the desired water addition coefficient, the predicted outlet material moisture content, and the predicted water addition coefficient; when the loss function is greater than a preset threshold, determining gradient information based on the loss function, and determining the momentum information of the prediction model to be trained based on the gradient information; and adjusting the model parameters of the prediction model to be trained based on the momentum information.
[0118] Optionally, the momentum information includes first-order momentum information and second-order momentum information; the model training module is also used to: update the first-order momentum information and second-order momentum information respectively based on gradient information to obtain updated first-order momentum information and updated second-order momentum information; and adjust the model parameters based on the updated first-order momentum information and updated second-order momentum information.
[0119] Optionally, the model training module is also used to: determine the Euclidean distance corresponding to the gradient information based on the gradient information; perform a cropping process on the gradient information based on the Euclidean distance to obtain the cropped gradient information; and determine the momentum information based on the cropped gradient information.
[0120] The tobacco leaf dryness and wetness water addition prediction device provided in the embodiments of the present invention can execute the tobacco leaf dryness and wetness water addition prediction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0121] Example 4
[0122] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0123] like Figure 7As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0124] Multiple components in electronic device 10 are connected to input / output (I / O) interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0125] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a method for predicting the amount of moisture added to dry and wet tobacco leaves.
[0126] In some embodiments, a method for predicting the moisture content of tobacco leaves can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via read-only memory (ROM) 12 and / or communication unit 19. When the computer program is loaded into random access memory (RAM) 13 and executed by processor 11, one or more steps of the method for predicting the moisture content of tobacco leaves described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform a method for predicting the moisture content of tobacco leaves by any other suitable means (e.g., by means of firmware).
[0127] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0128] A computer program for implementing a method for predicting the amount of moisture added to dry tobacco leaves according to the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0129] Example 5
[0130] Embodiment 5 of the present invention also provides a computer-readable storage medium storing computer instructions for causing a processor to execute a method for predicting the amount of moisture added to dry tobacco leaves, the method comprising:
[0131] The first processing time and first dry-wet parameters of the tobacco leaves are obtained. The first processing time includes processing year information, processing month information, and processing day information. Based on the first processing time, the first time characteristics are determined. The first time characteristics include relative year characteristics, processing month characteristics, and weekday attributes. The first time characteristics and the first dry-wet parameters are processed based on the prediction model to obtain the prediction results, which include the moisture content of the exported material and the water addition coefficient.
[0132] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0134] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0135] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0136] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0137] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for predicting the amount of moisture added to tobacco leaves when they are dry or wet, characterized in that, include: The first processing time and first dry / wet parameters of the tobacco leaves are obtained, wherein the first processing time includes processing year information, processing month information, and processing day information; A first time feature is determined based on the first processing time, and the first time feature includes a relative year feature, a processing month feature, and a weekday attribute; The prediction model processes the first time feature and the first dry / wet parameter to obtain the prediction result, which includes the moisture content of the outlet material and the water addition coefficient.
2. The method according to claim 1, characterized in that, The determination of the first time feature based on the first processing time includes: The relative year characteristics are determined based on the processing year information; The characteristics of the processing month are determined based on the processing month information; The weekday attribute is determined based on the processing year information, the processing month information, and the processing day information; The first time feature is determined based on the relative year feature, the processing month feature, and the weekday attribute.
3. The method according to claim 2, characterized in that, The relative year feature is determined based on the difference between the processing year information and the reference year information; The processing month characteristics are determined based on the sine and cosine information corresponding to the processing month information; The weekday attribute is determined based on Boolean information corresponding to the first processing time, whereby the Boolean information indicates whether the first processing time is a weekday.
4. The method according to claim 1, characterized in that, The prediction model includes a first feature extraction module, a second feature extraction module, and a result determination module; The first feature extraction module extracts features from the first time feature and the first dry / wet parameter to obtain shallow feature information. The second feature extraction module extracts features from the shallow feature information to obtain target feature information; The result determination module determines the prediction result based on the target feature information.
5. The method according to claim 1, characterized in that, The method further includes: training the prediction model; The training process of the prediction model is as follows: Construct a prediction model to be trained; Obtain a training dataset, which includes multiple training samples, and each training sample includes a second time feature, a second dry / wet parameter, a desired outlet material moisture content, and a desired water addition coefficient. The parameters of the prediction model to be trained are adjusted based on the multiple training samples, wherein the parameter adjustment process is as follows: Based on the prediction model to be trained, the second time feature and the second dry and wet parameters are processed to obtain the predicted moisture content of the outlet material and the predicted water addition coefficient. The loss function is determined based on the expected moisture content of the exported material, the expected water addition coefficient, the predicted moisture content of the exported material, and the predicted water addition coefficient. When the loss function is greater than a preset threshold, gradient information is determined based on the loss function, and momentum information of the prediction model to be trained is determined based on the gradient information. The model parameters of the prediction model to be trained are adjusted based on the momentum information.
6. The method according to claim 5, characterized in that, The momentum information includes first-order momentum information and second-order momentum information; The method further includes: The first-order momentum information and the second-order momentum information are updated based on the gradient information to obtain the updated first-order momentum information and the updated second-order momentum information. The model parameters are adjusted based on the updated first-order momentum information and the updated second-order momentum information.
7. The method according to claim 5, characterized in that, The method further includes: Determine the Euclidean distance corresponding to the gradient information based on the gradient information; The gradient information is clipped based on the Euclidean distance to obtain clipped gradient information. The momentum information is determined based on the clipped gradient information.
8. A device for predicting the amount of moisture added to dry tobacco leaves, characterized in that, include: The data acquisition module is used to acquire the first processing time and the first dry and wet parameters of the tobacco leaves. The first processing time includes processing year information, processing month information and processing day information. The first time feature determination module is used to determine a first time feature based on the first processing time, wherein the first time feature includes a relative year feature, a processing month feature, and a weekday attribute. The prediction result determination module is used to process the first time feature and the first dry and wet parameters based on the prediction model to obtain the prediction result, which includes the moisture content of the outlet material and the water addition coefficient.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method for predicting the amount of dry and wet tobacco leaves according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the method for predicting the amount of dry and wet tobacco leaves as described in any one of claims 1-7.