A soft-sensing method for chemical oxygen demand in sewage based on data enhancement and deep learning

By adopting a soft measurement method of chemical oxygen demand for wastewater based on data augmentation and deep learning in the sewage treatment system, the data loss and noise problems in traditional monitoring methods are solved, and the precise monitoring of effluent COD and the improvement of system operation efficiency are achieved.

CN118606678BActive Publication Date: 2025-02-14HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410775412.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2025-02-14
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In traditional sewage treatment systems, methods for real-time monitoring and controlling sewage quality rely on expensive equipment and are difficult to achieve accurate monitoring, especially when faced with missing data, noise and abnormal situations.

Method used

Using a soft measurement method of chemical oxygen demand for wastewater based on data augmentation and deep learning, data reconstruction is carried out by collecting data from the sewage treatment process, using the generative adversarial network of attention mechanism, and gradually decomposing the nonlinearity of the data. Soft measurement modeling was performed using FiLM and CatBoost models, and model parameters were optimized through improved PID search optimization algorithms.

Benefits of technology

It realizes accurate soft measurement of the effluent COD of the sewage treatment process, improves the operating efficiency of the sewage treatment system and the accuracy of water quality monitoring, and can deal with scarce samples and uneven distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606678B_ABST
    Figure CN118606678B_ABST
Patent Text Reader

Abstract

The invention discloses a soft measurement method of chemical oxygen demand of sewage based on data enhancement and deep learning, including: collecting chemical oxygen demand and related variable data of effluent from sewage treatment process; reconstructing missing water quality data by using adaptive weighted generative adversarial network based on attention mechanism to achieve effective data enhancement; decomposing effluent COD by successive variational mode decomposition to reduce the nonlinearity and non-stationarity of effluent COD; quantitatively analyzing the complexity and uncertainty of decomposed components by permutation entropy, and dividing the components into high-frequency components and low-frequency components; using FiLM model and CatBoost model to perform soft measurement modeling on high-frequency components and low-frequency components respectively, and summing the prediction results; and synchronously optimizing the parameters of FiLM and CatBoost models by improved PID search optimization algorithm. The invention improves the operation efficiency of sewage treatment system and the accuracy of water quality monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a sewage soft measurement method, and in particular to a sewage chemical oxygen demand soft measurement method based on data enhancement and deep learning. Background Art

[0002] In modern urban sewage treatment systems, real-time monitoring and control of sewage quality are crucial. Key parameters in the sewage treatment process, such as flow, pH, temperature, COD (chemical oxygen demand), MLSS (mixed liquor suspended solids), etc., are crucial to ensuring treatment effects, maintaining equipment operation, and protecting the environment. However, traditional parameter measurement methods often rely on expensive real-time monitoring equipment, which is not only costly but also easily disturbed and damaged by environmental conditions during actual operation. In addition, due to the complexity and uncertainty of the sewage treatment process, traditional monitoring methods often find it difficult to accurately monitor key parameters, thus affecting the operating efficiency and treatment effect of the sewage treatment system.

[0003] Existing sewage soft-sensing methods are usually based on mathematical models and statistical methods, such as multivariate linear regression, principal component analysis, etc. Although these methods can realize soft measurement of sewage treatment processes to a certain extent, there are still some limitations. First, traditional mathematical models often need to rely on a lot of prior knowledge and empirical models, and are often difficult to handle nonlinear, high-dimensional and dynamically changing data. Secondly, traditional statistical methods often have high requirements for data quality, and in actual engineering applications, problems such as missing data, data noise and data anomalies often occur in the sewage treatment process, which will affect the establishment and application of soft-sensing models. Summary of the invention

[0004] Purpose of the invention: In response to the above problems, the present invention proposes a soft measurement method for chemical oxygen demand of sewage based on data enhancement and deep learning, which can realize accurate soft measurement modeling of COD of effluent from sewage treatment process, thereby improving the operation efficiency of sewage treatment system and the accuracy of water quality monitoring.

