Sewage treatment effluent quality prediction method based on Gaussian process regression

Through the sewage treatment effluent quality prediction method based on Gaussian process regression, combined with the particle swarm optimization algorithm to optimize the model parameters, the problem of poor prediction accuracy and confidence intervals in the sewage treatment process is solved, and the prediction results with high accuracy and reliability are achieved, and the functions of online learning and model updates are provided.

CN119541703APending Publication Date: 2025-02-28HUAQI ENVIRONMENT PROTECTION SCI & TECH

Patent Information

Application Number
CN202411599181.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Existing sewage treatment technologies are difficult to effectively solve the problem of poor prediction accuracy of effluent water quality caused by nonlinearity and strong hysteresis of sewage treatment processes, and cannot give confidence intervals for the prediction results, making it difficult to judge the reliability of the prediction results.

Method used

The effluent quality prediction method based on Gaussian process regression is adopted, and the effluent water quality prediction model input and output are determined by collecting historical data, and the model parameters are optimized using particle swarm optimization algorithm to achieve the prediction of effluent water quality indicators and the confidence intervals are given.

Benefits of technology

It effectively improves the accuracy of the prediction of the effluent quality of the sewage treatment effluent, can give confidence intervals of the prediction results, improves the reliability of the prediction results, and realizes online learning and model updates to adapt to the measurement deviations that may occur after long-term work of the water quality index measuring instrument.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119541703A_ABST
    Figure CN119541703A_ABST
Patent Text Reader

Abstract

The invention discloses a sewage treatment effluent quality prediction method based on Gaussian process regression, which comprises the following steps: collecting sewage treatment historical data, and preprocessing the data; determining input and output of an effluent quality prediction model, and training the effluent quality prediction model based on Gaussian process regression; initializing parameters of the effluent quality prediction model, and performing parameter optimization on the effluent quality prediction model by adopting a particle swarm optimization algorithm; performing prediction precision judgment on the optimized effluent quality prediction model by using the test set until the prediction precision meets a predetermined requirement; the effluent quality prediction model meeting the precision requirement is embedded into a field system, input data collected on site are received in real time, and an effluent quality index prediction value is output so as to guide field drug dosage adjustment. According to the method, the problems of nonlinearity, strong hysteresis and the like in the sewage treatment process can be solved, the effluent quality is accurately predicted, meanwhile, the confidence interval of the prediction result is given, and input variable sensor abnormity can be reflected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of sewage treatment, and in particular to a method for predicting effluent water quality from sewage treatment based on Gaussian process regression. Background Art

[0002] Urban sewage treatment is an important measure to protect the ecological environment and ensure the quality of domestic water. The effluent quality indicators of sewage treatment plants are not only related to the amount of drugs added during the sewage treatment process, but also affected by the total amount of influent and the influent quality. In addition, the sewage treatment process is extremely complicated and involves many treatment links, which leads to obvious nonlinearity and strong hysteresis in the sewage treatment process, bringing challenges to the real-time monitoring of effluent quality and the reasonable adjustment of drug dosage.

[0003] The effluent quality of traditional sewage treatment processes mainly relies on related instrument detection and manual analysis, with low detection frequency and poor accuracy, which is difficult to meet the needs of sewage treatment process management. In recent years, with the development of data mining and machine learning technology, many machine learning-based methods and systems have been designed for effluent quality prediction in sewage treatment processes.

[0004] For example, Patent Publication No. CN115470702A proposes a sewage treatment water quality prediction method and system based on machine learning, which involves the construction, division and use of water quality databases, but does not provide a practical and reliable algorithm model. Patent Publication No. CN112735541A proposes a sewage treatment water quality prediction method based on a simple cyclic unit neural network, which can improve the parallelism of calculations and the modeling ability of sequences, but does not fully consider the strong hysteresis of the sewage treatment process. Patent Publication No. CN117493803A proposes a sewage treatment process effluent water quality prediction method based on a recursive RBF neural network, Patent Publication No. CN116934167A proposes a sewage treatment effluent prediction method and system based on a deep neural network, and Patent Publication No. CN115965149A proposes a water quality index prediction method based on an LSTM algorithm model. Although these patent applications all consider the strong hysteresis of the sewage treatment process in the model construction process, they do not provide a reasonable method for determining hysteresis-related parameters.

