Tobacco shred moisture early warning method, tobacco shred moisture early warning device and storage medium

Through the improved hunter prey optimization algorithm training nuclear limit learning machine model, combined with the variational autoencoder and radial basis kernel function, the problem of inaccurate moisture warning in tobacco production is solved, and higher warning accuracy and product quality control are achieved.

CN120356308APending Publication Date: 2025-07-22CHINA TOBACCO ZHEJIANG IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510436324.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

In the prior art, moisture warning during tobacco production is inaccurate, resulting in a decline in the quality of cigarette products.

Method used

The improved hunter prey optimization algorithm is used to train the nuclear limit learning machine prediction model, and the alarm data characteristics are extracted through the variational autoencoder, combined with the radial basis kernel function to predict the moisture of tobacco, and an early warning is issued when the threshold is exceeded.

Benefits of technology

Improve the accuracy of moisture warning during tobacco production and ensure the quality and production efficiency of cigarette products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120356308A_ABST
    Figure CN120356308A_ABST
Patent Text Reader

Abstract

The invention relates to a tobacco shred moisture early warning method, a tobacco shred moisture early warning device and a storage medium, and the tobacco shred moisture early warning method comprises the following steps: obtaining a to-be-detected tobacco shred sample; inputting the to-be-detected tobacco shred sample into a pre-trained tobacco shred moisture prediction model to obtain a tobacco shred moisture prediction result; wherein the pre-trained cut tobacco moisture prediction model is obtained by training a preset kernel extreme learning machine prediction model by adopting an improved hunter prey optimization algorithm; judging whether the tobacco shred moisture prediction result exceeds a preset moisture threshold value or not; and if yes, sending out an early warning prompt. According to the invention, the problem of inaccurate moisture early warning in the tobacco shred production process is solved, and the accuracy of moisture early warning in the tobacco shred production process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of tobacco detection, in particular to a method for warning of tobacco moisture, a device for warning of tobacco moisture, and a storage medium. Background Art

[0002] In cigarette cut tobacco production, the moisture content of cut tobacco plays a crucial role, which is directly related to multiple key aspects such as the appearance, taste, and combustion performance of cigarettes. To ensure that the cigarette quality meets high standards and conforms to the production process requirements, it is essential to accurately control the moisture content of tobacco raw silk. However, the moisture content of cut tobacco is affected by many factors interacting with each other during the cut tobacco production process, making it difficult to stably maintain the moisture accuracy of the finished cut tobacco. Therefore, how to achieve the smoothness and accuracy of moisture control in each process has always been the core problem that cigarette production enterprises urgently need to solve.

[0003] In cigarette production practice, tobacco leaves, as the core raw material of cigarette enterprises, are transformed into standardized industrial raw materials after being processed by the threshing and redrying process. Subsequently, these raw materials successively undergo a series of tobacco cut tobacco processes such as loose rewetting, leaf moistening and flavoring, leaf storage, cutting, and cut tobacco drying. During this process, the moisture content of cut tobacco must meet the cut tobacco process standards. For this purpose, cigarette processing factories are equipped with sensors in key processes such as raw material preparation, rewetting, leaf storage, and cut tobacco storage for real-time monitoring and control, and issuing alarms in a timely manner when abnormal situations occur.

[0004] However, the cigarette production process is complex and has many processes, and different types of alarms may be triggered in each production link. These alarms reflect abnormal situations in the production process, which in turn affect the moisture content of the final cut tobacco, resulting in a decline in the quality of cigarette products. For example, in the rewetting or leaf storage process, there may be alarms such as abnormal SIROX temperature monitoring alarm or abnormal monitoring alarm of the moisture content at the outlet of pre-cut leaf moistening. The influence degrees of these alarm types on the moisture content of the cut tobacco finished product are different.

[0005] To better address this challenge, a study has deeply analyzed and mined the occurrence frequencies of different alarm types in cigarette factories in the past two years and the data series of the change of cut tobacco moisture over time. The purpose of the study is to establish a cut tobacco moisture trend prediction model that can capture the trends, periodicity, and seasonal change rules of cut tobacco moisture over time. In this way, a practical solution is provided for the effective management and control of cut tobacco moisture, which has important practical significance.

[0006] In recent years, methods such as multiple linear regression and neural network segmented modeling have been applied to the prediction of cut tobacco moisture. However, due to the sparsity of alarm data in the cut tobacco production process usually shown in the time series, these methods are difficult to effectively capture the unevenly distributed relationships between alarm features. In addition, they have deficiencies in processing time series data and are prone to missing key information therein. These problems may lead to a decline in the fitting and prediction accuracy of the model and at the same time reduce the robustness of the algorithm.

[0007] Regarding the problem of inaccurate moisture warning in the cut tobacco production process in the related art, no effective solution has been proposed yet. Summary of the Invention

[0008] In this embodiment, a cut tobacco moisture warning method, a cut tobacco moisture warning device and a storage medium are provided to solve the problem of inaccurate moisture warning in the cut tobacco production process in the related art.

[0009] In a first aspect, in this embodiment, a cut tobacco moisture warning method is provided, including:

[0010] Obtain a cut tobacco sample to be detected;

[0011] Input the cut tobacco sample to be detected into a pre-trained cut tobacco moisture prediction model to obtain a cut tobacco moisture prediction result; wherein, the pre-trained cut tobacco moisture prediction model is obtained by training a preset kernel extreme learning machine prediction model using an improved hunter-prey optimization algorithm;

