A method and device for calculating spatially non-stationary soil moisture

By combining geographic map attention network and weighted regression formula, a spatial heterogeneous weighted prediction model was constructed, which solves the problem that spatial heterogeneity was not considered in soil moisture calculation, and achieves higher accuracy and wider applicability of soil moisture calculation.

CN119827740BActive Publication Date: 2025-12-05BEIJING INST OF ENVIRONMENTAL FEATURES
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411883723.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-12-05
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

Existing methods for calculating soil moisture fail to effectively account for the spatial heterogeneity of soil moisture, resulting in low calculation accuracy and poor versatility.

Method used

A spatial heterogeneous weighted prediction model for sites was constructed using a geographic graph attention network. Combined with a weighted regression formula, soil moisture was calculated by training the model and inputting the spatial-attribute information of the target site.

Benefits of technology

It improves the accuracy and versatility of soil moisture calculation, enabling it to more accurately capture complex nonlinear relationships between multiple points and flexibly handle different numbers of spatial points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119827740B_ABST
    Figure CN119827740B_ABST
Patent Text Reader

Abstract

The application discloses a kind of space non-stationary soil humidity calculation method and device.Method includes: based on geographic map attention network, construct site spatial heterogeneity weight prediction model;Prediction model with the spatial-attribute information of site and the spatial adjacency matrix between each site as input, with the spatial heterogeneity weight matrix of each site as output;Weighted regression formula is constructed, and regression formula is used to calculate the soil humidity of site based on the spatial heterogeneity weight matrix output by prediction model;Based on the dataset and regression formula constructed in advance, the prediction model is trained to obtain the trained prediction model;Dataset includes the real soil humidity and spatial-attribute information of site;The spatial-attribute information of target site is input into the trained prediction model, and the spatial heterogeneity weight matrix of target site is obtained;The spatial heterogeneity weight matrix of target site is brought into regression formula, and the soil humidity of target site is obtained.The application can improve the calculation precision of soil humidity, and has strong versatility.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of soil moisture calculation, and particularly relates to a method and device for calculating spatial non-stationary soil moisture. BACKGROUND

[0002] Since soil moisture information can be used in the fields of drought, flood and forest fire prediction and monitoring, etc., it is of great significance to accurately calculate soil moisture information. However, due to the influence of factors such as climate conditions, soil depth, regional and seasonal changes, soil moisture presents significant spatial heterogeneity, which means that the distribution of soil moisture in space is obviously different, and this is a factor that cannot be ignored in soil moisture calculation.

[0003] At present, the existing soil moisture calculation method mainly focuses on the driving factor research of soil moisture in different places, and ignores the spatial heterogeneity of soil moisture, that is, less attention is paid to the non-stationarity of space. Therefore, the existing soil moisture calculation method has poor universality and low calculation accuracy.

[0004] Therefore, there is an urgent need for a method and device for calculating spatial non-stationary soil moisture to solve the above problems. SUMMARY

[0005] The present application provides a method and device for calculating spatial non-stationary soil moisture, which can improve the calculation accuracy of soil moisture and has strong universality. The technical solution is as follows:

[0006] In a first aspect, a method for calculating spatial non-stationary soil moisture is provided, which comprises:

[0007] Based on a geographical graph attention network, a station spatial heterogeneity weight prediction model is constructed; the prediction model takes the spatial-attribute information of the station and the spatial adjacency matrix between stations as input, and takes the spatial heterogeneity weight matrix of each station as output; the spatial-attribute information includes the latitude and longitude coordinates of the station and the main parameters related to soil moisture, and the main parameters include dew point temperature, relative humidity, precipitation and dryness ratio; each weight in the spatial heterogeneity weight matrix corresponds to a main parameter;

[0008] A weighted regression formula is constructed, which is used to calculate the soil moisture of the station based on the spatial heterogeneity weight matrix output by the prediction model;

[0009] Based on the pre-constructed data set and the regression formula, the prediction model is trained to obtain a trained prediction model; the data set includes the real soil moisture and spatial-attribute information of a plurality of known stations;

[0010] inputting the spatial-attribute information of a target station into the trained prediction model to obtain a spatial heterogeneity weight matrix of the target station;

[0011] bringing the calculated spatial heterogeneity weight matrix of the target station into the regression formula to calculate soil moisture of the target station.

[0012] In a second aspect, a device for calculating spatial non-stationary soil moisture is provided, and the device comprises:

[0013] a first construction unit configured to construct a station spatial heterogeneity weight prediction model based on a geographical graph attention network, wherein the prediction model takes spatial-attribute information of stations and a spatial adjacency matrix between stations as input, and outputs a spatial heterogeneity weight matrix of the stations, wherein the spatial-attribute information comprises longitude and latitude coordinates of the stations and main parameters related to soil moisture, and the main parameters comprise dew point temperature, relative humidity, precipitation and dryness ratio, and each weight in the spatial heterogeneity weight matrix corresponds to a main parameter;

