River space section water quality prediction method based on physical information neural network

By combining manual sampling with deep learning and using a one-dimensional advection-diffusion equation to constrain the data-driven model, a method for predicting water quality at river spatial cross-sections based on physical information neural networks was constructed. This solved the problem of high-precision river water quality monitoring and enabled efficient water quality prediction and management.

CN121744953BActive Publication Date: 2026-06-19ZHEJIANG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2026-02-28
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve high-precision spatial monitoring of river water quality in the absence of physical monitoring stations. Traditional mechanistic models are unable to capture complex nonlinear laws, and the performance of data-driven models depends on the sampling frequency.

Method used

By combining manual sampling with deep learning, and using a one-dimensional advection-diffusion equation to constrain the data-driven model, water quality prediction is performed using water quality data from adjacent stations and a small amount of manual sampling data. This constructs a water quality prediction method for river spatial cross-sections based on physical information neural networks.

Benefits of technology

It enables high-precision water quality prediction in the absence of water quality monitoring stations, improves the preventiveness and accuracy of water quality management, and reduces monitoring costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121744953B_ABST
    Figure CN121744953B_ABST
Patent Text Reader

Abstract

This invention discloses a method for predicting water quality at river spatial cross-sections based on a physical information neural network. The method includes: constructing a monitoring dataset using water quality data from adjacent monitoring stations; constructing a sampling dataset by obtaining water quality data from the target station through manual sampling and analysis; constructing a deep learning model that takes the monitoring dataset as input and outputs the predicted water quality for the target station; calculating the water quality mechanism prediction results based on the upstream and downstream relationships between adjacent and target stations, combined with a one-dimensional advection-diffusion equation, and designing a corresponding loss function to optimize the deep learning model; and finally, using the optimized deep learning model, predicting the water quality at the target station based on the monitoring dataset. This invention improves model efficiency and accuracy by introducing a one-dimensional advection-diffusion equation and using mechanistic knowledge to constrain the data-driven model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality prediction technology for monitoring sections in river water quality management, specifically to a method for predicting water quality at spatial river sections based on physical information neural networks. This method is applicable to the time-series prediction of water quality indicators and early warning for water environment management in river sections lacking physical monitoring stations. Background Technology

[0002] River water quality changes are influenced by multiple factors such as watershed sewage discharge, meteorological conditions, and surface runoff, exhibiting highly nonlinear, nonstationary, and strong spatiotemporal coupling characteristics.

[0003] With the popularization of IoT monitoring technology, water quality sensors can acquire multi-section data in real time with hourly resolution, providing data support for refined management.

[0004] However, physical monitoring stations are costly and difficult to maintain, which poses a challenge to high-precision spatial monitoring of river water quality.

[0005] To address this problem, existing technologies mainly include:

[0006] 1. Traditional mechanistic models (such as the environmental fluid dynamics model EFDC and the hydrodynamic model software MIKE series): are difficult to capture complex nonlinear laws, and their predictive performance is difficult to meet actual needs.

[0007] 2. Data-driven models (such as machine learning and deep learning): For example, patent specification CN119129772A discloses a method for predicting river cross-section water quality based on a combined machine learning model; another example is a method for predicting river monitoring cross-section water quality based on STL (Seasonal Trend Decomposition) and attention mechanism (CN119090114A). These technical solutions can capture complex water quality changes, but their performance depends on the sampling frequency.

[0008] Therefore, it is necessary to propose a method for predicting water quality at river spatial cross-sections based on physical information neural networks. This method can effectively utilize spatial information and mechanistic knowledge of water quality, and accurately predict water quality changes at other river monitoring sections with limited sample data. This is of great significance for changing water quality management strategies, shifting from post-event control to pre-event prevention, and improving the surface water environment. Summary of the Invention

[0009] To address the aforementioned technical problems and shortcomings in this field, this invention provides a method for predicting water quality at river spatial cross-sections based on physical information neural networks. This method can be used for intelligent monitoring and prediction of the water environment. Its main innovations include:

[0010] 1. Combining manual sampling with deep learning: Water quality indicators for target sites can be predicted using only a small amount of manually sampled data.

[0011] 2. Combining data-driven approaches with mechanistic knowledge: Introducing a one-dimensional advection-diffusion equation, and using mechanistic knowledge to constrain the data-driven model, thereby improving model efficiency and accuracy.