[0012] Judge whether the cut tobacco moisture prediction result exceeds a preset moisture threshold;

[0013] If so, issue a warning prompt.

[0014] In some of the embodiments, the training process of the cut tobacco moisture prediction model includes:

[0015] Obtain various types of alarm data related to moisture in the cigarette production process of different batches;

[0016] Input the various types of alarm data into a variational autoencoder model for feature reconstruction to obtain characteristic variables of potential alarm types;

[0017] Based on the characteristic variables of the potential alarm types, train the kernel extreme learning machine prediction model, and in the training process, use the improved hunter-prey optimization algorithm to perform hyperparameter optimization on the kernel extreme learning machine prediction model to obtain a trained cut tobacco moisture prediction model.

[0018] In some of the embodiments, before inputting the various types of alarm data into the variational autoencoder model for feature reconstruction, it further includes:

[0019] Clean the outlier and standardize all kinds of warning data to obtain standardized warning data;

[0020] Perform maximum-minimum normalization on the standardized warning data to obtain various target warning data.

[0021] In some embodiments, inputting all kinds of warning data into a variational autoencoder model for feature reconstruction to obtain characteristic variables of potential warning types, including:

[0022] Input all kinds of warning data into the variational autoencoder model, wherein the variational autoencoder model includes an encoder and a decoder;

[0023] Map all kinds of warning data to a low-dimensional coding space through the encoder, and output initial characteristic variables of potential warning types;

[0024] Collect a target characteristic variable of potential warning type from the initial characteristic variables of potential warning types;

[0025] Map the target characteristic variable of potential warning type to the data space through the decoder to generate reconstructed data;

[0026] Calculate the reconstruction loss according to the reconstructed data, and measure the reconstruction quality of the variational autoencoder model for all kinds of warning data according to the reconstruction loss.

[0027] In some embodiments, using the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain a trained cut tobacco moisture prediction model, including:

[0028] Initialize the population position, and randomly generate the positions of the hunter and the prey of the hunter-prey optimization algorithm;

[0029] According to the selection mechanism of the hunter's behavior, generate a random number, and judge whether the random number is less than a preset adjustment parameter. If so, execute the hunter search mechanism to obtain a new hunter position; otherwise, execute the prey escape mechanism to obtain a new prey position;

[0030] Calculate the fitness value based on the new hunter position and the new prey position;

[0031] Compare whether the new prey position is better than the previous prey position according to the fitness value. If so, iterate the previous prey position with the new prey position and continue the optimization until the new prey position is inferior to the previous prey position, stop the optimization, and use the new prey position as the target optimization parameter of the kernel extreme learning machine prediction model;

[0032] Optimize the parameters of the kernel extreme learning machine prediction model with the target optimization parameters to obtain a trained cut tobacco moisture prediction model.

[0033] In some embodiments, the target optimization parameters include the regularization parameter and the kernel parameter of the kernel extreme learning machine prediction model.

[0034] In some embodiments, after using the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain a trained cut tobacco moisture prediction model, it further includes:

[0035] Divide the various types of alarm data into training set data and test set data;

[0036] Input the test set data into the trained cut tobacco moisture prediction model to output a test cut tobacco moisture prediction result;

[0037] Calculate the mean square error, root mean square error, and mean absolute percentage error between the test cut tobacco moisture prediction result and the true value of the cut tobacco moisture;

[0038] Evaluate the accuracy of the trained cut tobacco moisture prediction model according to the mean square error, root mean square error, and mean absolute percentage error;

[0039] Fit the trained cut tobacco moisture prediction model based on the accuracy evaluation.

[0040] In some embodiments, the kernel function of the kernel extreme learning machine prediction model uses a radial basis kernel function.

[0041] In a second aspect, a cut tobacco moisture warning device is provided in this embodiment, including: an acquisition module, a prediction module, and a warning module, where

[0042] The acquisition module is used to acquire a cut tobacco sample to be detected;

[0043] The prediction module is used to input the cut tobacco sample to be detected into a pre-trained cut tobacco moisture prediction model to obtain a cut tobacco moisture prediction result; wherein, the pre-trained cut tobacco moisture prediction model is trained based on a kernel extreme learning machine prediction model using an improved hunter-prey optimization algorithm;

[0044] The warning module is used to issue a warning prompt when it is detected that the cut tobacco moisture prediction result exceeds a preset difference threshold.

[0045] In a third aspect, in the present embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the tobacco moisture warning method described in the first aspect above are implemented.

[0046] Compared with the related art, in the tobacco moisture warning method provided in the present embodiment, by obtaining a tobacco sample to be detected; inputting the tobacco sample to be detected into a pre-trained tobacco moisture prediction model to obtain a tobacco moisture prediction result; wherein, the pre-trained tobacco moisture prediction model is obtained by training a preset kernel extreme learning machine prediction model using an improved hunter-prey optimization algorithm; determining whether the tobacco moisture prediction result exceeds a preset moisture threshold; if so, issuing a warning prompt. It solves the problem of inaccurate moisture warning in the tobacco production process and improves the accuracy of moisture warning in the tobacco production process.

[0047] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0049] Figure 1 is a hardware structure block diagram of a terminal of the tobacco moisture warning method in the present embodiment.

