Soil health dynamic evaluation and early warning system based on time sequence recurrent neural network

The soil health dynamic assessment and early warning system based on temporal recurrent neural network collects and processes multi-dimensional soil data in real time, which solves the problems of lag in traditional assessment methods and the limitations of IoT early warning. It realizes dynamic assessment and early warning of soil health status, and improves the accuracy and timeliness of early warning.

CN121633433APending Publication Date: 2026-03-10GUIZHOU LAIFOTE MECHANICAL & ELECTRICAL EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-27
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, traditional soil health assessment methods are outdated and costly, IoT monitoring systems are limited to short-term anomalies in their early warnings, and machine learning methods do not fully consider the correlation of multiple time scales, resulting in delayed early warnings or a high rate of false alarms, making it difficult to achieve effective and proactive early warnings of potential risks.

Method used

A dynamic soil health assessment and early warning system based on a time-series recurrent neural network is adopted. Multi-dimensional soil health data is collected in real time through multiple types of sensors, and data preprocessing, multi-scale feature extraction and time-series modeling are performed. Combined with dynamic assessment and early warning modules, a dynamic soil health index is generated and early warning is provided.

Benefits of technology

It enables real-time dynamic assessment and early warning of soil health status, provides sufficient lead time for decision-making, reduces warning lag and false alarm rate, and improves the accuracy and timeliness of warnings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121633433A_ABST
    Figure CN121633433A_ABST
Patent Text Reader

Abstract

The invention discloses a soil health dynamic evaluation and early warning system based on a time sequence recurrent neural network, and relates to the technical field of soil health monitoring and intelligent early warning. Comprising a data acquisition module configured to acquire multi-dimensional soil health time sequence data in real time through multiple types of sensors deployed in soil, the soil health time sequence data including soil temperature, soil humidity, pH value, conductivity, organic matter content, nitrogen phosphorus and potassium content and heavy metal concentration; and the data preprocessing module is configured to perform missing value filling, abnormal value processing and standardization processing on the acquired soil health time sequence data. According to the invention, multi-dimensional soil health time sequence data are collected in real time through multiple types of sensors, and the problems of lagging, high cost and poor timeliness of traditional laboratory detection are solved; after data quality is guaranteed through data preprocessing, data are divided according to multiple time windows, and soil health laws under different time scales are captured by combining multi-scale feature extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of soil health monitoring and intelligent early warning technology, specifically a soil health dynamic assessment and early warning system based on a time-series recurrent neural network. Background Technology

[0002] Soil health is fundamental to agricultural production, having a decisive impact on crop growth, the ecological environment, and food safety. However, soil health problems such as salinization, compaction, nutrient imbalance, and heavy metal pollution are often a slow, cumulative, and evolving process. Traditional soil health assessment methods mainly rely on periodic laboratory testing, which suffers from drawbacks such as lag, high cost, and poor timeliness, making it difficult to achieve real-time monitoring of dynamic soil changes. While soil health monitoring systems based on sensor and IoT technologies can provide real-time data, their early warning functions often remain at the level of describing the current state or identifying short-term anomalies, failing to provide effective and proactive warnings for potential health risks that have subtle early symptoms and evolve slowly over a long period.

[0003] Existing machine learning and deep learning methods have made progress in processing time-series data, but most models, when applied to soil health, fail to fully consider the complexity and interrelationships of soil health influencing factors at different time scales. For example, short-term changes in soil moisture may affect crop growth, while long-term declines in soil organic matter may lead to structural degradation. Simply stacking these different scales of information or processing them in a single dimension results in models with insufficient ability to identify potential risks, delayed warnings, or high false alarm rates, failing to provide farmers or managers with sufficient lead time for decision-making, thus hindering the implementation of effective prevention and intervention measures. Therefore, how to effectively extract potential risk features from multi-scale time-series data and achieve accurate early warning is a pressing technical challenge that needs to be addressed. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a dynamic assessment and early warning system for soil health based on a time-series recurrent neural network. This system solves the problems of traditional soil health assessment being slow and costly, IoT monitoring systems limiting early warning to short-term anomalies, and machine learning methods failing to adequately consider multi-timescale correlations, leading to delayed early warnings or high false alarm rates.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a soil health dynamic assessment and early warning system based on a temporal recurrent neural network, comprising: The data acquisition module is configured to collect multi-dimensional soil health time-series data in real time through multiple types of sensors deployed in the soil. The soil health time-series data includes soil temperature, soil moisture, pH value, electrical conductivity, organic matter content, nitrogen, phosphorus and potassium content, and heavy metal concentration. The data preprocessing module is configured to perform missing value imputation, outlier handling, and standardization on the collected soil health time series data, and divide the processed data into multiple time scale subsets according to a preset time window; The multi-scale feature extraction module is configured to extract time-domain and frequency-domain features from data subsets at multiple time scales respectively, generating multi-scale feature vectors. The time-series modeling module is configured to take multi-scale feature vectors as input and feed them into the time-series recurrent neural network model. The time-series recurrent neural network model is used to learn the complex correlations and evolution patterns of soil health influencing factors at different time scales and output the time-series prediction results of soil health status. The dynamic assessment module is configured to dynamically assess the soil health status based on time-series prediction results and preset soil health assessment standards, and generate a dynamic soil health index. The advanced warning module is configured to provide advance warnings of potential soil health risks based on the future changing trends of the dynamic soil health index, combined with the set warning threshold and warning lead time.

