A river water quality prediction method based on graph convolution STG-LSTM
Through the graph convolution STG-LSTM method, combined with the space-time graph and long-term memory neural network, the problem that the existing water quality prediction methods cannot describe the spatial distribution of river water quality is solved, and high-precision space-time prediction of river water quality factors is achieved.
Patent Information
- Application Number
- CN202210212916.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-03-04
AI Technical Summary
The existing water quality factor prediction methods are mainly time series predictions of single monitoring stations, which cannot describe the spatial distribution of river water quality, resulting in low prediction accuracy.
The graph convolution STG-LSTM method is used to measure the correlation between water quality factors of each monitoring site through the maximum mutual information coefficient, and a spatiotemporal graph is constructed to characterize the spatiotemporal correlation between each monitoring site, and the spatiotemporal graph is input into the STG-LSTM model, and the dynamic spatiotemporal correlation of water quality factors at different locations in the canal section is extracted for prediction.
High-precision prediction of river water quality factors in space and time can better describe the spatial distribution and timing changes of river water quality, and improve the accuracy and reliability of prediction.
Smart Images

Figure CN114676887B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graph convolution prediction, and in particular to a river water quality prediction method based on graph convolution STG-LSTM. Background Art
[0002] In order to better manage the water quality of river basins, some rivers in my country have established relatively complete monitoring systems. Dissolved oxygen content plays a key role in regulating various chemical processes and biological communities in river ecosystems. Nitrogen and phosphorus are the most important nutritional factors affecting the nutrient status of water bodies and phytoplankton productivity in natural rivers and lakes. However, river water quality has the characteristics of temporal sequence, instability and nonlinearity, and is affected by many factors, which will produce distribution differences in time and space. Therefore, improving the accuracy of spatiotemporal prediction of river water quality factors is conducive to rapid early warning and precise regulation of water quality status at different locations in the river.
[0003] The spatiotemporal prediction of river water quality takes the river water quality status information as the research object, and uses historical data to predict the spatiotemporal status of water quality in the future based on its spatiotemporal distribution characteristics. In the early prediction methods, scholars proposed statistical prediction models such as Markov model, autoregressive moving average model (ARMA) and its variant autoregressive difference moving average model (ARIMA). The common feature of these statistical prediction models is that they require data stationarity assumptions. Due to the insufficient ability to extract the nonlinear characteristics of river water quality factors, their prediction accuracy is not high. Machine learning methods such as support vector machine (SVR), Gaussian process regression (GPR) and extreme learning machine (ELM) can perform feature engineering modeling on river water quality data and can well extract nonlinear features, thereby improving prediction accuracy. In recent years, deep learning methods have achieved excellent performance in improving prediction accuracy and have been widely used in various industries. However, the above-mentioned prediction methods for water quality factors are all time series predictions for a single monitoring site, while river water quality factor data are not only temporally dependent, but also spatially correlated in water quality states at different river locations. Therefore, considering only the time dimension cannot obtain changes in water quality states at different river locations. Therefore, considering the relationship between water quality in time and space at the same time can further improve prediction accuracy. Summary of the invention
[0004] The technical problem to be solved by the present invention is that rapid and accurate prediction of river water quality is an important task in urban water management strategy. Most existing water quality factor prediction methods are time series predictions of single monitoring sites, which cannot describe the spatial distribution of river water quality.
[0005] The technical solution adopted by the present invention is: a river water quality prediction method based on graph convolution STG-LSTM comprises the following steps:
[0006] S1. Preprocess the geographical location and water quality data of each monitoring station of the Beijing-Hangzhou Grand Canal: including extracting the latitude and longitude and distance information of each station, different water quality data, and filling in missing values and normalizing them;
[0007] Furthermore, the step S1 specifically includes:
[0008] S1-1, use 91 bitmap software to extract the longitude and latitude information and distance information of each monitoring station on the canal into an Excel table for storage;
[0009] S1-2, use the random forest algorithm to complete the missing values of water quality data at each monitoring station;
[0010] S1-3, normalize the completed water quality data so that the data of different water quality types are normalized to the same order of magnitude;
[0011] S2, using the maximum mutual information coefficient (MIC) to measure the correlation between water quality factors at each monitoring station in the canal, and comprehensively selecting the station with the greatest correlation with other stations as the spatiotemporal prediction station;
[0012] Furthermore, the step S2 specifically includes:
[0013] S2-1, using the maximum mutual information coefficient to measure the correlation between water quality factors at each monitoring station on the canal;
[0014] S2-2, using the maximum mutual information coefficient of different water quality factors between two stations on the canal, comprehensively select the station with the greatest correlation with other stations as the spatiotemporal prediction station;
[0015] S3. Based on the geographical location of each monitoring station and the historical observation values of water quality factors, a spatiotemporal diagram is constructed to characterize the spatiotemporal correlation of water quality among the monitoring stations;
[0016] Furthermore, the step S3 specifically includes:
[0017] S3-1. At a certain moment, the spatial distribution of each monitoring station on the canal section is sampled into a spatial topological map, denoted as W = (V, E, A);
[0018] S3-2. Based on the geographical location of each monitoring station and the historical observation values of water quality factors, a time-space diagram is constructed: at a certain moment, a vector containing the site v i Past T h The mean, standard deviation, skewness and kurtosis of the water quality factor data to be predicted on the time slice; according to the site v i With site v j Constructed and The Pearson correlation coefficient between the two vectors obtained As site v i and v j The spatiotemporal weight relationship between them;
[0019] S4. Construct a graph convolutional long short-term memory neural network spatiotemporal water quality prediction model (STG-LSTM), use the spatiotemporal graph as the input of the model, and extract the dynamic spatiotemporal correlation of water quality factors at different locations in the canal section;
[0020] Furthermore, the step S4 specifically includes:
[0021] S4-1. The STG-LSTM model consists of a spatiotemporal module and an output layer. The spatiotemporal module includes a graph spatiotemporal convolution module and a LSTM time module. The two modules required above are constructed based on the tensorflow framework.
[0022] S4-2, the graph spatiotemporal convolution module captures the spatial correlation of water quality factors at different locations on the canal from the constructed spatiotemporal graph; the LSTM-based time module extracts the time series information between adjacent sites after data feature fusion; finally, the spatiotemporal feature fusion of the two output variables is performed based on the parameter matrix, and the final prediction result is obtained through the output layer;
[0023] S5. Verify the STG-LSTM spatiotemporal water quality prediction model: including error analysis of water quality prediction results at spatiotemporal prediction sites, verification analysis of water quality prediction results at different locations of the canal, and reliability and universality test of the model prediction results.
[0024] Furthermore, the step S5 specifically includes:
[0025] S5-1. Perform error analysis on the constructed STG-LSTM model prediction to analyze the prediction effect of the model on water quality factors;
[0026] S5-2, based on the constructed water quality spatiotemporal map, the water quality predictions at different stations of the canal are obtained, and the water quality predictions at different locations are further analyzed;
[0027] S5-3. Conduct a reliability test on the prediction results of the constructed STG-LSTM model, and use different water quality factor data to test the universality of the model, so as to make the obtained model more reliable.
[0028] The beneficial effects of the present invention are as follows: the present invention proposes a spatiotemporal prediction method for river water quality based on spatiotemporal graph convolution fused with long short-term memory neural network; firstly, MIC is used to measure the correlation between water quality factor sequences of each monitoring station, and the spatiotemporal prediction stations are comprehensively selected; secondly, based on the geographical location of each monitoring station and the historical observation value of water quality factors, a spatiotemporal graph is constructed to characterize the spatiotemporal correlation between each monitoring station; the spatiotemporal graph is input into the constructed STG-LSTM model, graph convolution is used to obtain the spatial dependency of river water quality factors, and the long short-term memory neural network is integrated to obtain the spatiotemporal correlation of water quality factors; finally, based on the constructed spatiotemporal graph, the spatiotemporal prediction of water quality status at different locations of the canal section in the future is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a logic diagram of the river water quality prediction method based on graph convolution STG-LSTM of the present invention;
[0030] Figure 2 It is a schematic diagram of water quality data of the Beijing-Hangzhou Grand Canal monitoring station used in the present invention;
[0031] Figure 3 It is a flow chart of the spatiotemporal prediction method of water quality of Beijing-Hangzhou Grand Canal based on graph convolution STG-LSTM in the present invention;
[0032] Figure 4 It is a spatiotemporal relationship diagram of water quality data of each monitoring station of the Beijing-Hangzhou Grand Canal in the present invention;
[0033] Figure 5 This is a graph showing the convergence verification results of the STG-LSTM model constructed in the present invention;
[0034] Figure 6 It is a graph of water quality prediction results for spatiotemporal prediction sites using the STG-LSTM model in the present invention;
[0035] Figure 7 This is a graph of water quality prediction results for each monitoring station of the Beijing-Hangzhou Grand Canal by the STG-LSTM model in the present invention;
[0036] Figure 8 This is a schematic diagram of the reliability test of the STG-LSTM model in the present invention. DETAILED DESCRIPTION
[0037] The present invention is further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner, and therefore it only shows the components related to the present invention.
[0038] like Figure 1 As shown in the figure, a river water quality prediction method based on graph convolution STG-LSTM has the following steps:
[0039] S1. Preprocess the geographical location and water quality data of each monitoring station of the Beijing-Hangzhou Grand Canal: including extracting the latitude and longitude and distance information of each station, different water quality data, and filling in missing values and normalizing them;
[0040] S2, using the maximum mutual information coefficient to measure the correlation between water quality factors at each monitoring station in the canal, and comprehensively selecting the station with the greatest correlation with other stations as the spatiotemporal prediction station;
[0041] S3. Based on the geographical location of each monitoring station and the historical observation values of water quality factors, a spatiotemporal diagram is constructed to characterize the spatiotemporal correlation of water quality among the monitoring stations;
[0042] S4. Construct a spatiotemporal water quality prediction model using a graph convolutional long short-term memory neural network, use the spatiotemporal graph as the input of the model, and extract the dynamic spatiotemporal correlation of water quality factors at different locations in the canal section;
[0043] S5. Verify the STG-LSTM spatiotemporal water quality prediction model: including error analysis of water quality prediction results at spatiotemporal prediction sites, verification analysis of water quality prediction results at different locations of the canal, and reliability and universality test of the model prediction results.
[0044] The specific experimental methods are as follows:
[0045] Steps S1 and S2, such as Figure 2 The figure shows the schematic diagram of water quality data at the Beijing-Hangzhou Grand Canal monitoring stations. All monitoring stations at the Beijing-Hangzhou Grand Canal are nationally and provincially controlled water quality section monitoring stations. Data on four water quality factors were collected from eight monitoring stations from April 1, 2020 to April 1, 2021, with a monitoring time interval of 4 hours for each set of data. These four water quality factors are dissolved oxygen, permanganate index, ammonia nitrogen and pH value. These eight monitoring stations can well grasp the changes in water quality factors at different locations of the Beijing-Hangzhou Grand Canal; each monitoring station has 2146 sets of data, and the first 1546 sets of data are divided into training sets, and the last 600 sets of data are used as validation sets.
[0046] The selection method of the spatiotemporal prediction site for water quality of the Beijing-Hangzhou Grand Canal is divided into three steps. Step 1: Assume that the number of sites in the canal section is N, where the dissolved oxygen sequence, permanganate index sequence, ammonia nitrogen sequence and pH value sequence of the i-th monitoring site are Step 2: Taking the dissolved oxygen sequence as an example, randomly select two stations from each monitoring station and convert the dissolved oxygen sequences of the two monitoring stations into and The value range of is divided into x segments and y segments respectively to obtain xy grid division results, then the maximum mutual information coefficient of the dissolved oxygen sequence of the canal monitoring stations i and j can be obtained; Step three: Finally, calculate the sum of the maximum mutual information coefficients of the dissolved oxygen sequence of the i-th monitoring station and the remaining monitoring stations on the river, and select the monitoring station with the largest mutual information coefficient as the spatiotemporal prediction station.
[0047] Eight national and provincial monitoring stations on a section of the Beijing-Hangzhou Grand Canal were selected, and the station names were defined as A, B, C, D, E, F, G, and H. In order to find the station with the greatest correlation with the remaining stations, it was used as the spatiotemporal prediction station. The sum of the maximum mutual information coefficients of dissolved oxygen, permanganate, ammonia nitrogen, and pH sequences of each monitoring station and the remaining monitoring stations were calculated, see Table 1.
[0048] Table 1 MIC calculation results of four water quality factors at eight monitoring stations
[0049] Tab.1 Calculation results of four water quality factors MIC at eight monitoring sites
[0050]
[0051] From Table 1, we can see that site D and The values are 4.607, 1.869, 2.063 and 2.590 respectively. The maximum mutual information coefficient of the four water quality factors at site D is the largest among the eight sites, indicating that the site has the greatest correlation with other sites and can obtain more water quality index sequence information from other sites. Therefore, site D is selected as the spatiotemporal prediction site and compared with the other models to verify the superiority of the STG-LSTM model.
[0052] Step S3, constructing a spatiotemporal graph of each monitoring station of the canal;
[0053] The spatiotemporal water quality diagrams of each monitoring station are constructed as follows: Figure 4 As shown in the figure, the circles represent different monitoring stations on the canal section, and the line segment between the two points represents the intensity of their mutual influence. The darker the color of the line segment, the greater the degree of influence. In the spatial dimension, such as sub-graphs (a) and (b), it can be found that the water quality status at different locations on the canal has different effects on point c, and even the same location has different effects on point c over time; in the spatiotemporal dimension, such as sub-graph (c), the historical water quality observations of station B not only have different effects on its own water quality status at the future time t+1, but also have different effects on the water quality status of station A at different times in the future.
[0054] The construction of the spatiotemporal graph of each monitoring station on the canal is mainly divided into the following two steps. Step 1: At a certain moment, the spatial distribution of each monitoring station on the canal section can be sampled into a spatial topological graph, recorded as W = (V, E, A); the geographical location of each monitoring station and the past T h Based on the historical observations of water quality factors on the time slice, a spatiotemporal graph is constructed to characterize the spatiotemporal correlation between the monitoring sites; Step 2: At a certain moment, a vector containing the site V i Past T h The mean, standard deviation, skewness, and kurtosis of the water quality factor data to be predicted on the time slice are calculated according to the site v i With site v j Constructed and The Pearson correlation coefficient between the two vectors obtained As site v i and v j The spatiotemporal weight relationship between them.
[0055] Step S4, construction of water quality spatiotemporal prediction model STG-LSTM;
[0056] The STG-LSTM model is used to realize the dynamic spatiotemporal correlation of water quality factors at different locations in the canal. Its overall architecture is as follows: Figure 3 As shown in the figure; the STG-LSTM model consists of a spatiotemporal module and an output layer. The spatiotemporal module includes a graph spatiotemporal convolution module and a LSTM time module; the graph spatiotemporal convolution module consists of graph convolutions in the spatiotemporal dimensions, which captures the spatial correlation of water quality factors at different locations on the canal from the constructed spatiotemporal graph; the LSTM-based time module extracts the time series information between adjacent sites after data feature fusion; finally, the spatiotemporal features of the two output variables are fused based on the parameter matrix, and the final prediction result is obtained through the output layer.
[0057] The entire model building process is written in the python development environment combined with the tensorflow library.
[0058] Step S5, 1) verifying the convergence of the spatiotemporal prediction STG-LSTM model;
[0059] In order to ensure the prediction accuracy of the proposed STG-LSTM model, its convergence is verified before comparison. Four commonly used optimization algorithms in deep learning are used to verify the convergence of the model: adaptive gradient algorithm (Adagrad), root mean square algorithm (RMSprop), adaptive incremental algorithm (Adadelta) and Adam; MSE is used as the loss function of the model, and the training set is used to verify the convergence of the model. The STG-LSTM convergence curve in the dissolved oxygen sequence of site D is shown in Figure 2. Figure 5 As shown in the figure, from the dissolved oxygen sequence data, we can see that although the MSE of the Adam algorithm training is comparable to that of the RMSprop algorithm in the end, the Adam algorithm converges faster in the early stage, which shows that the Adam algorithm makes STG-LSTM converge better among the four optimization algorithms.
[0060] 2) Research on water quality prediction of Beijing-Hangzhou Grand Canal;
[0061] 2.1、Prediction results display of spatiotemporal prediction sites;
[0062] The present invention has conducted three sets of comparative experiments. In the experiments, each model was built on the framework of tensorflow and Scikit-learn using Python 3.7. First, as traditional machine models for solving time series data, SVR and GPR rely on the characteristics of their own kernel functions and are suitable for processing complex regression problems such as high-dimensional and nonlinear problems, and their running speed is one of their major advantages. Therefore, SVR and GPR are compared with the STG-LSTM model proposed in this paper to conduct a comparative analysis from the comprehensive performance of prediction accuracy and running time. Secondly, in deep learning, LSTM and GRU control the information flow and the update of states and units by adding a gating mechanism, which can obtain The results are very good, but they only extract the time dependency of the data. Therefore, this study compares STG-LSTM with LSTM and GRU to verify the superiority of the model after adding the spatial dimension. Finally, STDN uses CNN and RNN to model and extract the time and space dependencies of data respectively, and does not consider the time lag between the various stations of the river in the time and space dimensions. Similarly, STGCN captures spatial dependency and time dependency through graph convolution and 2D convolution respectively. Therefore, the model proposed in this invention is compared with STDN and STGCN to verify whether the space-time graph formed after the fusion of the time and space features of the data of each station can better express the dependency in the time and space dimensions.
[0063] Schematic diagram of the prediction of the Beijing-Hangzhou Grand Canal's spatiotemporal prediction stations by different models Figure 6 As shown in the figure, in Experiment 1, SVR, GPR and STG-LSTM are compared in terms of prediction accuracy and running time; the prediction results of the three models in the dissolved oxygen data of the test set of prediction site D; the R 2 The larger the value, the smaller the RMSE, the closer it is to the actual observed value, and the better the prediction effect. As can be seen from the figure, when predicting some mutation points, the prediction value of the STG-LSTM model is more stable than that of SVR and GPR. 2Compared with SVR and GPR, the results are improved by 0.053 and 0.052 respectively; RMSE is reduced by 0.315 and 0.313 respectively compared with SVR and GPR. This shows that the invented model has more advantages in predicting river water quality factors than the traditional machine learning model and has better prediction effect; due to the characteristics of the kernel function of machine learning itself, the training time of SVR and GPR is greatly reduced compared with STG-LSTM.
[0064] Experiment 2 is used to verify whether adding spatial correlation information to the time series prediction model can help improve the prediction accuracy, and to prove whether adding spatial correlation information will significantly increase the running time of the model. The prediction effects of the three models LSTM, GRU, and STG-LSTM on the dissolved oxygen test set are shown in Figure 6 The model of the present invention is significantly better than LSTM and GRU in terms of dissolved oxygen prediction. 2 and RMSE were 0.987 and 0.144, respectively, R 2 Compared with LSTM and GRU, the results are improved by 6.82% and 7.17% respectively; RMSE is reduced by 69.30% and 70.06% respectively compared with LSTM and GRU; this shows that the method that considers both temporal and spatial associations is better than the method that only considers temporal associations, because the graph convolution spatiotemporal module extracts the spatial association features between the prediction site and the remaining monitoring sites on the river in each time slice, while the fusion time series module further extracts the temporal association features of spatial associations, and the spatiotemporal association module considers the spatiotemporal distribution characteristics of river water quality factors. At the same time, it can be seen that the model proposed in this paper does not increase the running time after adding spatial association information. The number of iterations of the three models is 1000 times. On the contrary, its running time is reduced by 9.2s and 19.6s respectively compared with LSTM and GRU; this is because MGCN-LSTM can quickly obtain the spatiotemporal relationship between each site from the constructed spatiotemporal graph.
[0065] Experiment 3 is used to verify whether the spatiotemporal graph of water quality factors can better express the dependencies in the spatiotemporal dimension. The prediction effects of the three models of STDN, STGCN and STG-LSTM are shown in Figure 6 ; STG-LSTM has slightly higher prediction accuracy for dissolved oxygen than STDN and STGCN. 2Compared with STDN and STGCN, it is improved by 4.45% and 2.07% respectively; RMSE is reduced by 67.86% and 28.71% compared with STDN and STGCN. The running time of STDN is greatly reduced compared with STG-LSTM. This is because although STDN also extracts the spatial and temporal dependencies between data separately, CNN can only capture the local spatial correlation of each location on the grid structure data, and the spatial information of the remaining sites is not considered here. STGCN does not use a spatiotemporal graph, but constructs a spatial graph based on the data information between sites for calculation. In summary, the spatiotemporal graph constructed by the STG-LSTM proposed in this paper through the spatiotemporal feature fusion can better express the dependencies in the spatiotemporal dimension, thereby improving the prediction accuracy of the model.
[0066] 2.2 Water quality prediction results at different locations of the canal
[0067] In the above three groups of experiments, the dissolved oxygen sequence of the selected spatiotemporal prediction site was predicted, and the model of the present invention was compared with the six models in terms of prediction accuracy and training time. It can be seen that the model proposed by the present invention has a good prediction effect in spatiotemporal prediction. Therefore, the STG-LSTM model is selected to characterize the spatiotemporal correlation of each monitoring site based on the constructed spatiotemporal graph, and predict the water quality factor sequence of other monitoring sites in the canal section, so as to obtain the water quality status of different locations in the canal section in the future. The key is that since the spatiotemporal graph of each monitoring site is constructed, STG-LSTM only needs to run once to obtain the prediction results of the eight monitoring sites in the canal section at the same time. Compared with other models that can only obtain the prediction results of a single site in a single run, the training time is greatly shortened. Taking the dissolved oxygen sequence as an example, the R of STG-LSTM's prediction results for different sites in the canal section is 2 , RMSE.
[0068] from Figure 7 It can be seen that the selected spatiotemporal prediction site D has the best prediction effect, because it is easier for this site to obtain water quality status information from other sites; the water quality status information obtained by different sites from other sites is different, resulting in different prediction effects of water quality status information at different locations of the canal section; in summary, the STG-LSTM model proposed in this study can quickly predict the water quality status at different locations of the canal section in the future based on the spatiotemporal graph constructed by different monitoring sites, and obtain better prediction results.
[0069] 2.3. STG-LSTM model reliability verification;
[0070] After evaluating the prediction results of STG-LSTM from the aspects of prediction accuracy and model training time, we continued to conduct reliability tests to ensure that the prediction results were convincing. First, the test set of dissolved oxygen sequences of site D was divided into four groups, each with 150 data. Secondly, the PIT value of each observation of each group of data was calculated. If these values obeyed a uniform distribution, it means that the prediction results of the proposed model were reliable. Therefore, the uniform probability graphs of the PIT values of the four test sets were drawn, and it can be clearly seen whether these values obeyed a uniform distribution, as shown in Figure 2. Figure 8 , the PIT values of the first and third data sets are evenly distributed along the diagonal, and their range evenly covers [0,1]. All points are within the Kolmogorov 5% significance band, which indicates that the predicted PDF is not too high or too low, nor too wide or too narrow; the oscillation amplitude of the PIT values of the second and fourth data sets is slightly larger, and some points are outside the Kolmogorov 5% significance band. This is because the observed values corresponding to some points in these two data sets are abnormal, or the correlation between some observed values corresponding to the predicted site and the observed values of the other sites is not very high; however, most of the PIT values of these two data sets are evenly distributed along the diagonal; therefore, the prediction results of STG-LSTM are reliable and convincing.
[0071] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.
Claims
1. A river water quality prediction method based on graph convolution STG-LSTM, characterized by: The steps are as follows: S1. Preprocess the geographical location and water quality data of each monitoring station of the Beijing-Hangzhou Grand Canal: including extracting the latitude and longitude and distance information of each station, different water quality data, and filling in missing values and normalizing them; S2, using the maximum mutual information coefficient to measure the correlation between water quality factors at each monitoring station in the canal, and comprehensively selecting the station with the greatest correlation with other stations as the spatiotemporal prediction station; The step S2 specifically includes: S2-1, using the maximum mutual information coefficient to measure the correlation between water quality factors at each monitoring station on the canal; S2-2, using the maximum mutual information coefficient of different water quality factors between two stations on the canal, comprehensively select the station with the greatest correlation with other stations as the spatiotemporal prediction station; S3. Based on the geographical location of each monitoring station and the historical observation values of water quality factors, a spatiotemporal diagram is constructed to characterize the spatiotemporal correlation of water quality among the monitoring stations; The step S3 specifically includes: S3-1. At a certain moment, the spatial distribution of each monitoring station on the canal section is sampled into a spatial topological map, recorded as ; S3-2. Based on the geographical location of each monitoring station and the historical observation values of water quality factors, a time-space diagram is constructed: at a certain moment, a vector containing the sites past The mean, standard deviation, skewness and kurtosis of the water quality factor data to be predicted on the time slice; With site Constructed and , the Pearson correlation coefficient between the two vectors is obtained As a site and The spatiotemporal weight relationship between them; S4. Construct a spatiotemporal water quality prediction model using a graph convolutional long short-term memory neural network, use the spatiotemporal graph as the input of the model, and extract the dynamic spatiotemporal correlation of water quality factors at different locations in the canal section; The step S4 specifically includes: S4-1. The STG-LSTM model consists of a spatiotemporal module and an output layer. The spatiotemporal module includes a graph spatiotemporal convolution module and a time module of the LSTM. The graph spatiotemporal convolution module and the time module of the LSTM are constructed based on the tensorflow framework. S4-2, the graph spatiotemporal convolution module captures the spatial correlation of water quality factors at different locations on the canal from the constructed spatiotemporal graph; the LSTM-based time module extracts the time series information between adjacent sites after data feature fusion; finally, the spatiotemporal feature fusion of the two output variables is performed based on the parameter matrix, and the final prediction result is obtained through the output layer; S5. Verify the STG-LSTM spatiotemporal water quality prediction model: including error analysis of water quality prediction results at spatiotemporal prediction sites, verification analysis of water quality prediction results at different locations of the canal, and reliability test of the model prediction results.
2. The river water quality prediction method based on graph convolution STG-LSTM as claimed in claim 1, characterized in that: The step S1 specifically includes: S1-1, use 91 bitmap software to extract the longitude and latitude information and distance information of each monitoring station on the canal into an Excel table for storage; S1-2, use the random forest algorithm to complete the missing values of water quality data at each monitoring station; S1-3. Normalize the completed water quality data so that data of different water quality types are normalized to the same order of magnitude.
3. The river water quality prediction method based on graph convolution STG-LSTM as claimed in claim 1, characterized in that: The step S5 specifically includes: S5-1. Perform error analysis on the constructed STG-LSTM model prediction to analyze the prediction effect of the model on water quality factors; S5-2, based on the constructed water quality spatiotemporal map, the water quality predictions at different stations of the canal are obtained, and the water quality predictions at different locations are further analyzed; S5-3. Conduct a reliability test on the prediction results of the constructed STG-LSTM model, and use different water quality factor data to test the universality of the model, so as to make the obtained model more reliable.
Citation Information
Patent Citations
Air quality space-time prediction method based on long-term and short-term memory neural network
CN111798051A
River water quality prediction method considering space-time correlation and meteorological factors
CN112381292A