[0005] Technical solution: The technical solution adopted by the present invention is a soft measurement method for chemical oxygen demand of sewage based on data enhancement and deep learning, including: collecting effluent chemical oxygen demand and sewage parameter data of sewage treatment process; screening sewage parameters through correlation analysis to obtain relevant parameter data of effluent chemical oxygen demand; using an adaptive weighted generative adversarial network based on an attention mechanism to reconstruct missing water quality data and achieve data enhancement; using successive variational mode decomposition to decompose the effluent chemical oxygen demand to obtain components of the effluent chemical oxygen demand; quantitatively analyzing the decomposed components through permutation entropy, and dividing the components into high-frequency components and low-frequency components according to the quantitative analysis results; training a FiLM model through the relevant parameter data and the corresponding high-frequency component data of the effluent chemical oxygen demand to obtain a FiLM A soft measurement model is provided, wherein a CatBoost model is trained by using the relevant parameter data and the corresponding low-frequency component data of the effluent chemical oxygen demand to obtain a CatBoost soft measurement model; a quasi-reverse learning strategy is adopted to update the initialization data of the PID search optimization algorithm, and an adaptive t-distribution mutation perturbation strategy is used to update the population position of the PID search optimization algorithm to obtain an improved PID search optimization algorithm; hyperparameters of the FiLM and CatBoost soft measurement models are optimized respectively by using the improved PID search optimization algorithm; with the measured relevant parameter data as input, the FiLM soft measurement model is adopted to predict the high-frequency component of the effluent chemical oxygen demand, and the CatBoost model is adopted to predict the low-frequency component of the effluent chemical oxygen demand, and the respective output results are summed to obtain the final prediction result of the chemical oxygen demand.

[0006] The sewage parameter data include flow rate, pH value, temperature, dissolved oxygen and mixed liquor suspended solids.

[0007] The adaptive weighted generative adversarial network based on the attention mechanism is used to reconstruct the missing water quality data, including: inputting the collected data and random noise to conduct adversarial training on the generator and the discriminator to obtain generated data similar to the real data; wherein the objective function of the generative adversarial network is:

[0008]

[0009] Among them, V(D,G) represents the loss function between the generator G and the discriminator D, x r To collect data, p data (x) is the probability density distribution of the collected data, z is the random noise, p z (z) is the prior noise distribution, E is the expectation, and G(z) is the fake sample generated by the generator network.

[0010] Derivative V(D,G) to find the optimal discriminator D * (x):

[0011]

[0012] In the formula, p g (x) represents the data distribution generated by the generator G. Substituting the optimal discriminator into the loss function, we can get that the loss of the generator is equivalent to optimizing p data (x), p g JS divergence of (x).

[0013] The loss function of the adaptive weighted generative adversarial network is defined using the domain-adapted relevance alignment algorithm:

[0014]

[0015] Where, L CORAL is the loss function, d is the difference between features, C S Covariance of the source data, C T is the covariance of the target domain features, is the Frobenius norm of the square matrix;

[0016] The covariance matrix of source data and target domain features is:

[0017]

[0018] Where n S Represents the number of samples in the source domain, n T represents the number of samples in the target domain, D S is the data distribution in the source domain, D T is the data distribution of the target domain.

[0019] Based on the loss function defined by the domain adaptation relevance alignment algorithm, the objective function of the adaptive weighted generative adversarial network is:

[0020]

[0021] Where: L is the objective function of the adaptive weighted generative adversarial network, L CLASS is the original task loss function, t represents the number of loss layers of the domain adaptation correlation alignment algorithm in the deep network, and λ represents the weight parameter.

[0022] The data is input into the GANs discriminator model for feature extraction and network mapping to obtain the feature representation vector h. The feature representation vector h is input into the attention network layer and output through the softmax function. The weight vector calculation formula in the attention network layer is:

[0023]

[0024] In the formula, a iis the weight vector, n is the normalized total weight or the number of feature segments, is the exponential function of the weight vector.

[0025] After the attention weight parameters are generated, they are weighted with the original input hidden layer features to obtain enhanced features. The calculation formula for the enhanced features is:

[0026]

[0027] Where v is the enhanced feature.

[0028] The method of decomposing the chemical oxygen demand of the effluent water by using successive variational modal decomposition comprises the following steps:

[0029] Step 3.1: Define the decomposition process of the input signal:

[0030] f(t)=μ L (t)+f r (t)

[0031] Where f(t) is the input signal, μ L (t) is the low-order mode; f r (t) is the residual signal;

[0032] Step 3.2: Minimize the constraints to achieve effective decomposition of the signal:

[0033]

[0034] Among them, J1 is the first constraint function, ω L is the center frequency of the L-order mode, t is time, μ k (t) is the kth intrinsic mode function decomposed from the original signal, is the impulse signal of discrete time, j is the imaginary unit, δ(t) is the impulse signal;

[0035] The residual signal f r (t) and low-order modes μ L The spectrum overlap of (t) should be minimized, and the first filter is set to filter the ... signal. The frequency response function of the first filter is as follows:

[0036]

[0037] In the formula, is the frequency response function of the first filter, α is the smoothing parameter, ω is the frequency of the modal function, ω L is the cutoff frequency of the filter;

[0038] The second constraint function established is:

[0039]

[0040] Where J2 is the second constraint function, β L (t) is the impulse response of the first filter;

[0041] By minimizing the J1 and J2 constraints, it is impossible to effectively distinguish the Lth order mode from the first L-1 order mode, so a filter is set to filter the modal signals of each order and the corresponding residual signals. The position and frequency response are as follows:

[0042]

[0043] In the formula, is the frequency response function of the ith filter, ω i is the frequency of the i-th filter; α i is the smoothing parameter of the i-th filter;

[0044] The third constraint function established is:

[0045]

[0046] Among them, J3 is the second constraint function, β i (t) is the impulse response of the i-th filter;

[0047] To ensure that the signal can be completely reconstructed, the constraints are established as follows:

[0048]

[0049] In the formula, represents the sum of the obtained modes, f u (t) is the untreated part;

[0050] Step 3.3: The problem of extracting modal components is formulated as a constrained minimization problem:

[0051]

[0052] Among them, a1, a2, and a3 are the smoothing parameters of J1, J2, and J3 respectively.

[0053] The quantitative analysis of the decomposed components by permutation entropy comprises the following steps:

[0054] Step 4.1: Reconstruct the one-dimensional sequence {X(i), i=1,2,…,N} into phase space and obtain the matrix:

[0055]

[0056] Among them, the number of reconstructed vectors is k, m is the embedding dimension, and the elements of each row in the matrix are sorted according to size; then:

[0057] x(i+(j1-1)t)≤x(i+(j2-1)t)≤…≤x(i+(j m -1)t)

[0058] Among them, j1, j2, …, j m is the numbering of the original order of all elements in each row;

[0059] Step 4.2: After re-sorting the elements of each row in descending order, we get:

[0060] S(l)=(j1,j2,…,j m )

[0061] Where l = 1, 2, ..., k, k ≤ m!, the number sequence has at most m! different permutations;

[0062] Step 4.3: Assume that the probabilities of the k numbering sequences are P1, P2, …, P k , then the calculation formula of permutation entropy is:

[0063]

[0064] Among them, when When , the permutation entropy reaches the maximum value ln(m!), the permutation entropy values ​​are sorted from small to large, and those lower than the set entropy value are taken as low-frequency components, and those lower than the set entropy value are taken as high-frequency components.

[0065] The objective function of the CatBoost soft-sensing model is:

[0066]

[0067] Among them, h t is the target function, y is the true value, F t-1 (x) is the strong learner obtained in the t-1th iteration, is the weak learner, L(·) is the loss function, h(x) is the prediction result of the weak learner when x is input, E is the expected function, and H is the output set of the weak learner;

[0068] Use the negative gradient of the loss function to fit an approximation of the loss at each iteration:

[0069]

[0070] Get the strong learner F for this round of iteration t (x) is:

[0071] F t (x) = F t-1 (x)+αh 2

[0072] Among them, α is the step size of model update, and the strong learner F t (x) output prediction results;

[0073] The FiLM soft-sensing model comprises a state space model and a frequency enhancement layer;

[0074] Input the high-frequency components of the effluent COD data into the state-space model:

[0075] C t =AC t-1 +Bx t

[0076] Among them, x t ∈R is the input signal, C t ∈R N is the storage unit, N is the number of Legendre polynomials; A and B are prefix matrices;

[0077] The prefix matrices A and B are defined as:

[0078]

[0079] The LPU consists of two stages: projection and reconstruction; the first stage projects the original signal to the memory unit, and the second stage reconstructs the signal from the memory unit;

[0080] The learning weight matrix of the frequency enhancement layer is: W∈R M'×N×N .

[0081] The improved PID search optimization algorithm comprises:

[0082] The quasi-reverse learning strategy is used to replace the random initialization of the original algorithm, so that the initial population evenly covers the entire sample space; the specific process is as follows:

[0083]

[0084] in, is the reverse solution; the calculation formula for the quasi-relative point is as follows:

[0085]

[0086] in, As the relative point, x ij represents the i-th individual in the j-th dimension; u j and l i is the upper and lower bounds of the i-th population in the j-th dimension; x ij ∈[l,u] is a candidate solution in the search space, r is a random number between -1 and 1, and c is the system deviation;

[0087] The adaptive t-distribution mutation disturbance is introduced into the PSA algorithm, and the t* distribution with the degree of freedom parameter n=iter is used to optimize the search direction and distance of the individual, where iter is the number of iterations; the position update formula is shown as follows:

[0088] x(t+1)=x(t)+η·Δu(t)+(1-η)·(cos(1-t / T)+λr5·t * )·e k (t)

[0089] Where r5 is a vector of random numbers from 0 to 1; η is a matrix with n rows and 1 column; e k (t) is the total deviation of t iterations, λ is the adjustment coefficient, and the formula is as follows:

[0090] λ=[ln(T-t+2) / ln(T)] 2

[0091] Where T is the maximum number of iterations.

