Deep learning-based plant drought tolerance prediction method and system

By combining the deep learning architecture of time convolution network and bidirectional LSTM and introducing a custom attention mechanism module, the data complexity and model accuracy problems in the prediction of drought tolerance of oil tea are solved, and drought tolerance monitoring is achieved with higher accuracy.

CN119990418APending Publication Date: 2025-05-13RES INST OF SUBTROPICAL FORESTRY CHINESE ACAD OF FORESTRY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510054548.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When using deep learning to predict drought tolerance of oil tea, the prior art faces the problems of high data dimensions, lots of redundant information, complex data processing and poor prediction model accuracy.

Method used

A deep learning architecture combining time convolution network layer and bidirectional LSTM is used to extract multi-dimensional features of environmental variables under drought stress conditions, and predict plant leaves SPAD values. By introducing two custom attention mechanism modules, dynamically adjusting the importance weight of the time step and the weighting processing of the feature channel, the prediction accuracy and stability of the model are improved.

Benefits of technology

It significantly improves the accuracy of plant drought tolerance monitoring, can more accurately evaluate the drought tolerance of plants under drought stress conditions, and enhances the model's ability to capture dynamic changes under complex environmental conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119990418A_ABST
    Figure CN119990418A_ABST
Patent Text Reader

Abstract

The invention relates to a deep learning-based plant drought tolerance prediction method and system, and the method comprises the steps: obtaining SPAD values and environment variable data corresponding to each sampling time point of a to-be-detected plant in a set time period, carrying out the preprocessing, obtaining predicted SPAD values through a trained prediction model, predicting the change trend between the SPAD values according to the SPAD values collected by the to-be-detected plant, and carrying out the prediction of the drought tolerance of the to-be-detected plant. Determining the drought tolerance of the to-be-detected plant; the prediction model obtains local features and global features in time sequence data through a time convolutional network layer, and the obtained features extract a long-term dependency relationship in a feature sequence by using bidirectional LSTM; performing time step weighting processing on the input features through a first user-defined attention mechanism module; and through a second self-defined attention mechanism module, multi-head attention weighting is performed on the feature vector after time weighting, attention output is performed by splicing a weighting result of each attention head, and a predicted SPAD value is obtained through post-processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and specifically to a plant drought tolerance prediction method and system based on deep learning. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] The SPAD (Soil and Plant Analyzer Development) value is a reading that reflects the relative content of chlorophyll in plants. It represents the "greenness" of chlorophyll in leaves, which can indirectly reflect the growth status and health of plants and is used to predict plant drought tolerance. For example, plants with different drought tolerance will have different trends in their SPAD values ​​under drought stress. For plant varieties with strong drought tolerance, their SPAD values ​​may be relatively stable or decrease slightly; while for plant varieties with weak drought tolerance, their SPAD values ​​may decrease significantly. Therefore, by monitoring and analyzing the changes in SPAD values, the drought tolerance of plants can be evaluated.

[0004] Take the prediction of drought resistance of camellia oleifera as an example. During the planting period, workers usually rely on experience and intuition to judge the drought resistance of camellia oleifera, which is not only inefficient but also inaccurate. If a deep learning-based method is used to predict the drought resistance of camellia oleifera, since the growth of camellia oleifera is affected by a variety of environmental factors, the data dimension is high and there is a lot of redundant information, there are problems with the complexity of data processing and the accuracy of the prediction model. Some deep learning models have shown good performance in time series data processing and can achieve high accuracy when processing a single variable, but the growth of camellia oleifera is affected by a variety of factors and the environmental conditions are complex and changeable, so the effects of these models are not ideal. Summary of the invention

[0005] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a method and system for predicting plant drought tolerance based on deep learning, which uses a deep learning architecture combining a temporal convolutional network layer and a bidirectional LSTM to extract multidimensional features of environmental variables (such as substrate moisture content, substrate temperature, and atmospheric temperature and humidity) under drought stress conditions, and predict the SPAD value of plant leaves. Through this prediction, the drought tolerance of plants under drought stress conditions can be indirectly evaluated, significantly improving the accuracy of drought tolerance monitoring.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides a method for predicting plant drought tolerance based on deep learning, comprising the following steps:

[0008] Obtain and pre-process the SPAD values ​​and environmental variable data corresponding to each sampling time point of the plant to be tested within a set time period, obtain the predicted SPAD value using the trained prediction model, predict the change trend between the SPAD values ​​based on the SPAD values ​​collected from the plant to be tested, and determine the drought tolerance of the plant to be tested;

[0009] Among them, the preprocessed SPAD value and environmental variable data form time series data and are input into the prediction model. The local features and global features in the time series data are obtained through the time convolutional network layer, and the obtained features are used to extract the long-term dependencies in the feature sequence using the bidirectional LSTM; the input features are time-step weighted through the first custom attention mechanism module; the time-weighted feature vector is multi-headed weighted through the second custom attention mechanism module, and the attention output is performed by splicing the weighted results of each attention head, and the predicted SPAD value is obtained after post-processing.