[0006] Furthermore, the data preprocessing module specifically includes: The missing value filling unit is configured to fill missing values ​​in the soil health time series data using an interpolation algorithm; The outlier processing unit is configured to identify and correct outliers in soil health time series data using statistical methods. The standardization processing unit is configured to normalize or standardize the processed soil health time series data to eliminate the influence of data with different dimensions.

[0007] Furthermore, the preset time window specifically includes: Short-term time windows are used to divide soil health time-series data into daily or hourly subsets. A medium-term time window is used to divide soil health time-series data into weekly or monthly subsets. Long-term time windows are used to divide soil health time-series data into quarterly or annual subsets. The multi-scale feature extraction module extracts the mean, variance, kurtosis, skewness, and Fourier transform coefficients from the data subsets at each time scale.

[0008] Furthermore, the temporal recurrent neural network model is specifically a long short-term memory (LSTM) network model, configured as a multi-layer stacked structure.

[0009] Furthermore, the temporal recurrent neural network model specifically includes: The input layer is configured to receive multi-scale feature vectors. The encoding layer is configured to encode the feature vectors received from the input layer in order to extract high-level semantic features; The LSTM layer is configured to perform temporal dependency learning and long-term memory retention on the encoded feature sequence; The output layer is configured to output time-series predictions of soil health status, including predicted values ​​of soil health parameters for multiple future time steps.

[0010] Furthermore, the training process of the time-series recurrent neural network model specifically includes: collecting historical soil health data as a training dataset and a validation dataset; Set the training parameters, including the learning rate, batch size, and number of iterations; The weights and biases of the temporal recurrent neural network model are optimized by using the backpropagation algorithm, so as to minimize the prediction error of the model on the validation dataset.

[0011] Furthermore, the dynamic evaluation module specifically includes: The prediction value parsing unit is configured to receive the predicted values ​​of future soil health parameters from the time-series prediction results. The health index calculation unit is configured to calculate the dynamic soil health index for multiple future time steps based on predicted values ​​of future soil health parameters, combined with weighting factors and preset soil health assessment standards.

[0012] Furthermore, the advanced early warning module specifically includes: The trend analysis unit is configured to analyze the changing trends of the dynamic soil health index over multiple future time steps. The threshold comparison unit is configured to compare the predicted trend of the dynamic soil health index with the early warning threshold. The early warning signal generation unit is configured to generate an early warning signal when the predicted value of the dynamic soil health index reaches or exceeds the early warning threshold within the early warning lead time. The early warning signal includes the early warning level and the expected time of risk occurrence.

[0013] Furthermore, the advanced early warning module also includes: The early warning information release unit is configured to send early warning signals to user terminals via a visual interface, SMS, or email. The intervention suggestion generation unit is configured to generate targeted prevention and intervention suggestions based on the warning level and the expected time of risk occurrence, combined with a preset agricultural expert knowledge base or historical treatment plans.

[0014] Furthermore, the system also includes: The model update module is configured to periodically receive new soil health time-series data and use the new data to incrementally train the time-series recurrent neural network model in order to continuously optimize the model's prediction accuracy and early warning capability.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention utilizes multiple types of sensors to collect multi-dimensional time-series soil health data in real time, addressing the problems of lagging, high cost, and poor timeliness in traditional laboratory testing. After data preprocessing to ensure data quality, the data is divided into multiple time windows. Multi-scale feature extraction is combined to capture soil health patterns at different time scales. A multi-layer LSTM model is used to learn the complex correlations of multi-scale influencing factors, solving the problems of existing technologies not fully considering multi-time scale correlations, delayed early warnings, or high false alarm rates. The dynamic evaluation module generates a dynamic soil health index to reflect dynamic changes in soil health, while the early warning module combines thresholds and lead times to generate early warning signals and provide intervention suggestions, providing users with sufficient decision-making lead time. The model update module continuously optimizes prediction accuracy and early warning capabilities through incremental training, ensuring the long-term stability and applicability of the system. Attached Figure Description

[0016] Figure 1 This is a system structure diagram of the present invention; Figure 2 This is a flowchart of the data processing and modeling process of the present invention.

[0017] In the diagram: 1. Data acquisition module; 2. Data preprocessing module; 3. Multi-scale feature extraction module; 4. Temporal modeling module; 5. Dynamic evaluation module; 6. Early warning module; 7. Model update module. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figure 1-2 This invention provides a soil health dynamic assessment and early warning system based on a time-series recurrent neural network, comprising: Data acquisition module 1 is configured to collect multi-dimensional soil health time-series data in real time through multiple types of sensors deployed in the soil. The soil health time-series data includes soil temperature, soil moisture, pH value, electrical conductivity, organic matter content, nitrogen, phosphorus and potassium content, and heavy metal concentration. Data preprocessing module 2 is configured to perform missing value filling, outlier handling, and standardization on the collected soil health time series data, and divide the processed data into multiple time scale subsets according to a preset time window; The multi-scale feature extraction module 3 is configured to extract time-domain and frequency-domain features from data subsets at multiple time scales respectively, and generate multi-scale feature vectors. The temporal modeling module 4 is configured to take multi-scale feature vectors as input and feed them into the temporal recurrent neural network model. The temporal recurrent neural network model is used to learn the complex correlation and evolution law of soil health influencing factors at different time scales and output the temporal prediction results of soil health status. The dynamic assessment module 5 is configured to dynamically assess the soil health status based on the time-series prediction results and the preset soil health assessment standards, and generate a dynamic soil health index. The advanced warning module 6 is configured to provide advanced warnings of potential soil health risks based on the future changing trend of the dynamic soil health index, combined with the set warning threshold and warning lead time.

