Method for predicting total phosphorus and total nitrogen in effluent in wastewater treatment process

Through PCA algorithm dimensionality reduction and PCA-NLSTM model combined with sgdm method optimization training, the problems of lag and overfitting of traditional models are solved, and efficient and accurate prediction of total phosphorus and total nitrogen in the effluent during wastewater treatment are achieved, which improves the system Control ability.

CN119108048AInactive Publication Date: 2024-12-10HUASHI (FUJIAN) ENVIRONMENTAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411133280.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-10
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the traditional wastewater treatment process, sensor monitoring lags greatly, commonly used soft measurement models are prone to local optimum, slow convergence speed, and cannot accurately reflect the high uncertainty and overfitting problems in multi-parameter time-varying state, which makes it difficult to Achieve accurate prediction of total phosphorus and total nitrogen in the effluent.

Method used

The PCA algorithm is used to reduce the input features, and a PCA-NLSTM neural network model is constructed. The time characteristics are extracted through the Nested-LSTM network, and the sgdm method is optimized to achieve efficient prediction of total phosphorus and total nitrogen in the effluent water.

Benefits of technology

It improves the prediction performance and stability of the model, and can accurately predict the total phosphorus and total nitrogen of the effluent water on a longer time scale, promoting effective control of the wastewater treatment system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119108048A_ABST
    Figure CN119108048A_ABST
Patent Text Reader

Abstract

The invention discloses an effluent total phosphorus and total nitrogen prediction method in a wastewater treatment process, and the method comprises the steps: obtaining an input independent variable and an output variable of an effluent total phosphorus and total nitrogen prediction model in the wastewater treatment process according to the wastewater treatment process; constructing a wastewater index data training set and a test set; principal components of training sample data are extracted through a principal component analysis (PCA) algorithm, and dimension reduction optimization is carried out on input data; constructing a principal component analysis-nested long-short term memory network (PCA-NLSTM) model; the PCA-NLSTM neural network model is trained; a PCA-NLSTM neural network model is used for predicting total phosphorus and total nitrogen of effluent in the wastewater treatment process, and prediction results are obtained; according to the method, the PCA-NLSTM neural network model is constructed, the total phosphorus and total nitrogen of the effluent of the wastewater treatment plant can be effectively monitored, the accuracy is high, the operation is simple and convenient, and a safety guarantee is provided for stable operation of a wastewater treatment system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the research field of effluent index prediction technology in a wastewater treatment process, and in particular to a method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process. Background Art

[0002] In order to ensure that the wastewater treatment process is always in a stable and safe operating state and prevent eutrophication of lakes and oceans, it is necessary to first monitor the effluent total phosphorus and total nitrogen in the wastewater treatment process in real time; by monitoring these parameters, the wastewater treatment process performance, effluent quality and economic benefits can be reflected, and then the wastewater treatment process can be optimized and controlled according to the monitoring results, and finally the purpose of achieving the nitrogen and phosphorus standards in the wastewater treatment process can be achieved. In order to solve the problem of large lag in traditional sensor monitoring, researchers have proposed data-driven soft measurement models in recent years to control effluent water quality in real time. Commonly used soft measurement models for wastewater treatment mainly include BP neural network, support vector machine, multivariate regression, etc. However, the above methods all have the disadvantages of being easily trapped in local optimality and slow convergence, and cannot accurately reflect the high uncertainty brought about by the time-varying state of multiple parameters in the wastewater treatment process or there is overfitting. Since various water quality indicators are time-series, there is a certain correlation between the samples collected before and after sewage treatment, that is, the samples at the current moment will be affected by the sample values ​​at the previous moment. In view of the time characteristics of the wastewater treatment process, this study adopts the Nested-LSTM network that can extract time characteristics as the basic architecture of the model. In order to further extract the performance of the model, this study uses PCA to optimize the dimensionality reduction of input features, so that the model can efficiently realize long-term dependencies, so that it can accurately predict the total phosphorus and total nitrogen in the effluent on a longer time scale. Summary of the invention

[0003] Therefore, in order to solve the above-mentioned shortcomings, the present invention provides a method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process.

