A soft sensing method for effluent ammonia nitrogen based on a neural network with double correlation pruning strategy
By applying the dual-correlation pruning strategy and high-dimensional mutual information feature extraction in the neural network model, the problems of low accuracy and high cost of ammonia nitrogen concentration detection in the existing technology are solved, and fast and accurate water quality detection is achieved.
Patent Information
- Application Number
- CN202311065512.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2043-08-22
AI Technical Summary
When detecting ammonia nitrogen concentration in water, the prior art has problems such as low accuracy, long cycle, high cost and high equipment maintenance costs, which are difficult to meet the needs of fast and accurate water quality detection.
A neural network model based on the dual-correlation pruning strategy is adopted to construct a fast prediction method for effluent ammonia nitrogen concentration through high-dimensional mutual information feature extraction, structural adjustment and parameter optimization.
It improves the measurement accuracy of ammonia nitrogen concentration in the effluent water, reduces the measurement cost, and provides a fast and accurate water quality detection method suitable for sewage treatment processes.
Smart Images

Figure CN117094356B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of artificial intelligence and relates to a soft measurement method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network. Background Art
[0002] In recent years, with the gradual improvement of environmental protection awareness, the demand for the accuracy of key variables in water has continued to increase. Ammonia nitrogen is one of the important water quality variables, which is closely related to the eutrophication of water bodies. Therefore, strengthening the detection of ammonia nitrogen will help discover and solve the eutrophication problem.
[0003] The measurement method based on chemical reaction is an offline measurement method of ammonia nitrogen concentration in the laboratory. It is easily affected by external factors such as the environment and the environment, and has a long measurement cycle, low accuracy, and high equipment maintenance costs. The measurement method based on the mechanism model is an indirect measurement method based on the water quality model. It is generally used in sewage treatment plants, but the cycle is long, the cost is high, and the technology is not yet mature. Therefore, it is of great significance to study low-cost, fast and accurate effluent ammonia nitrogen concentration measurement methods for water quality treatment processes.
[0004] The present invention designs a soft measurement method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network. By constructing a neural network model based on a double-correlation pruning strategy, the effluent ammonia nitrogen concentration in the sewage treatment process can be quickly and accurately predicted, the measurement accuracy is improved and the measurement cost is greatly reduced, providing an effective measurement method for water quality treatment. Summary of the invention
[0005] Purpose of the invention: In response to the problems pointed out in the background technology, the present invention proposes a soft measurement method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network. The effluent ammonia nitrogen data is predicted through feature extraction, structure adjustment and parameter optimization of high-dimensional mutual information. This method not only helps to improve the computational efficiency of the model, but also helps to improve the classification accuracy of the model.
[0006] Technical solution: The present invention provides a soft measurement method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network, comprising the following steps:
[0007] Step 1: Use the sensor array to measure the water temperature WT, pH, dissolved oxygen DO, potassium permanganate KMnO 4 , total phosphorus TP, total nitrogen TN, conductivity EC, turbidity TU, chlorophyll Chl, algae density ACD, a total of 10 easily measurable variables were tested, and salicylic acid spectrophotometry was used to determine ammonia nitrogen NH 3 -N content, generate a batch of sample input-output pairs;
[0008] Step 2: Use high-dimensional mutual information method to extract input features to reduce input redundancy and computational complexity;
[0009] Step 3: construct a TS fuzzy neural network FNN, and use a dual-correlation pruning strategy consisting of a growing scheme and a pruning scheme to dynamically optimize the TS fuzzy neural network FNN to obtain a neural network model SCFNN-DCP based on a dual-correlation pruning strategy; the dual-correlation pruning strategy specifically generates fuzzy rules by using a system error judgment criterion and a containment boundary criterion in the growth stage of fuzzy rules; in the pruning stage of fuzzy rules, the dual-correlation criterion is used to remove fuzzy rules from the rule base;
[0010] Step 4: Use the recursive least squares algorithm with stage forgetting factor to online estimate the network weights of the SCFNN-DCP neural network model based on the dual-correlation pruning strategy;
[0011] Step 5: After training the neural network model based on the double-correlation pruning strategy, predict the effluent ammonia nitrogen concentration; use the test sample data as the input of the model, obtain the output of the model and perform denormalization to obtain the predicted value of effluent ammonia nitrogen.
[0012] Furthermore, the specific steps of step 2 are as follows:
[0013] Assume that the joint probability density function of random variables A and B is γ A,B (a,b), then its marginal probability density function is defined as follows:
[0014] γ A (a) = ∫γ A,B (a,b)db
[0015] γ B (b) = ∫γ A,B (a,b)da
[0016] According to information theory, the MI between A and B is defined as:
[0017]
[0018] Where S is the domain of A and B; the entropy and joint entropy of A and B are as follows:
[0019] E(A)=-∫γ A (a) logγ A (a)
[0020] E(B)=-∫γ B (b)logγ B (b)db
[0021]
[0022] but:
[0023] MI(A;B)=E(A)+E(B)-E(A,B)
[0024] Step 2.1: Initialize the algorithm parameters, including the k value;
[0025] Step 2.2: Calculate the one-dimensional MI between each one-dimensional component of the input feature A and the output feature B, and select the feature corresponding to the maximum value as the first relevant feature;
[0026] Step 2.3: Combine the first relevant feature with other input features to form a two-dimensional input feature; calculate the high-dimensional mutual information between the first relevant feature and the output feature B, and select the feature corresponding to the maximum value as the second relevant feature;
[0027] Step 2.4: Repeat step 2.3 until the high-dimensional MI values of all input features are calculated;
[0028] Step 2.5: Use high-dimensional MI values to remove redundant features.
[0029] Furthermore, the TS fuzzy neural network FNN in step 3 is specifically as follows: a 5-layer FNN consisting of an input layer, a membership function layer, a rule layer, a normalization layer and an output layer is constructed using a TS model;
[0030] The fuzzy rules of TS fuzzy neural network FNN are described as follows:
[0031] R j :If x 1 is A 1j ,...,x n is A nj , then y is f(x 1 ,…,x n )
[0032] In the formula, j = 1, 2, ..., r, r represents the number of fuzzy rules, f(x 1 , …, x n ) is the input variable x i A linear function of
[0033] Input layer: Each node and input x = [x 1 ,x 2 ,…,x n ] T are connected, n is the number of input variables, that is, the number of nodes;
[0034] Membership function layer: Each node represents a linguistic variable value, which is used to calculate the membership of each input component to the fuzzy set of each linguistic variable value, using the Gaussian membership function:
[0035]
[0036] Among them, μ ij is the membership function of the i-th input variable belonging to the j-th fuzzy set, c ij With σ ij are the center and width of the corresponding Gaussian membership function, respectively;
[0037] Rule layer: Each node represents a fuzzy rule, which is used to match the premise of the fuzzy rule and calculate the applicability of each rule in the form of a product:
[0038] α j (x i )=μ 1j (x 1 )μ 2j (x 2 )...μ nj (x n )
[0039] Among them, j = 1, 2,…, r, r is the number of fuzzy rules.
[0040] Normalization layer: The number of nodes is the same as the third layer, and the output of the third layer is normalized:
[0041]
[0042] Output layer: also called defuzzification layer:
[0043]
[0044] y j (x i )=p 0j +p 1j x 1 +...+p nj x n ,j=1,2,...,r
[0045] Among them, y(x i ) is the network output, y j (x i ) is the consequent output of the jth rule, p ij (i=0,1,…,n,j=1,2,…,r) are coefficients, n is the number of input variables, and r is the number of fuzzy rules.
[0046] Furthermore, in step 3, the dual-correlation pruning strategy consisting of a growing scheme and a pruning scheme dynamically optimizes the TS FNN fuzzy neural network model. The specific steps of the growing scheme are as follows:
[0047] The growth scheme, i.e., regular growth, is as follows:
[0048] For the growth of the number of fuzzy rules, the following two criteria are introduced:
[0049] (1) System error criterion
[0050] For the kth observation data (X k , t k ), where t k is the desired output, y k is the actual output, and the system error is defined as:
[0051] ||ε k ||=||t k -y k ||
[0052] (2) Accommodate Boundary
[0053] If a new sample is located within the coverage range of an existing Gaussian function, the sample can be represented by the existing Gaussian function, and there is no need to generate a new Gaussian function;
[0054] For the kth observation data (X k , t k ) Calculate the input value X k and the center C of the existing Gaussian function unit j The distance between k (j), namely:
[0055] d k (j) = ||X i -C j ||j=1,2,...u
[0056] Let d min =min(d k (j)), if d min >k d , then we need to consider adding a fuzzy rule, otherwise the input data is represented by the existing nearest Gaussian function, k d is a valid variable that can accommodate boundaries;
[0057] When training the model offline, k e and k d Perform dynamic adjustment: First set a relatively large k e and k d , determine the position where the output error is large and is not covered by the existing fuzzy rules, and continuously reduce k through network training e and k d :
[0058] k e=max[e max ×β i ,e min ]
[0059] k d =max[d max ×γ i ,d min ]
[0060] Where: ε max is the predefined maximum error; ε min is the expected DFNN accuracy; β is the convergence constant, 0<β<1; d max is the maximum length of the input space; d min is the minimum length; γ is the attenuation constant, 0<γ<1;
[0061] Based on the above two indicators, consider the following four situations:
[0062] a) When ||ε k ||≤k e , d min ≤k d , indicating that SCFNN-DCP can fully adapt to the observation results (X k , t k ), no need to add fuzzy rules;
[0063] b) When ||ε k ||≤k e , d min >k d When , it shows that SCFNN-DCP This shows that the system has good generalization and only needs to adjust the weights;
[0064] c) When ||ε k ||>k e , d min >k d When , it indicates that the generalization performance of the current SCFNN-DCP is not good and the rules cannot cover the current sample, a fuzzy rule needs to be added;
[0065] d) When ||ε k ||>k e , d min ≤k d , indicating that although X k Can be gathered near the existing Gaussian function, but covering X k The generalization ability of the Gaussian function is not very good, and there is no need to add fuzzy rules, but the center and width of the Gaussian function need to be updated;
[0066] For the kth observation data X k, when it is necessary to add the jth fuzzy rule, j and σ j To initialize:
[0067] C j =X k
[0068] σ j =k l ×d min (j≠1)
[0069] Among them, k l is the overlap factor, k l >1; when the first observation data (X 1 ,t 1 ) enters SCFNN-DCP, it is adopted as the first neuron C 1 =X 1 , σ 1 =σ 0 , σ 0 is a pre-specified constant;
[0070] For the kth observation data X k , when ||ε appears k ||>k e , d min ≤k d When we need to find the closest k Gaussian function and adjust its σ j k :
[0071]
[0072] Among them, k w (k w >1) is a preset constant.
[0073] Furthermore, in step 3, the dual-correlation pruning strategy consisting of the growing scheme and the pruning scheme dynamically optimizes the TS fuzzy neural network FNN. The specific operation of the pruning scheme, i.e., rule pruning, is as follows:
[0074] For the regular layer neuron α m and α n For example, the correlation coefficient is calculated using the formula:
[0075]
[0076] Among them, Sα m and Sα n Respectively represent the sample standard deviation of the mth and nth neurons in the regular layer, Sα m α nRepresents the sample covariance between the two, and their calculation process is as follows:
[0077]
[0078]
[0079] Among them, α m and α n Respectively represent the output values of the mth and nth neurons in the normalization layer, N k Indicates the total number of training samples at the current moment;
[0080] For the regular layer neuron α m For the output layer neuron y, the correlation coefficient is calculated using the formula:
[0081]
[0082] Among them, Sα m and S y Represents the sample standard deviation of the mth neuron in the regular layer and the output layer neuron, Sα m y represents the sample covariance between the two, and their calculation process is as follows:
[0083]
[0084]
[0085]
[0086] Among them, α m and y represent the output values of the mth neuron in the normalization layer and the neuron in the output layer, respectively;
[0087] By analogy, we can obtain the sample covariance Sα of the nth neuron in the regular layer and the neuron in the output layer: n y, first calculate the correlation coefficient between the neurons in the regular layer, and find the neuron pairs with correlation coefficients greater than 0.8; then calculate the correlation coefficient between the neurons in this neuron pair and the output, and compare the two correlation coefficients. If r αm >r αn Then delete the mth neuron, and vice versa.
[0088] Furthermore, the specific steps of step 4 are as follows:
[0089] Assume that N sample points generate r fuzzy rules. For the kth observation data x k , the output y of the system k Written in the form of the following linear regression model:
[0090] T=ψM+E
[0091] The parameter estimation of SCFNN-DCP uses the improved RLS algorithm to optimize the subsequent parameters of the fuzzy rules online and define the learning error δ(k):
[0092] δ(k)=t(k)-y(k)
[0093] =t(k)-ψ T (k)M(k)
[0094] The RLS algorithm is obtained by minimizing the following criterion function:
[0095]
[0096] Find the minimum value of the above formula:
[0097]
[0098] Then the least squares estimate of parameter A is obtained as follows:
[0099]
[0100] Define an M×M Hermitian matrix H as follows:
[0101] H=[ψ T ψ] -1
[0102] Using matrix H and based on the RLS algorithm, we get the parameter update formula:
[0103]
[0104] The improved RLS algorithm is used to update the previous parameters online, and a forgetting factor λ in the interval [0, 1] is added to it. The formula of the recursive least squares method with the forgetting factor is:
[0105]
[0106] The adaptive adjustment of λ is expressed as follows:
[0107]
[0108] Among them, ε is the error between the true value of the sample currently entering the system and the predicted value; the smaller the error ε, the smaller the parameter correction effect is required, and the closer λ is to λ max ; The larger the error ε, the greater the parameter correction effect is required, and the closer λ is to λ min .
[0109] Beneficial Effects
[0110] (1) In the dual-correlation pruning strategy neural network, the high-dimensional mutual information method is first used to extract input features to reduce input redundancy and computational complexity.
[0111] (2) The present invention proposes a self-building strategy consisting of a growth scheme and a pruning scheme, which dynamically optimizes the network structure of the fuzzy neural network model to form a dual-correlation pruning strategy neural network. In the growth stage of fuzzy rules, the system error judgment criterion and the containment boundary criterion are used to generate fuzzy rules to enhance the generalization ability of the network. In the pruning stage of fuzzy rules, the dual-correlation criterion is used to remove fuzzy rules from the rule base to reduce the complexity of the network. At the same time, a dynamic adjustment scheme is used to update the network width.
[0112] (3) The present invention adopts a recursive least squares algorithm with a stage forgetting factor to estimate the network weights online, thereby obtaining a stronger prediction capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] Figure 1 This is a flow chart of the SCFNN-DCP learning algorithm of the present invention;
[0114] Figure 2 This is a comparison chart of the fuzzy rule numbers of the present invention;
[0115] Figure 3 It is a comparison diagram of the algorithm of the present invention, (a) is the prediction result and the prediction error prediction result; (b) is the prediction error; (c) is the prediction result; (d) is the prediction error. DETAILED DESCRIPTION
[0116] The following further describes the implementation of the present invention in detail with reference to the accompanying drawings and specific examples.
[0117] The present invention provides a soft sensing method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network, comprising the following steps:
[0118] Step 1: Use the sensor array to measure the water temperature WT, pH, dissolved oxygen DO, potassium permanganate KMnO 4 , total phosphorus TP, total nitrogen TN, conductivity EC, turbidity TU, chlorophyll Chl, algae density ACD, a total of 10 easily measurable variables were tested, and salicylic acid spectrophotometry was used to determine ammonia nitrogen NH 3 -N content, thereby generating a batch of sample input-output pairs.
[0119] Step 2: Use high-dimensional mutual information method to extract input features and reduce input redundancy and computational complexity.
[0120] Assume that the joint probability density function of random variables A and B is γ A,B (a,b), then its marginal probability density function is defined as follows:
[0121] γ A (a) = ∫γ A,B (a,b)db
[0122] γ B (b) = ∫γ A,B (a,b)da
[0123] According to information theory, the MI between A and B is defined as:
[0124]
[0125] where S is the domain of A and B.
[0126] According to Shannon's definition of entropy, the entropy and joint entropy of A and B are as follows:
[0127] E(A)=-∫γ A (a) logγ A (a)
[0128] E(B)=-∫γ B (b)logγ B (b)db
[0129]
[0130] According to the equation, the above formula can be rewritten as:
[0131] MI(A;B)=E(A)+E(B)-E(A,B)
[0132] The basic idea of MI calculation is as follows: First, determine the k nearest neighbors of a given N samples in the space composed of random variables A and B, and then calculate the number of other samples whose distances in the X and Y directions of the current sample are less than the maximum distances from the current sample to the k nearest neighbors. Finally, the value of MI is estimated by counting. Based on this, a feature selection method based on high-dimensional k-nearest neighbor mutual information is proposed. The basic concept of this method is as follows. First, a forward sum search strategy is used to select a candidate related feature subset consisting of strongly related features and weakly related features; then, the MI value between two features in the candidate subset is calculated. Finally, the related feature subset with the largest MI value is selected as the optimal strongly related feature subset.
[0133] The specific algorithm process is as follows:
[0134] Step 2.1: Initialize the algorithm parameters, including the k value.
[0135] Step 2.2: Calculate the one-dimensional MI between each one-dimensional component of the input feature A and the output feature B, and select the feature corresponding to the maximum value as the first relevant feature.
[0136] Step 2.3: Combine the first relevant feature with other input features to form a two-dimensional input feature. Calculate the high-dimensional mutual information between the first relevant feature and the output feature B according to the formula, and select the feature corresponding to the maximum value as the second relevant feature.
[0137] Step 2.4: Repeat step 2.3 until the high-dimensional MI values of all input features are calculated.
[0138] Step 2.5: Use high-dimensional MI values to remove redundant features.
[0139] Step 3: A self-construction strategy consisting of a growing scheme and a pruning scheme is proposed to dynamically optimize the TS FNN. Specifically, in the growing stage of fuzzy rules, the system error judgment criterion and the containment boundary criterion are used to generate fuzzy rules; in the pruning stage of fuzzy rules, the dual correlation criterion is used to remove fuzzy rules from the rule base.
[0140] A 5-layer FNN mainly composed of input layer, membership function layer, rule layer, normalization layer and output layer was constructed using the TS model.
[0141] The fuzzy rules of TS FNN are described as follows:
[0142] R j :If x 1 is A 1j ,...,x n is A nj , then y is f(x 1 ,…,x n )
[0143] In the formula, j = 1, 2, ..., r, r represents the number of fuzzy rules, f(x 1 , …, x n ) is the input variable x i A linear function of .
[0144] Input layer: Each node and input x = [x 1 ,x 2 ,…,x n ] T are connected, n is the number of input variables, that is, the number of nodes.
[0145] Membership function layer: Each node represents a linguistic variable value. This layer is mainly used to calculate the membership of each input component to the fuzzy set of each linguistic variable value. Generally, the Gaussian membership function is used:
[0146]
[0147] Among them, μ ijis the membership function of the i-th input variable belonging to the j-th fuzzy set, c ij With σ ij are the center and width of the corresponding Gaussian membership function, respectively.
[0148] Rule layer: Each node represents a fuzzy rule, which is used to match the premise of the fuzzy rule and calculate the applicability of each rule in the form of a product:
[0149] α j (x i )=μ 1j (x 1 )μ 2j (x 2 )...μ nj (x n )
[0150] Among them, j = 1, 2,…, r, r is the number of fuzzy rules.
[0151] Normalization layer: The number of nodes is the same as the third layer, and the output of the third layer is normalized:
[0152]
[0153] Output layer: Also called the defuzzification layer, the purpose of this layer is to perform the clarification calculation:
[0154]
[0155] y j (x i )=p 0j +p 1j x 1 +...+p nj x n ,j=1,2,...,r
[0156] Among them, y(x i ) is the network output, y j (x i ) is the consequent output of the jth rule, p ij (i=0,1,…,n,j=1,2,…,r) are coefficients, n is the number of input variables, and r is the number of fuzzy rules.
[0157] In the growth stage of fuzzy rules, the rule growth is:
[0158] For the growth of the number of fuzzy rules, the following two criteria can be introduced:
[0159] (1) System error criterion
[0160] For the kth observation data (Xk , t k ), where t k is the desired output, y k is the actual output, and the system error is defined as:
[0161] ||ε k ||=||t k -y k ||
[0162] (2) Accommodate Boundary
[0163] If a new sample is within the coverage range (i.e., the containment boundary) of an existing Gaussian function, the sample can be represented by the existing Gaussian function, and there is no need to generate a new Gaussian function.
[0164] For the kth observation data (X k , t k ) Calculate the input value X k and the center C of the existing Gaussian function unit j The distance between k (j), that is
[0165] d k (j) = ||X i -C j ||j=1,2,...u
[0166] Let d min =min(d k (j)), if d min >k d , then we need to consider adding a fuzzy rule. Otherwise, the input data can be represented by the existing nearest Gaussian function. Here k d is a valid variable that can accommodate bounds.
[0167] When training the model offline, k e and k d Perform dynamic adjustment: First set a relatively large k e and k d , determine the position where the output error is large and is not covered by the existing fuzzy rules. Further through network training, k is continuously reduced. e and k d :
[0168] k e =max[e max ×β i ,e min ]
[0169] k d =max[d max ×γi ,d min ]
[0170] Where: ε max is the predefined maximum error; ε min is the expected DFNN accuracy; β (0<β<1) is the convergence constant; d max is the maximum length of the input space; d min is the minimum length; γ (0<γ<1) is the attenuation constant.
[0171] Based on the above two indicators, consider the following four situations:
[0172] a) When ||ε k ||≤k e , d min ≤k d , indicating that SCFNN-DCP can fully adapt to the observation results (X k , t k ), no need to add fuzzy rules.
[0173] b) When ||ε k ||≤k e , d min >k d , indicating that SCFNN-DCP has good generalization performance and only needs to adjust the weights.
[0174] c) When ||ε k ||>k e , d min >k d When , it indicates that the generalization performance of the current SCFNN-DCP is not good and the rules cannot cover the current sample, a fuzzy rule needs to be added.
[0175] d) When ||ε k ||>k e , d min ≤k d , indicating that although X k Can be gathered near the existing Gaussian function, but covering X k The generalization ability of the Gaussian function is not very good. Therefore, there is no need to add fuzzy rules, but the center and width of the Gaussian function need to be updated.
[0176] For the kth observation data X k , when it is necessary to add the jth fuzzy rule, j and σ j To initialize:
[0177] C j =X k
[0178] σ j =k l ×d min (j≠1)
[0179] Among them, k l (k l >1) is the overlap factor. k l The larger the value, the greater the overlap between each membership function. 1 ,t 1 ) enters SCFNN-DCP, it is adopted as the first neuron C 1 =X 1 , σ 1 =σ 0 , σ 0 is a pre-specified constant.
[0180] For the kth observation data X k , when ||ε appears k ||>k e , d min ≤k d When we need to find the closest k Gaussian function and adjust its σ j k :
[0181]
[0182] Among them, k w (k w >1) is a preset constant.
[0183] In the pruning stage of fuzzy rules, the rule pruning is:
[0184] For the regular layer neuron α m and α n For example, the correlation coefficient between them can be calculated using the formula:
[0185]
[0186] Among them, Sα m and Sα n Respectively represent the sample standard deviation of the mth and nth neurons in the regular layer, Sα m α n represents the sample covariance between the two. Their calculation process is as follows:
[0187]
[0188]
[0189]
[0190] Among them, α m and α n Respectively represent the output values of the mth and nth neurons in the normalization layer, N k Indicates the total number of training samples at the current moment.
[0191] For the regular layer neuron α m For the output layer neuron y, the correlation coefficient between them can be calculated using the formula:
[0192]
[0193] Among them, Sα m and S y Represents the sample standard deviation of the mth neuron in the regular layer and the output layer neuron, Sα m y represents the sample covariance between the two. Their calculation process is as follows:
[0194]
[0195]
[0196]
[0197] Among them, α m and y represent the output values of the mth neuron in the normalization layer and the neuron in the output layer, respectively.
[0198] By analogy, we can obtain the sample covariance Sα of the nth neuron in the regular layer and the neuron in the output layer: n y. This paper first calculates the correlation coefficient between the neurons in the regular layer and finds the neuron pairs with correlation coefficients greater than 0.8. Then, the correlation coefficient between the neurons in this neuron pair and the output is calculated. Comparing the sizes of the two correlation coefficients, if r αm >r αn Then delete the mth neuron, and vice versa.
[0199] Step 4: Use the recursive least squares algorithm with stage forgetting factor to estimate the network weights online. The overall algorithm flow chart is as follows: Figure 1 shown.
[0200] Assume that N sample points generate r fuzzy rules. For the kth observation data x k , the output y of the system k It can be written as the following linear regression model:
[0201] T=ψM+E
[0202] The parameter estimation of SCFNN-DCP uses the improved RLS algorithm to optimize the subsequent parameters of the fuzzy rules online to ensure the convergence of the estimation error. Define the learning error δ(k):
[0203] δ(k)=t(k)-y(k)
[0204] =t(k)-ψ T (k)M(k)
[0205] The RLS algorithm is obtained by minimizing the following criterion function:
[0206]
[0207] Find the minimum value of the above formula:
[0208]
[0209] Then the least squares estimate of parameter A is obtained as follows:
[0210]
[0211] Define an M×M Hermitian matrix H as follows:
[0212] H=[ψ T ψ] -1
[0213] Using the matrix H and based on the RLS algorithm, we can get the parameter update formula:
[0214]
[0215] In order to improve the robustness of noise interference and overcome the "data saturation" problem, the improved RLS algorithm is used to update the previous parameters online. A forgetting factor λ in the interval [0, 1] can be added. The formula of the recursive least squares method with forgetting factor is:
[0216]
[0217] The value of λ affects the recognition ability of the algorithm. The smaller λ is, the faster the system converges, but the lower the system recognition accuracy is. The larger λ is, the slower the system converges, but the higher the recognition accuracy is. Therefore, the adaptive adjustment of λ is proposed, and the expression is as follows:
[0218]
[0219] Where e is the error between the true value of the sample currently entering the system and the predicted value. The smaller the error ε is, the smaller the parameter correction effect is required, and the closer λ is to λ. max ; The larger the error ε, the greater the parameter correction effect is required, and the closer λ is to λ min .
[0220] Step 5: After training the neural network model based on the dual-correlation pruning strategy, predict the effluent ammonia nitrogen concentration; use the test sample data as the input of the model, and obtain the output of the model and perform denormalization to obtain the predicted value of effluent ammonia nitrogen. The algorithm comparison diagram is shown in the figure below. Figure 2 , 3 shown.
[0221] This method is compared with radial basis neural network (RBF), multilayer feedforward neural network (FNN-EBP), dynamic fuzzy neural network (DFNN), generalized dynamic fuzzy neural network (GDFNN) and hierarchical pruned self-organizing fuzzy neural network (SOFNN-HPS) algorithms. It can be seen from Table 1 that the network structure of the SCFNN-DCP of the present invention is the most compact (10 rules), while the structures of DFNN and GDFNN are slightly more complex, with 13 and 16 rules respectively. The structural complexity of SOFNN-HPS is basically the same as that of SCFNN-DCP, but its test RMSE (0.1410) is significantly lower than that of the SCFNN-DCP of the present invention (0.0623). The test accuracy of SCFNN-DCP reaches 86.61%, which is also higher than other comparison models. The experimental results show that the SCFNN-DCP network model of the present invention has achieved satisfactory accuracy and can meet the needs of soft calculation of ammonia nitrogen in practical engineering applications.
[0222] Table 1 Algorithm comparison
[0223]
[0224] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A soft sensing method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network, characterized in that: The steps include: Step 1: Use the sensor array to detect 10 easily measurable variables, including water temperature WT, pH, dissolved oxygen DO, potassium permanganate KMnO4, total phosphorus TP, total nitrogen TN, electrical conductivity EC, turbidity TU, chlorophyll Chl, and algae density ACD, and use salicylic acid spectrophotometry to determine the ammonia nitrogen NH3-N content, and generate a batch of sample input-output pairs; Step 2: Use high-dimensional mutual information method to extract input features to reduce input redundancy and computational complexity; Step 3: construct a TS fuzzy neural network FNN, and use a dual-correlation pruning strategy consisting of a growing scheme and a pruning scheme to dynamically optimize the TS fuzzy neural network FNN to obtain a neural network model SCFNN-DCP based on a dual-correlation pruning strategy; the dual-correlation pruning strategy specifically generates fuzzy rules by using a system error judgment criterion and a containment boundary criterion in the growth stage of fuzzy rules; in the pruning stage of fuzzy rules, the dual-correlation criterion is used to remove fuzzy rules from the rule base; The dual-correlation pruning strategy consisting of a growing scheme and a pruning scheme dynamically optimizes the TS fuzzy neural network FNN. The specific operations of the pruning scheme, namely rule pruning, are as follows: For the regular layer neuron α m and α n For example, the correlation coefficient is calculated using the formula: Among them, Sα m and Sα n Respectively represent the sample standard deviation of the mth and nth neurons in the regular layer, Sα m α n Represents the sample covariance between the two, and their calculation process is as follows: Among them, α m and α n Respectively represent the output values of the mth and nth neurons in the normalization layer, N k Indicates the total number of training samples at the current moment; For the regular layer neuron α m For the output layer neuron y, the correlation coefficient is calculated using the formula: Among them, Sα m and S y Represents the sample standard deviation of the mth neuron in the regular layer and the output layer neuron, Sα m y represents the sample covariance between the two, and their calculation process is as follows: Among them, α m and y represent the output values of the mth neuron in the normalization layer and the neuron in the output layer, respectively; By analogy, we can obtain the sample covariance Sα of the nth neuron in the regular layer and the neuron in the output layer: n y, first calculate the correlation coefficient between the neurons in the regular layer, and find the neuron pairs with correlation coefficients greater than 0.8; then calculate the correlation coefficient between the neurons in this neuron pair and the output, and compare the two correlation coefficients. If Then delete the mth neuron, and vice versa; Step 4: Use the recursive least squares algorithm with stage forgetting factor to online estimate the network weights of the SCFNN-DCP neural network model based on the dual-correlation pruning strategy; Step 5: After training the neural network model based on the double-correlation pruning strategy, predict the effluent ammonia nitrogen concentration; use the test sample data as the input of the model, obtain the output of the model and perform denormalization to obtain the predicted value of effluent ammonia nitrogen.
2. The soft sensing method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network according to claim 1 is characterized in that: The specific steps of step 2 are as follows: Assume that the joint probability density function of random variables A and B is γ A,B (a,b), then its marginal probability density function is defined as follows: c A (a)=∫γ A,B (a,b)db c B (b)=∫γ A,B (a,b)da According to information theory, the MI between A and B is defined as: Where S is the domain of A and B; the entropy and joint entropy of A and B are as follows: E(A)=−∫γ A (a) logγ A (a) the E(B)=-∫γ B (b)logγ B (b)db but: MI(A;B)=E(A)+E(B)-E(A,B) Step 2.1: Initialize the algorithm parameters, including the k value; Step 2.2: Calculate the one-dimensional MI between each one-dimensional component of the input feature A and the output feature B, and select the feature corresponding to the maximum value as the first relevant feature; Step 2.3: Combine the first relevant feature with other input features to form a two-dimensional input feature; calculate the high-dimensional mutual information between the first relevant feature and the output feature B, and select the feature corresponding to the maximum value as the second relevant feature; Step 2.4: Repeat step 2.3 until the high-dimensional MI values of all input features are calculated; Step 2.5: Use high-dimensional MI values to remove redundant features.
3. The soft sensing method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network according to claim 1 is characterized in that: The TS fuzzy neural network FNN in step 3 is specifically as follows: a 5-layer FNN consisting of an input layer, a membership function layer, a rule layer, a normalization layer and an output layer is constructed using a TS model; The fuzzy rules of TS fuzzy neural network FNN are described as follows: R j :Ifx1 isA 1j ,...,x n isA nj ,theny isf(x1,…,x n ) Where j = 1, 2, ..., r, r represents the number of fuzzy rules, f(x1, ..., x n ) is the input variable x i A linear function of Input layer: Each node has an input x=[x1,x2,…,x n ] T are connected, n is the number of input variables, that is, the number of nodes; Membership function layer: Each node represents a linguistic variable value, which is used to calculate the membership of each input component to the fuzzy set of each linguistic variable value, using the Gaussian membership function: Among them, μ ij is the membership function of the i-th input variable belonging to the j-th fuzzy set, c ij With σ ij are the center and width of the corresponding Gaussian membership function, respectively; Rule layer: Each node represents a fuzzy rule, which is used to match the premise of the fuzzy rule and calculate the applicability of each rule in the form of a product: a j (x i )=μ 1j (x1)m 2j (x2)...m nj (x n ) Where, j = 1, 2, ..., r, r is the number of fuzzy rules; Normalization layer: The number of nodes is the same as the third layer, and the output of the third layer is normalized: Output layer: also called defuzzification layer: yes j (x i )=p 0j +p 1j x1+...+p nj x n ,j=1,2,...,r Among them, y(x i ) is the network output, y j (x i ) is the consequent output of the jth rule, p ij (i=0,1,…,n,j=1,2,…,r) are coefficients, n is the number of input variables, and r is the number of fuzzy rules.
4. The soft sensing method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network according to claim 1 is characterized in that: In step 3, the dual-correlation pruning strategy consisting of a growth scheme and a pruning scheme dynamically optimizes the TS FNN fuzzy neural network model. The specific steps of the growth scheme are as follows: The growth scheme, i.e., regular growth, is as follows: For the growth of the number of fuzzy rules, the following two criteria are introduced: (1) System error criterion For the kth observation data (X k , t k ), where t k is the desired output, y k is the actual output, and the system error is defined as: ||ε k ||=||t k -y k || (2) Accommodate Boundary If a new sample is located within the coverage range of an existing Gaussian function, that is, within the containment boundary, the sample is represented by the existing Gaussian function, and there is no need to generate a new Gaussian function; For the kth observation data (X k , t k ) Calculate the input value X k and the center C of the existing Gaussian function unit j The distance between k (j), namely: d k (j)=||X i -C j ||j=1,2,...u Let d min =min(d k (j)), if d min >k d , then we need to consider adding a fuzzy rule, otherwise the input data is represented by the existing nearest Gaussian function, k d is a valid variable that can accommodate boundaries; When training the model offline, k e and k d Perform dynamic adjustment: First set k e and k d , determine the position where the output error is large and is not covered by the existing fuzzy rules, and continuously reduce k through network training e and k d : k e =max[e max ×β i ,and min ] k d =max[d max ×γ i ,d min ] Where: ε max is the predefined maximum error; ε min is the expected DFNN accuracy; β is the convergence constant, 0<β<1; d max is the maximum length of the input space; d min is the minimum length; γ is the attenuation constant, 0<γ<1; Based on the above two indicators, consider the following four situations: a) When ∥ε k ∥≤k e , d min ≤k d , indicating that SCFNN-DCP fully adapts to the observation results (X k , t k ), no need to add fuzzy rules; b) When ∥ε k ∥≤k e , d min >k d , indicating that SCFNN-DCP has good generalization and only needs to adjust the weights; c) When ∥ε k ∥>k e , d min >k d When , it indicates that the generalization performance of the current SCFNN-DCP is not good and the rules cannot cover the current samples, and a fuzzy rule needs to be added; d) When ∥ε k ∥>k e , d min ≤k d , indicating that although X k Gathered around the existing Gaussian function, but covering X k The generalization ability of the Gaussian function is not very good, and there is no need to add fuzzy rules, but the center and width of the Gaussian function need to be updated; For the kth observation data X k , when it is necessary to add the jth fuzzy rule, j and σ j To initialize: C j =X k s j =k l ×d min (j≠1) Among them, k l is the overlap factor, k l >1; when the first observation data (X1, t1) enters SCFNN-DCP, it is adopted as the first neuron C1=X1, σ1=σ0, σ0 is a pre-specified constant; For the kth observation data X k , when ∥ε appears k ∥>k e , d min ≤k d When the value closest to X is found k Gaussian function and adjust its Among them, k w (k w >1) is a preset constant.
5. The soft sensing method for effluent ammonia nitrogen based on a double-correlation pruning strategy neural network according to any one of claims 1 to 4, characterized in that: The specific steps of step 4 are as follows: Assume that N sample points generate r fuzzy rules. For the kth observation data x k , the output y of the system k Written in the form of the following linear regression model: T=ψM+E The parameter estimation of SCFNN-DCP uses the improved RLS algorithm to optimize the subsequent parameters of the fuzzy rules online and define the learning error δ(k): δ(k)=t(k)-y(k) =t(k)-ψ T (k)M(k) The RLS algorithm is obtained by minimizing the following criterion function: Find the minimum value of the above formula: Then the least squares estimate of parameter A is obtained as follows: Define an M×M Hermitian matrix H as follows: H=[ψ T [ψ] -1 Using matrix H and based on the RLS algorithm, we get the parameter update formula: The improved RLS algorithm is used to update the previous parameters online, and a forgetting factor λ in the interval [0, 1] is added to it. The formula of the recursive least squares method with the forgetting factor is: The adaptive adjustment of λ is expressed as follows: Among them, ε is the error between the true value of the sample currently entering the system and the predicted value; the smaller the error ε, the smaller the parameter correction effect is required, and the closer λ is to λ max ; The larger the error ε, the greater the parameter correction effect is required, and the closer λ is to λ min .
Citation Information
Patent Citations
Method for improving chemical big data modeling speed by utilizing grid mutual information quick calculation
CN110795839A