Agricultural land quality evaluation method and system based on time series modeling-deep neural network
Patent Information
- Application Number
- CN202610880392.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-17
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]然而,现有技术在构建此类动态评估系统时仍面临四大核心矛盾:首先,多数模型将遥感影像、气象数据与土壤传感器读数简单拼接或分通道处理,缺乏对空间纹理特征与时间演变模式的协同建模能力,导致跨模态信息割裂,难以有效表征空间位置—时间进程—质量响应三者的耦合机制;其次,时序建模常采用单向循环结构或浅层网络,无法充分捕获农用地质量变化中同时存在的短期扰动与长期趋势,尤其在面对轮作制度或多年生作物场景时预测偏差显著;再次,模型决策过程高度黑箱化,管理者无法理解预测依据,致使评估结果难以转化为可信、可执行的农事干预措施;最后,现有深度模型参数量庞大、计算开销高,依赖云端服务器进行推理,无法在无稳定网络覆盖或算力受限的基层农田、丘陵茶园或牧区草场实现本地化实时部署
本发明提出一种基于时序建模-深度神经网络的农用地质量评估方法及系统,通过构建包含多源异构时序数据采集与预处理、时空特征协同提取、双向时序依赖关系建模与质量状态预测、模型可解释性增强与决策支持以及轻量化模型部署与边缘计算适配的完整技术链,首先有效解决了现有技术中遥感影像、气象数据与土壤传感器读数简单拼接导致跨模态信息割裂的问题,通过二维卷积提取空间局部纹理特征、一维时序卷积提取短期时序模式,并利用多头自注意力机制与通道注意力融合单元实现空间特征与时间特征的自适应加权融合,生成了具有高度时空一致性的深度特征序列,能够充分表征空间位置、时间进程、质量响应三者的耦合机制;其次,通过采用堆叠双向门控循环单元网络并在层间引入残差连接,利用更新门与重置门动态控制历史信息的保留与遗忘,同时从过去到未来和从未来到过去两个方向学习序列依赖关系,有效捕获了农用地质量变化中同时存在的短期扰动与长期趋势,显著提升了在轮作制度或多年生作物场景下的预测精度;再次,通过引入基于积分梯度法的特征重要性分析,将黑箱模型的预测过程转化为可视化的特征贡献热力图,并结合规则推理引擎将预测结果与归因信息映射为具体的农事操作建议与风险预警信息,解决了模型决策过程不可解释、评估结果难以转化为可信可执行农事干预措施的问题;最后,通过对训练完成的时空特征提取网络与时序建模网络进行知识蒸馏与模型剪枝,生成轻量化评估模型,并利用TensorRT或OpenVINO工具链编译优化后封装为可在ARM架构边缘设备上直接调用的评估服务接口,解决了现有深度模型参数量庞大、计算开销高、依赖云端服务器而无法在基层农田、丘陵茶园或牧区草场等算力受限或无稳定网络覆盖场景本地化实时部署的问题,实现了农用地质量评估体系向高精度、可解释、轻量化与广适配的智能化阶段演进。
Smart Images