[0012] The specific technical solution is as follows:

[0013] In a first aspect, the present invention provides a method for predicting water quality at spatial cross-sections of river channels based on a physical information neural network, comprising:

[0014] Points where water quality monitoring stations have been deployed in the river channel are recorded as adjacent stations, and points to be predicted are recorded as target stations.

[0015] A monitoring dataset was constructed by using water quality data from adjacent monitoring stations.

[0016] A sampling dataset was constructed by manually sampling and analyzing water quality data from target sites.

[0017] Construct a deep learning model, take the monitoring dataset as input, and output the predicted water quality of the target site;

[0018] When the adjacent station is upstream of the target station, the mechanism prediction results of the water quality at the target station are calculated using a one-dimensional advection-diffusion equation based on the monitoring dataset; when the adjacent station is downstream of the target station, the mechanism prediction results of the water quality at the adjacent station are calculated using a one-dimensional advection-diffusion equation based on the predicted water quality at the target station.

[0019] Construct a loss function that includes the error between the predicted water quality of the target site and the mechanism prediction result of the water quality of the target site, or the error between the mechanism prediction result of the water quality of adjacent sites and the monitoring dataset, as well as the error between the predicted water quality of the target site and the sampling dataset.

[0020] Optimize deep learning models using loss functions;

[0021] Using an optimized deep learning model, water quality at target sites is predicted based on monitoring datasets.

[0022] In some embodiments, the method for predicting water quality at river spatial cross-sections based on physical information neural networks, wherein the construction of a monitoring dataset using water quality data from adjacent monitoring stations includes: acquiring basic information about river monitoring cross-sections, including distances between stations, flow velocities, and water quality parameter data; removing outliers from the data using the IQR (Interquartile Range) method; filling missing values ​​using linear interpolation; normalizing all input features using Z-scores; and sorting the data by time series.

[0023] In some embodiments, the method for predicting water quality at river spatial cross-sections based on physical information neural networks, wherein the manual sampling analysis to obtain water quality data at the target site specifically includes: selecting a day at regular intervals (e.g., one week) to collect water samples at the target site, collecting water samples more than four times on that day, with an interval of more than one hour between two adjacent water sample collections.

[0024] In some embodiments, the water quality prediction method for river spatial cross-sections based on physical information neural networks sorts the water quality data of target stations in the sampled dataset according to time series.

[0025] In some embodiments, the deep learning model of the river spatial cross-section water quality prediction method based on physical information neural network includes an encoder and a decoder.

[0026] In some embodiments, the water quality prediction method for river spatial cross-sections based on physical information neural networks uses an encoder and a decoder both constructed from multilayer long short-term memory neural networks (LSTM).

[0027] The aforementioned method for predicting water quality at river spatial cross-sections based on physical information neural networks can calculate downstream water quality data from upstream water quality data using a one-dimensional advection-diffusion equation.

[0028] In some embodiments, the one-dimensional advection-diffusion equation in the river channel spatial cross-section water quality prediction method based on physical information neural networks is expressed as follows:

[0029]

[0030] in, The coordinates are along the direction of water flow. It is time. It refers to the concentration of water quality indicators, parameters. , , These represent the average flow velocity, the diffusion coefficient along the flow direction, and the first-order reaction rate, respectively.

[0031] This invention calculates water quality mechanism prediction results based on the upstream and downstream relationship between adjacent sites and the target site, combined with the one-dimensional advection-diffusion equation, and designs a corresponding loss function to optimize the deep learning model accordingly.

[0032] The water quality prediction method for river spatial cross-sections based on physical information neural networks, when the adjacent station is located upstream of the target station, includes the error between the predicted water quality of the target station and the mechanism prediction result of the water quality of the target station, as well as the error between the predicted water quality of the target station and the sampled dataset.

[0033] The water quality prediction method for river spatial cross-sections based on physical information neural networks, when the adjacent station is located downstream of the target station, includes the error between the mechanism prediction result of the water quality of the adjacent station and the monitoring dataset, as well as the error between the predicted water quality of the target station and the sampling dataset.

[0034] In some embodiments, the error in the method for predicting water quality at river spatial cross-sections based on physical information neural networks is the mean square error (MSE).