[0020] Specifically, the first step is the implementation of the data acquisition module. Within the farmland area to be monitored, multiple types of sensors are deployed according to a uniform distribution principle. The sensor deployment density can be adjusted based on the farmland area and monitoring accuracy requirements. For example, for 100 acres of plain farmland, a sensor node can be deployed every 50 meters. Each sensor node integrates sensor components capable of collecting data on soil temperature, soil moisture, pH value, conductivity, organic matter content, nitrogen, phosphorus, and potassium content, as well as heavy metal concentration. The heavy metal concentration sensor can detect common pollutants such as cadmium, lead, and mercury. All sensors establish a communication connection with the data processing center through an IoT gateway. The real-time data acquisition frequency can be set to once every 30 minutes to ensure continuous soil health time-series data, providing fundamental data support for subsequent multi-scale analysis.

[0021] Next, the data preprocessing module is performed. First, missing values ​​are handled. When sensor data is missing due to temporary malfunction or signal interference, interpolation algorithms are used to fill in the missing data. For example, for missing no more than three consecutive sampling points in soil moisture data, linear interpolation is used; if there are more than five missing sampling points, cubic spline interpolation is used to more accurately restore the data trend. Then, outlier handling is performed using statistical methods. For example, by calculating the mean μ and standard deviation σ of each parameter, data exceeding the range of μ-3σ to μ+3σ are identified as outliers. For identified outliers, if the deviation from adjacent normal data is small, a weighted average of adjacent data is used for correction; if the deviation is large, the distribution characteristics of historical data for the same period are considered for correction to avoid interference from outlier data in subsequent analysis. Finally, standardization is performed using the Min-Max standardization method to convert all processed data to the 0-1 range, eliminating the influence of different units. For example, soil temperature is in degrees Celsius, and soil moisture is in percentage. After standardization, both are within the same numerical range, as shown in the formula below: ; in, For standardized data, The original data, It is the minimum value of this parameter among all the original data. This parameter represents the maximum value among all the original data. After preprocessing, the data is divided into multiple time-scale subsets according to a preset time window to prepare for multi-scale feature extraction.

[0022] The implementation of the multi-scale feature extraction module is one of the innovations of this system, addressing the problem that existing models do not fully consider the complexity and correlation of soil health influencing factors at different time scales. First, three time windows are determined: a short-term time window for dividing hourly soil health time-series data subsets (e.g., using 12 hours as a short-term window, dividing data collected every 30 minutes into a short-term subset of 24 data points); a medium-term time window for dividing weekly data subsets (e.g., using 4 weeks as a medium-term window, dividing daily average data into a medium-term subset of 28 data points); and a long-term time window for dividing quarterly data subsets (e.g., using 4 quarters as a long-term window, dividing monthly average data into a long-term subset of 12 data points). Then, time-domain and frequency-domain features are extracted for each time-scale data subset. Time-domain features include mean, variance, kurtosis, and skewness, while frequency-domain features are Fourier transform coefficients. Taking the mean as an example, its calculation formula is as follows: ; in, It represents the mean of a parameter within a subset of time scales. This represents the number of data points within the subset. For the first in this subset The values ​​of each data point. The formula for calculating the Fourier transform coefficients is as follows: ; in, For the first Fourier transform coefficients, The imaginary unit, For the subset of the first The value of each data point. This represents the number of data points within the subset. By extracting multi-scale features, we can comprehensively capture the changing patterns of soil health parameters at different time scales. For example, a short-term window can reflect rapid fluctuations in soil moisture, while a long-term window can reflect the slow decline in soil organic matter.

[0023] The temporal modeling module employs a temporal recurrent neural network model, specifically a Long Short-Term Memory (LSTM) network, configured with a multi-layer stacked structure to enhance the learning ability of multi-scale feature temporal correlations. First, the multi-scale feature vectors generated by the multi-scale feature extraction module are input into the LSTM model. This model effectively solves the gradient vanishing problem inherent in traditional recurrent neural networks, thus better learning the evolution patterns of soil health influencing factors over long-term timescales. During model training, historical soil health data from the past five years for a specific region are collected as both training and validation datasets, with the training dataset accounting for 80% and the validation dataset for 20%. Training parameters are set as follows: learning rate of 0.001, batch size of 32, and 100 iterations. The Adam optimizer and mean squared error loss function are used, and the backpropagation algorithm is employed to optimize the model's weights and biases, minimizing the prediction error on the validation dataset. Once trained, the LSTM model can output time-series predictions of soil health status, including predicted values ​​of soil health parameters for multiple future time steps, such as predicted values ​​of soil pH and organic matter content for the next 7, 30, and 90 days, providing data support for dynamic assessment.