[0010] Furthermore, the SPAD value and environmental variable data corresponding to each sampling time point of the plant to be tested within the set time period are obtained, specifically: healthy, disease-free and consistently growing plants to be tested are selected as test materials, holes are punched at a set distance from the surface of the substrate on the outer wall of the plant container, and water is poured after sealing until it is completely saturated; the temperature and humidity of the substrate are obtained from the punched holes using a soil temperature and humidity sensor as environmental variable data, and the SPAD values ​​of the plant leaves are detected at the same time.

[0011] Furthermore, the prediction model includes an input layer, a hidden layer and an output layer; the hidden layer includes a temporal convolutional network layer, a Dropout layer, a bidirectional LSTM layer, a custom attention mechanism and a Flatten layer.

[0012] Furthermore, the temporal convolutional network layer captures local temporal dependencies through a one-dimensional convolution operation, as shown in the following formula:

[0013]

[0014] Among them, k is the convolution kernel size, w i is the convolution weight, x t-i is the input feature.

[0015] Furthermore, the bidirectional LSTM layer combines the forward and reverse time series features to capture global dependencies. The output is represented as: in and are the hidden states of the forward and backward LSTM, respectively.

[0016] Furthermore, the first custom attention module processes the three-dimensional time series data, calculates the attention weights through transposition and dense layers, generates a single attention vector using an activation function, and expands the vector back to the original size; the input data is the number of samples in each batch, the length of the time dimension of each sample, and the number of features, as shown in the following formula:

[0017]

[0018] Among them, x t is the feature vector at the input time step t, W is the learnable weight matrix used to calculate the attention score, b is the bias term used to adjust the offset of the attention score, α t is the attention weight at time step t, indicating the importance of this time step, and T is the total number of time steps in the sequence; the generated attention weight is multiplied element-by-element with the original input to generate a weighted output:

[0019] Furthermore, the second custom attention module weights the feature channels through a multi-head attention mechanism based on the output of the first custom attention module, as shown in the following formula:

[0020]

[0021] Among them, h is the index of the attention head, which represents the attention weight calculated independently by each head, and W h is the weight matrix of the attention head h, b h is the bias term of the attention head h, α t h is the attention weight of time step t generated by attention head h, ReLU(z)=max(0,z) is the nonlinear activation function; the weighted results of each attention head are connected to form a comprehensive attention output:

[0022]

[0023] A second aspect of the present invention provides a system for implementing the above method, comprising:

[0024] The data set construction module is configured to: obtain and pre-process the SPAD value and environmental variable data corresponding to each sampling time point of the plant to be tested within a set time period;

[0025] The model training module is configured to: train the prediction model using the preprocessed data;

[0026] The prediction output module is configured to: obtain a predicted SPAD value using the trained prediction model, predict a change trend between SPAD values ​​according to the SPAD values ​​collected from the tested plant, and determine the drought tolerance of the tested plant;

[0027] Among them, the preprocessed SPAD values ​​and environmental variable data form time series data and are input into the prediction model. The local features and global features in the time series data are obtained through the time convolutional network layer, and the obtained features are used to extract the long-term dependencies in the feature sequence using the bidirectional LSTM layer; the input features are time-step weighted through the first custom attention mechanism module; the time-weighted feature vectors are multi-headed for weighted attention through the second custom attention mechanism module, and the attention output is performed by splicing the weighted results of each attention head, and the predicted SPAD value is obtained after post-processing.

[0028] A third aspect of the present invention provides a computer-readable storage medium.

[0029] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the plant drought tolerance prediction method based on deep learning as described above.

[0030] A fourth aspect of the present invention provides a computer device.

[0031] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the plant drought tolerance prediction method based on deep learning as described above are implemented.

[0032] Compared with the prior art, one or more of the above technical solutions have the following beneficial effects:

[0033] 1. By using a deep learning architecture combining a temporal convolutional network (TCN) and a bidirectional LSTM (BiLSTM), multi-dimensional feature extraction is performed on environmental variables (such as substrate moisture content, substrate temperature, and atmospheric temperature and humidity) under drought stress conditions, and the SPAD value of plant leaves is predicted. Through this prediction, the drought tolerance of plants under drought stress conditions can be indirectly evaluated, significantly improving the accuracy of drought tolerance monitoring.

[0034] 2. Two custom attention mechanism modules were added during the training of the model. The first attention mechanism accurately focuses on key time steps by dynamically assigning importance weights to time steps, and highlights the weights of important features at these time steps, effectively reducing the interference of redundant information in the time dimension. This mechanism enables the model to focus more on time points and features that have a substantial impact on the prediction results, thereby improving the accuracy and stability of the prediction. The second attention mechanism adopts a multi-head structure design to enable it to capture the complex and subtle associations between environmental variables. Through multiple parallel attention heads, the relationship between variables is modeled from different angles, effectively strengthening the ability to model the nonlinear relationship between key variables (such as substrate moisture content) and SPAD values. This mechanism significantly improves the model's ability to deeply understand the response of plant drought resistance, enabling the model to more accurately predict plant growth conditions when facing changing environmental conditions.