[0005] In addition, the above existing methods can only give prediction results for effluent water quality indicators, but cannot give confidence intervals for the prediction results, making it difficult to judge the reliability of the prediction results. Water quality indicator measuring instruments will have measurement deviations after working for a long time, so the sewage treatment water quality prediction system needs to have the functions of online learning and model updating, which is also not available in the existing solution model. Summary of the invention

[0006] 1. Technical problem to be solved by the invention

[0007] The purpose of the present invention is to overcome the defects in the prior art and provide a method for predicting the effluent water quality of sewage treatment based on Gaussian process regression to solve the problem of poor effluent water quality prediction accuracy caused by the nonlinearity and strong hysteresis of the sewage treatment process.

[0008] 2. Technical solution

[0009] In order to achieve the above object, the technical solution provided by the present invention is:

[0010] The present invention provides a method for predicting the water quality of sewage treatment effluent based on Gaussian process regression, comprising the following steps:

[0011] Step 1: Collect historical data in the sewage treatment process, pre-process the data to remove abnormal data and reduce noise, and divide it into training set and test set;

[0012] Step 2: determine the input and output of the effluent water quality prediction model, and use the data of the training set to train the effluent water quality prediction model based on Gaussian process regression;

[0013] Step 3: Initialize the parameters of the effluent water quality prediction model, and use the particle swarm optimization algorithm to optimize the parameters of the effluent water quality prediction model;

[0014] Step 4: Use the test set to evaluate the prediction accuracy of the optimized effluent water quality prediction model until the prediction accuracy meets the predetermined requirements;

[0015] Step 5: embed the above-mentioned effluent water quality prediction model that meets the accuracy requirements into the on-site system, receive the input data collected on-site in real time, and output the predicted value of the effluent water quality index to guide the adjustment of the on-site drug dosage.

[0016] 3. Beneficial effects

[0017] Compared with the existing known technologies, the technical solution provided by the present invention has the following significant effects:

[0018] (1) The present invention provides a method for predicting the water quality of sewage treatment effluent based on Gaussian process regression, which fully considers the strong hysteresis of the sewage treatment process and provides a reasonable method for determining hysteresis-related parameters. It can effectively solve the input and output matching problem in the model training process and greatly improve the accuracy of the model prediction results.

[0019] (2) The present invention provides a method for predicting the effluent water quality of sewage treatment based on Gaussian process regression. While predicting the effluent water quality indicators, it also provides a confidence interval for the prediction result, which can be used to judge the reliability of the prediction result and reflect problems such as abnormal input variable sensors.

[0020] (3) The present invention provides a method for predicting the water quality of sewage treatment effluent based on Gaussian process regression. The calculation method is simple and the model update can be completed by recalculating the covariance matrix using the latest data collected online. This facilitates the improvement of online learning and helps solve the problem of measurement deviation of water quality index measuring instruments after long-term operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of a process of predicting the effluent water quality of sewage treatment based on Gaussian process regression according to the present invention;

[0022] Figure 2 Schematic diagram of the model input and output sample construction process in the present invention. DETAILED DESCRIPTION

[0023] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments.

[0024] Example

[0025] Combination Figure 1 , a method for predicting the water quality of sewage treatment effluent based on Gaussian process regression in this embodiment includes the following steps:

[0026] Step 1: Collect historical data from the sewage treatment process, pre-process the data to remove abnormal data and reduce noise, and divide the data into training sets and test sets.

[0027] The sensors at the sewage treatment site collect sewage inlet flow, inlet dissolved oxygen, inlet ammonia nitrogen, inlet total nitrogen, inlet total phosphorus and drug dosage as input parameters, and collect effluent dissolved oxygen, effluent ammonia nitrogen, effluent total nitrogen and effluent total phosphorus as output parameters.

[0028] The specific process of data preprocessing and data partitioning is as follows:

[0029] Step 1-1: Set up a collection is a data set of a certain parameter collected on site, where N z is the number of data in the data set, then calculate the standard deviation σ of the data set Z Z as follows:

[0030]

[0031] in, is the mean of all data in data set Z, when When z i The abnormal data are removed and z i =(z i-1 +z i+1 ) / 2;

[0032] Step 1-2, further denoising the data sequence obtained in the above step 1-1 using a wavelet transform algorithm, treating the high-frequency components in the data as noise and removing them;

[0033] Step 1-3: For the case where the data of real-time detection parameters such as inlet flow, inlet dissolved oxygen and outlet dissolved oxygen are missing in some time periods due to sensor abnormalities, a polynomial is fitted using normal data before and after the missing data time period, and the missing data is supplemented using polynomial interpolation;