[0024] The dynamic assessment module dynamically assesses soil health status based on time-series prediction results and pre-defined soil health assessment standards. First, the prediction value parsing unit receives predicted values ​​of future soil health parameters from the time-series prediction results, such as daily predicted values ​​for soil pH, organic matter content, nitrogen, phosphorus, and potassium content, and heavy metal concentration for the next 30 days. Then, the health index calculation unit calculates the dynamic soil health index. During the calculation, each predicted parameter is first standardized using the same Min-Max standardization method as in the data preprocessing stage. Then, weighting factors are set according to the degree of influence of each parameter on soil health; for example, the weighting factor for soil pH is 0.2, for organic matter content it is 0.3, for nitrogen, phosphorus, and potassium content it is 0.25, and for heavy metal concentration it is 0.25. The formula for calculating the dynamic soil health index is as follows: ; in, This is a dynamic soil health index, with a value range of 0-100. The number of soil health parameters included in the calculation. For the first The weighting factors of each parameter satisfy the following condition. , For the first The predicted values ​​are standardized for each parameter. Preset soil health assessment standards: when the dynamic soil health index is greater than or equal to 80, the soil health status is good; when the index is between 60 and 79, the status is moderate; when the index is less than 60, the status is a warning state. By dynamically calculating the health index, the changing trend of soil health status can be grasped in real time, solving the problems of traditional assessment methods being static and unable to reflect dynamic changes in soil health in a timely manner.

[0025] The advanced warning module provides potential risk warnings based on the future trends of the dynamic soil health index. First, the trend analysis unit uses linear regression to analyze the dynamic soil health index trends over multiple future time steps, such as analyzing the slope of the health index change over the next 90 days to determine whether the index is rising, falling, or stable. Then, the threshold comparison unit compares the predicted trend of the dynamic soil health index with preset warning thresholds, set as follows: low warning threshold 60, medium warning threshold 50, and high warning threshold 40. Warning lead times are also set: 15 days when the predicted health index will reach the low warning threshold, 25 days when it reaches the medium warning threshold, and 35 days when it reaches the high warning threshold. When the warning signal generation unit detects that the predicted value of the dynamic soil health index reaches or exceeds the warning threshold within the warning lead time, it immediately generates a warning signal. The warning signal includes the warning level and the expected time of risk occurrence. For example, if the soil health index is predicted to drop to 58 in the next 20 days, a low warning signal is generated at the current time, with the expected risk occurrence time being 20 days later. Early warning systems provide farmers or managers with sufficient lead time for decision-making, facilitating timely preventative and intervention measures.

[0026] In this embodiment, the data preprocessing module 2 specifically includes: The missing value filling unit is configured to fill missing values ​​in the soil health time series data using an interpolation algorithm; The outlier processing unit is configured to identify and correct outliers in soil health time series data using statistical methods. The standardization processing unit is configured to normalize or standardize the processed soil health time series data to eliminate the influence of data with different dimensions.

[0027] Specifically, the missing value filling unit uses interpolation algorithms to process missing data. For example, for two consecutive sampling points missing in soil temperature data due to a brief power outage of the sensor, linear interpolation is used to calculate the missing value based on the changing trends of three normal data points before and after the missing point. For more than five consecutive sampling points missing due to sensor failure, cubic spline interpolation is used to restore the data by constructing a smooth cubic polynomial curve, ensuring that the filled data better reflects the actual changing patterns.

[0028] The outlier handling unit uses statistical methods to identify and correct outliers. For example, it uses box plots to calculate the quartiles of soil electrical conductivity data, where Q1 is the lower quartile and Q3 is the upper quartile. It also calculates the interquartile range (IQR), where IQR = Q3 - Q1. Data values ​​less than Q1 - 1.5IQR or greater than Q3 + 1.5IQR are identified as outliers. For outliers, if the deviation from adjacent normal data is less than IQR, the average of the two adjacent normal data is used for correction. If the deviation is greater than or equal to IQR, the average historical electrical conductivity data for the same season and soil type in the region is used for correction to prevent outliers from affecting subsequent analysis.

[0029] The standardization unit uses Z-score standardization to eliminate the influence of data with different dimensions. For example, the unit of soil nitrogen, phosphorus, and potassium content is mg / kg, while pH value has no unit. After Z-score standardization, both are converted into standardized data with a mean of 0 and a standard deviation of 1, as shown in the following formula: ; in, For standardized data, The original data, This parameter is the mean of all the original data. This represents the standard deviation of all the original data for this parameter. This processing ensures that the weights of each parameter are not affected by differences in dimensions during subsequent multi-parameter analysis, thus improving the accuracy of model analysis.

[0030] In this embodiment, the preset time window specifically includes: Short-term time windows are used to divide soil health time-series data into daily or hourly subsets. A medium-term time window is used to divide soil health time-series data into weekly or monthly subsets. Long-term time windows are used to divide soil health time-series data into quarterly or annual subsets. The multi-scale feature extraction module 3 extracts the mean, variance, kurtosis, skewness, and Fourier transform coefficients from the data subsets at each time scale.

[0031] Specifically, short-term time windows are used to divide data subsets at the hourly or daily level. For example, when using an hourly window, the window duration is set to 6 hours, and soil health data is collected every 30 minutes. Each short-term subset contains 12 data points. If a daily window is used, the window duration is set to 1 day, and each subset contains 48 data points, sampled every 30 minutes.

[0032] Intermediate time windows are used to divide data into weekly or monthly subsets. For example, when using a weekly window, the window duration is set to 2 weeks, and the average value of each parameter is calculated once a day. Each intermediate subset contains 14 data points. When using a monthly window, the window duration is 1 month, and each subset contains 30 daily average data points, calculated based on 30 days per month.

[0033] Long-term time windows are used to divide data into quarterly or annual subsets. For example, when using a quarterly window, the window duration is set to 2 quarters, and the average value of each parameter is calculated once a month. Each long-term subset contains 6 data points. When using an annual window, the window duration is 1 year, and each subset contains 12 monthly average data points.