[0035] 3. The two attention mechanisms do not exist in isolation, but closely cooperate and influence each other. Specifically, the first attention mechanism selects and highlights key time steps and important features, while weakening the interference of irrelevant time steps. This fine processing of the time dimension provides more accurate and effective input data for the second attention mechanism, so that it can focus more on those variables and relationships that are important for predicting the target when capturing the complex associations between environmental variables in the feature dimension. At the same time, the second attention mechanism strengthens the relationship between key variables and SPAD values ​​and deeply explores the nonlinear interactions between variables. This optimization in the feature dimension in turn provides the first attention mechanism with a more accurate variable expression, thereby improving the first attention mechanism's ability to identify key time steps and features in time series. This collaborative and mutually reinforcing relationship enables the two attention mechanisms to work together to significantly improve the model's ability to capture dynamic changes in plant drought tolerance responses.

[0036] 4. The Dropout layer is introduced in model training to suppress overfitting, and the Flatten layer and the fully connected layer are combined to improve the model's ability to integrate high-dimensional features. Through the deep combination of TCN and BiLSTM, the model can capture the trend of SPAD values ​​changing over time under drought stress conditions, providing strong technical support for plant drought tolerance prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0038] Figure 1 It is a schematic diagram of the drought resistance prediction process of Camellia oleifera provided by one or more embodiments of the present invention;

[0039] Figure 2 is a schematic diagram of a custom attention mechanism during the prediction of drought tolerance of Camellia oleifera provided by one or more embodiments of the present invention;

[0040] Figure 3 It is a schematic diagram of fitting the predicted value and the true value of the SPAD value of Camellia oleifera provided by one or more embodiments of the present invention. DETAILED DESCRIPTION

[0041] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0042] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0043] As described in the background technology, since the growth of tea oil is affected by many environmental factors, the data dimension is high and there is a lot of redundant information, there are problems with the complexity of data processing and the accuracy of the prediction model. Some deep learning models have shown good performance in time series data processing and can achieve high accuracy when processing a single variable, but the growth of tea oil is affected by many factors and the environmental conditions are complex and changeable, so the effect of these models is not ideal.

[0044] The following example provides a method and system for predicting plant drought tolerance based on deep learning. Taking the prediction of drought tolerance of Camellia oleifera as an example, the drought tolerance of Camellia oleifera is efficiently predicted by collecting and analyzing multi-dimensional time series data of Camellia oleifera grafted seedlings and using the optimized TCN-BiLSTM model. When training the prediction model, using the SPAD value as the target value can help the model learn the changing rules of the SPAD value of Camellia oleifera under different environmental conditions (such as different soil moisture content, different meteorological conditions, etc.).

[0045] Embodiment 1:

[0046] like Figure 1 As shown, the plant drought tolerance prediction method based on deep learning includes the following steps:

[0047] Obtain and pre-process the SPAD values ​​and environmental variable data corresponding to each sampling time point of the plant to be tested within a set time period, obtain the predicted SPAD value using the trained prediction model, predict the change trend between the SPAD values ​​based on the SPAD values ​​collected from the plant to be tested, and determine the drought tolerance of the plant to be tested;

[0048] Among them, the preprocessed SPAD values ​​and environmental variable data form time series data and are input into the prediction model. The local features and global features in the time series data are obtained through the temporal convolutional network (TCN) layer, and the obtained features are used to extract the long-term dependencies in the feature sequence using the bidirectional LSTM layer (BiLSTM); the input features are time-step weighted through the first custom attention mechanism module; the time-weighted feature vectors are multi-headed for weighted attention through the second custom attention mechanism module, and the weighted results of each attention head are concatenated for attention output, and the predicted SPAD value is obtained after post-processing.

[0049] Considering that the attention mechanism has been proven to improve the accuracy of time series data processing, it is important to simplify the calculation and focus on key features when processing complex time series data. This problem is mainly caused by the high dimensionality and redundant information of time series data.

[0050] The first custom attention mechanism is based on the improvement of the sequence attention mechanism. It solves the problem of data processing complexity by processing three-dimensional time series data, transposing and calculating attention weights in dense layers, generating a single attention vector and expanding it back to the original size. In this way, the model can focus on important data more effectively and reduce computational complexity.

[0051] When improving the accuracy of the prediction model, it is crucial to capture the features of key time steps to fully reflect the changing trends of the data. The first custom attention mechanism is based on the improvement of the sequence attention mechanism, and is optimized for the global dependencies of time series data and the dynamic importance of key time steps. By introducing an additional dynamic normalization module and a weighted regulation mechanism, the mechanism can dynamically assign importance scores to each time step, allowing the model to focus more on the time step features related to the prediction target, thereby improving predictability.