[0014] a second construction unit configured to construct a weighted regression formula for calculating soil moisture of stations based on the spatial heterogeneity weight matrix output by the prediction model;

[0015] a training unit configured to train the prediction model based on a pre-constructed data set and the regression formula to obtain a trained prediction model, wherein the data set comprises real soil moisture and spatial-attribute information of a plurality of known stations;

[0016] an input unit configured to input spatial-attribute information of a target station into the trained prediction model to obtain a spatial heterogeneity weight matrix of the target station;

[0017] a calculation unit configured to bring the calculated spatial heterogeneity weight matrix of the target station into the regression formula to calculate soil moisture of the target station.

[0018] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in any of the embodiments.

[0019] In a fourth aspect, a computer readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the method for calculating spatial non-stationary soil moisture.

[0020] In a fifth aspect, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the above-mentioned method for calculating spatially non-stationary soil moisture.

[0021] The embodiment of the present application provides a method for calculating spatially non-stationary soil moisture. A spatial heterogeneity weight prediction model is constructed through a geographic graph attention network, and a weighted regression formula is used, so that the complex nonlinear relationship between multiple points can be captured in parallel, and the method of inductive learning can be used to flexibly process different numbers of spatial points, thereby overcoming the limitation that the model for calculating soil moisture needs a fixed number of spatial points, so that the model has a certain degree of universality, and the accuracy of soil moisture calculation is improved. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0023] Figure 1 is a flow chart of a method for calculating spatially non-stationary soil moisture provided by an embodiment of the present application;

[0024] Figure 2 is a structural diagram of a device for calculating spatially non-stationary soil moisture provided by an embodiment of the present application;

[0025] Figure 3 is a hardware architecture diagram of a computer device provided by an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of a solution process of the model provided by an embodiment of the present application;

[0027] Figures 5 to 10 are MAE scatter diagrams of the OLR model, the GWR-AFG model, the GWR-AAB model, the GNNWR-S model, the GNNWR-SA model and the GGATWR model of the present application, respectively;

[0028] Figures 11 to 16 are regression performance comparison diagrams between true values and predicted values of the OLR model, the GWR-AFG model, the GWR-AAB model, the GNNWR-S model, the GNNWR-SA model and the GGATWR model of the present application, respectively;

[0029] Figure 17 and Figure 18MSE and R of the GGATWR model of the present application on the training set and the validation set, respectively 2 Comparison chart of evaluation indexes. DETAILED DESCRIPTION

[0030] To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work belong to the protection scope of the present application.

[0031] The specific implementation of the above concept will be described below.

[0032] Please refer to Figure 1 The method comprises the following steps:

[0033] In step 100, a station spatial heterogeneity weight prediction model is constructed based on a geographic graph attention network. The prediction model takes spatial-attribute information of stations and a spatial adjacency matrix between stations as inputs, and takes a spatial heterogeneity weight matrix of the stations as output. The spatial-attribute information includes latitude and longitude coordinates of the stations and main parameters related to soil humidity, and the main parameters include dew point temperature, relative humidity, precipitation and dryness ratio. Each weight in the spatial heterogeneity weight matrix corresponds to a main parameter.

[0034] In step 102, a weighted regression formula is constructed. The regression formula is used to calculate soil humidity of the stations based on the spatial heterogeneity weight matrix output by the prediction model.

[0035] In step 104, the prediction model is trained based on a pre-constructed dataset and the regression formula to obtain a trained prediction model. The dataset includes real soil humidity and spatial-attribute information of a plurality of known stations.

[0036] In step 106, spatial-attribute information of a target station is input into the trained prediction model to obtain a spatial heterogeneity weight matrix of the target station.

[0037] In step 108, the calculated spatial heterogeneity weight matrix of the target station is input into the regression formula to calculate soil humidity of the target station.

[0038] In this embodiment, the spatial heterogeneity weight prediction model is constructed by the geographic graph attention network, and the weighted regression formula is adopted, which can not only capture the complex nonlinear relationship between multiple points in parallel, but also use the inductive learning method to flexibly process different number of spatial points, overcoming the limitation of the previous model that requires a fixed number of spatial points in soil moisture calculation, thereby making the model have a certain degree of universality and improving the accuracy of soil moisture calculation.

[0039] The execution of each step is described below. Figure 1 The execution of each step is described below.

[0040] First, for step 100, a station spatial heterogeneity weight prediction model is constructed based on a geographic graph attention network.

[0041] In this step, first, a spatial graph composed of N stations in the study area is given, and the node set is denoted as {P1, P2, …, P N}. The model is composed of multiple graph attention layers, and the purpose of the model is to encode the spatial-attribute features of each station into a high-dimensional embedding representation, and use the high-dimensional embedding as the output of the prediction model, which is used to represent the spatial heterogeneity weight of each station.

