Deep learning-based soil carbon and nitrogen content dynamic prediction method
Through deep learning technology, combined with multi-layer perceptron and time convolution network, a dynamic prediction model of soil carbon and nitrogen content is constructed, which solves the problem of time-consuming and labor-intensive and inaccurate traditional methods, and realizes accurate prediction of soil carbon and nitrogen content and in-depth consideration of meteorological factors.
Patent Information
- Application Number
- CN202510663061.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-26
AI Technical Summary
The existing soil carbon and nitrogen content prediction methods are time-consuming, costly and inaccurate, making it difficult to fully reflect the spatial variability and temporal dynamic changes of the soil. Traditional methods have failed to fully explore the complex relationship between meteorological factors and soil carbon and nitrogen content.
A deep learning-based method is adopted to reduce the feature dimension through a multi-layer perceptron model, combine the time convolution network and the meteorological factor library to build a dynamic prediction model of soil carbon and nitrogen content, and optimize the model using Gaussian process regression and cross-validation mechanism to integrate the local timing and global spatial characteristics of climate factor nodes.
Accurate dynamic prediction of soil carbon and nitrogen content is achieved, the integrity of data characteristics and the accuracy of prediction models are improved, and realistic predictions can be made under different climatic conditions, avoiding the shortcomings of traditional methods.
Smart Images

