A method for tracing pollution of a river

CN117391463BActive Publication Date: 2026-08-07SHANGHAI UBIQUITOUS NAVIGATION TECHNOLOGYCO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI UBIQUITOUS NAVIGATION TECHNOLOGYCO LTD
Filing Date
2023-09-20
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0006]有鉴于此,本发明提供了一种河流污染的溯源方法,可解决现有技术中污染溯源效率低、误差大、建模受限、准确性低的问题

Benefits of technology

[0065]经由上述的技术方案可知,与现有技术相比,本发明公开提供了一种河流污染的溯源方法,综合应用了扩散波模型、BP神经网络、贝叶斯算法和蒙特卡洛抽样方法,充分发挥了各自的优势,提高了对河流污染溯源结果的准确性和可靠性。通过本方法,环境管理者可以获得全面的河流污染源信息,支持科学决策和制定有效的污染防控措施。同时,本方法还具有普适性和可操作性,适用于不同河流和污染物的溯源问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117391463B_ABST
    Figure CN117391463B_ABST
Patent Text Reader

Abstract

The application discloses a river pollution tracing method, comprising the following steps: collecting monitoring data at different positions in a river; obtaining longitudinal diffusion coefficients and first-order attenuation coefficients of different pollution factors, establishing a diffusion wave model, and simulating and calculating space-time distribution data of the pollutants in the water body; taking the monitoring data and the corresponding space-time distribution data as input data sets of a BP neural network model, and performing iterative training; then inputting monitoring data of a target river to be predicted into the trained BP neural network model to obtain a prediction result corresponding to the target river; introducing a Bayesian algorithm to post-process the prediction result to obtain a probability distribution of pollution source parameters; and finally adopting a Monte Carlo sampling method to sample and process the probability distribution of the pollution source parameters to obtain an approximate solution of a tracing result of the target river. The method can realize efficient, accurate and reliable river pollution tracing and provides decision support for environmental management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of river pollution source tracing, and particularly to a method for tracing river pollution sources, more specifically to a method for tracing river pollution sources based on a diffuse wave model, a backpropagation neural network, a Bayesian algorithm, and Monte Carlo sampling. Background Technology

[0002] Currently, with rapid industrialization and urbanization, river pollution has become one of the most serious environmental problems facing the world. Source tracing of river pollution is crucial for effective environmental management and protection. However, current methods for tracing river pollution sources face several challenges and limitations, including high workload, low efficiency, potential for error, and uncertainties in model simulations.

[0003] Traditional manual source tracing methods primarily rely on on-site investigations, sample analysis, and isotope analysis to determine the source and transmission pathway of pollutants. This approach is time-consuming and resource-intensive, limited by sample acquisition constraints, and therefore inefficient. Furthermore, human factors can introduce errors.

[0004] Another common approach is to use mathematical models to simulate and identify pollution sources. These models simulate the transport and diffusion of pollutants in rivers, providing comprehensive information on pollution source tracing. However, the accuracy and reliability of these models are limited by the selection of model parameters and the assumptions made about them. Furthermore, model simulations require a reasonable description of the physical and chemical processes of rivers, which presents certain challenges in practical application.

[0005] Therefore, there is a need for an efficient, accurate, and reliable method for tracing the source of river pollution, which can intelligently and quickly determine the location, intensity, and timing of pollution occurrences. This would provide crucial support for environmental managers to take appropriate measures and is of great significance for subsequent emergency response. Summary of the Invention

[0006] In view of this, the present invention provides a method for tracing the source of river pollution, which can solve the problems of low efficiency, large error, limited modeling, and low accuracy in the existing technology for tracing the source of pollution.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] This invention provides a method for tracing the source of river pollution, comprising the following steps:

[0009] Data collection and preprocessing steps: Collect hydrological information, topographic information, and pollutant concentrations at different locations in the river, and perform preprocessing to obtain monitoring data; the hydrological information includes: water flow velocity and water depth; the topographic information includes: river channel width and depth;

[0010] Steps for establishing a diffusion wave model: Obtain the longitudinal diffusion coefficient and first-order attenuation coefficient of different pollutants; establish a diffusion wave model based on the characteristics and physical processes of the river; and simulate and calculate the spatiotemporal distribution data of pollutants in the water body.

[0011] Neural network training steps: Construct a BP neural network model, using the monitoring data and the corresponding spatiotemporal distribution data as the input dataset for the BP neural network model, and perform iterative training;

[0012] Neural network prediction steps: Input the monitoring data of the target river to be predicted into the trained BP neural network model to obtain the predicted pollution source location, pollution occurrence time and pollution intensity corresponding to the target river;