[0042] For all stations in the graph, in the case of stacking multiple graph attention layers, the formula of each layer l can be expressed as follows:

[0043]

[0044] α ij =sofxmax j (e ij ) (2)

[0045]

[0046] In the formula, e ij is the attention coefficient of station i and station j calculated based on the attention mechanism; is the weight matrix for performing linear transformation; and are the feature vectors of stations i and j, respectively; is a single-layer feedforward neural network; || represents vector splicing; LeakyReLU is a nonlinear activation function; α ij is the normalized attention coefficient of e ij using the softmax function; i = 1, 2 … … N; j = 1, 2 … … M, N is the total number of stations; M represents the total number of adjacent stations of station i; k represents the number of heads, k = 1, 2 … … K, K is the total number of heads; is the linear transformation weight matrix of the kth "head"; is the normalized attention coefficient of the kth "head", which measures the contribution of the jth site pair in the kth "head" to the site i in the adjacent network; represents the spatial feature of site i output by the lth attention layer, l = 1, 2, …, L, L is the total number of graph attention layers, and for the Lth layer, the output is the spatial feature of site i. GAT represents a graph attention network.

[0047] In some embodiments, the spatial adjacency matrix between each site is determined based on the spatial distance between each site, and the calculation formula is as follows:

[0048]

[0049] In the formula, A ij is the adjacency matrix between site i and site j; d ij is the spatial distance between site i and site j; and δ is a threshold value for controlling the sparsity of the adjacency matrix A.

[0050] In this step, the threshold value δ is empirically set to 0.2, which is not limited in the present application. When d ij is less than or equal to the threshold value δ, it indicates that the relationship between the two points is weak, and it is considered that there is no connectivity between the two sites. After defining the node features and the connectivity between adjacent nodes, the feature propagation process of the spatial heterogeneity weight prediction model can be written as follows:

[0051] W GAT = V GAT = GAT(A, P; θ) (5)

[0052] In the formula, represents the spatial heterogeneity weight of the q influencing factors in all N sites, P ∈ R N×d represents the spatial-attribute feature of all sites, d is the dimension of the spatial-attribute feature, A is the spatial adjacency matrix of the graph, and θ is the parameter set of the graph attention network in the prediction model. Through formula (3), the conversion from the spatial-attribute feature to the high-dimensional hidden feature vector (R N×d → R N×q ) can be realized, that is, the output is the spatial heterogeneity weight, and the input d-dimensional vector is converted into a q-dimensional vector.

[0053] It should be noted that the spatial heterogeneity weight of each site is a matrix, and the dimension of the matrix is equal to the number of main parameters after dimension reduction. Each weight in the spatial heterogeneity weight matrix corresponds to a main parameter. For example, the main parameters are dew point temperature, relative humidity, precipitation, and dryness ratio, and each parameter corresponds to a weight. Four weights form a spatial heterogeneity weight matrix.

[0054] For step 102, the weighted regression formula is:

[0055]

