A prediction method for effluent BOD concentration based on the PSLSTM neural network

By applying a simplified long and short-term memory (PSLSTM) neural network model based on partial least squares pruning algorithm in sewage treatment plants, the problem that existing technology is difficult to predict the effluent BOD concentration in the future is solved, and efficient, accurate and low-cost prediction effects are achieved, providing strong support for the decision-making of sewage treatment plants.

CN114565143BActive Publication Date: 2025-06-27BEIJING UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210151277.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2025-06-27
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

The prior art is difficult to predict the concentration of effluent BOD at the future moment, resulting in a lack of strong basis for sewage treatment plants when making decisions.

Method used

A simplified long and short-term memory (PSLSTM) neural network model based on partial least squares pruning algorithm is designed. By conducting parameter training on the actual data of the sewage treatment plant, it can achieve efficient, accurate and low-cost prediction of the effluent BOD concentration in the future.

Benefits of technology

It realizes high-precision prediction of the BOD concentration of effluent in the future, reduces the prediction cost, provides a basis for scientific decision-making, and improves the level of water quality monitoring of sewage treatment plants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565143B_ABST
    Figure CN114565143B_ABST
Patent Text Reader

Abstract

A method for predicting the effluent BOD concentration based on the PSLSTM neural network realizes the prediction of the effluent BOD concentration at future moments, and directly applies artificial intelligence technology to the field of sewage treatment. The present invention aims at the problems such as long waiting time and time lag in the process of predicting the effluent BOD concentration in the current sewage treatment process. This method designs a hybrid strategy that combines gate structure simplification and parameter simplification to simplify the internal structure of the LSTM, uses PLS regression coefficients to evaluate the importance of LSTM units, and prunes the redundant hidden layer size by merging unimportant units with their most relevant units. The results show that this method can achieve a balance between good generalization ability and a compact network structure, accurately and quickly predict the effluent BOD concentration at future moments, and provide a reference for scientific decision-making by relevant departments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention uses a Partial Least Squares-Based Pruning Algorithm for Simplified Long-Short Term Memory (PSLSTM) neural network to achieve the prediction of the effluent BOD concentration at future times, which relates to the field of artificial intelligence and is directly applied to the field of sewage treatment water quality parameter prediction. Background Art

[0002] Biochemical Oxygen Demand (BOD) refers to the amount of dissolved oxygen consumed during the biochemical reaction process of microorganisms under aerobic conditions, which is one of the key parameters describing the characteristics of sewage and an important indicator for measuring the overall performance of sewage treatment. Currently, existing methods such as dilution and inoculation, manual timed sampling, and sensor detection can only detect the effluent BOD concentration at the current time and cannot predict the effluent BOD concentration at future times. Predicting the effluent BOD concentration at future times based on current and past state information to judge the trend of the effluent BOD concentration at future times can provide a strong basis for the application decision-making of sewage treatment plants. Therefore, designing a model to efficiently predict the effluent BOD concentration at future times is a difficult problem faced in the sewage treatment process. The LSTM neural network can identify the non-linear relationship between variables and can predict the variables at future times, solving the problem of difficult prediction of the effluent BOD concentration at future times. The present invention designs a method for predicting the effluent BOD concentration based on the PSLSTM neural network to achieve efficient, accurate, and low-cost prediction of the effluent BOD concentration at future times, providing a reference for the scientific decision-making of relevant departments. Summary of the Invention

[0003] The present invention designs a method for predicting the effluent BOD concentration based on the PSLSTM neural network, and uses the actual data of the sewage treatment plant to train the parameters of the network model to achieve efficient, accurate, and low-cost prediction of the effluent BOD concentration at future times.

[0004] A method for predicting the effluent BOD concentration based on the PSLSTM neural network, characterized by comprising the following steps:

[0005] Step 1: Data preprocessing;

[0006] Step 1.1: Calculate the mutual information value between each water quality parameter of the sewage treatment plant and the effluent BOD concentration. The calculation method is shown in Equation (1). Select the variables with a mutual information value greater than 0.84 to obtain the auxiliary variables strongly correlated with the effluent BOD concentration: effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity;

[0007]

[0008] Among them, I(X,Y) represents the mutual information between X and Y, p(x,y) represents the joint probability density distribution function of x and y, and p(x) and p(y) represent the probability density distribution functions of x and y respectively;

[0009] Step 1.2: Select the effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity, and effluent BOD concentration at times t-2, t-1, and t as input variables, and the effluent BOD concentration at time t+1 as the output variable; normalize the input variables and output variables to [-1,1] according to Formulas (2)-(3):

[0010]

[0011] Among them, X t represents the input variable at time t, x t represents the normalized input variable at time t, O t represents the output variable at time t, x t represents the normalized output variable at time t;

[0012] Step 2: Design a PSLSTM neural network prediction model for effluent BOD;

[0013] Step 2.1: Design the structure of the SLSTM neural network;