[0034] The multi-scale feature extraction module extracts features from data subsets at each time scale: the mean is obtained by calculating the arithmetic mean of all data points within the subset, using the same formula as the mean formula in the above embodiment; the variance calculation formula is: ; in, For variance, The number of data points within the subset. For the first The value of each data point. The mean of the subset; the formula for calculating kurtosis is: ; in, For kurtosis, The standard deviation of the subset ( The formula for calculating skewness is: ; in, The skewness is represented by the Fourier transform coefficients, which are calculated using the discrete Fourier transform formula, the same as the formula used in the previous embodiment. By extracting these features, the distribution characteristics and fluctuation patterns of soil health parameters at different time scales can be comprehensively reflected, providing rich feature inputs for subsequent time series modeling.

[0035] In this embodiment, the temporal recurrent neural network model is specifically a long short-term memory (LSTM) network model, and the model is configured as a multi-layer stacked structure.

[0036] Specifically, the LSTM model has three layers: the first layer is a hidden layer following the input layer, containing 128 neurons; the second layer contains 64 neurons; and the third layer contains 32 neurons. This multi-layered stacked structure enhances the model's ability to learn complex features. For example, the neurons in the first layer can learn basic multi-scale feature associations, the second layer further learns the mid-level interactions between features, and the third layer learns the high-level temporal evolution patterns. Compared to a single-layer LSTM model, the multi-layered structure can more fully capture the complex correlations between soil health influencing factors at different time scales, effectively solving the dependency learning problem in long-term time series. For example, for the trend of slow decline in soil organic matter within a long time window, the multi-layered LSTM can more accurately learn the long-term correlation between this trend and other parameters such as nitrogen, phosphorus, and potassium content, improving prediction accuracy. Simultaneously, each LSTM unit includes a forget gate, an input gate, and an output gate, which can selectively retain or forget historical information, avoiding the gradient vanishing problem of traditional recurrent neural networks and ensuring effective learning of long-term time series data.

[0037] In this embodiment, the temporal recurrent neural network model specifically includes: The input layer is configured to receive multi-scale feature vectors. The encoding layer is configured to encode the feature vectors received from the input layer in order to extract high-level semantic features; The LSTM layer is configured to perform temporal dependency learning and long-term memory retention on the encoded feature sequence; The output layer is configured to output time-series predictions of soil health status, including predicted values ​​of soil health parameters for multiple future time steps.

[0038] Specifically, the input layer receives multi-scale feature vectors generated by the multi-scale feature extraction module. For example, each input sample contains the mean, variance, kurtosis, skewness, and the first 10 coefficients of the Fourier transform coefficients for the short-term, medium-term, and long-term time scales, for a total of 3×5×10=150 feature dimensions. The input layer converts these feature vectors into tensor forms that the model can process and passes them to the encoding layer.

[0039] The encoding layer uses a fully connected neural network structure, containing 64 neurons, and the ReLU activation function is selected. The encoding layer performs nonlinear transformations on the input multi-scale feature vectors to extract high-level semantic features. For example, it integrates short-term humidity fluctuation features with long-term organic matter change features into comprehensive soil health impact features, reducing redundant information and improving the learning efficiency of subsequent LSTM layers.

[0040] An LSTM layer consists of three stacked LSTM units. Each LSTM unit uses a gate structure to achieve temporal dependency learning and long-term memory retention. Taking a single LSTM unit as an example, the forget gate calculation formula is: ; in, Output for the forget gate. For the sigmoid function, , Here is the forget gate weight matrix. This is the output of the hidden layer from the previous time step. This is the output of the encoding layer at the current moment. This is the forget gate bias term; the input gate calculation formula is: ; in, For input gate output, Candidate cell state, , These are the weight matrices for the input gate and the candidate cell state, respectively. , These are the corresponding bias terms. The function is a hyperbolic tangent function, ranging from -1 to 1; the cell state update formula is: ; in, This represents the current state of the cell. This represents the cell state at the previous moment. This is element-wise multiplication; the output gate calculation formula is: ; in, For output gate output, This is the output of the hidden layer at the current moment. This is the output gate weight matrix. This is the output gate bias term. Through the above gate structure, the LSTM layer can effectively learn the temporal dependencies of features at different time scales, such as retaining the memory of soil organic matter changes in the long term and capturing rapid fluctuations in soil moisture in the short term.

[0041] The output layer uses a fully connected layer structure. The number of neurons is determined based on the prediction time step and the types of parameters. For example, if we need to predict three parameters—soil temperature, humidity, and pH—for the next 7, 15, and 30 days, the output layer would have 3 × 3 = 9 neurons, and a linear activation function would be used. It directly outputs the predicted values ​​of soil health parameters at each time step, providing data for the dynamic assessment module.

[0042] In this embodiment, the training process of the temporal recurrent neural network model specifically includes: collecting historical soil health data as a training dataset and a validation dataset; Set the training parameters, including the learning rate, batch size, and number of iterations; The weights and biases of the temporal recurrent neural network model are optimized by using the backpropagation algorithm, so as to minimize the prediction error of the model on the validation dataset.

[0043] Specifically, historical soil health data is first collected. Data sources can include soil monitoring data from a specific agricultural demonstration area over the past six years. The data covers parameters such as soil temperature, humidity, pH, electrical conductivity, organic matter content, nitrogen, phosphorus, and potassium content, and heavy metal concentration. Data is sampled every hour to ensure continuity and completeness. The collected historical data is then divided into training and validation datasets in an 8:2 ratio. For example, with a total of 50,000 data points, the training dataset contains 40,000 data points, and the validation dataset contains 10,000. This division maintains the temporal continuity of the data to avoid disrupting the chronological order and affecting the model's temporal learning performance.

[0044] Training parameters are set as follows: the initial learning rate is set to 0.001, and a learning rate decay strategy is adopted, which halves the learning rate every 20 iterations; the batch size is set to 64, that is, 64 samples are used for each model update; the number of iterations is set to 150, and an early stopping method is adopted, which stops training early when the loss function value on the validation dataset no longer decreases for 10 consecutive iterations to prevent the model from overfitting.

[0045] The model training uses the backpropagation algorithm, and the loss function is the mean squared error (MSE), calculated as follows: ; in, Mean square error, The number of training samples. The number of predicted parameters for each sample. For the first The first sample The actual values ​​of each parameter The corresponding predicted value is given. The optimizer used is the Adam optimizer, which calculates gradients and updates the model's weights and biases, including the gate weights of each LSTM unit, the fully connected weights of the encoding and output layers, etc., to minimize the MSE of the model on the validation dataset. During training, the model parameters are saved periodically, for example, once every 10 iterations. Finally, the model with the smallest MSE on the validation set is selected as the final time series prediction model.

[0046] In this embodiment, the dynamic evaluation module 5 specifically includes: The prediction value parsing unit is configured to receive the predicted values ​​of future soil health parameters from the time-series prediction results. The health index calculation unit is configured to calculate the dynamic soil health index for multiple future time steps based on predicted values ​​of future soil health parameters, combined with weighting factors and preset soil health assessment standards.

[0047] Specifically, the prediction value parsing unit receives the time-series prediction results of soil health status output by the time-series modeling module. These results are stored in tensor form. The parsing unit first performs a dimensionality transformation on the tensor, converting it into a table format. Table columns include prediction time steps (e.g., 1 day, 2 days, ..., 30 days) and parameter names (e.g., soil pH, organic matter content). Table rows correspond to the predicted parameter values ​​for each prediction time step. The parsing unit then performs a validity check on the prediction values, such as determining if the predicted soil pH is within a reasonable range. If it exceeds the range, it is marked as an abnormal prediction value and fed back to the time-series modeling module for model fine-tuning. This ensures that the parsed prediction values ​​have actual physical meaning, providing accurate data for health index calculation.

[0048] The soil health index calculation unit calculates the dynamic soil health index based on the analyzed predicted values ​​of future soil health parameters. First, the predicted values ​​of each parameter are standardized using the Min-Max standardization method, transforming all predicted values ​​to the range of 0 to 1 to ensure consistent dimensions. Then, the weighting factors for each parameter are determined using the Analytic Hierarchy Process (AHP). Five soil science experts are invited to score the importance of each parameter, constructing a judgment matrix and calculating the weights. For example, the final determined weighting factors are: soil pH 0.2, organic matter content 0.3, nitrogen, phosphorus, and potassium content 0.25, heavy metal concentration 0.25, soil moisture 0.05, soil temperature 0.03, and electrical conductivity 0.02, with the sum of all weighting factors being 1. Finally, the dynamic soil health index for multiple future time steps is calculated using the health index calculation formula, such as calculating the health index for the next 7 days, 15 days, and 30 days. The index changes reflect the dynamic trend of soil health status. This calculation process combines expert experience and objective data to ensure the scientific validity and rationality of the health index.

[0049] In this embodiment, the advanced warning module 6 specifically includes: The trend analysis unit is configured to analyze the changing trends of the dynamic soil health index over multiple future time steps. The threshold comparison unit is configured to compare the predicted trend of the dynamic soil health index with the early warning threshold. The early warning signal generation unit is configured to generate an early warning signal when the predicted value of the dynamic soil health index reaches or exceeds the early warning threshold within the early warning lead time. The early warning signal includes the early warning level and the expected time of risk occurrence.

[0050] Specifically, the trend analysis unit uses a combination of moving average and linear regression methods to analyze the dynamic soil health index trends over multiple future time steps. For example, for the health index over the next 30 days, a 5-day moving average is first used to smooth the index series, eliminating short-term fluctuations and obtaining a smoothed index series; then, linear regression is performed on the smoothed series to calculate the regression equation. ,in, For health index, To predict the time step, The slope The intercept is obtained through the slope. To determine the direction of the trend, if This indicates a declining health index and potential risks; if This indicates that the health index is stable or rising, and the risk is low.

[0051] The threshold comparison unit compares the predicted trend of the dynamic soil health index with preset warning thresholds. These warning thresholds are set according to soil health assessment standards; for example, a low warning threshold is 60, a medium warning threshold is 50, and a high warning threshold is 40. Warning lead times are also set, varying according to the warning level: a low warning lead time of 15 days (triggering a warning when the health index is predicted to drop to 60 within 15 days); a medium warning lead time of 25 days; and a high warning lead time of 35 days. The threshold comparison unit then compares the smoothed predicted health index value with the corresponding warning threshold step-by-step to determine whether the threshold has been reached or exceeded within the warning lead time.

[0052] The early warning signal generation unit generates early warning signals based on threshold comparison results. For example, if the smoothed health index prediction sequence shows that the index will drop from 65 to 58 in the next 20 days, and the current time is 20 days away from the prediction time step, which is greater than the low warning lead time of 15 days, then a low warning signal is generated at the current time. The warning signal includes the warning level, the expected time of risk occurrence, and key influencing parameters. For example, if the prediction shows that a decrease in organic matter content is the main reason for the index decline, this needs to be noted in the signal. If the prediction shows that the index will drop to 48 in the next 30 days, and the current time is 30 days away from the prediction time step, which is greater than the medium warning lead time of 25 days, then a medium warning signal is generated. The early warning signals generated by this unit can accurately indicate the level and timing of potential risks, providing a clear direction for subsequent intervention measures.

[0053] In this embodiment, the advanced warning module 6 further includes: The early warning information release unit is configured to send early warning signals to user terminals via a visual interface, SMS, or email. The intervention suggestion generation unit is configured to generate targeted prevention and intervention suggestions based on the warning level and the expected time of risk occurrence, combined with a preset agricultural expert knowledge base or historical treatment plans.

[0054] Specifically, the early warning information dissemination unit sends early warning signals to user terminals through various methods, including farmers' smartphones and agricultural management departments' computer terminals. For example, it disseminates warnings through a visual interface deployed on the web and mobile app, displaying the predicted trend curve of the dynamic soil health index, the early warning threshold line, the early warning level indicator, and the expected risk occurrence time in chart form, while also providing textual explanations of key influencing parameters. It also disseminates warnings via SMS, sending text messages to farmers' and managers' mobile phones containing the early warning level, the expected risk occurrence time, and a link to view detailed information. Finally, it disseminates warnings via email, sending emails to agricultural management department staff with an attached early warning report containing index change data, risk analysis, and recommended measures. These multiple dissemination methods ensure that different users can receive early warning information in a timely manner, avoiding information omissions.

[0055] The intervention suggestion generation unit generates targeted suggestions based on the warning level and the expected risk occurrence time, combined with a pre-set agricultural expert knowledge base and historical treatment plans. The agricultural expert knowledge base contains treatment methods, applicable conditions, and implementation steps for different soil problems such as salinization, organic matter decline, and heavy metal pollution; historical treatment plans include successful cases of treating the same soil problems in the region or similar regions in the past. For example, when a low warning signal is generated due to declining soil organic matter content, the intervention suggestion is: apply organic fertilizer, such as well-rotted straw, at a rate of 200-300 kg per acre 10 days before the expected risk occurs, and adjust the irrigation frequency from once every 3 days to once every 5 days to reduce organic matter loss; if a high warning signal is generated due to excessive cadmium concentration, it is recommended to apply a chelating agent, such as EDTA, at a rate of 5-10 kg per acre 30 days before the expected risk occurs, and plant cadmium-accumulating plants, such as centipede grass, harvesting and properly disposing of the plants after maturity to reduce soil cadmium content. The intervention suggestion generation unit also adjusts the implementation time of the suggestions based on the advance warning amount to ensure that the measures take effect before the risk occurs. The suggestions generated by this unit are highly targeted and operable, helping users to take intervention measures efficiently.

[0056] In this embodiment, the system further includes: Model update module 7 is configured to periodically receive new soil health time-series data and use the new data to incrementally train the time-series recurrent neural network model in order to continuously optimize the model's prediction accuracy and early warning capability.

[0057] Specifically, the model update module is set to update monthly. At the beginning of each month, soil health time-series data from the previous month are collected. This new data includes all parameters such as soil temperature, humidity, and pH value collected in real time by the data acquisition module from the previous month, and the data volume is consistent with the monthly data volume during model training. After collecting the new data, it is first preprocessed using the same methods as the data preprocessing module, including missing value imputation, outlier handling, and standardization, to ensure that the quality and format of the new data are consistent with the training dataset.

[0058] Then, the temporal recurrent neural network model was incrementally trained using the new data, employing a "freeze + fine-tuning" strategy: firstly, the first two layers of the model—the encoding layer and the first LSTM layer—were frozen, and only the weights and biases of the last two layers—the second and third LSTM layers and the output layer—were fine-tuned to avoid overfitting due to the limited amount of new data. The training parameters were set as follows: a learning rate of 0.0005, lower than the initial training learning rate to avoid drastic parameter fluctuations; a batch size of 32; 20 iterations; the mean squared error loss function; and the Adam optimizer. During incremental training, the newly preprocessed data was merged with the last six months' data from the original training dataset to form the incremental training dataset, while the original validation dataset served as the incremental validation dataset. The model parameters were optimized using backpropagation to minimize the prediction error on the incremental validation dataset.

[0059] After training, the updated model parameters replace the original model parameters, forming a new time-series prediction model. Through periodic incremental training, the model can continuously learn the latest patterns of soil health changes. For example, when a region's soil exhibits new humidity fluctuation patterns due to climate change, incremental training allows the model to quickly adapt to these changes, continuously optimizing the model's prediction accuracy and early warning capabilities. This prevents prediction biases from developing due to long-term use and ensures the system's long-term stable operation.

[0060] In summary, this invention utilizes multiple types of sensors to collect multi-dimensional time-series soil health data in real time, addressing the problems of lagging, high cost, and poor timeliness in traditional laboratory testing. After data preprocessing to ensure data quality, the data is divided into multiple time windows, and multi-scale feature extraction is combined to capture soil health patterns at different time scales. A multi-layer LSTM model is then used to learn the complex correlations of multi-scale influencing factors, solving the problems of insufficient consideration of multi-time-scale correlations, delayed early warnings, or high false alarm rates in existing technologies. The dynamic evaluation module generates a dynamic soil health index reflecting dynamic changes in soil health, while the early warning module combines thresholds and lead times to generate early warning signals and provide intervention suggestions, offering users sufficient lead time for decision-making. The model update module continuously optimizes prediction accuracy and early warning capabilities through incremental training, ensuring the long-term stability and applicability of the system.

[0061] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0062] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A soil health dynamic assessment and early warning system based on a time series recurrent neural network, characterized in that, The method comprises the following steps: A data acquisition module (1) is configured to collect multi-dimensional soil health time series data in real time through multiple types of sensors deployed in the soil, including soil temperature, soil humidity, pH value, conductivity, organic matter content, nitrogen, phosphorus and potassium content, and heavy metal concentration; A data preprocessing module (2) is configured to fill in missing values, process outliers and standardize the collected soil health time series data, and divide the processed data into multiple time scale data subsets according to a preset time window; A multi-scale feature extraction module (3) is configured to extract time domain features and frequency domain features from the multiple time scale data subsets respectively, and generate multi-scale feature vectors; A time series modeling module (4) is configured to input the multi-scale feature vectors into a time series recurrent neural network model, which is used to learn the complex correlation and evolution law of soil health influencing factors under different time scales, and output time series prediction results of soil health status; A dynamic evaluation module (5) is configured to dynamically evaluate the soil health status according to the time series prediction results and a preset soil health evaluation standard, and generate a dynamic soil health index; An early warning module (6) is configured to give early warning of potential soil health risks according to the future trend of the dynamic soil health index, combined with the set warning threshold and warning lead time.