[0056] wherein, is the soil moisture of the i-th station; is the regression coefficient of the i-th station and the regression coefficient corresponds to the spatial heterogeneity weight, (s i ,a i represents the spatial-attribute feature of the i-th station, wherein s i is the spatial location feature vector of the i-th station; a i is the spatial-related attribute feature vector of the i-th station; x ih is the h-th main parameter of the i-th station; h = 1, 2, …, q, q is the total number of main parameters; is the regression coefficient of the h-th main parameter; is the spatial heterogeneity weight constant of the i-th station; is the regression coefficient constant; ε i is the error coefficient of the i-th station.

[0057] This step, on the basis of the prediction model, first takes the spatial-attribute feature of each station as input, encodes it into an embedded representation through a graph attention layer, and then takes it as output, wherein each spatial heterogeneity weight w i of the output layer corresponds to each independent variable x i . Subsequently, the spatial heterogeneity weight is multiplied by the pre-calculated OLS regression coefficient to obtain the local non-stationary coefficient. The final output of the soil moisture is the result of multiplying the local non-stationary coefficient with the corresponding independent variable.

[0058] For step 104, based on the pre-constructed data set and the regression formula, the prediction model is trained to obtain the trained prediction model, including:

[0059] S1, extracting the real soil moisture and spatial-attribute information of each station in the data set, and normalizing the extracted information to obtain normalized data; dividing the normalized data into a training set, a validation set, and a test set according to a predetermined proportion;

[0060] S2, generating a spatial adjacency matrix between stations based on the spatial distance between stations;

[0061] S3, setting the hyperparameters of the prediction model, including the maximum number of iterations, the initial learning rate, and the hidden layer parameters; using a predetermined loss function, supervising the determination coefficient R 2 , the root mean square error RMSE, the mean absolute error MAE, and the mean absolute percentage error MAPE of the model, and executing S4;

[0062] S4, using the spatial-attribute information of each site in the training set and the spatial adjacency matrix between sites as input, using the Adadelta optimizer, training the training set by gradient descent and back propagation algorithm, and performing S5;

[0063] S5, at the end of each epoch, based on the spatial heterogeneity weight matrix output by the prediction model, using a regression formula to calculate the predicted soil moisture of each site, and based on the predicted soil moisture and the true soil moisture of each site, using a loss function to calculate the loss index of the training set and the validation set, and determining whether the loss function of the training set is decreased or the determination index of the validation set is overfitting; if the loss function is not decreased or the determination index is overfitting, proceed to the next round of training;

[0064] S6, repeat step S5 until the maximum number of iterations is reached, and determine whether the training index is better than the index of the last round of training, if so, record the optimal parameters of the current model, and perform S7;

[0065] S7, using the trained model to calculate and verify the generalization ability of the model on the test set, ending the training process of the model, and obtaining the trained prediction model.

[0066] In this step, the input of the model has three categories: the spatial-attribute characteristics of site i (s i ,a i ), the q independent variables related to soil moisture considered by site i (x i1 ,x i2 ,…,x iq ) and the soil moisture SM i of site i, all data are processed by standard normalization method to ensure the stability of the data.

[0067] In some embodiments, the loss function is:

[0068]

[0069] In the formula, i represents the ith site, i = 1, 2, …, N; SM i is the true soil moisture of the ith site; is the predicted soil moisture of the ith site.

[0070] In this step, the mean square error (MSE) is used as the loss function to update the parameters of the model by back propagation until The experiment continued until convergence. Simultaneously, in each training epoch, a validation set was used to determine if the model was overfitting. It is worth noting that because the prediction model in this application employs an inductive learning method, the number and location of stations in the dataset are variable, thus enabling the acquisition of spatially heterogeneous weights for any unseen stations, giving the model a certain degree of generality.

[0071] For steps 106 and 108, the soil moisture prediction process is as follows: Figure 4 As shown, the spatial-attribute information of the target site is input into the prediction model to obtain the spatial heterogeneous weight matrix of the target site; by substituting this spatial heterogeneous weight matrix into the regression formula, the soil moisture of the target site can be calculated.

[0072] To verify the effectiveness of the method in this application, the inventors used a dataset to test the model in this application (denoted as the GGATWR model) against several existing methods.

[0073] First, regarding the model comparison methods, the experiment initially used the classic Geographically Weighted Regression (GWR) model. Based on the kernel function type and bandwidth selection method, a Fixed-bandwidth Gaussian kernel and an Adaptive Bi-square kernel were chosen, with AICc used for both bandwidth optimization criteria. These are denoted as the GWR-AFG model and the GWR-AAB model, respectively. Furthermore, the experiment also selected the Geographically Neural Network Weighted Regression (GNNWR) model, which incorporates a neural network algorithm into the GWR model. Spatial proximity relationships are represented using spatial distance. To compare with the spatial-attribute features used in this application as model input, spatial-attribute distance was also introduced to represent spatial proximity relationships, denoted as the GNNWR-S model and the GNNWR-SA model. Finally, the OLR model was used as the baseline model.

[0074] In summary, the model in this application is compared with the OLR model, GWR-AFG model, GWR-AAB model, GNNWR-S model and GNNWR-SA model respectively.

[0075] Second, in terms of experimental environment configuration, all models were implemented in Python 3.9 and PyTorch 1.12.0 and trained on an Nvidia GeForce RTX 4090 GPU with 24GB of video memory.

[0076] Third, in order to better evaluate the soil moisture estimation effect of each model and analyze the spatial distribution rule of its estimation error, the present application selects a data set composed of 559 simulated ground base sites to compare each model, and divides the spatial graph data set into a training set (392), a verification set (120) and a test set (47) according to the ratio of 0.7:0.2:0.1 at random.

[0077] Under the above settings, the inventors use each model to predict the soil moisture, and the spatial distribution of the MAE error value obtained is as shown in Figures 5 to 10 From the figure, it can be seen that the error value of the OLR model is the highest, indicating that it has significant shortcomings in dealing with spatial heterogeneity, resulting in weak estimation ability of soil moisture. In contrast, the GWR model (GWR-AFG and GWR-AAB) significantly reduces the error value by introducing the idea of geographical weighting, especially the GWR-AAB model, which shows stronger spatial fitting ability and can better capture the spatial variation of soil moisture. The GNNWR model (GNNWR-S and GNNWR-SA) further introduced the neural network has greater improvement in error value, showing its advantage in dealing with complex nonlinear relationship. In particular, the GNNWR-SA model further improves the prediction accuracy of the model by combining spatial and attribute features.

[0078] In addition, in almost all site performances, the model (GGATWR model) of the present application is superior to the remaining models, with the lowest error value, indicating that the model of the present application has significant advantages in capturing spatial non-stationarity and complex nonlinear characteristics. The present application model can more finely depict the spatial distribution of soil moisture by introducing the graph neural network, providing more accurate estimation results.

[0079] In order to more specifically reflect the regression performance of the model (GGATWR model) of the present application, the inventors compare the regression performance of the model of the present application with that of the remaining five models, and the results are as shown in Figures 11 to 16 .

[0080] From the figure, it can be seen that the fitting effect of soil moisture gradually improves with the complexity of the model, and the remaining five models all show obvious advantages compared with the simple OLR model. Specifically, the R 2 of the OLR model is only 0.20, indicating that its data explanation ability is weak. In contrast, GWR-AFG and GWR-AAB show good fitting ability in R 2 , RMSE and MAPE, etc. Especially, the R 20.55, indicating that it has certain advantages in capturing local changes in data after introducing spatial geographic location information. Further, GNNWR-S, GNNWR-SA and GGATWR show stronger fitting ability, with R 2 up to 0.79, and RMSE reduced to 0.0072, indicating that they have excellent fitting and prediction ability with the help of neural networks. In terms of overall performance, the fitting effect of all models on low values is generally better than that on high values, but the fitting effect of the GGATWR model on high values is relatively good.

[0081] Overall, the geographically weighted regression model with neural networks performs better in capturing spatial heterogeneity in data and can more accurately reflect the spatial trend of true values.

[0082] In order to further reflect the performance of each model on the three data sets, the comparison of each evaluation index of OLR, GWR-AFG, GWR-AAB, GNNWR-S, GNNWR-SA and GGATWR models on the soil moisture data set is shown in Table 2.

[0083] Table 2 Results of OLR, GWR-AFG, GWR-AAB, GNNWR-S, GNNWR-SA and GGATWR models on data sets

[0084]

[0085] As can be seen from Table 2, the GGATWR model proposed in the application is superior to the other five models in all indicators, verifying its significant advantages in fitting ability and generalization ability. Specifically, the overall performance of the OLR model is weak, with R 2 only 0.20, although the low RMSE and MAPE prove that the prediction deviation is small, but the explanation ability is limited. The training set, validation set and test set show similar performance, which may have underfitting problem. GWR-AFG and GWR-AAB show obvious improvement, R 2 respectively increased to 0.49 and 0.55, and the prediction accuracy is also improved accordingly. These two models show relatively stable performance on each data set, showing good generalization ability. GNNWR-S and GNNWR-SA further improve the performance, R 2 respectively reached 0.72 and 0.74, and RMSE and MAPE were significantly reduced. Finally, the GGATWR model of the application shows the best performance, R 2 up to 0.79, and RMSE and MAPE also reached the minimum.

[0086] As can be seen, the model of the application has obvious advantages and can significantly improve the prediction accuracy of soil moisture.

[0087] In addition, the model of the application adopts a multi-layer multi-head graph attention network, and the hyperparameter settings are shown in Table 1.

[0088] Table 1 Structure and hyperparameters of the model of the application

[0089]

[0090] As can be seen from the table, the input dimension of the model of the application is 6, which is longitude, latitude, precipitation, relative humidity, dew point temperature and dryness ratio; the output dimension is 4, which is the spatial heterogeneity weight of precipitation, relative humidity, dew point temperature and dryness ratio. In order to improve the computing power of the model of the application, the model adopts a double-layer attention network structure with double-layer stacking and two "heads", and the initial learning rate is set to 0.05, the maximum iteration number is 400, and the loss ratio of the Dropout layer is 0.2.

[0091] The inventors compared the changes of the key indicators MSE and R 2 on the training set and the validation set with the iteration of epoch, and the comparison results are shown in Figures 1 and 2 respectively. Figure 17 and Figure 18 .

[0092] As can be seen from the figures, the MSE value of the training set is generally in a downward trend, and the MSE value of the validation set is basically in a flat state after the iteration number of epoch is 300. It can be known from the change of R 2 , the change of R 2 on the training set is generally in an upward trend, and the change after the iteration number of epoch is 300 on the validation set also tends to be flat. Therefore, neither the MSE nor the R 2 on the validation set has appeared overfitting with the indicators rising, and under the condition of the optimal parameters obtained by debugging, setting the epoch to 400 can basically fully train the model.

[0093] Therefore, the model of the application has good prediction effect by using the above parameters, of course, the user can also use other parameters, which are not limited in the application.

[0094] As shown in Figure 2 , Figure 3 , the embodiment of the application provides a kind of spatial non-stationary soil humidity calculation device. Device embodiment can be realized by software, also can be realized by hardware or software and hardware combined mode. From the hardware layer, as shown in Figure 2 , it is the hardware architecture diagram of the computing device of the spatial non-stationary soil humidity calculation device provided by the embodiment of the application, in addition to Figure 2In addition to the processor, memory, network interface, and non-volatile memory shown, a computing device in which the apparatus of embodiments is typically also includes other hardware, such as forwarding chips responsible for processing packets, and so on. For example, in software implementations, the apparatus is formed by the CPU of the computing device in which it is located reading the corresponding computer program in the non-volatile memory into the memory and running it. Figure 3 As shown, as a logical sense apparatus, it is formed by the CPU of the computing device in which it is located reading the corresponding computer program in the non-volatile memory into the memory and running it.

[0095] Please refer to Figure 3 The embodiment of the present application provides a kind of spatial non-stationary soil humidity computing device, and the device includes:

[0096] First construction unit 300, for constructing site spatial heterogeneity weight prediction model based on geographic graph attention network;Prediction model takes the spatial-attribute information of site and the spatial adjacency matrix between each site as input, and takes the spatial heterogeneity weight matrix of each site as output;Spatial-attribute information includes the longitude and latitude coordinates of site and the main parameters related to soil humidity, and the main parameters include dew point temperature, relative humidity, precipitation and dry ratio;Each weight in spatial heterogeneity weight matrix corresponds to a main parameter respectively;

[0097] Second construction unit 302, for constructing weighted regression formula, and regression formula is used to calculate the soil humidity of site based on the spatial heterogeneity weight matrix output by prediction model;

[0098] Training unit 304, for training prediction model based on pre-constructed data set and regression formula, to obtain trained prediction model;Data set includes the real soil humidity and spatial-attribute information of multiple known sites;

[0099] Input unit 306, for inputting the spatial-attribute information of target site into trained prediction model, to obtain the spatial heterogeneity weight matrix of target site;

[0100] Calculation unit 308, for bringing the calculated spatial heterogeneity weight matrix of target site into regression formula, to calculate the soil humidity of target site.

[0101] In some embodiments, the prediction model is composed of a plurality of sequentially stacked graph attention layers, and each graph attention layer adopts the following calculation formula:

[0102]

[0103] α ij =sofxmax j (e ij )

[0104]

[0105] where e ij is the attention coefficient of site i and site j calculated based on the attention mechanism; is the weight matrix for performing linear transformation; and are the feature vectors of sites i and j, respectively; is a single-layer feedforward neural network; || represents vector splicing; LeakyReLU is a nonlinear activation function; a ij is the attention coefficient of site i and site j calculated based on the attention mechanism; ij is the normalized attention coefficient; i = 1, 2…N; j = 1, 2…M, N is the total number of sites; M represents the total number of adjacent sites of site i; k represents the number of heads, k = 1, 2…K, K is the total number of heads; is the linear transformation weight matrix of the kth "head"; is the normalized attention coefficient of the kth "head", which is used to measure the contribution of the jth site in the kth "head" to site i in the adjacent network; represents the spatial feature of site i output by the lth attention layer, l = 1, 2…L, L is the total number of graph attention layers, and for the Lth layer, the output is the spatial feature of site i; the spatial heterogeneity weight matrix, GAT represents a graph attention network.

[0106] In some embodiments, the spatial adjacency matrix between sites is determined based on the spatial distance between sites, and the calculation formula is as follows:

[0107]

[0108] where A ij is the adjacency matrix between site i and site j; d ij is the spatial distance between site i and site j; δ is a threshold for controlling the sparsity of the adjacency matrix A; i = 1, 2…N; j = 1, 2…N.

[0109] In some embodiments, the weighted regression formula is:

[0110]

[0111] where, is the soil moisture of the ith site; is the soil moisture of the ith site corresponding to the regression coefficient is the corresponding spatial heterogeneity weight, (s i , a i ) represents the spatial-attribute feature of the ith site, where s i is the spatial position feature vector of the ith site; a iis the spatial attribute feature vector of the i th site; x ih is the h th main parameter of the i th site; h = 1, 2, …, q, q is the total number of main parameters; is the regression coefficient of the h th main parameter; is the spatial heterogeneity weight constant of the i th site; is the regression coefficient constant; ε i is the error coefficient of the i th site.

[0112] In some embodiments, the training unit 304 is configured to perform the following operations:

[0113] S1, extracting the real soil moisture and spatial-attribute information of each site in the data set, and normalizing the extracted information to obtain normalized data; dividing the normalized data into a training set, a validation set and a test set according to a preset ratio;

[0114] S2, generating a spatial adjacency matrix between sites based on the spatial distance between sites;

[0115] S3, setting the hyperparameters of the prediction model, including the maximum number of iterations, the initial learning rate, and the hidden layer parameters; using a preset loss function, and supervising the determination coefficient, the root mean square error, the mean absolute error and the mean absolute percentage error of the model, and performing S4;

[0116] S4, using the spatial-attribute information of each site in the training set and the spatial adjacency matrix between sites as input, using the Adadelta optimizer, and training the training set by the gradient descent method and the back propagation algorithm, and performing S5;

[0117] S5, based on the spatial heterogeneity weight matrix output by the prediction model at the end of each epoch, calculating the predicted soil moisture of each site using a regression formula, and based on the predicted soil moisture and the real soil moisture of each site, calculating the loss indicators of the training set and the validation set using the loss function, and determining whether the loss function of the training set is decreased or the determination indicators of the validation set are over-fitted; if the loss function is not decreased or the determination indicators are over-fitted, adjusting the learning rate or reconstructing the model parameters, and performing the next round of training;

[0118] S6, repeating step S5 until the maximum number of iterations is reached, and determining whether the training indicators are better than the indicators of the last round of training, if so, recording the optimal parameters of the current model, and performing S7;

[0119] S7, using the trained model to calculate and verify the generalization ability of the model on the test set, ending the training process of the model, and obtaining the trained prediction model.

[0120] In some embodiments, the loss function is:

[0121]

[0122] wherein, i represents the i th station point, i = 1, 2, …, N; SM i is the real soil moisture of the i th station point; is the predicted soil moisture of the i th station point.

[0123] It should be noted that the above-mentioned embodiment provides a spatial non-stationary soil moisture calculation device, which is only exemplified by the division of the above-mentioned functional modules. In actual application, the above-mentioned functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the spatial non-stationary soil moisture calculation device provided by the above-mentioned embodiment and the spatial non-stationary soil moisture calculation method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0124] The embodiment of the present application also provides a computer device, which refers to Figure 3 The computer device includes a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set. The at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to realize the spatial non-stationary soil moisture calculation method provided by each method embodiment.