[0050] Figure 2 is a flowchart of the tobacco moisture warning method in the present embodiment.

[0051] Figure 3 is a variational autoencoder topology diagram of the tobacco moisture prediction method in the present embodiment.

[0052] Figure 4 is a convergence curve diagram of the hunter-prey optimization algorithm of the tobacco moisture warning method in the present embodiment.

[0053] Figure 5 is a training set error diagram of the tobacco moisture prediction model of the tobacco moisture warning method in the present embodiment on the training set.

[0054] Figure 6 is a comparison diagram of the prediction result and the true moisture data of the tobacco moisture prediction model of the tobacco moisture warning method in the present embodiment on the test set.

[0055] Figure 7 is a structure block diagram of the tobacco moisture warning device in the present embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0056] To more clearly understand the purpose, technical solution and advantages of the present application, the present application will be described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0057] Unless otherwise defined, the technical terms or scientific terms involved in the present application shall have the general meanings understood by those with ordinary skills in the technical field to which the present application belongs. In the present application, words such as "a", "one", "kind", "the", "these" and the like do not indicate a limitation in quantity, and they can be singular or plural. The terms "including", "comprising", "having" and any variations thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products or devices. The terms "connected", "coupled" and the like involved in the present application do not limit to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "plurality" involved in the present application means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the objects associated before and after are an "or" relationship. The terms "first", "second", "third" and the like involved in the present application only distinguish similar objects and do not represent a specific sorting for the objects.

[0058] The method embodiment provided in this embodiment can be executed on a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is the hardware structure block diagram of the terminal of the tobacco moisture warning method in this embodiment. As Figure 1 shown, the terminal may include one or more ( Figure 1 only one is shown in Figure 1 the figure) processors 102 and a memory 104 for storing data. Among them, the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a field programmable gate array FPGA. The above terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 the structure shown in Figure 1 the figure is only schematic and does not limit the structure of the above terminal. For example, the terminal may further include more or fewer components than those shown in

[0059] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the tobacco moisture early warning method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0060] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0061] In this embodiment, a tobacco moisture early warning method is provided. Figure 2 : is a flow chart of the tobacco moisture early warning method of this embodiment, such as Figure 2 As shown, the process includes the following steps:

[0062] Step S201, obtaining a tobacco sample to be tested;

[0063] Specifically, a tobacco sample that needs to be tested for moisture is obtained, wherein the obtaining method can be a direct sampling method, in which the tobacco sample is directly obtained from the production line or storage area. For example, a certain amount of samples are randomly selected from the finished tobacco for testing; or a crushing method is used to dry the tobacco at a low temperature and then crush it into tobacco powder, and then take an appropriate amount of tobacco powder as a sample. The specific sampling method can be selected according to the actual situation, and this embodiment does not specifically limit this.

[0064] Step S202, inputting the tobacco sample to be tested into the pre-trained tobacco moisture prediction model to obtain the tobacco moisture prediction result; wherein the pre-trained tobacco moisture prediction model is obtained by training the preset kernel extreme learning machine prediction model using the improved hunter-prey optimization algorithm.

[0065] Specifically, the Kernel Extreme Learning Machine (KELM) is an improved model based on the Extreme Learning Machine (ELM), which combines the advantages of the kernel method and is applicable to regression and classification tasks. KELM can handle nonlinear problems by introducing kernel functions, and has the characteristics of fast training speed and good generalization performance. In this embodiment, the kernel extreme learning machine is used as the prediction model for cut tobacco moisture. On this basis, the hunter-prey optimization algorithm is combined to train the kernel extreme learning machine prediction model. Among them, the core idea of the hunter-prey optimization algorithm is to simulate the chasing and evading behaviors between hunters and prey. In this algorithm: Hunter (Predator): Represents the "searcher" in the optimization problem and is responsible for finding the optimal solution. Prey: Represents the "target solution" in the optimization problem, and the hunter needs to continuously adjust its strategy to approach the prey. The dynamic relationship between the hunter and the prey includes:

[0066] Chasing behavior: The hunter adjusts its position according to the position of the prey to gradually approach the prey.

[0067] Evading behavior: The prey adjusts its position according to the position of the hunter to avoid the hunter.

[0068] Environmental feedback: The behaviors of the hunter and the prey will be feedback by the environment (i.e., the objective function of the optimization problem), so as to continuously adjust the strategy. Through this dynamic interaction, the hunter can finally find the position of the prey, that is, the optimal solution of the optimization problem.

[0069] The regularization parameter and kernel parameter of the kernel extreme learning machine prediction model are optimized by the hunter-prey optimization algorithm to obtain the trained cut tobacco moisture prediction model, which improves the prediction accuracy and generalization ability of the cut tobacco moisture prediction model. The cut tobacco sample to be detected is input into the trained cut tobacco moisture prediction model to obtain the cut tobacco moisture prediction result.

[0070] Step S203, determine whether the cut tobacco moisture prediction result exceeds the preset moisture threshold; if so, issue a warning prompt.