[0013] Bayesian network construction steps: Introduce the Bayesian algorithm to post-process the predicted pollution source location, pollution occurrence time and pollution intensity to obtain the probability distribution of pollution source parameters;

[0014] Monte Carlo sampling steps: The probability distribution of the pollution source parameters is sampled and processed using the Monte Carlo sampling method to obtain an approximate solution for the source tracing results of the target river.

[0015] Furthermore, the data collection and preprocessing steps include:

[0016] Water quality sensors are used to monitor and collect water quality parameters at different locations in a river in real time, including hydrological information and pollutant concentration; and river topographic information is collected; the hydrological information includes: water flow velocity and water depth; the topographic information includes: river width and depth.

[0017] The water quality parameters are cleaned by aligning and correcting the data according to the time series, filtering out erroneous and missing values, detecting and deleting outliers, and then normalizing the data.

[0018] Extract effective time series features from the treated water quality parameters.

[0019] Furthermore, in the step of establishing the diffused wave model, the diffused wave model is expressed using the Saint-Venant equations:

[0020]

[0021]

[0022] In the formula, C is the pollutant concentration at a distance x from the pollution source along the river channel at time t, in mg / L; U is the average flow velocity, in m / s; and D is the diffusion coefficient of the pollutant in the water body, in m³ / s. 2 / s; K is the first-order attenuation coefficient, s -1m represents the mass of pollutants per unit area at the pollution source, expressed in grams.

[0023] Furthermore, the neural network training step includes:

[0024] The monitoring data and the corresponding spatiotemporal distribution data are used as a dataset and divided into a training set, a test set, and a validation set according to a preset ratio.

[0025] Design and construct a BP neural network model suitable for tracing the source of river pollution, including the settings of the input layer, hidden layer and output layer;

[0026] Weights and biases are initialized randomly, and the Swish activation function is used as the activation function for each hidden layer node.

[0027] Model training includes: forward propagation, calculating the loss function, back propagation, parameter updates, and repeated iterations;

[0028] The model's performance is evaluated using the validation set. When the performance exceeds a threshold, training is stopped, and the model is considered a well-trained BP neural network model.

[0029] Furthermore, a BP neural network model suitable for tracing river pollution sources was designed and constructed, including the settings of the input layer, hidden layers, and output layer, as follows:

[0030] Design and construct a BP neural network model suitable for tracing the source of river pollution, and determine the number of nodes in the input layer based on water quality parameters, with each node corresponding to a water quality index;

[0031] The number of nodes and layers in the hidden layer are determined based on the complexity of the problem and the characteristics of the dataset; the number of neurons is selected using an empirical formula:

[0032]

[0033] In the formula: N is the number of hidden layer neurons, s is the number of input neurons, p is the number of output nodes, and c is a constant between 1 and 10;

[0034] Determine the number of nodes in the output layer: Set the number of nodes in the output layer to 3, including the location of the pollution source, the time of occurrence, and the intensity of pollution.

[0035] Furthermore, the specific process of model training includes:

[0036] Forward propagation steps: Input data is passed into the network, and the output values ​​of the hidden and output layers are calculated through weighted summation and activation functions at each layer;

[0037] Steps for calculating the loss function: Compare the output obtained from the forward propagation with the measured values, and calculate the loss function, which is the mean squared error (MSE) between the predicted and actual values.

[0038]

[0039] In the formula, y i o The measured water quality parameter value is y. i p The model predicts water quality parameter values; n is the number of data points for the predicted water quality parameters; i = [1, 2, ..., n];

[0040] Backpropagation steps: Calculate the gradients of the output and hidden layers based on the loss function, and then backpropagate these gradients back to the input layer using the chain rule to update the weights and biases.

[0041] Parameter update steps: Based on the calculated gradient, the gradient descent method is used to update the parameters, and the weights and biases of the model are continuously adjusted so that the model can adapt to the characteristics and relationships of water quality parameters.

[0042] Repeated iteration steps: Repeat the forward propagation, loss calculation, back propagation and parameter update steps until the maximum number of iterations is reached or the loss function converges.

[0043] Furthermore, the performance of the model is evaluated using the validation set, and training is stopped when the performance exceeds a threshold. The resulting trained BP neural network model includes:

[0044] The performance of the model was evaluated using a validation set. Evaluation metrics included: mean absolute error (MAE), root mean square error (RMSE), and prediction interval coverage (PICP).

[0045]

[0046]

[0047]

