CN115952685A - Sewage treatment process soft measurement modeling method based on integrated deep learning - Google Patents

Sewage treatment process soft measurement modeling method based on integrated deep learning Download PDF

Info

Publication number
CN115952685A
CN115952685A CN202310053332.5A CN202310053332A CN115952685A CN 115952685 A CN115952685 A CN 115952685A CN 202310053332 A CN202310053332 A CN 202310053332A CN 115952685 A CN115952685 A CN 115952685A
Authority
CN
China
Prior art keywords
model
follows
soft measurement
treatment process
sewage treatment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310053332.5A
Other languages
Chinese (zh)
Other versions
CN115952685B (en
Inventor
熊金琳
彭甜
李正波
陶孜菡
张楚
赵环宇
伏咏妍
王宇涵
黄小龙
花磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cao Liang
Original Assignee
Huaiyin Institute of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huaiyin Institute of Technology filed Critical Huaiyin Institute of Technology
Priority to CN202310053332.5A priority Critical patent/CN115952685B/en
Publication of CN115952685A publication Critical patent/CN115952685A/en
Application granted granted Critical
Publication of CN115952685B publication Critical patent/CN115952685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a sewage treatment process soft measurement modeling method based on integrated deep learning. Firstly, acquiring sewage data as an auxiliary variable; selecting several collected variables by using KPCA characteristics and then using the selected variables as the input of a model; establishing a sewage soft measurement integrated model, wherein the integrated model has two layers, the first layer comprises three base learners of BiLSTM, LSSVM and XGboost, a 5-fold cross validation method is adopted for training, and the second layer adopts ELM as an element learner; and finally, carrying out error correction on the initial prediction result by adopting an extreme learning machine. In order to improve the performance of the model, an RSA algorithm is provided to optimize the model parameters; and according to the problems of the RSA algorithm in the aspects of convergence precision, easy falling into local optimization and the like, the Latin hypercube, the nonlinear factor, the golden sine and the somersault strategy are used for improving the RSA algorithm. Compared with the traditional soft measurement method, the method can integrate the advantages of each model, and has stronger generalization capability and higher prediction precision of the whole model.

Description

Sewage treatment process soft measurement modeling method based on integrated deep learning
Technical Field
The invention relates to the field of soft measurement modeling in an industrial sewage treatment process, in particular to a soft measurement modeling method for key water quality parameters in a sewage treatment process based on integrated deep learning.
Background
The wastewater treatment process is very complex, relates to a complex dynamic physical reaction process, a biological reaction process and a chemical reaction process, has strong nonlinearity, uncertainty, time-varying characteristic and wide hysteresis, and is difficult to establish an accurate model. In order to maintain a good environment of a sewage treatment system, ensure the stability, the running speed, the reliability test and the like of the control system, ensure the sewage discharge quality to reach the discharge standard, and carry out real-time inspection and monitoring on a plurality of important technical processes such as water meters, water quality parameters, environmental parameters and the like in the sewage treatment process. However, in practice, some quality variables in industrial processes can be difficult to measure in real time due to the lack of on-line measuring instruments and corresponding measuring sensors, or their need to operate in extremely harsh environments, which are expensive to purchase and maintain. The soft measurement technology can realize real-time monitoring and control of the dominant variable by establishing a mathematical model between the variable (auxiliary variable) which is easy to measure and the variable (dominant variable) which is difficult to directly measure in the process. The method has the advantages of convenient maintenance and low time delay, and is developed rapidly.
The deep learning has a more complex multilayer structure than the traditional model, has more information, better data extraction and stronger nonlinear feature expression capability, and can accurately map the hidden complex mapping relation under the industrial data. By utilizing the advantages of deep learning and combining soft measurement, the data characteristic information can be fully extracted, and the prediction precision of the model is improved. In the deep learning development, various deep learning models are continuously developed so far, and many new deep models are introduced, however, a single soft measurement model has many problems, such as local optimization and insufficient precision. In view of a large number of implicit data characteristics contained in data, various algorithms and network models are integrated, and the advantages of the algorithms and the network models are combined, so that the overall accuracy and the generalization capability of the models are improved, and the method becomes a new research direction in the soft measurement modeling of the complex industrial process.
Disclosure of Invention
The purpose of the invention is as follows: aiming at the problem that the water quality index biochemical oxygen demand in the sewage treatment process is difficult to realize on-line measurement, the method for soft measurement modeling in the sewage treatment process based on the integrated deep learning is provided.
The technical scheme is as follows: the invention discloses a soft measurement modeling method based on integrated deep learning in a sewage treatment process, which comprises the following steps of:
s1, acquiring sewage data and performing data pretreatment;
s2, performing feature selection on the processed data by using KPCA (kernel principal component analysis), and selecting a proper auxiliary variable so as to construct a soft measurement data sample set;
s3, the sewage data set processed in the S2 is used as the original input of a first-layer base learner in a Stacking integrated framework, wherein the first-layer base learner comprises a bidirectional long-short term memory network (BilsTM), a limiting gradient lifting XGboost and a Least Square Support Vector Machine (LSSVM), and the prediction result of the first-layer base learner is obtained by performing 5-fold cross validation on each base learner;
s4, the second layer adopts ELM as a meta-learner, and the result obtained from the first layer of the base learner is used as a training set of the second layer of the meta-learner to finish the training of the second layer of the meta-learner;
s5, optimizing model parameters of the base learner by adopting an improved reptile search algorithm, wherein the improved reptile search algorithm comprises the following steps: adopting Latin hypercube initialization, in an iterative process, adopting a nonlinear method to improve an evolution significance ES value, utilizing a gold sine and tumbling strategy to improve an individual optimization mode, and utilizing an optimized model to carry out soft measurement to obtain a prediction result of the biochemical oxygen demand;
and S6, correcting errors of the initial prediction result by adopting ELM to obtain a final prediction result.
Further, the sewage data in the step S1 includes suspended matter concentration SS, total nitrogen TN, ammonia nitrogen NH3-N, total phosphorus TP, chemical oxygen demand COD, and biochemical oxygen demand BOD at a historical time.
Further, in the step S2, feature extraction is performed on the data by using KPCA, and the specific steps are as follows:
s3.1 setting the sample data of the training set as X = (X) 1 ,x 2 ,...,x m ) X is mapped by a mapping function phi (x) i Mapping to a high-dimensional feature space;
s3.2, calculating a covariance matrix C of the feature space:
Figure BDA0004059251490000021
s3.3, calculating a characteristic equation of the covariance matrix:
λ i ξ i =Cξ i (3)
wherein ,λi Is the eigenvalue, ξ, of the covariance matrix C i Is corresponding to the characteristic value lambda i The feature vector of (2);
s3.4 defines a kernel matrix K:
K=φ(x i )·φ(x i ) T (4)
s3.5, calculating a characteristic equation of the kernel matrix K:
Figure BDA0004059251490000031
wherein ,
Figure BDA0004059251490000032
is the eigenvector of the kernel matrix K, alpha i Is corresponding to the characteristic value->
Figure BDA0004059251490000033
The feature vector of (2);
s3.6 substituting the covariance matrix C and the kernel matrix K into the characteristic equation of the kernel matrix K, then the eigenvector xi of the covariance matrix C i Can use a non-linear function phi (x) i ) Is represented as follows:
Figure BDA0004059251490000034
wherein ,
Figure BDA0004059251490000035
is xi i The corresponding ith coefficient;
s3.7 calculating the eigenvalues of the kernel matrix K
Figure BDA00040592514900000313
The characteristic values are arranged in descending order as->
Figure BDA0004059251490000036
S3.8 calculating the contribution rate eta of the characteristic values in sequence i And the cumulative contribution P is as follows:
Figure BDA0004059251490000037
Figure BDA0004059251490000038
s3.9, selecting the characteristic that the cumulative contribution rate P is more than or equal to 85 percent as a main auxiliary variable input by the sewage soft measurement model.
Further, in step S3, the step of establishing the bidirectional long and short term memory network prediction model is as follows:
s4.1, using the determined auxiliary variable as an input vector x of the network;
s4.2 setting the forward hidden layer state to
Figure BDA0004059251490000039
The reverse hidden layer state is->
Figure BDA00040592514900000310
w is different weight matrix, then the output y of BilSTM is calculated as:
Figure BDA00040592514900000311
Figure BDA00040592514900000312
Figure BDA0004059251490000041
s4.3 mixing of y t As a result of the prediction of the model.
Further, in step S3, the step of establishing the extreme gradient boost prediction model is as follows:
s5.1 setting the training data set as T = { (x) 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ) A loss function of
Figure BDA0004059251490000042
The regularization term is Ω (f) k ) Then the overall objective function can be written as:
Figure BDA0004059251490000043
where L (φ) is a representation in linear space, i is the ith sample, k is the kth tree,
Figure BDA0004059251490000044
is the ith sample x i The predicted value of (2);
s5.2 fit the residual of the previous tree prediction using the prediction of each tree:
Figure BDA0004059251490000045
s5.3, the predicted result of the t-th tree is obtained in the previous step, the predicted result is equal to the predicted result of the previous t-1 trees in value, and the performance of the t-th tree is added, and for the t-th tree, the objective function is as follows:
Figure BDA0004059251490000046
s5.4 Taylor expansion is used to approximate the original target in equation (14), defining
Figure BDA0004059251490000047
Equation (14) can be:
Figure BDA0004059251490000048
s5.5, solving the optimal solution of the objective function as follows:
Figure BDA0004059251490000049
wherein
Figure BDA0004059251490000051
I j ={i|q(x i ) = j } indicates that a certain sample maps to a set of nodes;
s5.6, calculating a Gain value Gain, updating the maximum Gain _ max, updating the separation points, and finally obtaining the optimal separation points;
s5.7 the above process is repeated to recursively build the tree until a termination condition.
Further, in step S3, the step of establishing the least squares support vector machine prediction model is as follows:
s6.1, optimizing a target, and defining a loss function as:
Figure BDA0004059251490000052
with the constraint:
Figure BDA0004059251490000053
where ω is the weight, ξ i Is an error variable, b is a deviation, c > 0 is a penalty coefficient;
s6.2 introduces Lagrange multiplier, and the formula (18) can be converted into:
Figure BDA0004059251490000054
wherein the Lagrange multiplier a i >0(i=1,2,...,N);
S6.3 solving optimal conditions
Figure BDA0004059251490000055
S6.4, obtaining an optimal regression function by combining the formulas as follows:
Figure BDA0004059251490000056
wherein ,K(xi ,y j ) Is a kernel function, x i Is the center of the kernel function, x is the input of the training sample, y i Is the output of the training sample.
Further, the meta-learner prediction model calculation formula in step S4 is as follows:
Figure BDA0004059251490000061
where L is the number of hidden layer units, N is the number of training samples, β is the weight vector between the ith hidden layer and the output layer, w is the weight vector between the input and output, g is the activation function, b is the bias vector, and x is the input vector.
Further, the steps of the modified reptile search algorithm in step S5 are as follows:
s5.1, adopting Latin hypercube sampling initialization to replace random initialization of an RSA algorithm, and setting the upper and lower search boundaries, the population size and the iteration times of IRSA;
s5.2 surrounding phase, the crocodile individual starts to surround the prey, and the mathematical model is as follows:
Figure BDA0004059251490000062
η ij =B j (t)×P ij (24)
Figure BDA0004059251490000063
Figure BDA0004059251490000064
Figure BDA0004059251490000065
Figure BDA0004059251490000066
wherein ,Bj (t) represents the location of the optimal solution; s i,j (t + 1) represents the next update position; t is the current iteration number; t is max Is the maximum number of iterations; eta ij Representing a hunting operator; r ij Is a reduction function to reduce the search space; alpha and beta are sensitive parameters and control the search precision; r is a radical of hydrogen 1 ,r 2 Are all [1,N]A random number within; r is 3 Is [ -1,1]A random integer of (1); ES (t) is evolutionary; p ij Representing a percentage difference between the best solution position and the current solution position; m(s) i ) Represents the average position of the ith solution;
s5.3, the evolutionary meaning parameter of the formula (26) is improved, and the improved evolutionary meaning expression is as follows:
Figure BDA0004059251490000071
s5.4 hunting stage, the crocodile individual starts hunting, and the mathematical model is as follows:
Figure BDA0004059251490000072
s5.5, introducing a golden sine and tumbling strategy into the position updating formula (30), wherein the improved formula is as follows:
Figure BDA0004059251490000073
wherein ,γ1 ,γ 2 Are each [0,2 pi]And [0, π]A random number within; gamma ray 3 ,γ 4 Is [0,1]A random number within; f =2 is the somersault coefficient, defining the position relative to the prey; x is the number of 1 ,x 2 Is the golden sine coefficient, x 1 and x2 The calculation formula of (c) is as follows:
x 1 =a*(1-γ)+b*σ (32)
x 2 =a*γ+b*(1-σ) (33)
wherein a and b are golden section ratio search initial values,
Figure BDA0004059251490000074
the golden ratio.
Further, in the step S5, optimizing parameters of the model using the improved reptile search algorithm includes: the learning rate, the number of hidden layer nodes and the extreme gradient of the bidirectional long-short term memory network BilsTM improve the weight and the learning rate of XGboost, and the optimal penalty coefficient and the kernel function width value of the least square support vector machine LSSVM.
Further, in step S6, the error correction step using the ELM is as follows:
s6.1, subtracting the initial predicted value obtained by the integrated model from the original observed value to construct an error sequence;
s6.2, predicting an error sequence by using an ELM network;
and S6.3, linearly adding the initial prediction sequence and the error prediction sequence to obtain a final prediction result.
Has the advantages that:
the depth-based and integrated learning method provided by the invention gives consideration to the training principle difference of different algorithms, and gives full play to the advantages of each model in the prediction process. The stronger the learning ability of the base learner is, the smaller the degree of mutual association is, and the better the final prediction effect is. Aiming at the problem that the super parameters of the model are difficult to determine, a reptile search algorithm is introduced to optimize the model, and the optimal model parameters are selected. And an algorithm improvement is proposed to improve the optimizing capability of the algorithm, and the improvement is as follows: firstly, aiming at the problem that random initialization of an algorithm can not enable a population to be uniformly distributed in the whole optimizing space, latin hypercube initialization is introduced to ensure that an initial population uniformly covers the whole distribution space; secondly, in the iterative process, because the random decreasing strategy of the evolution significance ES value between-2 and 2 cannot completely explain the actual convergence optimization process, the nonlinear strategy is adopted for improvement, so that the algorithm can more effectively balance the global and local search capability, and the convergence accuracy of the algorithm is improved. And finally, an individual optimizing mode is improved by utilizing a golden sine and tumbling strategy, so that a common individual can exchange information with the optimal individual in each iteration, the position difference information between the common individual and the optimal individual is completely absorbed, and the algorithm searching performance and the searching accuracy are improved. Compared with the traditional single model prediction, the sewage treatment process soft measurement modeling method based on depth and integrated learning has higher precision and generalization capability.
Drawings
FIG. 1 is a schematic diagram of a multi-model training framework of a sewage treatment process soft measurement modeling method based on integrated deep learning provided by the invention;
FIG. 2 is a flow chart of algorithm optimization model parameters in the integrated deep learning-based sewage treatment process soft measurement modeling method provided by the invention;
FIG. 3 is a flow chart of the integrated deep learning-based sewage treatment process soft measurement modeling method provided by the invention.
Detailed Description
Embodiments of the present invention will be further described with reference to the accompanying drawings.
As shown in FIG. 1, the invention provides a sewage treatment process soft measurement modeling method based on integrated deep learning, which comprises the following steps:
s1, acquiring sewage data from an international standard BSM 1 simulation platform and performing data pretreatment.
S1.1, sewage data including ammonia nitrogen NH3-N, suspended matter concentration SS, chemical oxygen demand COD, total nitrogen TN, total phosphorus TP and biochemical oxygen demand BOD at historical time are obtained from an international standard simulation platform.
S1.2, preprocessing the acquired sewage data into normalizing the data, wherein the formula is as follows:
Figure BDA0004059251490000081
in the formula ,S* Representing the data after normalization, S representing the raw data, S max and Smin Respectively representing the maximum and minimum values in the raw data.
And S2, performing feature selection on the processed data by using KPCA (kernel principal component analysis), and selecting the most appropriate auxiliary variable, thereby constructing a soft measurement data sample set.
S2.1 setting the sample data of the training set as X = (X) 1 ,x 2 ,...,x m ) X is mapped by a mapping function phi (x) i Mapping to a high-dimensional feature space.
S2.2, calculating a covariance matrix C of the feature space:
Figure BDA0004059251490000091
s2.3, calculating a characteristic equation of the covariance matrix:
λ i ξ i =Cξ i (3)
in the formula ,λi Is the eigenvalue, ξ, of the covariance matrix C i Is corresponding to the characteristic value lambda i The feature vector of (2).
S2.4 defines a kernel matrix K:
K=φ(x i )·φ(x i ) T (4)
s2.5, calculating a characteristic equation of the kernel matrix K:
Figure BDA0004059251490000092
in the formula ,
Figure BDA0004059251490000093
is the eigenvector of the kernel matrix K, alpha i Is corresponding to a characteristic value>
Figure BDA0004059251490000094
The feature vector of (2).
S2.6, substituting the covariance matrix C and the kernel matrix K into the characteristic equation of the kernel matrix K, so that the characteristic vector xi of the covariance matrix C i Can use a non-linear function phi (x) i ) Watch (A)Shown below:
Figure BDA0004059251490000095
in the formula ,
Figure BDA0004059251490000096
is xi i The corresponding ith coefficient.
S2.7 calculating the eigenvalues of the kernel matrix K
Figure BDA0004059251490000097
The characteristic values are arranged in descending order as->
Figure BDA0004059251490000098
S2.8 calculating contribution rate eta of these characteristic values in turn i And the cumulative contribution P is as follows:
Figure BDA0004059251490000101
Figure BDA0004059251490000102
s2.9, selecting the characteristic that the cumulative contribution rate P is more than or equal to 85% as a main auxiliary variable input by the sewage soft measurement model.
And S3, taking the sewage data set processed in the S2 as the original input of a first-layer base learning device in a Stacking integrated framework, wherein the first-layer base learning device comprises a bidirectional long-short term memory network (BiLSTM), a limiting gradient lifting XGboost and a Least Square Support Vector Machine (LSSVM), and the prediction result of the first-layer base learning device is obtained by performing 5-fold cross validation on each base learning device.
S3.1, establishing a bidirectional long-short term memory network prediction model.
S3.1.1 takes the determined auxiliary variables as the input vector x to the network.
S3.1.2 forward hiddenContaining a layer state of
Figure BDA0004059251490000103
The reverse hidden layer state is->
Figure BDA0004059251490000104
w is different weight matrix, the output y of BilSTM is calculated as follows: />
Figure BDA0004059251490000105
Figure BDA0004059251490000106
Figure BDA0004059251490000107
S3.1.3 coupling y t As a result of the prediction of the model.
S3.2, establishing a limit gradient lifting prediction model.
S3.2.1 the training data set is T = { (x) 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ) A loss function of
Figure BDA0004059251490000108
The regularization term is Ω (f) k ) Then the overall objective function can be written as:
Figure BDA0004059251490000109
where L (φ) is a representation in linear space, i is the ith sample, k is the kth tree,
Figure BDA00040592514900001010
is the ith sample x i The predicted value of (2).
S3.2.2 fitting the residual error of the predicted result of the previous tree by using the predicted result of each tree, so that the overall tree model effect is better and better;
Figure BDA0004059251490000111
s3.2.3 gets the predicted result of the t-th tree from the previous step, which is numerically equal to the predicted result of the previous t-1 trees, plus the performance of the t-th tree. For the t tree, the objective function is:
Figure BDA0004059251490000112
s3.2.4 approximate equation (14) to the original target with Taylor expansion, define
Figure BDA0004059251490000113
Equation (14) can be:
Figure BDA0004059251490000114
s3.2.5 the optimal solution for the objective function is:
Figure BDA0004059251490000115
in the formula
Figure BDA0004059251490000116
I j ={i|q(x i ) = j } indicates that a certain sample maps to a set of nodes. />
S3.2.6 calculates a Gain value Gain, updates the maximum Gain _ max, and updates the division point to finally obtain the optimal division point.
S3.2.7 repeats the above process recursively building the tree until a termination condition.
And S3.3, establishing a least square support vector machine prediction model.
S3.3.1 the optimization objective defines the loss function as:
Figure BDA0004059251490000117
with the constraint:
Figure BDA0004059251490000121
where ω is the weight, ξ i Is the error variable, b is the deviation, and c > 0 is the penalty factor.
S3.3.2 introduces the lagrange multiplier, equation (18) can be converted to:
Figure BDA0004059251490000122
in the formula, lagrange multiplier a i >0(i=1,2,...,N)。
S3.3.3 solving for optimal conditions
Figure BDA0004059251490000123
S3.3.4 the optimal regression function is obtained by combining the above equations as follows:
Figure BDA0004059251490000124
in the formula ,K(xi ,y j ) Is a kernel function, x i Is the center of the kernel function, x is the input of the training sample, y i Is the output of the training sample.
S4, using the result obtained from the first layer of base learner as a training set of a second layer of meta-learner to complete the training of the second layer of meta-learner, wherein the meta-learner prediction model is ELM, and the calculation formula is as follows:
Figure BDA0004059251490000125
where L is the number of hidden layer units, N is the number of training samples, β is the weight vector between the ith hidden layer and the output layer, w is the weight vector between the input and output, g is the activation function, b is the bias vector, and x is the input vector.
And S5, optimizing the model parameters of the base learner by adopting an improved reptile search algorithm, and performing soft measurement by using the optimized model to obtain a prediction result of the biochemical oxygen demand.
S5.1, random initialization of an RSA algorithm is replaced by Latin hypercube sampling initialization, and the upper and lower search boundaries, the population size and the iteration number of the IRSA are set.
The Latin hypercube sampling initialization method comprises the following steps:
s5.1.1 determining the population size A and the dimension D.
S5.1.2 sets the variable a to the interval [ low, up ], where up and low are the upper and lower bounds of the variable a, respectively.
S5.1.3 divides the interval of variable a into N equal sub-intervals.
S5.1.4 randomly selects a point from each subinterval for each dimension.
S5.1.5 combines each of the points selected to form an initial population.
S5.2 surrounding phase, the crocodile individual starts to surround the prey, and the mathematical model is as follows:
Figure BDA0004059251490000131
η ij =B j (t)×P ij (24)
Figure BDA0004059251490000132
Figure BDA0004059251490000133
Figure BDA0004059251490000134
Figure BDA0004059251490000135
in the formula ,Bj (t) represents the location of the optimal solution; s. the i,j (t + 1) represents the next update position; t is the current iteration number; t is max Is the maximum number of iterations; eta ij Representing a hunting operator; r ij Is a reduction function to reduce the search space; alpha and beta are sensitive parameters and control the search precision; r is 1 ,r 2 Are all [1,N]A random number within; r is 3 Is [ -1,1]A random integer of (1); ES (t) is evolutionary; p ij Representing a percentage difference between the best solution position and the current solution position; m(s) i ) The average position of the ith solution is indicated.
S5.3, the evolutionary meaning parameter of the formula (26) is improved, and the improved evolutionary meaning expression is as follows:
Figure BDA0004059251490000141
s5.4 hunting stage, the crocodile individual starts hunting, and the mathematical model is as follows:
Figure BDA0004059251490000142
s5.5, introducing a golden sine and tumbling strategy into the position updating formula (30), wherein the improved formula is as follows:
Figure BDA0004059251490000143
in the formula ,γ1 ,γ 2 are each [0,2 pi]And [0, pi ]]A random number within; gamma ray 3 ,γ 4 Is [0,1]A random number within; f =2 is the somersault coefficient, defining the position relative to the prey; x is the number of 1 ,x 2 Is the golden sine coefficient, x 1 and x2 The calculation formula of (a) is as follows:
x 1 =a*(1-γ)+b*σ (32)
x 2 =a*γ+b*(1-σ) (33)
wherein a and b are golden section ratio search initial values,
Figure BDA0004059251490000144
the golden ratio.
S5.6, optimizing the learning rate and the number of nodes of a hidden layer of the model BilsTM, the weight and the learning rate of XGboost, and the optimal penalty coefficient and the kernel function width value of the LSSVM by using an improved reptile search algorithm.
And S6, carrying out error correction on the initial prediction result by adopting ELM to obtain a final prediction result.
S6.1, subtracting the initial predicted value obtained by the integrated model from the original observed value, and constructing an error sequence.
S6.2 predict error sequences using the ELM network.
And S6.3, linearly adding the initial prediction sequence and the error prediction sequence to obtain a final prediction result.
And S7, jointly constructing a sewage treatment soft measurement platform based on QT, python and MATLAB, wherein the sewage treatment soft measurement platform comprises a user login interface, a sewage data monitoring and online prediction module, and the visual target of a soft measurement system is realized.
The invention also realizes an intelligent BOD soft measurement system which comprises a data acquisition module, a data processing module, a model training module, a parameter optimization module, an error correction module and an online monitoring module.
A data acquisition module: is used for acquiring sewage data including ammonia nitrogen NH3-N, suspended matter concentration SS, chemical oxygen demand COD, total nitrogen TN, total phosphorus TP and biochemical oxygen demand BOD at historical time.
A data processing module: and (3) performing feature extraction on the collected sewage data by using a KPCA (kernel principal component analysis) method, selecting features with high correlation, and screening out auxiliary variables most suitable for model input.
A model training module: an integration model based on a Stacking method is established, and the method performs Stacking integration on the BilSTM, the XGboost and the LSSVM, so that the overfitting is relieved, and the model effect is improved.
A parameter optimization module: and optimizing parameters of the model by using an IRSA algorithm, wherein the parameters comprise the learning rate and hidden layer node number of the BilsTM, the weight and learning rate of the XGboost, and the optimal penalty coefficient and kernel function width value of the LSSVM.
An error correction module: error sequence based correction of the primary prediction results using ELM.
An online monitoring module: the system comprises a user login interface, a sewage data monitoring and online prediction module, and realizes the visual target of a soft measurement system.
The present invention is not limited to the above embodiments, and any simple modification, equivalent change and modification made to the above embodiments according to the technical spirit of the present invention are within the scope of the technical solution of the present invention.