[0071] Compare the predicted tobacco moisture results obtained from the detection with the preset tobacco moisture quality standard (i.e., moisture threshold) in actual production. If it exceeds the preset moisture threshold, a warning prompt is issued to remind the staff to take measures in a timely manner according to the warning information, so as to ensure the product quality and production efficiency. Among them, the warning prompt can be presented in various ways. For example, audible and visual alarm: An audible and visual alarm signal is issued at the production site to remind the staff to pay attention. SMS notification: Send an SMS notification to the relevant person in charge to inform the specific abnormal situation and warning information. System prompt: Display the warning information on the production monitoring system interface, including detailed information such as the abnormal location, moisture value, and the range exceeding the threshold. In addition, the warning information can be further classified according to the severity of the moisture abnormality. The warning is divided into different levels, such as level 1 warning (slightly exceeding the threshold), level 2 warning (severely exceeding the threshold), and level 3 warning (severely exceeding the standard). Different levels of warnings can trigger different response measures to ensure that problems can be handled in a timely and effective manner.

[0072] Through the above steps S201 to S203, a tobacco sample to be detected is obtained; the tobacco sample to be detected is input into the pre-trained tobacco moisture prediction model to obtain the tobacco moisture prediction result; among them, the pre-trained tobacco moisture prediction model is obtained by training the preset kernel extreme learning machine prediction model using the improved hunter-prey optimization algorithm; determine whether the tobacco moisture prediction result exceeds the preset moisture threshold; if so, issue a warning prompt. Compared with the prior art in which the tobacco moisture is predicted by methods such as multiple linear regression and neural network segmented modeling, in this embodiment, the preset kernel extreme learning machine prediction model is trained by the hunter-prey optimization algorithm to improve the accuracy of the kernel extreme learning machine prediction model, and the trained tobacco moisture prediction model is obtained. The moisture of the tobacco sample is detected by the trained tobacco moisture prediction model, so as to improve the accuracy of the tobacco moisture detection. When the moisture value exceeds the preset moisture threshold, a warning prompt is initiated to improve the accuracy of the moisture warning in the tobacco production process.

[0073] In some of these embodiments, the training process of the tobacco moisture prediction model includes:

[0074] Obtain various warning data related to moisture in the production process of different batches of cigarettes; input the various warning data into the variational autoencoder model for feature reconstruction to obtain the characteristic variables of the potential warning types; based on the characteristic variables of the potential warning types, train the kernel extreme learning machine prediction model, and in the training process, use the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain the trained tobacco moisture prediction model.

[0075] Specifically, the preset tobacco moisture prediction model is trained to improve the accuracy of the tobacco moisture prediction model. The training process includes:

[0076] S1, obtain various warning data related to moisture in the cigarette production process of different batches.

[0077] Specifically, in order to improve the accuracy of the cut tobacco moisture prediction model, various warning data related to the moisture of cut tobacco products in each process under different batches during the actual production process of the cigarette factory in the past two years are collected. Among them, 6732 pieces of warning data are collected in this experiment, including 36 warning types.

[0078] S2, input various warning data into the variational autoencoder model for feature reconstruction to obtain the characteristic variables of potential warning types.

[0079] Specifically, first establish a variational autoencoder model for the cut tobacco moisture prediction model, input various warning data into the variational autoencoder model, and map the input various warning data to the variable space distribution through the variational autoencoder to obtain the characteristic variables of potential warning types.

[0080] S3, based on the characteristic variables of potential warning types, train the kernel extreme learning machine prediction model, and in the training process, use the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain the trained cut tobacco moisture prediction model.

[0081] Specifically, select the kernel function of the kernel extreme learning machine (KELM) model. Among them, the kernel function can be a linear kernel function, a polynomial kernel function, a radial basis kernel function, a Laplace kernel function, an exponential kernel function, etc. In this embodiment, the radial basis kernel function is used as the kernel function of the kernel extreme learning machine (KELM) model, where KELM is expressed as:

[0082] f(z) = h(z)β = Hβ;

[0083] where z represents different batch samples, f(z) represents the output of the neural network, h(z) and H represent the hidden layer feature mapping matrix, and β represents the weight between the hidden layer and the output layer, where,

[0084]

[0085] where T represents the target vector of the training samples, I is the identity matrix, and C is the regularization parameter;

[0086] Assign a small value to the mapping of the feature h(z) to obtain the kernel function Ω = HH T , so as to obtain the representation of the kernel extreme learning machine (KELM) model:

[0087]

[0088] In the kernel function, the radial basis kernel function is expressed as:

[0089] K(z,y)=exp(-γ||zy|| 2 );

[0090] Among them, γ is the kernel parameter.

[0091] The hunter-prey optimization algorithm HPO is used to perform hyperparameter optimization on the regularization parameter C and the kernel parameter γ, and the optimal C and γ values are assigned to the kernel extreme learning machine KELM model to obtain the trained tobacco moisture prediction model.

[0092] By using various types of moisture-related alarm data from the production process of different batches of cigarettes to train the preset nuclear extreme learning machine prediction model, the generalization ability of the model is improved. Then, the hunter-prey optimization algorithm is used to optimize the hyperparameters of the nuclear extreme learning machine prediction model to improve the accuracy of moisture detection in the tobacco moisture detection model.

[0093] In another embodiment, before inputting various types of alarm data into the variational autoencoder model for feature reconstruction, the method further includes:

[0094] Perform outlier cleaning and standardization on various types of alarm data to obtain standardized alarm data; perform maximum and minimum normalization on the standardized alarm data to obtain various types of target alarm data.