[0048] PICP represents the true probability that the actual value falls within the prediction interval; the larger the value, the greater the probability that the measured value falls within the prediction interval. i This indicates whether the i-th actual value falls within the prediction interval, with 0 indicating no and 1 indicating yes. When the PICP value is greater than the preset threshold, training stops, and the result is used as a trained BP neural network model.

[0049] Furthermore, the Bayesian network construction step includes:

[0050] Establish a priori distribution of pollution source locations and release amounts;

[0051] The likelihood function of the Bayesian algorithm is constructed using the prediction results of the BP neural network model;

[0052] According to Bayes' theorem, the prior distribution and the likelihood function are multiplied to obtain the posterior distribution, which serves as the probability distribution of the pollution source parameters.

[0053] Furthermore, the likelihood function of the Bayesian algorithm is constructed using the prediction results of the BP neural network model, including:

[0054] The prediction results of the BP neural network model are considered to conform to a Gaussian distribution, and the actual observed values ​​are considered to be observed data points.

[0055] For each prediction value of the BP neural network, calculate the difference between it and the corresponding actual observation value;

[0056] The difference is taken as the standard deviation of the Gaussian distribution;

[0057] The probability density of each observation under the Gaussian distribution is calculated using the probability density function of the Gaussian distribution.

[0058] Furthermore, the Monte Carlo sampling step includes:

[0059] 1) Randomly select an initial sample from the prior distribution as the starting point of the Markov chain;

[0060] 2) Construct a proposal function that conforms to a normal distribution, and generate a candidate sample with randomness in the parameter space based on the proposal function;

[0061] 3) Calculate the acceptance rate and determine whether to accept or reject a new sample based on the acceptance rate; the acceptance rate is obtained by comparing the likelihood function value of the candidate sample with the likelihood function value of the current sample;

[0062] 4) Update the sample based on the results of accepting or rejecting new samples;

[0063] 5) Repeat steps 2)-4) until the set number of iterations is met or the average and variance during the iteration process stabilize within the preset range;

[0064] 6) By retaining a series of samples of the Markov chain, an approximate posterior distribution is obtained; by statistically analyzing the mean, variance, and confidence interval of the series of samples, an approximate solution for the source tracing result of the target river is obtained.

[0065] As can be seen from the above technical solution, compared with the prior art, this invention discloses a method for tracing the source of river pollution. It comprehensively applies the diffuse wave model, BP neural network, Bayesian algorithm, and Monte Carlo sampling method, giving full play to their respective advantages and improving the accuracy and reliability of the results for tracing the source of river pollution. Through this method, environmental managers can obtain comprehensive information on river pollution sources, supporting scientific decision-making and the formulation of effective pollution prevention and control measures. Furthermore, this method is universal and operable, applicable to the source tracing problems of different rivers and pollutants. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0067] Figure 1 A flowchart illustrating a method for tracing the source of river pollution provided in an embodiment of the present invention.

[0068] Figure 2 This is a schematic diagram illustrating the principle of a river pollution source tracing method provided in an embodiment of the present invention.

[0069] Figure 3 The Monte Carlo sampling flowchart is provided for an embodiment of the present invention. Detailed Implementation

[0070] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0071] This invention relates to a river pollution source tracing method based on a diffuse wave model, BP neural network, Bayesian algorithm, and Monte Carlo sampling. It aims to provide a high-precision and reliable scheme for tracing river pollution sources, estimating the location of pollution sources, the time of pollution occurrence, and the intensity of pollution, thereby providing decision support for environmental management. This method comprehensively considers physical processes, data-driven predictive capabilities, uncertainty modeling, and diversity analysis, effectively addressing the limitations and challenges of traditional river pollution source tracing methods.

[0072] Reference Figure 1 As shown in the figure, an embodiment of the present invention discloses a method for tracing the source of river pollution, including the following steps:

[0073] Data collection and preprocessing steps: Collect hydrological information, topographic information, and pollutant concentrations at different locations in the river, and perform preprocessing to obtain monitoring data; the hydrological information includes: water flow velocity and water depth; the topographic information includes: river channel width and depth;

[0074] Steps for establishing a diffusion wave model: Obtain the longitudinal diffusion coefficient and first-order attenuation coefficient of different pollutants; establish a diffusion wave model based on the characteristics and physical processes of the river; and simulate and calculate the spatiotemporal distribution data of pollutants in the water body.

[0075] Neural network training steps: Construct a BP neural network model, using the monitoring data and the corresponding spatiotemporal distribution data as the input dataset for the BP neural network model, and perform iterative training;

[0076] Neural network prediction steps: Input the monitoring data of the target river to be predicted into the trained BP neural network model to obtain the predicted pollution source location, pollution occurrence time and pollution intensity corresponding to the target river;