2. The soil health dynamic assessment and early warning system based on time series recurrent neural network according to claim 1, characterized in that, The data preprocessing module (2) specifically includes: A missing value filling unit configured to fill in missing values in the soil health time series data using an interpolation algorithm; An outlier processing unit configured to identify and correct outliers in the soil health time series data using a statistical method; A standardization processing unit configured to normalize or standardize the processed soil health time series data to eliminate the influence of different dimensional data.

3. The soil health dynamic assessment and early warning system based on time series recurrent neural network according to claim 1, characterized in that, The preset time window specifically includes: A short-term time window for dividing soil health time series data subsets at the daily or hourly level; A medium-term time window for dividing soil health time series data subsets at the weekly or monthly level; A long-term time window for dividing soil health time series data subsets at the quarterly or annual level; The multi-scale feature extraction module (3) extracts mean, variance, kurtosis, skewness and Fourier transform coefficients from each time scale data subset.

4. The soil health dynamic assessment and early warning system based on time series recurrent neural network of claim 1, wherein, The time series recurrent neural network model is specifically a long short-term memory (LSTM) model with a multi-layer stacked structure.

5. The soil health dynamic assessment and early warning system based on time series recurrent neural network according to claim 4, characterized in that, The time series recurrent neural network model specifically includes: An input layer configured to receive multi-scale feature vectors; An encoding layer configured to encode the feature vectors received by the input layer to extract high-level semantic features; An LSTM layer configured to learn the time series dependency and long-term memory of the encoded feature sequence; An output layer configured to output time series prediction results of soil health status, including predicted values of soil health parameters at multiple future time steps.