[0035] In some embodiments, the method for predicting water quality at river spatial cross-sections based on physical information neural networks calculates the error between the predicted water quality at the target site and the mechanism prediction result of the water quality at the target site using the following formula. :

[0036]

[0037] in, The number of data samples. For the predicted water quality of the target site, The results are the mechanism predictions for water quality at the target site.

[0038] In some embodiments, the method for predicting water quality at river spatial cross-sections based on physical information neural networks calculates the error between the predicted water quality at the target station and the sampled dataset using the following formula. :

[0039]

[0040] in, This refers to the number of manually collected data samples. Water quality data for target sites obtained through manual sampling and analysis. Predicted water quality for the target site.

[0041] In some embodiments, the method for predicting water quality at river spatial cross-sections based on physical information neural networks calculates the error between the mechanistic prediction results of water quality at adjacent stations and the monitoring dataset using the following formula. :

[0042]

[0043] in, The number of data samples. Water quality data from adjacent monitoring stations monitored by the water quality monitoring station. The results are the mechanism predictions for water quality at adjacent sites.

[0044] In some embodiments, the water quality prediction method for river spatial cross-sections based on physical information neural networks, when the adjacent station is located upstream of the target station, has a loss function. The expression is as follows:

[0045]

[0046] in, This indicates the error between the predicted water quality at the target site and the mechanistic prediction results for the water quality at the target site. This represents the error between the predicted water quality at the target site and the sampled dataset. , They are respectively , The weight parameters.

[0047] In some embodiments, the water quality prediction method for river spatial cross-sections based on physical information neural networks, when the adjacent station is downstream of the target station, has a loss function. The expression is as follows:

[0048]

[0049] in, This indicates the error between the mechanistic prediction results of water quality at adjacent sites and the monitoring dataset. This represents the error between the predicted water quality at the target site and the sampled dataset. , They are respectively , The weight parameters.

[0050] Furthermore, the feasibility of the method of the present invention can be tested by pairing different adjacent sites and target sites, and the prediction results can be evaluated using the Nash-Sutcliffe efficiency coefficient (NSE).

[0051] As a general inventive concept, in a second aspect, the present invention provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the method for predicting water quality at river spatial cross-sections based on a physical information neural network as described in the first aspect.

[0052] Thirdly, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the method for predicting water quality at spatial cross-sections of a river channel based on a physical information neural network as described in the first aspect.

[0053] Compared with the prior art, the beneficial effects of this invention are as follows:

[0054] For any target station in a river channel, even if there is a lack of water quality monitoring stations, this invention can still utilize water quality data monitored by adjacent stations and a small amount of manually sampled target station water quality data, combined with a one-dimensional advection-diffusion equation, and optimize the deep learning model through mechanistic knowledge constraints to achieve high-precision water quality prediction. Attached Figure Description

[0055] Figure 1 This is a schematic diagram of a water quality monitoring section in a river basin.

[0056] Figure 2 This is a performance comparison chart of different water quality parameters under different models in embodiments of the present invention.

[0057] Figure 3 The graph shows the performance of the hybrid model proposed in this embodiment of the invention at different sampling frequencies. Detailed Implementation

[0058] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention.

[0059] like Figure 1 As shown, the drainage area of ​​a certain river is approximately 60 square kilometers. The abundant water resources in this basin provide a strong guarantee for the stable development of various industries in the region and surrounding areas. However, with rapid economic development and continuous improvement in urbanization, water consumption in the region has increased rapidly, and large amounts of industrial wastewater and domestic sewage have been discharged. The water quality of urban surface water bodies has deteriorated, and water quality-related water shortages have become increasingly prominent.

[0060] This embodiment of the method for predicting water quality at river spatial cross-sections based on physical information neural networks includes the following steps:

[0061] Automatic water quality monitoring stations were deployed at five monitoring sections (S1-S5) along the river in the region to record historical water quality data from January 1, 2021 to December 31, 2023. The data was then sorted by time series to construct a monitoring dataset. During the dataset construction process, basic information about the river monitoring sections was acquired, including distances between stations, flow velocity, and water quality parameters. Outliers were removed using the IQR method, and missing values ​​were filled using linear interpolation. All input features were Z-score normalized and sorted by time series.