[0052] In addition, fully capturing the diversity and complex associations of input features is another key issue. Therefore, the second custom attention mechanism is improved based on the multi-head attention mechanism. Multiple sets of attention weights are calculated through multiple dense layers. Each attention head independently weights the input features and effectively connects the weighted results, thereby greatly enhancing the model's ability to capture input features. This multi-head attention design enables the model to understand the dynamic relationship and long-term and short-term dependencies between different input variables in more detail, significantly improving the prediction accuracy of time series data.

[0053] At the same time, the advantages of TCN (temporal convolutional network) and BiLSTM (bidirectional long short-term memory network) models are combined. Through the introduction of these two custom attention mechanisms, the model's processing capability and prediction accuracy for complex time series data are further improved, making the prediction results of oil-tea drought stress resistance more stable and reliable.

[0054] like Figure 1 As shown, the method for predicting drought resistance of Camellia oleifera based on deep learning includes the following steps:

[0055] S1: Data collection: Collect the SPAD value of oil-tea camellia seedlings every day within 51 days and environmental variable data such as substrate moisture content, substrate temperature, atmospheric temperature and humidity to form a data set for measuring drought resistance of oil-tea camellia.

[0056] Among them, the SPAD value is used as the target value during model training to reflect the changes in chlorophyll content in tea leaves. Chlorophyll content is one of the important indicators of plant photosynthesis and is significantly affected by drought stress. Therefore, the SPAD value can indirectly reflect the drought resistance of tea leaves.

[0057] S2: Data processing: Preprocess the collected data, including missing value filling, data cleaning, normalization and data enhancement, to further optimize the data set.

[0058] S3: Construct a deep learning network model with a network structure of temporal convolutional network (TCN) - bidirectional LSTM (BiLSTM) - the first custom attention mechanism module - the second custom attention mechanism module - the fully connected layer, and optimize the model, that is, optimize the TCN-BiLSTM model by adding two custom attention mechanisms.

[0059] S4: Model training: Use the training set to train the optimized TCN-BiLSTM model, and perform full training based on the pre-trained model to finally obtain a trained prediction model.

[0060] S5: SPAD value prediction: Use the trained prediction model to predict the SPAD value of the data in the test set.

[0061] S6: Result verification: Verify the accuracy of the model prediction results and compare them with the actual measured SPAD values ​​to ensure the reliability of the model.

[0062] Step S1 includes: selecting healthy, disease-free, neat and uniform grafted seedlings, Camellia oleifera varieties, 2-year-old grafted seedlings of CL 4, CL40 and CL53 as test materials. Drill holes on the outer wall of the container at 5 cm, 10 cm, and 15 cm below the surface of the substrate for measuring substrate temperature and humidity, and then watering after sealing with tape until it is completely saturated. Use a soil temperature and humidity sensor to measure the substrate, and then seal it with tape. At the same time, detect the SPAD value of the leaves. The test ends when a large number of grafted seedlings die. The atmospheric temperature and humidity values ​​are taken as the average value of the day.

[0063] Step S2 includes: removing noise and outliers through data cleaning to ensure data quality. Using normalization method to scale the data to a uniform range, it is convenient for model training and prediction. Normalization uses linear normalization method to map the data to the [0, 1] interval: Among them, x is the original value, x min and x max are the minimum and maximum values ​​of the features respectively. Next, we apply the time scaling data augmentation technique to generate more training data through interpolation method: aug (t) = interp(t,x original ), where interp is the interpolation function and xoriginal is the original time series. This method increases the diversity of data and improves the generalization ability of the model. Finally, the dataset is divided into a training set and a test set, 90% of which is used for training and 10% for testing.

[0064] In step S3, the network model includes an input layer, a hidden layer and an output layer; the hidden layer includes a TCN layer, a Dropout layer, a BiLSTM layer, a custom attention mechanism and a Flatten layer.

[0065] S31: The input layer first accepts multidimensional time series data, including SPAD values, substrate temperature, atmospheric temperature and humidity, and other characteristic variables. The input shape is (batch_size, time_steps, feature_dims).

[0066] In this embodiment, the input layer accepts time series data, including input_steps=4 time steps, each time step includes input_dims=6 environmental variable features (such as moisture content above, in, and below the pot, substrate temperature, atmospheric temperature, and atmospheric humidity).

[0067] S32: The hidden layer is the core of the model, which includes the following modules: Temporal Convolutional Network (TCN) layer: Captures local temporal dependencies through one-dimensional convolution operations: Among them, k is the convolution kernel size, w i is the convolution weight, x t-iis the input feature. Bidirectional LSTM layer (BiLSTM): combines the forward and reverse time series features to capture global dependencies. The output is represented as: in and are the hidden states of the forward and backward LSTM, respectively.