Claims (10)

1. A sewage treatment process soft measurement modeling method based on integrated deep learning is characterized by comprising the following steps:
s1, acquiring sewage data and performing data pretreatment;
s2, performing feature selection on the processed data by using KPCA (kernel principal component analysis), and selecting a proper auxiliary variable so as to construct a soft measurement data sample set;
s3, the sewage data set processed in the S2 is used as the original input of a first-layer base learner in a Stacking integrated framework, wherein the first-layer base learner comprises a bidirectional long-short term memory network (BilsTM), a limiting gradient lifting XGboost and a Least Square Support Vector Machine (LSSVM), and the prediction result of the first-layer base learner is obtained by performing 5-fold cross validation on each base learner;
s4, the second layer adopts ELM as a meta-learner, and the result obtained from the first layer of the base learner is used as a training set of the second layer of the meta-learner to finish training of the second layer of the meta-learner;
s5, optimizing model parameters of the base learner by adopting an improved reptile search algorithm, wherein the improved reptile search algorithm comprises the following steps: adopting Latin hypercube initialization, in an iterative process, adopting a nonlinear method to improve an evolution significance ES value, utilizing a gold sine and tumbling strategy to improve an individual optimization mode, and utilizing an optimized model to carry out soft measurement to obtain a prediction result of the biochemical oxygen demand;
and S6, carrying out error correction on the initial prediction result by adopting ELM to obtain a final prediction result.
2. The integrated deep learning-based sewage treatment process soft measurement modeling method according to claim 1, wherein the sewage data in step S1 comprises suspended matter concentration SS, total nitrogen TN, ammonia nitrogen NH3-N, total phosphorus TP, chemical oxygen demand COD, and biochemical oxygen demand BOD at historical time.
3. The integrated deep learning-based sewage treatment process soft measurement modeling method according to claim 1, wherein in the step S2, KPCA is used for feature extraction of data, and the specific steps are as follows:
s3.1 setting the sample data of the training set as X = (X) 1 ,x 2 ,...,x m ) X is mapped by a mapping function phi (x) i Mapping to a high-dimensional feature space;
s3.2, calculating a covariance matrix C of the feature space:
Figure FDA0004059251480000011
s3.3, calculating a characteristic equation of the covariance matrix:
λ i ξ i =Cξ i (3)
wherein ,λi Is the eigenvalue, ξ, of the covariance matrix C i Is corresponding to the characteristic value lambda i The feature vector of (2);
s3.4 defines the kernel matrix K:
K=φ(x i )·φ(x i ) T (4)
s3.5, calculating a characteristic equation of the kernel matrix K:
Figure FDA0004059251480000021
wherein ,
Figure FDA0004059251480000022
is the eigenvector of the kernel matrix K, alpha i Is corresponding to the characteristic value->
Figure FDA0004059251480000023
The feature vector of (2);
s3.6, substituting the covariance matrix C and the kernel matrix K into the characteristic equation of the kernel matrix K, so that the characteristic vector xi of the covariance matrix C i Can use a non-linear function phi (x) i ) Is represented as follows:
Figure FDA0004059251480000024
/>
wherein ,
Figure FDA0004059251480000025
is xi i The corresponding ith coefficient;
s3.7 calculating the eigenvalues of the kernel matrix K
Figure FDA0004059251480000026
Characteristic values arranged in descending order to->
Figure FDA0004059251480000027
S3.8 calculating contribution rate eta of these characteristic values in sequence i And the cumulative contribution P is as follows:
Figure FDA0004059251480000028
Figure FDA0004059251480000029
s3.9, selecting the characteristic that the cumulative contribution rate P is more than or equal to 85 percent as a main auxiliary variable input by the sewage soft measurement model.
4. The integrated deep learning-based soft measurement modeling method for sewage treatment process according to claim 1, wherein in the step S3, the step of establishing the bidirectional long-short term memory network prediction model is as follows:
s4.1, using the determined auxiliary variable as an input vector x of the network;
s4.2 setting the state of the hidden layer to be
Figure FDA00040592514800000210
The reverse hidden layer state is->
Figure FDA00040592514800000211
w is different weight matrix, then the output y of BilSTM is calculated as:
Figure FDA0004059251480000031
Figure FDA0004059251480000032
Figure FDA0004059251480000033
s4.3 reaction of y t As a mouldThe predicted result of type.
5. The integrated deep learning-based soft measurement modeling method for the sewage treatment process according to claim 1, wherein in the step S3, the step of establishing the extreme gradient boost prediction model is as follows:
s5.1 setting the training data set as T = { (x) 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ) A loss function of
Figure FDA0004059251480000034
The regularization term is Ω (f) k ) Then the overall objective function can be written as:
Figure FDA0004059251480000035
where L (φ) is a representation in linear space, i is the ith sample, k is the kth tree,
Figure FDA0004059251480000036
is the ith sample x i The predicted value of (2);
s5.2 fit the residual of the previous tree prediction using the prediction of each tree:
Figure FDA0004059251480000037
Figure FDA0004059251480000038
Figure FDA0004059251480000039
……
Figure FDA00040592514800000310
s5.3, the predicted result of the t-th tree is obtained in the previous step, the predicted result is equal to the predicted result of the previous t-1 trees in value, and the performance of the t-th tree is added, and for the t-th tree, the objective function is as follows:
Figure FDA00040592514800000311
s5.4 Taylor expansion is used to approximate the original target in equation (14), defining
Figure FDA00040592514800000312
Equation (14) can be:
Figure FDA0004059251480000041
s5.5, solving the optimal solution of the objective function as follows:
Figure FDA0004059251480000042
wherein
Figure FDA0004059251480000043
I j ={i|q(x i ) = j } indicates that a certain sample maps to a set of nodes;
s5.6, calculating a Gain value Gain, updating the maximum Gain _ max, updating the separation points, and finally obtaining the optimal separation points;
s5.7 the above process is repeated to recursively build the tree until a termination condition.
6. The integrated deep learning-based sewage treatment process soft measurement modeling method according to claim 1, wherein in the step S3, the step of establishing a least squares support vector machine prediction model is as follows:
s6.1, optimizing a target, and defining a loss function as:
Figure FDA0004059251480000044
with the constraint:
Figure FDA0004059251480000045
where ω is the weight, ξ i Is an error variable, b is a deviation, c > 0 is a penalty coefficient;
s6.2 introduces Lagrange multiplier, and the formula (18) can be converted into:
Figure FDA0004059251480000046
wherein the Lagrange multiplier a i >0(i=1,2,...,N);
S6.3 solving optimal conditions
Figure FDA0004059251480000051
S6.4, obtaining an optimal regression function by combining the formulas as follows:
Figure FDA0004059251480000052
wherein ,K(xi ,y j ) Is a kernel function, x i Is the center of the kernel function, x is the input of the training sample, y i Is the output of the training sample.
7. The integrated deep learning-based sewage treatment process soft measurement modeling method according to claim 1, wherein the meta-learner prediction model calculation formula in the step S4 is as follows:
Figure FDA0004059251480000053
where L is the number of hidden layer units, N is the number of training samples, β is the weight vector between the ith hidden layer and the output layer, w is the weight vector between the input and output, g is the activation function, b is the bias vector, and x is the input vector.
8. The integrated deep learning-based soft measurement modeling method for sewage treatment process according to claim 1, wherein the modified reptile search algorithm in step S5 comprises the following steps:
s5.1, adopting Latin hypercube sampling initialization to replace random initialization of an RSA algorithm, and setting the upper and lower search boundaries, the population size and the iteration times of IRSA;
s5.2 surrounding phase, the crocodile individual starts to surround the prey, and the mathematical model is as follows:
Figure FDA0004059251480000054
η ij =B j (t)×P ij (24)
Figure FDA0004059251480000055
Figure FDA0004059251480000061
Figure FDA0004059251480000062
Figure FDA0004059251480000063
wherein ,Bj (t) represents the location of the optimal solution; s i,j (t + 1) represents the next update position; t is the current iteration number; t is max Is the maximum number of iterations; eta ij Representing a hunting operator; r ij Is a reduction function to reduce the search space; alpha and beta are sensitive parameters and control the search precision; r is 1 ,r 2 Are all [1,N]A random number within; r is 3 Is [ -1,1]A random integer of (1); ES (t) is evolutionary; p ij Representing a percentage difference between the best solution position and the current solution position; m(s) i ) Represents the average position of the ith solution;
s5.3, the evolutionary meaning parameters of the formula (26) are improved, and the improved evolutionary meaning expression is as follows:
Figure FDA0004059251480000064
s5.4 hunting stage, the crocodile individual starts hunting, and the mathematical model is as follows:
Figure FDA0004059251480000065
s5.5, introducing a gold sine and tendon-turning strategy into the position updating formula (30), wherein the improved formula is as follows:
Figure FDA0004059251480000066
wherein ,γ1 ,γ 2 Are respectively [0,2 pi ]]And [0, pi ]]A random number within; gamma ray 3 ,γ 4 Is [0,1]A random number within; f =2 is the overturning coefficientDefining a position relative to a prey; x is the number of 1 ,x 2 Is the golden sine coefficient, x 1 and x2 The calculation formula of (a) is as follows:
x 1 =a*(1-γ)+b*σ (32)
x 2 =a*γ+b*(1-σ) (33)
wherein a and b are golden section ratio search initial values,
Figure FDA0004059251480000071
the golden ratio.
9. The integrated deep learning-based soft measurement modeling method for sewage treatment process according to claim 8, wherein in the step S5, optimizing the parameters of the model by using the improved reptile search algorithm comprises: the learning rate, the number of hidden layer nodes and the extreme gradient of the bidirectional long-short term memory network BilsTM improve the weight and the learning rate of XGboost, and the optimal penalty coefficient and the kernel function width value of the least square support vector machine LSSVM.
10. The integrated deep learning-based sewage treatment process soft measurement modeling method according to any one of claims 1 to 9, wherein in the step S6, the error correction step using the ELM is as follows:
s6.1, subtracting the initial predicted value obtained by the integrated model from the original observed value to construct an error sequence;
s6.2, predicting an error sequence by using an ELM network;
s6.3, the initial prediction sequence and the error prediction sequence are linearly added to obtain a final prediction result.
CN202310053332.5A 2023-02-02 2023-02-02 Sewage treatment process soft measurement modeling method based on integrated deep learning Active CN115952685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310053332.5A CN115952685B (en) 2023-02-02 2023-02-02 Sewage treatment process soft measurement modeling method based on integrated deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310053332.5A CN115952685B (en) 2023-02-02 2023-02-02 Sewage treatment process soft measurement modeling method based on integrated deep learning