[0077] Bayesian network construction steps: Introduce the Bayesian algorithm to post-process the predicted pollution source location, pollution occurrence time and pollution intensity to obtain the probability distribution of pollution source parameters;

[0078] Monte Carlo sampling steps: The probability distribution of the pollution source parameters is sampled and processed using the Monte Carlo sampling method to obtain an approximate solution for the source tracing results of the target river.

[0079] First, this method employs a diffusion wave model to describe the transport and diffusion process of pollutants in water bodies. This model comprehensively considers the influence of factors such as water flow velocity and diffusion coefficient on pollutant propagation, and can accurately describe the spatiotemporal distribution of pollutants in water bodies. Second, this method introduces a backpropagation (BP) neural network algorithm to predict the location of pollution sources, the time of pollution occurrence, and the intensity of pollution. By training the neural network model and using a large amount of water quality monitoring data and simulation results from the diffusion wave model as learning data, the neural network can learn the complex relationship between water quality indicators and the location of pollution sources, thereby achieving accurate prediction of the location of pollution sources, the time of pollution occurrence, and the intensity of pollution.

[0080] Since BP neural networks may suffer from overfitting and other uncertainties, this method introduces a Bayesian algorithm to post-process the prediction results of the BP neural network and provides a confidence assessment of the traceability results, which can effectively alleviate the overfitting problem of the model. Finally, considering the randomness of the parameters and the random error of the observation data, the Monte Carlo sampling method is used to sample the uncertainties, resulting in a series of diverse traceability results, providing more comprehensive traceability information, and enhancing the reliability and robustness of the traceability results.

[0081] The advantage of this invention lies in its comprehensive application of the diffuse wave model, BP neural network, Bayesian algorithm, and Monte Carlo sampling method, fully leveraging the strengths of each to improve the accuracy and reliability of source tracing results. Through this method, environmental managers can obtain comprehensive information on river pollution sources, supporting scientific decision-making and the development of effective pollution control measures. Furthermore, this method is universal and operable, applicable to source tracing problems of different rivers and pollutants.

[0082] The following are the general steps for applying the diffuse wave model in conjunction with neural networks, Bayesian algorithms, and Monte Carlo sampling to river pollution source tracing. (Refer to...) Figure 2 As shown, the process is as follows:

[0083] Step S01: Data collection and preparation, specifically including:

[0084] 1) Using water quality sensors and other equipment, real-time monitoring and collection of water quality parameters at different locations in the river are carried out. The data includes pollutant concentration, water flow velocity, and water depth. At the same time, river topographic data are collected, including river width and river depth.

[0085] 2) Obtain the longitudinal diffusion coefficient and first-order decay coefficient of different pollutants through literature review;

[0086] 3) Build a dataset based on all the collected data, ensuring that the dataset contains enough samples and features for training and evaluation.

[0087] Step S02: Data preprocessing, including:

[0088] The collected measured data may contain outliers and missing values, so the collected data needs to be preprocessed, including data cleaning, aligning and correcting the data according to the time series, filtering out erroneous and missing values, detecting and deleting outliers; after processing, normalization is performed to ensure the reliability and consistency of the data.

[0089] Feature extraction: Organize the collected data and analyze the characteristics of the river water body to extract effective time series features from the water quality data as input to the BP neural network;

[0090] Step S03: Establishing the Diffused Wave Model:

[0091] Based on the characteristics and physical processes of rivers, a diffusion wave model is established to describe the transport and diffusion behavior of pollutants in water bodies. Since the longitudinal length of a river is usually much greater than its width and depth, the river flow can be generalized into a one-dimensional problem, expressed using the Saint-Venant equations:

[0092]

[0093]

[0094] In the formula, C is the pollutant concentration at a distance x from the pollution source along the river channel at time t, in mg / L; U is the average flow velocity, in m / s; and D is the diffusion coefficient of the pollutant in the water body, in m³ / s. 2 / s; K is the first-order attenuation coefficient, s -1 ; m represents the mass of pollutants per unit area at the pollution source, in grams. The model parameters are calibrated and adjusted considering factors such as water flow velocity, water depth, and river topography.

[0095] To simulate potential sudden pollution points and intensities, different scenario plans are developed: based on actual river conditions and the location of potential pollution sources, multiple possible sudden pollution points can be pre-defined, considering different pollutant release rates or concentrations. Using a validated diffusion wave model, the propagation path, concentration distribution, and temporal changes of pollutants in the water body are simulated and calculated. These simulation results will serve as input data for a BP neural network model.