[0004] The present invention is implemented by constructing a method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process, the device comprising the following steps: S1. According to the wastewater treatment process, the input independent variables and output variables of the total phosphorus and total nitrogen prediction model of the wastewater treatment process effluent are obtained; S2. Construct wastewater index data training set and test set based on the acquired water quality parameter data; S3, extract the principal components of the training sample data through the PCA algorithm, and perform dimensionality reduction optimization on the input data; S4. Build a PCA-NLSTM neural network model and train the PCA-NLSTM neural network model; S5. The total phosphorus and total nitrogen in the effluent during wastewater treatment are predicted using the trained PCA-NLSTM neural network model to obtain prediction results.

[0005] Preferably, the step S1 is specifically as follows: the input independent variables include influent chemical oxygen demand, influent ammonia nitrogen, influent total suspended solids, influent pH, effluent ammonia nitrogen, effluent total suspended solids, effluent pH, effluent flow rate, effluent temperature and effluent humidity; the output variables in the step S1 include effluent total phosphorus and effluent total nitrogen.

[0006] Preferably, the step S2 specifically includes: randomly dividing the sample data according to the principle of 8:2 between the training set and the test set, wherein the first 80% of the data sets in the sample data are the training set, and the last 20% of the data sets are the test set.

[0007] Preferably, the step S3 is specifically: S301, perform standardization operation on the data of the training set, that is, 0 mean and 1 variance, then the standardized training set data is: ; in, After the standardized training set, is the unstandardized training set. is the k-th row sample of the data, and sig are the mean and standard deviation of the training set data respectively; S302: Training set samples after standardization Entered Finally, we get the eigenvectors, eigenvalues ​​and new components of the training set: ; in, is the feature vector of the training set, is the corresponding eigenvalue in each variable, For passing New training set processed; S303, obtain The contribution rate of each column of data in The cumulative contribution rate exceeds 90% Column data is extracted to obtain the principal components of the training set; S304: Standardize the test set data. The test set samples after standardization are: ; in, and Test set before and after standardization is the jth row of data of the test sample; S305, calculate the average value of the training set after standardization, and copy the average value times, form a mean value matrix, subtract the mean value from the test set and multiply it by the training set feature vector to get the new component of the test set: ; in, is the new component of the test set, is the standardized test set, is the mean value of the training set, To copy the training set average Second-rate, is the feature vector of the training set; S306, Before The column data is extracted as the principal component of the test set.

[0008] Preferably, the PCA-NLSTM neural network model includes an input layer, a preprocessing layer, a Nested-LSTM hidden layer and an output layer. S401, establish a PCA-Nested-LSTM neural network hidden layer unit; S402. Using mean square error as the loss function of the prediction model ; Where n is the number of training samples, is the predicted value of the i-th sample, is the true value of the i-th sample; S403, using the output of the Nested-LSTM hidden layer as the input of the output layer, The function calculates the input of the output layer to get the predicted output: ; in, Represents the weight coefficient matrix that needs to be trained from the Nested-LSTM layer to the output layer. Indicates the corresponding bias that needs to be trained, is the corresponding predicted output.

[0009] S404, training the entire PCA-NLSTM network layer in sequence through the SGDM method to obtain the updated value of the weight of the entire PCA-NLSTM network.

[0010] The present invention has the following advantages: The present invention provides a method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process through improvement, which has the following improvements compared with similar equipment: The method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process described in the present invention adopts PCA and SGDM methods to optimize and train NLSTM, thereby enhancing the prediction performance and stability of the model. The method is simple to operate and does not require professional personnel to operate. The concentrations of total phosphorus and total nitrogen in the effluent can be determined using only historical water quality data, thereby promoting effective control of effluent indicators of the wastewater treatment system. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 Schematic diagram of the PCA-NLSTM neural network structure according to the present invention.

[0012] Figure 2 It is a comparison between the predicted value of effluent total nitrogen and the actual value achieved according to an embodiment of the present invention.

[0013] Figure 3 It is a comparison between the predicted value of effluent total phosphorus and the actual value achieved according to an embodiment of the present invention. DETAILED DESCRIPTION

[0014] The following is combined with Figure 1~Figure 3 The principles and features of the present invention are described, and the examples given are only used to explain the present invention and are not used to limit the scope of the present invention. In the following paragraphs, the present invention is described in more detail by way of example with reference to the accompanying drawings. It should be noted that the drawings are all in a very simplified form and are not in precise proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.