[0014] The designed SLSTM neural network consists of 2 control gates and a memory unit. The calculation functions of each structure are as follows:

[0015] ① Input gate: The input gate i t controls the information to be input into the network, and the calculation is as follows:

[0016] i t =σ(U i h t-1 +b i ) (4)

[0017] Among them, U i and b i are the recurrent weight matrix and bias weight matrix of the input gate respectively, h t-1 is the unit output at time t-1, and σ is the sigmoid activation function (σ(x)=1 / 1+e-x )

[0018] ② Memory unit: Memory unit c t Combines the current information with previous information and calculates as follows:

[0019] c t =(1 - i t )⊙c t-1 +z t (5)

[0020] where ⊙ represents dot product operation, c t-1 is the state of the memory unit at time t - 1, z t represents the combined unit input of the input variable x at time t t and the unit output h at time t - 1 t-1 to update the input:

[0021] z t =g(W z x t +U z h t-1 +b z ) (6)

[0022] where W z , U z and b z are the input weight matrix, recurrence weight matrix, and bias weight matrix of the unit input respectively, and g is the hyperbolic tangent activation function (g(x)=tanh(x));

[0023] ③ Output gate: Output gate o t Controls how much of the unit output h t is output to the network through the following formula:

[0024] o t =σ(U o h t-1 +b o ) (7)

[0025] h t =o t ⊙g(c t ) (8)

[0026] where U o and b o are the recurrence weight matrix and bias weight matrix of the output gate respectively, h t is the output of the LSTM unit at time t, and g(c t ) represents that c t is transformed by the tanh activation function;

[0027] Calculate the final output y of the SLSTM t As follows:

[0028] y t = W y h t (9)

[0029] where W y is the connection matrix between the cell output and the final output of the PSLSTM;

[0030] Step 2.2: Design a pruning algorithm for the SLSTM neural network based on PLS;

[0031] Step 2.2.1: Use the Partial Least Squares (PLS) method to calculate the corresponding regression coefficients of each internal memory cell of the LSTM. The PLS regression equation is as follows:

[0032] y t = a1c t,1 + ··· + a m c t,m + ··· + a M(t) c t,M(t) (10)

[0033] where a m is the PLS regression coefficient, and M(t) is the number of LSTM cells at time t;

[0034] Step 2.2.2: Select unimportant LSTM cells according to , is the average value of the PLS regression coefficients of all memory cells, and θ is a predefined threshold set according to experience, with a value of 0.06;

[0035] Step 2.2.3: Merge the unimportant LSTM cells with their most relevant cells according to formula (12):

[0036]

[0037] where S mn is the correlation coefficient, c t,m is the memory state of the unimportant LSTM cell m selected at time t, c t,n is the memory state of the unselected LSTM cell n at time t, and are the average values of c t,m and c t,n at all time points, respectively, and σ m , σ n are the standard deviations of c t,m , c t,nThe standard deviation, select the LSTM unit with the highest correlation coefficient as the most relevant unit;

[0038] Step 2.2.4: Combine the unimportant LSTM unit m1 and its most relevant unit m2 to generate a new unit m0. All the input, recurrent, and bias weight matrices of the LSTM unit m0 are randomly assigned within the range of [-1, 1]. The output of m0 is calculated through formulas (4)-(8). The connection weight matrix from the unit output to the final output of PSLSTM is calculated as:

[0039]

[0040] where, are the connection weight matrices from the outputs of the LSTM units m1 and m2 before pruning to the final output of PSLSTM respectively, are the outputs of the LSTM units m1 and m2 before pruning respectively, is the connection weight matrix from the output of the LSTM unit m0 after pruning to the final output of PSLSTM, is the output of the LSTM unit m0 after pruning;

[0041] Step 3: Design the PSLSTM neural network learning algorithm for the effluent BOD;

[0042] Step 3.1: Define the performance index function:

[0043]

[0044] where, and y t are the expected output and the actual output of PSLSTM at time t respectively;

[0045] Step 3.2: Use the time backpropagation algorithm to update the parameters;

[0046] ① At the last parameter update, δh t is calculated through Otherwise, δh t is calculated through the following formula:

[0047] δh t = δz t+1 U z + δi t+1 U i + δo t+1 U o (14)

[0048] where, δh t represents the error term of the output vector h t at time t, δzt+1 , δi t+1 and δo t+1 represent the error terms of the unit input z, t+1 input gate i, t+1 output gate o t+1 at time t + 1, respectively;

[0049] ② Calculate the parameters related to the memory unit and gate structure as follows:

[0050] δc t = δh t ⊙ o t ⊙ g′(c t ) (15)

[0051] δo t = δh t ⊙ g(c t ) ⊙ σ′(o t ) (16)

[0052]

[0053] where δc, t δo, t δi, t and δz t represent the error terms of the memory unit state c, t output gate o, t input gate i, t unit input z t at time t, respectively, and o t , represent the original values of the output gate, input gate, and unit input before being transformed by the corresponding activation functions, g′(c t ) represents the derivative of c t after being transformed by the tanh activation function, σ′(o t ) represents the derivative of o t after being transformed by the sigmoid activation function, represents after being transformed by the sigmoid activation function, represents after being transformed by the sigmoid activation function;