[0096] Step S04: Neural Network Training and Prediction: Design and construct a neural network model suitable for tracing river pollution sources, including the settings of the input layer, hidden layers, and output layer. Train the neural network model to learn patterns and correlations in the data, predicting the location of pollution sources, the timing of pollution occurrence, and the intensity of pollution. Specific steps are as follows:

[0097] (1) Data partitioning: The collected measured monitoring data and the calculation results of the diffusion wave model were used as the input dataset for the BP neural network. The dataset was divided into a training set and a test set in a 7:3 ratio, with 20% of the data in the training set used as the validation set. The training set was used for training the neural network model, the validation set was used for model parameter tuning, and the test set was used for the final model evaluation.

[0098] (2) Mesh architecture design:

[0099] 2.1) Determine the number of nodes in the input layer based on water quality data, with each node corresponding to a water quality index;

[0100] 2.2) Determine the number of nodes and layers in the hidden layer based on the complexity of the problem and the characteristics of the dataset; for river water quality, the data structure complexity is relatively low, and a 3-layer grid structure can be used, i.e., only 1 hidden layer; the number of neurons can be selected using an empirical formula:

[0101]

[0102] In the formula: N is the number of hidden layer neurons, s is the number of input neurons, p is the number of output nodes, and c is a constant between 1 and 10. Based on the above empirical formula, the approximate range of hidden layer nodes can be calculated. Different nodes are selected within the range to build models and perform calculations. The number of hidden layer nodes is determined based on the final accuracy.

[0103] 2.3) Determine the number of nodes in the output layer: Set the number of nodes in the output layer to 3, including the location of the pollution source, the time of occurrence, and the intensity of pollution;

[0104] (3) Initialize grid parameters: Randomly initialize weights and biases, and use the Swish activation function as the activation function for each hidden layer node to enhance the nonlinear expressive power of the network;

[0105] (4) Model Training

[0106] Forward propagation: Input data is passed into the network, and the output values ​​of the hidden and output layers are calculated through weighted summation and activation functions at each layer.

[0107] Calculate the loss function: Compare the output obtained from the forward propagation with the measured values, and calculate the loss function, which is the mean squared error (MSE) between the predicted and actual values.

[0108]

[0109] In the formula, y i o For actual measured water quality values, y i p n represents the water quality values ​​predicted by the model; n is the number of predicted water quality data points.

[0110] Backpropagation: Calculate the gradients of the output layer and hidden layer based on the loss function, and propagate the gradients back to the input layer using the chain rule to update the weights and biases.

[0111] Parameter update: Based on the calculated gradient, the gradient descent method is used to update the parameters, continuously adjusting the model's weights and biases so that the model can adapt to the characteristics and relationships of the water quality data.

[0112] Repeated iteration: Repeat the steps of forward propagation, loss calculation, back propagation and parameter update until the maximum number of iterations is reached or the loss function converges.

[0113] (5) Model evaluation and tuning: The performance of the model is evaluated using the validation set. Evaluation metrics include mean absolute error (MAE), root mean square error (RMSE), and prediction interval coverage (PICP).

[0114]

[0115]

[0116]

[0117] PICP represents the true probability that the actual value falls within the prediction interval; the larger the value, the greater the probability that the measured value falls within the prediction interval. i This indicates whether the i-th actual value falls within the prediction interval, with 0 indicating no and 1 indicating yes. When the PICP value is greater than a threshold, such as 95%, training stops, and the resulting model is considered a trained BP neural network model.

[0118] (6) Model prediction: The trained neural network model is used to predict and trace the source of new water quality data of the river to be detected. The new water quality data is input into the trained model to obtain the prediction results. Based on the model output, the location of the pollution source, the time of pollution occurrence, and the intensity of pollution are inferred.

[0119] Step S05: Bayesian Network Construction: The advantages of BP neural networks lie in their flexibility and efficiency. Parameters can be optimized using the backpropagation algorithm, and they can fit complex nonlinear relationships. However, BP neural networks are prone to overfitting and are insufficient in handling data uncertainty. This invention compensates for the shortcomings of BP neural networks in handling uncertainty through a Bayesian algorithm, providing more accurate prediction results and confidence intervals. The likelihood function of the Bayesian algorithm is constructed based on the prediction results of the BP neural network, and a Bayesian network model is established based on prior knowledge. This can be performed according to the following steps:

[0120] (1) Establishment of prior distribution: Before performing Bayesian algorithm processing, it is necessary to establish the prior distribution of pollution source location and release amount. Based on the water quality monitoring data and the parameters and assumptions in the diffusion wave model, such as pollutant release location, water flow velocity and water body characteristics, the normal distribution probability density function of the prior data of key variables is established.