[0092] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0093] 1. This method uses an adaptive weighted generative adversarial network (CDAGAN) based on an attention mechanism, which can handle situations where samples are scarce and unevenly distributed. It generates new data samples and fills in missing data, thereby improving the reliability and accuracy of subsequent modeling. CDAGAN based on the attention mechanism can achieve spectral adaptive weighted feature selection and extract shared features from the source domain and the target domain. The present invention introduces the CDAGAN model into cross-domain learning problems for data enhancement and prediction; CDAGAN aims to extract relevant information from multiple sources and enhance the identifiable information contained in the original data.

[0094] 2. This method uses successive variational mode decomposition (SVMD) to decompose the effluent COD, which helps to reduce the nonlinearity and non-stationarity of the effluent COD data and decompose the complex COD data into simpler components. The model can capture the characteristics of water quality changes more accurately.

[0095] 3. This method uses the FiLM model and the CatBoost model to perform soft sensor modeling on high-frequency and low-frequency components respectively; the complementary modeling of these two models can better capture the characteristics of effluent COD and improve the generalization ability and applicability of modeling.

[0096] 4. This method uses a quasi-reverse learning strategy and an adaptive t-distribution mutation perturbation strategy to improve the PID search optimization algorithm (PSA), and simultaneously optimizes the learning rate and batch size of the FiLM-CatBoost soft sensor model through an improved PID search optimization algorithm (IPSA). The application of these improved strategies further improves the soft measurement accuracy of effluent COD, which helps to improve the operating efficiency of the sewage treatment system and the accuracy of water quality monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] Figure 1 It is a flow chart of the soft measurement method of sewage chemical oxygen demand based on data enhancement and deep learning described in the present invention;

[0098] Figure 2 This is the FiLM model structure diagram;

[0099] Figure 3 It is the IPSA algorithm flow chart. DETAILED DESCRIPTION

[0100] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0101] The soft measurement method of sewage chemical oxygen demand based on data enhancement and deep learning described in the present invention has a flow chart as follows: Figure 1 As shown in the figure, the method includes: collecting effluent COD and sewage parameter data of the sewage treatment process, and obtaining relevant parameter data through the sewage parameter data; considering that some water quality parameter samples in the sewage treatment process are scarce and unevenly distributed, the adaptive weighted generative adversarial network (CDAGAN) based on the attention mechanism is used to reconstruct the missing water quality data to achieve effective data enhancement; the effluent COD is decomposed by successive variational mode decomposition (SVMD) to reduce the nonlinearity and non-stationarity of the effluent COD; the complexity and uncertainty of the decomposed components are quantitatively analyzed by permutation entropy, and the components are divided into high-frequency components and low-frequency components; the frequency improved Legendre memory (FiLM) model and the CatBoost model are used to soft-measure the high-frequency and low-frequency components respectively, and the prediction results are summed; in order to further improve the soft measurement accuracy of effluent COD, the quasi-reverse learning strategy and the adaptive t-distribution mutation perturbation strategy are used to improve the PID search optimization algorithm (PSA); the hyperparameters of the FiLM and CatBoost models are optimized respectively by the improved PID search optimization algorithm (IPSA).

[0102] Specifically, the following steps are included:

[0103] (1) Collect the effluent COD and its related parameter data of the sewage treatment process, and perform correlation analysis to obtain the related parameter data; use the Pearson correlation analysis method to obtain the related parameter data. You can also choose methods such as Spearman rank correlation coefficient or partial correlation coefficient for correlation analysis.

[0104] (2) Using the adaptive weighted generative adversarial network CDAGAN based on the attention mechanism, the missing water quality data is reconstructed to achieve effective data enhancement;

[0105] (3) The effluent COD is decomposed using successive variational mode decomposition (SVMD) to reduce the nonlinearity and non-stationarity of the effluent COD;

[0106] (4) Quantitatively analyze the complexity and uncertainty of the decomposed components through permutation entropy, and divide the components into high-frequency components and low-frequency components;

[0107] (5) The frequency-modified Legendre memory (FiLM) model and CatBoost model are used to perform soft-sensor modeling on the high-frequency and low-frequency components respectively, and the prediction results are summed;

[0108] (6) The quasi-reverse learning strategy and adaptive t-distribution mutation perturbation strategy are used to improve the PID search optimization algorithm (PSA). The learning rate, batch size and other parameters of the FiLM-CatBoost soft measurement model are simultaneously optimized through the improved PID search optimization algorithm (IPSA).

[0109] The relevant parameter data in step (1) include flow rate, pH value, temperature, dissolved oxygen (DO) and mixed liquor suspended solids (MLSS).

[0110] The process of step (2) is as follows:

[0111] Step 2.1: Input real data x r The generator and discriminator are trained adversarially with random noise z to obtain generated data similar to the real data. The loss function of CDAGAN is to minimize the distance between the generated data and the real data. Its loss function is:

[0112]