[0062] From January 1, 2021 to December 31, 2022, manual sampling was conducted at five monitoring sections, once every week, with four water samples taken each time. The time interval between two consecutive water sample collections was more than one hour. Water quality data were obtained by analysis, sorted by time series, and a sampling dataset was constructed.

[0063] When training and validating the model, any one of the cross sections can be considered as the target site, and any of the remaining cross sections can be considered as adjacent sites. This results in a total of 20 adjacent site-target site pairs.

[0064] Construct a hybrid deep learning model (or simply hybrid model) that takes the monitoring dataset of neighboring stations as input and outputs the predicted water quality of the target station.

[0065] When an adjacent station is located upstream of the target station, the mechanism prediction of water quality at the target station is calculated using a one-dimensional advection-diffusion equation based on the monitoring dataset. A loss function is constructed, which includes the error between the predicted water quality at the target station and the mechanism prediction of water quality at the target station, as well as the error between the predicted water quality at the target station and the sampled dataset at the target station.

[0066] When an adjacent site is located downstream of the target site, the mechanistic prediction of the water quality at the adjacent site is calculated using a one-dimensional advection-diffusion equation based on the predicted water quality at the target site. A loss function is constructed, which includes the error between the mechanistic prediction of the water quality at the adjacent site and the monitoring dataset at the adjacent site, as well as the error between the predicted water quality at the target site and the sampling dataset.

[0067] The one-dimensional advection-diffusion equation is expressed as follows:

[0068]

[0069] in, The coordinates are along the direction of water flow. It is time. It refers to the concentration of water quality indicators, parameters. , , These represent the average flow velocity, the diffusion coefficient along the flow direction, and the first-order reaction rate, respectively.

[0070] The error between the predicted water quality at the target site and the mechanism-based prediction results for the water quality at the target site is calculated using the following formula. :

[0071]

[0072] in, The number of data samples. For the predicted water quality of the target site, The results are the mechanism predictions for water quality at the target site.

[0073] The error between the predicted water quality at the target site and the sampled dataset is calculated using the following formula. :

[0074]

[0075] in, This refers to the number of manually collected data samples. Water quality data for target sites obtained through manual sampling and analysis. Predicted water quality for the target site.

[0076] The error between the mechanistic prediction results of water quality at adjacent sites and the monitoring dataset is calculated using the following formula. :

[0077]

[0078] in, The number of data samples. Water quality data from adjacent monitoring stations monitored by the water quality monitoring station. The results are the mechanism predictions for water quality at adjacent sites.

[0079] When the adjacent station is upstream of the target station, the loss function The expression is as follows:

[0080]

[0081] in, This indicates the error between the predicted water quality at the target site and the mechanistic prediction results for the water quality at the target site. This represents the error between the predicted water quality at the target site and the sampled dataset. , They are respectively , The weight parameters.

[0082] When the adjacent station is downstream of the target station, the loss function The expression is as follows:

[0083]

[0084] in, This indicates the error between the mechanistic prediction results of water quality at adjacent sites and the monitoring dataset. This represents the error between the predicted water quality at the target site and the sampled dataset. , They are respectively , The weight parameters.

[0085] The optimal parameters of the hybrid deep learning model were determined using grid search, with the encoder hidden layer dimension being 512, the encoder LSTM layer number being 3, the decoder hidden layer dimension being 512, the decoder LSTM layer number being 3, the maximum number of training epochs being 300, and the learning rate being 0.0001.

[0086] In addition, a mechanistic model (predicting using only the one-dimensional advection-diffusion equation) and a pure data-driven model (using only a deep learning model, without combining the one-dimensional advection-diffusion equation, referred to as data-driven) with the same input data were calibrated and trained for performance comparison.

