Sewage treatment effluent quality collaborative prediction method based on efficient second-order gradient compression algorithm
By using a fuzzy neural network model based on an efficient second-order gradient compression algorithm, the problem of ignoring interactive effects in traditional water quality prediction methods is solved, achieving efficient and accurate prediction of wastewater effluent quality and ensuring that the effluent quality meets discharge standards.
Patent Information
- Application Number
- CN202511357200.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2026-02-10
AI Technical Summary
Traditional water quality prediction methods ignore the interaction between water quality indicators during wastewater treatment, resulting in low prediction efficiency and inaccuracy, making it difficult to accurately predict the effluent quality of wastewater treatment plants.
A fuzzy neural network model based on an efficient second-order gradient compression algorithm is adopted. By introducing input weights to improve task information interaction, and a dimension alignment mechanism is designed to adjust parameter updates, the collaborative prediction of wastewater treatment effluent quality is achieved.
This improves the accuracy and efficiency of wastewater treatment effluent quality prediction, ensuring that the effluent meets national or local discharge standards.
Smart Images

Figure CN121503744A_ABST
Abstract
Description
Technical Field
[0001] This invention designs a collaborative prediction method for wastewater treatment effluent quality based on a highly efficient second-order gradient compression algorithm, achieving accurate collaborative prediction of multiple effluent quality indicators during wastewater treatment. By predicting the effluent quality of wastewater treatment plants, potential pollution problems can be identified and resolved in a timely manner, ensuring that the effluent meets national or local discharge standards. In practical applications, this collaborative prediction method for wastewater treatment effluent quality based on a highly efficient second-order gradient compression algorithm can fully utilize input information, improve the model's prediction accuracy, and enhance the operational efficiency of the wastewater treatment process. Background Technology
[0002] With the acceleration of global industrialization and urbanization, the generation and discharge of urban sewage are constantly increasing, and water pollution has become a major environmental problem facing the world. Modern sewage treatment technology has gradually developed into a combination of multiple methods to adapt to the increasing pollution load and more stringent environmental protection requirements. The automation level of sewage treatment plants has been gradually improving with the development of digital technology. However, in the sewage treatment process, numerous factors affect the effluent quality and interact with each other. Traditional water quality prediction methods ignore the interaction between water quality prediction tasks, resulting in low actual prediction efficiency and inaccurate results. Therefore, accurately predicting the effluent quality of sewage treatment plants based on multiple water quality indicators in the sewage treatment process is of great significance for achieving efficient management and optimized treatment of sewage treatment plants.
[0003] This invention designs a collaborative prediction method for wastewater treatment effluent quality based on an efficient second-order gradient compression algorithm. This method analyzes multiple water quality indicators of wastewater treatment, selects corresponding feature variables, establishes a collaborative prediction model for water quality based on an efficient second-order gradient compression algorithm, introduces input weights to improve task information interaction, uses the efficient second-order gradient compression algorithm to update parameters, and designs a dimension alignment mechanism to adjust the operation matrix, thereby achieving accurate collaborative prediction of multiple indicators of wastewater treatment effluent quality. Summary of the Invention
[0004] This invention presents a collaborative prediction method for wastewater treatment effluent quality based on an efficient second-order gradient compression algorithm. The method designs an effluent quality collaborative prediction model with task sharing based on a fuzzy neural network (FNN) structure, utilizing input weights to improve task information utilization. Furthermore, an efficient second-order gradient compression algorithm is designed to update model parameters using the second derivative of the parameters, and row vectors are used instead of matrices to reduce runtime storage. Finally, a dimension alignment mechanism is designed to address the dimension mismatch problem during parameter updates, thus assisting in parameter updates. This achieves collaborative prediction of wastewater treatment effluent quality, improving model prediction efficiency and accuracy.
[0005] The present invention adopts the following technical solution and implementation steps:
[0006] A collaborative prediction method for wastewater treatment effluent quality based on an efficient second-order gradient compression algorithm, characterized by the following steps:
[0007] (1) Selection of characteristic variables for water quality collaborative prediction model
[0008] Using wastewater treatment as the research object, this study aims to predict effluent total nitrogen and total phosphorus. The first task is to predict effluent total nitrogen, with six input variables: influent chemical oxygen demand (COD), influent ammonia nitrogen, nitrate nitrogen in the anoxic tank, mixed liquor suspended solids concentration in the anoxic tank, dissolved oxygen concentration in the aerobic tank, and sludge quantity. The second task is to predict effluent total phosphorus, with six input variables: influent hydrogen ion concentration, influent COD, dissolved oxygen concentration in the aerobic tank, effluent hydrogen ion concentration, orthophosphate data at the secondary sedimentation tank effluent, and sludge quantity. The influent COD at time t is obtained. Influent ammonia nitrogen Nitrate nitrogen in anoxic pond Anoxic pool mixed liquor suspended solids concentration Dissolved oxygen concentration in aerobic tank sludge volume data Construct the first task sample matrix Obtain the influent hydrogen ion concentration data at time t Influent chemical oxygen demand data Dissolved oxygen data from aerobic tank Hydrogen ion concentration in effluent Orthophosphorus data at the effluent of the secondary sedimentation tank sludge volume data Construct the second task sample matrix t = 1, 2, ..., M, where M is the total number of samples and T represents the transpose of the matrix;
[0009] (2) Constructing a water quality collaborative prediction model
[0010] The collaborative water quality prediction model consists of four layers: an input layer, an RBF layer, a normalization layer, and an output layer. The input layer has 12 neurons, the RBF layer has R1+R2+S neurons, the normalization layer has R1+R2+S neurons, and the output layer has 2 neurons. R1 represents the number of task-specific neurons for the first task, R2 represents the number of task-specific neurons for the second task, and S represents the number of shared neurons in the RBF layer and the normalization layer between tasks. Task-specific neurons are hidden layer neurons connected to the input of the l-th specific task; they are neurons specific to that task only. Shared neurons are hidden layer neurons connected to the input of all tasks. When l is 1, the specific task represents predicting total nitrogen in the effluent; when l is 2, the specific task represents predicting total phosphorus in the effluent. The output of each layer for the l-th task is...
[0011] (2.1) Input Layer: This layer contains the input variables for water quality prediction. The input for the l-th task is...
[0012]
[0013] (2.2) RBF layer: This layer includes task-specific neurons and shared neurons, and its output is...
[0014]
[0015] in It is the output of the r-th specific neuron in the RBF layer of the l-th task at time t, where l = 1, 2, r = 1, 2, ..., R l R l It is the number of specific neurons for the l-th task. It is the center of the r-th specific neuron of the l-th task and the i-th input at time t, where i = 1, 2, ..., 6. The parameter matrix of the specific centers of this layer of neurons is: σ li,r (t) represents the width of the r-th specific neuron in the l-th task at time t, and the parameter matrix for the specific width of neurons in this layer is:
[0016]
[0017] in It is the output of the s-th shared neuron in the RBF layer of the l-th task at time t, where s = 1, 2, ..., S. It is the input weight of the i-th input of the l-th task at time t and the input weight of the s-th shared neuron in the RBF layer. The input weight parameter matrix is: c i,s (t) represents the center of the s-th shared neuron in the i-th input of each task at time t. The shared center parameter matrix of this layer of neurons is C. s (t)=[c1(t),…,c s (t),…,c S (t)],c s (t)=[c 1,s (t),…,c i,s (t),…,c 6,s (t)],σ i,s (t) represents the width of the s-th shared neuron of the i-th input for each task at time t, and the shared width parameter matrix of neurons in this layer is Σ. s (t)=[σ1(t),…,σ s (t),…,σ S (t)],σ s (t)=[σ1,s (t),…,σ i,s (t),…,σ 6,s (t)];
[0018] (2.3) Normalization layer: The neurons in this layer correspond one-to-one with the neurons in the RBF layer, and the output is...
[0019]
[0020] in It is the output of the r-th specific neuron in the l-th task normalization layer at time t. It is the output of the s-th shared neuron in the l-th task normalization layer at time t;
[0021] (2.4) Output layer: The number of neurons in this layer is the same as the number of tasks.
[0022]
[0023] in It is the output of the l-th task at time t. The output weights of the l-th task and r-th specific neuron at time t are given by w. l (t)=[w l1 (t),…,w lr (t),…,w lRl (t)],w s (t) represents the output weight of the s-th shared neuron at time t, and the task-shared output weight parameter matrix is w. s (t)=[w1(t),…,w s (t),…,w S (t)];
[0024] (3) Efficient second-order gradient compression algorithm for parameter updating
[0025] (3.1) Initialize the water quality collaborative prediction model. Let the current time be t=1, and the initial input weights of the model be U. l (1) contains random values between 0 and 1, and the initial center value of the hidden layer neurons is... and C s (1) The internal elements are random values between 0 and 1, and the initial width value is... and The internal element is 1, and the initial output weight w of the normalization layer is... l (1) and w s(1) The internal elements are random values between 0 and 1. The total number of the first task-specific parameters is α, where α = 12R1 + 6S. The total number of the second task-specific parameters is β, where β = 12R2 + 6S. The total number of task-shared parameters is γ, where γ = 13S. ζ represents the update of all parameters, and the maximum number of iterations is K, where K ∈ [200, 500].
[0026] (3.2) Use formulas (2)-(6) to obtain the output of the l-th task sample at time t = 1 when k = 1. The output error of the l-th task is Define the total output error of the model as e k (t) = ∑ 2l=1 e lk (t). If time t < M, then t is incremented by 1; if t = M, calculate when k = 1 iteration Denoted as RRMSE l ;
[0027] (3.3) Use formulas (2)-(6) to obtain the output of the l-th task sample at time t = 1 when k > 1. Calculate the network output error e lk (t) of the l-th task, and calculate the total output error e k (t) of the model. If time t < M, then t is incremented by 1; if t = M, calculate
[0028] (3.4) Calculate the task parameter gradients using the output errors, and the input weights The gradient calculation is
[0029]
[0030] where ε(t) is the sum of the RBF layer outputs,
[0031] The center of the task-specific parameter and the center of the shared parameter c i,s The gradient calculation is
[0032]
[0033] The width σ of the task-specific parameter li,r and the width σ of the shared parameter i,s The gradient calculation is
[0034]
[0035] The weight of the task-specific parameter and the weight w of the shared parameter s The gradient calculation is
[0036]
[0037] The Jacobian row vector is obtained as follows
[0038]
[0039] Where ζ 1α This represents the α-th task-specific parameter of the first task, and the task-specific parameter matrix is denoted as... Let α be the number of elements in the vector. This represents the β-th task-specific parameter of the second task, and the task-specific parameter matrix is denoted as... The number of vector elements is denoted as β, ζ s,γ The γ-th shared parameter represents all tasks, and the shared parameter matrix is denoted as ζ. s,k (t)=[c1(t),…,c S (t),σ
[0040] 1(t),…,σ S (t),w s [t], the number of vector elements is denoted as γ;
[0041] (3.5) Calculate the gradient update direction when updating parameters for multiple tasks
[0042]
[0043] Let the result be Z. k =j k T (t)e k (t), perform matrix dimension transformation on it.
[0044] z k =Z k H⊙Ω (19)
[0045] H=[h1,h2,h3] (20)
[0046]
[0047] Where h1 is a 3×α matrix, h2 is a 3×β matrix, and h3 is a 3×γ matrix, ⊙ denotes matrix dot product, and the dot product with Ω yields the diagonal matrix z. k (t), where Ω is an N×N identity matrix, and N = α + β + γ;
[0048]
[0049] Where n = [1, 1, ..., 1] T n has N elements;
[0050] (3.6) Compare RRMSE l and RMSEl Determine if the parameters need to be updated; if RMSE l >RRMSE l Update parameters using an efficient second-order gradient compression algorithm.
[0051] ζ k+1 (t)=ζ k (t)+(Q k +λ k I) -1 G k (twenty three)
[0052] Where λ k The initial value is 0.01, I is the identity matrix, and Q... k and G k Calculated as
[0053]
[0054] And adjust the model training speed, λ k +1=50λ k Conversely, RRMSE l =RMSE l The parameters are not updated, λ k +1=λ k / 10;
[0055] (3.7) Determine whether the maximum number of training rounds has been reached. If the number of iterations K has been reached, training ends and proceeds to step (4); if the number of iterations K has not been reached, k is increased by 1 and the process returns to step (3.3) to continue training.
[0056] Determine RRMSE l Has the threshold of 0.001 been reached? If it has, training stops; otherwise, the number of shared neurons is adjusted. and Then S = S + 1, otherwise decrease; the number of shared neurons is greater than or equal to 1, but less than the specific number of neurons; in each specific task, the number of specific neurons is automatically adjusted according to the training results of that task; if RMSE lk+1 RMSE lk Then R l =R l +1, or decrease if the number of neurons is less than or equal to 1, return to step (3) to retrain;
[0057] (4) Realize collaborative prediction of wastewater effluent quality based on efficient second-order gradient compression algorithm
[0058] To achieve collaborative prediction of effluent quality in wastewater treatment processes, the system collects input and output data corresponding to two task samples: total nitrogen and total phosphorus in the effluent, and obtains the influent chemical oxygen demand data at time t. Influent ammonia nitrogen data Nitrate nitrogen data from anoxic ponds Anoxic pool mixed liquor suspended solids concentration Dissolved oxygen concentration data in aerobic tank sludge volume data Construct the first task sample matrix Obtain the influent hydrogen ion concentration data at time t Influent chemical oxygen demand data Dissolved oxygen data from aerobic tank Hydrogen ion concentration in effluent Orthophosphorus data at the effluent of the secondary sedimentation tank sludge volume data Construct the second task sample matrix t = 1, 2, ..., M, where M is the total number of samples; after data normalization, the input vector is input into the input layer of the water quality collaborative prediction model, and then passed through the RBF layer, normalization layer and output layer of the water quality collaborative prediction model. The output value of the water quality collaborative prediction is obtained by using formulas (2)-(6), and the predicted value of total nitrogen in the effluent is obtained. and predicted total phosphorus in effluent f(·) represents the expression in formulas (1)-(6). Regarding x l The mapping relationship of (t).
[0059] The inventiveness of this invention is mainly reflected in:
[0060] This invention addresses the challenges of complex wastewater treatment processes and the slow convergence of first-order optimization algorithms that neglect higher-order interaction curvature information, leading to inaccurate prediction of effluent quality. To address these issues, a collaborative water quality prediction model with task sharing is established. This model introduces input weights to improve task information utilization and proposes an efficient second-order gradient compression algorithm to update parameters, thereby achieving accurate effluent quality prediction. Attached Figure Description
[0061] Figure 1 This invention presents the training RMSE changes of training samples for predicting the effluent quality of wastewater treatment. The blue part represents the training RMSE changes of total nitrogen in the effluent, and the purple part represents the training RMSE changes of total phosphorus in the effluent.
[0062] Figure 2 This is a graph showing the prediction results of the present invention for total nitrogen in wastewater effluent training samples;
[0063] Figure 3 This is a graph showing the prediction results of the present invention for total phosphorus in wastewater effluent training samples;
[0064] Figure 4 This is a graph showing the predicted results of the present invention for total nitrogen test samples in wastewater treatment effluent;
[0065] Figure 5 This is a graph showing the predicted results of the present invention for total phosphorus test samples of wastewater effluent. Detailed Implementation
[0066] This invention designs a collaborative prediction method for wastewater treatment effluent quality based on an efficient second-order gradient compression algorithm. Taking two water quality prediction tasks as examples, the first task is to predict the total nitrogen in the effluent, with the corresponding input variables being six variables: influent chemical oxygen demand (COD), influent ammonia nitrogen, nitrate nitrogen in the anoxic tank, suspended solids concentration in the mixed liquor of the anoxic tank, dissolved oxygen concentration in the aerobic tank, and sludge quantity. The second task is to predict the total phosphorus in the effluent, with the corresponding input variables being six variables: influent hydrogen ion concentration, influent COD, dissolved oxygen concentration in the aerobic tank, effluent hydrogen ion concentration, orthophosphorus data at the effluent of the secondary sedimentation tank, and sludge quantity. The total nitrogen and total phosphorus in the effluent are used as the output variables of the collaborative prediction model.
[0067] The experimental data came from the actual sampling data of the operating variables of a wastewater treatment plant in 2021. The sampling interval was one minute. After screening and processing, 400 data samples were selected as training samples and the last 100 samples were used as test samples.
[0068] The present invention adopts the following technical solution and implementation steps:
[0069] A collaborative prediction method for wastewater treatment effluent quality based on an efficient second-order gradient compression algorithm, characterized by the following steps:
[0070] (1) Selection of characteristic variables for water quality collaborative prediction model
[0071] Using wastewater treatment as the research object, this study aims to predict effluent total nitrogen and total phosphorus. The first task is to predict effluent total nitrogen, with six input variables: influent chemical oxygen demand (COD), influent ammonia nitrogen, nitrate nitrogen in the anoxic tank, mixed liquor suspended solids concentration in the anoxic tank, dissolved oxygen concentration in the aerobic tank, and sludge quantity. The second task is to predict effluent total phosphorus, with six input variables: influent hydrogen ion concentration, influent COD, dissolved oxygen concentration in the aerobic tank, effluent hydrogen ion concentration, orthophosphate data at the secondary sedimentation tank effluent, and sludge quantity. The influent COD at time t is obtained. Influent ammonia nitrogen Nitrate nitrogen in anoxic pond Anoxic pool mixed liquor suspended solids concentration Dissolved oxygen concentration in aerobic tank sludge volume data Construct the first task sample matrix Obtain the influent hydrogen ion concentration data at time t Influent chemical oxygen demand data Dissolved oxygen data from aerobic tank Hydrogen ion concentration in effluent Orthophosphorus data at the effluent of the secondary sedimentation tank sludge volume data Construct the second task sample matrix t = 1, 2, ..., M, where M is the total number of samples and T represents the transpose of the matrix;
[0072] (2) Constructing a water quality collaborative prediction model
[0073] The collaborative water quality prediction model consists of four layers: an input layer, an RBF layer, a normalization layer, and an output layer. The input layer has 12 neurons, the RBF layer has R1+R2+S neurons, the normalization layer has R1+R2+S neurons, and the output layer has 2 neurons. R1 represents the number of task-specific neurons for the first task, R2 represents the number of task-specific neurons for the second task, and S represents the number of shared neurons in the RBF layer and the normalization layer between tasks. Task-specific neurons are hidden layer neurons connected to the input of the l-th specific task; they are neurons specific to that task only. Shared neurons are hidden layer neurons connected to the input of all tasks. When l is 1, the specific task represents predicting total nitrogen in the effluent; when l is 2, the specific task represents predicting total phosphorus in the effluent. The output of each layer for the l-th task is...
[0074] (2.1) Input Layer: This layer contains the input variables for water quality prediction. The input for the l-th task is...
[0075]
[0076] (2.2) RBF layer: This layer includes task-specific neurons and shared neurons, and its output is...
[0077]
[0078] in It is the output of the r-th specific neuron in the RBF layer of the l-th task at time t, where l = 1, 2, r = 1, 2, ..., R l R l It is the number of specific neurons for the l-th task. It is the center of the r-th specific neuron of the l-th task and the i-th input at time t, where i = 1, 2, ..., 6. The parameter matrix of the specific centers of this layer of neurons is: σ li,r (t) represents the width of the r-th specific neuron in the l-th task at time t, and the parameter matrix for the specific width of neurons in this layer is:
[0079]
[0080] in It is the output of the s-th shared neuron in the RBF layer of the l-th task at time t, where s = 1, 2, ..., S. It is the input weight of the i-th input of the l-th task at time t and the input weight of the s-th shared neuron in the RBF layer. The input weight parameter matrix is: c i,s (t) represents the center of the s-th shared neuron in the i-th input of each task at time t. The shared center parameter matrix of this layer of neurons is C. s (t)=[c1(t),…,c s (t),…,c S (t)],c s (t)=[c 1,s (t),…,c i,s (t),…,c 6,s (t)],σ i,s (t) represents the width of the s-th shared neuron of the i-th input for each task at time t, and the shared width parameter matrix of neurons in this layer is Σ. s (t)=[σ1(t),…,σ s (t),…,σ S (t)],σ s (t)=[σ 1,s (t),…,σ i,s (t),…,σ 6,s (t)];
[0081] (2.3) Normalization layer: The neurons in this layer correspond one-to-one with the neurons in the RBF layer, and the output is...
[0082]
[0083] in It is the output of the r-th specific neuron in the l-th task normalization layer at time t. It is the output of the s-th shared neuron in the l-th task normalization layer at time t;
[0084] (2.4) Output layer: The number of neurons in this layer is the same as the number of tasks.
[0085]
[0086] in It is the output of the l-th task at time t. This represents the output weights of the l-th task and the r-th specific neuron at time t. The task-specific output weight parameter matrix is as follows. w s$(t)$ is the output weight of the $s$-th shared neuron at time $t$, and the task-sharing output weight parameter matrix is $w$ s $(t)=[w_1(t),…,w$ s (t),…,w$ S (t)];
[0087] (3) Update parameters using the efficient second-order gradient compression algorithm
[0088] (3.1) Initialize the water quality collaborative prediction model. Let the current time $t = 1$, the initial input weight $U$ of the model l (1) The internal elements are random values between 0 and 1, and the initial center value of the hidden layer neurons and $C$ s (1) The internal elements are random values between 0 and 1, and the initial width value and The internal elements are 1, and the initial output weight $w$ of the normalization layer l (1) and $w$ s (1) The internal elements are random values between 0 and 1. The total number of the first task-specific parameters is $\alpha$, $\alpha = 12R_1 + 6S$. The total number of the second task-specific parameters is $\beta$, $\beta = 12R_2 + 6S$. The total number of task-sharing parameters is $\gamma$, $\gamma = 13S$. $\zeta$ represents the update of all parameters, and the maximum number of iterations is $K$, $K\in[200,500]$;
[0089] (3.2) Use formulas (2)-(6) to obtain the output of the $l$-th task sample at time $t = 1$ when $k = 1$. The output error of the $l$-th task is Define the total output error of the model as $e$ k (t)=\sum$ 2l=1 $e$ lk (t). If the time $t < M$, then $t$ is incremented by 1; if $t = M$, calculate the value at $k = 1$ iteration Denoted as $RRMSE$ l ;
[0090] (3.3) Use formulas (2)-(6) to obtain the output of the $l$-th task sample at time $t = 1$ when $k > 1$. Calculate the network output error $e$ of the $l$-th task lk (t), calculate the total output error $e$ of the model k (t). If the time $t < M$, then $t$ is incremented by 1; if $t = M$, calculate
[0091] (3.4) Calculate the task parameter gradient using the output error, and the input weight The gradient calculation is
[0092]
[0093] Where ε(t) is the output of the RBF layer,
[0094] Task-Specific Parameter Center and shared parameter center c i,s Gradient calculation is
[0095]
[0096] Task-specific parameter width σ li,r and shared parameter width σ i,s Gradient calculation is
[0097]
[0098] Task-specific parameter weights and shared parameter weights w s Gradient calculation is
[0099]
[0100] The Jacobian row vector is obtained as follows
[0101]
[0102] Where ζ 1α This represents the α-th task-specific parameter of the first task, and the task-specific parameter matrix is denoted as... Let α be the number of elements in the vector. This represents the β-th task-specific parameter of the second task, and the task-specific parameter matrix is denoted as... The number of vector elements is denoted as β, ζ s,γ The γ-th shared parameter represents all tasks, and the shared parameter matrix is denoted as ζ. s,k (t)=[c1(t),…,c S (t),σ1(t),…,σ S (t),w s [t], the number of vector elements is denoted as γ;
[0103] (3.5) Calculate the gradient update direction when updating parameters for multiple tasks
[0104]
[0105] Let the result be Z. k =j k T (t)e k (t), perform matrix dimension transformation on it.
[0106] z k =Z kH⊙Ω (44)
[0107] H = [h1, h2, h3] (45)
[0108]
[0109] Where h1 is a 3×α matrix, h2 is a 3×β matrix, and h3 is a 3×γ matrix, ⊙ denotes matrix dot product, and the dot product with Ω yields the diagonal matrix z. k (t), where Ω is an N×N identity matrix, and N = α + β + γ;
[0110]
[0111] Where n = [1, 1, ..., 1] T n has N elements;
[0112] (3.6) Compare RRMSE l and RMSE l Determine if the parameters need to be updated; if RMSE l >RRMSE l Update parameters using an efficient second-order gradient compression algorithm.
[0113] ζ k+1 (t)=ζ k (t)+(Q k +λ k I) -1 G k (48)
[0114] Where λ k The initial value is 0.01, I is the identity matrix, and Q... k and G k Calculated as
[0115]
[0116] And adjust the model training speed, λ k +1=50λ k Conversely, RRMSE l =RMSE l The parameters are not updated, λ k +1=λ k / 10;
[0117] (3.7) Determine whether the maximum number of training rounds has been reached. If the number of iterations K has been reached, training ends and proceeds to step (4); if the number of iterations K has not been reached, k is increased by 1 and the process returns to step (3.3) to continue training.
[0118] Determine RRMSE lHas the threshold of 0.001 been reached? If it has, training stops; otherwise, the number of shared neurons is adjusted. and Then S = S + 1, otherwise decrease; the number of shared neurons is greater than or equal to 1, but less than the specific number of neurons; in each specific task, the number of specific neurons is automatically adjusted according to the training results of that task; if RMSE lk+1 RMSE lk Then R l =R l +1, or decrease if the number of neurons is less than or equal to 1, return to step (3) to retrain;
[0119] (4) Realize collaborative prediction of wastewater effluent quality based on efficient second-order gradient compression algorithm
[0120] To achieve collaborative prediction of effluent quality in wastewater treatment processes, the system collects input and output data corresponding to two task samples: total nitrogen and total phosphorus in the effluent, and obtains the influent chemical oxygen demand data at time t. Influent ammonia nitrogen data Nitrate nitrogen data from anoxic ponds Anoxic pool mixed liquor suspended solids concentration Dissolved oxygen concentration data in aerobic tank sludge volume data Construct the first task sample matrix Obtain the influent hydrogen ion concentration data at time t Influent chemical oxygen demand data Dissolved oxygen data from aerobic tank Hydrogen ion concentration in effluent Orthophosphorus data at the effluent of the secondary sedimentation tank sludge volume data Construct the second task sample matrix t = 1, 2, ..., M, where M is the total number of samples; after data normalization, the input vector is input into the input layer of the water quality collaborative prediction model, and then passed through the RBF layer, normalization layer and output layer of the water quality collaborative prediction model. The output value of the water quality collaborative prediction is obtained by using formulas (2)-(6), and the predicted value of total nitrogen in the effluent is obtained. and predicted total phosphorus in effluent In formulas (1)-(6) Regarding x l The mapping relationship of (t).
Claims
1. A collaborative prediction method for wastewater treatment effluent quality based on an efficient second-order gradient compression algorithm, characterized in that, Includes the following steps: (1) Selection of characteristic variables for water quality collaborative prediction model Using wastewater treatment as the research object, this study aims to predict effluent total nitrogen and total phosphorus. The first task is to predict effluent total nitrogen, with six input variables: influent chemical oxygen demand (COD), influent ammonia nitrogen, nitrate nitrogen in the anoxic tank, mixed liquor suspended solids concentration in the anoxic tank, dissolved oxygen concentration in the aerobic tank, and sludge quantity. The second task is to predict effluent total phosphorus, with six input variables: influent hydrogen ion concentration, influent COD, dissolved oxygen concentration in the aerobic tank, effluent hydrogen ion concentration, orthophosphate data at the secondary sedimentation tank effluent, and sludge quantity. The influent COD at time t is obtained. Influent ammonia nitrogen Nitrate nitrogen in anoxic pond Anoxic pool mixed liquor suspended solids concentration Dissolved oxygen concentration in aerobic tank sludge volume data Construct the first task sample matrix Obtain the influent hydrogen ion concentration data at time t Influent chemical oxygen demand data Dissolved oxygen data from aerobic tank Hydrogen ion concentration in effluent Orthophosphorus data at the effluent of the secondary sedimentation tank sludge volume data Construct the second task sample matrix t = 1, 2, ..., M, where M is the total number of samples and T represents the transpose of the matrix; (2) Constructing a water quality collaborative prediction model The collaborative water quality prediction model consists of four layers: an input layer, an RBF layer, a normalization layer, and an output layer. The input layer has 12 neurons, the RBF layer has R1+R2+S neurons, the normalization layer has R1+R2+S neurons, and the output layer has 2 neurons. R1 represents the number of task-specific neurons for the first task, R2 represents the number of task-specific neurons for the second task, and S represents the number of shared neurons in the RBF layer and the normalization layer between tasks. Task-specific neurons are hidden layer neurons connected to the input of the l-th specific task; they are neurons specific to that task only. Shared neurons are hidden layer neurons connected to the input of all tasks. When l is 1, the specific task represents predicting total nitrogen in the effluent; when l is 2, the specific task represents predicting total phosphorus in the effluent. The output of each layer for the l-th task is... (2.1) Input Layer: This layer contains the input variables for water quality prediction. The input for the l-th task is... (2.2) RBF layer: This layer includes task-specific neurons and shared neurons, and its output is... in It is the output of the r-th specific neuron in the RBF layer of the l-th task at time t, where l = 1, 2, r = 1, 2, ..., R l R l It is the number of specific neurons for the l-th task. It is the center of the r-th specific neuron of the l-th task and the i-th input at time t, where i = 1, 2, ..., 6. The parameter matrix of the specific centers of this layer of neurons is: It is the width of the r-th specific neuron of the l-th task and the i-th input at time t. The parameter matrix of the specific width of the neurons in this layer is: in It is the output of the s-th shared neuron in the RBF layer of the l-th task at time t, where s = 1, 2, ..., S. It is the input weight of the i-th input of the l-th task at time t and the input weight of the s-th shared neuron in the RBF layer. The input weight parameter matrix is: c i,s (t) represents the center of the s-th shared neuron in the i-th input of each task at time t. The shared center parameter matrix of this layer of neurons is C. s (t)=[c1(t),…,c s (t),…,c S (t)],c s (t)=[c 1,s (t),…,c i,s (t),…,c 6,s (t)],σ i,s (t) represents the width of the s-th shared neuron of the i-th input for each task at time t, and the shared width parameter matrix of neurons in this layer is Σ. s (t)=[σ1(t),…,σ s (t),…,σ S (t)],σ s (t)=[σ 1,s (t),…,σ i,s (t),…,σ 6,s (t)]; (2.3) Normalization layer: The neurons in this layer correspond one-to-one with the neurons in the RBF layer, and the output is... in It is the output of the r-th specific neuron in the l-th task normalization layer at time t. It is the output of the s-th shared neuron in the l-th task normalization layer at time t; (2.4) Output layer: The number of neurons in this layer is the same as the number of tasks. in It is the output of the l-th task at time t. This represents the output weights of the l-th task and the r-th specific neuron at time t. The task-specific output weight parameter matrix is as follows. w s (t) represents the output weight of the s-th shared neuron at time t, and the task-shared output weight parameter matrix is w. s (t)=[w1(t),…,w s (t),…,w S (t)]; (3) Efficient second-order gradient compression algorithm for parameter updating (3.1) Initialize the water quality collaborative prediction model. Let the current time be t=1, and the initial input weights of the model be U. l (1) contains random values between 0 and 1, and the initial center value of the hidden layer neurons is... and C s (1) The internal elements are random values between 0 and 1, and the initial width value is... and The internal element is 1, and the initial output weight w of the normalization layer is... l (1) and w s (1) The internal elements are random values between 0 and 1. The total number of specific parameters for the first task is α, α = 12R1 + 6S, the total number of specific parameters for the second task is β, β = 12R2 + 6S, the total number of shared parameters for the tasks is γ, γ = 13S, ζ represents all parameters being updated, and the maximum number of iterations is K, K∈[200,500]; (3.2) Obtain the output of the $l$-th task sample at time $t = 1$ for $k = 1$ iteration using equations (2)-(6). The output error of the $l$-th task is Define the total output error of the model as If time $t < M$, then increment $t$ by 1; if $t = M$, calculate for $k = 1$ iteration Denoted as RRMSE l ; (3.3) Obtain the output of the $l$-th task sample at $t = 1$ for $k>1$ iterations using equations (2)-(6), and calculate the network output error of the $l$-th task Calculate the total output error $e$ of the model k $(t)$. If $t < M$, then $t$ is incremented by 1; if $t = M$, calculate (3.4) Calculate the gradient of the task parameters using the output error and input the weights. Gradient calculation is Where ε(t) is the output of the RBF layer, Task-Specific Parameter Center and shared parameter center c i,s Gradient calculation is Task-specific parameter width and shared parameter width σ i,s Gradient calculation is Task-specific parameter weights and shared parameter weights w s Gradient calculation is The Jacobian row vector is obtained as follows in This represents the α-th task-specific parameter of the first task, and the task-specific parameter matrix is denoted as... Let α be the number of elements in the vector. This represents the β-th task-specific parameter of the second task, and the task-specific parameter matrix is denoted as... The number of vector elements is denoted as β, ζ s,γ The γ-th shared parameter represents all tasks, and the shared parameter matrix is denoted as ζ. s,k (t)=[c1(t),…,c S (t),σ1(t),…,σ S (t),w s [t], the number of vector elements is denoted as γ; (3.5) Calculate the gradient update direction when updating parameters for multiple tasks Let the result be Z. k =j k T (t)e k (t), perform matrix dimension transformation on it. With k =Z k H⊙Ω (19) H=[h1,h2,h3](20) Where h1 is a 3×α matrix, h2 is a 3×β matrix, and h3 is a 3×γ matrix, ⊙ denotes matrix dot product, and the dot product with Ω yields the diagonal matrix z. k (t), where Ω is an N×N identity matrix, and N = α + β + γ; Where n = [1, 1, ..., 1] T n has N elements; (3.6) Compare RRMSE l and RMSE l Determine if the parameters need to be updated; if RMSE l >RRMSE l Update parameters using an efficient second-order gradient compression algorithm. g k+1 (t)=ζ k (t)+(Q k +λ k I) -1 G k (23) Where λ k The initial value is 0.01, I is the identity matrix, and Q... k and G k Calculated as And adjust the model training speed, λ k +1=50λ k Conversely, RRMSE l =RMSE l The parameters are not updated, λ k +1=λ k / 10; (3.7) Determine whether the maximum number of training rounds has been reached. If the number of iterations K has been reached, training ends and proceeds to step (4); if the number of iterations K has not been reached, k is increased by 1 and the process returns to step (3.3) to continue training. Determine RRMSE l Has the threshold of 0.001 been reached? If it has, training stops. Otherwise, adjust the number of shared neurons if and Then S = S + 1, otherwise decrease; the number of shared neurons is greater than or equal to 1, but less than the specific number of neurons; in each specific task, the number of specific neurons is automatically adjusted according to the training results of that task. Then R l =R l +1, or decrease if the number of neurons is less than or equal to 1, return to step (3) to retrain; (4) Realize collaborative prediction of wastewater effluent quality based on efficient second-order gradient compression algorithm To achieve collaborative prediction of effluent quality in wastewater treatment processes, the system collects input and output data corresponding to two task samples: total nitrogen and total phosphorus in the effluent, and obtains the influent chemical oxygen demand data at time t. Influent ammonia nitrogen data Nitrate nitrogen data from anoxic ponds Anoxic pool mixed liquor suspended solids concentration Dissolved oxygen concentration data in aerobic tank sludge volume data Construct the first task sample matrix Obtain the influent hydrogen ion concentration data at time t Influent chemical oxygen demand data Dissolved oxygen data from aerobic tank Hydrogen ion concentration in effluent Orthophosphorus data at the effluent of the secondary sedimentation tank sludge volume data Construct the second task sample matrix M is the total number of samples; after data normalization, the input vector is input into the input layer of the water quality collaborative prediction model, and then passed through the RBF layer, normalization layer and output layer of the water quality collaborative prediction model. The output value of the water quality collaborative prediction is obtained by using formulas (2)-(6), and the predicted value of total nitrogen in the effluent is obtained. and predicted total phosphorus in effluent f(·) represents the expression in formulas (1)-(6). Regarding x l The mapping relationship of (t).