[0068] The local and global features in the input time series are extracted through the temporal convolutional network (TCN), and the temporal receptive field is effectively expanded by dilating the convolution kernel. The dilation factor [1, 2, 4, 8, 16] can be used to extract temporal information at different time scales. The local temporal dependency is captured by the convolution operation with a dilated convolution kernel size of 1×1: Among them, k is the convolution kernel size, w i is the convolution weight, x t-i is the input feature. And there are 64 channels in total, which can capture the timing information at different time scales. Next, the features output by TCN are input into the bidirectional LSTM (BiLSTM) layer.

[0069] The BiLSTM layer consists of forward and backward LSTM units, which learn the forward and reverse dependencies of the time series respectively, thereby capturing the long-term dependencies in the sequence. The output of BiLSTM is specifically [4, 128]. By concatenating the forward and backward features, the network's ability to understand time series information is enhanced.

[0070] After the bidirectional LSTM layer, the first custom attention mechanism module is entered. This module performs weighted processing on time steps and can dynamically adjust the importance weight of each time step to highlight the time information that plays a key role in the final prediction.

[0071] The calculation methods of the two custom attention mechanisms are:

[0072] S33: The first custom attention mechanism is based on the improvement of the sequence attention mechanism. It processes three-dimensional time series data, calculates attention weights through transposition and dense layers, and uses the Softmax activation function to generate a single attention vector, and then expands the vector back to the original size, thereby simplifying the calculation and focusing on important parts, improving the model's attention to key moments.

[0073] The input data shape is (batch_size, time_steps, feature_dims), where batch_size refers to the number of samples in each batch, time_steps refers to the length of the time dimension of each sample, and feature_dims represents the number of features.

[0074] The specific formula is as follows:

[0075] Among them, x t is the feature vector at the input time step t, with dimension (feature_dims). W: a learnable weight matrix used to calculate the attention score. b: a bias term used to adjust the offset of the attention score. α t : The attention weight at time step t, indicating the importance of this time step, normalized to [0, 1]. T: The total number of time steps in the sequence. The generated attention weight is multiplied element-wise with the original input to generate a weighted output:

[0076] The specific implementation process is as follows Figure 2 As shown in the upper part, the input features are transposed from [4, 128] to [128, 4] to calculate the weight of the time step. Then, a fully connected layer (Dense) and a Soft max activation function are used to generate the time step attention weights. The time step weights are averaged and restored to the shape of [4, 128] after the dimension is expanded through the RepeatVector operation. Finally, the weighted time feature is multiplied with the original feature using the Multiply operation to generate a time-weighted feature vector.

[0077] S34: The second custom attention mechanism is improved based on the multi-head attention mechanism. Based on the output of the first module, the second custom attention mechanism weights the feature channels through the multi-head attention mechanism. Each attention head is weighted independently. It adds the ReLU activation function to the attention weight calculation formula. The formula is:

[0078] Where h is the index of the attention head, indicating the attention weight calculated independently by each head. h : The weight matrix of the attention head h. b h : The bias term of the attention head h. α t h : The attention weight at time step t generated by attention head h. ReLU(z)=max(0,z) is a nonlinear activation function. Then, the weighted results of each attention head are concatenated to form a comprehensive attention output: Finally, after concatenating multiple features, a Dense layer is introduced for further integration. The formula is: The Dense layer compresses and integrates the concatenated multi-head features to reduce redundant information.

[0079] In this embodiment, the module consists of 4 independent attention heads, each of which performs weighted processing on the input feature channel. The specific implementation process is as follows: Figure 2As shown in the lower part, each attention head uses a Dense layer to calculate the weight of the feature channel, then multiplies the input feature channel by the attention weight to generate a weighted feature, and uses the relu activation function to calculate the attention weight. Finally, the weighted features of the four attention heads are concatenated to output a feature vector of [4, 512].

[0080] In step S4, the training method of the obtained TCN-BiLSTM-attention mechanism model is:

[0081] S41: Set the time step of input data to time_steps, and the input feature dimension to input_di ms, including substrate moisture content, substrate temperature, upper basin moisture content, middle basin moisture content, lower basin moisture content, atmospheric temperature, etc. Set the maximum number of iterations to T.

[0082] In this embodiment, the time step of the input data is set to time_steps=4, the input feature dimension is input_dims=6, including features such as substrate moisture content, substrate temperature, upper basin moisture content, middle basin moisture content, lower basin moisture content, and atmospheric temperature. The maximum number of iterations is set to K=500, and the batch size is 32.

[0083] S42: Randomly select samples from the enhanced training dataset for batch training.

[0084] In this embodiment, the time scaling factor is set to 0.5, and the number of time steps of each sample is compressed to half of the original, so that the model can adapt to changes on different time scales and enhance the model's learning ability for time series.