[0015] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0016] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", and "set" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. The following is an explanation of the embodiments of the present invention based on its overall structure.

[0017] See also Figure 1~Figure 3 A method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process of the present invention comprises the following steps: S1. According to the wastewater treatment process, the input independent variables and output variables of the total phosphorus and total nitrogen prediction model of the wastewater treatment process effluent are obtained; Appropriate parameters of the wastewater treatment system can be obtained through the computer interface as input variables and output variables. The input variables include influent chemical oxygen demand, influent ammonia nitrogen, influent total suspended solids, influent pH, effluent ammonia nitrogen, effluent total suspended solids, effluent pH, effluent flow rate, effluent temperature, effluent humidity, etc.; the output variables include effluent total phosphorus and effluent total nitrogen; S2. Construct wastewater index data training set and test set based on the acquired water quality parameter data; The sample data is randomly divided according to the principle of 8:2 for training set and test set, where the first 80% of the sample data is the training set and the last 20% is the test set. Therefore, the total data is 1000 groups, and the ratio of training set to test set is 800:200. S3, extract the principal components of the training sample data through the PCA algorithm, and perform dimensionality reduction optimization on the input data; S301, perform standardization operation on the data of the training set, that is, 0 mean and 1 variance, then the standardized training set data is: , in, After the standardized training set, is the unstandardized training set. is the k-th row sample of the data, and sig are the mean and standard deviation of the training set data respectively; S302: Training set samples after standardization Entered Finally, we get the eigenvectors, eigenvalues ​​and new components of the training set: , in, is the feature vector of the training set, is the corresponding eigenvalue in each variable, For passing New training set processed; S303, obtain The contribution rate of each column of data in The cumulative contribution rate exceeds 90% Column data is extracted to obtain the principal components of the training set; S304: Standardize the test set data. The test set samples after standardization are: , in, and Test set before and after standardization is the jth row of data of the test sample; S305, calculate the average value of the training set after standardization, and copy the average value times, form a mean value matrix, subtract the mean value from the test set and multiply it by the training set feature vector to get the new component of the test set: , in, is the new component of the test set, is the standardized test set, is the mean value of the training set, To copy the training set average Second-rate, is the feature vector of the training set; S306, Before The column data is extracted as the principal component of the test set.

[0018] After PCA processing, the number of input variables was reduced from 10 to 7, achieving dimensionality reduction optimization of the input variables; S4. Build a PCA-NLSTM neural network model and train the PCA-NLSTM neural network model; First, build the network. The mathematical transfer process of the hidden layer unit is as follows:

[0019] In the above formula, is the output, input, input gate, forget gate, state of the unit, and output gate of the internal NLSTM unit at time t; They represent the output, input, input gate, forget gate, state of the unit, and output gate of the external NLSTM unit at time t respectively; Represents the Sigmoid function; is the tanh function; is the weight matrix of the internal NLSTM; is the bias term; is the bias term; The t-th feature vector output by the Nested-LSTM hidden layer Input PCA-Nested-LSTM layer to get the initial state vector , according to the state vector The determined energy value is recalculated to obtain the coefficient , and then the final output state vector Y is obtained by summing. The calculation process is as follows:

[0020] Where: The state vector representing the tth eigenvector The energy value to be determined; Represents the weight coefficient matrix of the tth eigenvector; Represents the offset corresponding to the t-th eigenvector.

[0021] The input of the output layer is the output of the NLSTM hidden layer, The function performs corresponding calculations on the input of the output layer to obtain the corresponding predicted output. The specific calculation formula is as follows:

[0022] in: Represents the coefficient matrix that needs to be trained from the NLSTM hidden layer to the output layer; Indicates the corresponding bias that needs to be trained; is the corresponding predicted output.

[0023] The divided training set is used as the model input, and training is performed according to the defined model loss function and sgdm optimizer. The model training result under the relatively optimal parameters is selected as the final result to complete the model training. The trained PCA-NLSTM neural network model is used to predict the total phosphorus and total nitrogen in the effluent; S5. The total phosphorus and total nitrogen in the effluent during wastewater treatment are predicted using the trained PCA-NLSTM neural network model to obtain prediction results.