[0113] Among them, V(D,G) represents the loss function between the generator G and the discriminator D, p data (x) is the probability density distribution of real data, p z (z) is the prior noise distribution, E is the expectation, and G(z) is the fake sample generated by the generator network.

[0114] Derivative V(D,G) to find the optimal discriminator D *(x):

[0115]

[0116] In the formula, p g (x) represents the data distribution generated by the generator G. Substituting the optimal discriminator into formula (1), we can get that the loss of the generator is equivalent to optimizing p data (x), p g JS divergence of (x).

[0117] Step 2.2: Use domain-adapted relevance alignment (CORAL) instead of JS divergence to define the distance between the generated data and the real data to be minimized. The CORAL loss function is defined as follows:

[0118]

[0119] In the formula, d is the difference between features, C S Covariance of the source data, C T is the covariance of the target domain features, is the Frobenius norm of the square matrix.

[0120] The covariance matrix of the source data and the target data is:

[0121]

[0122] Based on the loss function defined by the domain adaptation relevance alignment algorithm, the objective function of the adaptive weighted generative adversarial network is:

[0123]

[0124] Where: L CLASS is the original task loss function, t represents the number of CORAL loss layers in the deep network, and λ represents the weight parameter.

[0125] Step 2.3: The attention mechanism can adaptively weight the input and select specific frequency bands in the COD sample data for data augmentation.

[0126] After the data is input into the GANs discriminator model for feature extraction and network mapping, the feature representation vector h is obtained. The attention mechanism is obtained through h i Get the weight vector a i , vector a i The improved CDAGAN is finally obtained by calculating through a separately constructed attention network layer and normalizing through a softmax function, as shown in the formula:

[0127]

[0128] Implementing the attention mechanism through a basic neural network

[0129] l i =f ac (W att h i +b att ) (8)

[0130] Where W att and b att denote the weight and bias of the attention layer, respectively, and f ac (·) is the network activation function.

[0131] Step 2.4: After the attention weight parameters are generated, they are weighted with the original input hidden layer features to obtain the enhanced features v. The hidden layer features are enhanced by the attention parameters to achieve weighted selection of features in the deep network, as shown below:

[0132]

[0133] The process of step (3) is as follows:

[0134] Step 3.1: Define the decomposition process of the input signal f(t):

[0135] f(t)=μ L (t)+f r (t) (10)

[0136] Among them, μ L (t) is the ground-order mode; f r (t) is the residual signal, including the obtained mode and the untreated part f μ (t);

[0137] Step 3.2: Minimize Constraint Implementation:

[0138]

[0139] Among them, ω L is the center frequency of the L-order mode;

[0140] Step 3.3: Residual signal f r (t) and modal μ L The spectral overlap of (t) should be minimized; in order to ensure stable operation of this constraint, an appropriate filter is selected. The frequency response is:

[0141]

[0142] The constraints established are:

[0143]

[0144] Step 3.4: By minimizing the J1 and J2 constraints, it is not possible to effectively distinguish the Lth mode from the first L-1 modes;

[0145] The frequency response of the filter is:

[0146]

[0147] The constraints established are:

[0148]

[0149] Among them, β i (t) is the impulse response of the filter;

[0150] Step 3.5: To ensure that the signal can be completely reconstructed, establish the constraints:

[0151]

[0152] The problem of extracting modal components can be formulated as a constrained minimization problem

[0153]

[0154] Among them, a1, a2, and a3 are the smoothing parameters of J1, J2, and J3 respectively.

[0155] The process of step (4) is as follows:

[0156] Step 4.1: Reconstruct the one-dimensional sequence {X(i), i=1,2,…,N} into phase space and obtain the matrix:

[0157]

[0158] The number of reconstructed vectors is k, and m is the embedding dimension. Sort the elements of each row in the matrix by size; then:

[0159] x(i+(j1-1)t)≤x(i+(j2-1)t)≤…≤x(i+(j m -1)t) (19)

[0160] Among them, j1, j2, …, j m is the numbering of the original order of all elements in each row;

[0161] Step 4.2: After re-sorting the elements of each row in descending order, we get:

[0162] S(l)=(j1,j2,…,j m ) (20)

[0163] Where l = 1, 2, ..., k, k ≤ m!, the number sequence has at most m! different permutations;

[0164] Step 4.3: Assume that the probabilities of the k numbering sequences are P1, P2, …, P k , then the calculation formula of permutation entropy is:

[0165]

[0166] Among them, when When the permutation entropy reaches the maximum value ln(m!), in the actual processing process, H is usually P (m) Perform normalization processing: sort the permutation entropy values ​​from small to large, with the first 50% as the low-frequency component and the last 50% as the high-frequency component.

[0167]

[0168] The process of step (5) is as follows:

[0169] Step 5.1: Build the CatBoost model, input the low-frequency multivariate matrix into the model, and the objective function h of each iteration t for:

[0170]

[0171] Among them, F t-1 (x) is the strong learner obtained in the t-1th iteration, L(y,F t-1 (x)) is the loss function, E is the expected function, and H(x) is the weak learner.

[0172] The error of the negative gradient of the loss function decreases the fastest, so the negative gradient of the loss function is used to fit the approximate value of the loss of each round of iteration:

[0173]

[0174] Get the strong learner F for this round of iteration t (x) is:

[0175] F t (x) = F t-1 (x)+αh 2 (25)

[0176] Among them, α is the step size of model update, and the strong learner F t (x) Output the prediction result.

[0177] Step 5.2: Construct the FiLM model; its structure is shown in the figure Figure 2As shown, it includes a state space model (LPU) and a frequency enhancement layer (FEL);

[0178] Step 5.2.1: Input the high-frequency component of the effluent COD data into the state-space model (LPU):

[0179] C t =AC t-1 +Bx t (26)

[0180] Among them, x t ∈R is the input signal, C t ∈R N is the storage unit, and N is the number of Legendre polynomials.

[0181] The LPU contains two non-trainable prefix matrices A and B, defined as follows:

[0182]

[0183] The LPU consists of two stages: projection and reconstruction; the first stage projects the original signal to the memory unit, and the second stage reconstructs the signal from the memory unit;

[0184] Step 5.2.2: The learning weight matrix of the frequency enhancement layer (FEL) is: W∈R M'×N∈N

[0185] Decompose W into three matrices: W1∈R M'×N'×N' , W2∈R N'×N' , W3∈R N'×N To perform low-rank approximation (N< <N);

[0186] Step 5.3: Perform a mixture of multi-scale expert mechanisms; use the input sequence {T, 2T, ... nT} of different time ranges to predict the layer T, and merge each expert prediction with the linear layer;

[0187] Step 5.4: Obtain the high-frequency prediction results of the effluent COD component of the FiLM model and the low-frequency prediction results of the effluent COD component of the CatBoost model, and add the prediction results to obtain the final prediction result.

[0188] like Figure 3 As shown, the process of step (6) is as follows:

[0189] Step 6.1: Set the algorithm parameters, including the maximum number of iterations T and the population size n;

[0190] Step 6.2: Use the quasi-reverse learning strategy to replace the random initialization of the original algorithm, so that the initial population evenly covers the entire sample space; the specific process is as follows:

[0191]

[0192] in, is the reverse solution; quasi-relative point The calculation formula is as follows:

[0193]

[0194] Among them, x ij represents the i-th individual in the j-th dimension; u i and l i is the upper and lower bounds of the i-th population in the j-th dimension; x ij ∈[l,u] is a candidate solution in the search space, r is a random number between -1 and 1;

[0195] Step 6.3: Define the objective function of the algorithm as f i ; The objective function value of the i-th individual is:

[0196] f i =F(x i ) (30)

[0197] Step 6.4: Calculate the system deviation; the best individual x at iteration t * (t) is the individual corresponding to the historical minimum of the population; for several iterations t, the overall deviation e k (t) is:

[0198]

[0199] Among them, e k-1 (t) The overall deviation of the previous iteration, x * (t-1) is the best individual at iteration t-1;

[0200] Step 6.5: When the number of iterations is t, the output value Δu(t) of PID regulation is:

[0201] Δu(t)=K p .r2.[e k (t)-e k-1 (t)]+K i .r3.e k (t)+K d .r4.[e k (t)-2e k-1 (t)+e k-2 (t)](32)

[0202] where r2, r3 and r4 are vectors of random numbers from 0 to 1 in n rows and 1 column; K p =1, K i=0.6 and K d =1.1 are the adjustment coefficients of proportion, integration and differentiation respectively;

[0203] Step 6.6: Introduce adaptive t-distribution mutation disturbance into the PSA algorithm to make it jump out of the local optimum to improve the search ability of the PSA algorithm; use the t* distribution with the degree of freedom parameter n=iter to optimize the search direction and distance of the individual, and the step size will change adaptively with the increase of the number of iterations. Among them, iter represents the number of iterations. The intention of this setting is that as the number of iterations increases, the degree of freedom parameter n also gradually increases. The larger the degree of freedom parameter n of the t distribution, the closer the distribution is to the standard normal distribution. Its position update formula is shown as follows:

[0204] x(t+1)=x(t)+η·Δu(t)+(1-η)·(cos(1-t / T)+λr5·t * )·e k (t) (33)

[0205] Where r5 is a vector of random numbers from 0 to 1 in n rows and d columns; where η is a matrix with n rows and 1 column; and λ is the adjustment coefficient, and the formula is as follows:

[0206] λ=[ln(T-t+2) / ln(T)] 2 (34)

[0207] Step 6.7: Synchronously optimize the learning rate and batch size parameters of the soft sensor model through the improved PID search optimization algorithm (IPSA) mentioned above.

Claims

1. A soft measurement method for chemical oxygen demand of sewage based on data enhancement and deep learning, characterized in that: include: Collect the chemical oxygen demand and sewage parameter data of the effluent during the sewage treatment process; screen the sewage parameters through correlation analysis to obtain the relevant parameter data of the chemical oxygen demand of the effluent; The adaptive weighted generative adversarial network based on the attention mechanism is used to reconstruct the missing water quality data and achieve data enhancement. The chemical oxygen demand of the effluent is decomposed using successive variational mode decomposition to obtain the components of the chemical oxygen demand of the effluent. The decomposed components are quantitatively analyzed by permutation entropy, and the components are divided into high-frequency components and low-frequency components according to the quantitative analysis results; The FiLM model is trained by the relevant parameter data and the high-frequency component data of the corresponding effluent chemical oxygen demand to obtain the FiLM soft sensing model, and the CatBoost model is trained by the relevant parameter data and the low-frequency component data of the corresponding effluent chemical oxygen demand to obtain the CatBoost soft sensing model; Taking the measured relevant parameter data as input, the FiLM soft sensor model is used to predict the high-frequency component of the effluent chemical oxygen demand, and the CatBoost model is used to predict the low-frequency component of the effluent chemical oxygen demand. The respective output results are summed to obtain the final prediction result of the chemical oxygen demand. The sewage parameter data include flow rate, pH value, temperature, dissolved oxygen and mixed liquor suspended solids; a quasi-reverse learning strategy is adopted to update the initialization data of the PID search optimization algorithm, and an adaptive t-distribution mutation perturbation strategy is used to update the population position of the PID search optimization algorithm to obtain an improved PID search optimization algorithm; the hyperparameters of the FiLM and CatBoost soft measurement models are optimized respectively by the improved PID search optimization algorithm.

2. The soft-sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1 is characterized in that: The adaptive weighted generative adversarial network based on the attention mechanism is used to reconstruct the missing water quality data, including: inputting the collected data and random noise to conduct adversarial training on the generator and the discriminator to obtain generated data similar to the real data; wherein the objective function of the generative adversarial network is: Among them, V(D,G) represents the loss function between the generator G and the discriminator D, x r To collect data, p data (x) is the probability density distribution of the collected data, z is the random noise, p z (z) is the prior noise distribution, E is the expectation, and G(z) is the fake sample generated by the generator network; Derivative V(D,G) to find the optimal discriminator D * (x): In the formula, p g (x) represents the data distribution generated by the generator G. Substituting the optimal discriminator into the loss function, we can get that the loss of the generator is equivalent to optimizing p data (x), p g JS divergence of (x).

3. The soft sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1 is characterized in that: The loss function of the adaptive weighted generative adversarial network is defined using the domain-adapted relevance alignment algorithm: Where, L CORAL is the loss function, d is the difference between features, C S Covariance of the source data, C T is the covariance of the target domain features, is the Frobenius norm of the square matrix; The covariance matrix of source data and target domain features is: Where n S Represents the number of samples in the source domain, n T represents the number of samples in the target domain, D S is the data distribution in the source domain, D T is the data distribution of the target domain.

4. The soft-sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 3 is characterized in that: Based on the loss function defined by the domain adaptation relevance alignment algorithm, the objective function of the adaptive weighted generative adversarial network is: Where: L is the objective function of the adaptive weighted generative adversarial network, L CLASS is the original task loss function, t represents the number of loss layers of the domain adaptation correlation alignment algorithm in the deep network, and λ represents the weight parameter.

5. The soft-sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1 is characterized in that: The data is input into the GANs discriminator model for feature extraction and network mapping to obtain the feature representation vector h. The feature representation vector h is input into the attention network layer and output through the softmax function. The weight vector calculation formula in the attention network layer is: In the formula, a i is the weight vector, n is the normalized total weight or the number of feature segments, is the exponential function of the weight vector; After the attention weight parameters are generated, they are weighted with the original input hidden layer features to obtain enhanced features. The calculation formula for the enhanced features is: Where v is the enhanced feature.