Figure CN120544715A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soil monitoring and data analysis, and specifically to a method for dynamically predicting soil carbon and nitrogen content based on deep learning. Background Art
[0002] Soil carbon and nitrogen content is a key indicator of soil quality and ecological function. Its dynamic changes are crucial for precision agriculture, environmental protection, global climate change research, and other fields. In precision agriculture, accurately understanding the dynamic changes in soil carbon and nitrogen content helps farmers apply fertilizers more effectively, improve crop yields and quality, and reduce resource waste and environmental pollution. In environmental protection, it provides a scientific basis for assessing soil ecosystem health and preventing land degradation. From the perspective of global climate change, the soil carbon and nitrogen cycle is an important component of the global carbon and nitrogen cycle, and studying its dynamic changes is of great significance for understanding the mechanisms of climate change.
[0003] However, traditional methods for predicting soil carbon and nitrogen content have numerous limitations. Early approaches often relied on a combination of field sampling and laboratory analysis. This approach is not only time-consuming, labor-intensive, and costly, but also limited in sampling locations, making it difficult to fully reflect the spatial variability and temporal dynamics of soil changes. For example, monitoring large areas of farmland requires significant manpower and resources to conduct sampling in different areas and at different times. Furthermore, each sampling operation only captures instantaneous data at the sampling point, making continuous dynamic monitoring impossible.
[0004] Prediction methods based on empirical models, such as regression models based on soil physical and chemical properties and meteorological data, have improved prediction efficiency to a certain extent. However, due to their incomplete consideration of complex environmental factors, the models' adaptability and accuracy are poor. Soil carbon and nitrogen content is interactively affected by multiple factors, including soil texture, microbial activity, vegetation type, and climatic conditions. Empirical models struggle to accurately capture these complex relationships. Taking climate change as an example, changes in meteorological factors such as temperature, precipitation, and light can affect soil microbial activity and plant growth, thereby affecting the transformation and accumulation of soil carbon and nitrogen. However, empirical models struggle to accurately describe these dynamic processes.
[0005] With the development of sensor technology, some sensor-based real-time monitoring methods have gradually emerged. However, sensor accuracy is susceptible to environmental interference, and data processing and analysis methods still need to be improved. For example, soil moisture sensors may experience measurement errors in high-salinity soil environments, affecting the accuracy of predictions related to soil carbon and nitrogen content. Furthermore, faced with massive amounts of sensor data, how to effectively extract valuable information and make accurate predictions has become a current challenge.
[0006] Furthermore, existing prediction methods often fail to thoroughly and comprehensively consider the impact of meteorological factors on the dynamic changes in soil carbon and nitrogen content. Meteorological factors not only directly influence soil physical properties such as moisture and temperature, but also indirectly impact the soil carbon and nitrogen cycle by influencing plant growth and soil microbial activity. However, most methods only briefly consider a subset of meteorological parameters, failing to fully explore the complex dynamic relationship between meteorological factors and soil carbon and nitrogen content, resulting in predictions that fail to accurately reflect actual conditions.
[0007] In the era of big data and artificial intelligence, deep learning technology has achieved remarkable results in many fields, but its application in the dynamic prediction of soil carbon and nitrogen content remains exploratory. How to effectively combine deep learning technology with soil monitoring data to overcome the shortcomings of traditional methods and achieve accurate dynamic prediction of soil carbon and nitrogen content has become a pressing issue in soil science. Summary of the Invention
[0008] The purpose of the present invention is to provide a dynamic prediction method for soil carbon and nitrogen content based on deep learning to solve the problems raised in the above background technology.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a method for dynamic prediction of soil carbon and nitrogen content based on deep learning, the method comprising: Obtain soil monitoring data from the environmental monitoring platform; A multi-layer perceptron model was used to reduce the dimension of soil monitoring data, and the reduced features were used as core features. The pre-processed soil monitoring data were divided into multiple dynamic monitoring data sets according to the core features. Each dynamic monitoring data set contained soil attribute information for at least two time periods. The dynamic monitoring dataset is used as input, and a temporal convolutional network is used to construct an initial prediction model. The initial prediction model contains multiple time nodes, and the connection between any two time nodes represents the soil property change information in adjacent time periods. Obtain a meteorological factor library that stores a variety of meteorological parameters, each of which represents at least one environmental variable corresponding to a climate condition; construct an impact map based on the meteorological factor library, and express the dynamic relationship between meteorological parameters and soil properties by constructing a factor-association-indicator triple; According to the meteorological parameters in the impact map, the time nodes in the initial prediction model are replaced with the corresponding climate factor nodes. The node replacement results are verified using the cross-validation mechanism to obtain the prediction model of the climate factor nodes. The Gaussian process regression algorithm based on deep learning is used to fit the climate factor nodes in the prediction model of climate factor nodes; the cross-validation mechanism is used to check the consistency of the fitting results, and the checked fitting results are used as the soil dynamic prediction model.
[0010] Preferably, the method of using a multi-layer perceptron model to perform feature dimensionality reduction on soil monitoring data includes: The pre-processed soil monitoring data is input into the residual neural network, and the spatial features of the pre-processed soil monitoring data are extracted through the residual block and jump connection of the residual neural network to obtain the spatial feature vector; The spatial feature vector is input into the time series decomposition network, and the periodic feature of the spatial feature vector is extracted by the time series decomposition network to obtain a periodic feature vector; Fusion of spatial eigenvectors and periodic eigenvectors as core features; Among them, the time series decomposition network contains multiple layers of dilated convolution and decomposition mechanism; The multi-scale periodic features of the spatial feature vector are extracted through multi-layer dilated convolution to obtain the multi-scale periodic feature vector; The decomposition mechanism generates decomposition coefficients of multi-scale periodic eigenvectors by calculating the distribution differences of multi-scale periodic eigenvectors in different time windows; According to the decomposition coefficient, the contribution weights of the multi-scale periodic features in different time windows are adjusted; The fusion of spatial eigenvectors and periodic eigenvectors as core features includes: The spatial contribution weight of each feature in the spatial eigenvector and the temporal contribution weight of each feature in the periodic eigenvector are calculated through a decomposition mechanism; According to the spatial contribution weight and the temporal contribution weight, the spatial eigenvector and the periodic eigenvector are weightedly integrated to obtain the integrated eigenvector; The integrated feature vector is input into the dense connection layer, and the integrated feature vector is nonlinearly mapped through the dense connection layer to obtain the core feature; The densely connected layer adopts a multi-layer stacking structure, and the output of each layer is directly connected to the input of all subsequent layers.
[0011] Preferably, the pre-processed soil monitoring data is divided into multiple dynamic monitoring data sets according to core features, including: According to the core features, a classification algorithm based on feature correlation and environmental correlation was used to classify the preprocessed soil monitoring data.
[0012] Preferably, the classification algorithm based on feature correlation and environmental correlation is used to classify the pre-processed soil monitoring data, including: The Manhattan distance between the core eigenvectors of the preprocessed soil monitoring data was calculated as a measure of feature correlation; The pre-trained ecological model is used to encode the pre-processed soil monitoring data to obtain environmental vectors. The Jaccard similarity between the environmental vectors is calculated as a measure of environmental relevance. According to the obtained feature correlation measure and environmental correlation measure, a classification algorithm is used to classify the preprocessed soil monitoring data.
[0013] Preferably, the method of classifying the pre-processed soil monitoring data using a classification algorithm based on the obtained feature correlation measure and environmental correlation measure includes: The obtained feature correlation measure and environment correlation measure are standardized; the standardized feature correlation measure and environment correlation measure are linearly combined; and a comprehensive measurement matrix is constructed based on the combined measure; Based on the comprehensive metric matrix, the Prim algorithm is used to construct a minimum spanning tree of the preprocessed soil monitoring data, and the edge set and corresponding edge weight set of the minimum spanning tree are obtained. The minimum spanning tree represents the minimum connected subgraph of the preprocessed soil monitoring data in the comprehensive metric space. Based on the edge weight set of the minimum spanning tree, a piecewise regression algorithm is used to determine the maximum reachable distance and minimum number of samples of the OPTICS clustering parameter. The edge weight set is sorted in ascending order, and the mutation point of the weight distribution is obtained through the piecewise regression algorithm. The edge weight corresponding to the mutation point is used as the maximum reachable distance of the parameter, and the number of edges before the mutation point is used as the minimum number of samples of the parameter. The comprehensive metric matrix was used as the input of OPTICS clustering. Based on the determined maximum reachable distance of the parameter and the minimum number of samples of the parameter, the soil monitoring data were grouped using density connection to obtain preliminary classification results. The preliminary classification results are merged, the average metric value between the dynamic monitoring data is calculated, and the dynamic monitoring data sets with average metric values greater than the set value are merged to obtain the final dynamic monitoring data set division result.
[0014] Preferably, the method of grouping the soil monitoring data by density connection includes: If the number of data points within the maximum reachable distance neighborhood of any soil monitoring data point is greater than or equal to the minimum number of parameter samples, the corresponding soil monitoring data point will be marked as a hub point, and all soil monitoring data points within the maximum reachable distance neighborhood of the hub point will be grouped into the same group; If any soil monitoring data point is not a hub point, but there is a hub point within the maximum reachable distance neighborhood of the corresponding soil monitoring data point, the corresponding soil monitoring data point will be marked as an auxiliary point and the corresponding soil monitoring data point will be assigned to the corresponding group; If any soil monitoring data point is neither a hub point nor a subsidiary point, the corresponding soil monitoring data point will be marked as an outlier and will not be included in any group.
[0015] Preferably, constructing an initial prediction model includes: The soil attribute information of the dynamic monitoring dataset is extracted as time nodes, and the attribute features of the time nodes are used as the node feature matrix; the time nodes and the node feature matrix are used as the input nodes of the temporal convolutional network; Adopting the temporal attention layer, the attention weight tensor between time nodes is calculated through the attention mechanism; the feature representation of the time node is updated according to the attention weight tensor; A multi-head temporal attention mechanism is used to parallelly calculate the attention weight tensor of the time node through multiple independent temporal attention layers, and the outputs of different temporal attention layers are stacked as the output of the multi-head temporal attention; According to the output of multi-head temporal attention, the feature representation of the time node is pooled through the temporal pooling layer to obtain the high-dimensional feature representation of the time node; According to the high-dimensional feature representation of the time node, the time node is mapped from the high-dimensional feature space to the low-dimensional embedding space through the dimensionality reduction layer to obtain the embedding matrix representation of the time node; According to the embedding matrix representation of the time nodes, the cosine similarity between the embedding matrices of the time nodes is calculated to build the connection between the time nodes and obtain the initial prediction model; The transaction mechanism of the distributed database is used to perform version marking and checksum calculation on the constructed initial prediction model. The version marking and checksum of the initial prediction model are agreed upon in the distributed database through the cross-validation mechanism, and the initial prediction model is stored in the distributed database as a version.
[0016] Preferably, building a soil dynamic prediction model includes: The prediction model of the climate factor node is used as input. The local temporal features of the climate factor node are extracted through the spatiotemporal fusion network. The global spatial correlation features between the climate factor nodes are obtained through the spatial attention mechanism. The local temporal features and the global spatial correlation features are coupled to obtain the comprehensive feature tensor of the climate factor node. Among them, the local temporal features represent the temporal evolution information of the climate factor node in the prediction model, and the global spatial correlation features represent the spatial distribution effect of the climate factor node in the prediction model. A variational autoencoder structure is used, taking the comprehensive feature tensor of the climate factor node as input. The encoder maps the comprehensive feature tensor to a low-dimensional latent space to obtain the latent vector representation of the climate factor node. The decoder reconstructs the latent vector representation into the original comprehensive feature tensor. The original comprehensive feature tensor is used to optimize the encoder parameters. In a low-dimensional latent space, a spectral clustering algorithm is used to cluster the latent vector representations of climate factor nodes. By minimizing the difference between the latent vector and the cluster centroid while maximizing the separation between different clusters, the optimal clustering division of climate factor nodes is obtained. The potential representation and clustering of climate factor nodes are used as prediction data. The checksum of the prediction data is calculated in parallel across multiple replicas in a distributed database. The checksums calculated from different replicas are compared and arbitrated using a cross-validation mechanism. The checksum corresponding to the replica with the most arbitration results is selected as the final consistency checksum. A soil dynamic prediction model is constructed based on consistency verification and corresponding cluster division. The nodes in the soil dynamic prediction model represent the clusters corresponding to the climate factor nodes. The attributes of the nodes include the centroid coordinates of the clusters and the standard deviation of the nodes within the clusters. The connections between the nodes represent the dynamic association relationships between different clusters, and the weights of the connections represent the frequency and intensity of the dynamic associations.
[0017] Preferably, the spatiotemporal fusion network includes a temporal branch and a spatial branch. The temporal branch uses an expanded convolution layer to extract multi-scale temporal features, and the spatial branch uses a graph convolution layer to extract multi-scale spatial features. The outputs of the temporal branch and the spatial branch are dynamically weighted fused through a gated fusion mechanism.
[0018] Preferably, the gated fusion mechanism generates temporal weights and spatial weights by calculating the feature importance scores of the temporal branch and the spatial branch outputs, and performs weighted summation on the outputs of the two branches according to the weights to form a fused comprehensive feature tensor.
[0019] Compared with the prior art, the present invention has the following beneficial effects: (1) At the data processing and feature extraction level, a multi-layer perceptron model is used to perform feature dimensionality reduction. First, the spatial features of the soil monitoring data are extracted with the help of the residual blocks and jump connections of the residual neural network, and then the periodic features are mined through the time series decomposition network. This multi-stage, multi-dimensional feature extraction method can accurately capture the spatial and temporal variation patterns of soil data. Taking farmland soil monitoring as an example, it can not only determine the spatial distribution differences of soil carbon and nitrogen content in different regions, but also discover the periodic patterns of seasonal changes. Compared with the traditional single feature extraction method, it greatly improves the integrity and effectiveness of data features, laying a solid foundation for subsequent accurate predictions; (2) In the data division stage, a classification algorithm based on feature correlation and environmental correlation is adopted. Feature correlation is measured by calculating the Manhattan distance of the core feature vector, and the environmental vector is obtained using the pre-trained ecological model and the Jaccard similarity is calculated to evaluate the environmental correlation. Then, data classification is achieved through a series of complex calculations. This process fully considers the inherent feature connection of soil monitoring data and the external environmental factors in which it is located, making the divided dynamic monitoring data set more reasonable and representative. In soil monitoring in different ecological regions, data with similar soil properties and environmental conditions can be grouped together, avoiding the data mixing problem caused by traditional simple classification methods and improving the accuracy of prediction model training; (3) When constructing the initial prediction model, the temporal attention layer and the multi-head temporal attention mechanism are incorporated. The temporal attention layer can calculate the attention weight tensor based on the degree of correlation between time nodes, and then update the feature representation of the time nodes; the multi-head temporal attention mechanism can capture the complex dependencies in the time series from multiple perspectives through parallel calculation and stacked output of multiple independent temporal attention layers. This makes the model capture the information of soil property changes over time more comprehensive and accurate, and can more accurately reflect the actual changes when predicting the fluctuation trend of soil carbon and nitrogen content over time, which is better than the simple processing method of time series information of traditional models; (4) In terms of considering the influence of meteorological factors, a meteorological factor library and influence map are constructed, and the dynamic relationship between meteorological parameters and soil properties is represented by a factor-association-indicator triple. This innovative representation method deeply explores the complex internal relationship between meteorological factors and soil carbon and nitrogen content, replacing the time nodes in the initial prediction model with climate factor nodes, so that the model can fully consider the impact of meteorological changes on soil carbon and nitrogen content. When predicting changes in soil carbon and nitrogen content under different climatic conditions, it can combine real-time meteorological data to make more realistic predictions, making up for the shortcomings of traditional methods in not considering meteorological factors enough; (5) In the model optimization and verification phase, Gaussian process regression is used to fit the climate factor nodes, and the accuracy and consistency of the model are ensured through multiple cross-validation mechanisms. When constructing the soil dynamic prediction model, the spatiotemporal fusion network can simultaneously extract the local temporal characteristics and global spatial correlation characteristics of the climate factor nodes. The comprehensive feature tensor formed by the coupling of the two contains richer information. The variational autoencoder structure processes the comprehensive feature tensor and achieves the optimal clustering division of the climate factor nodes through the spectral clustering algorithm, further optimizing the model structure. The transaction mechanism and replica verification operation of the distributed database ensure the accuracy and stability of the model in different computing environments, effectively avoiding data inconsistency and model bias problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1This is a diagram showing the working principle of the method for dynamic prediction of soil carbon and nitrogen content based on deep learning described in the present invention.
[0021] Figure 2 Flowchart of the preliminary processing of soil data classification based on feature and environment correlation.
[0022] Figure 3 Detailed flowchart for soil data classification based on feature and environmental correlation.
[0023] Figure 4 A flowchart constructed for the initial prediction model.
[0024] Figure 5 Figure 2 is the internal workflow diagram of the spatiotemporal fusion network. DETAILED DESCRIPTION
[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0026] See also Figure 1-Figure 5 The present invention provides a method for dynamic prediction of soil carbon and nitrogen content based on deep learning, and the specific steps are as follows: Soil monitoring data obtained from an environmental monitoring platform contains multifaceted soil information and serves as the foundation for subsequent analysis. A multi-layer perceptron model is used to reduce the dimensionality of the soil monitoring data, using the reduced features as core features. The preprocessed soil monitoring data is first fed into a residual neural network, where its residual blocks and skip connections extract spatial features, resulting in a spatial feature vector. This spatial feature vector is then fed into a temporal decomposition network, which extracts multi-scale periodic features through multiple layers of dilated convolution. The decomposition mechanism then calculates the distribution differences across different time windows to generate decomposition coefficients. The contribution weights of the multi-scale periodic features are then adjusted accordingly, resulting in a periodic feature vector. The weights of the spatial and periodic feature vectors are then calculated, weighted and integrated, and then fed into a densely connected layer for nonlinear mapping, ultimately yielding the core features. The preprocessed soil monitoring data is then divided into multiple dynamic monitoring datasets based on the core features. Classification is achieved using a classification algorithm based on feature correlation and environmental relevance, using the core features.
[0027] Using a dynamic monitoring dataset as input, a temporal convolutional network (TCN) was used to construct an initial prediction model. Soil attribute information from the dynamic monitoring dataset was extracted as time nodes, and the attribute features of the time nodes were used as the node feature matrix. Both served as input nodes of the TCN. A temporal attention layer and a multi-head temporal attention mechanism were used to calculate the attention weight tensor to update the time node feature representation. This was then processed through a temporal pooling layer and a dimensionality reduction layer. Connections were established by calculating the cosine similarity of the time node embedding matrix. Finally, the distributed database transaction mechanism was used for version tagging, checksum calculation, and storage in the database through cross-validation.
[0028] Obtain a meteorological factor library containing multiple meteorological parameters, each representing at least one environmental variable under a specific climate condition. Construct an impact map based on the meteorological factor library, using a factor-association-indicator triplet to represent the dynamic relationship between meteorological parameters and soil properties.
[0029] According to the meteorological parameters in the impact map, the time nodes in the initial prediction model are replaced with the corresponding climate factor nodes. The node replacement results are verified using the cross-validation mechanism to obtain the prediction model of the climate factor nodes.
[0030] The Gaussian process regression algorithm is used to fit the climate factor nodes in the prediction model of the climate factor nodes. The cross-validation mechanism is used to check the consistency of the fitting results, and the checked fitting results are used as the soil dynamic prediction model.
[0031] The present invention will be further described below in conjunction with Examples 1 to 5: Example 1
[0032] When performing feature dimensionality reduction on soil monitoring data, the data is first preprocessed to remove interfering information such as outliers and missing values. After preprocessing, the data is fed into a residual neural network. The residual blocks of the residual neural network effectively avoid the vanishing gradient problem. Skip connections transfer shallow-layer features directly to deeper layers, enabling the network to better learn the spatial characteristics of the soil monitoring data. After processing by the residual neural network, a spatial feature vector is obtained.
[0033] The spatial feature vector is input into the time series decomposition network. The multi-layer dilated convolution within the network performs convolution operations on the spatial feature vector at varying kernel dilation rates, thereby extracting multi-scale periodic features and generating a multi-scale periodic feature vector. The decomposition mechanism calculates the distribution differences of the multi-scale periodic feature vector across different time windows, focusing on short-term variations in shorter time windows and long-term trends in longer time windows. Decomposition coefficients are generated based on these differences. The decomposition coefficients are used to adjust the contribution weights of the multi-scale periodic features across different time windows, allowing the model to prioritize features that are more valuable for subsequent analysis, ultimately yielding a periodic feature vector.
[0034] The spatial contribution weight of each feature in the spatial feature vector and the temporal contribution weight of each feature in the periodic feature vector are calculated. Based on these weights, the two vectors are weighted and integrated to obtain an integrated feature vector. This integrated feature vector is then input into a densely connected layer with a multi-layer stacked structure. The output of each layer is directly connected to the input of all subsequent layers. This structure fully utilizes the features learned in previous layers and obtains the core features through nonlinear mapping.
[0035] Suppose we need to monitor the soil in an agricultural park to predict its carbon and nitrogen content. The soil monitoring data obtained from the environmental monitoring platform includes information such as soil depth, pH, and carbon and nitrogen content over different time periods. This data is preprocessed. For example, if the soil pH value in a particular data set is significantly abnormal, far exceeding the normal range, it is considered an outlier and removed. For missing carbon and nitrogen content data, the mean of the data from adjacent time periods is used to fill in the missing data.
[0036] After preprocessing, the data is input into a residual neural network. For example, a residual neural network has five layers, each of which performs a specific convolution operation on the data. In the first layer, a 3×3 convolution kernel with a stride of 1 is used to convolve the input data and extract preliminary spatial features. As the network deepens, the size and stride of the convolution kernel are adjusted based on the data characteristics. For example, the third layer may use a 5×5 convolution kernel with a stride of 2. Through residual blocks and skip connections, feature information from shallow layers is directly transferred to deeper layers, preventing gradient vanishing. This results in a spatial feature vector for the soil monitoring data, which contains spatial characteristic information of the soil, such as the differences in soil characteristics at different depths.
[0037] The spatial feature vector is input into the temporal decomposition network. The network's multiple layers of dilated convolutions come into play. For example, the first layer of dilated convolution uses a kernel size of 3 and a dilation rate of 2. This expands the receptive field of the convolution without increasing the number of parameters, capturing richer periodic features. After three layers of dilated convolution, a multi-scale periodic feature vector is obtained.
[0038] The decomposition mechanism processes this multi-scale periodic eigenvector. Taking three different time windows—one day, seven days, and 30 days—as examples, the distribution differences of the multi-scale periodic eigenvectors within these time windows are calculated. Assume that within the one-day window, carbon and nitrogen content fluctuate more frequently, while within the 30-day window, there is a certain seasonal trend. Based on these differences, the decomposition mechanism generates decomposition coefficients. For features that fluctuate more frequently within the one-day window, if they are considered more important for predicting short-term soil carbon and nitrogen content changes in subsequent analysis, their contribution can be increased through the decomposition coefficients. For features that reflect seasonal changes within the 30-day window, if the focus is on long-term trend prediction, their weights can be adjusted accordingly, thereby obtaining a periodic eigenvector.
[0039] Calculate the weights of each feature of the spatial eigenvector and the periodic eigenvector. For example, if the soil depth feature in the spatial eigenvector is found to have a significant impact on carbon and nitrogen content during analysis, it will be given a higher spatial contribution weight. In the periodic eigenvector, if the feature reflecting weekly carbon and nitrogen content fluctuations is strongly correlated with the actual pattern of carbon and nitrogen content changes, it will be given a higher temporal contribution weight. Based on these weights, the two vectors are weighted and integrated to obtain the integrated eigenvector. The integrated eigenvector is then input into a densely connected layer with a multi-layer stacked structure. Assume that there are 4 densely connected layers. Each layer uses the output of all previous layers as input and performs nonlinear mapping through a nonlinear activation function (such as the ReLU function) to ultimately obtain the core features. These core features will be used for subsequent data segmentation and model construction. Example 2
[0040] When partitioning the preprocessed soil monitoring data into multiple dynamic monitoring datasets based on core features, the Manhattan distance between the core feature vectors of the preprocessed soil monitoring data is first calculated. Manhattan distance measures the sum of the absolute differences between two vectors in each dimension. This serves as a measure of feature correlation and intuitively reflects the degree of difference in core features between different data sets.
[0041] The pre-trained ecological model is then used to encode the environmental characteristics of the pre-processed soil monitoring data, generating environmental vectors. The Jaccard similarity between these environmental vectors is calculated as a measure of environmental relevance. This measure measures the similarity between two sets of data, and is used here to measure the similarity of environmental characteristics between different soil monitoring data.
[0042] After obtaining the feature correlation and environmental correlation metrics, they are first standardized to map the data to a specific interval and eliminate dimensionality effects. The two standardized metrics are then linearly combined, and a comprehensive metric matrix is constructed based on the combined metrics. Based on the comprehensive metric matrix, the Prim algorithm is used to construct a minimum spanning tree of the preprocessed soil monitoring data. The minimum spanning tree's edge set and corresponding edge weight set are obtained. The minimum spanning tree represents the minimum connected subgraph of the data in the comprehensive metric space.
[0043] Based on the edge weight set of the minimum spanning tree, the edge weights are sorted in ascending order. A piecewise regression algorithm is used to identify the mutation points in the weight distribution. The edge weights corresponding to the mutation points are used as the maximum reachable distance parameter for OPTICS clustering, and the number of edges before the mutation point is used as the minimum sample number parameter. Finally, the comprehensive metric matrix is used as the input for OPTICS clustering. Based on the determined maximum reachable distance parameter and minimum sample number parameter, the soil monitoring data are grouped using density linkage. If the number of data points within the maximum reachable distance neighborhood of a soil monitoring data point is greater than or equal to the minimum sample number parameter, it is marked as a hub point, and all soil monitoring data points within the maximum reachable distance neighborhood of the hub point are assigned to the same group. If a data point is not a hub point, but a hub point exists within its maximum reachable distance neighborhood, it is marked as an auxiliary point and assigned to the corresponding group. Data points that are neither hub points nor auxiliary points are marked as outliers and are not assigned to any group. The preliminary classification results are merged, and the average metric value between the dynamic monitoring data is calculated. Dynamic monitoring data sets with an average metric value greater than the set value are merged to obtain the final dynamic monitoring data set partitioning result.
[0044] In actual soil monitoring work, suppose we set up multiple monitoring points in a certain area and continuously collect soil monitoring data from these monitoring points over a period of time, covering various information such as soil pH, nutrient content, and texture. This is the soil monitoring data before preprocessing.
[0045] This data was preprocessed to remove obviously erroneous or missing data. For example, if the soil pH value recorded at a monitoring point at a certain moment was 0 (normal soil pH range is usually between 3-9), which clearly did not conform to the actual situation, the data was deleted. For data with a small number of missing values, the mean of data from adjacent monitoring points and similar time periods was used to fill in the gaps.
[0046] After preprocessing, we begin calculating the Manhattan distance between core eigenvectors. Assume we have two core eigenvectors: A = [0.2, 0.5, 0.3] and B = [0.4, 0.3, 0.2]. The Manhattan distance is calculated as the sum of the absolute values of the differences in the corresponding dimensions: |0.2 - 0.4| + |0.5 - 0.3| + |0.3 - 0.2| = 0.5. This 0.5 represents the feature correlation measure between the two core eigenvectors. In this way, the Manhattan distance between the core eigenvectors of all monitoring data is calculated.
[0047] A pretrained ecological model is used to encode the environmental characteristics of preprocessed soil monitoring data. For example, this ecological model might be trained based on environmental data from a large number of regions, including climate, topography, and vegetation. After inputting the soil monitoring data into the model, an environmental vector is generated. Consider two environmental vectors, C = [0.1, 0.7, 0.2] and D = [0.2, 0.6, 0.2]. The Jaccard similarity between them is calculated. First, the vectors are converted to sets (assuming that vector elements represent the presence or absence of a certain environmental characteristic, with values greater than 0.5 considered present and values less than or equal to 0.5 considered absent). The converted set for C is {2}, and the converted set for D is {1, 2}. The Jaccard similarity is the number of elements in the intersection of the two sets divided by the number of elements in the union, i.e., 1 ÷ 3 ≈ 0.33. This is the environmental correlation measure between environmental vectors C and D. This analogy is used to calculate the similarity between all environmental vectors.
[0048] After obtaining the feature relevance measure and the environmental relevance measure, they are normalized. Assuming the feature relevance measure ranges from 0 to 2, they are mapped to the range from 0 to 1 using the formula (x-min) ÷ (max-min). For example, the feature relevance measure calculated above, 0.5, is normalized to (0.5-0) ÷ (2-0) = 0.25. The environmental relevance measure ranges from 0 to 1 and remains unchanged. Then, the two normalized measures are linearly combined, assuming a weight of 0.5. The combined metric value is 0.25 × 0.5 + 0.33 × 0.5 = 0.29. A comprehensive metric matrix is constructed based on all these combined metric values.
[0049] Based on the comprehensive metric matrix, the Prim's algorithm is used to construct a minimum spanning tree. Starting from any node, the Prim's algorithm selects the edge with the smallest weight connecting it to a node already added to the tree, adding the corresponding node to the tree until all nodes have been added. Assuming we have data from five monitoring points, the minimum spanning tree we construct yields the edge set {(1,2),(2,3),(3,4),(4,5)}, with the corresponding edge weight set [0.2,0.3,0.4,0.5].
[0050] Based on the edge weight set, we sort the edge weights in ascending order to [0.2, 0.3, 0.4, 0.5] and use a piecewise regression algorithm to find the mutation point in the weight distribution. Assuming that 0.4 is the mutation point, we use 0.4 as the maximum reachable distance parameter for OPTICS clustering. The number of edges before the mutation point is 3, which we use as the minimum sample number parameter.
[0051] The comprehensive metric matrix is used as input for OPTICS clustering. Based on the established parameters of a maximum distance of 0.4 and a minimum number of samples of 3, the soil monitoring data are grouped using density linkage. For example, for a monitoring point M, if its neighborhood with a radius of 0.4 contains three or more other data points, M is labeled a hub, and all data points within that neighborhood are grouped together. If a data point N's neighborhood contains fewer than three data points but a hub exists, N is labeled an outlier and assigned to the group containing the hub. If a data point P meets neither the hub nor the outlier criteria, it is labeled an outlier and not assigned to any group. The initial classification results are merged to calculate the average metric between the dynamic monitoring data. Assuming a set value of 0.3, if the average metric between two groups is greater than 0.3, the two groups are merged, ultimately resulting in a reasonable partitioning of the dynamic monitoring data set. Example 3
[0052] When constructing the initial prediction model, the soil attribute information of the dynamic monitoring data set is extracted as the time node, and the attribute characteristics of the time node are organized into a node feature matrix. The two serve as the input nodes of the temporal convolutional network.
[0053] Using the temporal attention layer, the attention mechanism calculates the attention weight tensor between time nodes. The attention mechanism automatically learns the importance of different time nodes and assigns higher weights to time nodes that are more closely related to subsequent predictions, thereby updating the feature representation of each time node. A multi-head temporal attention mechanism is used to parallelly calculate the attention weight tensor for each time node through multiple independent temporal attention layers. Each temporal attention layer focuses on a different aspect, and the outputs of different temporal attention layers are stacked. This allows for a more comprehensive capture of the relationships between time nodes, which serve as the output of the multi-head temporal attention.
[0054] Based on the output of the multi-head temporal attention, the temporal pooling layer performs a pooling operation on the feature representations of the time nodes. This pooling operation reduces the data dimension while retaining key features, resulting in a high-dimensional feature representation of the time nodes. The dimensionality reduction layer then maps the time nodes from the high-dimensional feature space to a low-dimensional embedding space, resulting in an embedding matrix representation of the time nodes. The cosine similarity between the embedding matrices of the time nodes is calculated to establish connections between the time nodes, thereby obtaining an initial prediction model.
[0055] The transaction mechanism of the distributed database is used to perform version tagging and checksum calculation on the constructed initial prediction model. The cross-validation mechanism is used to reach a consensus on the version tag and checksum of the initial prediction model in the distributed database. The initial prediction model is stored in the distributed database as a version to facilitate subsequent call and management.
[0056] Suppose the soil of a certain farmland is monitored, and soil monitoring data at different time points are obtained, including soil temperature, humidity, carbon and nitrogen content, and other information, forming a dynamic monitoring data set.
[0057] Extract soil attribute information from the dynamic monitoring data set as a time node. For example, take the daily soil monitoring data as a time node. Each time node contains the soil temperature, humidity, carbon and nitrogen content and other attribute characteristics of the day, and organize them into a node feature matrix. Assume that the node feature matrix of the first day is:
[0058] Where 25 represents soil temperature (unit: °C), 60 represents soil moisture (unit:%), and 1.2 represents soil carbon and nitrogen content (unit: g / kg). The time nodes and node feature matrix are used as input nodes of the temporal convolutional network.
[0059] Using the temporal attention layer, the attention mechanism calculates the attention weight tensor between time nodes. Assuming there are five time nodes, the attention mechanism analyzes the correlation between each time node and the others. For example, if soil moisture changes on the second day significantly influence the prediction of carbon and nitrogen content on the third day, the attention weight tensor will be calculated with a relatively high weight between the second and third time nodes. This method updates the feature representation of each time node.
[0060] A multi-head temporal attention mechanism is employed, assuming three independent temporal attention layers. Each temporal attention layer focuses on a different aspect. The first temporal attention layer might focus more on the impact of temperature on carbon and nitrogen content, the second on humidity, and the third on the combined effects of multiple factors. The attention weight tensors for each time node are calculated in parallel, and the outputs of different temporal attention layers are stacked to form the output of the multi-head temporal attention.
[0061] Based on the output of the multi-head temporal attention, the temporal pooling layer performs a pooling operation on the feature representation of the time node. For example, a max pooling operation is used to select the maximum value from multiple feature values, reducing the data dimension while retaining key features, resulting in a high-dimensional feature representation of the time node. The dimensionality reduction layer then maps the time node from the high-dimensional feature space to a low-dimensional embedding space. Assuming that the dimensionality reduction layer uses a linear transformation, the resulting embedding matrix representation of the time node is obtained.
[0062] The connection between time nodes is constructed by calculating the cosine similarity between the embedding matrices of time nodes. Assume that the embedding matrices of two time nodes are and , the cosine similarity formula is, (in Representation matrix and The cosine similarity of is a matrix and The dot product of and They are matrices and According to the calculated similarity, when the similarity is greater than a certain threshold (such as 0.6), connections are established between the time nodes to obtain the initial prediction model.
[0063] The transaction mechanism of the distributed database is used to perform version tagging and checksum calculation on the constructed initial prediction model. The cross-validation mechanism is used to reach a consensus on the version tag and checksum of the initial prediction model in the distributed database. The initial prediction model is stored in the distributed database as a version to facilitate subsequent call and management. Example 4
[0064] When constructing a soil dynamic prediction model, the prediction model of the climate factor node is used as input to a spatiotemporal fusion network. This network consists of a temporal branch and a spatial branch. The temporal branch uses a dilated convolutional layer to extract multi-scale temporal features using different kernel dilation rates, capturing the changing trends of climate factor nodes at different time scales. The spatial branch uses a graph convolutional layer to extract multi-scale spatial features for analyzing the spatial distribution relationships between climate factor nodes. The outputs of the temporal and spatial branches are dynamically weighted and fused using a gated fusion mechanism. This mechanism calculates the feature importance scores of the temporal and spatial branch outputs, generates temporal and spatial weights based on these scores, and then performs a weighted summation of the outputs of the two branches to form a fused comprehensive feature tensor. This tensor contains the local temporal features and global spatial correlation features of the climate factor nodes.
[0065] A variational autoencoder architecture is used, taking the comprehensive feature tensor of a climate factor node as input. The encoder maps the comprehensive feature tensor into a low-dimensional latent space, generating a latent vector representation of the climate factor node. The decoder then reconstructs the latent vector representation into the original comprehensive feature tensor. During this process, the encoder parameters are optimized using the original comprehensive feature tensor, enabling the encoder to better extract key information from the comprehensive feature tensor.
[0066] In a low-dimensional latent space, a spectral clustering algorithm is used to cluster the latent vector representations of climate factor nodes. The spectral clustering algorithm obtains the optimal clustering partition of climate factor nodes by minimizing the difference between the latent vector and the cluster centroid while maximizing the separation between different clusters.
[0067] The potential representation and clustering of climate factor nodes are used as prediction data, and the checksum of the prediction data is calculated in parallel using multiple replicas in a distributed database. The checksums calculated from different replicas are compared and arbitrated using a cross-validation mechanism, and the checksum corresponding to the replica with the most arbitration results is selected as the final consistency checksum. A soil dynamic prediction model is constructed based on the clustering corresponding to the consistency checksum. The nodes in the soil dynamic prediction model represent the clusters corresponding to the climate factor nodes. Node attributes include the centroid coordinates of the cluster and the standard deviation of the nodes within the cluster, which are used to describe the central location and dispersion of the cluster. The connections between nodes represent the dynamic associations between different clusters, and the connection weights represent the frequency and strength of the dynamic associations.
[0068] Suppose we want to predict the carbon and nitrogen content of orchard soil in a certain area. We have already built a prediction model for the climate factor node. The climate factors input to the model include temperature, precipitation, and sunshine duration.
[0069] The prediction model for the climate factor node is fed into the spatiotemporal fusion network. This network consists of a temporal branch and a spatial branch. In the temporal branch, dilated convolution layers are used to extract multi-scale temporal features. For example, the first dilated convolution layer processes the temperature data in the time series using a kernel size of 3 and a dilation rate of 2. This captures temperature variations at different time scales, such as short-term diurnal variations and long-term seasonal variations. After multiple layers of dilated convolution, multi-scale temporal features are obtained.
[0070] The spatial branch uses a graph convolution layer to extract multi-scale spatial features. For example, if an orchard is divided into multiple regions, and the soil monitoring points in each region form a graph structure, the graph convolution layer analyzes the connections between these monitoring points to extract the spatial distribution characteristics of soil properties across different regions, such as the differences and correlations in soil carbon and nitrogen content.
[0071] The outputs of the temporal and spatial branches are dynamically weighted and fused using a gated fusion mechanism. This mechanism calculates the feature importance scores of the temporal and spatial branch outputs. For example, in the current prediction task, if recent temperature changes have a significant impact on soil carbon and nitrogen content, while spatial differences between regions have a relatively small impact, the temporal branch output will have a higher feature importance score. Based on these scores, temporal and spatial weights are generated. Assuming a temporal weight of 0.7 and a spatial weight of 0.3, the outputs of the two branches are weighted and summed to form a fused composite feature tensor. This tensor contains the local temporal features and global spatial correlation features of the climate factor node.
[0072] A variational autoencoder architecture is used, taking the comprehensive feature tensor of a climate factor node as input. The encoder maps this comprehensive feature tensor into a low-dimensional latent space, yielding a latent vector representation of the climate factor node. Assuming the encoder is a multi-layer neural network, computations across three layers of neurons map the high-dimensional comprehensive feature tensor into a three-dimensional latent vector space. The decoder then reconstructs the latent vector representation into the original comprehensive feature tensor. During this process, the encoder parameters are optimized using the original comprehensive feature tensor, enabling the encoder to better extract key information from the comprehensive feature tensor.
[0073] In a low-dimensional latent space, a spectral clustering algorithm is used to cluster the latent vector representations of climate factor nodes. For example, the latent vector is divided into three clusters. By minimizing the difference between the latent vector and the cluster centroid while maximizing the separation between different clusters, the optimal clustering of climate factor nodes is obtained.
[0074] The potential representation and clustering of climate factor nodes are used as prediction data. Checksums for the prediction data are calculated in parallel across multiple replicas in a distributed database. Assuming there are five replicas, each replica calculates a checksum for the prediction data. A cross-validation mechanism is used to compare and arbitrate the checksums calculated across different replicas. The checksum corresponding to the replica with the most arbitration results is selected as the final consistency checksum. A soil dynamic prediction model is constructed based on the clustering corresponding to the consistency checksum. Nodes in the soil dynamic prediction model represent clusters corresponding to climate factor nodes. Node attributes include the centroid coordinates of the cluster and the standard deviation of the nodes within the cluster, which describe the central location and dispersion of the clusters. Connections between nodes represent the dynamic relationships between clusters, and the connection weights represent the frequency and strength of the dynamic relationships. Example 5
[0075] When constructing an impact map based on the meteorological factor library, the meteorological factor library stores a variety of meteorological parameters. Each meteorological parameter represents at least one environmental variable corresponding to a climate condition, such as temperature, humidity, light and other meteorological parameters, which reflect different aspects of climate conditions.
[0076] Based on these meteorological parameters, an impact map was constructed, representing the dynamic relationships between meteorological parameters and soil properties by constructing a triplet of factor, association, and indicator. For each meteorological parameter, the relationship and degree of influence between it and the soil property were analyzed. For example, rising temperature may affect soil microbial activity, which in turn affects soil carbon and nitrogen content. This constitutes a triplet of factor (temperature) - association (influence on microbial activity, thus affecting soil carbon and nitrogen content) - indicator (change in soil carbon and nitrogen content). By presenting these dynamic relationships between all meteorological parameters and soil properties in the form of a triplet, a complete impact map was constructed. This impact map provided an important basis for subsequently replacing time nodes in the initial prediction model with climate factor nodes, enabling the model to better account for the impact of meteorological factors on soil carbon and nitrogen content.
[0077] Suppose we are studying the soil in a grassland region and have obtained a database of meteorological factors for the region, including temperature, precipitation, wind speed, and other meteorological parameters. Based on these meteorological parameters, we construct an impact map. For example, changes in temperature affect soil microbial activity, which in turn is closely related to soil carbon and nitrogen content. Therefore, we can construct a factor-association-indicator triple: (temperature, affecting soil microbial activity and thus affecting soil carbon and nitrogen content, and changes in soil carbon and nitrogen content).
[0078] Next, consider precipitation. Precipitation affects soil moisture, which in turn affects the dissolution and migration of nutrients in the soil, thus affecting soil carbon and nitrogen content. The constructed triplet is: (precipitation, affecting soil moisture, which in turn affects soil nutrient migration and soil carbon and nitrogen content, and changes in soil carbon and nitrogen content).
[0079] Wind speed also affects soil. For example, high wind speeds accelerate soil evaporation, affecting soil moisture and, consequently, soil carbon and nitrogen content. The corresponding triplet is: (wind speed, affecting soil evaporation and thus affecting soil moisture and soil carbon and nitrogen content, changes in soil carbon and nitrogen content).
[0080] By presenting these dynamic relationships between all meteorological parameters and soil properties in the form of triplets, a complete impact map was constructed. For example, after detailed analysis and research, a total of 10 dynamic relationships between meteorological parameters and soil carbon and nitrogen content were identified, forming 10 triplets. Together, these triplets constitute the impact map of the soil in this grassland region. This impact map provided an important basis for subsequently replacing time nodes in the initial prediction model with climate factor nodes, allowing the model to better account for the impact of meteorological factors on soil carbon and nitrogen content.
[0081] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0082] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A method for dynamic prediction of soil carbon and nitrogen content based on deep learning, comprising: Obtain soil monitoring data from the environmental monitoring platform; A multi-layer perceptron model is used to reduce the dimension of soil monitoring data, and the reduced features are used as core features. The preprocessed soil monitoring data is divided into multiple dynamic monitoring data sets according to core features; each dynamic monitoring data set contains soil attribute information for at least two time periods; The dynamic monitoring dataset is used as input, and a temporal convolutional network is used to construct an initial prediction model. The initial prediction model contains multiple time nodes, and the connection between any two time nodes represents the soil property change information in adjacent time periods. Obtain a meteorological factor library that stores a variety of meteorological parameters, each of which represents at least one environmental variable corresponding to a climate condition; construct an impact map based on the meteorological factor library, and express the dynamic relationship between meteorological parameters and soil properties by constructing a factor-association-indicator triple; According to the meteorological parameters in the impact map, the time nodes in the initial prediction model are replaced with the corresponding climate factor nodes. The node replacement results are verified using the cross-validation mechanism to obtain the prediction model of the climate factor nodes. The Gaussian process regression algorithm based on deep learning is used to fit the climate factor nodes in the prediction model of climate factor nodes; the cross-validation mechanism is used to check the consistency of the fitting results, and the checked fitting results are used as the soil dynamic prediction model.
2. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 1, characterized in that: The multi-layer perceptron model is used to perform feature dimensionality reduction on soil monitoring data; including: The pre-processed soil monitoring data is input into the residual neural network, and the spatial features of the pre-processed soil monitoring data are extracted through the residual block and jump connection of the residual neural network to obtain the spatial feature vector; The spatial feature vector is input into the time series decomposition network, and the periodic feature of the spatial feature vector is extracted by the time series decomposition network to obtain a periodic feature vector; Fusion of spatial eigenvectors and periodic eigenvectors as core features; Among them, the time series decomposition network contains multiple layers of dilated convolution and decomposition mechanism; The multi-scale periodic features of the spatial feature vector are extracted through multi-layer dilated convolution to obtain the multi-scale periodic feature vector; The decomposition mechanism generates decomposition coefficients of multi-scale periodic eigenvectors by calculating the distribution differences of multi-scale periodic eigenvectors in different time windows; According to the decomposition coefficient, the contribution weights of the multi-scale periodic features in different time windows are adjusted; The fusion of spatial eigenvectors and periodic eigenvectors as core features includes: The spatial contribution weight of each feature in the spatial eigenvector and the temporal contribution weight of each feature in the periodic eigenvector are calculated through a decomposition mechanism; According to the spatial contribution weight and the temporal contribution weight, the spatial eigenvector and the periodic eigenvector are weightedly integrated to obtain the integrated eigenvector; The integrated feature vector is input into the dense connection layer, and the integrated feature vector is nonlinearly mapped through the dense connection layer to obtain the core feature; The densely connected layer adopts a multi-layer stacking structure, and the output of each layer is directly connected to the input of all subsequent layers.
3. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 1, characterized in that: The pre-processed soil monitoring data is divided into multiple dynamic monitoring data sets according to core features, including: According to the core features, a classification algorithm based on feature correlation and environmental correlation was used to classify the preprocessed soil monitoring data.
4. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 3, characterized in that: The classification algorithm based on feature correlation and environmental correlation is used to classify the pre-processed soil monitoring data, including: The Manhattan distance between the core eigenvectors of the preprocessed soil monitoring data was calculated as a measure of feature correlation; The pre-trained ecological model is used to encode the pre-processed soil monitoring data to obtain environmental vectors. The Jaccard similarity between the environmental vectors is calculated as a measure of environmental relevance. According to the obtained feature correlation measure and environmental correlation measure, a classification algorithm is used to classify the preprocessed soil monitoring data.
5. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 4, characterized in that: The method of classifying the pre-processed soil monitoring data using a classification algorithm based on the obtained feature correlation measure and environmental correlation measure includes: The obtained feature correlation measure and environment correlation measure are standardized; the standardized feature correlation measure and environment correlation measure are linearly combined; and a comprehensive measurement matrix is constructed based on the combined measure; Based on the comprehensive metric matrix, the Prim algorithm is used to construct a minimum spanning tree of the preprocessed soil monitoring data, and the edge set and corresponding edge weight set of the minimum spanning tree are obtained. The minimum spanning tree represents the minimum connected subgraph of the preprocessed soil monitoring data in the comprehensive metric space. Based on the edge weight set of the minimum spanning tree, a piecewise regression algorithm is used to determine the maximum reachable distance and minimum number of samples of the OPTICS clustering parameter. The edge weight set is sorted in ascending order, and the mutation point of the weight distribution is obtained through the piecewise regression algorithm. The edge weight corresponding to the mutation point is used as the maximum reachable distance of the parameter, and the number of edges before the mutation point is used as the minimum number of samples of the parameter. The comprehensive metric matrix was used as the input of OPTICS clustering. Based on the determined maximum reachable distance of the parameter and the minimum number of samples of the parameter, the soil monitoring data were grouped using density connection to obtain preliminary classification results. The preliminary classification results are merged, the average metric value between the dynamic monitoring data is calculated, and the dynamic monitoring data sets with average metric values greater than the set value are merged to obtain the final dynamic monitoring data set division result.
6. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 5, characterized in that: The method of using density connection to group soil monitoring data includes: If the number of data points within the maximum reachable distance neighborhood of any soil monitoring data point is greater than or equal to the minimum number of parameter samples, the corresponding soil monitoring data point will be marked as a hub point, and all soil monitoring data points within the maximum reachable distance neighborhood of the hub point will be grouped into the same group; If any soil monitoring data point is not a hub point, but there is a hub point within the maximum reachable distance neighborhood of the corresponding soil monitoring data point, the corresponding soil monitoring data point will be marked as an auxiliary point and the corresponding soil monitoring data point will be assigned to the corresponding group; If any soil monitoring data point is neither a hub point nor a subsidiary point, the corresponding soil monitoring data point will be marked as an outlier and will not be included in any group.
7. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to any one of claims 1 to 6, characterized in that: Build an initial prediction model, including: The soil attribute information of the dynamic monitoring dataset is extracted as time nodes, and the attribute features of the time nodes are used as the node feature matrix; the time nodes and the node feature matrix are used as the input nodes of the temporal convolutional network; Adopting the temporal attention layer, the attention weight tensor between time nodes is calculated through the attention mechanism; the feature representation of the time node is updated according to the attention weight tensor; A multi-head temporal attention mechanism is used to parallelly calculate the attention weight tensor of the time node through multiple independent temporal attention layers, and the outputs of different temporal attention layers are stacked as the output of the multi-head temporal attention; According to the output of multi-head temporal attention, the feature representation of the time node is pooled through the temporal pooling layer to obtain the high-dimensional feature representation of the time node; According to the high-dimensional feature representation of the time node, the time node is mapped from the high-dimensional feature space to the low-dimensional embedding space through the dimensionality reduction layer to obtain the embedding matrix representation of the time node; According to the embedding matrix representation of the time nodes, the cosine similarity between the embedding matrices of the time nodes is calculated to build the connection between the time nodes and obtain the initial prediction model; The transaction mechanism of the distributed database is used to perform version marking and checksum calculation on the constructed initial prediction model. The version marking and checksum of the initial prediction model are agreed upon in the distributed database through the cross-validation mechanism, and the initial prediction model is stored in the distributed database as a version.
8. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 7, characterized in that: Construct a soil dynamic prediction model, including: The prediction model of the climate factor node is used as input. The local temporal features of the climate factor node are extracted through the spatiotemporal fusion network. The global spatial correlation features between the climate factor nodes are obtained through the spatial attention mechanism. The local temporal features and the global spatial correlation features are coupled to obtain the comprehensive feature tensor of the climate factor node. Among them, the local temporal features represent the temporal evolution information of the climate factor node in the prediction model, and the global spatial correlation features represent the spatial distribution effect of the climate factor node in the prediction model. A variational autoencoder structure is used, taking the comprehensive feature tensor of the climate factor node as input. The encoder maps the comprehensive feature tensor to a low-dimensional latent space to obtain the latent vector representation of the climate factor node. The decoder reconstructs the latent vector representation into the original comprehensive feature tensor. The original comprehensive feature tensor is used to optimize the encoder parameters. In a low-dimensional latent space, a spectral clustering algorithm is used to cluster the latent vector representations of climate factor nodes. By minimizing the difference between the latent vector and the cluster centroid while maximizing the separation between different clusters, the optimal clustering division of climate factor nodes is obtained. The potential representation and clustering of climate factor nodes are used as prediction data. The checksum of the prediction data is calculated in parallel across multiple replicas in a distributed database. The checksums calculated from different replicas are compared and arbitrated using a cross-validation mechanism. The checksum corresponding to the replica with the most arbitration results is selected as the final consistency checksum. A soil dynamic prediction model is constructed based on consistency verification and corresponding cluster division. The nodes in the soil dynamic prediction model represent the clusters corresponding to the climate factor nodes. The attributes of the nodes include the centroid coordinates of the clusters and the standard deviation of the nodes within the clusters. The connections between the nodes represent the dynamic association relationships between different clusters, and the weights of the connections represent the frequency and intensity of the dynamic associations.
9. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 8, characterized in that: The spatiotemporal fusion network includes a temporal branch and a spatial branch. The temporal branch uses an expanded convolution layer to extract multi-scale temporal features, and the spatial branch uses a graph convolution layer to extract multi-scale spatial features. The outputs of the temporal branch and the spatial branch are dynamically weighted fused through a gated fusion mechanism.
10. The method for dynamic prediction of soil carbon and nitrogen content based on deep learning according to claim 9, characterized in that: The gated fusion mechanism generates temporal weights and spatial weights by calculating the feature importance scores of the temporal branch and the spatial branch outputs, and performs weighted summation on the outputs of the two branches according to the weights to form a fused comprehensive feature tensor.
Citation Information
Cited By
Spatial local XGBoost machine learning model based on multi-scale geographic weighting
CN121051606A
Method and equipment for accurately identifying runoff production characteristics of watershed
CN121117657A
Marine fine-grained soil content prediction method based on multi-source CPTU data and machine learning
CN121148511A
Soil environment background content statistical method and system based on multi-source data fusion
CN121388979A
A soil environment background content statistical method and system based on multi-source data fusion
CN121388979B