[0054] ③ Update the input weight, recurrent weight, and bias weight matrices at time t as follows:

[0055] W z,t = W z,t+1 - η × δW z,t (19)

[0056] U Ω,t = UΩ,t+1 -η×δW Ω,t (20)

[0057] b Ω,t = b Ω,t+1 -η×δb Ω,t (21)

[0058] Where, W z,t , U Ω,t , b Ω,t represent the input weight matrix, the recurrent weight matrix, and the bias weight matrix at the updated time t, respectively. W z,t+1 , U Ω,t+1 , b Ω,t+1 represent the input weight matrix, the recurrent weight matrix, and the bias weight matrix at time t+1, respectively. η is the learning rate, with a value of 0.01. δW z,t , δU Ω,t , δb Ω,t represent the update values of the input weight matrix, the recurrent weight matrix, and the bias weight matrix at time t, respectively, and are calculated as:

[0059]

[0060] δb Ω,t = δΩ t (24)

[0061] Where, represents the cross product of matrices; Ω represents one of {z, i, o};

[0062] Step 3.3: Input the training sample data, and update the input weights, recurrent weights, and bias weight matrix according to the formulas (14)-(24) in Step 3.2. The weights are updated once for each input of a set of training samples;

[0063] Step 3.4: Calculate the training RMSE. If the RMSE is less than the desired training RMSE (E d ) or the number of iterations reaches the maximum number of iterations (I max ), stop the calculation. Here, I max has a value of 1000, and E d has a value of 0.0200. Otherwise, jump to Step 3.3. The RMSE is defined as shown in formula (25):

[0064]

[0065] Where, T is the number of all time points;

[0066] Step 4: Effluent BOD prediction;

[0067] Taking the test sample data as the input of the trained PSLSTM neural network, obtaining the output of the PSLSTM neural network, and performing inverse normalization on it to obtain the effluent BOD concentration.

[0068] Beneficial effects:

[0069] (1) Aiming at the problems of long period, high cost and inability to predict the effluent BOD concentration at future moments in the prediction of water quality parameter effluent BOD concentration in the current sewage treatment process, the present invention proposes a PSLSTM neural network model to realize the prediction of the effluent BOD concentration at future moments, which has the characteristics of high accuracy and short prediction time.

[0070] (2) Aiming at the problems of large computational amount and complex internal structure of the standard LSTM neural network, the present invention adopts a hybrid strategy combining gate structure simplification and parameter simplification to simplify the internal structure of the LSTM, and uses PLS regression coefficients to evaluate the importance of memory units. By merging unimportant units with their most relevant units, the redundant hidden layer size is trimmed to avoid too large network scale. Description of the drawings

[0071] Figure 1 is the internal structure diagram of the neural network of the present invention;

[0072] Figure 2 is the graph of the change of the root mean square error (RMSE) during the training of the effluent BOD concentration prediction method of the present invention;

[0073] Figure 3 is the graph of the prediction result of the effluent BOD concentration of the present invention;

[0074] Figure 4 is the graph of the prediction error of the effluent BOD concentration of the present invention;

[0075] Figure 5 is the graph of the change of the hidden layer size during the training process of the effluent BOD concentration prediction method of the present invention. Detailed implementation manners

[0076] The present invention obtains an effluent BOD prediction method based on a PSLSTM neural network, realizes the measurement of the BOD concentration at future moments according to the data collected during the sewage treatment process, solves the problem that it is difficult to measure the effluent BOD concentration at future moments during the sewage treatment process, and improves the monitoring level of the water quality at future moments in urban sewage treatment plants;

[0077] The experimental data comes from the water quality analysis data of a sewage treatment plant in 2011, including four water quality variables: (1) effluent total nitrogen concentration; (2) influent phosphate concentration; (3) influent chromaticity; (4) effluent BOD concentration. A total of 362 samples are collected, the first 250 samples are used for training, and the last 112 samples are used for testing;

[0078] A method for predicting the effluent BOD concentration based on a PSLSTM neural network includes the following steps:

[0079] Step 1: Data preprocessing;

[0080] Step 1.1: Calculate the mutual information value between each water quality parameter of the sewage treatment plant and the effluent BOD concentration. The calculation method is shown in Equation (1). Select the variables with a mutual information value greater than 0.84 to obtain the auxiliary variables strongly correlated with the effluent BOD concentration: effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity;

[0081]

[0082] Among them, I(X,Y) represents the mutual information between X and Y, p(x,y) represents the joint probability density distribution function of x and y, and p(x) and p(y) represent the probability density distribution functions of x and y respectively;

[0083] Step 1.2: Select the effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity and effluent BOD concentration at times t-2, t-1, and t as input variables, and the effluent BOD concentration at time t+1 as the output variable; normalize the input variables and output variables to [-1,1] according to Formulas (2)-(3):

