An online soft measurement method for effluent BOD based on self-organizing RBFNN
By designing an online prediction method for effluent BOD based on a self-organizing RBF neural network and utilizing Gaussian membership and online small-batch gradient learning algorithms, the hysteresis and high cost problems of effluent BOD concentration detection are solved, and real-time, accurate prediction and efficient monitoring of effluent BOD concentration are achieved.
Patent Information
- Application Number
- CN202210018901.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-10
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-01-10
AI Technical Summary
The detection of effluent BOD concentration in the sewage treatment process has problems such as long detection cycle, large hysteresis, and expensive instrument detection. The traditional RBF neural network structure is difficult to determine, and the self-organizing RBF network relies too much on human factors in parameter setting and lacks adaptability.
An online prediction method for effluent BOD based on a self-organizing RBF neural network is designed. Gaussian membership is used as the similarity metric, and an online small-batch gradient learning algorithm is adopted for online learning of network parameters. A self-organizing mechanism is constructed to achieve real-time and accurate prediction of effluent BOD concentration.
It achieves low-cost, high-efficiency real-time prediction of effluent BOD concentration, obtains a compact network structure and fast and stable convergence performance, and improves the level of monitoring of future water quality during sewage treatment.
Smart Images

Figure CN114462208B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and is directly applicable to the field of sewage treatment. Background Art
[0002] The sewage treatment process involves many reactions and is very complex, which makes it very difficult to measure important parameters in sewage. Biochemical oxygen demand (BOD) indicates the amount of oxygen consumed by microorganisms in the water body to convert organic matter into inorganic matter. It can directly reflect the degree of water pollution and is a very important water quality detection indicator in the sewage treatment process. Currently, there are methods for predicting the effluent BOD concentration, such as dilution and inoculation methods and manual timed sampling. However, the dilution and inoculation methods have problems such as long test cycles, large hysteresis, and inability to reflect changes in BOD in the water body in a timely manner. Although the method of using instruments to detect the effluent BOD in sewage can quickly detect the results, the instrument detection is expensive. Therefore, how to more effectively detect the effluent BOD concentration is a key issue in the sewage treatment process.
[0003] In order to solve this problem, many scholars have proposed a soft measurement method, which adopts the idea of indirect measurement, uses known variables, and constructs a model to make real-time predictions of unmeasurable variables in the future. This method can solve the problems of traditional measurement methods of effluent BOD being too time-consuming, expensive to use instrument detection, and requiring regular maintenance. The structure of traditional RBF neural networks is difficult to determine, and most existing self-organizing RBF networks are overly dependent on human factors for parameter setting and lack adaptability. The present invention designs a self-organizing RBF neural network based on Gaussian membership and uses it for effluent BOD prediction to achieve real-time and accurate prediction of effluent BOD concentration. Summary of the Invention
[0004] 1. Problems that the present invention can solve:
[0005] This paper proposes an online prediction method for BOD concentration in sewage treatment effluent based on a self-organizing RBF neural network. This method uses Gaussian membership as a similarity metric, designs a self-organizing mechanism for the network's online structure, and proposes an online small-batch gradient learning algorithm to learn network parameters. This method enables real-time online prediction of effluent BOD concentration, addressing the difficulty of measuring BOD concentration in sewage treatment processes.
[0006] 2. Specific technical solutions of the present invention:
[0007] An online soft measurement method for effluent BOD based on self-organizing RBFNN mainly includes the following steps:
[0008] Step 1: Preprocessing of effluent BOD data
[0009] Through the mechanism analysis of effluent BOD in the sewage treatment process, a total of 10 variables, including ① influent pH value, ② effluent pH value, ③ influent suspended solids concentration, ④ effluent suspended solids concentration, ⑤ influent BOD concentration, ⑥ influent chemical oxygen demand (COD) concentration, ⑦ effluent COD concentration, ⑧ sludge settling rate (SV), ⑨ suspended solids concentration (MLSS), and ⑩ dissolved oxygen concentration (DO), are selected as the original feature set of effluent BOD, i.e., input variables, denoted as X = {x np |p=1,2,…,P,n=1,2,…,N}, P is the input feature dimension, here P=10; N is the number of samples. np It is expressed as the pth feature of the nth data. The effluent BOD concentration is selected as the output variable, denoted as Y = {y n |n=1,2,…,N}, N is the number of samples, y n Represents the nth output sample. The obtained multi-feature data set is normalized so that the data indicators are at the same order of magnitude, eliminating the error in the soft measurement model caused by the large difference in the order of magnitude of the data.
[0010] Normalize the input variable X and output variable Y according to the following formula:
[0011]
[0012] X and Y represent normalized data, and their values range from [0, 1].
[0013] Step 2: Design the effluent BOD online soft-sensing model structure based on self-organizing RBFNN;
[0014] Step 2.1: Design the RBF neural network topology. RBF is a three-layer feedforward neural network consisting of an input layer, a hidden layer, and an output layer. The input layer, which imports samples into the network, contains 10 neurons. Initially, the hidden layer contains 2 neurons. H represents the number of neurons in the hidden layer. Initially, H = 2. The kernel function is a Gaussian function. The output of the hth neuron is:
[0015]
[0016] Where c h and σ h Represent the center and width vectors of the hth hidden layer neuron, c1=x1,c2=x2,σ1=1,σ2=1,x n Indicates the nth sample n≥3, ||x n -c h || represents x n and c hThe Euclidean distance between them is calculated as
[0017]
[0018] The output layer has only one neuron, and the output of this neuron is the linear weighted output of the hidden layer neurons, expressed as:
[0019]
[0020] Where w h is the connection weight between the hth hidden layer neuron and the output neuron, w1=y1, w2=y2.
[0021] Step 2.2: Design a self-organizing RBF neural network
[0022] Step 2.2.1: For the current sample x n (n≥3), calculate the sample x n and the similarity μ between neurons h nh , μ nh The calculation formula is
[0023]
[0024] Here H is the number of neurons, c h is the center vector of neuron h.
[0025] Sample x n The similarity vector between all current neurons is recorded as U n , U n =[μ n1 ,μ n2 ,μ nh ,…,μ nH ](1≤h≤H), according to U n Find the maximum value of the elements in the sample x n The neuron h with the maximum similarity, After determining the maximum similarity neuron h, calculate the similarity threshold T of neuron h h , the similarity threshold T of neuron h h It is defined as the maximum similarity between neuron h and all current neurons.
[0026] First, the similarity between neuron h and all other neurons is calculated. For example, the similarity between neuron h and neuron h' (h'∈H\{h}) is calculated using formula (7), where h'∈H\{h} indicates that h' is the neuron other than the hth neuron among the H neurons.
[0027]
[0028] Here, H is the number of neurons, and c h is the center vector of neuron h, and c h' is the center vector of neuron h'.
[0029] The similarity matrix between neuron h and all the other neurons is denoted as U h , U h = [μ h1 , μ h2 , μ hh' , …, μ hH (h' ∈ H\{h}). The similarity threshold T of neuron h h is calculated by the formula T h = max(max(U h )).
[0030] Use formula (8) to calculate the current root mean square error of the network based on the samples within the sliding window. When n < L, the samples within the sliding window are the first sample to the nth sample, and there are n samples in total; when n ≥ L, the samples within the sliding window are the (n - L + 1)th sample to the nth sample, and there are L samples in the sliding window.
[0031]
[0032] where L represents the size of the sliding window, and the value range of L is [50, 100]. d i is the expected output of the network, y i is the actual output, and i indicates that the sample is the data within the sliding window.
[0033] Design the network addition criterion: If μ nh < T h , and E > E0, where E0 takes the value of 0.05. Add the current sample as a new neuron to the network, and the parameter settings are as shown in formula (9):
[0034]
[0035] where c H+1 , σ H+1 , w H+1 are respectively the center vector, width, and output weight of the newly added neuron H + 1, and d max is the maximum distance between the centers.e n H is the network error when the input is x n before the change of the RBFNN structure, that is, the error when the network has H neurons, and it is calculated using formula (10).<Calculate using formula (3). Update H = H + 1.
[0036]
[0037] Here y n The input is x n In the case of , the actual output obtained by the network when there are H neurons.
[0038] Step 2.2.2: Design a learning algorithm for the online soft-sensing model of outlet BOD based on self-organizing RBFNN—online fixed mini-batch gradient algorithm. If the algorithm adds neurons and learns parameters after the structure changes, the loss function of the current network is defined as:
[0039]
[0040] where d i is the expected output, y i is the actual output; The fixed batch size L is in the range [50, 100], and k is the number of iterations.
[0041] The output weight, neuron center, and neuron width parameters are trained using the following formula:
[0042] w h (k+1)=w h (k)-η w Φ wh (k) (12)
[0043] c h (k+1)=c h (k)-η c Φ ch (k) (13)
[0044] σ h (k+1)=σ h (k)-η σ Φ σh (k) (14)
[0045]
[0046]
[0047] Wherein formula (12), formula (13) and formula (14) are the update iteration rules of output weight, neuron center and neuron width respectively; h (k), c h (k) and σ h (k) represents the weight, center vector and width of the h-th neuron at the k-th iteration; Φwh (k), Φ ch (k) and Φ σh (k) represents the weight gradient, center gradient, and width gradient of the hth neuron; e(k) is the error vector generated by the network at the kth iteration based on the samples in the current sliding window; x represents the samples in the current sliding window; θ h (k) is the output vector of the h-th neuron at the k-th iteration based on the samples in the current sliding window, η w ,η c and η σ denote the learning rates of output weight, center and width respectively, η w ,η c and η σ The value range is [0.01,0.05].
[0048] The sliding window size is set to 50 during online learning of network parameters, and training is stopped when the training error reaches the expected error value of 0.05 or the maximum number of training times is 200.
[0049] Step 2.2.3: If H>3, calculate the similarity between neurons and the obtained similarity matrix is expressed as U=[U1,U2,…,U H ], where U1 represents the similarity matrix between the first neuron and all other neurons, U1=[μ 12 ,μ 13 ,…,μ 1h ,…,μ 1H ],μ 1h Represents the similarity between the first neuron and the hth neuron, calculated using formula (7). Each element in the matrix U represents the similarity between two neurons. Assume μ p1p2 = max(max(U)), that is, the similarity μ between neuron p1 and neuron p2 p1p2 is the maximum similarity between all neurons, and neuron p1 and neuron p2 are determined according to the following formula:
[0050]
[0051] If μ p1p2 >T0 (T0 is the merging threshold, which is 0.8), that is, the similarity between neurons p1 and p2 is greater than the preset merging threshold T0, then neurons p1 and p2 are merged. The parameters of the new neuron after the merger are set to:
[0052]
[0053] where c p1 ,c p2 ,σ p1 ,σp2 ,w p1 ,w p2 are the center, width and output weight of neurons p1 and p2 before merging; c p , σ p , w p are the center vector, width and output weight of the new neuron p after merging; Represent the sum of the outputs of the samples in the sliding window on neurons p1, p2 and the new neuron p after merging, and update H=H-1.
[0054] Step 2.2.4: If neuron merging is performed, the network parameters are learned using the learning algorithm designed in step 2.2.2 after the structural change;
[0055] Step 2.2.5: Every age max Time step to check the lifetime of the neuron 'age' and the similarity power of the neuron 'P', age max The value of is 40. Here, the lifespan of a neuron is defined as the number of samples that each neuron has experienced since its generation. The age of each neuron is 0 since its generation, and its age increases by 1 every time a new sample is input. The similarity ability of a neuron is defined as the number of times each neuron satisfies the similarity between the neuron and the sample is greater than its own similarity threshold, that is, every time it satisfies μ nh >T h (h=1,2,…,H), P increases by 1. When age reaches the maximum value age max But when P is 2 or less, it is regarded as a noise neuron and updated to H = H-1.
[0056] Step 2.2.6: If noise neuron removal is performed, after the structural change, use the learning algorithm designed in step 2.2.2 to read the network parameters for learning, and return to step 2.2.1 to learn the next sample;
[0057] Step 2.2.7: When the last sample is learned, stop.
[0058] Step 3: Effluent BOD prediction
[0059] The test sample data is used as the input of the self-organizing RBF neural network, and the output of the self-organizing RBF neural network is obtained, which is then denormalized to obtain the effluent BOD concentration.
[0060] 3. Compared with the prior art, the present invention has the following obvious advantages:
[0061] (1) Aiming at some problems existing in the effluent BOD in the current sewage treatment process, the present invention proposes a self-organizing RBF neural network model to achieve accurate prediction of the effluent BOD concentration, which has the characteristics of low cost and high efficiency.
[0062] (2) This paper introduces Gaussian membership into the self-organizing mechanism of the RBF neural network structure for the first time, designs a parameter-insensitive self-organizing RBF neural network model, and obtains a compact network structure. It also designs an online small-batch gradient learning algorithm to learn the network parameters, achieving fast and stable convergence performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a diagram of the internal structure of the neural network of the present invention;
[0064] Figure 2 This is a diagram showing the change in the root mean square error (RMSE) of the effluent BOD concentration prediction method training of the present invention;
[0065] Figure 3 This is a diagram showing the prediction results of the effluent BOD concentration according to the present invention;
[0066] Figure 4 It is the prediction error diagram of effluent BOD concentration of the present invention. DETAILED DESCRIPTION
[0067] The present invention designs an online soft measurement method for effluent BOD based on self-organizing RBFNN, which realizes the prediction of BOD concentration at future moments, solves the problem of difficulty in real-time measurement of effluent BOD concentration during sewage treatment, and improves the monitoring level of future water quality during sewage treatment.
[0068] The experimental data comes from water quality analysis data from a sewage treatment plant in Beijing. 365 sets of data were obtained. The input data features were selected as influent pH, effluent pH, influent suspended solids concentration, effluent suspended solids concentration, influent BOD concentration, influent chemical oxygen demand (COD) concentration, effluent COD concentration, sludge settling rate (SV), suspended solids concentration (MLSS), and dissolved oxygen concentration (DO). The output was effluent BOD concentration. The first 265 sets were selected as training samples, and the last 100 sets were selected as test samples. The main steps are as follows:
[0069] Step 1: Preprocessing of effluent BOD data
[0070] Select the input variable, record it as X={x np |p=1,2,…,P,n=1,2,…,N}, P is the input feature dimension, here P=10; N is the number of samples. np It is expressed as the pth feature of the nth data. The effluent BOD concentration is selected as the output variable, denoted as Y = {yn |n=1,2,…,N}, N is the number of samples, y n Represents the nth output sample. The obtained multi-feature data set is normalized so that the data indicators are at the same order of magnitude, eliminating the error in the soft measurement model caused by the large difference in the order of magnitude of the data.
[0071] Normalize the input variable X and output variable Y according to the following formula:
[0072]
[0073] X and Y represent normalized data, and their values range from [0, 1].
[0074] Step 2: Design the effluent BOD online soft-sensing model structure based on self-organizing RBFNN;
[0075] Step 2.1: Design the RBF neural network topology. RBF is a three-layer feedforward neural network consisting of an input layer, a hidden layer, and an output layer. The input layer, which imports samples into the network, contains 10 neurons. Initially, the hidden layer contains 2 neurons. H represents the number of neurons in the hidden layer. Initially, H = 2. The kernel function is a Gaussian function. The output of the hth neuron is:
[0076]
[0077] Where c h and σ h Represent the center and width vectors of the hth hidden layer neuron, c1=x1,c2=x2,σ1=1,σ2=1,x n Indicates the nth sample n≥3, ||x n -c h || represents x n and c h The Euclidean distance between them is calculated as
[0078]
[0079] The output layer has only one neuron, and the output of this neuron is the linear weighted output of the hidden layer neurons, expressed as:
[0080]
[0081] Where w h is the connection weight between the hth hidden layer neuron and the output neuron, w1=y1, w2=y2.
[0082] Step 2.2: Design a self-organizing RBF neural network
[0083] Step 2.2.1: For the current sample x n (n≥3), calculate the sample x n and the similarity μ between neurons h nh , μ nh The calculation formula is
[0084]
[0085] Here H is the number of neurons, c h is the center vector of neuron h.
[0086] Sample x n The similarity vector between all current neurons is recorded as U n , U n =[μ n1 ,μ n2 ,μ nh ,…,μ nH ](1≤h≤H), according to U n Find the maximum value of the elements in the sample x n The neuron h with the maximum similarity, After determining the maximum similarity neuron h, calculate the similarity threshold T of neuron h h , the similarity threshold T of neuron h h It is defined as the maximum similarity between neuron h and all current neurons.
[0087] First, the similarity between neuron h and all other neurons is calculated. For example, the similarity between neuron h and neuron h' (h'∈H\{h}) is calculated using formula (27), where h'∈H\{h} indicates that h' is the neuron other than the hth neuron among the H neurons.
[0088]
[0089] Here H is the number of neurons, c h is the center vector of neuron h, c h' is the center vector of neuron h'.
[0090] The similarity matrix between neuron h and all other neurons is denoted as U h ,U h =[μ h1 ,μ h2 ,μ hh' ,…,μ hH ](h'∈H\{h}). Similarity threshold T of neuron h h The calculation formula is T h =max(max(U h )).
[0091] Calculate the current root mean square error of the network according to the samples within the sliding window using formula (28). When n < L, the samples within the sliding window are the first sample to the nth sample, with a total of n samples; when n ≥ L, the samples within the sliding window are the (n - L + 1)th sample to the nth sample, and there are L samples within the sliding window.
[0092]
[0093] Where L represents the size of the sliding window, and the value range of L is [50, 100]. d i is the expected output of the network, y i is the actual output, and i indicates that the sample is the data within the sliding window.
[0094] Design the network addition criterion: If μ nh < T h , and E > E0, where E0 takes the value of 0.05. Add the current sample as a new neuron to the network, and the parameter settings are shown in formula (29):
[0095]
[0096] Where c H+1 , σ H+1 , w H+1 are respectively the center vector, width, and output weight of the newly added neuron H + 1, and d max is the maximum distance between the centers. e n H is the network error before the change of the RBFNN structure when the input is x <T , that is, the error when the network has H neurons, and it is calculated using formula (30). <00D0436>is the sum of the outputs of the H + 1 neurons in the hidden layer of the network when the input is x n after the addition of neurons, and θ h is calculated using formula (23). Update H = H + 1.
[0097]
[0098] Here y n is the actual output obtained by the network when there are H neurons in the case where the input is x n .
[0099] Step 2.2.2: Design the learning algorithm of the online soft sensor model for effluent BOD based on self-organizing RBFNN - online fixed small batch gradient algorithm. If the addition of neurons is performed and the parameters are learned after the structural change, define the loss function of the current network as:
[0100]
[0101] where d i is the expected output, y i is the actual output; The fixed batch size L is in the range [50, 100], and k is the number of iterations.
[0102] The output weight, neuron center, and neuron width parameters are trained using the following formula:
[0103] w h (k+1)=w h (k)-η w Φ wh (k) (32)
[0104] c h (k+1)=c h (k)-η c Φ ch (k) (33)
[0105] σ h (k+1)=σ h (k)-η σ Φ σh (k) (34)
[0106]
[0107] Wherein formula (32), formula (33) and formula (35) are the update iteration rules of output weight, neuron center and neuron width respectively; w h (k), c h (k) and σ h (k) represents the weight, center vector and width of the h-th neuron at the k-th iteration; Φ wh (k), Φ ch (k) and Φ σh (k) represents the weight gradient, center gradient, and width gradient of the hth neuron; e(k) is the error vector generated by the network at the kth iteration based on the samples in the current sliding window; x represents the samples in the current sliding window; θ h (k) is the output vector of the h-th neuron at the k-th iteration based on the samples in the current sliding window, η w ,η c and η σ denote the learning rates of output weight, center and width respectively, η w ,η c and η σ The value range is [0.01,0.05].
[0108] The sliding window size is set to 50 during online learning of network parameters, and training is stopped when the training error reaches the expected error value of 0.05 or the maximum number of training times is 200.
[0109] Step 2.2.3: If H>3, calculate the similarity between neurons and the obtained similarity matrix is expressed as U=[U1,U2,…,U H ], where U1 represents the similarity matrix between the first neuron and all other neurons, U1=[μ 12 ,μ 13 ,…,μ 1h ,…,μ 1H ],μ 1h Represents the similarity between the first neuron and the hth neuron, calculated using formula (7). Each element in the matrix U represents the similarity between two neurons. Assume μ p1p2 = max(max(U)), that is, the similarity μ between neuron p1 and neuron p2 p1p2 is the maximum similarity between all neurons, and neuron p1 and neuron p2 are determined according to the following formula:
[0110]
[0111] If μ p1p2 >T0 (T0 is the merging threshold, which is 0.8), that is, the similarity between neurons p1 and p2 is greater than the preset merging threshold T0, then neurons p1 and p2 are merged. The parameters of the new neuron after the merger are set to:
[0112]
[0113] where c p1 ,c p2 ,σ p1 ,σ p2 ,w p1 ,w p2 are the center, width and output weight of neurons p1 and p2 before merging; c p , σ p , w p are the center vector, width and output weight of the new neuron p after merging; Represent the sum of the outputs of the samples in the sliding window on neurons p1, p2 and the new neuron p after merging, and update H=H-1.
[0114] Step 2.2.4: If neuron merging is performed, the network parameters are learned using the learning algorithm designed in step 2.2.2 after the structural change;
[0115] Step 2.2.5: Every agemax Time step to check the lifetime of the neuron 'age' and the similarity power of the neuron 'P', age max The value of is 40. Here, the lifespan of a neuron is defined as the number of samples that each neuron has experienced since its generation. The age of each neuron is 0 since its generation, and its age increases by 1 every time a new sample is input. The similarity ability of a neuron is defined as the number of times each neuron satisfies the similarity between the neuron and the sample is greater than its own similarity threshold, that is, every time it satisfies μ nh >T h (h=1,2,…,H), P increases by 1. When age reaches the maximum value age max But when P is 2 or less, it is regarded as a noise neuron and updated to H = H-1.
[0116] Step 2.2.6: If noise neuron removal is performed, after the structural change, use the learning algorithm designed in step 2.2.2 to read the network parameters for learning, and return to step 2.2.1 to learn the next sample;
[0117] Step 2.2.7: When the last sample is learned, stop.
[0118] Step 3: Effluent BOD prediction
[0119] The test sample data is used as the input of the self-organizing RBF neural network, and the output of the self-organizing RBF neural network is obtained, which is then denormalized to obtain the effluent BOD concentration.
[0120] In this embodiment, the RMSE of the effluent BOD concentration prediction method training is as follows: Figure 2 As shown, the X-axis is the number of training samples, and the Y-axis is the value of training RMSE; the prediction results of effluent BOD concentration are shown in Figure 3 As shown, the X-axis is the number of test samples, the Y-axis is the effluent BOD concentration value, the unit is mg / L, the solid line is the expected output value of the effluent BOD concentration, and the dotted line is the actual output value of the effluent BOD concentration; the effluent BOD concentration test error is as follows Figure 4 As shown, the X-axis is the number of test samples, and the Y-axis is the prediction error of effluent BOD concentration, in mg / L.
Claims
1. An online soft measurement method for effluent BOD based on self-organizing RBFNN, characterized by: It includes the following steps: Step 1: Pretreatment of effluent BOD data Through the mechanism analysis of effluent BOD in the sewage treatment process, a total of 10 variables, including ① influent pH value, ② effluent pH value, ③ influent suspended solids concentration, ④ effluent suspended solids concentration, ⑤ influent BOD concentration, ⑥ influent chemical oxygen demand concentration COD, ⑦ effluent COD concentration, ⑧ sludge settling rate SV, ⑨ suspended solids concentration, and ⑩ dissolved oxygen concentration DO, are selected as the original feature set of effluent BOD, i.e., input variables, denoted as X = {x np |p=1,2,…,P,n=1,2,…,N}, P is the input feature dimension, here P=10; N is the number of samples; x np Represented as the pth feature of the nth data; The effluent BOD concentration is selected as the output variable, which is denoted as Y = {y n |n=1,2,…,N}, N is the number of samples, y n Represents the nth output sample; perform data normalization on the obtained multi-feature data set so that the data indicators are at the same order of magnitude, eliminating the error in the soft measurement model caused by the large difference in the order of magnitude of the data; The input variable X and the output variable Y are normalized according to the following formula: X and Y represent the data after normalization, and the value range is [0, 1]; Step 2: Design the online soft sensor model structure of effluent BOD based on self-organizing RBFNN; Step 2.1: Design the topology structure of the RBF neural network; RBF is a three-layer forward neural network, including an input layer, a hidden layer, and an output layer; the input layer imports samples into the network and contains 10 neurons; initially, the hidden layer of the network contains 2 neurons, and H represents the number of neurons in the hidden layer of the network. Initially, H = 2, and the neuron kernel function adopts the Gaussian function. The output of the h-th neuron is: Where c h and σ h Represent the center and width vectors of the hth hidden layer neuron, c1=x1,c2=x2,σ1=1,σ2=1,x n Indicates the nth sample n≥3, ||x n -c h || represents x n and c h The Euclidean distance between them is calculated as The output layer has only one neuron, and the output of this neuron is the linear weighting of the outputs of the hidden layer neurons, and the expression is: Where w h is the connection weight between the hth hidden layer neuron and the output neuron, w1 = y1, w2 = y2; Step 2.2: Design the self-organizing RBF neural network Step 2.2.1: For the current sample x n And n≥3, calculate the sample x n and the similarity μ between neurons h nh , μ nh The calculation formula is Here H is the number of neurons, c h is the center vector of neuron h; Sample x n The similarity vector between all current neurons is recorded as U n , U n =[μ n1 ,μ n2 ,μ nh ,…,μ nH ], 1≤h≤H, according to U n Find the maximum value of the elements in the sample x n The neuron h with the maximum similarity, After determining the maximum similarity neuron h, calculate the similarity threshold T of neuron h h , the similarity threshold T of neuron h h Defined as the maximum similarity between neuron h and all current neurons; First, use formula (7) to calculate the similarity between neuron h and neuron h', h' ∈ H\{h}', and h' is the neuron other than the h-th neuron among the H neurons; Here H is the number of neurons, c h is the center vector of neuron h, c h' is the center vector of neuron h'; The similarity matrix between neuron h and all other neurons is denoted as U h ,U h =[μ h1 ,μ h2 ,μ hh' ,…,μ hH ], h'∈H\{h}; similarity threshold T of neuron h h The calculation formula is T h =max(max(U h )); Use formula (8) to calculate the current root mean square error of the network according to the samples in the sliding window. When n < L, the samples in the sliding window are the first sample to the n-th sample, and there are n samples in total; when n ≥ L, the samples in the sliding window are the (n - L + 1)-th sample to the n-th sample, and there are L samples in the sliding window; Where L represents the size of the sliding window, and the value range of L is [50,100]; d i is the expected output of the network, y i is the actual output, i indicates that the sample is the data within the sliding window; Design network increase criterion: If μ nh <T h , and E>E0, E0 is 0.05; add the current sample as a new neuron to the network, and set the parameters as shown in formula (9): where c H+1 , σ H+1 , w H+1 are the center vector, width and output weight of the newly added neuron H+1, d max is the maximum distance between centers; e n H Before the RBFNN structure changes, the input is x n The network error when , that is, the error when the network has H neurons, is calculated using formula (10); After the neuron is added, the input is x n The sum of the outputs of the H+1 neurons in the hidden layer of the network, θ h Calculate using formula (3); update H = H + 1; Here y n The input is x n In the case of , the actual output obtained by the network when there are H neurons; Step 2.2.2: Design the learning algorithm of the online soft sensor model of effluent BOD based on self-organizing RBFNN - online fixed small batch gradient algorithm; If neuron addition is performed, after the structure change, learn the parameters. Define the loss function of the current network as: where d i is the expected output, y i is the actual output; The fixed batch size L ranges from [50,100], and k is the number of iterations; Use the following formula to train the output weight, neuron center, and neuron width parameters: Wherein formula (12), formula (13) and formula (14) are the update iteration rules of output weight, neuron center and neuron width respectively; h (k), c h (k) and σ h (k) represents the weight, center vector and width of the h-th neuron at the k-th iteration; Φ wh (k), Φ ch (k) and Φ σh (k) represents the weight gradient, center gradient, and width gradient of the hth neuron; e(k) is the error vector generated by the network at the kth iteration based on the samples in the current sliding window; x represents the samples in the current sliding window; θ h (k) is the output vector of the h-th neuron at the k-th iteration based on the samples in the current sliding window, η w ,η c and η σ denote the learning rates of output weight, center and width respectively, η w ,η c and η σ The value range is [0.01, 0.05]; When the network parameters are learned online, set the current fixed batch size to 50, and stop training when the training error reaches the expected error value of 0.05 or reaches the maximum training times of 200; Step 2.2.3: If H>3, calculate the similarity between neurons and the obtained similarity matrix is expressed as U=[U1,U2,…,U H ], where U1 represents the similarity matrix between the first neuron and all other neurons, U1=[μ 12 ,μ 13 ,…,μ 1h ,…,μ 1H ],μ 1h Represents the similarity between the first neuron and the hth neuron, calculated using formula (7); each element in the matrix U represents the similarity between two neurons, assuming μ p1p2 = max(max(U)), that is, the similarity μ between neuron p1 and neuron p2 p1p2 is the maximum similarity between all neurons, and neuron p1 and neuron p2 are determined according to the following formula: If μ p1p2 >T0, T0 is the merging threshold, which is 0.
8. That is, if the similarity between neurons p1 and p2 is greater than the preset merging threshold T0, neurons p1 and p2 are merged; the parameters of the new neuron after the merger are set to: where c p1 ,c p2 ,σ p1 ,σ p2 ,w p1 ,w p2 are the center, width and output weight of neurons p1 and p2 before merging; c p , σ p , w p are the center vector, width and output weight of the new neuron p after merging; Represent the sum of the outputs of the samples in the sliding window on neurons p1, p2 and the new neuron p after merging, and update H=H-1; Step 2.2.4: If neuron merging is performed, after the structure change, use the learning algorithm designed in Step 2.2.2 to learn the parameters of the network; Step 2.2.5: Every age max Time step to check the lifetime of the neuron 'age' and the similarity power of the neuron 'P', age max The value is 40; Here, the life span of a neuron is defined as the number of samples that each neuron has experienced since its generation. The age of each neuron is 0 since its generation, and its age increases by 1 every time a new sample is input; the similarity ability of a neuron is defined as the number of times each neuron satisfies the similarity between the neuron and the sample is greater than its own similarity threshold, that is, every time μ is satisfied nh >T h h=1,2,…,H, P plus 1; when age reaches the maximum value age max When P is 2 or less, it is regarded as a noise neuron and updated to H = H-1; Step 2.2.6: If noise neuron deletion is performed, after the structure change, use the learning algorithm designed in Step 2.2.2 to learn the parameters of the network, and return to Step 2.2.1 to learn the next sample; Step 2.2.7: When the learning of the last sample is completed, stop; Step 3: Prediction of effluent BOD Take the test sample data as the input of the self-organizing RBF neural network, obtain the output of the self-organizing RBF neural network, and perform anti-normalization on it to obtain the effluent BOD concentration.
Citation Information
Patent Citations
Spectral analysis method capable of measuring chemical oxygen demand and biochemical oxygen demand in waste water simultaneously
CN101907565A
Effluent BOD soft measurement method based on self-organization RBF neural network
CN108469507A