Sewage quality prediction method based on pyramid-shaped three-dimensional model
By adopting a pyramid-type three-dimensional model with multi-model fusion stacking in the sewage treatment process, the problem that the existing technology is difficult to accurately reflect the real-time changes in sewage water quality is solved, and high-accuracy and real-time sewage water quality prediction is achieved, and intelligent and automated sewage treatment is supported.
Patent Information
- Application Number
- CN202510475162.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-04-16
AI Technical Summary
The existing sewage water quality prediction methods are difficult to accurately reflect the real-time changes in sewage water quality, and traditional chemical analysis methods have problems of high costs and environmental pollution.
A pyramid-type three-dimensional model based on multi-model fusion stacking is adopted to obtain wastewater water quality index monitoring data for deformation and expansion, and combined with BPNN, LSTM, RFR, GBDT and other models, a prediction model of multi-model fusion stacking is constructed to realize real-time prediction of COD and NH3-N.
It improves the accuracy and real-time nature of sewage water quality prediction, reduces overfitting, enhances the prediction performance of sewage water quality, and supports the intelligence and automation of sewage treatment processes.
Smart Images

Figure CN119990481A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of prediction and analysis in a water treatment process, and specifically relates to a sewage water quality prediction method based on a pyramid-shaped three-dimensional model of multi-model fusion stacking. Background Art
[0002] Importance of sewage treatment and water quality index measurement: In modern sewage treatment processes, sequencing batch sludge reactors (SBR) are widely used due to their strong adaptability and flexible operation. Among them, chemical oxygen demand (COD), ammonia nitrogen (NH3-N), total nitrogen (TN), and total phosphorus (TP) are key indicators for measuring the content of pollutants in water. Accurately measuring their values is of irreplaceable importance for optimizing sewage treatment plans and ensuring that sewage discharge meets strict regulatory standards. They are not only directly related to the efficiency of sewage treatment, but also play a key role in the assessment of environmental impact and process regulation.
[0003] Limitations of traditional COD and NH3-N determination methods: However, traditional COD and NH3-N chemical analysis methods have many drawbacks. This method consumes a large amount of chemical reagents during the determination process, which not only increases the detection cost, but also may cause secondary pollution to the environment. At the same time, the time required for water sample digestion and determination is long, and it is impossible to obtain monitoring data in a timely and online manner, which makes it difficult to adjust the treatment strategy in time during the sewage treatment process, and it is difficult to meet the needs of modern sewage treatment for real-time monitoring and precise control.
[0004] The rise and problems of soft sensing methods: In order to overcome the shortcomings of traditional chemical determination methods, soft sensing models based on machine learning and other methods, namely water quality soft sensors, have emerged. This method predicts the COD and NH3-N content of water quality by establishing a mathematical model, which is expected to achieve rapid, online monitoring. However, due to the complex kinetic characteristics of the sewage treatment process and the complexity and discontinuity of COD and NH3-N measurements themselves, the existing soft sensing methods still need to be improved in terms of prediction accuracy, and it is difficult to accurately reflect the real-time changes in sewage quality. Summary of the invention
[0005] The purpose of the present invention is to solve the problem that the existing prediction and analysis methods are difficult to accurately reflect the real-time changes of sewage water quality during the water treatment process, and proposes a sewage water quality prediction method based on a pyramid-shaped three-dimensional model of multi-model fusion stacking.
[0006] The technical solution of the present invention is: a sewage water quality prediction method based on a pyramid-shaped three-dimensional model of multi-model fusion stacking, comprising the following steps: S1. Obtain wastewater quality index monitoring data, and deform and expand the wastewater quality index monitoring data to obtain deformed and expanded data; S2. Construct a stereo prediction model based on multi-model fusion stacking; S3. Input the wastewater quality monitoring data and deformation expansion data into the three-dimensional prediction model, output the final COD prediction value and NH3-N prediction value, and complete the wastewater quality prediction.
[0007] Preferably, the wastewater quality index monitoring data in step S1 include the wastewater's electrical conductivity EC, pH value, oxidation-reduction potential ORP, reaction temperature T, dissolved oxygen DO, and turbidity NTU.
[0008] Preferably, the deformation expansion data includes conductivity change rate △EC, pH change rate △pH, oxidation-reduction potential change rate △ORP, dissolved oxygen change rate △DO, reaction temperature change rate △T, turbidity change rate △NTU, conductivity accumulation value EC Cum , pH cumulative value pH Cum , Oxidation-reduction potential cumulative value ORP Cum , dissolved oxygen cumulative value DO Cum , reaction temperature cumulative value T Cum , Turbidity cumulative value NTU Cum , the product of the monitoring data of each wastewater quality index and the quotient of the monitoring data of each wastewater quality index.
[0009] Preferably, the three-dimensional prediction model in step S2 includes a wastewater quality index prediction model and a meta-model; The wastewater quality index prediction model is used to receive the wastewater quality index monitoring data and output a preliminary prediction value of COD and a preliminary prediction value of NH3-N; The meta-model is used to receive the COD preliminary prediction value and the NH3-N preliminary prediction value, and output the final COD prediction value and the NH3-N prediction value.
[0010] Preferably, the wastewater quality index prediction model includes a parallel RFR model, a CNN model, a GBDT model and a LSTM model; the input end of the RFR model, the input end of the CNN model, the input end of the GBDT model and the input end of the LSTM model are all input ends of the entire wastewater quality index prediction model; the output end of the RFR model, the output end of the CNN model, the output end of the GBDT model and the output end of the LSTM model are all connected to the input end of the meta-model; The meta-model is a BPNN model.
[0011] Preferably, the RFR model constructs multiple decision trees and averages the prediction results of the multiple decision trees to obtain each preliminary prediction value; the calculation formula of each preliminary prediction value is:
[0012] in, represents the preliminary prediction values output by the RFR model, represents the total number of decision trees, Indicates the input wastewater quality index monitoring data, Indicates The prediction results of COD and NH3-N by the decision trees.
[0013] Preferably, the GBDT model captures the nonlinear characteristics of wastewater quality index monitoring data by constructing a series of decision trees, specifically: Calculate the negative gradient of the current decision tree, and the calculation formula is:
[0014] in, Indicates the mth iteration j The negative gradient of the wastewater quality index, represents the partial derivative, represents the loss function, Indicates j The true labels of the instances, Represents the decision tree of the m-1th iteration for the j The predicted values of wastewater quality indicators, Indicates j The input parameters of the wastewater quality indicators are: represents the derivative of the loss function with respect to the predicted value of the boost model; The negative gradient of the current decision tree is used as the target of the loss function to calculate the next decision tree. The calculation formula is:
[0015] in, represents the predicted value of the decision tree at the mth iteration, represents the predicted value of the decision tree at the m-1th stage, Indicates The learning rate of a decision tree, Indicates The output of a decision tree, Indicates the monitoring data of wastewater quality indicators; Repeat the above steps until the preset number of iterations is reached to obtain the nonlinear characteristics of the wastewater quality index monitoring data.
[0016] Preferably, the LSTM model captures the long-term dependency between the wastewater quality monitoring data and the preliminary predicted values of COD and NH3-N by including an input gate, a forget gate and an output gate; The input gate is used to determine how much current input information is retained; The forget gate is used to determine the information in the previous state that needs to be forgotten; The output gate is used to determine the impact of the current unit state on the output; The LSTM model specifically includes the following formula:
[0017] in, represents the output parameter of the input gate, represents the output parameter of the forget gate, represents the output parameter of the output gate, Indicates that the LSTM model is The unit state at the moment, represents the sigmoid activation function, represents the weight of the input gate, express The hidden state of the moment, express The hidden state of the moment, express The wastewater quality index monitoring data is input into the LSTM model at all times. represents the bias of the input gate, represents the weight of the forget gate, represents the bias of the forget gate, Represents the adjustment factor dynamically calculated according to the current environmental conditions, represents the weight of the output gate, represents the bias of the output gate, Indicates that the LSTM model is The unit state at the moment, express The memory representation corresponding to the input information at each moment, represents the hyperbolic tangent activation function, represents the weight corresponding to the unit state update, Indicates the bias corresponding to the cell state update.
[0018] Preferably, the output of the BPNN neural network is:
[0019] in, It represents the final COD prediction value and NH3-N prediction value output by the BPNN neural network. represents the activation function, represents the weight of the output layer, represents the weight of the hidden layer, It represents the fusion features of the preliminary prediction values obtained by parallel fusion of the RFR model, CNN model, GBDT model and LSTM model. represents the bias term of the hidden layer, Represents the bias term of the output layer.
[0020] Preferably, the step S2 specifically includes the following sub-steps: Perform expansion processing on the wastewater quality index monitoring data to obtain deformed expansion data; The wastewater quality index monitoring data is filled in using the arithmetic difference interpolation method to obtain complete wastewater quality index monitoring data; Construct variable data sets based on complete wastewater quality index monitoring data and deformation and expansion data; The variable data set is input into the wastewater quality index prediction model for training, and the trained wastewater quality index prediction model, COD preliminary prediction value and NH3-N preliminary prediction value are obtained; The preliminary predicted values of COD, preliminary predicted values of NH3-N, measured values of COD and measured values of NH3-N were input into the meta-model for training to obtain a three-dimensional prediction model.
[0021] The beneficial effects of the present invention are: 1. The present invention deforms and expands the wastewater quality index monitoring data, and the deformed and expanded data obtained can more comprehensively reflect the dynamic change characteristics of the water quality data and the relationship between the data, thereby enhancing the amount of information input to the model.
[0022] 2. The present invention designs a three-dimensional architecture of multi-model fusion, combines the BPNN model, LSTM model, RNN model, RFR model and GBDT model, and constructs a pyramid-shaped three-dimensional prediction model of multi-model fusion stacking. It can fully combine the advantages of each model, better capture the time series characteristics and nonlinear relationships in the data, and solve the limitations of a single model in complex water quality prediction. In real-time prediction, it can improve prediction accuracy, reduce overfitting, and maximize the prediction performance of sewage water quality.
[0023] 3. The present invention proposes a dynamic metamodel optimization mechanism, which can improve prediction accuracy and adaptability.
[0024] 4. Through in-depth research on model stacking, the intelligence and automation of water quality monitoring can be effectively promoted. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Shown is a flow chart of a sewage quality prediction method based on a pyramid-shaped three-dimensional model of multi-model fusion stacking provided in an embodiment of the present invention.
[0026] Figure 2The figure shows a flowchart of a sewage water quality prediction method based on a pyramid-shaped three-dimensional model of multi-model fusion stacking provided in an embodiment of the present invention.
[0027] Figure 3 Shown is a flow chart of independent variables of the iterative prediction meta-model provided in an embodiment of the present invention.
[0028] Figure 4 Shown is a metamodel testing and data processing flow chart provided in an embodiment of the present invention.
[0029] Figure 5 Shown is a comparison chart of the predicted value of ammonia nitrogen NH3-N predicted by the scheme provided in the embodiment of the present invention and the actual test value.
[0030] Figure 6 Shown is a comparison chart of the COD predicted value obtained by using the solution provided by the present invention and the actual test value provided in the embodiment of the present invention. DETAILED DESCRIPTION
[0031] Now, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be understood that the embodiments shown and described in the accompanying drawings are only exemplary and are intended to explain the principles and spirit of the present invention, rather than to limit the scope of the present invention.
[0032] Example: like Figure 1 and Figure 2 As shown, a sewage water quality prediction method based on a pyramid-shaped stereo model of multi-model fusion stacking includes the following steps: S1. Obtain wastewater quality index monitoring data, and deform and expand the wastewater quality index monitoring data to obtain deformed and expanded data; the wastewater quality index monitoring data includes the conductivity EC, pH value, oxidation-reduction potential ORP, reaction temperature T, dissolved oxygen DO and turbidity NTU of the wastewater; the deformed and expanded data includes conductivity change rate △EC, pH change rate △pH, oxidation-reduction potential change rate △ORP, dissolved oxygen change rate △DO, reaction temperature change rate △T, turbidity change rate △NTU, conductivity accumulation value EC Cum , pH cumulative value pH Cum , Oxidation-reduction potential cumulative value ORP Cum , dissolved oxygen cumulative value DO Cum , reaction temperature cumulative value T Cum , Turbidity cumulative value NTU Cum , the product of the monitoring data of each wastewater quality index and the quotient of the monitoring data of each wastewater quality index.
[0033] S2. Construct a pyramid-shaped stereo prediction model based on multi-model fusion stacking; The three-dimensional prediction model includes the wastewater quality index prediction model and meta-model; The wastewater quality index prediction model is used to receive the wastewater quality index monitoring data and output a preliminary predicted value of COD and a preliminary predicted value of NH3-N; it includes a parallel random forest (RFR) model, a convolutional neural network (CNN) model, a gradient boosting tree (GBDT) model and a long short-term memory network (LSTM) model; the input end of the RFR model, the input end of the CNN model, the input end of the GBDT model and the input end of the LSTM model are all input ends of the entire wastewater quality index prediction model; the output end of the RFR model, the output end of the CNN model, the output end of the GBDT model and the output end of the LSTM model are all connected to the input end of the meta-model.
[0034] The RFR model constructs multiple decision trees and averages the prediction results of the multiple decision trees to obtain each preliminary prediction value; the calculation formula of each preliminary prediction value is:
[0035] in, represents the preliminary prediction values output by the RFR model, represents the total number of decision trees, Indicates the input wastewater quality index monitoring data, Indicates The prediction results of COD and NH3-N by the decision trees.
[0036] The GBDT model captures the nonlinear characteristics of wastewater quality index monitoring data by constructing a series of decision trees, specifically: Calculate the negative gradient of the current decision tree, and the calculation formula is:
[0037] in, Indicates the mth iteration j The negative gradient of the wastewater quality index, represents the partial derivative, represents the loss function, Indicates j The true labels of the instances, Represents the decision tree of the m-1th iteration for the j The predicted values of wastewater quality indicators, Indicates j The input parameters of the wastewater quality indicators are: represents the derivative of the loss function with respect to the predicted value of the boost model; The negative gradient of the current decision tree is used as the target of the loss function to calculate the next decision tree. The calculation formula is:
[0038] in, represents the predicted value of the decision tree at the mth iteration, represents the predicted value of the decision tree at the m-1th stage, Indicates The learning rate of a decision tree, Indicates The output of a decision tree, Indicates the monitoring data of wastewater quality indicators; Repeat the above steps until the preset number of iterations is reached to obtain the nonlinear characteristics of the wastewater quality index monitoring data.
[0039] The LSTM (Long Short-Term Memory) model is a special recurrent neural network (RNN) that can effectively capture long-term dependencies and contextual information in time series data. It aims to solve the gradient vanishing and explosion problems faced by traditional RNNs in long sequence learning. LSTM introduces a gating mechanism to enable the network to effectively capture long-term dependencies and contextual information. Its structure consists of multiple LSTM units, and the storage and update of information is mainly achieved through the following steps.
[0040] Input gate: The input gate determines how much of the current input information should be retained while combining the hidden state of the previous time step. It generates a weight between 0 and 1 through a sigmoid activation function to control the degree of information inflow.
[0041] Forget Gate: The forget gate determines which information in the previous state should be forgotten. Similarly, the forget gate uses the sigmoid activation function to generate weights.
[0042] Cell state update: Combining the output of the input gate and the forget gate, LSTM updates the cell state. First, a new candidate cell state is generated, and the value range is restricted by the tanh activation function, and then the current cell state is updated.
[0043] Output gate: The output gate determines the impact of the current cell state on the output. After sigmoid activation, combined with the tanh activated cell state, the current hidden state is generated.
[0044] This design enables LSTM to effectively learn and memorize important information in long sequence data and perform well in a variety of tasks, such as sequence prediction and natural language processing. Through the gating mechanism, LSTM overcomes the limitations of traditional RNN and can adapt to complex time series data. The LSTM model specifically includes the following formula:
[0045] in, represents the output parameter of the input gate, represents the output parameter of the forget gate, represents the output parameter of the output gate, Indicates that the LSTM model is The unit state at the moment, represents the sigmoid activation function, represents the weight of the input gate, express The hidden state of the moment, express The hidden state of the moment, express The wastewater quality index monitoring data is input into the LSTM model at all times. represents the bias of the input gate, represents the weight of the forget gate, represents the bias of the forget gate, Represents the adjustment factor dynamically calculated according to the current environmental conditions, represents the weight of the output gate, represents the bias of the output gate, Indicates that the LSTM model is The unit state at the moment, express The memory representation corresponding to the input information at each moment, represents the hyperbolic tangent activation function, represents the weight corresponding to the unit state update, Indicates the bias corresponding to the cell state update.
[0046] The meta-model is used to receive the COD preliminary prediction value and the NH3-N preliminary prediction value, and output the final COD prediction value and the NH3-N prediction value; the meta-model is a back propagation neural network (BPNN) neural network, and the BPNN neural network further integrates the features extracted from the wastewater quality index prediction model through connection weight optimization and error back propagation mechanism to perform intelligent prediction, and its output is:
[0047] in, It represents the final COD prediction value and NH3-N prediction value output by the BPNN neural network. represents the activation function, represents the weight of the output layer, represents the weight of the hidden layer, represents the bias term of the hidden layer, represents the bias term of the output layer, The fusion characteristics of the preliminary prediction values output by the wastewater quality index prediction model are represented, which are fused in parallel through the RFR model, the CNN model, the GBDT model and the LSTM model, that is, the wastewater quality index is predicted by the four models of the RFR model, the CNN model, the GBDT model and the LSTM model respectively, and the COD preliminary prediction value and the NH3-N preliminary prediction value are obtained, and then the COD preliminary prediction value and the NH3-N preliminary prediction value are used as the input of the meta-model for final prediction. Compared with simple processing such as weighted average or median method for the prediction value of the parallel model, the root mean square error (RMSE) and (MAE) of the prediction value obtained by the method of the present invention are better, and the prediction value is closer to the measured value (true value).
[0048] Step S2 specifically includes the following sub-steps: Perform expansion processing on the wastewater quality index monitoring data to obtain deformed expansion data; The SBR operating parameters are: 30 minutes of water inflow into the biochemical pool - 30 minutes of stirring - 30 minutes of aeration - ... - 30 minutes of stirring - 30 minutes of aeration - 30 minutes of drainage, of which "-30 minutes of stirring - 30 minutes of aeration -" has a total of 10 cycles, and the total operation cycle time is 660 minutes. In the SBR biochemical reaction pool, an online monitor for dissolved oxygen (DO), an online monitor for oxidation-reduction potential (ORP), and an online monitor for conductivity (EC) are installed. During the 600-minute reaction time excluding water inflow and drainage, the DO value, ORP value, and EC value of water quality are collected every 1 minute. Every 10 minutes, the NH3-N value of water quality is determined by chemical analysis methods, such as the NH3-N values at the 1st minute, the 11th minute, and the 21st minute. The NH3-N values at the rest of the time are obtained by arithmetic interpolation.
[0049] The SBR reactor was run for 100 complete cycles to obtain 100 cycles of DO value, ORP value, EC value, reaction temperature T and pH data. Each cycle data consists of 600 sets of data, and the data features in each cycle are time series. Each time series contains multiple input features as shown in Table 1, and 2 output features COD and NH3-N.
[0050] Table 1 Input feature description
[0051] Product: EC*pH, EC*DO, EC*ORP, EC*T, EC*NTU, pH*DO, pH*ORP, pH*T, pH*NTU, DO *ORP, DO*T, DO*NTU, ORP *T, ORP*NTU, T*NTU; Ask for quotient: EC / pH, EC / DO, EC / ORP, EC / T, EC / NTU, Ph / DO, pH / ORP, pH / T, pH / NTU, DO / ORP, DO / T, DO / NTU, ORP / T, ORP / NTU, T / NTU.
[0052] The wastewater quality index monitoring data is filled in using the arithmetic difference interpolation method to obtain complete wastewater quality index monitoring data; The complete wastewater quality index monitoring data and deformed and expanded data are used as independent variables, COD and NH3-N are used as dependent variables, and a variable data set is constructed. Each sample represents the water quality status at a specific time point, forming a time series data structure; The variable data set is input into the wastewater quality index prediction model for training, and the trained wastewater quality index prediction model, COD preliminary prediction value and NH3-N preliminary prediction value are obtained; Among the 100 cycles, 80 cycles are randomly selected and sorted. The data sets of the first 79 cycles are used as training sets, and the remaining 1 cycle data set is used as test sets. Two different prediction methods (BPNN model, LSTM model, RNN model, RFR model, GBDT model) are used to train the 79 training sets to obtain the corresponding prediction models. The two prediction models are used to predict the 80th cycle respectively, and the prediction results of the 80th cycle are obtained, which are recorded as x 80 ,y 80 Repeat the above steps, taking each of the 80 cycles as the test set and the remaining 79 sets as the training set, and a total of 80 independent prediction results are obtained, denoted as set W, X, W = {w1, w2, ..., w 80},X={x1,x2,……,x 80}, in this embodiment, the LSTM model and the RFR model are selected. Taking the prediction of COD as an example, the independent variable process of the iterative prediction meta-model is as follows Figure 3 shown.
[0053] The COD preliminary prediction value, the NH3-N preliminary prediction value, the COD measured value and the NH3-N measured value are input into the meta-model for training to obtain a three-dimensional prediction model; The remaining 20 cycle data after randomly selecting 80 cycles in 100 cycles are used as the test set of the meta-model, and the 80 cycle data selected in advance are used as the training set. The 20 cycle data are predicted by BPNN model, LSTM model, RNN model, RFR model and GBDT model respectively, and the preliminary prediction values of COD and NH3-N for 20 cycles are obtained, which are recorded as sets Y and Z, Y={y1,y2,……,y 20},Z={z1,z2,……,z20}, sets Y and Z are used as input features on the metamodel test set. The metamodel test and data processing process is as follows Figure 4 shown.
[0054] S3. Input the wastewater quality monitoring data and deformation expansion data into the three-dimensional prediction model, output the final COD prediction value and NH3-N prediction value, complete the wastewater quality prediction, and compare the prediction results with the test values. Figure 5 and Figure 6 shown.
[0055] The present invention improves the prediction accuracy of time series data by comprehensively utilizing the advantages of multiple models and training and predicting in a stacked manner through the above steps. The core of this method is to effectively integrate the prediction results of different models, use the BPNN neural network as a meta-model, fully tap the prediction ability of each model, and finally obtain a more accurate prediction result. This method has a wide range of application prospects in time series analysis and prediction tasks, and is suitable for data prediction needs in multiple fields.
[0056] The water quality intelligent prediction method of the present invention fully combines the advantages of BPNN model, LSTM model, RNN model, RFR model, GBDT model and BPNN model by stacking deep learning and integrated learning models, and maximizes the prediction performance of the model. This embodiment compares the prediction effect of the three-dimensional prediction model proposed by the present invention with that of a single BPNN model, LSTM model, RNN model and RFR model. The prediction performance of different models is shown in Table 2. It can be seen that in complex sewage water quality data, the present invention can better capture the time series characteristics and nonlinear relationships in the data. In real-time prediction, it can improve prediction accuracy, reduce overfitting, and provide more reliable information basis for proposing feasible improvement plans for wastewater treatment.
[0057] Table 2 Comparison of the prediction effects of the three-dimensional prediction model and other models on COD and ammonia nitrogen NH3-N on the test set
[0058] This invention can not only effectively promote the intelligence and automation of water quality monitoring, but also provide a new idea and method for predictive analysis in other fields, with broad application potential and market value. Through in-depth research on model stacking, it can be replaced or expanded in the future according to different application requirements to achieve more outstanding prediction performance.
[0059] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
Claims
1. A method for predicting sewage quality based on a pyramid-shaped three-dimensional model, characterized in that: The following steps are involved: S1. Obtain wastewater quality index monitoring data, and deform and expand the wastewater quality index monitoring data to obtain deformed and expanded data; S2. Construct a stereo prediction model based on multi-model fusion stacking; S3. Input the wastewater quality monitoring data and deformation expansion data into the three-dimensional prediction model, output the final COD prediction value and NH3-N prediction value, and complete the wastewater quality prediction.
2. The method for predicting sewage quality based on a pyramid-shaped stereoscopic model according to claim 1, characterized in that: The wastewater quality index monitoring data in step S1 includes the wastewater's electrical conductivity EC, pH value, oxidation-reduction potential ORP, reaction temperature T, dissolved oxygen DO, and turbidity NTU.
3. The sewage quality prediction method based on the pyramid-type three-dimensional model according to claim 2, characterized in that: The deformation expansion data includes conductivity change rate △EC, pH change rate △pH, redox potential change rate △ORP, dissolved oxygen change rate △DO, reaction temperature change rate △T, turbidity change rate △NTU, conductivity accumulation value EC Cum , pH cumulative value pH Cum , Oxidation-reduction potential cumulative value ORP Cum , dissolved oxygen cumulative value DO Cum , reaction temperature cumulative value T Cum , Turbidity cumulative value NTU Cum , the product of the monitoring data of each wastewater quality index and the quotient of the monitoring data of each wastewater quality index.
4. The method for predicting sewage quality based on a pyramid-shaped stereoscopic model according to claim 1, characterized in that: The three-dimensional prediction model in step S2 includes a wastewater quality index prediction model and a meta-model; The wastewater quality index prediction model is used to receive the wastewater quality index monitoring data and output a preliminary prediction value of COD and a preliminary prediction value of NH3-N; The meta-model is used to receive the COD preliminary prediction value and the NH3-N preliminary prediction value, and output the final COD prediction value and the NH3-N prediction value.
5. The sewage quality prediction method based on the pyramid-type three-dimensional model according to claim 4 is characterized in that: The wastewater quality index prediction model includes a parallel RFR model, a CNN model, a GBDT model and a LSTM model; the input end of the RFR model, the input end of the CNN model, the input end of the GBDT model and the input end of the LSTM model are all input ends of the entire wastewater quality index prediction model; the output end of the RFR model, the output end of the CNN model, the output end of the GBDT model and the output end of the LSTM model are all connected to the input end of the meta-model; The meta-model is a BPNN neural network.
6. The method for predicting sewage quality based on a pyramid-shaped stereoscopic model according to claim 5, characterized in that: The RFR model constructs multiple decision trees and averages the prediction results of the multiple decision trees to obtain each preliminary prediction value; the calculation formula of each preliminary prediction value is: in, represents the preliminary prediction values output by the RFR model, represents the total number of decision trees, Indicates the input wastewater quality index monitoring data, Indicates The prediction results of COD and NH3-N by the decision trees.
7. The method for predicting sewage quality based on a pyramid-shaped stereoscopic model according to claim 5, characterized in that: The GBDT model captures the nonlinear characteristics of wastewater quality index monitoring data by constructing a series of decision trees, specifically: Calculate the negative gradient of the current decision tree, and the calculation formula is: in, Indicates the mth iteration j The negative gradient of the wastewater quality index, represents the partial derivative, represents the loss function, Indicates j The true labels of the instances, Represents the decision tree of the m-1th iteration for the j The predicted values of wastewater quality indicators, Indicates j The input parameters of the wastewater quality indicators are: represents the derivative of the loss function with respect to the predicted value of the boost model; The negative gradient of the current decision tree is used as the target of the loss function to calculate the next decision tree. The calculation formula is: in, represents the predicted value of the decision tree at the mth iteration, represents the predicted value of the decision tree at the m-1th stage, Indicates The learning rate of a decision tree, Indicates The output of a decision tree, Indicates the monitoring data of wastewater quality indicators; Repeat the above steps until the preset number of iterations is reached to obtain the nonlinear characteristics of the wastewater quality index monitoring data.
8. The method for predicting sewage quality based on a pyramid-shaped stereoscopic model according to claim 5, characterized in that: The LSTM model captures the long-term dependency between wastewater quality monitoring data and the preliminary predicted values of COD and NH3-N by including an input gate, a forget gate, and an output gate; The input gate is used to determine how much current input information is retained; The forget gate is used to determine the information in the previous state that needs to be forgotten; The output gate is used to determine the impact of the current unit state on the output; The LSTM model specifically includes the following formula: in, represents the output parameter of the input gate, represents the output parameter of the forget gate, represents the output parameter of the output gate, Indicates that the LSTM model is The unit state at the moment, represents the sigmoid activation function, represents the weight of the input gate, express The hidden state of the moment, express The hidden state of the moment, express The wastewater quality index monitoring data is input into the LSTM model at all times. represents the bias of the input gate, represents the weight of the forget gate, represents the bias of the forget gate, Represents the adjustment factor dynamically calculated according to the current environmental conditions, represents the weight of the output gate, represents the bias of the output gate, Indicates that the LSTM model is The unit state at the moment, express The memory representation corresponding to the input information at each moment, represents the hyperbolic tangent activation function, represents the weight corresponding to the unit state update, Indicates the bias corresponding to the cell state update.
9. The method for predicting sewage quality based on a pyramid-shaped stereoscopic model according to claim 5, characterized in that: The output of the BPNN neural network is: in, It represents the final COD prediction value and NH3-N prediction value output by the BPNN neural network. represents the activation function, represents the weight of the output layer, represents the weight of the hidden layer, It represents the fusion features of the preliminary prediction values obtained by parallel fusion of the RFR model, CNN model, GBDT model and LSTM model. represents the bias term of the hidden layer, Represents the bias term of the output layer.
10. The method for predicting sewage quality based on a pyramid-shaped three-dimensional model according to claim 5, characterized in that: The step S2 specifically includes the following sub-steps: Perform expansion processing on the wastewater quality index monitoring data to obtain deformed expansion data; The wastewater quality index monitoring data is filled in using the arithmetic difference interpolation method to obtain complete wastewater quality index monitoring data; Construct variable data sets based on complete wastewater quality index monitoring data and deformation and expansion data; The variable data set is input into the wastewater quality index prediction model for training, and the trained wastewater quality index prediction model, COD preliminary prediction value and NH3-N preliminary prediction value are obtained; The preliminary predicted values of COD, preliminary predicted values of NH3-N, measured values of COD and measured values of NH3-N were input into the meta-model for training to obtain a three-dimensional prediction model.
Citation Information
Patent Citations
Offshore doubly fed wind power generator fault judging method based on GRA-LSTM-stacking model
CN111237134A
Water quality prediction method and device, electronic equipment and storage medium
CN113159456A
High-speed traffic emergency prediction and detection integrated method and system
CN116434547A
Waterfowl breeding water quality prediction method
CN117171624A
Method for predicting effluent quality of sewage treatment system
CN117273540A
Cited By
Multi-module collaborative optimization water quality prediction and control method and system
CN120717530A
Prediction method based on pyramid decomposition framework and multi-scale stacked LSTMs
CN120822666A