Figure CN122819554A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing technology, specifically relating to a method and system for assessing farmland quality based on time-series modeling and deep neural networks. Background Technology
[0002] With the accelerated advancement of digital transformation in agriculture, farmland quality assessment has gradually shifted from traditional static indicator evaluation to dynamic, intelligent, and predictive management. Farmland quality is essentially a comprehensive reflection of soil health, ecological function, and production potential. Its state is influenced by the coupling effects of multiple factors over long time scales, including climate fluctuations, cultivation intensity, nutrient input, and environmental stress, exhibiting strong spatiotemporal nonstationarity and evolutionary uncertainty. To achieve precision agriculture and sustainable land management, there is an urgent need for a farmland quality assessment technology system capable of real-time perception, dynamic simulation, and forward-looking early warning.
[0003] The farmland quality assessment method based on time-series modeling and deep neural networks represents a new paradigm in this field, moving towards intelligent perception and dynamic inference. This method takes continuous, high-frequency, multi-dimensional observation data as input, automatically learns the complex nonlinear mapping relationship between land quality status and its driving factors through deep neural networks, and explicitly characterizes the long-term dependence and seasonal periodicity of quality evolution through time-series modeling mechanisms, thereby achieving a fundamental shift from post-event evaluation to pre-event early warning.
[0004] However, existing technologies still face four core challenges in constructing such dynamic assessment systems: First, most models simply stitch together or process remote sensing images, meteorological data, and soil sensor readings in separate channels, lacking the ability to collaboratively model spatial texture features and temporal evolution patterns. This results in fragmented cross-modal information and makes it difficult to effectively represent the coupling mechanism of spatial location, temporal process, and quality response. Second, time-series modeling often employs unidirectional loop structures or shallow networks, failing to fully capture the simultaneous short-term disturbances and long-term trends in farmland quality changes, especially when facing crop rotation systems or perennial crop scenarios, leading to significant prediction biases. Third, the model decision-making process is highly opaque, making it difficult for managers to understand the basis of predictions, thus hindering the transformation of assessment results into credible and actionable agricultural interventions. Finally, existing deep models have a large number of parameters and high computational overhead, relying on cloud servers for inference, making localized real-time deployment impossible in grassroots farmland, hilly tea gardens, or pastoral grasslands where stable network coverage is lacking or computing power is limited. These technical bottlenecks collectively hinder the evolution of farmland quality assessment systems towards a more accurate, interpretable, lightweight, and widely adaptable intelligent stage. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for assessing farmland quality based on time-series modeling and deep neural networks.
[0006] To achieve the above objectives, the present invention provides the following technical solution: This application provides a method for assessing farmland quality based on time-series modeling and deep neural networks, including: Time series data from multiple sources are acquired and preprocessed, including at least spatiotemporal alignment, missing value imputation, outlier removal, and standardization, to generate a standardized time series feature tensor. A spatiotemporal feature extraction network incorporating convolutional neural networks and temporal attention mechanisms is used to extract local features in the spatial dimension and dynamic evolution features in the temporal dimension from the standardized temporal feature tensor, and cross-modal fusion of spatial and temporal features is performed to obtain a deep feature sequence. The deep feature sequence is input into a bidirectional temporal modeling network to capture the long-term dependencies and periodic patterns of the sequence in the time dimension, and output the farmland quality status prediction results for at least one future time step. The quality status includes at least one of soil fertility index, pollution risk index and comprehensive quality level. Feature importance analysis is performed on the prediction process of the time series modeling network to generate visual attribution information, and corresponding agricultural operation suggestions and risk warning information are output in combination with preset agricultural management rules. The spatiotemporal feature extraction network and the bidirectional temporal modeling network are compressed to generate a lightweight evaluation model, and the lightweight evaluation model and decision support logic are deployed to an edge computing device.
[0007] Preferably, the spatiotemporal alignment in the preprocessing further includes: Based on the geographic coordinates of the target plot, image data from different sources are reprojected to the same coordinate system; Spatial interpolation methods are used to convert discrete site data into raster data that matches the spatial resolution of image data; Assign a uniform timestamp to all data sources and resample and align them using a preset time unit; The missing value imputation uses spatiotemporal kriging interpolation, the outlier removal uses the local outlier factor algorithm, and the standardization uses Z-score standardization.
[0008] Preferably, the spatiotemporal feature extraction network includes: Two-dimensional convolutional layers are used to extract local spatial features from single-temporal images; One-dimensional temporal convolutional layers are used to slide along the time dimension to extract short-term temporal patterns; The multi-head self-attention mechanism layer generates query vectors, key vectors, and value vectors through learnable linear transformations, and calculates the association weights between features at different time steps based on scaled dot product attention, thereby achieving adaptive weighting of temporal features. The cross-modal fusion employs a channel attention mechanism, generating weight coefficients for each feature channel through global average pooling and two fully connected layers. The calculation process is as follows: in This is the feature map of the c-th channel. For global average pooling, , For learnable weight matrix, It is the ReLU activation function. The sigmoid function is used; and the spatial and temporal features are weighted and fused using the weight coefficients.
[0009] Preferably, the bidirectional temporal modeling network is a bidirectional gated recurrent unit network and adopts a stacked structure; residual connections are introduced between the layers in the stacked structure; the network dynamically controls the retention and forgetting of historical information through update gates and reset gates, and the hidden state of its last time step is used to generate the farmland quality state prediction result.
[0010] Preferably, the bidirectional gated cyclic unit network has 3 stacked layers, and the hidden state dimension of each layer is set to 128.
[0011] Preferably, the feature importance analysis employs the integral gradient method, which calculates the gradient of the model output relative to the input features and integrates it along the path from the baseline to the input to obtain the contribution of each input feature to the prediction result; the visualized attribution information presents the contribution in the form of a heatmap. The preset agricultural management rules include: if the predicted value of soil organic matter decreases and is attributed to continuous high temperature and low rainfall, it is recommended to increase the application of organic fertilizer and implement water-saving irrigation.
[0012] Preferably, the compression includes knowledge distillation and model pruning of the spatiotemporal feature extraction network and the bidirectional temporal modeling network; the loss function of the knowledge distillation includes both the cross-entropy loss of the student network and the real label, and the divergence loss of the output distribution of the student network and the teacher network; the model pruning includes removing convolutional kernels with contributions below a threshold; the deployment includes compiling and optimizing the lightweight model using an inference optimization toolchain, and encapsulating it into a service interface that can be called on edge computing devices.
[0013] A farmland quality assessment system based on time-series modeling and deep neural networks includes: The multi-source data acquisition and preprocessing module is configured to acquire time-series data from multiple sources and perform spatiotemporal alignment, missing value imputation, outlier removal, and standardization to generate a standardized time-series feature tensor. The spatiotemporal feature collaborative extraction module is configured to extract local spatial features and temporal dynamic evolution features using a network containing convolutional neural networks and temporal attention mechanisms, and generate deep feature sequences through cross-modal fusion; The quality status prediction module is configured to input the deep feature sequence into a bidirectional temporal modeling network and output the farmland quality status prediction result at least one time step in the future. The interpretable decision support module is configured to perform feature importance analysis on the prediction process of the time series modeling network, generate a visual attribution map, and output agricultural operation suggestions and risk warning information in conjunction with the agricultural management knowledge base; The lightweight deployment module is configured to compress the networks used by the spatiotemporal feature collaborative extraction module and the quality state prediction module, generate a lightweight model, and deploy it to an edge computing device.
[0014] Preferably, the multi-source data acquisition and preprocessing module is specifically used for: Using the geographic coordinates of the target plot as a reference, a unified projection coordinate system is used to spatially interpolate the site data to generate a matching raster. Based on the unified timestamp, the data is resampled and aligned using a preset time unit. The missing data is filled by spatiotemporal kriging interpolation, the outlier algorithm is used to remove outlier data, and the standardized temporal feature tensor is generated by Z-score standardization.
[0015] Preferably, the lightweight deployment module is specifically used for: Knowledge distillation is performed using a teacher-student network architecture, and its loss function is: in For cross-entropy loss, for Divergence loss, and For the logits of the teacher-student network, For temperature parameters, This is the balance coefficient, set to 0.3; Channel pruning is performed on the student network to remove low-contribution convolution kernels; The pruned model is compiled and optimized using TensorRT or OpenVINO toolchains and then encapsulated into an evaluation service interface that runs on ARM architecture edge devices.
[0016] Compared with the prior art, this application has the following beneficial effects: This invention proposes a method and system for assessing farmland quality based on temporal modeling and deep neural networks. By constructing a complete technology chain encompassing multi-source heterogeneous temporal data acquisition and preprocessing, spatiotemporal feature collaborative extraction, bidirectional temporal dependency modeling and quality status prediction, model interpretability enhancement and decision support, and lightweight model deployment and edge computing adaptation, it first effectively solves the problem of cross-modal information fragmentation caused by simple splicing of remote sensing images, meteorological data, and soil sensor readings in existing technologies. It extracts spatial local texture features through two-dimensional convolution and extracts short-term temporal patterns through one-dimensional temporal convolution. Furthermore, it utilizes a multi-head self-attention mechanism and a channel attention fusion unit to achieve adaptive weighted fusion of spatial and temporal features, generating a deep feature sequence with high spatiotemporal consistency, which can fully characterize the coupling mechanism of spatial location, temporal process, and quality response. Secondly, by employing a stacked bidirectional gated recurrent unit network and introducing residual connections between layers, it dynamically controls the retention and forgetting of historical information using update and reset gates. Simultaneously, it learns sequence dependencies from both the past to the future and the future to the past, effectively capturing changes in farmland quality. The simultaneous presence of short-term disturbances and long-term trends in the process significantly improves prediction accuracy in crop rotation or perennial crop scenarios. Furthermore, by introducing feature importance analysis based on integral gradient method, the prediction process of the black-box model is transformed into a visualized feature contribution heatmap. Combined with a rule-based reasoning engine, the prediction results and attribution information are mapped to specific agricultural operation suggestions and risk warnings, solving the problems of unexplainable model decision-making processes and the difficulty in transforming evaluation results into credible and executable agricultural intervention measures. Finally, by performing knowledge distillation and model pruning on the trained spatiotemporal feature extraction network and temporal modeling network, a lightweight evaluation model is generated. This model is then compiled and optimized using TensorRT or OpenVINO toolchains and encapsulated into an evaluation service interface that can be directly called on ARM architecture edge devices. This solves the problems of existing deep models having large parameter counts, high computational overhead, and dependence on cloud servers, making local real-time deployment impossible in scenarios with limited computing power or no stable network coverage, such as farmland, hilly tea gardens, or pastureland. This realizes the evolution of the farmland quality assessment system towards a more accurate, interpretable, lightweight, and widely adaptable intelligent stage. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall technical solution architecture of the farmland quality assessment method based on temporal modeling and deep neural networks proposed in this invention; Figure 2 This is a schematic diagram of the core principle framework of spatiotemporal feature collaborative extraction and fusion in this invention; Figure 3 This is a logical flowchart of the temporal dependency modeling and prediction based on bidirectional gated cyclic unit network in this invention. Figure 4This is a schematic diagram of the multi-level interaction and data flow of model interpretability enhancement and decision support generation based on the integral gradient method in this invention; Figure 5 This is a schematic diagram of the system architecture for lightweight model deployment and edge computing adaptation based on knowledge distillation and model pruning in this invention. 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] Furthermore, in this invention, an element referred to as fixed to or disposed on another element may be directly disposed on the other element, or there may be an intermediate element. When an element is considered to be connected to another element, it may be directly connected to the other element, or there may be an intermediate element present simultaneously. The terms vertical, horizontal, left, right, and similar expressions used herein are for illustrative purposes only and do not represent the only possible implementation.
[0020] See Figures 1-5 This application provides a method for assessing farmland quality based on time-series modeling and deep neural networks, including: Time series data from multiple sources are acquired and preprocessed, including at least spatiotemporal alignment, missing value imputation, outlier removal, and standardization, to generate a standardized time series feature tensor. A spatiotemporal feature extraction network incorporating convolutional neural networks and temporal attention mechanisms is used to extract local features in the spatial dimension and dynamic evolution features in the temporal dimension from the standardized temporal feature tensor, and cross-modal fusion of spatial and temporal features is performed to obtain a deep feature sequence. The deep feature sequence is input into a bidirectional temporal modeling network to capture the long-term dependencies and periodic patterns of the sequence in the time dimension, and output the farmland quality status prediction results for at least one future time step. The quality status includes at least one of soil fertility index, pollution risk index and comprehensive quality level. Feature importance analysis is performed on the prediction process of the time series modeling network to generate visual attribution information, and corresponding agricultural operation suggestions and risk warning information are output in combination with preset agricultural management rules. The spatiotemporal feature extraction network and the bidirectional temporal modeling network are compressed to generate a lightweight evaluation model, and the lightweight evaluation model and decision support logic are deployed to an edge computing device.
[0021] In this embodiment, the time-series data from multiple sources includes multi-period remote sensing image sequences, continuous meteorological observation data, soil moisture and nutrient sensor monitoring data, and historical tillage records.
[0022] After acquiring this data, preprocessing is performed first: the remote sensing images are reprojected to the same coordinate system based on the geographic coordinates of the target plot's center point; meteorological station data are generated into raster data matching the spatial resolution of the remote sensing images through inverse distance weighted spatial interpolation; all data sources are assigned a unified Coordinated Universal Time (UTC) timestamp and resampled and aligned using year-week as the basic time unit; missing data are filled using spatiotemporal kriging interpolation, and outlier data are identified and removed using a local outlier factor algorithm; finally, all features are Z-score standardized to generate standardized multi-source temporal feature tensors.
[0023] Subsequently, the tensor is input into a spatiotemporal feature extraction network that includes a convolutional neural network and a temporal attention mechanism. Single-phase spatial local texture features are extracted through two-dimensional convolution, and short-term temporal patterns are extracted through one-dimensional temporal convolution. The correlation weights between features at different time steps are calculated using a multi-head self-attention mechanism to achieve adaptive weighting. At the same time, a cross-modal fusion strategy based on channel attention is adopted to perform weighted fusion of spatial and temporal features to obtain a deep feature sequence.
[0024] Subsequently, the deep feature sequence is input into a bidirectional temporal modeling network, which consists of bidirectional gated recurrent units. The network uses update gates and reset gates to dynamically control the retention and forgetting of historical information. It learns long-term dependencies and periodic patterns in two directions: from the past to the future and from the future to the past. Finally, the hidden state is mapped through a fully connected layer to the predicted value of farmland quality status for one or more future time steps. The quality status includes at least soil fertility index, pollution risk index and comprehensive quality level.
[0025] Next, the integral gradient method is used to perform feature importance analysis on the prediction process, calculate the contribution of input features to the prediction results, and generate visualized attribution information in the form of a heatmap. Combined with preset agricultural management rules, the predicted values and attribution information are mapped into agricultural operation suggestions and risk warning information.
[0026] Finally, knowledge distillation and model pruning are performed on the spatiotemporal feature extraction network and the bidirectional temporal modeling network to generate a lightweight evaluation model. This lightweight model and the decision support logic used to generate the suggestions and warning information are then deployed to an edge computing device.
[0027] In a preferred embodiment, the spatiotemporal alignment in the preprocessing further includes: Based on the geographic coordinates of the target plot, image data from different sources are reprojected to the same coordinate system; Spatial interpolation methods are used to convert discrete site data into raster data that matches the spatial resolution of image data; Assign a uniform timestamp to all data sources and resample and align them using a preset time unit; The missing value imputation uses spatiotemporal kriging interpolation, the outlier removal uses the local outlier factor algorithm, and the standardization uses Z-score standardization.
[0028] In this embodiment, the specific implementation of the spatiotemporal alignment operation is as follows: using the geographic coordinates of the center point of the target agricultural land plot as a reference, the reprojection algorithm is used to unify the remote sensing images of all periods to the same geographic coordinate system; for discretely distributed meteorological station data, the inverse distance weighted spatial interpolation method is used to generate 10-meter resolution raster data that perfectly matches the spatial resolution of the remote sensing images by weighting the observation values of the three nearest stations around each raster unit according to the inverse distance; all data sources are assigned a unified Coordinated Universal Time timestamp, and resampling is performed using year-week number as the basic time unit to ensure that data from different sources are strictly synchronized in the time dimension.
[0029] Missing value imputation employs spatiotemporal kriging interpolation, which considers not only spatial correlation but also temporal autocorrelation, utilizing the effective pixel values within the spatiotemporal neighborhood of the missing pixel for optimal unbiased estimation. Outlier removal uses the local outlier factor algorithm, calculating the local density deviation of each data point within its k-nearest neighbors, and identifying data points with deviations exceeding three times the standard deviation as outliers and removing them.
[0030] The standardization process uses Z-score standardization, which involves subtracting the mean from each feature variable and dividing by the standard deviation to normalize each feature scale to zero mean and unit variance, ultimately generating a standardized multi-source time series feature tensor.
[0031] In a preferred embodiment, the spatiotemporal feature extraction network includes: Two-dimensional convolutional layers are used to extract local spatial features from single-temporal images; One-dimensional temporal convolutional layers are used to slide along the time dimension to extract short-term temporal patterns; The multi-head self-attention mechanism layer generates query vectors, key vectors, and value vectors through learnable linear transformations, and calculates the association weights between features at different time steps based on scaled dot product attention, thereby achieving adaptive weighting of temporal features. The cross-modal fusion employs a channel attention mechanism, generating weight coefficients for each feature channel through global average pooling and two fully connected layers. The calculation process is as follows: in This is the feature map of the c-th channel. For global average pooling, , For learnable weight matrix, It is the ReLU activation function. The sigmoid function is used; and the spatial and temporal features are weighted and fused using the weight coefficients.
[0032] It should be noted that in the implementation of the spatiotemporal feature extraction network, a two-dimensional convolutional layer first processes the remote sensing image and derived feature map at each time step. A 3×3 convolutional kernel slides with a stride of 1 to extract local spatial patterns within the pixel neighborhood, such as the spatial gradient of vegetation index and soil texture continuity. Then, for each spatial location, its feature values at all time steps are arranged along the time dimension to form a time series. A one-dimensional temporal convolutional layer slides along the time axis, with the convolutional kernel acting along the time direction to capture short-term temporal dependencies and local fluctuation patterns, such as the immediate impact of two consecutive weeks of precipitation on soil moisture content.
[0033] The spatial enhancement features and temporal local features initially extracted by two-dimensional and one-dimensional convolutions are concatenated and then fed into a multi-head self-attention mechanism layer. This layer generates query vectors, key vectors, and value vectors respectively through learnable linear transformations. Based on scaling dot product attention, it calculates the association weights between features at different time steps, enabling the model to adaptively focus on the importance of features at different time steps to the current representation.
[0034] Cross-modal fusion employs a channel-attention-based fusion strategy: For the spatial and temporal feature maps to be fused, they are first concatenated along the channel dimension, and then global average pooling is performed on each channel to compress the two-dimensional feature map into a scalar. This scalar is transformed through a bottleneck structure composed of two fully connected layers. The first fully connected layer compresses the number of channels to one-sixteenth of the original number to reduce computation and introduces the non-linearity of the ReLU activation function. The second fully connected layer restores the number of channels to the original number. Finally, the output is normalized to between 0 and 1 by the Sigmoid function to generate the weight coefficients for each feature channel. The calculation process is as follows: ,in Let GAP represent the feature map of the c-th channel. and The weight matrix is a learnable matrix. It is the ReLU activation function. The Sigmoid function is used; the final fused features are composed of the original features of each channel and their weight coefficients. The deep feature sequence with high spatiotemporal consistency is obtained by multiplying each channel and then summing the results.
[0035] In a preferred embodiment, the bidirectional temporal modeling network is a bidirectional gated cyclic unit network with a stacked structure; residual connections are introduced between the layers in the stacked structure; the network dynamically controls the retention and forgetting of historical information through update gates and reset gates, and the hidden state of its last time step is used to generate the farmland quality state prediction result.
[0036] In this embodiment, the bidirectional temporal modeling network is specifically implemented as a bidirectional gated cyclic unit network and adopts a stacked structure.
[0037] Each layer of GRU dynamically regulates the information flow through its internal update gate and reset gate: the update gate determines how much information from past hidden states is retained in the current state, and the reset gate controls how much past information is ignored, so as to combine the current input to construct new candidate hidden states, thereby effectively learning long-term dependencies and avoiding gradient vanishing or exploding.
[0038] The network adopts a bidirectional structure. For each time step, a forward layer running from front to back and a backward layer running from back to front are run simultaneously. The forward layer gradually accumulates historical information from the beginning of the sequence to the current time step, while the backward layer accumulates future information from the end of the sequence to the current time step. The hidden states of the two directions at the same time step are spliced together as the complete context-aware representation of that time step, so as to utilize the context information of the past and the future at the same time step.
[0039] Residual connections are introduced between stacked layers, where the input of a layer is directly added to its output, to alleviate the vanishing gradient problem in deep network training and promote model convergence. The network takes the bidirectional hidden state of the last valid time step as a condensed representation of the entire observation sequence, and feeds it into a fully connected layer to map it into the quality state prediction result for future time steps.
[0040] In a preferred embodiment, the bidirectional gated cyclic unit network has 3 stacked layers, and the hidden state dimension of each layer is set to 128.
[0041] As a further specific setting of the bidirectional gated cyclic unit network stacking structure, the network contains a total of 3 layers of GRU units, and the hidden state dimension of each layer of GRU units is set to 128.
[0042] This three-layer stacked structure, combined with inter-layer residual connections, not only ensures the model's ability to express complex temporal dependencies, but also controls the number of model parameters and computational overhead through appropriate dimensionality settings.
[0043] In a preferred embodiment, the feature importance analysis employs the integral gradient method, which calculates the gradient of the model output relative to the input features and integrates it along the path from the baseline to the input to obtain the contribution of each input feature to the prediction result; the visualized attribution information presents the contribution in the form of a heatmap. The preset agricultural management rules include: if the predicted value of soil organic matter decreases and is attributed to continuous high temperature and low rainfall, it is recommended to increase the application of organic fertilizer and implement water-saving irrigation.
[0044] In this embodiment, the feature importance analysis employs the integral gradient method. Specifically, for a given predicted output, a baseline value is defined for each input feature. The baseline input is a vector composed of the mean values of all features on the training set. Then, integration is performed along a straight path from the baseline input to the actual input. For the i-th input feature xi, its integral gradient contribution is calculated. The calculation formula is: in As baseline input, For the trained temporal modeling network function, the integral is approximated using the Riemann sum, typically taking 50 to 200 interpolation points; the integral of all input features is then calculated. The values are then normalized and presented as a heatmap. For spatial features, the contribution is mapped back to a geospatial grid and overlaid on a concurrent remote sensing image base map, with red areas representing positive contributions and blue areas representing negative contributions. For temporal features, a time-series contribution curve can be generated.
[0045] The pre-set agricultural management rules include: if the predicted value of soil organic matter decreases and is attributed to continuous high temperature and low rainfall, it is recommended to increase the application of organic fertilizer and implement water-saving irrigation.
[0046] A further example of the rule is: if the predicted soil organic matter content decreases by more than 5% in the next two weeks, and the integral gradient attribution analysis shows that the main contributing characteristics are three consecutive weeks of temperatures 2 degrees Celsius above the historical average and precipitation 30% below the historical average, then it is recommended to apply 150 kg of well-rotted organic fertilizer per acre and to irrigate once per acre at a rate of 20 m³ per acre within the next week. 3 Water-saving irrigation was implemented, and a yellow alert for the risk of high temperature and drought stress was issued.
[0047] In a preferred embodiment, the compression includes knowledge distillation and model pruning of the spatiotemporal feature extraction network and the bidirectional temporal modeling network; the loss function of the knowledge distillation includes both the cross-entropy loss of the student network and the real label, and the divergence loss of the output distribution of the student network and the teacher network; the model pruning includes removing convolutional kernels with contributions below a threshold; the deployment includes compiling and optimizing the lightweight model using an inference optimization toolchain, and encapsulating it into a service interface that can be called on edge computing devices.
[0048] Specifically, the compression process includes knowledge distillation and model pruning. Knowledge distillation employs a teacher-student network architecture, using a fully trained spatiotemporal feature extraction network and a bidirectional temporal modeling network as the teacher network, and constructing a simpler student network with fewer parameters, such as reducing the number of convolutional layer channels or GRU layers. During training, the loss function includes both the cross-entropy loss between the student network and the ground truth labels, and the KL divergence loss between the output probability distributions of the student network and the teacher network, specifically: in For cross-entropy loss, for Divergence loss, and These are the logits outputs of the final layer of the teacher and student networks, respectively. The temperature parameter is used to smooth the probability distribution. The balancing factor can be set to 0.3. Model pruning involves calculating the L1 norm of each convolutional kernel in the convolutional layer, identifying and removing convolutional kernels with a norm close to 0 that contribute very little to the network output, and then fine-tuning them to restore performance. The size of the compressed model can be reduced to less than 20% of the original teacher model.
[0049] During deployment, lightweight models are compiled and optimized using inference optimization toolchains such as TensorRT or OpenVINO, including operations such as inter-layer fusion, accuracy calibration, and automatic kernel tuning. Finally, the results are encapsulated into a service interface that can be directly called through the application programming interface on ARM architecture edge computing devices, enabling localized real-time evaluation.
[0050] This application also provides a farmland quality assessment system based on time-series modeling and deep neural networks, including: The multi-source data acquisition and preprocessing module is configured to acquire time-series data from multiple sources and perform spatiotemporal alignment, missing value imputation, outlier removal, and standardization to generate a standardized time-series feature tensor. The spatiotemporal feature collaborative extraction module is configured to extract local spatial features and temporal dynamic evolution features using a network containing convolutional neural networks and temporal attention mechanisms, and generate deep feature sequences through cross-modal fusion; The quality status prediction module is configured to input the deep feature sequence into a bidirectional temporal modeling network and output the farmland quality status prediction result at least one time step in the future. The interpretable decision support module is configured to perform feature importance analysis on the prediction process of the time series modeling network, generate a visual attribution map, and output agricultural operation suggestions and risk warning information in conjunction with the agricultural management knowledge base; The lightweight deployment module is configured to compress the networks used by the spatiotemporal feature collaborative extraction module and the quality state prediction module, generate a lightweight model, and deploy it to an edge computing device.
[0051] This solution also provides a farmland quality assessment system based on temporal modeling and deep neural networks, comprising five modules. The multi-source data acquisition and preprocessing module is configured to acquire time-series data from multiple sources and perform spatiotemporal alignment, missing value imputation, outlier removal, and standardization to generate a standardized temporal feature tensor.
[0052] The spatiotemporal feature collaborative extraction module is configured to extract local spatial features and temporal dynamic evolution features using a network containing convolutional neural networks and temporal attention mechanisms, and generate deep feature sequences through cross-modal fusion.
[0053] The quality status prediction module is configured to input deep feature sequences into a bidirectional temporal modeling network and output farmland quality status prediction results for at least one future time step.
[0054] The interpretable decision support module is configured to perform feature importance analysis on the prediction process of the time series modeling network, generate a visual attribution map, and output agricultural operation suggestions and risk warning information in conjunction with the agricultural management knowledge base.
[0055] The lightweight deployment module is configured to compress the networks used by the spatiotemporal feature collaborative extraction module and the quality status prediction module, generate a lightweight model, and deploy it to edge computing devices.
[0056] In a preferred embodiment, the multi-source data acquisition and preprocessing module is specifically used for: Using the geographic coordinates of the target plot as a reference, a unified projection coordinate system is used to spatially interpolate the site data to generate a matching raster. Based on the unified timestamp, the data is resampled and aligned using a preset time unit. The missing data is filled by spatiotemporal kriging interpolation, the outlier algorithm is used to remove outlier data, and the standardized temporal feature tensor is generated by Z-score standardization.
[0057] The specific working method of the multi-source data acquisition and preprocessing module in the system is as follows: using the geographic coordinates of the target plot as a reference to unify the projection coordinate system, spatial interpolation is performed on the station data to generate matching rasters, and resampling and alignment are performed based on a unified timestamp and a preset time unit; spatiotemporal kriging interpolation is used to fill in missing data, local outlier factor algorithm is used to remove abnormal data, and Z-score standardization is used to generate a standardized temporal feature tensor to provide regular input for subsequent modules.
[0058] In a preferred embodiment, the lightweight deployment module is specifically used for: Knowledge distillation is performed using a teacher-student network architecture, and its loss function is: in For cross-entropy loss, for Divergence loss, and For the logits of the teacher-student network, For temperature parameters, This is the balance coefficient, set to 0.3; Channel pruning is performed on the student network to remove low-contribution convolution kernels; The pruned model is compiled and optimized using TensorRT or OpenVINO toolchains and then encapsulated into an evaluation service interface that runs on ARM architecture edge devices.
[0059] The lightweight deployment module in the system is implemented as follows: knowledge distillation is performed using a teacher-student network architecture, and its loss function is... ,in For cross-entropy loss, for Divergence loss, and For the logits of the teacher-student network, For temperature parameters, The balancing factor is set to 0.3; channel pruning is performed on the student network by calculating the L1 norm of the convolution kernels to identify and remove low-contribution convolution kernels; then, the pruned model is compiled and optimized using TensorRT or OpenVINO toolchains, and encapsulated into an evaluation service interface that runs on ARM architecture edge devices.
[0060] The following section provides a more detailed explanation of the solution presented in this application, using specific examples: Example 1 In a wheat-corn rotation area of a large state-owned farm in the North China Plain, thousands of acres of contiguous farmland are flat, but the soil texture, historical fertilization levels and local microclimates are spatially heterogeneous. Traditional evaluation methods based on annual sampling and static indicators are difficult to reflect the dynamic changes in soil fertility, moisture and potential pollution risks during the crop growing season.
[0061] The multi-source heterogeneous time-series data acquisition and preprocessing module acquires multispectral remote sensing image sequences covering the target area from the Sentinel-2 satellite once a week, with a uniform spatial resolution of 10m; it collects daily data on temperature, precipitation, relative humidity, wind speed, and sunshine duration from five automatic weather stations distributed in the farm and surrounding counties; it collects soil volumetric water content, soil temperature, and electrical conductivity data hourly from 20 IoT soil sensor nodes deployed in representative plots; and it extracts crop planting types, fertilizer and organic fertilizer application rates, irrigation records, and historical soil test reports from the farm's information management database for the past five years. Using the latitude and longitude coordinates of the center point of each standard farmland grid as a reference, a reprojection algorithm was used to unify all remote sensing images from all periods to the same geographic coordinate system. Meteorological station data were generated into 10m raster data matching the spatial resolution of the remote sensing images using inverse distance weighted spatial interpolation. The meteorological value of each raster cell was obtained by weighting the observation values of its three nearest surrounding stations according to the inverse distance. All data sources were assigned a unified Coordinated Universal Time (UTC) timestamp and resampled and aligned using year-week as the basic time unit. Missing data were filled using spatiotemporal kriging interpolation. Outlier data were identified and removed using a local outlier factor algorithm. Finally, all features were Z-score standardized to generate a standardized temporal feature tensor.
[0062] In the spatiotemporal feature collaborative extraction module, the two-dimensional convolutional layer uses a 3×3 convolutional kernel, sliding with a stride of 1 to extract spatial local features from single-phase images; the one-dimensional temporal convolutional layer slides along the time dimension to extract short-term temporal patterns; the spatial local features and short-term temporal patterns are fed into a multi-head self-attention mechanism layer, which generates query vectors, key vectors, and value vectors respectively through learnable linear transformations. Based on scaled dot product attention, the association weights between features at different time steps are calculated to achieve adaptive weighted fusion; the cross-modal feature fusion unit adopts a fusion strategy based on channel attention, and the calculation process is as follows: in For the first Feature map of each channel Indicates global average pooling. and The weight matrix is a learnable matrix. It is the ReLU activation function. The Sigmoid function is used to fuse features, which are the features of each channel and their weight coefficients. The weighted sum is used to output a deep feature sequence.
[0063] In the temporal dependency modeling and quality status prediction module, the temporal modeling network based on the bidirectional gated recurrent unit network adopts a stacked structure, containing 3 layers of GRU units, with each layer having a hidden state dimension of 128, and residual connections are introduced between layers; update gates and reset gates dynamically control the retention and forgetting of historical information; the forward layer and the backward layer learn sequence dependencies from the past to the future and from the future to the past, respectively; the bidirectional hidden state of the last time step is mapped through a fully connected layer to the farmland quality status prediction vector for the next t+1, t+2, t+3, t+4 time steps, including predicted values of soil organic matter content, effective soil nitrogen, phosphorus and potassium content, soil salinity index, and probability distribution of soil pollution risk level.
[0064] In the model interpretability enhancement and decision support module, the integral gradient method is used to calculate the input features for a given predicted output. integral gradient ,in As baseline input, For the model function, the baseline input is a vector composed of the means of all features on the training set; the calculated... After normalization, the values are overlaid on the original remote sensing image or feature map in the form of a heat map; the rule reasoning engine has built-in decision rules: if the predicted value of soil organic matter decreases and is attributed to continuous high temperature and low rainfall, it is recommended to increase the application of organic fertilizer and implement water-saving irrigation.
[0065] In the lightweight model deployment and edge computing adaptation module, the loss function used in the knowledge distillation process is: ,in The cross-entropy loss between student network predictions and real labels, Output the KL divergence loss for the probability distributions of the student network and the teacher network. and These are the logits outputs for the teacher and student networks, respectively. For temperature parameters, The balancing factor is set to 0.3; at the same time, channel pruning is performed on the student network to remove convolutional kernels with low contribution; the compressed model and the core logic of the rule inference engine are compiled and optimized through TensorRT or OpenVINO toolchains and encapsulated into an evaluation service interface that can be directly called on ARM architecture edge servers or smart agricultural terminals.
[0066] Example 2 In small and medium-sized tea gardens in the hilly areas of southern China, the plots are scattered and the micro-topography is complex, making it urgent to manage soil acidity, spatial variability of nutrients and the risk of soil erosion.
[0067] At the data acquisition end, in addition to utilizing publicly available medium-resolution remote sensing images and regional meteorological data, the focus was on strengthening the deployment of low-cost Internet of Things (IoT). Soil pH and temperature and humidity composite sensors were deployed in each tea plantation plot, and data was transmitted back in a low-power manner through narrowband IoT technology. In the preprocessing stage, special corrections were made for the shadow problem in remote sensing images caused by hilly terrain, and topographic corrections were performed on meteorological elements using digital elevation model data.
[0068] When extracting spatiotemporal features collaboratively, due to the high spatial heterogeneity, two-dimensional convolutional layers pay more attention to the relationship between pixels and their immediate neighbors, while multi-head self-attention mechanisms help to associate features between plots with similar topographic slope but spatial discontinuity.
[0069] In the temporal dependency modeling and quality status prediction module, the temporal modeling network adjusts the network memory length for the tea growing season and pruning cycle to better capture the periodic fluctuations caused by agricultural operations such as changes in nutrient demand after pruning.
[0070] In the model interpretability enhancement and decision support module, the knowledge base of the rule reasoning engine is embedded with tea garden management-specific rules. For example, if the predicted soil pH value is consistently below 5.0, and the attribution characteristics show that the area has high rainfall and insufficient organic matter input, it is recommended to apply 50 kg / mu of dolomite powder and increase the tea garden mulch.
[0071] The lightweight deployment is carried out directly on an ARM-based edge computing box deployed in the tea plantation management room. The device integrates a 4G module to receive satellite and meteorological data, aggregates data from various sensors through a LoRa gateway, runs a lightweight assessment model locally, generates quality status maps and fertilization and acidity improvement suggestions for different blocks of the tea garden every week, and pushes them to the tea garden managers via WeChat mini program.
[0072] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0073] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for assessing farmland quality based on time-series modeling and deep neural networks, characterized in that, include: Time series data from multiple sources are acquired and preprocessed, including at least spatiotemporal alignment, missing value imputation, outlier removal, and standardization, to generate a standardized time series feature tensor. A spatiotemporal feature extraction network incorporating convolutional neural networks and temporal attention mechanisms is used to extract local features in the spatial dimension and dynamic evolution features in the temporal dimension from the standardized temporal feature tensor, and cross-modal fusion of spatial and temporal features is performed to obtain a deep feature sequence. The deep feature sequence is input into a bidirectional temporal modeling network to capture the long-term dependencies and periodic patterns of the sequence in the time dimension, and output the farmland quality status prediction results for at least one future time step. The quality status includes at least one of soil fertility index, pollution risk index and comprehensive quality level. Feature importance analysis is performed on the prediction process of the time series modeling network to generate visual attribution information, and corresponding agricultural operation suggestions and risk warning information are output in combination with preset agricultural management rules. The spatiotemporal feature extraction network and the bidirectional temporal modeling network are compressed to generate a lightweight evaluation model, and the lightweight evaluation model and decision support logic are deployed to an edge computing device.
2. The method according to claim 1, characterized in that, The spatiotemporal alignment in the preprocessing further includes: Based on the geographic coordinates of the target plot, image data from different sources are reprojected to the same coordinate system; Spatial interpolation methods are used to convert discrete site data into raster data that matches the spatial resolution of image data; Assign a uniform timestamp to all data sources and resample and align them using a preset time unit; The missing value imputation uses spatiotemporal kriging interpolation, the outlier removal uses the local outlier factor algorithm, and the standardization uses Z-score standardization.
3. The method according to claim 1, characterized in that, The spatiotemporal feature extraction network includes: Two-dimensional convolutional layers are used to extract local spatial features from single-temporal images; One-dimensional temporal convolutional layers are used to slide along the time dimension to extract short-term temporal patterns; The multi-head self-attention mechanism layer generates query vectors, key vectors, and value vectors through learnable linear transformations, and calculates the association weights between features at different time steps based on scaled dot product attention, thereby achieving adaptive weighting of temporal features. The cross-modal fusion employs a channel attention mechanism, generating weight coefficients for each feature channel through global average pooling and two fully connected layers. The calculation process is as follows: in This is the feature map of the c-th channel. For global average pooling, , For learnable weight matrix, It is the ReLU activation function. The sigmoid function is used; and the spatial and temporal features are weighted and fused using the weight coefficients.
4. The method according to claim 1, characterized in that, The bidirectional temporal modeling network is a bidirectional gated cyclic unit network with a stacked structure; residual connections are introduced between the layers in the stacked structure; the network dynamically controls the retention and forgetting of historical information through update gates and reset gates, and the hidden state of its last time step is used to generate the farmland quality state prediction result.
5. The method according to claim 4, characterized in that, The bidirectional gated cyclic unit network has 3 stacked layers, and the hidden state dimension of each layer is set to 128.
6. The method according to claim 1, characterized in that, The feature importance analysis employs the integral gradient method, which calculates the gradient of the model output relative to the input features and integrates it along the path from the baseline to the input to obtain the contribution of each input feature to the prediction result. The visual attribution information is presented in the form of a heatmap to show the contribution. The preset agricultural management rules include: if the predicted value of soil organic matter decreases and is attributed to continuous high temperature and low rainfall, it is recommended to increase the application of organic fertilizer and implement water-saving irrigation.
7. The method according to claim 1, characterized in that, The compression includes knowledge distillation and model pruning of the spatiotemporal feature extraction network and the bidirectional temporal modeling network; the loss function of the knowledge distillation includes both the cross-entropy loss of the student network and the real label, and the divergence loss of the output distribution of the student network and the teacher network; the model pruning includes removing convolutional kernels with contributions below a threshold; the deployment includes compiling and optimizing the lightweight model using an inference optimization toolchain and encapsulating it into a service interface that can be called on edge computing devices.
8. A farmland quality assessment system based on time-series modeling and deep neural networks, characterized in that, include: The multi-source data acquisition and preprocessing module is configured to acquire time-series data from multiple sources and perform spatiotemporal alignment, missing value imputation, outlier removal, and standardization to generate a standardized time-series feature tensor. The spatiotemporal feature collaborative extraction module is configured to extract local spatial features and temporal dynamic evolution features using a network containing convolutional neural networks and temporal attention mechanisms, and generate deep feature sequences through cross-modal fusion; The quality status prediction module is configured to input the deep feature sequence into a bidirectional temporal modeling network and output the farmland quality status prediction result at least one time step in the future. The interpretable decision support module is configured to perform feature importance analysis on the prediction process of the time series modeling network, generate a visual attribution map, and output agricultural operation suggestions and risk warning information in conjunction with the agricultural management knowledge base; The lightweight deployment module is configured to compress the networks used by the spatiotemporal feature collaborative extraction module and the quality state prediction module, generate a lightweight model, and deploy it to an edge computing device.
9. The system according to claim 8, characterized in that, The multi-source data acquisition and preprocessing module is specifically used for: Using the geographic coordinates of the target plot as a reference, a unified projection coordinate system is used to spatially interpolate the site data to generate a matching raster. Based on the unified timestamp, the data is resampled and aligned using a preset time unit. The missing data is filled by spatiotemporal kriging interpolation, the outlier algorithm is used to remove outlier data, and the standardized temporal feature tensor is generated by Z-score standardization.
10. The system according to claim 8, characterized in that, The lightweight deployment module is specifically used for: Knowledge distillation is performed using a teacher-student network architecture, and its loss function is: in For cross-entropy loss, for Divergence loss, and For the logits of the teacher-student network, For temperature parameters, This is the balance coefficient, set to 0.3; Channel pruning is performed on the student network to remove low-contribution convolution kernels; The pruned model is compiled and optimized using TensorRT or OpenVINO toolchains and then encapsulated into an evaluation service interface that runs on ARM architecture edge devices.