[0125] The embodiment of the present application also provides a computer readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set. The at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to realize the spatial non-stationary soil moisture calculation method provided by each method embodiment.

[0126] The embodiment of the present application also provides a computer program product, which includes a computer program. The processor of the computer device reads the computer program from the computer readable storage medium. The processor executes the computer program, so that the computer device executes the spatial non-stationary soil moisture calculation method described in any of the above-mentioned embodiments.

[0127] For the convenience of description, the above system or device is described as various modules or units respectively described in function. Of course, in the implementation of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0128] Those skilled in the art can clearly understand the application by the description of the above embodiments. The technical solutions of the application can be implemented by means of software and necessary universal hardware platforms. Based on such an understanding, the technical solutions of the application can be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the application.

[0129] Finally, it should be noted that the terms such as first, second, third, and fourth, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0130] The above description is only the preferred embodiments of the application, and it should be pointed out that those skilled in the art can make some improvements and refinements without departing from the principles of the application, and these improvements and refinements should also be regarded as the protection scope of the application.

Claims

1. A method of calculating spatially non-stationary soil moisture, characterized by, The method comprises: a site spatial heterogeneity weight prediction model is constructed based on a geographical graph attention network; the prediction model takes spatial-attribute information of sites and a spatial adjacency matrix between sites as inputs, and takes a spatial heterogeneity weight matrix of the sites as output; the spatial-attribute information comprises longitude and latitude coordinates of the sites and main parameters related to soil humidity, the main parameters comprising dew point temperature, relative humidity, precipitation and dryness ratio; each weight in the spatial heterogeneity weight matrix corresponds to a main parameter; a weighted regression formula is constructed, which is used to calculate soil humidity of sites based on the spatial heterogeneity weight matrix output by the prediction model; the prediction model is trained based on a pre-constructed dataset and the regression formula to obtain a trained prediction model; the dataset comprises real soil humidity and spatial-attribute information of multiple known sites; spatial-attribute information of a target site is input into the trained prediction model to obtain a spatial heterogeneity weight matrix of the target site; the calculated spatial heterogeneity weight matrix of the target site is brought into the regression formula to calculate soil humidity of the target site.