[0084]

[0085]

[0086] Among them, X t represents the input variable at time t, x t represents the normalized input variable at time t, O t represents the output variable at time t, x t represents the normalized output variable at time t;

[0087] Step 2: Design a PSLSTM neural network prediction model for effluent BOD;

[0088] Step 2.1: Design the structure of the SLSTM neural network;

[0089] The designed SLSTM neural network consists of 2 control gates and a memory unit. The calculation functions of each structure are as follows:

[0090] ① Input gate: The input gate i t controls the information to be input into the network. The calculation is as follows:

[0091] i t =σ(U i ht-1 +b i ) (4)

[0092] Among them, U i and b i are the recurrent weight matrix and the bias weight matrix of the input gate respectively, h t-1 is the cell output at time t - 1, and σ is the sigmoid activation function (σ(x) = 1 / (1 + e -x ));

[0093] ② Memory cell: The memory cell c t combines the current information with the previous information and is calculated as follows:

[0094] c t = (1 - i t ) ⊙ c t-1 + z t (5)

[0095] Among them, ⊙ represents the dot product operation, c t-1 is the memory cell state at time t - 1, and z t represents that the cell input combines the input variable x t at time t and the cell output h t-1 at time t - 1 to update the input:

[0096] z t = g(W z x t + U z h t-1 + b z ) (6)

[0097] Among them, W z , U z and b z are the input weight matrix, the recurrent weight matrix and the bias weight matrix of the cell input respectively, and g is the hyperbolic tangent activation function (g(x) = tanh(x));

[0098] ③ Output gate: The output gate o t controls how much of the cell output h t is output to the network through the following formula:

[0099] o t = σ(U o h t-1 + b o ) (7)

[0100] h t = o t ⊙ g(c t ) (8)

[0101] Among them, U o and b o are the recursive weight matrix and the bias weight matrix of the output gate respectively, and h t is the output of the LSTM cell at time t, and g(c t ) represents that c t is transformed by the tanh activation function;

[0102] Calculate the final output y t of the SLSTM as follows:

[0103] y t = W y h t (9)

[0104] Among them, W y is the connection matrix between the cell output and the final output of the PSLSTM;

[0105] Step 2.2: Design a pruning algorithm for the SLSTM neural network based on PLS;

[0106] Step 2.2.1: Use the Partial Least Squares (PLS) method to calculate the corresponding regression coefficients of each internal memory unit of the LSTM. The PLS regression equation is as follows:

[0107] y t = a1c t,1 + ··· + a m c t,m + ··· + a M(t) c t,M(t) (10)

[0108] Among them, a m is the PLS regression coefficient, and M(t) is the number of LSTM cells at time t;

[0109] Step 2.2.2: Select unimportant LSTM cells according to , where is the average value of the PLS regression coefficients of all memory units, and θ is a predefined threshold set according to experience, with a value of 0.06;

[0110] Step 2.2.3: Merge the unimportant LSTM cells with their most relevant cells according to formula (12):

[0111]

[0112] Among them, S mn is the correlation coefficient, c t,m is the memory state of the unimportant LSTM cell m selected at time t, and ct,n is the memory state of the LSTM cell n not selected at time t, and are the averages of c t,m and c t,n over all time points, respectively, and σ m and σ n are the standard deviations of c t,m and c t,n respectively. The LSTM cell with the highest correlation coefficient is selected as the most relevant cell;

[0113] Step 2.2.4: Combine the unimportant LSTM cell m1 and its most relevant cell m2 to generate a new cell m0. All input, recurrent, and bias weight matrices of the LSTM cell m0 are randomly assigned within the range [-1, 1]. The output of m0 is calculated through formulas (4)-(8). The connection weight matrix from the cell output to the final output of PSLSTM is calculated as:

[0114]

[0115] where are the connection weight matrices from the outputs of the LSTM cells m1 and m2 before pruning to the final output of PSLSTM, respectively, are the outputs of the LSTM cells m1 and m2 before pruning, respectively, is the connection weight matrix from the output of the LSTM cell m0 after pruning to the final output of PSLSTM, is the output of the LSTM cell m0 after pruning;

[0116] Step 3: Design the PSLSTM neural network learning algorithm for the effluent BOD;

[0117] Step 3.1: Define the performance metric function:

[0118]

[0119] where and y t are the expected output and the actual output of PSLSTM at time t, respectively;

[0120] Step 3.2: Use the backpropagation through time algorithm to update the parameters;

[0121] ① At the last parameter update, δh t is calculated through , otherwise δh t is calculated through the following formula:

[0122] δh t = δzt+1 U z +δi t+1 U i +δo t+1 U o (14)

[0123] where δh t represents the error term of the output vector h t at time t, and δz t+1 , δi t+1 and δo t+1 represent the error terms of the cell input z t+1 , the input gate i t+1 , and the output gate o t+1 at time t + 1 respectively;