[0095] Specifically, before the various types of alarm data obtained in step S1 are input into the variational autoencoder model for feature reconstruction, the various types of alarm data are preprocessed. According to the 3σ principle, the value of the result value of the alarm type that deviates from the mean value by more than three times the standard deviation is regarded as an outlier, and all data points of each alarm type are traversed to check whether each value exceeds the above threshold range. If exceeded, the data point is marked as an outlier and removed to achieve standardization of the data point and obtain standardized alarm data. After removing the outliers, the remaining alarm data, i.e., the standardized alarm data, is normalized to the maximum and minimum, and normalized, and the number of different alarm types is mapped to [0,1] to obtain various types of target alarm data. Thereby eliminating the difference in feature dimensions, making the model training more stable, and making the features of different alarm types have the same scale. The normalized data can better adapt to the machine learning model and improve the accuracy and generalization ability of the model.

[0096] In some of these embodiments, various types of alarm data are input into a variational autoencoder model for feature reconstruction to obtain feature variables of potential alarm types, including: inputting various types of alarm data into the variational autoencoder model, where the variational autoencoder model includes an encoder and a decoder; mapping various types of alarm data to a low-dimensional coding space through the encoder, and outputting initial feature variables of potential alarm types; collecting a target feature variable of a potential alarm type from the initial feature variables of potential alarm types; mapping the target feature variable of the potential alarm type to the data space through the decoder to generate reconstructed data; calculating a reconstruction loss based on the reconstructed data, and measuring the reconstruction quality of the variational autoencoder model for various types of alarm data according to the reconstruction loss.

[0097] Specifically, Figure 3 is the variational autoencoder topology diagram of the cut tobacco moisture prediction method in this embodiment. The steps for feature reconstruction in the above step S2 are as follows:

[0098] S21. First, define an encoder (E) and a decoder (D) for the variational autoencoder model. The encoder (E) maps the input alarm data x to the latent variable space distribution q (low-dimensional coding space),

[0099] q(z|x) = N(μ(x), σ(x) 2 );

[0100] where μ(x) is the mean of the latent variable, σ(x) is the standard deviation of the latent variable, and N is the Gaussian distribution.

[0101] Mapping the high-dimensional original data to the low-dimensional coding space can remove redundant information and extract more representative and discriminative features, thereby improving the efficiency and performance of the model.

[0102] S22. Output the initial feature variables of potential alarm types.

[0103] S23. Then, sample a latent variable z from the mean and standard deviation output by the encoder (E) as the target feature variable of the potential alarm type,

[0104] z = μ(x) + ε × σ(x);

[0105] where ε is the noise sampled from the standard normal distribution N(0, 1).

[0106] S24. The decoder (D) maps the latent variable z to the data space to generate reconstructed data where,

[0107]

[0108] where D is the mapping function of the decoder.

[0109] S25 defines the reconstruction loss through the KL divergence,

[0110]

[0111] where E(x) is the probability distribution of the original data x, and D(z) is the probability distribution of the reconstructed data of.

[0112] The KL divergence is an asymmetric measure that quantifies the difference between two probability distributions E(x) and D(z). In a variational autoencoder, the KL divergence is used to measure the difference in probability distributions between the original sample x and the reconstructed sample between. By calculating the difference between the original sample x and between, the quality of the reconstruction can be measured. During training, by minimizing the KL divergence, the parameters of the encoder and decoder can be optimized so that the probability distribution of the reconstructed data is as close as possible to the probability distribution of the original data x.

[0113] The input data is mapped to the latent space and reconstructed back to the data space through the encoder and decoder of the variational autoencoder, and then the KL divergence is used as the loss function to measure the difference between the original data and the reconstructed data, and the model is optimized by minimizing this difference. It can help the variational autoencoder learn an effective representation of the data while ensuring the quality of the reconstructed data, ultimately improving the accuracy of moisture detection of the trained cut tobacco moisture prediction model, thereby improving the accuracy of moisture warning during the cut tobacco production process.

[0114] In another embodiment, the improved hunter-prey optimization algorithm is used to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain the trained cut tobacco moisture prediction model, including:

[0115] Initialize the population positions, randomly generate the positions of the hunters and the prey in the hunter-prey optimization algorithm; according to the selection mechanism of the hunter's behavior, generate a random number, and determine whether the random number is less than the preset adjustment parameter. If so, execute the hunter search mechanism to obtain a new hunter position; otherwise, execute the prey escape mechanism to obtain a new prey position; calculate the fitness value based on the new hunter position and the new prey position; compare whether the new prey position is better than the previous prey position according to the fitness value. If so, iterate the previous prey position with the new prey position and continue the optimization until the new prey position is inferior to the previous prey position or the preset number of iterations is reached, stop the optimization, and use the new prey position as the target optimization parameter of the kernel extreme learning machine prediction model; optimize the parameters of the kernel extreme learning machine prediction model through the target optimization parameter to obtain the trained cut tobacco moisture prediction model; otherwise, continue the optimization based on the new hunter position and the new prey position until the preset number of iterations is completed, stop the optimization, and obtain the trained cut tobacco moisture prediction model.

[0116] Specifically, in the above step S3, the specific process of training the kernel extreme learning machine prediction model using the improved hunter-prey optimization algorithm is as follows:

[0117] S31. First, initialize the population positions, and randomly generate the positions of the hunters and the prey in the hunter-prey optimization algorithm. The specific position generation formula is as follows:

[0118] a n = rand(1, d)*(u - 1)+1;

[0119] where a n represents the position of the population member (hunter or prey), u and 1 are the upper and lower limit values of the search space, and d represents the dimension of the problem.

[0120] The hunter-prey optimization algorithm includes a hunter search strategy and a prey escape strategy.

[0121] S32. Introduce the hunter search strategy and update the hunter position as:

[0122] a i,j (t + 1)= a i,j (t)+0.5[(2QZP pos(j) - a i,j (t))+(2(1 - Q)Zτ (j) - a i,j (t))];

[0123] where a i,j (t) is the current position of the hunter, a i,j (t + 1) is the next position of the hunter, P pos(j) is the position of the target prey, τ(j) is the mean of the hunter's and the prey's positions, Z is an adaptive parameter used to adjust the step size of the hunter's movement, and Q is a balance parameter between exploration and exploitation.

[0124]

[0125] where t is the current iteration number, and t max is the maximum iteration number.

[0126] The position of the hunter is updated by combining the position of the prey and the mean of the hunter's and the prey's positions, thus simulating the behavior of the hunter chasing the prey. By introducing the adaptive parameter Z and the balance parameter Q, the algorithm can balance between exploration (searching for new possible solutions) and exploitation (utilizing known optimal solutions).

[0127] S33. Introduce the prey escape strategy. In the hunter-prey optimization algorithm, the safest position of the prey is the global best position. Update the prey's position as:

[0128] a i,j (t + 1) = T pos(j) + CZcos(2πR)*(T pos(j) - a i,j (t));

[0129] where a i,j (t) represents the current position of the prey, and a i,j (t + 1) is the next position of the prey. T pos(j) is the target position of the prey, C is an adaptive parameter used to control the step size of the prey's movement, Z is a scaling factor related to the current state or environment of the prey, and R is a random number in the range of [-1, 1] used to introduce randomness and simulate the irregular escape path of the prey.

[0130] The goal of the prey is to update its position to move away from the hunter and find a safer position. This is achieved by moving towards the target position T pos(j) and adding a random component that simulates the evasive behavior of the prey.

[0131] S34. According to the selection mechanism of the hunter's behavior, set a regulation parameter δ, which is used to control the selection mechanism of the hunter's behavior. Generate a random number R1 in the range of [-1, 1], and compare the random number R1 with the regulation parameter δ. If R1 is less than δ, execute the hunter search mechanism, which means the algorithm will adopt an active search strategy to find a better solution and obtain a new hunter position. If R1 is greater than or equal to δ, trigger the prey escape mechanism, which means the algorithm will simulate the behavior of the prey evading the hunter, may adopt a conservative strategy to avoid falling into a local optimum, and obtain a new prey position.

[0132] S35. Calculate the fitness value based on the new hunter position and the new prey position. The fitness value is the prediction error of the kernel extreme learning machine model and is used to evaluate the quality of the current solution. If the new prey position is better than the previous prey position, compare and save the current best prey position T pos , use the current best prey position T pos as the new previous prey position to continue the optimization, obtain the new prey position, continue to compare whether the new prey position is better than the previous prey position, and continuously iterate and update in this way until the latest prey position obtained is inferior to the previous prey position, or the maximum number of iterations is reached, then stop the optimization. And use the latest prey position obtained as the target optimization parameter of the kernel extreme learning machine prediction model. Figure 4 is the convergence curve graph of the hunter-prey optimization algorithm for the tobacco moisture warning method in this embodiment. As Figure 4 shown, the hunter-prey optimization algorithm has reached a stable state in the fifth generation and can find the optimal solution of the kernel extreme learning machine prediction model in a relatively short time.

[0133] S36. Optimize the parameters of the kernel extreme learning machine prediction model through the target optimization parameters to obtain the trained tobacco moisture prediction model.

[0134] By simulating the behaviors of hunters and prey to dynamically adjust the optimization search strategy, the optimal solution to the problem can be efficiently found in the hunter-prey optimization algorithm. This strategy enables the tobacco moisture prediction model to conduct extensive searches in the early stage and fine searches in the later stage to increase the probability of finding the global optimal solution.

[0135] In some of these embodiments, the target optimization parameters include the regularization parameter and the kernel parameter of the kernel extreme learning machine prediction model.

[0136] In the above step S35, the target optimization parameters in this embodiment are the regularization parameter and the kernel parameter of the kernel extreme learning machine prediction model. Among them, the regularization parameter C controls the fitting degree of the model to the training data. A larger C value will make the model fit the training data more strictly, which may lead to overfitting; a smaller C value may lead to underfitting. Find a suitable C value so that the model has a good fit on the training data and also has good generalization ability on the test data. The kernel parameter determines the behavior of the kernel function, and the kernel function is used to map the input data to a high-dimensional space for linear separation in this space. Common kernel functions include the Gaussian kernel (RBF), polynomial kernel, Sigmoid kernel, etc., and each kernel function has its specific parameters. Select a suitable kernel function and its parameters so that the model can effectively process nonlinear data and improve the accuracy of classification or regression.

[0137] In another embodiment, after using the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model and obtaining the trained cut tobacco moisture prediction model, the following steps are further included:

[0138] Divide various types of alarm data into training set data and test set data; input the test set data into the trained cut tobacco moisture prediction model to output the predicted results of the test cut tobacco moisture; calculate the mean square error, root mean square error, and mean absolute percentage error between the predicted results of the test cut tobacco moisture and the true values of the cut tobacco moisture; evaluate the accuracy of the trained cut tobacco moisture prediction model based on the mean square error, root mean square error, and mean absolute percentage error; and perform fitting on the trained cut tobacco moisture prediction model based on the accuracy evaluation.

[0139] Specifically, divide various types of alarm data into a 70% training set and a 30% test set, input the test set into the trained cut tobacco moisture prediction model to output the predicted results of the test cut tobacco moisture, calculate the mean square error (MSE), root mean square error (RMSE), and mean absolute percentage error (MAPE) between the predicted results of the test cut tobacco moisture and the true values of the cut tobacco moisture, and evaluate the accuracy of the prediction.

[0140] Figure 5 is the training set error graph of the cut tobacco moisture prediction model of the cut tobacco moisture warning method in this embodiment, as Figure 5 shown, the horizontal axis represents the index of the training samples or the number of training iterations, and the vertical axis represents the error value. Figure 5 It shows the change of the error during the training process of the kernel extreme learning machine optimized by the hunter-prey optimization algorithm (HPO-KELM). Among them, the error value shows large fluctuations during the training process, indicating that there are differences in the fitting degree of the model on different samples; the error value fluctuates between -0.8 and 0.8, indicating that the difference between the predicted value and the true value of the model changes within this range; although there are fluctuations in the error, there is no systematic deviation (for example, the error value does not continuously increase or decrease), indicating that there is no obvious overfitting or underfitting phenomenon in the model on the training set; since the error value is relatively small, this indicates that the HPO-KELM model performs well on the training set, and the hunter-prey optimization algorithm plays a positive role in finding the optimal parameters.

[0141] Figure 6 is the comparison graph between the predicted results of the cut tobacco moisture prediction model of the cut tobacco moisture warning method in this embodiment and the true moisture data on the test set. As Figure 6As shown, the blue circles are the real moisture data, representing the actual moisture content of each sample in the test set; the red asterisks are the prediction results of the HPO-KELM model, representing the predicted values of the moisture content of each sample in the test set by the model. The horizontal axis represents the sample index in the test set, ranging from 0 to 2000. The vertical axis represents the numerical value of the moisture content, with a range of approximately between 11.2% and 12.8%. As Figure 6 shown, most of the red prediction result line coincides with the blue actual data points, indicating that the prediction result of the model is very close to the true value, and the model has high prediction accuracy. The fluctuation range of the prediction results is similar to that of the real data, indicating that the model has good prediction stability on different samples and there is no systematic deviation. Since this is the result on the test set and the model performs well on unseen data, it shows that the model has good generalization ability and can be well generalized to new data. Thus, the tobacco moisture warning model based on variational autoencoder - adaptive kernel extreme learning machine (HPO-KELM) performs well on the test set, with high prediction accuracy and stability. The model can effectively learn from the input data and predict the moisture content of tobacco, and is applicable to actual tobacco moisture warning and quality control applications.

[0142] In some of these embodiments, the kernel function of the kernel extreme learning machine prediction model adopts the radial basis kernel function.

[0143] In this embodiment, the kernel function of the kernel extreme learning machine prediction model adopts the radial basis kernel function (RadialBasis Function, RBF). By using the radial basis kernel function, the model can map the input data to a high-dimensional feature space, where the data points may be more easily linearly separable in this space. This mapping is achieved through the RBF kernel function without explicitly calculating the high-dimensional feature vectors, improving the model's fitting ability and prediction accuracy for complex data and enhancing the model's performance.

[0144] In this embodiment, a tobacco moisture warning device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated here. The following terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0145] Figure 7 is the structural block diagram of the tobacco moisture warning device in this embodiment. As Figure 7 shown, the device 70 includes: an acquisition module 71, a prediction module 72, and a warning module 73, where

[0146] An acquisition module 71 for acquiring a to-be-detected cut tobacco sample;

[0147] A prediction module 72 for inputting the to-be-detected cut tobacco sample into a pre-trained cut tobacco moisture prediction model to obtain a cut tobacco moisture prediction result; wherein, the pre-trained cut tobacco moisture prediction model is trained by an improved hunter-prey optimization algorithm based on a kernel extreme learning machine prediction model;

[0148] An early warning module 73 for sending out an early warning prompt when it is detected that the cut tobacco moisture prediction result exceeds a preset difference threshold.

[0149] It should be noted that the above-mentioned each module can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module can be located in the same processor; or the above-mentioned each module can also be located in different processors in any combined form.

[0150] In addition, in combination with the cut tobacco moisture early warning method provided in the above-mentioned embodiments, a storage medium can also be provided in this embodiment to implement it. A computer program is stored on the storage medium; when the computer program is executed by a processor, any one of the cut tobacco moisture early warning methods in the above-mentioned embodiments is implemented.

[0151] It should be understood that the specific embodiments described here are only used to explain this application, rather than to limit it. According to the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the protection scope of the present application.

[0152] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties.

[0153] Obviously, the accompanying drawings are only some examples or embodiments of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations according to these drawings without creative work. In addition, it can be understood that although the work done during the development process here may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes made according to the technical content disclosed in the present application are only conventional technical means and should not be regarded as insufficient disclosure of the present application.