[0034] Step 1-4: In view of the fact that the time interval of data feedback changes of the component detection instruments used on site to collect parameters such as influent ammonia nitrogen, influent total nitrogen, influent total phosphorus, drug dosage, effluent ammonia nitrogen, effluent total nitrogen and effluent total phosphorus is much longer than that of other real-time parameter detection instruments, the real-time detection parameters such as influent flow rate, influent dissolved oxygen and effluent dissolved oxygen are resampled according to the detection time interval of the component detection instruments;

[0035] Step 1-5: normalize the data obtained in the above step 1-3 to the interval [0,1];

[0036] Step 1-6: Divide the preprocessed data into a training set and a test set in a ratio of 4:1.

[0037] Step 2: Determine the input and output of the effluent water quality prediction model, and use the data in the training set to train the effluent water quality prediction model based on Gaussian process regression.

[0038] The specific process of building and training the effluent water quality prediction model is as follows:

[0039] Step 2-1, remember a t b is the input parameter vector obtained by the sensor sampling at time t, which is composed of the inlet flow rate, inlet dissolved oxygen, inlet ammonia nitrogen, inlet total nitrogen, inlet total phosphorus and drug dosage parameters sampled by the sensor, denoted by b t is the output parameter obtained by the sensor sampling at time t. This parameter can be set to any parameter that needs to be predicted among effluent dissolved oxygen, effluent ammonia nitrogen, effluent total nitrogen and effluent total phosphorus. Among them, t=1,2,...,N1, N1 is the number of samples sampled by the sensor in the training set. Then the input and output sample pairs of the effluent water quality prediction model can be constructed as x t =[a t ,a t+1 ,...,a t+k ] and y t =b t+T , where T is the lag time interval from the start of drug addition to the impact on effluent water quality, k is the input impact sampling number, satisfying 0≤k<T;

[0040] Step 2-2: According to the above step 2-1, a training sample set D = {(x t ,y t )|t=1,2,...,N}, where N=N1-T is the number of samples in the training sample set. Similarly, the test sample set can be constructed Where N * is the number of samples in the test sample set;

[0041] Step 2-3: Use the data obtained in step 2-2 to build and train a effluent water quality prediction model based on Gaussian process regression. First, define a Gaussian process as:

[0042] f(x)~GP(m(x),k(x,x′))

[0043] Among them, m(x) is the mean function, which represents the mean of the input samples, and k(x,x′) is the covariance function, which is used to define the correlation between the input samples. The calculation formula is as follows:

[0044]

[0045] in, is the signal variance, l is the length scale parameter. For two input samples x in the training sample set i and x j , whose covariance can be expressed as k(x i ,x j ).

[0046] Considering that the target output y of the model has external noise or disturbance, it can be characterized as:

[0047] y=f(x)+ε

[0048] in is the Gaussian white noise variance.

[0049] For the input sample sequence in the test sample set Its corresponding predicted output sequence It can be calculated as:

[0050]

[0051] Where X=[x1,x2, … ,x N ] T is the input sample sequence in the training sample set, y=[y1,y2, … ,y N ] T is the output sample sequence in the training sample set, and cov(y * ) represent the mean vector and covariance matrix of the predicted output respectively. The matrix K(X,X) is the covariance matrix of the training sample set, and its (i,j)th element is calculated by the covariance function K i,j (X,X)=k(x i ,x j ), and similarly, we can get the covariance matrix K(X * ,X)、K(X,X * ) and K(X * ,X * ).

[0052] The number of lag time intervals T is obtained through correlation analysis, and the input parameter vector and output parameter pairs (a t ,b t+ Pearson correlation coefficient between τ), where t=1,2, … ,N1,τ is a positive integer. The τ value corresponding to the largest absolute value of the Pearson correlation coefficient can be set as the lag time interval number T.

[0053] Step 3: Initialize the parameters of the effluent water quality prediction model, and use the particle swarm optimization algorithm to optimize the parameters of the effluent water quality prediction model. Specifically:

[0054] The model parameters to be optimized in step 2 above include the input impact sampling number k, Gaussian white noise variance Signal variance The length scale parameter l, the specific process of parameter optimization is as follows:

[0055] Step 3-1, set the parameters of the particle swarm optimization algorithm PSO, and determine the parameters to be optimized in the model constructed in step 2 above, that is, And randomly generate the speed and position of particles:

[0056]

[0057] Where M is the number of particles in the particle swarm, and d = 4 is the dimension of the target search space;

[0058] Step 3-2: Use the root mean square error indicator predicted by the model to construct a fitness function and calculate the fitness value of each particle:

[0059]

[0060] in is the root mean square error of the model prediction, y t is the actual value of the effluent water quality index, is the predicted value of the effluent water quality index by the prediction model corresponding to the i-th particle;

[0061] Step 3-3, calculate and update the individual optimal value and global optimal value of each particle;

[0062] Step 3-4: Update the speed and position of each particle, and constrain the speed and position that are out of bounds;

[0063] Step 3-5: Recalculate the fitness value of each particle and update the individual optimal value and global optimal value of each particle;

[0064] Step 3-6: Determine whether the PSO termination condition is met, that is, whether the number of iterations reaches the preset number. If so, output the optimal parameters of the prediction model; otherwise, jump to step 3-4 to continue execution.

[0065] Step 4: Use the mean absolute error, root mean square error and mean absolute percentage error of the actual value of the effluent water quality index and its predicted value to judge the prediction accuracy of the optimized effluent water quality prediction model. If the accuracy does not meet the predetermined requirements, repeat the model optimization process until the prediction accuracy meets the predetermined requirements;

[0066] Step 5: embed the above-mentioned effluent water quality prediction model that meets the accuracy requirements into the on-site system, receive the input data collected on-site in real time, and output the predicted value of the effluent water quality index to guide the adjustment of the on-site drug dosage.

[0067] The above is a schematic description of the present invention and its implementation methods, which is not restrictive. The drawings show only one implementation method of the present invention and are not limited thereto. Therefore, if a person skilled in the art is inspired by it and designs methods and embodiments similar to the technical solution without creativity without departing from the purpose of the invention, they should all fall within the scope of protection of the present invention.

Claims

1. A method for predicting the effluent quality of sewage treatment based on Gaussian process regression, characterized in that: The following steps are involved: Step 1: Collect historical data in the sewage treatment process, pre-process the data, remove abnormal data and reduce noise, and divide the data into training set and test set; Step 2: determine the input and output of the effluent water quality prediction model, and use the data of the training set to train the effluent water quality prediction model based on Gaussian process regression; Step 3: Initialize the parameters of the effluent water quality prediction model, and use the particle swarm optimization algorithm to optimize the parameters of the effluent water quality prediction model; Step 4: Use the test set to evaluate the prediction accuracy of the optimized effluent water quality prediction model until the prediction accuracy meets the predetermined requirements; Step 5: embed the above-mentioned effluent water quality prediction model that meets the accuracy requirements into the on-site system, receive the input data collected on-site in real time, and output the predicted value of the effluent water quality index to guide the adjustment of the on-site drug dosage.

2. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 1 is characterized in that: In step 1, the sewage treatment site sensor collects sewage inlet flow, inlet dissolved oxygen, inlet ammonia nitrogen, inlet total nitrogen, inlet total phosphorus and drug dosage as input parameters, and collects effluent dissolved oxygen, effluent ammonia nitrogen, effluent total nitrogen and effluent total phosphorus as output parameters.

3. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 2 is characterized in that: In step 1, the specific process of data preprocessing is as follows: Step 1-1: Set up a collection is a data set of a certain parameter collected on site, where N z is the number of data in the data set, then calculate the standard deviation σ of the data set Z Z ;when When z i The abnormal data are removed and z i =(z i-1 +z i+1 ) / 2; among them, is the mean of all data in data set Z; Step 1-2, further denoising the data sequence obtained in step 1-1 using a wavelet transform algorithm, treating the high-frequency components in the data as noise and removing them; Step 1-3: In case of missing data in some time periods due to sensor abnormality, a polynomial is fitted using normal data before and after the missing data time period, and the missing data is supplemented using polynomial interpolation; Step 1-4: in case that the time interval of the data feedback change of the component detection instrument is much longer than that of other real-time parameter detection instruments, the real-time detection parameters are resampled according to the detection time interval of the component detection instrument; Step 1-5: Normalize the data obtained in step 1-3 to the interval [0,1].