[0124] ② Calculate the parameters related to the memory cell and the gate structure as follows:

[0125] δc t = δh t ⊙ o t ⊙ g′(c t ) (15)

[0126] δo t = δh t ⊙ g(c t ) ⊙ σ′(o t ) (16)

[0127]

[0128] where δc t , δo t , δi t and δz t represent the error terms of the memory cell state c t , the output gate o t , the input gate i t , and the cell input z t at time t respectively, and o t , represent the original values of the output gate, the input gate, and the cell input before being transformed by the corresponding activation functions, g′(c t ) represents the derivative of c t after being transformed by the tanh activation function, σ′(o t ) represents the derivative of o t after being transformed by the sigmoid activation function, represents after being transformed by the sigmoid activation function, represents after being transformed by the sigmoid activation function;

[0129] ③ Update the input weight, recurrent weight, and bias weight matrices at time t as follows:

[0130] W z,t = W z,t+1 - η × δW z,t (19)

[0131] U Ω,t = U Ω,t+1 - η × δU Ω,t (20)

[0132] b Ω,t = b Ω,t+1 - η × δb Ω,t (21)

[0133] where, W z,t , U Ω,t , b Ω,t represent the input weight matrix, recurrent weight matrix, and bias weight matrix at time t after update, respectively; W z,t+1 , U Ω,t+1 , b Ω,t+1 represent the input weight matrix, recurrent weight matrix, and bias weight matrix at time t + 1, respectively; η is the learning rate with a value of 0.01; δW z,t , δU Ω,t , δb Ω,t represent the update values of the input weight matrix, recurrent weight matrix, and bias weight matrix at time t, respectively, and are calculated as:

[0134]

[0135]

[0136] δb Ω,t = δΩ t (24)

[0137] where, represents the cross product of matrices; Ω represents one of {z, i, o};

[0138] Step 3.3: Input the training sample data, and update the input weight, recurrent weight, and bias weight matrices according to the formulas (14) - (24) in Step 3.2. The weights are updated once for each input of a set of training samples;

[0139] Step 3.4: Calculate the training RMSE. Stop the calculation if the RMSE is less than the expected training RMSE (E d ) or the number of iterations reaches the maximum number of iterations (I max ). Here, the value of I max is 1000, and E dTake the value as 0.0200, otherwise jump to step 3.3. The RMSE is defined as shown in formula (25):

[0140]

[0141] where T is the number of all time points;

[0142] Step 4: Effluent BOD prediction;

[0143] Use the test sample data as the input of the trained PSLSTM neural network to obtain the output of the PSLSTM neural network, and perform inverse normalization on it to obtain the effluent BOD concentration.

[0144] In this embodiment, the training RMSE of the effluent BOD concentration prediction method is as Figure 2 shown. The X-axis is the number of iterations, and the Y-axis is the value of the training RMSE; the prediction result of the effluent BOD concentration is as Figure 3 shown. The X-axis is the number of test samples, the Y-axis is the effluent BOD concentration value, and the unit is mg / L. The solid line is the actual output value of the effluent BOD concentration, and the dashed line is the expected output value of the effluent BOD concentration; the test error of the effluent BOD concentration is as Figure 4 shown. The X-axis is the number of test samples, and the Y-axis is the prediction error of the effluent BOD concentration, and the unit is mg / L.

[0145] Tables 1 - 9 are the experimental data of the present invention. Among them, Tables 1 - 4 are training samples: effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity, and effluent BOD concentration. Tables 5 - 8 are test samples: effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity, and effluent BOD concentration. Table 9 is the predicted value of the effluent BOD of the present invention.

[0146] Training samples:

[0147] Table 1. Auxiliary variable effluent total nitrogen (mg / L)

[0148]

[0149]

[0150] Table 2. Auxiliary variable influent phosphate concentration (mg / L)

[0151]

[0152]

[0153] Table 3: Auxiliary variable influent chromaticity