[0024] The present invention provides a method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process through improvement. The measured data are processed by an intelligent monitoring system based on a PCA-NLSTM neural network model, and the concentrations of total phosphorus and total nitrogen in the effluent are accurately and quickly calculated, thereby promoting comprehensive control of water pollution in the wastewater treatment process. The present invention also enables efficient and accurate monitoring of total phosphorus and total nitrogen in the effluent from the wastewater treatment process through an intelligent monitoring method for effluent parameters from a wastewater treatment process based on a PCA-NLSTM neural network model.

[0025] The above shows and describes the basic principles, main features and advantages of the present invention, and the standard parts used in the present invention can be purchased from the market, and special-shaped parts can be customized according to the description in the specification and the drawings. The specific connection methods of each part adopt the conventional means such as mature bolts, rivets, welding, etc. in the prior art. The machinery, parts and equipment all adopt the conventional models in the prior art, and the circuit connection adopts the conventional connection method in the prior art, which will not be described in detail here.

[0026] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process. It is characterized in that The following steps are involved: S1. According to the wastewater treatment process, the input independent variables and output variables of the total phosphorus and total nitrogen prediction model of the wastewater treatment process effluent are obtained; S2. Construct wastewater index data training set and test set based on the acquired water quality parameter data; S3, extract the principal components of the training sample data through the PCA algorithm, and perform dimensionality reduction optimization on the input data; S4. Build a PCA-NLSTM neural network model and train the PCA-NLSTM neural network model; S5. The total phosphorus and total nitrogen in the effluent during wastewater treatment are predicted using the trained PCA-NLSTM neural network model to obtain prediction results.

2. A method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process according to claim 1, It is characterized in that The step S1 specifically includes: the input independent variables include influent chemical oxygen demand, influent ammonia nitrogen, influent total suspended solids, influent pH, effluent ammonia nitrogen, effluent total suspended solids, effluent pH, effluent flow rate, effluent temperature and effluent humidity; the output variables in the step S1 include effluent total phosphorus and effluent total nitrogen.

3. A method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process according to claim 1, It is characterized in that The step S2 specifically includes: randomly dividing the sample data according to the principle of 8:2 between the training set and the test set, wherein the first 80% of the data set in the sample data is the training set, and the last 20% of the data set is the test set.

4. A method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process according to claim 1, It is characterized in that The step S3 is specifically as follows: S301, perform standardization operation on the data of the training set, that is, 0 mean and 1 variance, then the standardized training set data is: ; in, After the standardized training set, is the unstandardized training set. is the k-th row sample of the data, and sig are the mean and standard deviation of the training set data respectively; S302: Training set samples after standardization Entered Finally, we get the eigenvectors, eigenvalues ​​and new components of the training set: ; in, is the feature vector of the training set, is the corresponding eigenvalue in each variable, For passing New training set processed; S303, obtain The contribution rate of each column of data in The cumulative contribution rate exceeds 90% Column data is extracted to obtain the principal components of the training set; S304: Standardize the test set data. The test set samples after standardization are: ; in, and Test set before and after standardization is the jth row of data of the test sample; S305, calculate the average value of the training set after standardization, and copy the average value times, form a mean value matrix, subtract the mean value from the test set and multiply it by the training set feature vector to get the new component of the test set: ; in, is the new component of the test set, is the standardized test set, is the training set average, To copy the training set mean Second-rate, is the feature vector of the training set; S306, Before The column data is extracted as the principal component of the test set.

5. The method for predicting total phosphorus and total nitrogen in effluent from a wastewater treatment process according to claim 1, It is characterized in that The PCA-NLSTM neural network model includes an input layer, a preprocessing layer, a Nested-LSTM hidden layer and an output layer. S401, establish a PCA-Nested-LSTM neural network hidden layer unit; S402. Using mean square error as the loss function of the prediction model ; Where n is the number of training samples, is the predicted value of the i-th sample, is the true value of the i-th sample; S403, using the output of the Nested-LSTM hidden layer as the input of the output layer, The function calculates the input of the output layer to get the predicted output: ; in, Represents the weight coefficient matrix that needs to be trained from the Nested-LSTM layer to the output layer. Indicates the corresponding bias that needs to be trained, is the corresponding prediction output; S404, training the entire PCA-NLSTM network layer in sequence through the SGDM method to obtain the updated value of the weight of the entire PCA-NLSTM network.