6. The soil health dynamic assessment and early warning system based on timing recurrent neural network of claim 1, wherein, The training process of the time series recurrent neural network model specifically includes collecting historical soil health data as training data set and validation data set; Set training parameters, the training parameters include learning rate, batch size and iteration times; The weights and biases of the time series recurrent neural network model are optimized through a back propagation algorithm to minimize the prediction error of the model on the validation dataset.

7. The soil health dynamic assessment and early warning system based on time series recurrent neural network of claim 1, wherein, The dynamic evaluation module (5) specifically includes: A predicted value analysis unit configured to receive future soil health parameter prediction values in the time series prediction results; A health index calculation unit configured to calculate dynamic soil health indexes for future time steps according to the future soil health parameter prediction values, in combination with a weight factor and a preset soil health evaluation standard.

8. The soil health dynamic assessment and early warning system based on time series recurrent neural network according to claim 7, characterized in that, The early warning module (6) specifically includes: A trend analysis unit configured to analyze the change trend of the dynamic soil health indexes for the future time steps; A threshold comparison unit configured to compare the predicted trend of the dynamic soil health indexes with a warning threshold; A warning signal generation unit configured to generate a warning signal when the predicted value of the dynamic soil health index reaches or exceeds the warning threshold within a warning lead time, the warning signal including a warning level and a predicted risk occurrence time.

9. The soil health dynamic assessment and early warning system based on time series recurrent neural network according to claim 8, characterized in that, The early warning module (6) further includes: A warning information publishing unit configured to send the warning signal to a user terminal through a visual interface, a short message or an email; An intervention suggestion generation unit configured to generate targeted prevention and intervention measures suggestions according to the warning level and the predicted risk occurrence time, in combination with a preset agricultural expert knowledge base or a historical treatment scheme.

10. The soil health dynamic assessment and early warning system based on timing recurrent neural network of claim 1, wherein, The system further includes: A model updating module (7) configured to periodically receive new soil health time series data and perform incremental training on the time series recurrent neural network model using the new data to continuously optimize the prediction accuracy and warning ability of the model.