[0154] 11.4000 11.5900 8.7800 10.0800 10.2900 10.0800 11.0500 11.2600 9.9000 10.2700 10.8800 12.7200 5.1500 13.8000 10.7500 10.2200 2.9000 10.6800 12.2800 11.6000 12.7000 12.0200 13.7200 9.8200 8.8000 9.4200 10.3800 11.2400 12.0600 11.2800 10.6200 11.3200 9.3200 9.8800 10.0800 11.1200 9.7500 8.2200 9.4700 10.1200 9.8200 11.2800 10.3200 10.0800 11.7400 10.2600 12.6000 11.3500 10.4200 11.2200 10.7800 10.6200 8.7500 9.2200 10.6200 10.2800 11.0700 10.5800 11.1500 10.6800 10.4200 10.0500 9.7000 9.3800 10.2800 9.6200 10.3200 10.8800 10.3000 9.6500 9.7400 10.0600 10.4500 9.3500 10.0700 10.3200 9.6800 10.1500 9.5200 9.3800 10.0700 9.7600 9.2800 9.6400 9.3700 10.1100 9.5000 9.7300 10.2200 9.8700 9.5600 10.1800 10.5800 9.7800 9.2100 9.8600 10.0500 9.7800 10.1400 9.7600 10.0200 9.8400 9.6200 9.5800 9.3700 9.2900 10.1200 9.8400 9.6400 9.5700 9.0600 9.3200 9.5300 10.2600 9.2600 9.0300 9.2400 9.0600 9.1700 9.2000 9.6300 9.2800 9.0200 10.1700 9.4200 9.1500 9.2400 10.1800 9.7200 9.5800 9.5500 9.8700 9.2800 10.1800 9.7200 9.2900 8.6500 8.7500 8.9200 8.6400 8.3700 8.9600 9.2500 7.2300 7.5800 7.9600 7.5400 7.8200 8.2800 7.8000 5.8000 5.0200 5.1300 4.8900 4.7600 4.5200 3.6800 3.9400 4.1600 3.7400 3.4800 4.8200 4.2200 3.7500 4.0300 4.7000 4.1500 3.7400 3.0900 4.8500 3.2300 3.0400 3.5200 3.0400 4.2300 3.1600 4.5400 2.0500 2.8200 3.1700 4.7400 3.7600 2.9500 3.8400 2.7400 5.2800 3.4600 4.0700 3.5800 2.9600 3.1600 2.4200 3.2000 4.8800 3.9200 3.5200 3.0700 3.8800 4.1500 2.4800 3.4000 5.9200 4.2800 4.0700 3.5800 4.4000 4.1300 4.5500 4.0800 3.7700 4.1500 3.8600 3.4300 3.5100 3.0800 3.7200 3.9800 3.0500 2.1500 1.7200 2.6000 3.2500 1.8000 2.3000 1.9200 2.0700 1.5500 2.6800 1.4800 1.7200 2.1800 1.8600 2.3800 1.9500 2.0400 1.9200 2.8200 2.4800 2.1500 2.6500 2.6200 2.3200 2.1500 2.5600 2.7800 2.5100 2.1500 7.7200 2.7000 2.9500

[0155] Table 4. Effluent BOD Concentration (mg / L)

[0156]

[0157]

[0158] Test Samples:

[0159] Table 5. Auxiliary Variable Effluent Total Nitrogen (mg / L)

[0160] 42.4243 42.4686 42.5129 42.5571 42.6014 42.6457 42.6900 41.9843 41.2786 40.5729 39.8671 39.1614 38.4557 37.7500 37.9314 38.1129 38.2943 38.4757 38.6571 38.8386 39.0200 39.3829 39.7457 40.1086 40.4714 40.8343 41.1971 41.5600 41.3657 41.1714 40.9771 40.7829 40.5886 40.3943 40.2000 39.8743 39.5486 39.2229 38.8971 38.5714 38.2457 37.9200 38.0514 38.1829 38.3143 38.4457 38.5771 38.7086 38.8400 38.5557 38.2714 37.9871 37.7029 37.4186 37.1343 36.8500 36.6943 36.5386 36.3829 36.2271 36.0714 35.9157 35.7600 36.4086 37.0571 37.7057 38.3543 39.0029 39.6514 40.3000 39.9043 39.5086 39.1129 38.7171 38.3214 37.9257 37.5300 37.7457 37.9614 38.1771 38.3929 38.6086 38.8243 39.0400 38.9986 38.9571 38.9157 38.8743 38.8329 38.7914 38.7500 38.6314 38.5129 38.3943 38.2757 38.1571 38.0386 37.9200 37.4100 36.9000 36.3900 35.8800 35.3700 34.8600 34.3500 34.1830 34.0160 33.8490 33.6820 33.5150 33.3480 33.3480 33.3480 33.3480

[0161] Table 6. Auxiliary Variable Influent Phosphate Concentration (mg / L)

[0162]

[0163]

[0164] Table 7: Auxiliary Variable Influent Chromaticity

[0165] 2.3600 1.9800 2.1400 2.4600 1.6200 2.0800 2.3800 1.8400 2.4600 2.0900 1.7800 1.8400 2.2600 3.7800 2.9500 1.8500 2.4700 2.0000 1.9000 2.5400 2.7000 2.4800 2.7600 2.2600 1.9400 2.1000 1.8500 2.6800 2.0500 1.8400 2.6000 2.7100 2.2600 2.0900 1.7900 2.0400 2.4500 2.1600 2.8600 3.0800 2.7600 2.8700 2.5800 2.7200 2.9300 2.3000 2.5700 2.9000 3.1200 2.9800 3.0300 2.7800 2.3600 2.7400 3.4200 3.4500 3.4000 3.1000 3.6400 2.7600 3.2300 3.3800 3.0500 4.4000 2.9300 3.1700 3.6200 4.9500 4.7500 5.2600 5.1800 4.8000 5.2800 3.8700 5.7500 5.3000 5.5300 5.7800 4.7500 5.7200 4.3800 6.0300 6.7600 6.1300 5.8400 6.3000 6.1300 5.3700 6.2500 6.8200 6.6200 6.2400 6.3700 6.5400 5.8900 6.5200 7.8000 7.2300 6.9400 7.1200 6.7700 6.1300 6.5800 7.0400 8.8300 12.2000 10.7800 9.8300 8.6900 8.1700 8.7700 7.5800 7.1500 7.9300 7.0600