2. The method of claim 1, wherein, The prediction model is composed of multiple graph attention layers stacked in sequence, and each graph attention layer adopts the following calculation formula: where e ij is the attention coefficient of site i and site j calculated based on the attention mechanism; is the weight matrix for performing linear transformation; and are the feature vectors of sites i and j respectively; is a single-layer feedforward neural network; || represents vector splicing; LeakyReLU is a nonlinear activation function; a ij is the normalized attention coefficient of e ij ; i = 1, 2 …… N; j = 1, 2 …… M, N is the total number of sites; M represents the total number of adjacent sites of site i; k represents the kth head, k = 1, 2 …… K, K is the total number of heads; is the linear transformation weight matrix of the kth "head"; is the normalized attention coefficient of the kth "head", which is used to measure the contribution of the jth site in the kth "head" to site i in the adjacent network; represents the spatial feature of site i output by the lth attention layer, l = 1, 2 …… L, L is the total number of graph attention layers, and for the Lth layer, the output is the spatial feature of site i; spatial heterogeneity weight matrix, GAT represents a graph attention network.

3. The method of claim 1, wherein, The spatial adjacency matrix between sites is determined based on spatial distances between the sites, and the calculation formula is as follows: wherein A ij is the adjacency matrix between site i and site j; d ij is the spatial distance between site i and site j; δ is the threshold value to control the sparsity of the adjacency matrix A; i = 1, 2, …, N; j = 1, 2, …, N.