4. A method for predicting sewage treatment effluent quality based on Gaussian process regression according to any one of claims 1 to 3, characterized in that: In step 2, the input of the effluent water quality prediction model is the input parameter vector obtained by sensor sampling, and the vector is composed of the inlet flow rate, inlet dissolved oxygen, inlet ammonia nitrogen, inlet total nitrogen, inlet total phosphorus and drug dosage parameters sampled by the sensor; the output of the effluent water quality prediction model is any parameter that needs to be predicted among effluent dissolved oxygen, effluent ammonia nitrogen, effluent total nitrogen and effluent total phosphorus.

5. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 4 is characterized in that: In step 2, the construction and training process of the effluent water quality prediction model is as follows: Step 2-1, remember a t is the input parameter vector sampled by the sensor at time t, b t is the output parameter obtained by the sensor sampling at time t, where t = 1, 2, ..., N1, N1 is the number of samples sampled by the sensor in the training set, then the input and output sample pairs for constructing the effluent water quality prediction model are x t =[a t , a t+1 , ..., a t+k ] and y t =b t+T , where T is the lag time interval from the start of drug addition to the impact on effluent water quality, k is the input impact sampling number, satisfying 0≤k<T; Step 2-2: According to the above step 2-1, a training sample set D = {(x t ,y t )|t=1,2,...,N}, where N=N1-T is the number of samples in the training sample set and the test sample set Where N* is the number of samples in the test sample set; Step 2-3, using the data obtained in the above step 2-2 to construct and train an effluent water quality prediction model based on Gaussian process regression; The effluent water quality prediction model first defines a Gaussian process as: f(x)~GP(m(x),k(x,x′)) Among them, m(x) represents the mean of the input samples, k(x,x′) is the covariance function, which is used to define the correlation between the input samples; Considering that the target output y of the model has external noise or disturbance, it can be characterized as: y=f(x)+ε in is the Gaussian white noise variance; For the input sample sequence in the test sample set and its corresponding predicted output sequence, calculate the mean vector and covariance matrix of the predicted output.

6. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 5, characterized in that: The lag time interval T from the start of drug addition to the impact on effluent water quality in step 2-1 is obtained by correlation analysis, and the input parameter vector and output parameter pair (a t ,b t+τ ), where t = 1, 2, ..., N1, τ is a positive integer, and the τ value with the largest absolute value of the Pearson correlation coefficient is selected as the lag time interval number.

7. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 6 is characterized in that: In step 3, the parameters of the effluent water quality prediction model optimized by the particle swarm algorithm include the input impact sampling number k, the Gaussian white noise variance Signal variance and the length scale parameter l.

8. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 7 is characterized in that: After determining the parameters to be optimized of the effluent water quality prediction model, the specific process of optimizing the parameters to be optimized is as follows: Step 3-1, set the parameters of the particle swarm optimization algorithm PSO, and randomly generate the speed and position of the particles; Step 3-2: Use the root mean square error index predicted by the model to construct a fitness function and calculate the fitness value of each particle; Step 3-3, calculate and update the individual optimal value and global optimal value of each particle; Step 3-4: Update the speed and position of each particle, and constrain the speed and position that are out of bounds; Step 3-5: Recalculate the fitness value of each particle and update the individual optimal value and global optimal value of each particle; Step 3-6: Determine whether the PSO termination condition is met, that is, whether the number of iterations reaches the preset number. If so, output the optimal parameters of the prediction model; otherwise, jump to step 3-4 to continue execution.

9. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 8, characterized in that: The fitness function constructed in step 3-2 is: in is the root mean square error of the model prediction, y t is the actual value of the effluent water quality index, is the predicted value of the effluent water quality index by the prediction model corresponding to the i-th particle.

10. The method for predicting sewage treatment effluent quality based on Gaussian process regression according to claim 9, characterized in that: In step 4, the average absolute error, root mean square error and average absolute percentage error between the actual value of the effluent water quality index and its predicted value are used to judge the prediction accuracy of the optimized effluent water quality prediction model. If the accuracy does not meet the predetermined requirements, the model optimization process is repeated.

Citation Information

Patent Citations

  • Sewage treatment water quality prediction method based on simple circulation unit neural network

    CN112735541A

  • Sewage treatment water quality prediction method and system based on machine learning

    CN115470702A

  • Water quality index prediction method based on LSTM algorithm model

    CN115965149A

  • Sewage treatment effluent prediction method and system based on deep neural network

    CN116934167A

  • Recursive RBF neural network-based effluent quality prediction method in sewage treatment process

    CN117493803A

Cited By

  • A sewage treatment water quality monitoring method based on target domain prior fusion source domain knowledge transfer Gaussian process regression

    CN122712534A