[0166] Table 8. Effluent BOD Concentration (mg / L)

[0167] 13.1714 13.2429 13.3143 13.3857 13.4571 13.5286 13.6000 13.8000 14.0000 14.2000 14.4000 14.6000 14.8000 15.0000 14.8286 14.6571 14.4857 14.3143 14.1429 13.9714 13.8000 13.9429 14.0857 14.2286 14.3714 14.5143 14.6571 14.8000 14.6714 14.5429 14.4143 14.2857 14.1571 14.0286 13.9000 13.8857 13.8714 13.8571 13.8429 13.8286 13.8143 13.8000 13.6286 13.4571 13.2857 13.1143 12.9429 12.7714 12.6000 12.6429 12.6857 12.7286 12.7714 12.8143 12.8571 12.9000 12.7429 12.5857 12.4286 12.2714 12.1143 11.9571 11.8000 12.0000 12.2000 12.4000 12.6000 12.8000 13.0000 13.2000 13.1429 13.0857 13.0286 12.9714 12.9143 12.8571 12.8000 12.7571 12.7143 12.6714 12.6286 12.5857 12.5429 12.5000 12.5571 12.6143 12.6714 12.7286 12.7857 12.8429 12.9000 12.8571 12.8143 12.7714 12.7286 12.6857 12.6429 12.6000 12.5286 12.4571 12.3857 12.3143 12.2429 12.1714 12.1000 12.1700 12.2400 12.3100 12.3800 12.4500 12.5200 12.5900 12.6600 12.7300 12.8000

[0168] Table 9. Predicted Effluent BOD Value of the Present Invention (mg / L)

[0169]

[0170]

Claims