[0121] (2) Calculate the likelihood function

[0122] The likelihood function of a Bayesian model represents the probability of an observation occurring given the model parameters. Bayes' theorem formula is:

[0123]

[0124] In the formula, P(X) is the prior distribution of the unknown parameter X of the pollution source, P(Y|X) is the likelihood function, representing the conditional probability of the pollution monitoring data Y given the unknown parameter X of the pollution source, P(X|Y) is the posterior probability density function, representing the probability distribution of the pollution source location parameter X after obtaining the monitoring data Y, and P(Y) is the unconditional probability of the pollution monitoring data.

[0125] A backpropagation (BP) neural network can be trained to obtain a parameterized model that maps input data to output results, including the location of pollution sources and the prediction of pollutant concentrations. Within the Bayesian framework, the output of a BP neural network can be interpreted as a probability density function of observed data given parameters. By using the output of the BP neural network as a likelihood function, it can be multiplied by the prior distribution to obtain the posterior probability. The specific steps for constructing the likelihood function based on the output of the BP neural network are as follows:

[0126] 1) Treat the predicted output of the BP neural network as conforming to a Gaussian distribution, and the actual values ​​as observed data points;

[0127] 2) For each predicted value of the BP neural network, calculate the difference between it and the corresponding actual observed value;

[0128] 3) Use the difference as the standard deviation of the Gaussian distribution;

[0129] 4) Calculate the probability density of each observation under the Gaussian distribution using the probability density function of the Gaussian distribution.

[0130] (4) Calculate the posterior distribution

[0131] According to Bayes' theorem, the posterior distribution can be obtained by multiplying the prior distribution and the likelihood function. The posterior distribution represents a new estimate of the model parameters after the data has been observed.

[0132] Posterior probability density function:

[0133]

[0134] In the formula, σ is the observation error, n is the quantity of the observed value, and Y i For the observed value, T i The posterior probability distribution is the result of Bayesian inference, which is often quite complex and cannot intuitively represent the distribution of unknown parameters. In order to obtain the estimated values ​​of the parameters, it is necessary to sample the posterior probability density function to obtain the probability distribution of the pollution source parameters.

[0135] (5) The Markov-Monte Carlo (MCMC) sampling method is used to sample and process the posterior distribution in order to obtain an approximate solution for the source tracing result.

[0136] Reference Figure 3 As shown, the following are the processing steps based on MCMC:

[0137] 1) Initial sample: Randomly select an initial sample from the prior distribution as the starting point of the Markov chain.

[0138] 2) Generate new samples: Construct a proposal function that conforms to a normal distribution, and generate a candidate sample with a certain degree of randomness in the parameter space based on the proposal function.

[0139] 3) Accept or reject new samples: Calculate the acceptance rate to decide whether to accept a candidate sample. The acceptance rate is usually derived by comparing the likelihood function value of the candidate sample with the likelihood function value of the current sample. In the Metropolis-Hastings algorithm, the formula for calculating the acceptance rate ar is:

[0140]

[0141] p can It is the likelihood function value of the candidate sample, p cur It is the likelihood function value of the current sample.

[0142] If the likelihood function value of a new sample is high, the acceptance rate will be greater than 1, meaning that the new sample is more likely to be accepted; if the likelihood function value of a new sample is low, the acceptance rate will be less than 1, meaning that the new sample is less likely to be accepted.

[0143] Decisions are made based on the acceptance rate: A random number between [0, 1] is generated and compared with the acceptance rate. If the random number is less than or equal to the acceptance rate, i.e., falls within the interval [0, ar], then the new sample will be accepted and become the current sample for the next iteration; if the random number is greater than the acceptance rate, the new sample is rejected, and the current sample remains unchanged.

[0144] 4) Update Samples: Update the samples based on the acceptance or rejection result. If the new sample is accepted, it is used as the current sample for the next iteration; if it is rejected, the current sample is reused.

[0145] 5) Iteration: Repeat steps 2) to 4) until the set number of iterations is met or the mean and variance during the iteration process are stable.

[0146] 6) Output Approximate Posterior Distribution: By retaining a series of samples from the Markov chain, an approximate posterior distribution is obtained. The mean, variance, and confidence interval of these samples can be statistically analyzed to obtain an approximate description of the source tracing results. In summary, by iteratively generating samples that conform to the posterior probability distribution, the location of the pollution source, the time of pollution occurrence, and the intensity of pollution can be estimated. The larger the sample size, the more accurate the approximation of the posterior distribution.

[0147] Compared with the prior art, the beneficial effects of the present invention are:

[0148] Improving the accuracy of source tracing: By comprehensively utilizing multiple methods and data sources, the ability to locate and identify pollution sources can be enhanced. The diffusion wave model provides the physical mechanism of pollutant propagation, the BP neural network can learn nonlinear relationships in the data, and the Bayesian Monte Carlo sampling algorithm can post-process and optimize the source tracing results. Combining these methods can improve the accuracy of source tracing.

[0149] Providing more information: By combining multiple methods, different data and knowledge sources can be integrated to provide more information about pollution sources. Diffusion wave models can provide spatial distribution information about pollution sources, BP neural networks can extract hidden features and patterns from water quality data, and Bayesian Monte Carlo sampling algorithms can incorporate prior knowledge for post-processing. Comprehensive use of this information allows for a more complete understanding and interpretation of source tracing results.

[0150] Taking uncertainty into account: The Bayesian Monte Carlo sampling algorithm can obtain the posterior distribution of the source tracing results through sampling and post-processing, thus taking into account the uncertainty of the results. This can help decision-makers conduct risk assessment and decision-making based on uncertainty.

[0151] Potential Discovery and Explanation Capabilities: As a data-driven approach, BP neural networks can discover hidden correlations and patterns in data, thereby providing explanatory power for the characteristics and influencing factors of pollution sources. This helps to further understand the characteristics and mechanisms of pollution sources and provides deeper insights for environmental management and pollution control.

[0152] In summary, compared with existing methods, the use of a diffusion wave model, BP neural network and Bayesian Monte Carlo sampling algorithm for river pollution source tracing may bring beneficial effects such as improved source tracing accuracy, provision of more information, consideration of uncertainties, and provision of potential discovery and interpretation capabilities.

[0153] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0154] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for tracing the source of river pollution, characterized in that, Includes the following steps: Data collection and preprocessing steps: Collect hydrological information, topographic information, and pollutant concentrations at different locations in the river, and perform preprocessing to obtain monitoring data; The hydrological information includes: water flow velocity and water depth; the topographic information includes: river width and depth. Steps for establishing a diffusion wave model: Obtain the longitudinal diffusion coefficient and first-order attenuation coefficient of different pollutants; establish a diffusion wave model based on the characteristics and physical processes of the river; and simulate and calculate the spatiotemporal distribution data of pollutants in the water body. Neural network training steps: Construct a BP neural network model, using the monitoring data and the corresponding spatiotemporal distribution data as the input dataset for the BP neural network model, and perform iterative training; Neural network prediction steps: Input the monitoring data of the target river to be predicted and the spatiotemporal distribution data calculated by the diffusion wave model into the trained BP neural network model to obtain the predicted pollution source location, pollution occurrence time and pollution intensity corresponding to the target river; Bayesian network construction steps: Introduce the Bayesian algorithm to post-process the predicted pollution source location, pollution occurrence time and pollution intensity to obtain the probability distribution of pollution source parameters; Monte Carlo sampling steps: The probability distribution of the pollution source parameters is sampled and processed using the Monte Carlo sampling method to obtain an approximate solution for the source tracing results of the target river; The Bayesian network construction steps include: Establish a priori distribution of pollution source locations and release amounts; The likelihood function of the Bayesian algorithm is constructed based on the prediction results of the BP neural network model. Specifically, this includes: treating the prediction results of the BP neural network model as conforming to a Gaussian distribution and the actual observed values ​​as observed data points; calculating the difference between each predicted value of the BP neural network and the corresponding actual observed value; using the difference as the standard deviation of the Gaussian distribution; calculating the probability density of each observed value under the Gaussian distribution using the probability density function of the Gaussian distribution, and constructing the likelihood function based on each probability density. According to Bayes' theorem, the prior distribution and the likelihood function are multiplied to obtain the posterior distribution, which serves as the probability distribution of the pollution source parameters.

2. The method for tracing the source of river pollution according to claim 1, characterized in that, The data collection and preprocessing steps include, in particular, the preprocessing process; The water quality parameters are cleaned by aligning and correcting the data according to the time series, filtering out erroneous and missing values, and detecting and deleting outliers. And perform normalization processing; Extract effective time series features from the treated water quality parameters.

3. The method for tracing the source of river pollution according to claim 1, characterized in that, In the step of establishing the diffuse wave model, the diffuse wave model is expressed using the Saint-Venant equations: (1) (2) In the formula, C is the pollutant concentration at a distance x from the pollution source along the river channel at time t, in mg / L; U is the average flow velocity of the water, in m / s; D is the diffusion coefficient of pollutants in water, measured in meters. 2 / s; K is the first-order attenuation coefficient, in seconds. -1 m represents the mass of pollutants per unit area at the pollution source, expressed in grams.