[0085] S43: Input the selected training samples and their labels into the model for training. Use MAE (mean absolute error) as the loss function to measure the error between the model's prediction results and the true labels.

[0086] The MAE loss function is:

[0087]

[0088] where y (i) is the true SPAD value of the i-th sample, is the SPAD value predicted by the model, and N is the number of training samples.

[0089] S44: The input of the model is the time series data consisting of environmental variables (such as substrate moisture content, substrate temperature, etc.) in the previous time_steps time steps. The input data of each time step includes input_dims=6 features. First, the input data is extracted through a temporal convolutional network (TCN) to extract time series features. The dilations parameter of the TCN layer is used to capture time series patterns at different scales. The specific dilation is set to [1, 2, 4, 8, 16], which indicates how the receptive field of the convolution kernel is expanded at each layer.

[0090] S45: The time series features extracted by TCN are further used to capture the long-term dependencies in the sequence through the bidirectional LSTM (BiLSTM) layer. The bidirectional structure can consider both forward and reverse time series information at the same time, thereby enhancing the expressiveness of the model.

[0091] In this embodiment, the shape of the BiLSTM layer output is [4, 128], that is, the number of time steps is 4 and the feature dimension of each time step is 128.

[0092] S46: After the BiLSTM output, two custom attention mechanism modules are used to perform weighted sum operations to help the model focus on the features at key moments that have a greater impact on the prediction results. The first custom attention mechanism calculates the attention weight of the feature and weights the input feature, and then the second custom attention mechanism is used to further weight the processed features, ultimately obtaining a more accurate feature representation.

[0093] In this embodiment, the output shape of the first custom attention mechanism remains [4, 128], and the second custom attention mechanism further weights the processed features, and the output shape becomes [4, 512], and 4 attention heads are used to capture different timing information.

[0094] S47: Through the back-propagation algorithm and Adam optimizer, the error between the predicted value and the true value is calculated according to the MAE loss function, and the network parameter θt is updated.

[0095] In this embodiment, the network parameter update rule is: θ t =θ t-1 -ε·▽ θ L, where ▽ θ L is the gradient of the loss function with respect to the network parameter θ, and ε is the learning rate of the optimizer.

[0096] S48: Repeat the above steps to traverse all the amplified training data samples until the maximum number of iterations K is reached.

[0097] S5: SPAD value prediction: Use the trained prediction model to predict the SPAD value of the data in the test set;

[0098] After completing the model training, the trained and optimized TCN-BiLSTM model is used to predict the SPAD value of the data in the test set. First, the environmental variable data in the test set (such as substrate moisture content, substrate temperature, atmospheric temperature and humidity, etc.) are input into the trained model. The trained model will predict the SPAD value of the oil-tea seedlings every day based on these environmental variable data. These prediction results will be used for subsequent verification and analysis.

[0099] S6: Result verification: Use the enhanced test sample set to verify the model of step S3 and test the prediction ability of the model. Randomly input the test sample set containing SPAD value measurement data corresponding to multiple environmental variables (such as substrate moisture content, substrate temperature, atmospheric temperature and humidity, etc.) into the trained model. By comparing the SPAD value predicted by the model with the actual measured SPAD value, the accuracy of the model in the prediction task is evaluated.

[0100] Evaluation results such as Figure 3 As shown in Figure 2, where predicted = predicted value and real = true value, the R is calculated based on the difference between the model prediction result and the actual measured SPAD value. 2 It is 0.98, indicating that the model can explain 98% of the variance, and the MAE (mean absolute error) is 0.28, which is highly accurate.

[0101] The above method uses a deep learning architecture combining TCN and BiLSTM to extract multidimensional features of environmental variables (such as substrate moisture content, substrate temperature, and atmospheric temperature and humidity) under drought stress conditions, and predict the SPAD value of oil-tea camellia leaves. Through this prediction, the drought tolerance of oil-tea camellia under drought stress conditions can be indirectly evaluated, significantly improving the accuracy of drought tolerance monitoring.