6. The soft sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1 is characterized in that: The method of decomposing the chemical oxygen demand of the effluent water by using successive variational modal decomposition comprises the following steps: Step 3.1: Define the decomposition process of the input signal: f(t)=μ L (t)+f r (t) Where f(t) is the input signal, μ L (t) is the low-order mode; f r (t) is the residual signal; Step 3.2: Minimize the constraints to achieve effective decomposition of the signal: Among them, J1 is the first constraint function, ω L is the center frequency of the L-order mode, t is time, μ k (t) is the kth intrinsic mode function decomposed from the original signal, is a complex exponential signal, j is an imaginary unit, and δ(t) is an impulse signal; The second constraint function established is: Where J2 is the second constraint function, β L (t) is the impulse response of the first filter; In order to distinguish the Lth order mode from the first L-1 order modes, multiple filters are set to filter the modal signals and residual signals of each order. The frequency response function of the filter is as follows: In the formula, is the frequency response function of the ith filter, ω i is the cutoff frequency of the i-th filter, α i is the smoothing parameter of the i-th filter; The third constraint function established is: Among them, J3 is the second constraint function, β i (t) is the impulse response of the i-th filter; To ensure that the signal can be completely reconstructed, the constraints are established as follows: In the formula, represents the sum of the obtained modes, f u (t) is the untreated part; Step 3.3: The problem of extracting modal components is formulated as a constrained minimization problem: Among them, a1, a2, and a3 are the smoothing parameters of J1, J2, and J3 respectively.

7. The soft-sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1 is characterized in that: The quantitative analysis of the decomposed components by permutation entropy comprises the following steps: Step 4.1: Reconstruct the one-dimensional sequence {X(i), i=1,2,…,N} into phase space and obtain the matrix: Among them, the number of reconstructed vectors is k, m is the embedding dimension, and the elements of each row in the matrix are sorted according to size; then: x(i+(j1-1)t)≤x(i+(j2-1)t)≤…≤x(i+(j m -1)t) Among them, j1, j2, …, j m is the numbering of the original order of all elements in each row; Step 4.2: After re-sorting the elements of each row in descending order, we get: S(l)=(j1,j2,…,j m ) Where l = 1, 2, ..., k, k ≤ m!, the number sequence has at most m! different permutations; Step 4.3: Assume that the probabilities of the k numbering sequences are P1, P2, …, P k , then the calculation formula of permutation entropy is: Among them, when When , the permutation entropy reaches the maximum value ln(m!), the permutation entropy values ​​are sorted from small to large, and those lower than the set entropy value are taken as low-frequency components, and those lower than the set entropy value are taken as high-frequency components.

8. The soft-sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1 is characterized in that: The objective function of the CatBoost soft-sensing model is: Among them, h t is the target function, y is the true value, F t-1 (x) is the strong learner obtained in the t-1th iteration, L(·) is the loss function, h(x) is the prediction result of the weak learner when x is input, E is the expected function, and H is the output set of the weak learner; Use the negative gradient of the loss function to fit an approximation of the loss at each iteration: Get the strong learner F for this round of iteration t (x) is: F t (x)=F t-1 (x)+αh 2 Among them, α is the step size of model update, and the strong learner F t (x) output prediction results; The FiLM soft-sensing model comprises a state space model and a frequency enhancement layer; Input the high-frequency components of the effluent COD data into the state-space model: C t =AC t-1 +Bx t Among them, x t ∈R is the input signal, C t ∈R N is the storage unit, N is the number of Legendre polynomials; A and B are prefix matrices; The prefix matrices A and B are defined as: The LPU consists of two stages: projection and reconstruction; the first stage projects the original signal to the memory unit, and the second stage reconstructs the signal from the memory unit; The learning weight matrix of the frequency enhancement layer is: W∈R M′×N×N .

9. The soft-sensing method for chemical oxygen demand of sewage based on data enhancement and deep learning according to claim 1, characterized in that: Improved PID search optimization algorithm, including: The quasi-reverse learning strategy is used to replace the random initialization of the original algorithm, so that the initial population evenly covers the entire sample space. The initialization calculation formula is: in, is the reverse solution; the calculation formula for the quasi-relative point is as follows: in, As the relative point, x ij represents the i-th individual in the j-th dimension; u j and l i is the upper and lower bounds of the i-th population in the j-th dimension; x ij ∈[l,u] is a candidate solution in the search space, r is a random number between -1 and 1, and c is the system deviation; The adaptive t-distribution mutation disturbance is introduced into the PSA algorithm, and the t* distribution with the degree of freedom parameter n=iter is used to optimize the search direction and distance of the individual, where iter is the number of iterations; the position update formula is shown as follows: x(t+1)=x(t)+η·Δu(t)+(1-η)·(cos(1-t / T)+λr5·t * )·e k (t) Where r5 is a vector of random numbers from 0 to 1; η is a matrix with n rows and 1 column; e k (t) is the total deviation of t iterations, λ is the adjustment coefficient, and the formula is as follows: λ=[ln(T-t+2) / ln(T)] 2 Where T is the maximum number of iterations.

Citation Information

Patent Citations

  • Wind speed prediction method and device for railway disaster prevention system

    CN116415723A