Effluent total phosphorus prediction model construction method based on pigeon flock optimization echo state network
The pigeon flock optimized echo state network model addresses the complexity and low accuracy of traditional sewage treatment prediction methods by enhancing parameter optimization, achieving accurate and real-time total phosphorus monitoring.
Patent Information
- Application Number
- CN202411286128.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-01-03
AI Technical Summary
The traditional methods for predicting total phosphorus concentration in sewage treatment processes are complex and have low accuracy, failing to meet the needs of fine control due to the highly nonlinear and uncertain nature of sewage treatment processes.
A method for constructing an effluent total phosphorus prediction model using a pigeon flock optimized echo state network, involving data preprocessing, determining auxiliary and predictor variables, and optimizing echo state network parameters with an adaptive improved pigeon flock optimization algorithm combined with a taboo search algorithm to enhance prediction accuracy.
The method significantly improves prediction accuracy and enables real-time monitoring of total phosphorus in sewage treatment effluent, breaking free from local optimal solutions and adapting to the complex sewage treatment environment.
Smart Images

Figure CN119252367A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of effluent total phosphorus prediction, and in particular to a method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network. Background Art
[0002] With the acceleration of urbanization and the rapid development of industrialization, the problem of urban water pollution has become increasingly serious, bringing serious impacts to the environment and ecosystem. As an effective measure to cope with this challenge, sewage treatment can effectively remove harmful substances in sewage through physical, chemical and biological methods. With the construction of a large number of sewage treatment facilities, the operation status of the facilities has received more and more attention. The growth of the national economy and the enhancement of public environmental awareness have brought unprecedented development opportunities for sewage treatment automation technology. This trend has prompted all parties to pay more attention to improving facility efficiency and management level to cope with the increasing demand for environmental protection.
[0003] In the process of urban sewage treatment, total phosphorus is a very important monitoring indicator for measuring the phosphorus content in water bodies, and is also a key indicator for evaluating the nutrient load and eutrophication in water bodies. Total phosphorus exists in sewage in three main forms: orthophosphate, polyphosphate and organic phosphorus. Excessive total phosphorus concentration in sewage can easily lead to eutrophication of water bodies and cause the extinction of a large number of aquatic organisms. Therefore, real-time detection of effluent total phosphorus concentration in urban sewage treatment is crucial to improving the urban sewage treatment monitoring mechanism and urban environmental protection.
[0004] The measurement of total phosphorus concentration in the traditional sewage treatment process is mainly to convert various forms of phosphorus in the sewage into orthophosphate by oxidants and then measure the value to obtain its concentration. However, the prediction process of the traditional method is complicated and the prediction accuracy is not high, which is difficult to meet the needs of fine control of the urban sewage treatment process. At the same time, due to the complex chemical reactions and environmental uncertainties, the sewage treatment process is highly nonlinear, strongly coupled, and uncertain, making it difficult to establish an accurate mechanism model. Summary of the invention
[0005] To this end, the present application provides a method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network to solve the problems of complex total phosphorus concentration measurement process and low prediction accuracy in the sewage treatment process in the prior art.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network, comprising:
[0008] Step 1: Obtain sewage treatment data and perform data preprocessing;
[0009] Step 2: Determine the auxiliary variable set and the predictor variable based on the pre-treated sewage treatment data; the predictor variable is the effluent total phosphorus;
[0010] Step 3: Determine the number of input nodes and output nodes of the echo state network according to the auxiliary variable set and the predictor variable;
[0011] Step 4: Determine the optimal parameters of the echo state network reserve pool layer based on the adaptive improved pigeon flock optimization algorithm combined with the taboo search algorithm;
[0012] Step 4 is as follows:
[0013] Step 401: Randomly initialize the position and velocity of each pigeon in the pigeon flock; wherein the initial position of the pigeon is the initial solution;
[0014] Step 402: using the position update formula and speed update formula of the map and compass operator to update the position and speed of each pigeon, after a certain number of updates, all pigeons are retained and the fitness value of each pigeon is calculated;
[0015] Step 403: According to the fitness value of each pigeon, the initial solution is updated in ascending order to obtain a valid solution;
[0016] Step 404: According to the fitness value of each pigeon, select candidate releases with the same number as the length of the taboo list from high to low and add them into the taboo list;
[0017] Step 405: determine whether the maximum number of iterations of the map and compass operators is satisfied; if not, return to step 402; if satisfied, obtain a valid solution stored outside the taboo list;
[0018] Step 406: Use the landmark operator update formula to update the positions of the pigeons corresponding to the valid solutions outside the taboo list until the optimal solution is found;
[0019] Step 407: Determine the optimal parameters of the echo state network reservoir layer according to the optimal solution.
[0020] Preferably, in step 1, data preprocessing includes noise reduction, outlier removal, missing value filling and normalization.
[0021] Preferably, in step 2, the auxiliary variable set is determined according to the pre-treated sewage treatment data as follows:
[0022] Step 201: Initialize a candidate auxiliary variable set;
[0023] Step 202: performing Min-Max normalization processing on the prediction variables and the auxiliary variables in the candidate auxiliary variable set;
[0024] Step 203: using the Pearson correlation coefficient to analyze the correlation between the auxiliary variables and the predictor variables in the candidate auxiliary variable set to obtain a candidate auxiliary variable set;
[0025] Step 204: Calculate the covariance matrix of the auxiliary variables in the auxiliary variable set to be selected, perform eigendecomposition according to the covariance matrix, and obtain eigenvalues and eigenvectors;
[0026] Step 205: Determine the final auxiliary variable set through principal component analysis based on the eigenvalues and eigenvectors.
[0027] Preferably, in step 402, the position update formula of the map and compass operator is:
[0028] P i (t+1)=P i (t)+V i (t+1)
[0029] Among them, P i (t+1) represents the position of the i-th pigeon after the t+1th iteration, P i (t) represents the position of the i-th pigeon after the t-th iteration, V i (t+1) represents the speed of the i-th pigeon after the t+1th iteration.
[0030] Preferably, in step 402, the speed update formula of the map and compass operator is:
[0031] V i (t+1)=V i,s (t)+r1(t)·V i,c (t) = V i (t)·e -R(t)t +r1(t)[P g,b (t)-P i (t)]
[0032] Where V represents speed, i represents the i-th pigeon, t represents the t-th iteration, s represents the influence of solar factors, r1(t) represents the dynamically adjusted random number of the earth's magnetic field, c represents the influence of the earth's magnetic field factors, R(t) represents the dynamically adjusted compass factor, and P g,b (t) represents the global optimal pigeon position.
[0033] Preferably, the calculation formula of the dynamically adjusted earth magnetic field random number r1(t) is:
[0034]
[0035] Among them, r 1max Represents the maximum value of the random number of the Earth's magnetic field, r 1minRepresents the minimum value of the random number of the Earth's magnetic field, N c1max Indicates the maximum number of iterations of the map and compass operators.
[0036] Preferably, the calculation formula of the dynamically adjusted compass factor R(t) is:
[0037]
[0038] Among them, R max Indicates the maximum compass factor, R min Indicates the minimum value of the compass factor, P p,b (t) represents the optimal position of the individual after t iterations, P i (t) represents the position of the i-th pigeon at the t-th iteration, P g,b (t) represents the global optimal position after t iterations.
[0039] Preferably, in step 402, the certain period refers to the taboo period Tenure; in step 405, the valid solutions stored outside the taboo list are pop·Tenure-Length, wherein pop is the population size, Length is the length of the taboo list, and Tenure is the taboo period.
[0040] Preferably, in step 406, the landmark operator update formula is:
[0041]
[0042] P i (t+1)=P i (t)+r2(t)[P c (t+1)-P i (t)]
[0043] Among them, P c (t) represents the optimal solution after t iterations, P i (t) represents the position of the i-th pigeon at the t-th iteration, fitness (P i (t)) represents the fitness value of the ith pigeon after t iterations, ceil(·) represents the scale change equation, N P (t+1) represents the size of the pigeon flock after t+1 iterations, and r2(t) represents the dynamically adjusted landmark random number.
[0044] Preferably, the calculation formula of the dynamically adjusted landmark random number r2(t) is:
[0045]
[0046] Among them, r 2maxIndicates the maximum value of the landmark random number, r 2min Indicates the minimum value of the landmark random number, N c2max Indicates the maximum number of iterations of the landmark operator.
[0047] Compared with the prior art, this application has at least the following beneficial effects:
[0048] The present application provides a method for constructing a prediction model for total phosphorus in effluent based on a pigeon flock optimization echo state network, by obtaining sewage treatment data and performing data preprocessing; determining an auxiliary variable set and a prediction variable based on the preprocessed sewage treatment data; wherein the prediction variable is total phosphorus in effluent; determining the number of input nodes and the number of output nodes of the echo state network based on the auxiliary variable set and the prediction variable; and determining the optimal parameters of the echo state network reserve pool layer based on an adaptively improved pigeon flock optimization algorithm combined with a taboo search algorithm. The present application utilizes the global search capability of the pigeon flock optimization algorithm and the local search capability of the taboo search algorithm, further improves the algorithm's optimization capability by improving the update formula of the original operator in the pigeon flock optimization algorithm, and uses an adaptive adjustment mechanism to optimize the parameters and structure of the echo state network, which not only allows the original pigeon flock optimization algorithm to break free from the constraints of the local optimal solution, but also significantly improves the prediction accuracy of the constructed effluent total phosphorus prediction model. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more intuitively illustrate the prior art and the present application, exemplary drawings are given below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing the present application; for example, those skilled in the art are capable of easily making conventional adjustments or further optimizations to the addition / reduction / attribution division, specific shapes, positional relationships, connection methods, dimensional ratios, etc. of certain units (components) based on the technical concepts and exemplary drawings disclosed in the present application.
[0050] Figure 1 A flow chart of a method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network provided in this application;
[0051] Figure 2 A schematic diagram of the echo state network structure provided for this application;
[0052] Figure 3 Schematic diagram of the adaptive improved pigeon flock optimization algorithm provided in this application;
[0053] Figure 4 A graph showing the predicted results of total phosphorus in effluent from a municipal sewage treatment process provided in an embodiment of the present application;
[0054] Figure 5 A prediction error optimization diagram of total phosphorus in effluent from an urban sewage treatment process provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The present application is further described below in detail through specific embodiments in conjunction with the accompanying drawings.
[0056] In the description of this application: unless otherwise specified, the meaning of "plurality" is two or more. The terms "first", "second", "third", etc. in this application are intended to distinguish the objects referred to, and do not have special meanings in terms of technical connotations (for example, they should not be understood as emphasizing the importance or order, etc.). Expressions such as "including", "comprising", "having", etc. also mean "not limited to" (certain units, components, materials, steps, etc.).
[0057] The terms such as "upper", "lower", "left", "right", "middle", etc. cited in this application are usually used to indicate the general relative position relationship for the purpose of intuitive understanding by referring to the drawings, and are not absolute limitations on the position relationship in the actual product.
[0058] In recent years, artificial neural networks have been widely used as a new type of intelligent data-driven method in the prediction of key variables. By designing a suitable neural network structure and corresponding weight training, the performance of the neural network can be optimized, thereby improving the accuracy of the prediction. This method can achieve efficient prediction of the total phosphorus concentration in the effluent of urban sewage treatment, and provides a feasible solution for the real-time prediction of total phosphorus in the effluent of urban sewage treatment.
[0059] This application proposes a method for constructing an effluent total phosphorus prediction model based on an echo state network with an adaptive improved pigeon flock optimization algorithm. The effluent total phosphorus prediction model constructed using this method can realize real-time prediction of effluent total phosphorus in urban sewage treatment processes.
[0060] See also Figure 1 The present application provides a method for constructing a prediction model for total phosphorus in effluent based on a pigeon flock optimized echo state network, which specifically includes:
[0061] S1: Obtain sewage treatment data and perform data preprocessing;
[0062] Specifically, data preprocessing includes noise reduction, removal of outliers, filling of missing values, and normalization.
[0063] S2: Determine the auxiliary variable set and the predictor variable based on the pre-treated sewage treatment data; the predictor variable is the effluent total phosphorus;
[0064] Specifically, this step determines the auxiliary variable set and the prediction variable according to the pre-treated sewage treatment data, and obtains K auxiliary variables and prediction variables, a total of N groups of data samples with K+1 variables, where the prediction variable is the effluent total phosphorus. After determining the auxiliary variable set and the prediction variable, all N groups of data samples need to be divided into two parts, where N1 group data is used as training samples and the remaining N2 group data is used as test samples, so as to facilitate the training and testing of the model after the effluent total phosphorus prediction model is built.
[0065] More specifically, the auxiliary variable set is determined based on the pre-treated sewage treatment data as follows:
[0066] S201: Initialize a candidate auxiliary variable set;
[0067] This step requires initializing the candidate auxiliary variable set A = {X1, X2, ..., X i ,...,X K} and the predicted variable (total phosphorus in effluent Y), the observation vector corresponding to the auxiliary variable is Among them, i∈[1,K], i is the sequence number of the auxiliary variable, and the observation vector corresponding to the predicted variable is:
[0068] S202: performing Min-Max normalization processing on the prediction variables and the auxiliary variables in the candidate auxiliary variable set;
[0069] In this step, the auxiliary variable X in the candidate auxiliary variable set A is i The Min-Max normalization process is performed on the predicted variable Y to unify the scales of all variables to the same range.
[0070] S203: using the Pearson correlation coefficient to analyze the correlation between the auxiliary variables and the predictor variables in the candidate auxiliary variable set to obtain a candidate auxiliary variable set;
[0071] Specifically, the correlation calculation formula between the auxiliary variables and the predictor variables is:
[0072]
[0073] In formula (1), Represents auxiliary variable X i Correlation coefficient with the predictor variable (total phosphorus in effluent Y); represents the lth observation value of the ith auxiliary variable; y l represents the lth observation value of the predictor variable; represents the mean of the i-th auxiliary variable; represents the mean of the predictor variable.
[0074] This step can determine which auxiliary variables have a greater impact on the predicted variables by calculating the correlation coefficient, thereby preliminarily screening out The auxiliary variables are stored in the auxiliary variable set B to be selected.
[0075] S204: Calculate the covariance matrix of the auxiliary variables in the auxiliary variable set to be selected, perform eigendecomposition according to the covariance matrix, and obtain eigenvalues and eigenvectors;
[0076] If the correlation between the two auxiliary variables is very high (i.e. When the number of auxiliary variables is small, it may cause multicollinearity problems. Therefore, the principal component analysis method is used to extract the main features from the high-dimensional data to reduce the dimension of the data. Therefore, this step needs to calculate the covariance matrix of the auxiliary variables in the auxiliary variable set B to determine the linear relationship between each pair of auxiliary variables.
[0077]
[0078] In formula (2), U and V are two different variables in the auxiliary variable set B to be selected, and u and v are the means of the variables.
[0079] After the covariance matrix is calculated in this step, eigenvalue decomposition is performed to obtain eigenvalues and eigenvectors, where the eigenvalue represents the variance of each principal component and the eigenvector represents the direction of each principal component.
[0080] S205: Determine the final auxiliary variable set through principal component analysis based on the eigenvalues and eigenvectors.
[0081] This step selects the main principal components according to the size of the eigenvalue. Generally, the principal components with eigenvalues greater than 1 are selected. Through principal component analysis, a determined auxiliary variable set C containing Z variables is obtained, where Z is 4-10 and is given by the parties in actual applications. Based on the determined auxiliary variable set C, no more than Z auxiliary variables can be selected to predict the total phosphorus in the effluent.
[0082] S3: Determine the number of input nodes and the number of output nodes of the echo state network according to the auxiliary variable set and the predictor variable;
[0083] Specifically, this step can determine the number of input nodes of the echo state network model according to the number of auxiliary variable sets C determined; because the predicted variable is the total phosphorus concentration of the effluent, the number of output nodes of the echo state network model is set to 1, and then the specific parameters of the reserve pool layer need to be determined.
[0084] S4: Determine the optimal parameters of the echo state network reserve pool layer based on the adaptive improved pigeon flock optimization algorithm combined with the taboo search algorithm;
[0085] See also Figure 2, the echo state network is composed of an input layer of k nodes, a reservoir layer of n nodes, and an output layer of l nodes. At time t, the input state of the input node, the reservoir state of the neurons inside the reservoir, and the output state equations of the output node are shown in formulas (3) to (5), and the update equations of the reservoir state and output state are shown in formulas (6) to (7).
[0086] u(t)=[u1(t),u2(t),...,u k (t)] T (3)
[0087] x(t)=[x1(t),x2(t),...,x n (t)] T (4)
[0088] y(t)=[y1(t),y2(t),...,y l (t)] T (5)
[0089] x(t+1)=f(W in u(t+1)+W res x(t)) (6)
[0090] y(t+1)=W out (x(t+1),u(t+1)) (7)
[0091] The hidden nodes of the reservoir layer are not all connected to each other, but are realized through partial sparse connections. The activation function f of the reservoir node of the model uses the unipolar Sigmoid function. The input weight W of the echo state network in and the internal connection weight W of the reserve pool res It is randomly generated and fixed when the network is initialized, that is, the input weights of the hidden nodes are not adjusted during the network learning and growth process. Therefore, only the output weights of the network W out For training, the pseudo-inverse method is usually used to optimize the output weights of the network. Define the internal state matrix X = [X(1), X(2), ..., X(N s )] T , the corresponding expected output Y target =[y(1),y(2),…,y(N s )] T ,where X(t)=[u(t) T ,x(t) T ] T , N s is the number of training samples. Get the optimal output weight matrix W out The model output needs to be Y actualWith the target output Y target The square error between them reaches the minimum value, that is Therefore, the pseudo-inverse method can be used to obtain the optimal output weight W out =YX + =Y(X T X) -1 X T , where Y is the target output matrix Y target , X + is the pseudo-inverse solution of the internal state matrix X.
[0092] Although the echo state network has been developed on the basis of the traditional recurrent neural network, there is still room for improvement in model parameter selection and network structure optimization. Because the optimal model parameter values and corresponding network structures screened out by different time series data are also different, it is necessary to use an adaptive optimization algorithm to adjust the model parameters (mainly for the four important parameters of the reservoir layer of the echo state network, namely, the reservoir size, sparsity, the spectral radius of the reservoir weight matrix, and the input scaling factor) so that the fitness function value gradually decreases, thereby achieving adaptive adjustment of model parameters and network structure.
[0093] The pigeon flock optimization algorithm uses the map and compass operator and the landmark operator to optimize the pigeon flock. Therefore, the present application can use the pigeon flock optimization algorithm to optimize the parameters of the reserve pool layer of the echo state network. Assuming that each pigeon represents a potential solution of the echo state network reserve pool layer, the position of the pigeon in the optimization problem represents the important parameters of the echo state network, and the important parameters of the echo state network are adjusted by continuously adjusting the position of the pigeon. The algorithm optimization continues until the maximum number of iterations is reached or the accuracy requirements are met. The corresponding solution obtained by selecting the minimum fitness value using fitness evaluation is the optimal solution, thereby finally obtaining the corresponding ideal model parameters and the corresponding network structure.
[0094] The map and compass operator simulates the influence of the earth's magnetic field and the sun, two navigation tools, on the pigeon, and draws a map in the mind for navigation. Therefore, the speed V and position P of the ith pigeon affected by the map and compass operator at the t+1th iteration can be expressed by formulas (8) to (9).
[0095] V i (t+1)=V i,s (t)+rand·V i,c (t) = V i (t)·e -Rt +rand[P g,b (t)-P i (t)] (8)
[0096] P i (t+1)=Pi (t)+V i (t+1) (9)
[0097] The landmark operator imitates the influence of the navigation tool landmark on the pigeons and optimizes the algorithm's exploration ability. Assuming that the central pigeon is familiar with the terrain and can fly directly to the destination, the other pigeons are all led by the central pigeon and move towards the destination. The position of the central pigeon after t iterations can be expressed by formula (10), and the position information of the i-th pigeon affected by the landmark operator at the t+1 iteration can be expressed by formula (11). When individual pigeons are far away from the landmark, the landmark operator will abandon the individuals far away from the landmark, believing that they will not be able to effectively return to the pigeon nest, and the size of the pigeon flock will continue to shrink. The scale change equation can be expressed by formula (12).
[0098]
[0099] P i (t+1)=P i (t)+rand·[P c (t+1)-P i (t)] (11)
[0100]
[0101] However, the pigeon flock optimization algorithm is prone to fall into the local optimal solution and the accuracy of the solution is low. Therefore, based on the original algorithm, an adaptive improved pigeon flock optimization algorithm is proposed to solve the shortcomings of the original pigeon flock optimization algorithm. The compass factor R in the original operator speed update formula is usually a fixed value, but the geomagnetic influence on the pigeon flock is different. By dynamically adjusting the compass factor, the speed of the pigeon flock tending to the global optimal solution can be further improved. The dynamically adjusted compass factor R(t) can be expressed by formula (13). The random value rand in the original operator position update formula has great randomness. By dynamically adjusting the earth's magnetic field random number and the landmark random number, the pigeon flock position is further constrained to improve the quality of the solution. The dynamically adjusted random values r1(t) and r2(t) can be expressed by formulas (14) and (15).
[0102]
[0103] On the basis of improving the pigeon swarm optimization algorithm, it is proposed to combine it with the taboo search algorithm, use the local search ability of the taboo search algorithm, and use fitness evaluation to calculate the fitness value of each pigeon. The fitness value of each pigeon is arranged from large to small through the taboo list, and the solution with lower fitness is screened out to further improve the quality of the solution, thereby making up for the deficiency of the pigeon swarm optimization algorithm that is easy to fall into the local optimum, such as Figure 3As shown. The algorithm is combined with an adaptive optimization method to iteratively adjust the important parameters of the model until the model parameters corresponding to the optimal solution are found, which are the optimal parameters.
[0104] From the above analysis, it can be seen that this step can determine the optimal parameters of the echo state network reserve pool layer based on the adaptive improved pigeon swarm optimization algorithm combined with the taboo search algorithm. Among them, the pigeon swarm optimization algorithm needs to determine the population size pop, dimension DIM, and compass factor maximum value R max and minimum value R min 、The maximum value of the random number of the Earth's magnetic field r 1max and the minimum value r 1min , the maximum value of the landmark random number r 2max and the minimum value r 2min , map and compass operator maximum iteration number N C1max and the maximum number of iterations of the landmark operator N C2max ; The taboo search algorithm needs to determine the length of the taboo list Length and the taboo period Tenure; The echo state network needs to determine the size of the reserve pool N DR , sparsity SD, spectral radius ρ, and the adaptive parameter adjustment range of input shrinkage factor IS; determine the fitness function fitness(X), and use the error function to determine whether the fitness result is optimal for the prediction of total phosphorus concentration in sewage treatment effluent.
[0105] Therefore, S4 is specifically:
[0106] S401: Randomly initialize the position and speed of each pigeon in the pigeon flock; wherein the initial position of the pigeon is the initial solution;
[0107] In this step, the position P and speed V of pop pigeons are randomly initialized. The initial position of pop pigeons is the initial solution P0.
[0108] S402: using the position update formula and speed update formula of the map and compass operator to update the position and speed of each pigeon, after a certain number of updates, all pigeons are retained and the fitness value of each pigeon is calculated;
[0109] This step uses the position update formula (9) and speed update formula (16) of the map and compass operator to update the position P and speed V of each pigeon i, and calculates the fitness value fitness (X i ).
[0110] V i (t+1)=V i,s (t)+r1(t)·V i,c (t) = V i (t)·e -R(t)t +r1(t)[P g,b(t)-P i (t)] (16)
[0111] In formula (16), V represents speed, i represents the i-th pigeon, t represents the t-th iteration, s represents the influence of solar factors, r1(t) represents the dynamically adjusted random number of the earth's magnetic field, c represents the influence of the earth's magnetic field factors, R(t) represents the dynamically adjusted compass factor, and P g,b (t) represents the global optimal pigeon position after t iterations.
[0112] Record the position P of each pigeon i 、The individual optimal position P p,b , the global optimal position P g,b And fitness(X i ), global optimal fitness (X g,b ).
[0113] S403: According to the fitness value of each pigeon, the initial solution is updated in ascending order to obtain a valid solution;
[0114] After the first tenure round iteration, this step is based on the fitness value fitness (X i ), the initial solution P0 is updated in the order of fitness from small to large to obtain the effective solution P.
[0115] S404: According to the fitness value of each pigeon, select candidate releases with the same number as the length of the taboo list from high to low and add them into the taboo list;
[0116] The taboo list is updated once every tenure rounds, and length candidate solutions P are selected from high to low according to the fitness values obtained previously. candidate ∈N(P current ) is put into the taboo list, and the solutions included in the taboo list are set as taboo objects to eliminate the repetitiveness of the randomly generated individuals. If the fitness value of the subsequent solution P' is better than any previous valid solution P, the current solution is updated to the optimal solution P * and the objects in the optimal solution.
[0117] S405: Determine whether the maximum number of iterations of the map and compass operators is satisfied; if not, return to step 402; if satisfied, obtain a valid solution stored outside the taboo list;
[0118] Until the maximum number of iterations N of the map and compass operators is met C1max Finally, we get pop·Tenure-Length valid solutions stored outside the taboo list.
[0119] S406: using the landmark operator update formula to update the positions of the pigeons corresponding to the valid solutions outside the taboo list until the optimal solution is found;
[0120] In this step, the landmark operator is used to update the pigeon position P, and the size of the pigeon group is continuously reduced until the optimal solution X is found. c , thus obtaining the optimal model parameters and its corresponding network structure.
[0121] P i (t+1)=P i (t)+r2(t)[P c (t+1)-P i (t)] (17)
[0122] In formula (17), P i (t) represents the position of the i-th pigeon at the t-th iteration, r2(t) represents the dynamically adjusted landmark random number, P c (t+1) represents the optimal solution after t+1 iterations.
[0123] S407: Determine optimal parameters of the echo state network reservoir layer according to the optimal solution.
[0124] After the application uses the adaptive optimization algorithm to obtain the echo state network with the best model parameters, the training sample data set determined in step S2 is used to drive the network. After the initial state influence is eliminated through the "idle" operation, the output weights of formula (7) are trained using the pseudo-inverse method to obtain the trained echo state network of the adaptive improved pigeon flock optimization algorithm.
[0125] After obtaining the trained echo state network of the adaptive improved pigeon flock optimization algorithm, the trained network is tested using the test sample data determined in step S2.
[0126] When the echo state network with the best parameters obtained by the trained adaptive improved pigeon flock optimization algorithm is used to predict the test data, the observed values of the auxiliary variables in the test sample are used as the input of the trained echo state network, and the output of the model is the predicted result of the total phosphorus concentration in the effluent. After the test is completed, the mean square error (MSE) is used to verify the deviation of the prediction. The smaller the value, the better the prediction effect.
[0127] Example:
[0128] The experimental data were selected from the sewage treatment test data of a sewage treatment plant in Beijing from August 17, 2022 to November 16, 2023. After data preprocessing and determining the variable process, a total of 8 variables remained, as shown in Table 1.
[0129] Table 1
[0130] variable name variable name X1 Temperature T X5 Aerobic terminal DO X2 Anaerobic terminal ORP X6 Aerobic terminal TSS X3 Outlet ORP X7 Outlet pH X4 Aerobic front DO Y Outlet TP
[0131] S1: Obtain sewage treatment data, and perform noise reduction, outlier removal, missing value filling and normalization on the collected data in turn.
[0132] S2: Determine the auxiliary variable set and the predictor variable based on the pre-treated sewage treatment data; the predictor variable is the effluent total phosphorus;
[0133] In this step, the candidate auxiliary variable set initialized contains 21 auxiliary variables, the predicted variable is effluent total phosphorus), and a total of 456 data samples under 22 variables. All 456 data samples need to be divided into two parts, 300 of which are used as training samples and the remaining 156 are used as test samples.
[0134] After screening, this step finally obtains an auxiliary variable set C containing 7 variables. According to the auxiliary variable set C, seven auxiliary variables, including temperature T, anaerobic end ORP, effluent ORP, aerobic front DO, aerobic end DO, aerobic end TSS, and effluent pH, are finally selected to predict the effluent total phosphorus.
[0135] S3: Determine the number of input nodes and the number of output nodes of the echo state network according to the auxiliary variable set and the predictor variable;
[0136] In this step, the number of input nodes and output nodes of the model is determined according to the number of prediction variables and auxiliary variables, and the auxiliary variable set C is determined. Finally, seven auxiliary variables are selected to predict the effluent total phosphorus, so the number of input nodes is set to 7; the prediction variable is the effluent total phosphorus, so the number of output nodes is set to 1; then the specific parameters of the reserve pool layer need to be determined.
[0137] S4: Determine the optimal parameters of the echo state network reserve pool layer based on the adaptive improved pigeon flock optimization algorithm combined with the taboo search algorithm.
[0138] Specifically, this step determines the size N of the echo state network reserve pool. DR , sparsity SD, spectral radius ρ, and adaptive parameter adjustment range of input shrinkage factor IS. The specific parameter selection can be seen in Table 2.
[0139] Table 2
[0140]
[0141] After determining the optimal parameters of the echo state network reserve pool layer, the echo state network is trained to obtain the trained echo state network of the adaptive improved pigeon flock optimization algorithm. The adaptive optimization process of important parameters of the echo state network can be seen in Table 3.
[0142] Table 3
[0143]
[0144] Finally, the echo state network with the best parameters obtained by the trained adaptive optimization algorithm is used to predict the test data. The observed values of the auxiliary variables in the test samples are used as the input of the trained echo state network, and the output is the predicted result of the total phosphorus in the effluent. Figure 4 This is the optimal test result diagram of the original pigeon flock optimization algorithm and the adaptive improved pigeon flock optimization algorithm, where the X-axis represents time in samples / day, the Y-axis represents the total phosphorus in the effluent in mg / L, the TrueValue is the actual data, PIO-ESN is the output of the original pigeon flock optimization algorithm combined with the echo state network for the predicted total phosphorus concentration in the effluent, and TS-APIO-ESN is the output of the adaptive improved pigeon flock optimization algorithm combined with the echo state network for the predicted total phosphorus concentration in the effluent. The mean square error (MSE) is used to reflect the degree of deviation of the prediction. The smaller the value, the better the prediction effect. Figure 5 is the prediction error of the improved pigeon swarm optimization algorithm. The horizontal axis represents the number of model iterations, and the vertical axis represents the model error, i.e., mean square error. As the number of iterations increases, the prediction error of the model gradually decreases, and the prediction accuracy is greatly improved compared to the original algorithm, indicating that the prediction model established by this method can accurately measure the total phosphorus concentration in the effluent of the urban sewage treatment process in real time.
[0145] It should be noted that this embodiment is implemented in full accordance with the method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network provided in this application. Therefore, the details of the method are not repeated, and only the final results are presented.
[0146] The method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimization echo state network provided in the present application combines the global search capability of the pigeon flock optimization algorithm and the local search capability of the taboo search algorithm, further improves the optimization ability of the pigeon flock optimization algorithm by improving the update formula of the original operator, and optimizes the parameters and structure of the echo state network using an adaptive adjustment mechanism. This not only allows the original pigeon flock optimization algorithm to break free from the constraints of the local optimal solution, but also significantly improves the prediction accuracy of the network, thereby realizing real-time and accurate prediction of total phosphorus in the effluent of urban sewage treatment processes.
[0147] In other words, this application combines the echo state network with the adaptive improved pigeon flock optimization algorithm, and proposes to improve the update formula of the original operator to explore the solution space more efficiently in response to the problems existing in the original pigeon flock optimization algorithm. It is proposed that combining it with the taboo search algorithm can avoid being constrained by the local optimal solution, and utilizes the adaptive adjustment mechanism to match the optimal network parameters and structure based on the actual data of the urban sewage treatment process to achieve a significant improvement in the model prediction accuracy.
[0148] A method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network provided by this application can be used to construct an effluent total phosphorus prediction model and perform training. Online prediction of effluent total phosphorus can be achieved based on the trained effluent total phosphorus prediction model. The real-time prediction of effluent total phosphorus not only ensures that the quality of sewage effluent meets environmental protection standards, but also improves the ability to respond to abnormal situations, which is an important link in controlling the water ecosystem. This technology belongs to both the field of control science and engineering and the field of environmental science and engineering. It provides theoretical support and technical guarantees for improving the quality of effluent from urban sewage treatment, and promotes safer and more stable operation of the sewage treatment process.
[0149] The present application also provides a device for constructing an outlet water total phosphorus prediction model based on a pigeon flock optimized echo state network, comprising:
[0150] A data acquisition module is used to acquire sewage treatment data and perform data preprocessing;
[0151] A variable determination module is used to determine an auxiliary variable set and a prediction variable according to the pre-treated sewage treatment data; wherein the prediction variable is the effluent total phosphorus;
[0152] A first network structure determination module, used to determine the number of input nodes and the number of output nodes of the echo state network according to the auxiliary variable set and the prediction variable;
[0153] The second network structure determination module is used to determine the optimal parameters of the echo state network reserve pool layer based on the adaptive improved pigeon flock optimization algorithm combined with the taboo search algorithm;
[0154] The second network structure determination module is specifically used for:
[0155] Randomly initialize the position and velocity of each pigeon in the pigeon flock; the initial position of the pigeon is the initial solution;
[0156] Use the position update formula and speed update formula of the map and compass operator to update the position and speed of each pigeon. After updating for a certain number of times, keep all the pigeons and calculate the fitness value of each pigeon.
[0157] According to the fitness value of each pigeon, the initial solution is updated in ascending order to obtain a valid solution;
[0158] According to the fitness value of each pigeon, select the same number of candidate releases as the length of the taboo list from high to low and add them to the taboo list;
[0159] Determine whether the maximum number of iterations of the map and compass operators is satisfied; if not, return to step 402; if satisfied, obtain a valid solution stored outside the taboo list;
[0160] Use the landmark operator update formula to update the positions of the pigeons corresponding to the valid solutions outside the taboo list until the optimal solution is found;
[0161] Determine the optimal parameters of the echo state network reservoir layer based on the optimal solution.
[0162] The model training module is used to determine a good training sample data set to drive the network. After eliminating the influence of the initial state through the "idle" operation, the output weights are trained using the pseudo-inverse method to obtain the trained echo state network of the adaptive improved pigeon flock optimization algorithm for data prediction.
[0163] For the specific implementation content of each module in the device for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network, please refer to the above definition of the method for constructing an effluent total phosphorus prediction model based on a pigeon flock optimized echo state network, which will not be repeated here.
[0164] The technical features of the above embodiments may be arbitrarily combined (as long as there is no contradiction in the combination of these technical features). To make the description concise, not all possible combinations of the technical features in the above embodiments are described; these embodiments that are not explicitly written should also be considered to be within the scope of this specification.
Claims
1. A method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network, characterized in that: include: Step 1: Obtain sewage treatment data and perform data preprocessing; Step 2: Determine the auxiliary variable set and the predictor variable based on the pre-treated sewage treatment data; the predictor variable is the effluent total phosphorus; Step 3: Determine the number of input nodes and output nodes of the echo state network according to the auxiliary variable set and the predictor variable; Step 4: Determine the optimal parameters of the echo state network reserve pool layer based on the adaptive improved pigeon flock optimization algorithm combined with the taboo search algorithm; Step 4 is as follows: Step 401: Randomly initialize the position and velocity of each pigeon in the pigeon flock; wherein the initial position of the pigeon is the initial solution; Step 402: using the position update formula and speed update formula of the map and compass operator to update the position and speed of each pigeon, after a certain number of updates, all pigeons are retained and the fitness value of each pigeon is calculated; Step 403: According to the fitness value of each pigeon, the initial solution is updated in ascending order to obtain a valid solution; Step 404: According to the fitness value of each pigeon, select candidate releases with the same number as the length of the taboo list from high to low and add them into the taboo list; Step 405: determine whether the maximum number of iterations of the map and compass operators is satisfied; if not, return to step 402; if satisfied, obtain a valid solution stored outside the taboo list; Step 406: Use the landmark operator update formula to update the positions of the pigeons corresponding to the valid solutions outside the taboo list until the optimal solution is found; Step 407: Determine the optimal parameters of the echo state network reservoir layer according to the optimal solution.
2. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 1, characterized in that: In step 1, data preprocessing includes noise reduction, outlier removal, missing value filling and normalization.
3. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 1, characterized in that: In step 2, the auxiliary variable set is determined based on the pre-treated sewage treatment data as follows: Step 201: Initialize a candidate auxiliary variable set; Step 202: performing Min-Max normalization processing on the prediction variables and the auxiliary variables in the candidate auxiliary variable set; Step 203: Analyze the correlation between the auxiliary variables and the prediction variables in the candidate auxiliary variable set using the Pearson correlation coefficient to obtain a candidate auxiliary variable set; Step 204: Calculate the covariance matrix of the auxiliary variables in the auxiliary variable set to be selected, perform eigendecomposition according to the covariance matrix, and obtain eigenvalues and eigenvectors; Step 205: Determine the final auxiliary variable set through principal component analysis based on the eigenvalues and eigenvectors.
4. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 1, characterized in that: In step 402, the position update formula of the map and compass operator is: P i (t+1)=P i (t)+V i (t+1) Among them, P i (t+1) represents the position of the i-th pigeon after the t+1th iteration, P i (t) represents the position of the i-th pigeon after the t-th iteration, V i (t+1) represents the speed of the i-th pigeon after the t+1th iteration.
5. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 1, characterized in that: In step 402, the speed update formula of the map and compass operator is: V i (t+1)=V i,s (t)+r1(t)·V i,c (t)=V i (t)·e -R(t)t +r1(t)[P g,b (t)-P i (t)] Where V represents speed, i represents the i-th pigeon, t represents the t-th iteration, s represents the influence of solar factors, r1(t) represents the dynamically adjusted random number of the earth's magnetic field, c represents the influence of the earth's magnetic field factors, R(t) represents the dynamically adjusted compass factor, and P g,b (t) represents the global optimal pigeon position after t iterations.
6. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 5, characterized in that: The calculation formula of the dynamically adjusted earth magnetic field random number r1(t) is: Among them, r 1max Represents the maximum value of the random number of the Earth's magnetic field, r 1min Represents the minimum value of the random number of the Earth's magnetic field, N c1max Indicates the maximum number of iterations of the map and compass operators.
7. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 5, characterized in that: The calculation formula of the dynamically adjusted compass factor R(t) is: Among them, R max Indicates the maximum compass factor, R min Indicates the minimum value of the compass factor, P p,b (t) represents the optimal position of the individual after t iterations, P i (t) represents the position of the i-th pigeon at the t-th iteration, P g,b (t) represents the global optimal position after t iterations.
8. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 1, characterized in that: In step 402, the certain period represents the taboo period Tenure; in step 405, the valid solutions stored outside the taboo list are pop·Tenure-Length, where pop is the population size, Length is the length of the taboo list, and Tenure is the taboo period.
9. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 1, characterized in that: In step 406, the landmark operator update formula is: P i (t+1)=P i (t)+r2(t)[P c (t+1)-P i (t)] Among them, P c (t) represents the optimal solution after t iterations, P i (t) represents the position of the i-th pigeon at the t-th iteration, fitness (P i (t)) represents the fitness value of the ith pigeon after t iterations, ceil(·) represents the scale change equation, N P (t+1) represents the size of the pigeon flock after t+1 iterations, and r2(t) represents the dynamically adjusted landmark random number.
10. The method for constructing a water outlet total phosphorus prediction model based on a pigeon flock optimized echo state network according to claim 9, characterized in that: The calculation formula of the dynamically adjusted landmark random number r2(t) is: Among them, r 2max Indicates the maximum value of the landmark random number, r 2min Indicates the minimum value of the landmark random number, N c2max Indicates the maximum number of iterations of the landmark operator.
Citation Information
Cited By
Pruning double-Q learning echo state network-based effluent ammonia nitrogen concentration prediction method
CN121051680A
Pruned double q-learning echo state network-based prediction method for effluent ammonia concentration
CN121051680B
Sewage effluent ammonia nitrogen prediction method based on local enhanced optimization echo state network
CN121256244A