4. The method of claim 2, wherein, The weighted regression formula is as follows: wherein, is the soil moisture of the i-th site; is the regression coefficient of the i-th site; is the spatial heterogeneity weight of the i-th site, i , a i represents the spatial-attribute feature of the i-th site, wherein s i is the spatial location feature vector of the i-th site; a i is the spatial-related attribute feature vector of the i-th site; x ih is the h-th main parameter of the i-th site; h = 1, 2, …, q, q is the total number of main parameters; is the regression coefficient of the h-th main parameter; is the spatial heterogeneity weight constant of the i-th site; is the regression coefficient constant; ε i is the error coefficient of the i-th site.

5. The method of claim 1, wherein, The prediction model is trained based on the pre-constructed dataset and the regression formula to obtain a trained prediction model, which comprises: S1, real soil humidity and spatial-attribute information of each site in the dataset are extracted, and the extracted information is normalized to obtain normalized data; the normalized data is divided into a training set, a validation set and a test set according to a preset proportion; S2, a spatial adjacency matrix between sites is generated based on spatial distances between the sites; S3, hyperparameters of the prediction model are set, including a maximum number of iterations, an initial learning rate and hidden layer parameters; a preset loss function is used, and the model is supervised in terms of a determination coefficient, a root mean square error, a mean absolute error and a mean absolute percentage error, and S4 is executed; S4, spatial-attribute information of sites and a spatial adjacency matrix between sites in the training set are input, an Adadelta optimizer is used, and the training set is trained by a gradient descent method and a back propagation algorithm, and S5 is executed; S5, after each epoch ends, predicted soil humidity of each site is calculated based on a spatial heterogeneity weight matrix output by the prediction model using the regression formula, and a loss index of the training set and the validation set is calculated based on the predicted soil humidity and real soil humidity of each site using the loss function, and it is determined whether the loss function of the training set is decreased or the determination index of the validation set is overfitting; if the loss function is not decreased or the determination index is overfitting, the learning rate is adjusted or the model parameters are reconstructed, and the next round of training is performed. S6, repeating step S5 until a set maximum number of iterations is reached, and determining whether the training index is better than that of the previous round of training, if so, recording the optimal parameters of the current model, and performing S7; S7, using the trained model to calculate and verify the generalization ability of the model on the test set, ending the training process of the model, and obtaining the trained prediction model.

