River water quality prediction method fusing quantum-like features and graph-time sequence model
By integrating quantum features and graph-temporal model, the problems of sparseness and insufficient spatial coverage of water quality data acquisition in large-scale watersheds are solved, and high-precision and stable prediction of water quality changes are achieved.
Patent Information
- Application Number
- CN202510866867.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-26
AI Technical Summary
The existing water quality data acquisition methods have problems such as data sparsity, insufficient spatial coverage capacity and strong model dependence in large-scale watershed basins. Traditional deep learning models have limitations in dealing with spatial structure information and spatial-time interaction characteristics of large-scale watershed basins.
Using the method of fusion quantum features and graph-time-series model, we perform high-dimensional quantum feature transformation on multi-source heterogeneous data to generate spatiotemporal quantum feature vectors, and use graph-series models to capture spatially dependent features between sites to perform continuous prediction of time scale.
The water quality prediction accuracy and generalization performance of the model in the background of large-scale watershed watersheds has been improved, effectively alleviating the modeling problems caused by sparse observation data, and improving the prediction accuracy and stability of sparse water quality observation data.
Smart Images

Figure CN120372425A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of hydrological simulation, and particularly relates to a river water quality prediction method integrating quantum-like features and a graph-time series model. Background Technique
[0002] The acquisition of river water quality data is a key task in water resource management and ecological environment protection, and can provide important decision-making support for basin management and pollution prevention and control. Existing water quality data acquisition methods mainly include ground observation, remote sensing monitoring, and numerical simulation, etc., but there are many limitations in practical applications. Although the ground observation method has high data accuracy, the number of observation stations is limited and unevenly distributed, resulting in serious data sparsity; although the satellite remote sensing monitoring method has the ability to cover a large range of space, it is sensitive to meteorological conditions, and the data quality is affected by cloud interference and adjacent land; although the numerical simulation method can provide continuous spatio-temporal estimates, it is highly dependent on the model structure and parameter setting, and is prone to reducing the data prediction accuracy due to simplified assumptions.
[0003] In recent years, with the development of artificial intelligence, deep learning methods have received extensive attention in water quality prediction. Models such as support vector machine (SVM), random forest (RF), and gradient boosting decision tree (GBDT) have achieved certain results in modeling non-linear input-output relationships. However, traditional deep learning models have certain limitations in modeling the spatial structure information of large-scale basins and processing spatio-temporal interaction features. Quantum machine learning (QML), as an emerging direction of the integration of artificial intelligence and quantum computing, shows the potential in processing high-dimensional data and modeling complex non-linear relationships. By simulating the quantum embedding process, stronger feature expression ability can be achieved at the data input stage, providing a richer representation space for data modeling. At the same time, the graph-time series model is a composite modeling framework integrating graph neural network and time series neural network, and has the ability to model the spatial dependence relationship between nodes and the dynamic change of node features over time. This type of model usually uses graph convolutional network (GCN, GAT, etc.) as the spatial modeling unit to capture the spatial adjacency relationship constructed based on static attributes such as terrain, land use, and climate between river stations; at the same time, time series structures such as LSTM or GRU are introduced to model the time evolution trend of variables such as water quality and hydro-meteorology of river stations. It can continuously predict the change process of river water quality on a long time scale, thereby improving the time series filling accuracy of sparse observation data.
[0004] Based on this, the present invention proposes a river water quality prediction method that integrates quantum-like features and a graph-temporal model. As a technical path for simulating high-dimensional mapping of quantum states, the quantum-like feature enhancement method can construct a feature vector space with higher discriminative power and expressive ability by performing high-dimensional non-linear feature transformation on the original input features, providing a more distinguishable initial expression for the graph-temporal model to process the spatio-temporal dependence features of rivers. At the same time, a graph-temporal model is introduced to mine the spatio-temporal information between river stations, enabling the model to have the ability to extract information related to water quality changes from spatio-temporal multi-scale features, effectively improving the water quality prediction accuracy and generalization performance of the model in large-scale complex basin scenarios, and having good engineering practical value and promotion prospects. Summary of the Invention
[0005] Aiming at the deficiencies of the above-mentioned existing technologies, the purpose of the present invention is to provide a river water quality prediction method that integrates quantum-like features and a graph-temporal model to improve the prediction accuracy and stability of the model for sparse water quality observation data in the context of large-scale basins. The present invention performs high-dimensional quantum-like feature transformation on multi-source heterogeneous data (time series meteorological data and static basin attribute data) to generate corresponding spatio-temporal quantum-like feature vectors, enhancing the model's ability to represent the non-linear interaction relationship of spatio-temporal features; at the same time, using a graph-temporal model to capture the spatial dependence features between stations; and performing continuous prediction of river water quality on a time scale. Realize the daily prediction of water quality variables (such as dissolved oxygen, water temperature, runoff, etc.) at multiple river stations, effectively alleviating the modeling difficulties brought by sparse observation data.
[0006] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A river water quality prediction method that integrates quantum-like features and a graph-temporal model of the present invention is as follows:
[0008] Step S1: Obtain multi-variable water quality observation data, time series meteorological data, and static basin attribute data of multiple river stations;
[0009] Step S2: Preprocess the data obtained in step S1, and divide the preprocessed data into a training set and a test set;
[0010] Step S3: Perform high-dimensional quantum-like feature transformation on the preprocessed time series meteorological data and static basin attribute data to generate corresponding meteorological quantum-like feature vectors and static basin attribute quantum-like feature vectors respectively;
[0011] Step S4: Extract spatial dependence features using the graph-temporal model, splice and fuse the meteorological quantum feature vector and the static basin attribute quantum feature vector in Step S3 with the spatial dependence features, and input them together with the preprocessed multi-variable water quality observation data in Step S2 into the graph-temporal model for training to optimize the model parameters;
[0012] Step S5: Perform inverse normalization on the simulated output calculated by the trained graph-temporal model to obtain continuous daily river water quality simulation data, and evaluate the model performance to predict daily continuous river water quality data.
[0013] Furthermore, the multi-variable water quality observation data, time series meteorological data, and static basin attribute data in Step S1 are organized in a site-time structure and constructed into a tensor structure of site × time × feature dimension, with a time resolution of daily scale; among them,
[0014] The multi-variable water quality observation data includes dissolved oxygen, runoff, and water temperature. According to the requirements of specific prediction tasks, one or more of these variables can be selected for data prediction;
[0015] The time series meteorological data includes: dew point temperature at 2 meters, potential evaporation, surface air pressure, temperature of the first layer of soil, net solar radiation at the surface, net thermal radiation at the surface, total surface runoff, total precipitation, U component of wind speed at 10 meters, V component of wind speed at 10 meters, volumetric water content of the first layer of soil, and air temperature at 2 meters;
[0016] The static basin attribute data includes 100 - 200 different basin attributes, which cover land use, topographic features, soil types, basin area, slope distribution, and vegetation index of different basins, and are used as invariant features of each river site for spatial modeling.
[0017] Furthermore, the data preprocessing in Step S2 specifically includes:
[0018] Normalize the multi-variable water quality observation data, time series meteorological data, and static basin attribute data in Step S1 so that the data is transformed into a distribution with a mean of 0 and a standard deviation of 1, and ensure that the data has similar scales and distributions. The formula is as follows:
[0019] ;
[0020] Among them, is the original data, is the average value of the original data, is the standard deviation of the original data, is the preprocessed data.
[0021] Further, in step S2, based on the time series of the preprocessed water quality observation data, the normalized water quality observation data, time series meteorological data, and static basin attribute data are divided into a training set and a test set according to the ratio of 75% and 25%.
[0022] Further, step S3 specifically includes:
[0023] The meteorological vector of the i-th river site on the t-th day is expressed as:
[0024] ;
[0025] Where, represents the meteorological vector of the i-th river site on the t-th day, indicates that the meteorological vector belongs to the real vector space of dimension , t = 1, 2,..., T, and T is the total number of time steps;
[0026] The static basin attribute vector corresponding to each river site is expressed as:
[0027] ;
[0028] Where, represents the static basin attribute vector of the i-th river site; indicates that the static basin attribute vector belongs to the real vector space of dimension ;
[0029] For each meteorological vector , the following high-dimensional quantum-like feature transformation is defined:
[0030] Step S31: Perform sine and cosine non-linear transformations on the meteorological vector of the i-th river site on the t-th day, as follows:
[0031] ;
[0032] ;
[0033] Where, and respectively represent the meteorological sine feature and meteorological cosine feature after non-linear transformation;
[0034] Step S32: Perform a bivariate interaction transformation on any two different feature dimensions d1, d2 in the meteorological vector of each river site at time step t, calculate the interaction feature, d1, d2 ∈ {1, 2,..., D}, d1 < d2, as follows:
[0035] ;
[0036] Among them, , respectively represent the values of the d1-th and d2-th dimensions in the meteorological interaction features generated by the i-th river site on the t-th day, and a total of interaction dimensions are generated;
[0037] Step S33: Concatenate the meteorological vector, meteorological sine feature, meteorological cosine feature, and meteorological interaction feature to obtain the meteorological quantum-like feature vector of the i-th river site on the t-th day , as follows:
[0038] ;
[0039] Among them, represents concatenating multiple vectors of the same dimension and merging them along the feature dimension into an extended high-dimensional feature vector, , represents that the meteorological quantum-like feature vector belongs to the real vector space of dimension ;
[0040] Stack the meteorological quantum-like feature vectors generated from the meteorological time series along the time dimension t = 1, 2,..., T to form a meteorological quantum-like feature matrix, as follows:
[0041] ;
[0042] Among them, is the meteorological quantum-like feature matrix corresponding to the i-th hydrological observation site, is the meteorological quantum-like feature vector generated by the i-th river site on the t-th day, T is the length of the time series, is the dimension of the meteorological quantum-like feature vector, represents that the meteorological quantum-like feature matrix belongs to the real vector space of dimension ;
[0043] Perform a high-dimensional quantum-like feature transformation on the static attribute vector of each river site, as follows:
[0044] ;
[0045] ;
[0046] ;
[0047] ;
[0048] Among them, is the static basin attribute vector of the i-th river station; and respectively represent the static basin attribute sine feature and the static basin attribute cosine feature after non-linear transformation of the static basin attribute vector; , respectively represent the values of the d1-th and d2-th dimensions in represents the static basin attribute interaction feature; represents the static basin attribute quantum-like feature vector; , represents that the static basin attribute quantum-like feature vector belongs to the real vector space of dimension ;
[0049] Furthermore, the specific process of using the graph-temporal model to extract spatial dependence features in step S4 is as follows:
[0050] Using the static basin attribute vector of each river station , calculate the cosine similarity between all river stations as follows:
[0051] ;
[0052] where and respectively represent the static basin attribute vectors of the i-th and j-th river stations; the cosine similarity between the static basin attribute vectors of the i-th and j-th river stations;
[0053] Construct an adjacency matrix based on the similarity matrix , define the edge connection relationship in the graph structure, and the connection rule is as follows:
[0054] ;
[0055] where is the similarity threshold; represents the element in the i-th row and j-th column of the adjacency matrix;
[0056] Construct a spatial dependence node feature matrix, input the initial node feature matrix , where the i-th row is the static attribute vector of river station i , and use the graph convolutional neural network for embedding learning to extract spatial dependence information, and the formula is as follows:
[0057] ;
[0058] where is the initial node feature matrix; Indicates that the node feature matrix belongs to a real vector space of dimension ; Indicates the total number of river stations participating in graph construction, i.e., the number of nodes in the graph; Indicates the dimension of the static catchment attributes of each station; Is the node feature matrix output by the -th layer; Is the activation function; Is the node feature matrix input to the -th layer; Is the normalized adjacency matrix; Is the trainable weight parameter matrix of the -th layer;
[0059] After l layers of graph convolution, the output spatial dependence feature matrix can be obtained as follows:
[0060] ;
[0061] Among them, Indicates the spatial dependence feature matrix output after l layers of graph convolution, Indicates the output spatial embedding dimension, Indicates that the output spatial dependence feature matrix belongs to a real vector space of dimension ;
[0062] Furthermore, in step S4, the time series meteorological quantum feature vector and the static catchment attribute quantum feature vector in step S3 are concatenated and fused with the spatial dependence feature, and are input into the graph-time series model together with the preprocessed multi-variable water quality observation data in step S2 for training to optimize the model parameters; specifically including:
[0063] The time series meteorological quantum feature vector and the static catchment attribute quantum feature vector are concatenated to obtain a high-dimensional spatio-temporal quantum feature matrix , , where T is the length of the input time step, Is the total feature dimension, including the non-linear mapping term of meteorological features and the regional attribute embedding term, Indicates the high-dimensional feature matrix Belongs to a real vector space of dimension ;
[0064] The spatial dependence feature is replicated in the time dimension to construct a spatial feature matrix, as follows:
[0065] ;
[0066] Among them, Denote the spatially - extended feature matrix replicated at the \(i\) - th river site at each time step, as the spatial - dependence feature vector of the \(i\) - th river site;
[0067] The spatial - dependence feature vector of the \(i\) - th river site is extended to \(T\) time steps to form a dimension matching the high - dimensional spatio - temporal quantum - like feature matrix;
[0068] Construct the fused feature at each time step as follows:
[0069] ;
[0070] where, is the high - dimensional spatio - temporal quantum - like feature vector of site \(i\) at time \(t\); , are both fusion - weighted coefficients, and their value ranges are in \([0,1]\); denotes the fused feature vector of the \(i\) - th river site at the \(t\) - th time step;
[0071] Construct the fused input feature matrix as follows:
[0072] ;
[0073] where the fusion dimension is expressed as follows:
[0074] ;
[0075] The fused feature is the final input feature sequence of river site \(i\), denotes the fused feature belonging to the real - vector space of dimension ;
[0076] Input the fused feature into the graph - time - series model, and input it in the format of \((N,T,D)\); assuming there are \(N\) river sites, and the dimension of the feature vector of each river site satisfies , then the final input data dimension is \((N,T,\) ), and the joint input is expressed as:
[0077] ;
[0078] where \(F\) represents the fused feature vectors of \(N\) river sites, denotes the water - quality observation data pre - processed in step S2;
[0079] Set hyperparameters for the graph-time series model, including defining the total number of training epochs, the model saving frequency, the batch size, the time step, the number of units in the hidden layer, and the Dropout rate;
[0080] Use the test set as the input. During the training process, the model performs forward propagation and calculates the simulated output layer by layer. The specific process is as follows:
[0081] At each time step t, calculate the water quality prediction information of the river station at the previous time step that the model decides to retain under the current meteorological and hydrological conditions;
[0082] ;
[0083] Among them, represents the output vector, represents the function, represents the weight matrix, represents the hidden state at the previous time step, represents the input at the current time step, represents the bias term;
[0084] Calculate the influence ratio of the input data at the current time step on the update of the water quality prediction state of the river station and the value of the candidate unit state
[0085] ;
[0086] ;
[0087] Among them, represents the output vector, represents the weight matrix, represents the input data at the current time step t, represents the candidate unit state, represents the hyperbolic tangent activation function, represents the weight matrix of the candidate unit state, represents the bias vector of the candidate unit state;
[0088] Update the cumulative water quality prediction information C t of the river station at the current time step, and C t includes the input at the current time step and the water quality prediction information of the river station at the previous time step. The calculation formula is as follows:
[0089] ;
[0090] Among them, and represent the unit states at the current time step and the previous time step respectively, denote element-wise multiplication;
[0091] By calculating the activation value to control the information output ratio of the unit state at the current time step, and then calculate the hidden state at the current time step as the output information, and the calculation formula is as follows:
[0092] ;
[0093] ;
[0094] where, represents the activation value of the output gate, represents the hidden state at the current time step, represents the weight matrix, represents the bias vector of the output gate;
[0095] The hidden state at the last time step is used as the feature representation of the sequence and passed to the output layer, and the expression is as follows:
[0096] ;
[0097] where, represents the weight matrix of the output layer, represents the bias term, represents the simulated output calculated by the model;
[0098] The model parameters are updated by the backpropagation algorithm, and the goal is to minimize the loss function L. The expression of the loss function L is as follows:
[0099] ;
[0100] where, represents the simulated output calculated by the model; represents the preprocessed multi-variable water quality observation data in step S2, take 1×10 −8 , n is the number of samples; calculate the gradient of the loss function L with respect to the model parameters θ , and the parameter θ includes all the weight matrices and bias terms in the time series model;
[0101] Use the gradient descent method to update the model parameters, and the update rule is:
[0102] ;
[0103] Where k represents the current number of iterations, θ(k) is the parameter value at the kth iteration, η is the learning rate, is the gradient of the loss function with respect to the parameter θ, and θ(k+1) is the updated parameter value;
[0104] The model parameters are gradually optimized through multiple iterations until the loss function converges to the minimum value or reaches the predetermined number of training cycles, completing the model training.
[0105] Furthermore, in step S5, the simulation output of the trained graph-time series model is denormalized to restore it to the continuous daily river water quality simulation value at the original physical quantity scale, expressed as:
[0106] ;
[0107] Among them, Y represents the continuous daily river water quality simulation value after anti-normalization, represents the multivariate water quality observation data after preprocessing in step S2, represents the standard deviation of multivariate water quality observation data, Represents the average of the multivariate water quality observations.
[0108] The model was evaluated using the denormalized continuous daily river water quality simulation values and multivariate water quality observation data as follows:
[0109] ;
[0110] ;
[0111] ;
[0112] ;
[0113] In the formula, Represents the continuous daily river water quality simulation value, represents the multivariate water quality observation data, n represents the total number of paired continuous daily river water quality simulation data and multivariate water quality observation data during the model testing period, It represents the average value of the simulated river water quality values for consecutive days. represents the average value of the multivariate water quality simulation data, represents the percentage deviation, represents the Nash efficiency coefficient, represents the root mean square error, Represents the Pearson correlation coefficient; after evaluating the reliability of the model output results based on the four evaluation parameters of Pbias, NSE, RMSE and Pcorr, the denormalized continuous daily river water quality simulation value is the final predicted daily continuous river water quality data.
[0114] Advantages of the present invention:
[0115] 1. By performing high-dimensional quantum-like feature transformation on multi-source heterogeneous meteorological and static watershed attribute data, the present invention improves the model's ability to express the non-linear interaction relationship between complex spatio-temporal variables, and enhances the fitting accuracy and generalization ability of the water quality prediction model.
[0116] 2. The present invention models the spatial dependence relationship between multiple river stations in a large-scale spatial background, and constructs an adjacency matrix by using the similarity of static attributes of each station in the watershed, so as to effectively model and infer the large-scale watershed spatial structure, and solve the problem that traditional water quality prediction methods cannot effectively capture spatial features in complex geographical environments.
[0117] 3. The present invention conducts spatio-temporal joint modeling, fully excavates the spatio-temporal coupling relationship of water quality data, not only improves the accuracy of the model in long-term and dynamic prediction tasks, but also enhances the stability and adaptability of the model. Description of the Drawings
[0118] Figure 1 It is a flow chart of the method of the present invention. Detailed Embodiments
[0119] For the convenience of understanding by those skilled in the art, the present invention will be further described below in conjunction with embodiments and the drawings. The content mentioned in the embodiments does not limit the present invention.
[0120] Referring to Figure 1 As shown, a river water quality prediction method integrating quantum-like features and graph-time series model of the present invention is as follows:
[0121] Step S1: Obtain multi-variable water quality observation data, time series meteorological data and static watershed attribute data of multiple river stations;
[0122] Specifically, the multi-variable water quality observation data, time series meteorological data and static watershed attribute data in step S1 are organized in a site-time structure and constructed into a tensor structure of site × time × feature dimension, and the time resolution is on a daily scale; among them,
[0123] The multi-variable water quality observation data includes dissolved oxygen, runoff and water temperature. According to the requirements of specific prediction tasks, one or more of these variables can be selected for data prediction;
[0124] Time series meteorological data, including: dew point temperature at 2 meters, potential evapotranspiration, surface air pressure, temperature of the 1st layer of soil, net solar radiation at the surface, net heat radiation at the surface, total surface runoff, total precipitation, U-component of wind speed at 10 meters, V-component of wind speed at 10 meters, volumetric water content of the 1st layer of soil, and air temperature at 2 meters;
[0125] Static basin attribute data, including 100 - 200 different basin attributes, which cover land use, topographic features, soil types, basin area, slope distribution, and vegetation index of different basins, and are used as invariant features of each river site for spatial modeling.
[0126] Step S2: Preprocess the data obtained in step S1, and divide the preprocessed data into a training set and a test set;
[0127] Specifically, the preprocessing of the data in step S2 specifically includes:
[0128] Normalize the multivariate water quality observation data, time series meteorological data, and static basin attribute data in step S1, so that the data is transformed into a distribution with a mean of 0 and a standard deviation of 1, and ensure that the data has similar scales and distributions. The formula is as follows:
[0129] ;
[0130] Where, is the original data, is the average value of the original data, is the standard deviation of the original data, is the preprocessed data.
[0131] Among them, in step S2, based on the time series of the preprocessed water quality observation data, the normalized water quality observation data, time series meteorological data, and static basin attribute data are divided into a training set and a test set according to the ratio of 75% and 25%.
[0132] Step S3: Perform high-dimensional quantum-like feature transformation on the preprocessed time series meteorological data and static basin attribute data, and generate corresponding meteorological quantum-like feature vectors and static basin attribute quantum-like feature vectors respectively;
[0133] Specifically, step S3 specifically includes:
[0134] The meteorological vector representation of the i-th river site on the t-th day is:
[0135] ;
[0136] Where, Denote the meteorological vector of the \(i\)-th river site on the \(t\)-th day, where the meteorological vector belongs to a real vector space with dimension , \(t = 1, 2,\cdots, T\), and \(T\) is the total number of time steps;
[0137] The static basin attribute vector corresponding to each river site is denoted as:
[0138] ;
[0139] where, denotes the static basin attribute vector of the \(i\)-th river site; denotes that the static basin attribute vector belongs to a real vector space with dimension ;
[0140] For each meteorological vector , the following high-dimensional quantum-like feature transformation is defined:
[0141] Step S31: Perform sine and cosine non-linear transformations on the meteorological vector of each river site on the \(t\)-th day as follows:
[0142] ;
[0143] ;
[0144] where, and respectively represent the meteorological sine feature and meteorological cosine feature after non-linear transformation;
[0145] Step S32: Perform bivariate interaction transformation on any two different feature dimensions \(d_1, d_2\) of the meteorological vector of each river site at time step \(t\), calculate the interaction feature, \(d_1, d_2\in\{1, 2,\cdots, D\}\), \(d_1 < d_2\), as follows:
[0146] ;
[0147] where, , respectively represent the values of the \(d_1\)-th and \(d_2\)-th dimensions in the meteorological interaction feature generated by the \(i\)-th river site on the \(t\)-th day, and a total of interaction dimensions are generated;
[0148] Step S33: Concatenate the meteorological vector, meteorological sine feature, meteorological cosine feature, and meteorological interaction feature to obtain the meteorological quantum-like feature vector of the \(i\)-th river site on the \(t\)-th day, as follows:
[0149] ;
[0150] Among them, represents the concatenation of multiple vectors of the same dimension, which are merged along the feature dimension into an extended high-dimensional feature vector. , represents that the meteorological quantum feature vector belongs to the real vector space of dimension ;
[0151] Stack the meteorological quantum feature vectors generated from the meteorological time series along the time dimension t = 1, 2,..., T to form a meteorological quantum feature matrix, as follows:
[0152] ;
[0153] Among them, is the meteorological quantum feature matrix corresponding to the i-th hydrological observation station, is the meteorological quantum feature vector generated by the i-th river station on the t-th day, T is the length of the time series, is the dimension of the meteorological quantum feature vector, represents that the meteorological quantum feature matrix belongs to the real vector space of dimension ;
[0154] Perform a high-dimensional quantum-like feature transformation on the static attribute vector of each river station, as follows:
[0155] ;
[0156] ;
[0157] ;
[0158] ;
[0159] Among them, is the static basin attribute vector of the i-th river station; , respectively represent the static basin attribute sine feature and the static basin attribute cosine feature after the non-linear transformation of the static basin attribute vector; , respectively represent the values of the d1-th and d2-th dimensions in represents the static basin attribute interaction feature; represents the static basin attribute quantum-like feature vector; , represents that the static basin attribute quantum-like feature vector belongs to the dimension of The real vector space.
[0160] Step S4: Use the graph-temporal model to extract spatial dependence features, and splice and fuse the meteorological quantum feature vectors and static basin attribute quantum feature vectors in step S3 with the spatial dependence features, and then input them together with the preprocessed multi-variable water quality observation data in step S2 into the graph-temporal model for training to optimize the model parameters;
[0161] Specifically, the use of the graph-temporal model to extract spatial dependence features in step S4 specifically includes:
[0162] Use the static basin attribute vectors of each river station , calculate the cosine similarity between all river stations as follows:
[0163] ;
[0164] Among them, , respectively represent the static basin attribute vectors of the i-th and j-th river stations; The cosine similarity between the static basin attribute vectors of the i-th and j-th river stations;
[0165] Construct an adjacency matrix based on the similarity matrix , define the edge connection relationship in the graph structure, and the connection rule is as follows:
[0166] ;
[0167] Among them, is the similarity threshold; represents the element in the i-th row and j-th column of the adjacency matrix;
[0168] Construct a spatial dependence node feature matrix, input the initial node feature matrix , where the i-th row is the static attribute vector of river station i , use the graph convolutional neural network for embedding learning to extract spatial dependence information, and the formula is as follows:
[0169] ;
[0170] Among them, is the initial node feature matrix; represents that the node feature matrix belongs to the real vector space of dimension ; represents the total number of river stations participating in graph construction, that is, the number of nodes in the graph; represents the static basin attribute dimension of each station; is the The node feature matrix output by the layer; is the activation function; is the node feature matrix input by the layer; is the layer's trainable weight parameter matrix;
[0171] After l layers of graph convolution, the output spatial dependence feature matrix can be obtained as follows:
[0172] ;
[0173] Among them, represents the spatial dependence feature matrix output after l layers of graph convolution, represents the output spatial embedding dimension, represents that the output spatial dependence feature matrix belongs to the real vector space with dimension .
[0174] Among them, in step S4, the time series meteorological quantum feature vector and the static basin attribute quantum feature vector in step S3 are spliced and fused with the spatial dependence feature, and are input into the graph-time series model together with the preprocessed multi-variable water quality observation data in step S2 for training to optimize the model parameters; specifically including:
[0175] Splice the time series meteorological quantum feature vector and the static basin attribute quantum feature vector to obtain a high-dimensional spatio-temporal quantum feature matrix , , where T is the input time step length, is the total feature dimension, including the non-linear mapping term of meteorological features and the regional attribute embedding term, represents the high-dimensional feature matrix belongs to the real vector space with dimension ;
[0176] Perform a replication operation on the spatial dependence feature in the time dimension to construct a spatial feature matrix, as follows:
[0177] ;
[0178] Among them, represents the spatial feature matrix after replication and extension of the i-th river site at each time step, represents the spatial dependence feature vector of the i-th river site;
[0179] The spatial dependence feature vector of the i-th river site is extended to T time steps to form a dimension matching the high-dimensional spatio-temporal quantum feature matrix;
[0180] Construct the fused features for each time step as follows:
[0181] ;
[0182] where is the high-dimensional spatio-temporal quantum-like feature vector of site i at time t; , are both fusion weight coefficients, and their value ranges are [0, 1]; represents the fused feature vector of the i-th river site at the t-th time step;
[0183] Construct the fused input feature matrix as follows:
[0184] ;
[0185] where the fusion dimension is expressed as follows:
[0186] ;
[0187] The fused feature is the final input feature sequence of river site i, represents that the fused feature belongs to the real vector space of dimension ;
[0188] Input the fused feature into the graph-temporal model in the format of (N, T, D); it is assumed that there are N river sites, and the dimension of the feature vector of each river site satisfies , then the dimension of the final input data is (N, T, ), and the joint input is expressed as:
[0189] ;
[0190] where F represents the fused feature vectors of N river sites, represents the water quality observation data after preprocessing in step S2;
[0191] Set the hyperparameters of the graph-temporal model, including defining the total number of training epochs, the model saving frequency, the batch size, the time step, the number of units in the hidden layer, and the Dropout rate;
[0192] Use the test set as the input, and during the training process, the model propagates forward layer by layer to calculate the simulated output. The specific process is as follows:
[0193] At each time step t, calculations are performed to obtain the water quality prediction information of the river sites at the previous time step that the model decides to retain under the current meteorological and hydrological conditions;
[0194] ;
[0195] Among them, represents the output vector, represents function, represents the weight matrix, represents the hidden state at the previous time step, represents the input at the current time step, represents the bias term;
[0196] Calculate the influence ratio of the input data at the current time step on the update of the water quality prediction state of the river sites and the candidate unit state value;
[0197] ;
[0198] ;
[0199] Among them, represents the output vector, represents the weight matrix, represents the input data at the current time step t, represents the candidate unit state, represents the hyperbolic tangent activation function, represents the weight matrix of the candidate unit state, represents the bias vector of the candidate unit state;
[0200] Update the cumulative water quality prediction information C of the river sites at the current time step t , C t includes the input at the current time step and the water quality prediction information of the river sites at the previous time step. The calculation formula is as follows:
[0201] ;
[0202] Among them, and respectively represent the unit states at the current time step and the previous time step, represents element-wise multiplication;
[0203] By calculating the activation value to control the information output ratio of the unit state at the current time step, and then calculate the hidden state at the current time step as the output information. The calculation formula is as follows:
[0204] ;
[0205] ;
[0206] Among them, represents the activation value of the output gate, represents the hidden state at the current time step, represents the weight matrix, represents the bias vector of the output gate;
[0207] The hidden state at the last time step is used as the feature representation of the sequence and passed to the output layer. The expression is as follows:
[0208] ;
[0209] Among them, represents the weight matrix of the output layer, represents the bias term, represents the simulated output calculated by the model;
[0210] The model parameters are updated through the backpropagation algorithm. The goal is to minimize the loss function L. The expression of the loss function L is as follows:
[0211] ;
[0212] Among them, represents the simulated output calculated by the model; represents the preprocessed multi-variable water quality observation data in step S2, Take 1×10 −8 , where n is the number of samples; calculate the gradient of the loss function L with respect to the model parameters θ , and the parameter θ includes all the weight matrices and bias terms in the time series model;
[0213] Use the gradient descent method to update the model parameters. The update rule is:
[0214] ;
[0215] Among them, k represents the current iteration number, θ(k) is the parameter value at the kth iteration, η is the learning rate, is the gradient of the loss function with respect to the parameter θ, and θ(k + 1) is the updated parameter value;
[0216] Perform multiple iterations to gradually optimize the model parameters until the loss function converges to the minimum value or reaches the predetermined number of training epochs, and complete the model training.
[0217] Step S5: After denormalizing the simulated output calculated by the trained graph-temporal model, continuous daily river water quality simulation data is obtained, and the model performance is evaluated to predict the continuous daily river water quality data;
[0218] Specifically, in step S5, the simulated output of the trained graph-temporal model is denormalized to restore it to the continuous daily river water quality simulation values under the original physical quantity scale, and the expression is:
[0219] ;
[0220] where Y represents the continuous daily river water quality simulation values after denormalization, represents the multi-variable water quality observation data after preprocessing in step S2, represents the standard deviation of the multi-variable water quality observation data, represents the mean value of the multi-variable water quality observation data.
[0221] The model is evaluated using the continuous daily river water quality simulation values after denormalization and the multi-variable water quality observation data as follows:
[0222] ;
[0223] ;
[0224] ;
[0225] ;
[0226] In the formula, represents the continuous daily river water quality simulation values, represents the multi-variable water quality observation data, n represents the total number of paired continuous daily river water quality simulation data and multi-variable water quality observation data during the model test period, represents the mean value of the continuous daily river water quality simulation values, represents the mean value of the multi-variable water quality simulation data, represents the percentage bias, represents the Nash-Sutcliffe efficiency coefficient, represents the root mean square error, represents the Pearson correlation coefficient; after evaluating that the model output results are reliable based on the four evaluation parameters of Pbias, NSE, RMSE, and Pcorr, the continuous daily river water quality simulation values after denormalization are the final predicted continuous daily river water quality data.
[0227] The specific application ways of the present invention are numerous. The above description is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, several improvements can be made without departing from the principle of the present invention, and these improvements should also be regarded as the protection scope of the present invention.
Claims
1. A river water quality prediction method integrating quasi-quantum features and graph-temporal models, characterized in that The steps are as follows: Step S1: Obtain multi-variable water quality observation data, time series meteorological data, and static basin attribute data for multiple river stations; Step S2: Preprocess the data obtained in Step S1, and divide the preprocessed data into a training set and a test set; Step S3: Perform high-dimensional quantum-like feature transformation on the preprocessed time series meteorological data and static basin attribute data to generate corresponding meteorological quantum-like feature vectors and static basin attribute quantum-like feature vectors respectively; Step S4: Use the graph-temporal model to extract spatial dependence features, and splice and fuse the meteorological quantum-like feature vectors and static basin attribute quantum-like feature vectors in Step S3 with the spatial dependence features, and then input them together with the preprocessed multi-variable water quality observation data in Step S2 into the graph-temporal model for training to optimize the model parameters; Step S5: Perform inverse normalization on the simulated output calculated by the trained graph-temporal model to obtain continuous daily river water quality simulation data, and evaluate the model performance to predict daily continuous river water quality data.
2. The river water quality prediction method integrating quantum features and graph-temporal models according to claim 1, characterized in that The multi-variable water quality observation data, time series meteorological data, and static basin attribute data in Step S1 are organized in a site-time structure and constructed into a tensor structure of site × time × feature dimension, with a time resolution of daily scale; among them, The multi-variable water quality observation data includes dissolved oxygen, runoff, and water temperature. According to the requirements of specific prediction tasks, one or more of these variables can be selected for data prediction; The time series meteorological data includes: dew point temperature at 2 meters, potential evaporation, surface air pressure, temperature of the first layer of soil, surface net solar radiation, surface net heat radiation, total surface runoff, total precipitation, U component of wind speed at 10 meters, V component of wind speed at 10 meters, volumetric water content of the first layer of soil, and air temperature at 2 meters; The static basin attribute data includes 100 - 200 different basin attributes, and the basin attributes cover land use, topographic features, soil types, basin area, slope distribution, and vegetation index of different basins, and are used as invariant features of each river station for spatial modeling.
3. The river water quality prediction method integrating quantum characteristics and graph-temporal model according to claim 1, wherein The specific data preprocessing in Step S2 includes: Normalize the multi-variable water quality observation data, time series meteorological data, and static basin attribute data in Step S1 so that the data is converted into a distribution with a mean of 0 and a standard deviation of 1, and ensure that the data has similar scales and distributions. The formula is as follows: ; Among them, is the original data, is the average value of the original data, is the standard deviation of the original data, is the data after preprocessing.
4. The river water quality prediction method integrating quantum features and graph-temporal model according to claim 2, characterized in that, In Step S2, based on the time series of the preprocessed water quality observation data, the normalized water quality observation data, time series meteorological data, and static basin attribute data are divided into a training set and a test set according to the ratio of 75% and 25%.
5. The river water quality prediction method integrating quantum features and graph-temporal models according to claim 1, wherein The specific content of Step S3 includes: The meteorological vector of the i-th river station on the t-th day is expressed as: ; Among them, represents the meteorological vector of the $i$-th river site on the $t$-th day, indicating that the meteorological vector belongs to a real vector space of dimension , where $t = 1, 2, \ldots, T$, and $T$ is the total number of time steps; The static basin attribute vector corresponding to each river station is expressed as: ; Among them, represents the static basin attribute vector of the \(i\)-th river site; indicates that the static basin attribute vector belongs to a real vector space with a dimension of ; For each meteorological vector , the following high-dimensional quasi-quantum feature transformation is defined: Step S31: Perform sine and cosine non-linear transformation on the meteorological vector of each river station on the t-th day as follows: ; ; Among them, and respectively represent the meteorological sine feature and the meteorological cosine feature after non-linear transformation; Step S32: Perform a bivariate interaction transformation on any two different feature dimensions d1 and d2 in the meteorological vector of each river station at time step t, and calculate the interaction features, where d1, d2 ∈ {1, 2,..., D} and d1 < d2, as follows: ; Among them, , respectively represent the values of the d1-th and d2-th dimensions in the meteorological interaction features generated by the i-th river site on the t-th day, and a total of interaction dimensions are generated; Step S33: Concatenate the meteorological vector, meteorological sine feature, meteorological cosine feature, and meteorological interaction feature to obtain the meteorological quantum feature vector of the \(i\)-th river site on the \(t\)-th day , as follows: ; Among them, represents the concatenation of multiple vectors of the same dimension, which are merged along the feature dimension into an extended high-dimensional feature vector. , represents that the meteorological quantum feature vector belongs to the real vector space of dimension . Stack the meteorological quantum-like feature vectors generated from the meteorological time series along the time dimension t = 1, 2,..., T to form a meteorological quantum-like feature matrix, as follows: ; Among them, is the meteorological quantum feature matrix corresponding to the i-th hydrological observation station, is the meteorological quantum feature vector generated by the i-th river station on the t-th day, and T is the length of the time series, is the dimension of the meteorological quantum feature vector, indicates that the meteorological quantum feature matrix belongs to the real vector space with the dimension of ; Static attribute vectors for each river site , perform high-dimensional quantum-like feature transformation as follows: ; ; ; ; Among them, is the static basin attribute vector of the i-th river site; and respectively represent the sine feature and cosine feature of the static basin attribute after non-linear transformation of the static basin attribute vector; , respectively represent the values of the d1-th and d2-th dimensions in, represents the static basin attribute interaction feature; represents the static basin attribute quantum-like feature vector; , represents that the static basin attribute quantum-like feature vector belongs to the real vector space of dimension .
6. The river water quality prediction method integrating quantum features and graph-temporal models according to claim 5, characterized in that The specific process of using the graph-temporal model to extract spatial dependence features in Step S4 includes: Using the static catchment attribute vectors for each river station , the cosine similarity between all river stations is calculated as follows: ; Among them, and respectively represent the static basin attribute vectors of the $i$-th and $j$-th river sites; the cosine similarity between the static basin attribute vectors of the $i$-th and $j$-th river sites; Construct an adjacency matrix based on the similarity matrix , define the edge connection relationship in the graph structure, and the connection rules are as follows: ; Among them, is the similarity threshold; represents the element in the i-th row and j-th column of the adjacency matrix; Construct a spatial dependence node feature matrix and input the initial node feature matrix , where the i-th row is the static attribute vector of river station i , use a graph convolutional neural network for embedding learning to extract spatial dependence information. The formula is as follows: ; Among them, is the initial node feature matrix; indicates that the node feature matrix belongs to the real vector space of dimension ; represents the total number of river stations participating in graph construction, that is, the number of nodes in the graph; represents the dimension of the static basin attribute of each station; is the node feature matrix output by the th layer; is the activation function; is the node feature matrix input to the th layer; is the normalized adjacency matrix; is the trainable weight parameter matrix of the th layer; After l - layer graph convolution, the output spatial - dependence feature matrix is as follows: ; Among them, represents the spatial dependence feature matrix output after l - layer graph convolution, represents the output spatial embedding dimension, represents that the output spatial dependence feature matrix belongs to the real vector space with the dimension of 7. The river water quality prediction method integrating quantum characteristics and graph-temporal model according to claim 6, wherein In step S4, the time - series meteorological - type quantum feature vectors and static - basin - attribute - type quantum feature vectors in step S3 are concatenated and fused with the spatial - dependence features, and together with the pre - processed multi - variable water - quality observation data in step S2, they are input into the graph - time - series model for training to optimize the model parameters. Specifically, it includes: Concatenate the time - series meteorological quantum feature vectors and the static watershed attribute quantum feature vectors to obtain a high - dimensional spatio - temporal quantum feature matrix , , where T is the length of the input time step, is the total feature dimension, including the non - linear mapping term of meteorological features and the regional attribute embedding term, represents the high - dimensional feature matrix belongs to the real vector space of dimension ; Perform a replication operation on the spatial - dependence features in the time dimension to construct a spatial - feature matrix, as follows: ; Among them, represents the spatially-feature matrix after replication and extension at the \(i\)-th river site for each time step, represents the spatial-dependency feature vector of the \(i\)-th river site; Spatial dependence eigenvector of the $i$-th river station It is extended to $T$ time steps to form a dimension matching the high-dimensional spatio-temporal quantum-like feature matrix; Construct the fusion features for each time step, as follows: ; Among them, is the high-dimensional spatio-temporal quantum feature vector of site i at time t; , are both fusion weighting coefficients, and their value ranges are [0, 1]; represents the fusion feature vector of the i-th river site at the t-th time step; Construct the fused input - feature matrix, as follows: ; Among them, the fusion dimension The expression is as follows: ; Fusion feature is the final input feature sequence for river station i, representing the fusion feature belonging to the real vector space of dimension ; The fused features are input into the graph-temporal model in the format of (N, T, D); it is assumed that there are N river stations, and the dimensionality of the feature vector for each river station satisfies , then the final input data dimensionality is (N, T, ), and the combined input is expressed as: ; Among them, F represents the fused feature vector of N river stations, indicating the water quality observation data after preprocessing in step S2; Set the hyperparameters of the graph - time - series model, including defining the total number of training epochs, the model - saving frequency, the batch size, the time step, the number of units in the hidden layer, and the Dropout rate; Take the test set as the input. During the training process, the model performs forward propagation and calculates the simulated output layer by layer. The specific process is as follows: At each time step t, calculate the water - quality prediction information of the river sites at the previous time step that the model decides to retain under the current meteorological - hydrological conditions; ; Among them, represents the output vector, represents the function, represents the weight matrix, represents the hidden state at the previous time step, represents the input at the current time step, represents the bias term; Calculate the input data for the current time step The influence ratio when updating the water quality prediction status of river stations And the status of candidate units Value; ; ; Among them, represents the output vector, represents the weight matrix, represents the input data at the current time step t, represents the candidate cell state, represents the hyperbolic tangent activation function, represents the weight matrix of the candidate cell state, represents the bias vector of the candidate cell state; Update the cumulative river station water quality prediction information C for the current time step t , C t including the input for the current time step and the river station water quality prediction information for the previous time step. The calculation formula is as follows: ; Among them, and represent the unit states at the current time step and the previous time step respectively, represents element-wise multiplication; By calculating the activation value to control the information output ratio of the cell state at the current time step, and then calculate the hidden state at the current time step as the output information, and the calculation formula is as follows: ; ; Among them, represents the activation value of the output gate, represents the hidden state at the current time step, represents the weight matrix, represents the bias vector of the output gate; The hidden state at the last time step As the feature representation of the sequence, it is passed to the output layer, and the expression is as follows: ; Among them, represents the weight matrix of the output layer, represents the bias term, represents the simulated output calculated by the model; The model parameters are updated through the back - propagation algorithm, and the goal is to minimize the loss function L. The expression of the loss function L is as follows: ; Among them, represents the simulated output calculated by the model; represents the preprocessed multi-variable water quality observation data in step S2, Take 1×10 −8 , where n is the number of samples; calculate the gradient of the loss function L with respect to the model parameter θ , and the parameter θ includes all weight matrices and bias terms in the time series model; Use the gradient - descent method to update the model parameters, and the update rule is: ; where k represents the current iteration number, θ(k) is the parameter value at the k-th iteration, η is the learning rate, is the gradient of the loss function with respect to the parameter θ, and θ(k + 1) is the updated parameter value; Perform multiple iterations to gradually optimize the model parameters until the loss function converges to the minimum value or reaches the predetermined number of training epochs to complete the model training.
8. The river water quality prediction method integrating quantum features and graph-temporal models according to claim 7, characterized in that, In step S5, the simulation output of the trained graph - time - series model is de - normalized to restore the continuous daily river - water - quality simulation values in the original physical - quantity scale. The expression is: ; Among them, Y represents the continuous daily river water quality simulation value after anti-normalization, represents the preprocessed multi-variable water quality observation data in step S2, represents the standard deviation of the multi-variable water quality observation data, represents the average value of the multi-variable water quality observation data; Evaluate the model using the de - normalized continuous daily river - water - quality simulation values and the multi - variable water - quality observation data, as follows: ; ; ; ; In the formula, represents the simulated values of river water quality on consecutive daily basis, represents the multivariate water quality observation data, and n represents the total number of paired simulated values of river water quality on consecutive daily basis and multivariate water quality observation data during the model test period, represents the average value of the simulated values of river water quality on consecutive daily basis, represents the average value of the multivariate water quality simulation data, represents the percentage bias, represents the Nash efficiency coefficient, represents the root mean square error, represents the Pearson correlation coefficient; after evaluating that the model output results are reliable based on the four evaluation parameters of Pbias, NSE, RMSE and Pcorr, the simulated values of river water quality on consecutive daily basis after inverse normalization are the finally predicted daily consecutive river water quality data.
Citation Information
Patent Citations
Meteorological prediction method and device, medium and electronic device
CN117849904A
Water quality prediction method based on graph neural network and spatial-temporal feature fusion
CN119598402A
Basin hydrological multivariable prediction method based on meta-learning TFT architecture
CN119848789A
Integrated Sensing and Communications Empowered by Networked Hybrid Quantum-Classical Machine Learning
US20230368065A1
Cited By
Multi-source data driven complex water area flow direction identification method and system
CN120597006A
Urban river water quality evaluation system suitable for cold climate
CN121458160A
Drainage basin water quality multi-step forecast uncertainty quantification method and system based on double-flow graph state space model
CN122113761A