Publications (2)

Publication Number Publication Date
CN115952685A true CN115952685A (en) 2023-04-11
CN115952685B CN115952685B (en) 2023-09-29

Family

ID=87296827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310053332.5A Active CN115952685B (en) 2023-02-02 2023-02-02 Sewage treatment process soft measurement modeling method based on integrated deep learning

Country Status (1)

Country Link
CN (1) CN115952685B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116562331A (en) * 2023-05-19 2023-08-08 石家庄铁道大学 Method for optimizing SVM by improving reptile search algorithm and application thereof

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112132333A (en) * 2020-09-16 2020-12-25 安徽泽众安全科技有限公司 Short-term water quality and water quantity prediction method and system based on deep learning
CN113448245A (en) * 2021-04-14 2021-09-28 华南师范大学 Deep learning-based dissolved oxygen control method and system in sewage treatment process
CN113449464A (en) * 2021-06-11 2021-09-28 淮阴工学院 Wind power prediction method based on improved depth extreme learning machine
CN113837364A (en) * 2021-09-17 2021-12-24 华南师范大学 Sewage treatment soft measurement method and system based on residual error network and attention mechanism
CN114861528A (en) * 2022-04-18 2022-08-05 湖北工业大学 Wireless power transmission system parameter optimization method based on improved wolf algorithm
CN114944203A (en) * 2022-05-11 2022-08-26 华南师范大学 Wastewater treatment monitoring method and system based on automatic optimization algorithm and deep learning
CN115470702A (en) * 2022-09-14 2022-12-13 中山大学 Sewage treatment water quality prediction method and system based on machine learning
CN115561282A (en) * 2022-09-27 2023-01-03 上海化工研究院有限公司 Detection method and system for heavy metal in underground water

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112132333A (en) * 2020-09-16 2020-12-25 安徽泽众安全科技有限公司 Short-term water quality and water quantity prediction method and system based on deep learning
CN113448245A (en) * 2021-04-14 2021-09-28 华南师范大学 Deep learning-based dissolved oxygen control method and system in sewage treatment process
CN113449464A (en) * 2021-06-11 2021-09-28 淮阴工学院 Wind power prediction method based on improved depth extreme learning machine
CN113837364A (en) * 2021-09-17 2021-12-24 华南师范大学 Sewage treatment soft measurement method and system based on residual error network and attention mechanism
CN114861528A (en) * 2022-04-18 2022-08-05 湖北工业大学 Wireless power transmission system parameter optimization method based on improved wolf algorithm
CN114944203A (en) * 2022-05-11 2022-08-26 华南师范大学 Wastewater treatment monitoring method and system based on automatic optimization algorithm and deep learning
CN115470702A (en) * 2022-09-14 2022-12-13 中山大学 Sewage treatment water quality prediction method and system based on machine learning
CN115561282A (en) * 2022-09-27 2023-01-03 上海化工研究院有限公司 Detection method and system for heavy metal in underground water

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
盛晓晨;史旭东;熊伟丽;: "改进粒子群优化的极限学习机软测量建模方法", 计算机应用研究, no. 06, pages 89 - 93 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116562331A (en) * 2023-05-19 2023-08-08 石家庄铁道大学 Method for optimizing SVM by improving reptile search algorithm and application thereof
CN116562331B (en) * 2023-05-19 2023-11-21 石家庄铁道大学 Method for optimizing SVM by improving reptile search algorithm and application thereof