[0154] As used in this application, the term "embodiment" means that the specific features, structures or characteristics described in connection with an embodiment may be included in at least one embodiment of this application. The phrase appears at various locations in the specification and does not necessarily mean the same embodiment, nor does it mean being independent or alternative to other embodiments and mutually exclusive. Those of ordinary skill in the art can clearly or implicitly understand that the embodiments described in this application can be combined with other embodiments without conflict.

[0155] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0156] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of patent protection. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A method for warning of tobacco moisture content, characterized in that, Including: Obtain the cut tobacco sample to be detected; Input the cut tobacco sample to be detected into the pre-trained cut tobacco moisture prediction model to obtain the cut tobacco moisture prediction result; wherein, the pre-trained cut tobacco moisture prediction model is obtained by training the preset kernel extreme learning machine prediction model using the improved hunter-prey optimization algorithm; Judge whether the cut tobacco moisture prediction result exceeds the preset moisture threshold; If so, issue a warning prompt.

2. The cigarette tobacco moisture warning method according to claim 1, characterized in that, The training process of the cut tobacco moisture prediction model includes: Obtain various warning data related to moisture during the production process of different batches of cigarettes; Input the various warning data into the variational autoencoder model for feature reconstruction to obtain the characteristic variables of the potential warning types; Based on the characteristic variables of the potential warning types, train the kernel extreme learning machine prediction model, and during the training process, use the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain the trained cut tobacco moisture prediction model.

3. The cut tobacco moisture warning method according to claim 2, characterized in that Before inputting the various warning data into the variational autoencoder model for feature reconstruction, the method further includes: Clean the outliers and perform standardization processing on the various warning data to obtain standardized warning data; Perform maximum-minimum normalization processing on the standardized warning data to obtain various target warning data.

4. The tobacco moisture warning method according to claim 2, wherein The step of inputting the various warning data into the variational autoencoder model for feature reconstruction to obtain the characteristic variables of the potential warning types includes: Input the various warning data into the variational autoencoder model, wherein the variational autoencoder model includes an encoder and a decoder; Map the various warning data to the low-dimensional coding space through the encoder and output the initial characteristic variables of the potential warning types; Collect a target characteristic variable of the potential warning type from the initial characteristic variables of the potential warning types; Map the target characteristic variable of the potential warning type to the data space through the decoder to generate reconstructed data; Calculate the reconstruction loss according to the reconstructed data, and measure the reconstruction quality of the variational autoencoder model for the various warning data according to the reconstruction loss.

5. The tobacco moisture warning method according to claim 2, wherein The step of using the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain the trained cut tobacco moisture prediction model includes: Initialize the population position, and randomly generate the positions of the hunters and the prey of the hunter-prey optimization algorithm; Generate a random number according to the selection mechanism of the hunter's behavior; judge whether the random number is less than the preset adjustment parameter, if so, execute the hunter search mechanism to obtain a new hunter position; otherwise, execute the prey escape mechanism to obtain a new prey position; Calculate the fitness value based on the new hunter position and the new prey position; Compare whether the new prey position is better than the previous prey position according to the fitness value. If so, iterate the previous prey position with the new prey position and continue to optimize until the new prey position is inferior to the previous prey position or the preset number of iterations is reached. Then stop the optimization and use the new prey position as the target optimization parameter of the kernel extreme learning machine prediction model; Optimize the parameters of the kernel extreme learning machine prediction model through the target optimization parameter to obtain a trained cut tobacco moisture prediction model.

6. The tobacco moisture warning method according to claim 5, wherein The target optimization parameter includes the regularization parameter and the kernel parameter of the kernel extreme learning machine prediction model.

7. The tobacco moisture warning method according to claim 2, wherein After using the improved hunter-prey optimization algorithm to optimize the hyperparameters of the kernel extreme learning machine prediction model to obtain a trained cut tobacco moisture prediction model, the method further includes: Divide the various types of alarm data into training set data and test set data; Input the test set data into the trained cut tobacco moisture prediction model to output the predicted result of the test cut tobacco moisture; Calculate the mean square error, root mean square error, and mean absolute percentage error between the predicted result of the test cut tobacco moisture and the true value of the cut tobacco moisture; Evaluate the accuracy of the trained cut tobacco moisture prediction model according to the mean square error, root mean square error, and mean absolute percentage error; Fit the trained cut tobacco moisture prediction model based on the accuracy evaluation.

8. The method for warning of cut tobacco moisture according to claim 1 or claim 2, characterized in that, The kernel function of the kernel extreme learning machine prediction model uses a radial basis kernel function.

9. A warning device for the moisture content of cut tobacco, characterized in that, It includes: An acquisition module, a prediction module, and an early warning module, where, The acquisition module is used to acquire the cut tobacco sample to be detected; The prediction module is used to input the cut tobacco sample to be detected into the pre-trained cut tobacco moisture prediction model to obtain the predicted result of the cut tobacco moisture; where the pre-trained cut tobacco moisture prediction model is trained by using the improved hunter-prey optimization algorithm based on the kernel extreme learning machine prediction model; The early warning module is used to issue an early warning prompt when it is detected that the predicted result of the cut tobacco moisture exceeds a preset difference threshold.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the cut tobacco moisture early warning method according to any one of claims 1 to 8.