6. The method of claim 5, wherein, The loss function is: where i represents the i-th station, i = 1, 2,..., N; SM i is the real soil moisture for the i-th station; is the predicted soil moisture for the i-th station.

7. An apparatus for computing spatially non-stationary soil moisture, characterized by, The device comprises: A first construction unit configured to construct a site spatial heterogeneity weight prediction model based on a geographical graph attention network; the prediction model takes spatial-attribute information of sites and a spatial adjacency matrix between sites as input, and outputs a spatial heterogeneity weight matrix of the sites; the spatial-attribute information comprises latitude and longitude coordinates of the sites and main parameters related to soil humidity, and the main parameters comprise dew point temperature, relative humidity, precipitation and dryness ratio; each weight in the spatial heterogeneity weight matrix corresponds to a main parameter; A second construction unit configured to construct a weighted regression formula, which is used to calculate soil humidity of a site based on the spatial heterogeneity weight matrix output by the prediction model; A training unit configured to train the prediction model based on a pre-constructed data set and the regression formula, and obtain a trained prediction model; the data set comprises real soil humidity and spatial-attribute information of a plurality of known sites; An input unit configured to input spatial-attribute information of a target site into the trained prediction model, and obtain a spatial heterogeneity weight matrix of the target site; A calculation unit configured to input the calculated spatial heterogeneity weight matrix of the target site into the regression formula, and calculate soil humidity of the target site.

8. A computer device, comprising: The computer device comprises a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to realize the steps of the method of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by the processor to realize the steps of the method of any one of claims 1-6.

10. A computer program product, characterised in that, The computer program is executed by the processor to realize the steps of the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Atmospheric environmental pollutant prediction model based on dynamic space-time attention mechanism

    CN113326981A

  • Soil humidity prediction method based on extreme learning machine

    CN115730511A