1. A method for predicting the effluent BOD concentration based on a PSLSTM neural network, characterized in that , including the following steps: Step 1: Data preprocessing; Step 1.1: Calculate the mutual information value between each water quality parameter of the sewage treatment plant and the effluent BOD concentration. The calculation method is shown in Equation (1): Select the variables with a mutual information value greater than 0.84, and the auxiliary variables strongly correlated with the effluent BOD concentration are: effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity; Among them, I(X,Y) represents the mutual information between X and Y, p(x,y) represents the joint probability density distribution function of x and y, and p(x) and p(y) represent the probability density distribution functions of x and y respectively; Step 1.2: Select the effluent total nitrogen concentration, influent phosphate concentration, influent chromaticity and effluent BOD concentration at t-2, t-1, and t moments as input variables, and the effluent BOD concentration at t+1 moment as the output variable; Normalize the input variables and output variables to [-1,1] according to Formulas (2)-(3): Among them, X t represents the input variable at time t, x t represents the normalized input variable at time t, O t represents the output variable at time t, y t represents the normalized output variable at time t; Step 2: Design a PSLSTM neural network prediction model for effluent BOD; Step 2.1: Design the structure of the SLSTM neural network; The designed SLSTM neural network consists of 2 control gates and a memory unit. The calculation functions of each structure are as follows: ① Input gate: Input gate i t Controls the information to be input into the network and is calculated as follows: i t = σ(U i h t-1 + b i )(4) Among them, U i and b i are the recurrent weight matrix and the bias weight matrix of the input gate respectively, and h t-1 is the cell output at time t - 1, σ is the sigmoid activation function (σ(x) = 1 / (1 + e -x )); ②Memory unit: Memory unit c t Combine the current information with the previous information and calculate as follows: c t = (1 - i t ) ⊙ c t-1 + z t (5) where ⊙ represents the dot product operation, and c t-1 is the memory cell state at time t - 1, and z t represents the combined unit input of the input variable x at time t t and the unit output h at time t - 1 t-1 to update the input: z t = g(W z x t + U z h t-1 + b z ) (6) Among them, W z , U z and b z are the input weight matrix, the recurrent weight matrix, and the bias weight matrix of the unit input respectively, and g is the hyperbolic tangent activation function (g(x) = tanh(x)); ③ Output gate: output gate o t Controls how much of the cell output h is passed through the following formula t The output network: o t = σ(U o h t-1 + b o ) (7) h t = o t ⊙g(c t ) (8) Among them, U o and b o are the recurrent weight matrix and the bias weight matrix of the output gate respectively, h t is the output of the LSTM cell at time t, g(c t ) represents that c t is transformed by the tanh activation function; Calculate the final output y of the SLSTM t As follows: y t = W y h t (9) Among them, W y is the connection matrix between the unit output and the final output of the PSLSTM; Step 2.2: Design a pruning algorithm for the SLSTM neural network based on PLS; Step 2.2.1: Use the Partial Least Squares (PLS) method to calculate the corresponding regression coefficients of each internal memory unit of the LSTM. The PLS regression equation is shown as follows: y t = a1c t,1 + ··· + a m c t,m + ··· + a M(t) c t,M(t) (10) where a m is the PLS regression coefficient, and M(t) is the number of LSTM units at time t; Step 2.2.2: According to select unimportant LSTM units, is the average of the PLS regression coefficients of all memory units, and θ is a predefined threshold set according to experience, with a value of 0.06; Step 2.2.3: Merge the unimportant LSTM units with their most relevant units according to Formula (12): Among them, S mn is the correlation coefficient, c t,m is the memory state of the unimportant LSTM cell m selected at time t, c t,n is the memory state of the unselected LSTM cell n at time t, and are the average values of c t,m and c t,n at all time points respectively, σ m , σ n are the standard deviations of c t,m , c t,n respectively, and the LSTM cell with the highest correlation coefficient is selected as the most relevant cell; Step 2.2.4: Merge the unimportant LSTM cell m1 and its most relevant cell m2 to generate a new cell m0. All the input, recurrent, and bias weight matrices of the LSTM cell m0 are randomly assigned within the range of [-1, 1], and the output of m0 is calculated by formulas (4)-(8), and the connection weight matrix from the cell output to the final output of PSLSTM is calculated as: Among them, are respectively the connection weight matrices from the outputs of LSTM units m1 and m2 before pruning to the final output of PSLSTM, are respectively the outputs of LSTM units m1 and m2 before pruning, is the connection weight matrix from the output of LSTM unit m0 after pruning to the final output of PSLSTM, is the output of LSTM unit m0 after pruning; Step 3: Design a learning algorithm for the PSLSTM neural network of effluent BOD; Step 3.1: Define the performance index function: Among them, and y t are the expected output and the actual output of the PSLSTM at time t, respectively; Step 3.2: Use the backpropagation through time algorithm to update the parameters; ① When updating the parameters for the last time, δh t is calculated through , otherwise δh t is calculated by the following formula: δh t = δz t+1 U z + δi t+1 U i + δo t+1 U o (14) Among them, δh t represents the error term of the output vector h t at time t, and δz t+1 , δi t+1 and δo t+1 represent the error terms of the unit input z t+1 , the input gate i t+1 , and the output gate o t+1 at time t + 1 respectively; ② Calculate the parameters related to the memory unit and the gate structure as follows: δc t = δh t ⊙o t ⊙g′(c t ) (15) Among them, δc t , δo t , δi t and δz t respectively represent the error terms of the memory cell state c t , output gate o t , input gate i t , and cell input z t at time t. respectively represent the original values of the output gate, input gate, and cell input before being transformed by the corresponding activation functions. g′(c t ) represents the derivative of c t after being transformed by the tanh activation function. represents after being transformed by the sigmoid activation function and taking the derivative. represents after being transformed by the sigmoid activation function and taking the derivative. represents after being transformed by the sigmoid activation function and taking the derivative; ③ Update the input weight, recurrent weight, and bias weight matrices at time t as follows: W z,t = W z,t+1 - η × δW z,t (19) U Ω,t = U Ω,t+1 - η × δU Ω,t (20) b Ω,t = b Ω,t+1 -η × δb Ω,t (21) Among them, W z,t , U Ω,t , b Ω,t respectively represent the input weight matrix, the recurrent weight matrix, and the bias weight matrix at the updated time t. W z,t+1 , U Ω,t+1 , b Ω,t+1 respectively represent the input weight matrix, the recurrent weight matrix, and the bias weight matrix at time t + 1. η is the learning rate with a value of 0.

01. δW z,t , δU Ω,t , δb Ω,t respectively represent the update values of the input weight matrix, the recurrent weight matrix, and the bias weight matrix at time t, and are calculated as: δb Ω,t = δΩ t (24) Among them, represents the cross product of matrices; Ω represents one of {z, i, o}; Step 3.3: Input the training sample data, and update the input weight, recurrent weight, and bias weight matrices according to Formulas (14)-(24) in Step 3.

2. The weights are updated once for each input of a group of training samples; Step 3.4: Calculate the training RMSE. If the RMSE is less than the expected training RMSE (E d ) or the number of iterations reaches the maximum number of iterations (I max ), stop the calculation, where I max takes the value of 1000 and E d takes the value of 0.0200. Otherwise, jump to Step 3.

3. The RMSE is defined as shown in Equation (25): Among them, T is the number of all time points; Step 4: Effluent BOD prediction; Take the test sample data as the input of the trained PSLSTM neural network, obtain the output of the PSLSTM neural network, and perform anti-normalization on it to obtain the effluent BOD concentration.

Citation Information

Patent Citations

  • Method of Stock Yield Prediction Based on LSTM Mode

    AU2020102461A4

  • Sewage treatment water quality prediction method based on improved long short-term memory LSTM neural network

    CN111027776A