Also Published As

Publication number Publication date
CN115952685B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
US11346831B2 (en) Intelligent detection method for biochemical oxygen demand based on a self-organizing recurrent RBF neural network
CN111461453B (en) Medium-and-long-term runoff ensemble forecasting method based on multi-model combination
CN108710974B (en) Water ammonia nitrogen prediction method and device based on deep belief network
CN110689179A (en) Water bloom prediction method based on space-time sequence mixed model
CN110083125B (en) Machine tool thermal error modeling method based on deep learning
CN107271405A (en) A kind of water quality parameter retrieving concentration method and apparatus of multi-model collaboration
CN113505534B (en) Load prediction method considering demand response
CN112989711B (en) Aureomycin fermentation process soft measurement modeling method based on semi-supervised ensemble learning
CN115952685B (en) Sewage treatment process soft measurement modeling method based on integrated deep learning
CN109214591B (en) Method and system for predicting aboveground biomass of woody plant
Hocalar et al. Comparison of different estimation techniques for biomass concentration in large scale yeast fermentation
CN114429077A (en) Time sequence multi-scale analysis method based on quantum migration
CN115859789A (en) Method for improving inversion accuracy of polar atmosphere temperature profile
CN116484747A (en) Sewage intelligent monitoring method based on self-adaptive optimization algorithm and deep learning
CN115456245A (en) Prediction method for dissolved oxygen in tidal river network area
CN112464567B (en) Intelligent data assimilation method based on variational and assimilative framework
CN112668606B (en) Step type landslide displacement prediction method based on gradient elevator and quadratic programming
CN117078114B (en) Water quality evaluation method and system for water-bearing lakes under influence of diversion engineering
CN117235510A (en) Joint roughness prediction method and training method of joint roughness prediction model
CN110909492A (en) Sewage treatment process soft measurement method based on extreme gradient lifting algorithm
CN115907204A (en) Forest transpiration water consumption prediction method for optimizing BP neural network by sparrow search algorithm
CN114417740A (en) Deep sea breeding situation sensing method
CN113377075A (en) Method and device for optimizing rare earth extraction process in real time and computer readable storage medium
CN116028757B (en) Optimal soft measurement model generation method and system based on multi-source information fusion
CN115018137B (en) Water environment model parameter calibration method based on reinforcement learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240219

Address after: 230000 Room 203, building 2, phase I, e-commerce Park, Jinggang Road, Shushan Economic Development Zone, Hefei City, Anhui Province

Patentee after: Hefei Jiuzhou Longteng scientific and technological achievement transformation Co.,Ltd.

Country or region after: China

Address before: 223005 Jiangsu Huaian economic and Technological Development Zone, 1 East Road.

Patentee before: HUAIYIN INSTITUTE OF TECHNOLOGY

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240403

Address after: No. 6, West Second Lane, Xingkuang Road, Bin County, Xianyang City, Shaanxi Province, 713500

Patentee after: Cao Liang

Country or region after: China

Address before: 230000 Room 203, building 2, phase I, e-commerce Park, Jinggang Road, Shushan Economic Development Zone, Hefei City, Anhui Province

Patentee before: Hefei Jiuzhou Longteng scientific and technological achievement transformation Co.,Ltd.

Country or region before: China