4. The method for tracing the source of river pollution according to claim 1, characterized in that, The neural network training steps include: The monitoring data and the corresponding spatiotemporal distribution data are used as a dataset and divided into a training set, a test set, and a validation set according to a preset ratio. Design and construct a BP neural network model suitable for tracing the source of river pollution, including the settings of the input layer, hidden layer and output layer; Weights and biases are initialized randomly, and the Swish activation function is used as the activation function for each hidden layer node. Model training includes: forward propagation, calculating the loss function, back propagation, parameter updates, and repeated iterations; The model's performance is evaluated using the validation set. Training is stopped when the predicted interval coverage (PICP) exceeds a threshold, and the model is considered a well-trained BP neural network model.

5. The method for tracing the source of river pollution according to claim 4, characterized in that, Design and construct a BP neural network model suitable for tracing river pollution sources, including the settings of the input layer, hidden layers, and output layer, including: Design and construct a BP neural network model suitable for tracing the source of river pollution, and determine the number of nodes in the input layer based on water quality parameters, with each node corresponding to a water quality index; The number of nodes and layers in the hidden layer are determined based on the complexity of the problem and the characteristics of the dataset; the number of neurons is selected using an empirical formula: (3) In the formula: N is the number of hidden layer neurons, s is the number of input neurons, p is the number of output nodes, and c is a constant between 1 and 10; Determine the number of nodes in the output layer: Set the number of nodes in the output layer to 3, including the location of the pollution source, the time of occurrence, and the intensity of pollution.

6. The method for tracing the source of river pollution according to claim 4, characterized in that, The specific process of model training includes: Forward propagation steps: Input data is passed into the network, and the output values ​​of the hidden and output layers are calculated through weighted summation and activation functions at each layer; Steps for calculating the loss function: Compare the output obtained from the forward propagation with the measured values, and calculate the loss function, which is the mean squared error (MSE) between the predicted and actual values. (4) In the formula, y i o The measured water quality parameter value is y. i p The model predicts water quality parameter values; n is the number of data points for the predicted water quality parameters; i = [1, 2, ..., n]; Backpropagation steps: Calculate the gradients of the output and hidden layers based on the loss function, and then backpropagate these gradients back to the input layer using the chain rule to update the weights and biases. Parameter update steps: Based on the calculated gradient, the gradient descent method is used to update the parameters, and the weights and biases of the model are continuously adjusted so that the model can adapt to the characteristics and relationships of water quality parameters. Repeated iteration steps: Repeat the forward propagation, loss calculation, back propagation and parameter update steps until the maximum number of iterations is reached or the loss function converges.

7. The method for tracing the source of river pollution according to claim 6, characterized in that, The performance of the model is evaluated using the validation set. Training is stopped when the predicted interval coverage (PICP) exceeds a threshold. The resulting trained BP neural network model includes: The performance of the model was evaluated using a validation set. Evaluation metrics included: mean absolute error (MAE), root mean square error (RMSE), and prediction interval coverage (PICP). (5) (6) (7) PICP represents the true probability that the actual value falls within the prediction interval; the larger the value, the greater the probability that the measured value falls within the prediction interval. i This indicates whether the i-th actual value falls within the prediction interval, with 0 indicating no and 1 indicating yes. When the PICP value is greater than the preset threshold, training stops, and the result is used as a trained BP neural network model.

8. The method for tracing the source of river pollution according to claim 1, characterized in that, The Monte Carlo sampling procedure includes: 1) Randomly select an initial sample from the prior distribution as the starting point of the Markov chain; 2) Construct a proposal function that conforms to a normal distribution, and generate a candidate sample with randomness in the parameter space based on the proposal function; 3) Calculate the acceptance rate and determine whether to accept or reject a new sample based on the acceptance rate; the acceptance rate is obtained by comparing the likelihood function value of the candidate sample with the likelihood function value of the current sample; 4) Update the sample based on the results of accepting or rejecting new samples; 5) Repeat steps 2)-4) until the set number of iterations is met or the average and variance during the iteration process stabilize within the preset range; 6) By retaining a series of samples of the Markov chain, an approximate posterior distribution is obtained; by statistically analyzing the mean, variance, and confidence interval of the series of samples, an approximate solution for the source tracing result of the target river is obtained.

Citation Information

Patent Citations

  • Detection method of abnormal event of multi-variable water quality parameter time sequence data

    CN106872657A

  • Section drainage basin tracing method based on deep Bayesian neural network

    CN115905937A