[0102] The two custom attention mechanism modules introduced in the above method play a key role in the model, and they have a profound and unique impact on the prediction results. The first attention mechanism, which mainly acts on time series data, accurately focuses on key time steps by dynamically allocating the importance weights of time steps, and highlights the weights of important features at these time steps, effectively reducing the interference of redundant information in the time dimension. This mechanism enables the model to focus more on those time points and features that have a substantial impact on the prediction results, thereby improving the accuracy and stability of the prediction. The second attention mechanism adopts a multi-head structure design, which enables it to capture the complex and subtle associations between environmental variables. By modeling the relationship between variables from different angles through multiple parallel attention heads, this mechanism effectively strengthens the ability to model the nonlinear relationship between key variables (such as substrate moisture content) and SPAD values, and significantly improves the model's ability to deeply understand the drought resistance response of Camellia oleifera. This capture and modeling of complex relationships enables the model to more accurately predict the growth status of Camellia oleifera when faced with changing environmental conditions. It is worth mentioning that these two attention mechanisms do not exist in isolation, but are closely coordinated and influenced by each other. Specifically, the first attention mechanism screens and highlights key time steps and important features while weakening the interference of irrelevant time steps. This fine processing of the time dimension provides more accurate and effective input data for the second attention mechanism, so that it can focus more on variables and relationships that are important for predicting the target when capturing the complex associations between environmental variables in the feature dimension. At the same time, the second attention mechanism strengthens the relationship between key variables and SPAD values ​​and deeply explores the nonlinear interactions between variables. This optimization in the feature dimension in turn provides the first attention mechanism with a more accurate variable expression, thereby improving the first attention mechanism's ability to identify key time steps and features in time series. This collaborative and mutually reinforcing relationship enables the two attention mechanisms to work together to significantly improve the model's ability to capture the dynamic changes in the drought resistance response of tea oil.

[0103] The above method effectively improves the quality and diversity of environmental variable data through multidimensional data processing technology (including missing value filling, normalization and time scaling data enhancement), ensuring the efficient performance of the model in training and prediction.

[0104] The above method introduces the Dropout layer in model training to suppress overfitting, and combines the Flatten layer and the fully connected layer to improve the model's ability to integrate high-dimensional features. Through the deep combination of TCN and Bi LSTM, the model can capture the trend of SPAD values ​​changing over time under drought stress conditions, providing strong technical support for the prediction of oil-tea drought resistance.

[0105] In order to further improve the accuracy of the model and expand its scope of application, the following improvements can also be considered:

[0106] 1) Integrate data features from more dimensions: In addition to the environmental variables currently considered, we can also try to integrate multi-dimensional data such as meteorological data, soil type, and plant physiological indicators to more comprehensively reflect the growth environment and drought resistance of Camellia oleifera.

[0107] 2) Optimize the structure of the attention mechanism: We can explore more complex attention mechanism structures, such as introducing position encoding in the self-attention mechanism, or trying different numbers of attention heads to find the optimal structure that best suits the prediction of drought resistance of Camellia oleifera.

[0108] 3) Improvement of the universality of the model: Although the current model is designed for Camellia oleifera, its core ideas and methodology can be extended to other similar plants. In order to achieve this universality, the model can be adaptively improved, such as adjusting the type and number of input features, or fine-tuning the model parameters to meet the drought tolerance prediction needs of different plants.

[0109] 4) Cross-domain application exploration: In addition to plant drought tolerance prediction, this model can also be applied to time series data prediction problems in other fields, such as agricultural pest and disease prediction, climate change trend prediction, etc., to verify the universality and generalization ability of the model.

[0110] Embodiment 2:

[0111] A system for implementing the above method comprises:

[0112] The data set construction module is configured to: obtain and pre-process the SPAD value and environmental variable data corresponding to each sampling time point of the plant to be tested within a set time period;

[0113] The model training module is configured to: train the prediction model using the preprocessed data;

[0114] The prediction output module is configured to: obtain a predicted SPAD value using the trained prediction model, predict a change trend between SPAD values ​​according to the SPAD values ​​collected from the tested plant, and determine the drought tolerance of the tested plant;

[0115] Among them, the preprocessed SPAD values ​​and environmental variable data form time series data and are input into the prediction model. The local features and global features in the time series data are obtained through the temporal convolutional network (TCN) layer, and the obtained features are used to extract the long-term dependencies in the feature sequence using the bidirectional LSTM layer (BiLSTM); the input features are time-step weighted through the first custom attention mechanism module; the time-weighted feature vectors are multi-headed for weighted attention through the second custom attention mechanism module, and the weighted results of each attention head are concatenated for attention output, and the predicted SPAD value is obtained after post-processing.

[0116] Two custom attention mechanism modules were added during the training of the model. The first attention mechanism mainly acts on time series data. By dynamically allocating the importance weights of time steps, it accurately focuses on key time steps and highlights the weights of important features at these time steps, effectively reducing the interference of redundant information in the time dimension. The second attention mechanism adopts a multi-head structure design, which enables it to capture the complex and subtle associations between environmental variables. Through multiple parallel attention heads, the relationship between variables is modeled from different angles, effectively strengthening the ability to model the nonlinear relationship between key variables (such as substrate moisture content) and SPAD values. This mechanism significantly improves the model's ability to deeply understand the response of Camellia oleifera to drought resistance.

[0117] Embodiment three:

[0118] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the plant drought tolerance prediction method based on deep learning as described in the above-mentioned embodiment 1 are implemented.

[0119] Embodiment 4:

[0120] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the plant drought tolerance prediction method based on deep learning as described in the above-mentioned embodiment 1 are implemented.

[0121] The steps or modules involved in the above embodiments 2 to 4 correspond to those in embodiment 1. For the specific implementation, please refer to the relevant description of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.