[0087] For model prediction results, the Nash efficiency coefficient ( The algorithm's prediction accuracy is evaluated using the following formula:

[0088]

[0089] in, This represents the actual value of the water quality parameter to be predicted. This represents the predicted value of the water quality parameter to be predicted. This represents the average value of the actual values ​​of the water quality parameter to be predicted. This indicates the number of data values ​​in a time series.

[0090] In this embodiment, to verify the predictive effectiveness of the above method, electrical conductivity (Cond), dissolved oxygen (DO), ammonia nitrogen (NH3-N), and total phosphorus (TP) were selected as key water quality parameters for the river section for prediction. The prediction results are compared with those of... Figure 2 As shown, the actual monitored values ​​of water quality parameters at the studied river cross-section are basically consistent with the model predictions, with the NSE reaching a maximum of 0.93, indicating that the method has high prediction accuracy and is fully capable of practical application. Furthermore, the proposed hybrid model with physical information exhibits the best performance, outperforming both the mechanistic model and the purely data-driven model across different water quality indicators.

[0091] Depend on Figure 3It can be seen that as the frequency of manual sampling increases, the uncertainty of the proposed hybrid model with physical information gradually decreases and its stability increases, which provides a scientific basis for specifying sampling schemes in practical applications.

[0092] Furthermore, it should be understood that after reading the above description of the present invention, those skilled in the art can make various alterations or modifications to the present invention, and these equivalent forms also fall within the scope defined by the appended claims.

Claims

1. A method for predicting water quality at spatial cross-sections of river channels based on physical information neural networks, characterized in that, include: Points where water quality monitoring stations have been deployed in the river channel are recorded as adjacent stations, and points to be predicted are recorded as target stations. A monitoring dataset was constructed by using water quality data from adjacent monitoring stations. A sampling dataset was constructed by manually sampling and analyzing water quality data from target sites. Construct a deep learning model, take the monitoring dataset as input, and output the predicted water quality of the target site; When the adjacent site is located upstream of the target site, the mechanism prediction results of the water quality at the target site are calculated based on the monitoring dataset using the one-dimensional advection-diffusion equation; When the adjacent site is downstream of the target site, the mechanism prediction results of the water quality of the adjacent site are calculated using the one-dimensional advection-diffusion equation based on the predicted water quality of the target site. Construct a loss function that includes the error between the predicted water quality of the target site and the mechanism prediction result of the water quality of the target site, or the error between the mechanism prediction result of the water quality of adjacent sites and the monitoring dataset, as well as the error between the predicted water quality of the target site and the sampling dataset. Optimize deep learning models using loss functions; Using an optimized deep learning model, water quality at target sites is predicted based on monitoring datasets.

2. The method for predicting water quality at river spatial cross-sections based on physical information neural networks according to claim 1, characterized in that, The method of constructing a monitoring dataset by monitoring water quality data from adjacent monitoring stations includes: acquiring basic information of river monitoring sections, including distances between stations, flow velocities, and water quality parameter data; using the IQR method to remove outliers from the data; using linear interpolation to fill in missing values; performing Z-score normalization on all input features; and sorting the data by time series.

3. The method for predicting water quality at river spatial cross-sections based on physical information neural networks according to claim 1, characterized in that, The manual sampling analysis to obtain water quality data at the target site specifically includes: selecting a day at regular intervals to collect water samples at the target site, collecting water samples more than four times in total on that day, with an interval of more than 1 hour between two adjacent water sample collections.

4. The method for predicting water quality at spatial cross-sections of rivers based on physical information neural networks according to claim 1, characterized in that, The water quality data of the target stations in the sampled dataset are sorted by time series.

5. The method for predicting water quality at river spatial cross-sections based on physical information neural networks according to claim 1, characterized in that, Deep learning models consist of encoders and decoders.

6. The method for predicting water quality at river spatial cross-sections based on physical information neural networks according to claim 5, characterized in that, Both the encoder and decoder are constructed using multi-layered long short-term memory neural networks.

7. The method for predicting water quality at river spatial cross-sections based on physical information neural networks according to claim 1, characterized in that, The error mentioned is the mean square error.

8. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the method for predicting water quality at spatial cross-sections of a river channel based on a physical information neural network as described in any one of claims 1 to 7.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing at least one instruction, which is loaded and executed by the processor to implement the method for predicting water quality at spatial cross-sections of a river channel based on a physical information neural network as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • River channel monitoring section water quality prediction method based on STL decomposition and attention mechanism

    CN119090114A

  • River section water quality prediction method based on combined machine learning model

    CN119129772A

  • Water quality prediction method and device, computer equipment and storage medium

    CN120105053A

  • Lake and reservoir water quality intelligent forecasting method and system based on physical constraint guidance and medium

    CN121561614A