Cultivation quality control method and system based on GC-IMS technology
Through the combination of the bidirectional Bi-GRU-PID neural network and GC-IMS technology, the problem of the inability to accurately predict the internal damage of the Arborist in the existing technology is solved, precise control of pesticide watering is achieved, and the cultivation effect and pesticide utilization efficiency are improved.
Patent Information
- Application Number
- CN202510309360.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot effectively utilize nonlinear models to accurately predict the degree of internal damage of the Arborite, resulting in inaccurate application of pesticides and affecting the cultivation effect.
The bidirectional Bi-GRU-PID neural network combined with GC-IMS technology is used to capture the complex relationship between the combined concentration of the volatile compounds of the arborist and the degree of internal damage through nonlinear calculations, and generate electrical signal parameters for controlling the pesticide irrigation system.
Accurate prediction of the internal damage degree of arborist and quantitative control of pesticide irrigation have been achieved, the cultivation effect has been improved, and the use of pesticides and environmental pollution have been reduced.
Smart Images

Figure CN120178656A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of GC-IMS technology, specifically to an optimized cultivation technology based on a combination of an exponential decay model and a PID control algorithm, belongs to the technical direction of model-based control (MPC), and particularly to a cultivation quality control method and system based on GC-IMS technology. Background Art
[0002] Platycladus orientalis is an evergreen tree of the genus Platycladus in the Cupressaceae family and is a common road greening tree species in my country. However, Platycladus orientalis is susceptible to borer pests and leaf blight pathogens during the sapling cultivation stage. Such pests and diseases are highly concealed and difficult to detect in the early stages of damage, but they spread exponentially in the late stages and cause rapid death of Platycladus orientalis plants. At present, most detections of plant diseases and pests are based on spectral and image recognition technologies, which are not ideal for detecting early leaf blight and borer pests inside tree trunks. To this end, many existing technologies attempt to solve this technical problem:
[0003] (1) CN114252500A discloses an early prediction method for the number of arborvitae invaded by cypress beetles based on GC-IMS (publication date 2022-03-29). It mainly extracts characteristic parameters from GC-IMS data using a multilinear principal component analysis method, and selects the number of features through cross-validation, and finally establishes a partial least squares model between the GC-IMS characteristic parameters of arborvitae and the number of cypress beetle invasions. It can achieve early prediction of the number of arborvitae invaded by cypress beetles without the need for complex pre-processing operations.
[0004] (2) CN114252525A discloses a method for detecting the degree of damage caused by borer pests on Platycladus orientalis based on GC-IMS (publication date 2022-03-29), which uses a support vector machine classification model and finally evaluates the model effect by the model classification accuracy based on k-fold cross-validation. This model is used to detect the degree of damage caused by borer pests on Platycladus orientalis based on GC-IMS.
[0005] According to the applicant's analysis, the above two prior art documents are based on GC-IMS detection and use multilinear principal component analysis method to extract features from GC-IMS data. The key independent variables are principal components PC1 and PC2; these principal components are obtained by linearly combining the original variables (the concentrations of different volatile compounds detected by GC-IMS) and are used to explain most of the variation in the data.
[0006] Among them, in the traditional detection model of Platycladus orientalis invaded by Phloeosinus aubei, PC1 and PC2 represent the combined concentrations of volatile compounds corresponding to the invasion quantity of Phloeosinus aubei. These volatile compounds are specific reaction substances produced by Platycladus orientalis when invaded by Phloeosinus aubei, and their concentrations and combination methods can reflect the invasion quantity and degree.
[0007] Therefore, whether the above-mentioned prior art is based on the multi-linear principal component analysis algorithm or the classification model, in essence, it assumes that there is a direct linear relationship between the concentrations PC1 and PC2 and the internal damage degree of Platycladus orientalis; although objectively this relationship is non-linear, or can be approximated as linear in some cases, so the prior art can also generate the internal damage degree of Platycladus orientalis, but in essence, it cannot achieve a true exponential decay relationship. Because the attenuation prediction of capacity is not a generalized linear model (GLM). It essentially does not allow the response variable to be associated with the linear predictor through a link function, because the distribution of the response variable of the internal damage degree of Platycladus orientalis still belongs to the exponential distribution family.
[0008] Then, if simply relying on the internal damage degree distribution of Platycladus orientalis calculated by the traditional model as a reference and then applying pesticides in corresponding proportions, it is very likely to affect the growth or cultivation of Platycladus orientalis.
[0009] For this reason, the present invention proposes a cultivation quality control method and system based on GC-IMS technology. Summary of the Invention
[0010] In view of this, the embodiments of the present invention hope to provide a cultivation quality control method and system based on GC-IMS technology to solve or alleviate the technical problems existing in the prior art, that is, how to use a non-linear model to make the distribution of the response variable of the internal damage degree of Platycladus orientalis respond to the combined concentrations PC1 and PC2 of the volatile compounds of Platycladus orientalis regularly collected by the GC-IMS detection system, and then rely on the internal damage degree distribution of Platycladus orientalis calculated by the traditional model as a reference, and then apply pesticides in corresponding proportions to improve the cultivation effect, and at least provide a beneficial choice for this; the present invention is implemented as follows:
[0011] In the first aspect, a cultivation quality control method based on GC-IMS technology:
[0012] (I) Overview:
[0013] The present invention aims to solve the above technical problems. By combining GC-IMS detection technology and a bidirectional Bi-GRU-PID neural network, precise prediction of the internal damage degree of Platycladus orientalis and quantitative control of pesticide irrigation are achieved. The solution first uses a GC-IMS system to regularly collect combined concentration data of volatile compounds in Platycladus orientalis, and then inputs it into a bidirectional Bi-GRU-PID neural network for non-linear calculation to capture complex relationships in the data. This neural network not only has the ability to process time series data, but also directly generates the electrical signal parameters for controlling the pesticide irrigation system by embedding the PID algorithm. Finally, based on the predicted internal damage degree, quantitative pesticide irrigation is achieved through a PID controller to improve the cultivation effect of Platycladus orientalis.
[0014] (II) Technical solution:
[0015] 2.1 Step S1, data engineering:
[0016] Based on the combined concentrations PC1 and PC2 of volatile compounds in Platycladus orientalis regularly collected by the GC-IMS detection system, an independent variable x is formed. Where x = (PC1, PC2).
[0017] Then, the above data is arranged in the form of a time series data according to the time sequence, that is, the data set D: D = [x1, x2,..., x n ; where, x i is the i-th independent variable (sample), and n is the number of samples of the independent variable.
[0018] 2.2 Step S2, perform non-linear calculation:
[0019] Input the data set D into a bidirectional Bi-GRU-PID neural network, and regard the response variable of the internal damage degree of Platycladus orientalis as the dependent variable y (that is, the response variable y i corresponding to each independent variable x i value);
[0020] This bidirectional Bi-GRU-PID neural network can, on the one hand, give full play to the advantages of the neural network, be able to capture both positive and negative dependencies in time series data, and further avoid the non-linear defects not applicable in traditional technologies. On the other hand, embed the PID algorithm into the gated recurrent unit (GRU unit), and can directly generate the response parameters required for the electrical signal e(t) (for example, the opening or flow rate of the solenoid valve of the irrigation system) corresponding to the value of the response variable y i to directly achieve quantitative pesticide irrigation for the dependent variable y i (corresponding to the predicted internal damage degree of Platycladus orientalis);
[0021] 2.2.1 Step S200, encoding layer processing:
[0022] At the current time step \(t\), all datasets \(D\) are combined into an input sequence \(S\), and the forward and backward hidden states of the bidirectional Bi - GRU - PID neural network are initialized; the bidirectional Bi - GRU - PID network simultaneously extracts the dependency relationship between the input sequence \(S\) and the dependent variable \(y\) from the forward and backward directions through a number of GRU units, performs an encoding operation, and generates a hidden state sequence \(H\).
[0023] 2.2.1.1 Step S2000, GRU unit operation:
[0024] 1) Proportional neuron \(P\): \(P(t)=K_p\cdot e(\tau)\);
[0025] 2) Integral neuron \(I\):
[0026] 3) Derivative neuron \(D\):
[0027] 4) Concatenated into an input vector \(x\) t =[P(t),y I (t),y D (t)];
[0028] 5) Update gate: \(z\) u =\(\sigma(W\) u e(\tau)+U\) u h\) t-1 );
[0029] 6) Reset gate: \(z\) r =\(\sigma(W\) r e(\tau)+U\) r h\) t-1 );
[0030] Among them, \(K\) p is the proportionality coefficient, \(e(\tau)=|PC1 - PC2|\) is the error between the combined concentrations \(PC1\) and \(PC2\); \(K\) i is the integral coefficient, \(b\) I is the bias of the integral neuron; \(\tau\) is the time response variable; \(y\) I (t)\) is the output of the integral neuron at time \(t\); is the integral of the error signal \(e(t)\) from \(0\) to \(t\); \(K\) d is the derivative coefficient, \(b\) D is the bias of the derivative neuron; \(y\) D (t)\) is the output of the derivative neuron at time \(t\); is the derivative of the error signal \(e(t)\); \(W\) u and \(U\) u are the weight matrices in the update gate, used to calculate the activation value of the update gate; \(z\) u is the activation value of the update gate; \(z\)r is the activation value of the Reset Gate; σ is the sigmoid activation function; W r and U r are the weight matrices in the Reset Gate, used to calculate the activation value of the Reset Gate; h t-1 is the hidden state at the previous time step.
[0031] 2.2.1.2 Step S2001, calculate the forward candidate hidden state and the forward hidden state
[0032] where, W x and W h are the weight matrices, is the bias vector. is a weight matrix, which is used in the neural network to perform a linear transformation on the hidden state at the previous time step.
[0033] 2.2.1.3 Step S2002, calculate the backward candidate hidden state and the backward hidden state
[0034] The calculation method is similar to S2001, but in the opposite direction:
[0035]
[0036] where, is a weight matrix, which is used in the neural network to perform a linear transformation on the hidden state at the next time step. is the bias vector.
[0037] 2.2.1.4 Step S2003, vector concatenation, form the hidden state sequence H:
[0038] Based on S2000~S2002, for each time step t, the hidden state
[0039] where, [·;·] represents the vector concatenation operation.
[0040] Therefore, the entire hidden state sequence H = [h1, h2,..., h T ; where, T is the length of the sequence.
[0041] 2.2.2 Step S201, iterative calculation:
[0042] Iteratively execute all sub-steps of Step S200 until the hidden state sequence H t-1is accurate; and the so-called "accuracy" is measured and controlled through the following steps:
[0043] 2.2.2.1 Step S2010, define the residual function r:
[0044] The residual function r is used to measure the deviation magnitude r(h t ) of the hidden state h t ):
[0045] r(h t ) = h t *exp(-λ*t) - C m ;
[0046] where C m is the residual of the current hidden state h t with respect to the hidden state sequence H t-1 at the previous time step; λ is the decay rate.
[0047] 2.2.2.2 Step S2011, calculate the sum of squared residuals:
[0048] Based on the deviation magnitude r(h t ) to measure the degree of difference in the hidden state sequence H t-1 at the previous time step, calculate the sum of squared residuals (RSS) to evaluate the overall fitting effect of the model:
[0049]
[0050] where N is the total number of data points. By minimizing RSS, the optimal parameter combination of the hidden state h t can be found to minimize the difference in the predicted values of the model.
[0051] 2.2.2.3 Step S2012, apply the LM algorithm (Levenberg - Marquardt algorithm):
[0052] Use the LM algorithm to minimize the sum of squares of the residual function r. In each iteration, the LM algorithm calculates an update step size based on the current deviation magnitude r(h t ) and applies this step size to update the parameters. The iteration process will continue until the convergence condition is met. When the LM algorithm converges, the corresponding hidden state sequence H t-1 at the previous time step can be regarded as the stable and accurate parameters.
[0053] 2.2.3 Step S202, decoding layer processing:
[0054] The hidden state sequence H t-1Input into the decoding layer; the bidirectional Bi-GRU-PID network extracts the hidden state sequence H of the previous time step from both the forward and backward directions simultaneously through several GRU units t-1 and the dependencies in the hidden state sequence H, perform decoding operations, and decode the response parameters required for the electrical signal e(t) to control the cultivation pesticide irrigation system;
[0055]
[0056] P i (c)' = DecodeLayerOutput(h dec ) = [P(t), y I (t), y D (t)];
[0057] Among them, and respectively represent the hidden states processed by the forward and backward GRU units. h dec is the hidden state of the decoding layer obtained by concatenating the forward and backward hidden states;
[0058] DecodeLayerOutput(·) is a decoding function or network layer used to convert the hidden state of the decoding layer into a sequence of dependent variables y( ) y = [y1, y2,..., y n ; among them, y i is the dependent variable data corresponding to the i-th independent variable x i , that is, the response variable of the internal damage degree of Platycladus orientalis, and is a fully connected layer, a regression layer, or any other network structure that can generate output coordinates based on the hidden state. [P(t), y I (t), y D (t)] is the response parameter.
[0059] 2.3 Step S3, perform PID control:
[0060] Based on the dependent variable y predicted in step S2 and its common response parameters [P(t), y I (t), y D (t)] corresponding to the proportional, integral, and differential, further substitute them into the PID controller to perform control:
[0061]
[0062] Furthermore, e(t) can be used to directly achieve quantitative pesticide irrigation for the dependent variable y i (corresponding to the predicted internal damage degree of Platycladus orientalis).
[0063] (III) Mechanism for solving technical problems:
[0064] First, the combined concentrations PC1 and PC2 of volatile compounds of Platycladus orientalis are regularly collected through the GC-IMS detection system. These data can reflect the physiological response of Platycladus orientalis when it is invaded by pests and diseases. However, since the relationship between pests and diseases and the degree of internal damage of Platycladus orientalis is nonlinear, the traditional linear model cannot accurately predict this relationship. Therefore, the present invention introduces a nonlinear model, a bidirectional Bi-GRU-PID neural network. This model can simultaneously capture the forward and reverse dependencies in time series data, avoiding the defect of nonlinearity in traditional technology. By inputting the data collected by the GC-IMS detection system into the neural network, the model can learn the complex nonlinear relationship between pests and diseases and the degree of internal damage of Platycladus orientalis.
[0065] During the model training process, the fitting effect of the model is evaluated by defining the residual function and calculating the residual sum of squares, and the residual sum of squares is minimized using the LM algorithm to ensure the accuracy and stability of the model. In this way, the trained model can accurately predict the internal damage degree of Platycladus orientalis based on the data collected by the GC-IMS detection system. Finally, based on the predicted internal damage degree of Platycladus orientalis, the present invention further realizes the precise control of the cultivation pesticide irrigation system through a PID controller. By adjusting the parameters such as the opening or flow rate of the solenoid valve of the irrigation system, quantitative pesticide irrigation of Platycladus orientalis can be achieved, thereby improving the cultivation effect.
[0066] Second, the cultivation quality control system based on GC-IMS technology
[0067] The cultivation quality control system based on GC-IMS technology is characterized in that: the system includes a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the cultivation quality control method as described above; after calculating the electrical signal e(t), the electrical signal is input into a PLC controller of a cultivation pesticide irrigation system to control the opening, flow rate or start time of a solenoid valve of the cultivation pesticide irrigation system
[0068] Compared with the prior art, the present invention has the following beneficial effects:
[0069] 1. Adaptive cultivation control based on pest and disease monitoring: By combining GC-IMS technology and bidirectional Bi-GRU-PID neural network, the present invention can achieve accurate detection of diseases and pests of Platycladus orientalis. GC-IMS technology can detect small changes in volatile compounds of Platycladus orientalis, while the bidirectional Bi-GRU-PID neural network can learn the complex nonlinear relationship between the concentration of these compounds and the degree of internal damage of Platycladus orientalis. This combination enables the present invention to accurately detect diseases and pests in the early stage, thereby improving the accuracy of detection.
[0070] II. Achieving Adaptive Quantitative Pesticide Irrigation Control: Through a PID controller, the present invention realizes precise control of the cultivated pesticide irrigation system according to the predicted internal damage degree of Platycladus orientalis. This means that corresponding proportions of pesticides can be applied according to the actual damage situation of Platycladus orientalis, avoiding over-application or under-application. This quantitative pesticide irrigation control not only improves the utilization efficiency of pesticides but also helps reduce environmental pollution and pesticide residues.
[0071] III. Two-way Processing Enhances the Ability to Capture Time-series Data: The two-way Bi-GRU-PID neural network combines the structural characteristics of the bi-directional gated recurrent unit (GRU), enabling it to capture both forward and backward dependencies in time-series data simultaneously. This means that the network can not only predict the future based on past information but also consider future information to understand the current state. This two-way processing ability is crucial for analyzing the patterns of changes in the concentration of volatile compounds in Platycladus orientalis over time and helps to more accurately predict the internal damage degree of Platycladus orientalis.
[0072] IV. GRU Units Simplify Model Complexity While Maintaining Performance: Compared with traditional long short-term memory (LSTM) networks, GRU units simplify the model structure by combining the forget gate and input gate into an update gate and introducing a reset gate, thereby reducing computational complexity and the number of parameters. This simplification does not sacrifice the performance of the model. Instead, it makes the two-way Bi-GRU-PID neural network converge more easily during training, improving the efficiency and applicability of the model. Embedding the PID (Proportional-Integral-Derivative) algorithm into the GRU unit is a major innovation of the two-way Bi-GRU-PID neural network of the present invention. The PID algorithm has a wide range of applications in control systems. It can adjust the control input according to the error signal to achieve stable control of the system. The PID algorithm directly generates the response parameters required to control the electrical signal of the cultivated pesticide irrigation system. This embedding enables the neural network to directly output signals that can be used for actual control, achieving seamless connection from data prediction to actual control. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] To more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0074] Figure 1 It is a schematic flowchart of the method of the present invention;
[0075] Figure 2Schematic diagram of the neural network architecture of the present invention;
[0076] Figure 3 Schematic diagram of the principles of forward propagation and backward propagation of the present invention;
[0077] Figure 4 Schematic diagram of the architecture of the GRU unit of the present invention;
[0078] Figure 5 Schematic diagram of the control logic of the present invention;
[0079] Figure 6 Control line chart of the test example of the present invention. Detailed implementation manners
[0080] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe the detailed implementation manners of the present invention with reference to the accompanying drawings. Many specific details are set forth in the following description to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below;
[0081] It should be noted that the various embodiments in this specification are described in a progressive manner, and the key points of each embodiment are the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0082] Embodiment 1: Platycladus orientalis is vulnerable to boring pests and leaf blight pathogens during the young tree cultivation stage, and the behavior of such pests and diseases is highly concealed and not easily detected in the early stage of damage, while in the late stage, it will cause the rapid apoptosis of Platycladus orientalis. Traditional technologies detect based on spectral and image recognition technologies, but the detection effect on early pests and diseases is not ideal; at the same time, although existing technologies attempt to predict the damage degree of Platycladus orientalis through GC-IMS technology and multi-linear principal component analysis methods or classification models, these methods essentially assume a direct linear relationship between concentration and internal damage degree, while in fact this relationship is non-linear.
[0083] For this reason, please refer to Figure 1 , this embodiment proposes a cultivation quality control method based on GC-IMS technology; it includes the following steps S1 to S3.
[0084] In this embodiment, regarding step S1, data engineering: Based on the combined concentrations PC1 and PC2 of the volatile compounds of Platycladus orientalis regularly collected by the GC-IMS detection system, the independent variable x is formed. Where x = (PC1, PC2). Then, the above data is arranged in the form of a time series data in chronological order, that is, the data set D: D = [x1, x2,..., x n ; where, x i is the i-th independent variable (sample), and n is the number of samples of the independent variable.
[0085] Specifically, the GC-IMS detection system regularly collects the combined concentration data of the volatile compounds of Platycladus orientalis. These compounds are separated and detected by gas chromatography-ion mobility spectrometry (GC-IMS) technology to obtain the concentration values of two main components, namely PC1 and PC2. PC1 and PC2 respectively represent the concentrations of two key components in the volatile compounds of Platycladus orientalis, and their changes can reflect the internal physiological state or damage degree of Platycladus orientalis.
[0086] Specifically, the collected independent variable x is arranged in chronological order to form time series data. This arrangement method can retain the time information of the data and help analyze the changing trend of the concentration of Platycladus orientalis volatile compounds over time. The arranged time series data is defined as the data set D, which contains the PC1 and PC2 concentration values collected at specific time points; n is the number of samples of the independent variable, representing the total number of data in the time series. By forming the independent variable x and the time series data set D, it provides a data basis for subsequent analysis of the relationship between the internal damage degree of Platycladus orientalis and the concentration of volatile compounds using a non-linear model. The non-linear model can capture the complex relationships in the data and is more suitable for describing the variable and interacting factors in biological systems than traditional linear models. Time series data not only contains the information of each time point but also implies the changing trend of the data over time. This helps analyze the changing law of the concentration of Platycladus orientalis volatile compounds over time and further accurately predict the internal damage degree of Platycladus orientalis.
[0087] It can be understood that by organizing the data into time series data, all data points collected by the GC-IMS detection system can be fully utilized, improving the utilization rate and accuracy of the data. The time series data provides rich input information for the non-linear model, helps the model better adapt to the changes in the concentration of Platycladus orientalis volatile compounds, and thus more accurately predicts the internal damage degree of Platycladus orientalis. Accurate time series data and model prediction results can provide a scientific basis for pesticide application decisions, ensure that the application ratio and timing of pesticides are more reasonable, and improve the cultivation effect.
[0088] In this embodiment, please refer to Figures 2 - 4, Regarding step S2, perform a non-linear calculation: Input the data set D into a bidirectional Bi-GRU-PID neural network, and regard the response variable of the internal damage degree of Platycladus orientalis as the dependent variable y (i.e., the response variable y i corresponding to each independent variable x i value); Each independent variable x i represents the combined concentration of volatile compounds of Platycladus orientalis collected at a specific time point, and the corresponding response variable y i , indicating the predicted internal damage degree of Platycladus orientalis at this time point.
[0089] The neural network of this embodiment adopts a bidirectional structure and can capture the forward and backward dependencies in time series data at the same time. That is to say, the network can not only predict the future based on past information, but also consider future information to understand the current state, so as to more accurately capture the complex relationship between the concentration of volatile compounds of Platycladus orientalis and the internal damage degree.
[0090] The gated recurrent unit (GRU unit) in the network is responsible for processing time series data and controls the flow of information through internal update gates and reset gates, so as to effectively capture and memorize the long-term dependencies in the data. Embed the PID (Proportional-Integral-Derivative) algorithm into the GRU unit.
[0091] It should be noted that the PID algorithm is a classic control algorithm that can adjust the control input according to the error signal to achieve the stable control of the system. Here, the PID algorithm directly generates the electrical signal e(t) corresponding to the response variable yi for controlling the cultivation pesticide irrigation system. The bidirectional Bi-GRU-PID neural network combines the non-linear processing ability of the neural network and the control ability of the PID algorithm, can accurately predict the internal damage degree of Platycladus orientalis, and generate the electrical signal for controlling the pesticide irrigation system. By capturing the forward and backward dependencies in time series data, the network can more comprehensively understand the relationship between the concentration of volatile compounds of Platycladus orientalis and the internal damage degree, thereby improving the prediction accuracy.
[0092] Specifically, in step S200, encoding layer processing: At the current time step t, form all data sets D into an input sequence S, and initialize the forward and backward hidden states of the bidirectional Bi-GRU-PID neural network; The bidirectional Bi-GRU-PID network simultaneously extracts the dependencies between the input sequence S and the dependent variable y from the forward and backward directions through several GRU units, performs an encoding operation, and generates a hidden state sequence H; where:
[0093] (1) The bidirectional Bi-GRU-PID network simultaneously extracts the dependencies between the input sequence S and the dependent variable y (the internal damage degree of Platycladus orientalis) from the forward and backward directions through several GRU units.
[0094] (2) The forward GRU cell processes the input sequence S from left to right, capturing the influence of past information on the current state.
[0095] (3) The backward GRU cell processes the input sequence S from right to left, considering the understanding of future information on the current state.
[0096] Through the processing of the forward and backward GRU cells, the network performs an encoding operation to generate a hidden state sequence H; each hidden state hi contains all the information in the input sequence S up to the current time point, and has fused past and future information through forward and backward processing. The hidden state sequence H will be used as the input for the subsequent decoding layer or output layer to predict the dependent variable y or generate a control signal.
[0097] It can be understood that the purpose of the encoding layer processing is to extract the temporal dependencies in the input sequence S through bidirectional GRU cells and generate a hidden state sequence H containing these dependencies. The bidirectional processing enables the network to consider both past and future information simultaneously, thus more accurately capturing the complex relationship between the input sequence S and the dependent variable y. The hidden state sequence H, as the input for subsequent processing, provides a rich information basis for predicting the dependent variable y or generating a control signal.
[0098] Through bidirectional processing, the network can more comprehensively understand the temporal dependencies in the input sequence S, thereby improving the prediction accuracy. The hidden state sequence H contains all the information in the input sequence S, making the network more robust to noise and missing data. The encoding layer processing provides a rich information basis for the subsequent decoding layer or output layer, enabling the network to handle more complex tasks, such as predicting the internal damage degree of Platycladus orientalis and generating a control signal.
[0099] Specifically, in step S2000, the GRU cell operation includes:
[0100] 1) Proportional neuron P: P(t) = Kp·e(τ); The proportional neuron P(t) is directly calculated based on the current error signal, quickly responding to error changes.
[0101] 2) Integral neuron I: The integral neuron yI(t) helps to eliminate the system steady-state error by accumulating the error signal.
[0102] 3) Differential neuron D: The differential neuron yD(t) helps to predict the error trend in advance and suppress oscillations by considering the rate of change of the error signal.
[0103] 4) Concatenated into the input vector x t = [P(t), y I (t), y D(t); It contains the error information at the current moment, the cumulative effect of the error, and the change trend of the error, providing comprehensive input information for the GRU unit.
[0104] 5) Update gate: z u = σ(W u e(τ)+U u h t-1 ); It determines how much information of the hidden state at the current moment needs to be updated.
[0105] 6) Reset gate: z r = σ(W r e(τ)+U r h t-1 ); It determines how much of the input information at the current moment needs to be forgotten or reset.
[0106] Among them, K p is the proportionality coefficient, e(τ) = |PC1 - PC2| is the error between the combined concentrations PC1 and PC2, reflecting the deviation of the concentration of Platycladus orientalis volatile compounds at the current moment; K i is the integral coefficient, b I is the bias of the integral neuron; τ is the time response variable; y I (t) is the output of the integral neuron at time t;
[0107] is the integral of the error signal e(t) from 0 to t; K d is the differential coefficient, b D is the bias of the differential neuron; y D (t) is the output of the differential neuron at time t; is the derivative of the error signal e(t); W u and U u are the weight matrices in the update gate, used to calculate the activation value of the update gate; z u is the activation value of the update gate; z r is the activation value of the Reset Gate; σ is the sigmoid activation function; W r and U r are the weight matrices in the reset gate, used to calculate the activation value of the reset gate; h t-1 is the hidden state of the previous time step.
[0108] It can be understood that by combining proportional, integral, and differential neurons, the GRU unit can comprehensively consider the error signal and its changing trend, thereby improving the accuracy of predicting the internal damage degree of Platycladus orientalis. The integral neuron helps eliminate the steady-state error of the system and enhance the system's stability by accumulating the error signal. The differential neuron helps predict the error trend in advance and suppress oscillations by considering the change rate of the error signal. The design of the update gate and reset gate enables the GRU unit to dynamically adjust the information flow according to the current input and the hidden state at the previous time step, enhancing the network's adaptability. The non-linear processing ability of the GRU unit enables the network to handle more complex tasks, such as predicting the internal damage degree based on the combined concentration of volatile compounds in Platycladus orientalis and generating control signals.
[0109] Specifically, in step S2001, calculate the forward candidate hidden state and the forward hidden state
[0110] where, W x and W h are weight matrices, is the bias vector. is a weight matrix that is used in the neural network to perform a linear transformation on the hidden state at the previous time step. σ is the sigmoid activation function that maps the result of the linear transformation to the interval (0, 1) to generate the forward candidate hidden state
[0111] Specifically, in step S2002, calculate the backward candidate hidden state and the backward hidden state
[0112] The calculation method is similar to S2001 but in the opposite direction:
[0113] where, is a weight matrix that is used in the neural network to perform a linear transformation on the hidden state at the next time step. is the bias vector.
[0114] Specifically, in step S2003, vector concatenation is performed to form the hidden state sequence H: Based on S2000 - S2002, for each time step t, the hidden state where, [·;·] represents the vector concatenation operation. Therefore, the entire hidden state sequence H = [h1, h2, …, h T ; where, T is the length of the sequence.
[0115] It is understandable that through bidirectional processing, the network can consider past and future information simultaneously, capture the complex relationship between the input sequence and the dependent variable more accurately, and improve the accuracy of predicting the internal damage degree of Platycladus orientalis. The calculation and update of the forward and backward hidden states enable the network to comprehensively understand the temporal dependence relationship of the input sequence and enhance the temporal modeling ability. The hidden state sequence H, as the input for subsequent processing, provides a rich information basis for predicting the internal damage degree of Platycladus orientalis and generating control signals, supporting more complex task processing.
[0116] Specifically, in step S201, iterative calculation: Iteratively execute all sub-steps of step S200 until the hidden state sequence H of the previous time step t-1 is accurate; and the so-called "accuracy" is measured and controlled through the following steps:
[0117] Step S2010, define the residual function r: The residual function r is used to measure the deviation magnitude r(h t ) of the hidden state h t ): r(h t ) = h t *exp(-λ*t) - C m ;
[0118] where C m is the residual between the current hidden state h t and the hidden state sequence H t-1 of the previous time step; λ is the decay rate. exp(-λ×t) is the decay term, which is used to adjust the change of the residual over time.
[0119] Step S2011, calculate the sum of squared residuals: Based on the deviation magnitude r(h t ), measure the difference degree of the hidden state sequence H t-1 of the previous time step, and calculate the sum of squared residuals (Residual Sum of Squares, RSS) to evaluate the overall fitting effect of the model:
[0120] where N is the total number of data points. By minimizing RSS, the optimal parameter combination of the hidden state h t can be found, making the difference of the predicted values of the model minimized.
[0121] Step S2012, apply the LM algorithm: Use the LM algorithm to minimize the sum of squares of the residual function r. In each iteration, the LM algorithm calculates an update step size according to the current deviation magnitude r(h t ) and applies this step size to update the parameters. The iterative process will continue until the convergence condition is met. When the LM algorithm converges, the corresponding hidden state sequence H of the previous time stept-1 can be regarded as stable and accurate parameters.
[0122] It can be understood that by iterative calculation and the application of the residual function, the hidden state sequence can be continuously adjusted to be closer to the actual measured value. The effective use of the LM algorithm ensures the rapid convergence of parameter optimization and improves the accuracy of the model. The residual sum of squares (RSS) as an evaluation index can comprehensively reflect the overall fitting effect of the model. By minimizing RSS, it can be ensured that the predicted values of the model at different data points are relatively stable. The iterative calculation process can handle complex time-series data and adapt to the changes in the concentrations of Platycladus orientalis volatile compounds under different cultivation environments. It provides a reliable basis for the subsequent calculation of the pesticide application ratio based on the hidden state sequence.
[0123] That is, step S201 ensures the accuracy, stability, and adaptability of the hidden state sequence through iterative calculation, residual function definition, residual sum of squares calculation, and the application of the LM algorithm. The implementation of this step not only improves the accuracy and stability of the model but also provides a reliable basis for subsequent processing and strong support for cultivation quality control.
[0124] Specifically, in step S202, decoding layer processing: The main purpose of this step is to input the hidden state sequence H of the previous time step t-1 into the decoding layer, extract the dependencies between hidden states through a bidirectional Bi-GRU-PID network, and decode the response parameters required for the electrical signal e(t) to control the cultivation pesticide irrigation system.
[0125] Specifically, Bi-GRU can process sequence data in both forward and backward directions simultaneously and extract the long-term and short-term dependencies in the sequence. In this step, the Bi-GRU network receives the hidden state sequence H of the previous time step t-1 and the current hidden state sequence H as inputs. The forward GRU unit (denoted as GRU) processes the data from the start position to the end position of the sequence to generate the forward hidden state sequence h dec . At the same time, the backward GRU unit (denoted as GRU) processes the data from the end position to the start position of the sequence to generate the backward hidden state sequence h dec . Then, the forward and backward hidden state sequences are concatenated to obtain the decoding layer hidden state h dec . The purpose of this step is to integrate the forward and backward information to obtain more comprehensive sequence features.
[0126] Next, the decoding layer converts the decoding layer hidden state hdec into the required response parameters through a decoding function or network layer DecodeLayerOutput(·). This decoding function or network layer can be a fully connected layer, a regression layer, or any other network structure capable of generating output coordinates based on the hidden state.
[0127] In this step, it generates the response parameter vector [P(t), y I (t), y D (t)], where P(t) represents the power or intensity of the electrical signal e(t) of the pesticide irrigation system, and y I (t) and y D (t) respectively represent two response variables of the internal damage degree of Platycladus orientalis (for example, the direct estimate of the damage degree or other indicators related to it, depending on the training method of Example 2).
[0128]
[0129] P i (c)' = DecodeLayerOutput(h dec ) = [P(t), y I (t), y D (t)];
[0130] Where, and respectively represent the hidden states processed by the forward and backward GRU units. h dec is the decoding layer hidden state obtained by concatenating the forward and backward hidden states;
[0131] DecodeLayerOutput(·) is a decoding function or network layer for converting the decoding layer hidden state into the sequence of dependent variables y (y = [y1, y2,..., y n ); where, y i is the dependent variable data corresponding to the i-th independent variable x i , that is, the response variable of the internal damage degree of Platycladus orientalis, and it is a fully connected layer, a regression layer, or any other network structure capable of generating output coordinates based on the hidden state.
[0132] [P(t), y I (t), y D (t)] is the said response parameter.
[0133] It can be understood that by using a bidirectional Bi-GRU network to extract the dependencies between hidden states simultaneously from both the forward and backward directions, it is possible to capture the features in sequence data more comprehensively, thereby improving the accuracy of response parameters. This is of great significance for precisely controlling the pesticide irrigation system and enhancing the cultivation effect. The bidirectional Bi-GRU network can handle the noise and outliers in sequence data, enhancing the robustness of the system. In practical applications, due to the complexity of environmental factors, the collected data may contain noise and outliers. The bidirectional Bi-GRU network can effectively handle these problems and ensure the stable operation of the system. The decoding layer process is relatively efficient and can generate response parameters quickly, thus improving the response speed of the system. This is of great significance for real-time control of the pesticide irrigation system and timely adjustment of cultivation strategies. By adjusting the decoding function or the structure of the network layer, the calculation method of response parameters can be flexibly changed to support different control strategies. For example, more feature variables can be introduced or more complex dependencies can be considered to meet the requirements under different cultivation conditions.
[0134] In this embodiment, please refer to Figure 5 , regarding step S3, perform PID control: Based on the dependent variable y predicted in step S2 and its corresponding common response parameters of proportional, integral, and differential [P(t), y I (t), y D (t)], further substitute them into the PID controller to perform the control:
[0135]
[0136] Furthermore, e(t) can be used to directly achieve quantitative pesticide irrigation for the dependent variable y i (corresponding to the predicted internal damage degree of Platycladus orientalis).
[0137] It can be understood that through PID control, the irrigation amount of pesticides can be precisely adjusted according to the real-time prediction results of the internal damage degree of Platycladus orientalis. This avoids excessive or insufficient pesticide use, improves the utilization efficiency of pesticides, and reduces production costs. The PID controller precisely calculates the required pesticide irrigation amount by continuously monitoring the error e(t) and based on the effects of proportional, integral, and differential control.
[0138] By precisely controlling the pesticide irrigation amount, the internal damage degree of Platycladus orientalis can be effectively reduced, and its growth quality and yield can be improved. With the precise control of the pesticide irrigation amount, the growth environment of Platycladus orientalis is improved, the occurrence of pests and diseases is reduced, and thus its growth quality and yield are improved.
[0139] The derivative control part in the PID controller can predict the future trend of the error and make adjustments in advance, thus enhancing the stability and response speed of the system. The derivative control monitors the change rate of the error in real time and adjusts the control signal in a timely manner to ensure that the system can respond quickly and maintain a stable state.
[0140] Example 2: On the basis of Example 1, this example further provides a training method for the two-way Bi-GRU-PID neural network:
[0141] P1. Data preparation: Based on the historical data regularly collected by the GC-IMS detection system, that is, the combined concentrations PC1 and PC2 of Platycladus orientalis volatile compounds in history, the independent variable x is formed, and the response variable of the corresponding internal damage degree is regarded as the dependent variable y.
[0142] Then, arrange the above data in the form of chronological order into a data set D’:
[0143] D = [(x1, y1), (x2, y2),...,(x n , y n ),]; where (x i , y i ) is the i-th training sample, and n is the number of samples. Then form the data set D’ into a training set and a test set. Preprocess the data, including standardization and normalization.
[0144] P2. Model initialization: Initialize the weight matrices W u and U u , the weight matrices W r and U r , the weight matrices W x and W h , the bias vector weight matrix weight matrix bias vector weight matrix of the entropy weight regression layer and the bias vector
[0145] P3. Forward propagation: According to the model architecture, sequentially perform the forward propagation calculations of the encoding layer and the decoding layer. Calculate the loss function between the decoding layer and the true value.
[0146] P4. Backward propagation and weight update: According to the loss function, calculate the gradients of the parameters of each layer through the backward propagation algorithm. Use the optimization algorithm (Adam) to update all the above weight matrices and bias vectors.
[0147] P5. Iterative Training: Repeat the forward propagation and backward propagation processes until the loss function converges or the set number of training epochs is reached. Meanwhile, optimize the model based on the evaluation results, including adjusting the learning rate and increasing or decreasing the number of GRU units.
[0148] The basic MATLAB architecture of the above neural network is as follows:
[0149] % Clear the workspace and command window
[0150] clear;
[0151] clc;
[0152] % Preprocessed training set and test set
[0153] % trainData = [X_train,Y_train]; % Training set, X_train is the input feature, Y_train is the target output
[0154] % testData = [X_test,Y_test]; % Test set
[0155] % Initialize model parameters
[0156] inputSize = size(trainData,2)-1; % Dimension of independent variables
[0157] outputSize = 3; % Dimension of response parameters (e.g., P(t), y_I(t), y_D(t))
[0158] gruUnits = 64; % Number of GRU units
[0159] % Build a bidirectional GRU layer
[0160] forwardGRULayer = gruLayer(gruUnits,'OutputMode','sequence','Direction','forward');
[0161] backwardGRULayer = gruLayer(gruUnits,'OutputMode','sequence','Direction','backward');
[0162] % Combine the outputs of the forward and backward GRU layers
[0163] biGRUOutputSize = gruUnits*2; % Output dimension of the bidirectional GRU
[0164] % Define the network architecture
[0165] layers =
[0166] sequenceInputLayer(inputSize)
[0167] % Bidirectional GRU part
[0168] forwardGRULayer
[0169] backwardGRULayer
[0170] concatenationLayer(1,2) % Merge the outputs of the forward and backward GRUs
[0171] fullyConnectedLayer(biGRUOutputSize) % Optional dimensionality reduction layer reluLayer % Activation function
[0172] % PID controller part
[0173] fullyConnectedLayer(outputSize)
[0174] % Regression layer
[0175] regressionLayer];
[0176] % Define the training options
[0177] options = trainingOptions('adam',...
[0178] 'MaxEpochs',100,...
[0179] 'GradientThreshold',1,...
[0180] 'InitialLearnRate',0.001,...
[0181] 'LearnRateSchedule', 'piecewise',...
[0182] 'LearnRateDropPeriod',125,...
[0183] 'LearnRateDropFactor',0.2,...
[0184] 'Verbose',0,...
[0185] 'Plots','training-progress');
[0186] % Training model
[0187] net = trainNetwork(trainData(:, 1:end - 1), trainData(:, end), layers, options);
[0188] % Evaluate model performance using the test set
[0189] YPred = predict(net, testData(:, 1:end - 1));
[0190] mse = mean((YPred - testData(:, end)).^2);
[0191] fprintf('Test MSE: %.4f\n', mse);
[0192] In the above program, the input layer is used to define the dimension of the input sequence. The size of the input features is inputSize, which depends on the number of features in the training data. The forward GRU (forwardGRULayer) processes the sequence data from the first time step to the last time step. The backward GRU
[0193] (backwardGRULayer) processes the sequence data from the last time step to the first time step.
[0194] The concatenation layer concatenates the outputs of the forward and backward GRUs in the feature dimension to form the output of the bidirectional GRU. The fully connected layer (fullyConnectedLayer) and the activation function (reluLayer) are used to reduce the dimension and perform a non - linear transformation on the output of the bidirectional GRU to better fit the data.
[0195] The PID controller part is used to adjust the output of the system. The fully connected layer (fullyConnectedLayer) maps the output of the GRU to the final response parameters [P(t), y_I(t), y_D(t)]. The regression layer is used to calculate the loss function. Here, the mean squared error (MSE) is usually used to measure the difference between the predicted value and the actual value.
[0196] The parameters are updated using the Adam optimizer, and the gradients of the parameters of each layer are calculated through the backpropagation algorithm. Iterative training is performed until the loss function converges or the set number of training epochs is reached. Finally, the performance of the model is evaluated using the test set, and the mean squared error (MSE) between the predicted values and the actual values is calculated.
[0197] Embodiment 3: This embodiment further provides the specific implementation steps of step S2012 in Embodiment 1:
[0198] 1) Initialization: According to the deviation magnitude r(h t ), the convergence tolerance ε, and the maximum number of iterations k max , set the iteration count k = 0.
[0199] 2) Calculate the residual and the Jacobian matrix: Let the current parameter estimate be and the decay rate λ (k) , calculate the residual function r(C m ,λ (k) ,t)) for all i = 1,…,M;
[0200] where M is the number of data points; r i is the residual function of the i-th data point;
[0201] Construct the residual vector r (k) =[r1,r2,…,r N T ;
[0202] where N is the maximum value of the data points; T is the transpose operation.
[0203] Calculate the Jacobian matrix
[0204] where p j is the j-th element of the parameter vector [C0,λ] T . is the Jacobian matrix between the i-th data point and the j-th data point.
[0205] The residual vector provides the difference between the model prediction and the actual observation under the current parameter estimate; the Jacobian matrix contains local information about how the parameters affect the residuals and is crucial for determining the direction and magnitude of parameter updates.
[0206] 3) Construct the incremental normal equation to calculate the increment: (J (k)T J (k) +μ (k) I)δp=-J (k)T r (k) ;
[0207] where μ (k) is the damping factor, and δp is the estimated value and the estimated value λ (k) of the update vector; Solve the above equation to obtain δp.
[0208] By combining the characteristics of the gradient descent method and the Gauss-Newton method, the LM algorithm takes into account both the reduction of the residual and the stability of the iterative process in incremental calculations. The introduction of the damping factor allows the algorithm to adjust the step size more robustly when encountering difficulties (such as approaching a singularity or a local minimum).
[0209] 4) Calculate the new parameter estimate p (k+1) = p (k) + δp;
[0210] That is, update and λ (k+1) ; In this step, the calculated update vector δp (increment) is used to update the parameters, so that the deviation magnitude r(h t ) and the decay rate gradually approach the optimal solution.
[0211] 5) In the step of updating the parameters, execute:
[0212] Obtain the new parameter estimate p (k) by adding the current parameter estimate p (k+1) to the calculated parameter update vector δp. The parameter update vector δp is obtained by solving the incremental normal equation, which combines the Jacobian matrix of the model and the residual vector to calculate a parameter adjustment amount that can reduce the sum of the squared residuals.
[0213] 6) Specifically for the components, execute:
[0214] Specifically for the model of this technical solution, the parameter vector p has two components: the deviation magnitude r(h t ) and the decay rate λ. Therefore, the parameter update vector δp will also have two components, corresponding to the update amounts of the deviation magnitude r(h t ) and the decay rate λ respectively. In this technical solution, it is written as: δp = [δr(h t ), δλ] T ;
[0215] When updating the parameters, execute p (k+1) = p (k) + δp;
[0216] Substitute the specific forms of the parameter vector and the update vector into the above formula to obtain:
[0217]
[0218] λ (k+1) = λ (k)+δλ;
[0219] The update amount obtained by calculation and λ (k+1) are used to update the estimated value. This process is repeated in each iteration until the convergence condition is met.
[0220] 7) Iterate and check for convergence:
[0221] Repeat S2012 and determine whether to stop the iteration according to the following criterion rules:
[0222] If |δp| < ∈, that is, the parameter change is less than the preset tolerance; or k ≥ k max , that is, the maximum number of iterations k max ;
[0223] If any of the above conditions is met, stop the iteration. The hidden state sequence H t-1 at the previous time step can be regarded as stable and accurate parameters. Otherwise, increase the iteration count to k + 1 and adjust the damping factor μ (k) according to the progress of the algorithm, and then continue the iteration. This step ensures that the algorithm stops when a sufficiently good solution is found, avoiding unnecessary calculations, or terminates the iteration in a timely manner when a better solution cannot be found, preventing the algorithm from falling into an infinite loop.
[0224] It can be understood that the LM algorithm of this embodiment combines the characteristics of the gradient descent method and the Gauss-Newton method, and can consider both the reduction of the residual and the stability of the iteration process during the iteration. This combination makes the parameter estimation more accurate and can more precisely reflect the relationship between the internal damage degree of Platycladus orientalis and the combined concentration of volatile compounds (PC1 and PC2).
[0225] It should be noted that the introduction of the damping factor is a major improvement feature of this embodiment for the LM algorithm. During the iteration process, when the algorithm approaches a singularity or a local minimum, the damping factor can adjust the step size to avoid the algorithm falling into these bad regions. This enhances the robustness of the algorithm and enables the algorithm to work stably under a wider range of conditions. The LM algorithm calculates the parameter update vector by constructing an incremental normal equation, which combines the Jacobian matrix of the model and the residual vector and can efficiently reduce the sum of squared residuals. Compared with other optimization algorithms, the LM algorithm usually has a faster convergence speed and can reach the optimal solution faster.
[0226] During the iteration process, the LM algorithm determines whether to stop the iteration by checking whether the parameter change is less than a preset tolerance or whether the maximum number of iterations is reached. This mechanism avoids unnecessary calculations and improves the efficiency of the algorithm. Accurate parameter estimation is the key to cultivation quality control. Step S2012 optimizes the parameters through the LM algorithm, providing reliable parameter estimation for subsequent cultivation quality control. These parameter estimations can be used to calculate the distribution of internal damage degree of Platycladus orientalis, and then apply pesticides in corresponding proportions to improve the cultivation effect.
[0227] In summary, through the specific execution steps of the LM algorithm in this embodiment, the effective optimization of parameters is achieved. This algorithm combines the advantages of the gradient descent method and the Gauss-Newton method. By calculating the residual, Jacobian matrix, and parameter update vector, it gradually approaches the optimal solution. At the same time, through convergence checking, it ensures that the algorithm stops when a sufficiently good solution is found, improving the efficiency and stability of the algorithm. The implementation of this step provides accurate parameter estimation for subsequent cultivation quality control and a reliable basis for applying pesticides in corresponding proportions.
[0228] Test example:
[0229] (1) Test purpose:
[0230] This example aims to compare the cultivation quality control method combining GC-IMS detection technology and bidirectional Bi-GRU-PID neural network (experimental group, i.e., the technical solutions provided in Examples 1 to 3) with the method of only estimating the internal damage degree of Platycladus orientalis based on GC-IMS detection technology and traditionally irrigating pesticides (control group, i.e., traditional technology) in terms of controlling the internal damage degree of Platycladus orientalis.
[0231] (2) Test materials:
[0232] Select healthy and undamaged Platycladus orientalis plants as the detection objects.
[0233] Artificially inoculate 10 adult beetles of Phloeosinus aubei on each Platycladus orientalis plant to simulate the pest situation under natural conditions.
[0234] FlavourSpec1H1-00053 type headspace gas chromatography-ion mobility spectrometry (G.A.S. company, Germany), used for gas sampling and detection.
[0235] Bidirectional Bi-GRU-PID neural network system, used for measurement and control of pesticide irrigation in the experimental group.
[0236] Traditional pesticide irrigation equipment, used for pesticide irrigation in the control group.
[0237] (3) Test method:
[0238] 3.1 Cultivation stage:
[0239] The selected Platycladus orientalis plants are divided into an experimental group and a control group, with several plants in each group.
[0240] After artificially inoculating adult Tomicus piniperda, the plants are cultivated for one growth cycle under the same environmental conditions.
[0241] 3.2 Gas sampling and detection stage:
[0242] After the cultivation is completed, gas sampling and detection are carried out on the inside of the Platycladus orientalis plants in the experimental group and the control group every 2 hours using a FlavourSpec1H1-00053 type headspace gas chromatography-ion mobility spectrometer.
[0243] Perform multi-linear principal component analysis on the obtained GC-IMS data, and extract the top 2 principal components (PC1, PC2) with the highest contribution.
[0244] 3.3 Control and treatment stage:
[0245] Experimental group: Use a bidirectional Bi-GRU-PID neural network to calculate the internal damage degree of Platycladus orientalis according to the extracted PC1 and PC2 data. According to the calculation results, adjust the irrigation amount of the pesticide irrigation system through a PID controller to achieve precise control.
[0246] Control group: Based on the extracted PC1 and PC2 levels, perform irrigation according to the preset pesticide irrigation amount rule; the irrigation amount is determined according to traditional experience or preset standards and is not adjusted in real time.
[0247] 3.4 Statistics and analysis stage:
[0248] After the experiment has been carried out for 20 hours, the internal damage degrees of the Platycladus orientalis plants in the experimental group and the control group are statistically analyzed. Draw a line chart of the internal damage degrees of the experimental group and the control group to compare the differences in damage degrees between the two groups.
[0249] (IV) Experimental results:
[0250] Through Figure 6 It can be clearly seen that the internal damage degree of the Platycladus orientalis in the experimental group is significantly less than that in the control group. Since the experimental group uses a bidirectional Bi-GRU-PID neural network for real-time calculation and control, it can more accurately adjust the pesticide irrigation amount according to the actual damage degree of Platycladus orientalis, thus effectively controlling the development of damage. The control group, on the other hand, only performs irrigation based on the traditional preset pesticide irrigation amount and cannot adjust the irrigation amount in real time to adapt to the actual damage situation of Platycladus orientalis, so the damage degree is relatively large.
[0251] (V) Conclusion:
[0252] Compared with the method of estimating the internal damage degree of Platycladus orientalis based only on GC-IMS detection technology and applying pesticides by traditional irrigation, the cultivation quality control method combining GC-IMS detection technology and bidirectional Bi-GRU-PID neural network has a more significant effect in controlling the internal damage degree of Platycladus orientalis. This method can achieve precise control of the pesticide irrigation amount, improve the utilization efficiency of pesticides, reduce production costs, and at the same time improve the cultivation effect and quality of Platycladus orientalis.
[0253] For those skilled in the art, it can be further realized that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0254] At the same time, those skilled in the art can understand that all or part of the processes of implementing the methods of all 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, storage, database, or other medium provided in the present application and used in the embodiments can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0255] The above embodiments only express the implementation manners of the relevant actual applications of the present invention. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several variations and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the appended claims.
Claims
1. A cultivation quality control method based on GC-IMS technology, comprising forming an independent variable x based on the combined concentrations PC1 and PC2 of volatile compounds of Platycladus orientalis regularly collected by a GC-IMS detection system, characterized in that: The following steps are included: S1, arranged in chronological order into a data set D = [x1, x2,, ..., x n ]; where x i is the ith independent variable, n is the sample size of the independent variable; S2, the data set D is input into a bidirectional Bi-GRU-PID neural network, the response variable of the internal damage degree of Platycladus orientalis is regarded as the dependent variable y, and the positive and negative dependencies in the time series data are captured. The GRU unit generates i The response parameters [P(t),y I (t),y D (t)]; S3, based on the dependent variable y predicted in step S2 and its corresponding common response parameters of proportion, integration and differentiation [P(t),y I (t),y D (t)] and is brought into the PID controller for execution.
2. The cultivation quality control method according to claim 1, characterized in that: In S2, the bidirectional Bi-GRU-PID neural network includes: S200, encoding layer processing: at the current time step t, all data sets D are combined into an input sequence S, and the forward and backward hidden states of the bidirectional Bi-GRU-PID neural network are initialized; the dependency relationship between the input sequence and the dependent variable y is extracted from the forward and backward directions simultaneously through several GRU units, and the encoding operation is performed to generate a hidden state sequence H; S201, iterative calculation: iteratively execute all sub-steps of S200 until the hidden state sequence H of the previous time step is t-1 is accurate; S202, decoding layer processing: convert the hidden state sequence H of the previous time step t-1 Input to the decoding layer; the bidirectional Bi-GRU-PID network again extracts the hidden state sequence H of the previous time step from both the forward and backward directions through several GRU units t-1 The dependencies in the hidden state sequence H are used to perform a decoding operation and decode the response parameters required for controlling the electrical signal e(t) of the cultivation pesticide irrigation system.
3. The cultivation quality control method according to claim 2, characterized in that: The execution steps of S200 include: S2000, GRU unit operation: Proportional neuron P: P(t) = Kp·e(τ); Integral Neuron I: Differentiable neuron D: Concatenate into input vector x t =[P(t),y I (t),y D (t)]; Update gate: z u =σ(W u e(τ)+U u h t-1 ); Reset gate: z r =σ(W r e(τ)+U r h t-1 ); Among them, K p is the proportionality coefficient, e(τ) is the error between the combined concentrations PC1 and PC2; K i is the integration coefficient, b I is the bias of the integrating neuron; τ is the time response variable; y I (t) is the output of the integrating neuron at time t; is the integral of the error signal e(t) from 0 to t; K d is the differential coefficient, b D is the bias of the differentiating neuron; y D (t) is the output of the differentiable neuron at time t; is the derivative of the error signal e(t); W u and U u is the weight matrix in the update gate; z u is the activation value of the update gate; z r is the activation value of the reset gate; σ is the sigmoid activation function; W r and U r is the weight matrix in the reset gate; h t-1 is the hidden state at the previous time step.
4. The cultivation quality control method according to claim 3, characterized in that: The S200 further includes: S2001, calculate the forward candidate hidden state and the forward hidden state Among them, W x and W h is the weight matrix, is the bias vector; is a weight matrix.
5. The cultivation quality control method according to claim 4, characterized in that: S2002, calculate the backward candidate hidden state and the backward hidden state in, is a weight matrix; is the bias vector; S2003, for each time step t, the hidden state Where [·; ·] represents the vector concatenation operation; the entire hidden state sequence H = [h1,h2,…,h T ]; where T is the length of the sequence.
6. The cultivation quality control method according to claim 2, characterized in that: In S201, the accurate measurement and adjustment method includes: S2010, the residual function r is used to measure the hidden state h t The deviation amplitude r(h t ): r(h t )=h t *exp(-λ*t)-C m Among them, C m is the current hidden state h t The hidden state sequence H of the previous time step t-1 The residual of ; λ is the decay rate; S2011, based on the deviation amplitude r(h t ) measures the hidden state sequence H of the previous time step t-1 The difference between Where N is the total number of data points; S2012, using the LM algorithm to minimize the sum of squares of the residual function r; in each iteration, the LM algorithm calculates the current deviation amplitude r (h t ) calculates an update step size and applies this step size to update the parameters; the iteration process will continue until convergence; when the LM algorithm converges, the hidden state sequence H corresponding to the previous time step t-1 It is considered to be a stable and accurate parameter.
7. The cultivation quality control method according to claim 3, characterized in that: The execution step of S202 and the method for obtaining the response parameter include: P i (c)'=DecodeLayerOutput(h dec )=[P(t),y I (t),y D (t)]; in, and Respectively represent the hidden states after forward and backward GRU unit processing; h dec It is the hidden state of the decoding layer obtained by concatenating the forward and backward hidden states; DecodeLayerOutput(·) is a decoding function or network layer that converts the decoding layer hidden state into a dependent variable y(sequence) y = [y1,y2,,...,y n ]; Among them, y i is the ith independent variable x i The corresponding dependent variable data is the response variable of the internal damage degree of Platycladus orientalis; [P(t),y I (t),y D (t)] is the response parameter.
8. The cultivation quality control method according to claim 7, characterized in that: The execution method of S3 includes: Furthermore, e(t) can be used to directly implement the dependent variable y i (Corresponding to the predicted internal damage degree of Platycladus orientalis) quantitative pesticide irrigation is achieved.
9. The cultivation quality control system based on GC-IMS technology is characterized by: The system includes a processor and a memory connected to the processor, wherein program instructions are stored in the memory, and when the program instructions are executed by the processor, the processor executes the cultivation quality control method according to any one of claims 1 to 8.
10. The cultivation quality control system according to claim 9, characterized in that: After the electrical signal e(t) is calculated, it is input into the PLC controller of the cultivation pesticide irrigation system to control the opening, flow rate or start time of the electromagnetic valve of the cultivation pesticide irrigation system.
Citation Information
Patent Citations
Early prediction method for invasion quantity of platycladus orientalis bark beetles based on GC-IMS
CN114252500A