[0122] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A plant drought tolerance prediction method based on deep learning, characterized in that: The following steps are involved: Obtain and pre-process the SPAD values ​​and environmental variable data corresponding to each sampling time point of the plant to be tested within a set time period, obtain the predicted SPAD value using the trained prediction model, predict the change trend between the SPAD values ​​based on the SPAD values ​​collected from the plant to be tested, and determine the drought tolerance of the plant to be tested; Among them, the preprocessed SPAD value and environmental variable data form time series data and are input into the prediction model. The local features and global features in the time series data are obtained through the time convolutional network layer, and the obtained features are used to extract the long-term dependencies in the feature sequence using the bidirectional LSTM; the input features are time-step weighted through the first custom attention mechanism module; the time-weighted feature vector is multi-headed weighted through the second custom attention mechanism module, and the attention output is performed by splicing the weighted results of each attention head, and the predicted SPAD value is obtained after post-processing.

2. The method for predicting plant drought tolerance based on deep learning according to claim 1, characterized in that: The SPAD value and environmental variable data corresponding to each sampling time point of the plant to be tested within the set time period are obtained, specifically: healthy, disease-free and consistently growing plants to be tested are selected as test materials, holes are punched at a set distance from the surface of the substrate on the outer wall of the plant container, and water is poured after sealing until it is completely saturated; the temperature and humidity of the substrate are obtained from the punched holes using a soil temperature and humidity sensor as environmental variable data, and the SPAD value of the plant leaves is detected at the same time.

3. The method for predicting plant drought tolerance based on deep learning according to claim 1, characterized in that: The prediction model includes input layer, hidden layer and output layer; the hidden layer includes temporal convolutional network layer, Dropout layer, bidirectional LSTM layer, custom attention mechanism and Flatten layer.

4. The method for predicting plant drought tolerance based on deep learning as claimed in claim 3, characterized in that: The temporal convolutional network layer captures local temporal dependencies through a one-dimensional convolution operation, as shown in the following formula: Among them, k is the convolution kernel size, w i is the convolution weight, x t-i is the input feature.

5. The method for predicting plant drought tolerance based on deep learning as claimed in claim 3, characterized in that: The bidirectional LSTM layer combines the forward and reverse time series features to capture global dependencies. The output is represented as: in and are the hidden states of the forward and backward LSTM, respectively.

6. The method for predicting plant drought tolerance based on deep learning according to claim 3, characterized in that: The first custom attention module processes the three-dimensional time series data, calculates the attention weights through transposition and dense layers, generates a single attention vector using an activation function, and expands the vector back to the original size; the input data is the number of samples in each batch, the length of the time dimension of each sample, and the number of features, as shown in the following formula: Among them, x t is the feature vector at the input time step t, W is the learnable weight matrix used to calculate the attention score, b is the bias term used to adjust the offset of the attention score, α t is the attention weight at time step t, indicating the importance of this time step, and T is the total number of time steps in the sequence; the generated attention weight is multiplied element-by-element with the original input to generate a weighted output:

7. The method for predicting plant drought tolerance based on deep learning as claimed in claim 3, characterized in that: The second custom attention module weights the feature channels through a multi-head attention mechanism based on the output of the first custom attention module, as shown in the following formula: Among them, h is the index of the attention head, which represents the attention weight calculated independently by each head, and W h is the weight matrix of the attention head h, b h is the bias term of the attention head h, α t h is the attention weight of time step t generated by attention head h, ReLU(z)=max(0,z) is the nonlinear activation function; the weighted results of each attention head are connected to form a comprehensive attention output:

8. A plant drought tolerance prediction method system based on deep learning, characterized by: The data set construction module is configured to: obtain and pre-process the SPAD value and environmental variable data corresponding to each sampling time point of the plant to be tested within a set time period; The model training module is configured to: train the prediction model using the preprocessed data; The prediction output module is configured to: obtain a predicted SPAD value using the trained prediction model, predict a change trend between SPAD values ​​according to the SPAD values ​​collected from the tested plant, and determine the drought tolerance of the tested plant; Among them, the preprocessed SPAD value and environmental variable data form time series data and are input into the prediction model. The local features and global features in the time series data are obtained through the time convolutional network layer, and the obtained features are used to extract the long-term dependencies in the feature sequence using the bidirectional LSTM layer; the input features are time-step weighted through the first custom attention mechanism module; the time-weighted feature vector is multi-headed weighted through the second custom attention mechanism module, and the attention output is performed by splicing the weighted results of each attention head, and the predicted SPAD value is obtained after post-processing.

9. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the plant drought tolerance prediction method based on deep learning as described in any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the plant drought tolerance prediction method based on deep learning as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Soil humidity prediction method and system based on attention mechanism and multi-source data interpolation fusion

    CN121302852A

  • A soil moisture prediction method and system based on attention mechanism and multi-source data interpolation fusion

    CN121302852B