This application claims priority to Chinese Patent Application No. 202010964415.6, filed on Sep. 15, 2020, which is hereby incorporated by reference in its entirety and made a part of this specification.
In this disclosure, a computing method is established for realizing the total nitrogen intelligent detection by a fuzzy neural network with multi-objective particle swarm optimization algorithm. This method based on the multi-objective optimized fuzzy neural network can improve the generalization ability of the model by fully learning the multiple objective functions to enhance the prediction accuracy of total nitrogen. The method belongs to both the field of control engineer and environmental engineer, which is an important branch for the field of advanced manufacturing technology.
The serious water pollution has highlighted the problem of water shortage in the world, and it has become a problem that cannot be ignored to ensure the health and production of people. With the acceleration of the urbanization process, the demand for freshwater resources is increasing, resulting in an increasing amount of wastewater. However, wastewater is recognized as a stable freshwater resource. Its recycling can not only reduce the demand for natural water but also reduce the pollution of the environment, which is an indispensable measure to ensure the water cycle. World Water Development Report pointed out that the innovative technology was used to acquire knowledge by collecting and processing the water information and data, which will help to further improve water resources management. Therefore, the research results of wastewater treatment technology have broad application prospects.
With the improvement of wastewater treatment technology, the pollution of organic matter in the wastewater has been curbed, but the excessive discharge of nutrients such as nitrogen and phosphorus has caused serious water pollution. The increase of nitrogen content is one of the main factors that cause the deterioration of water quality and eutrophication. At the same time, the total nitrogen is also used as an evaluation indicator in many national standards. At present, wastewater treatment plants mainly detect total nitrogen concentration through chemical experiments. Although this method can guarantee accurate detection accuracy, it has high requirements on the operating environment and detection time, which requires a long detection time. However, the accurate and rapid detection of total nitrogen play a great significance in the prevention of water pollution and regeneration.
In order to achieve real-time and high-precision detection of total nitrogen, artificial neural networks have become a mainstream technology. The neural network with nonlinear approximation ability and learning ability can establish a nonlinear method of the wastewater treatment process, which provides a new method for wastewater detection. Hence, the novel method presented to realize the real-time and high-precision measurement has an important topic.
To solve the problem, the invention designed an intelligent detection method for total nitrogen based on multi-objective optimized fuzzy neural network. In this method, data can be automatically acquired and the total nitrogen concentration can be detected in real-time to improve the level of intelligence. The model adopt a multi-objective particle swarm optimization algorithm with global optimization capabilities to optimize the multi-level learning objectives of fuzzy neural network to adjust the parameters and structure, which can improve the generalization performance of the network. This method was able to realize the accurate detection of total nitrogen by improving the generalization ability, which can realize the actual demand of the wastewater treatment plant.
The invention proposed a total nitrogen intelligent detection method based on fuzzy neural network. This method used the least squares algorithm to extract feature variables to determine the main variables related to the total nitrogen and automatically collect data by transmission devices. Then, based on the multi-level learning objectives of fuzzy neural network, the multi-objective particle swarm algorithm was used to optimize the parameters and structure simultaneously. This method solved the problem of poor generalization ability and had better detection accuracy than traditional fuzzy neural networks.
The total nitrogen intelligent detection method includes the following steps: (1) Selecting input variables and collecting data by transmission devices, (2) Establishing an initial fuzzy neural network, (3) Training the fuzzy neural network based on multi-objective particle swarm optimization algorithm, (4) Total nitrogen concentration prediction.
(1) Selecting Input Variables and Collecting Data by Transmission Devices
Through the analysis of the wastewater treatment process, a least square method is used to extract feature variables; then, dosage, oxidation-reduction potential, orthophosphate, pH, ammonia nitrogen, nitrate-nitrogen and chemical oxygen demand are the feature variables that affect the total nitrogen concentration; each variable was measured by the dosage device, the oxidation-reduction potential sensor, the orthophosphate sensor, pH detector, the ammonia nitrogen sensor, the nitrate-nitrogen sensor and the chemical oxygen demand sensor, and then transmitted to the model of the computer by optical fiber communication network; where the dosage device is at an end of a second aerobic tank, the oxidation-reduction potential sensor in a middle of an anaerobic tank, the orthophosphate sensor at an end of the second aerobic tank, the pH detector in an inlet cell, the ammonia nitrogen sensor in the inlet cell, the nitrate-nitrogen sensor at the end of the first anoxic tank and the chemical oxygen demand sensor is at the end of a primary sedimentation tank; the sensors use probes to achieve variables concentration detection, and dosage device uses a flow meter to achieve detection; the feature variables are obtained by devices and normalized to [0, 1], and the total nitrogen concentration is normalized to [0, 1];
(2) Establishing an Initial Fuzzy Neural Network
A total nitrogen intelligent detection model based on fuzzy neural network contains four layers: an input layer, a membership function layer, a rule layer and an output layer; the fuzzy neural network is 7-P-Q-1, including 7 neurons in the input layer, P neurons in the membership function layer, Q neurons in the rule layer and a neurons in the output layer, P and Q are positive integers between [2, 15], and P=Q; the number of training samples is N, an input of the fuzzy neural network is x(n)=[x1(n), x2(n), . . . , x7(n)], x1(n) represents the dosage in nth sample; x2(n) represents the oxidation-reduction potential in the middle of anaerobic tank in nth sample, x3(n) represents the orthophosphate at the end of the second aerobic tank in nth sample, x4(n) represents pH in the inlet cell in nth sample, x5(n) represents the ammonia nitrogen in the inlet cell in nth sample, x6(n) represents the nitrate nitrogen at the end of the anoxic tank in nth sample, and x7 (n) represents the chemical oxygen demand of the primary sedimentation tank in nth sample, the output of fuzzy neural network is y(n) and the actual output is An), n=1, 2, . . . , N; the fuzzy neural network includes:
{circle around (1)} input layer: there are 7 neurons in the input layer, an output of the input layer is:
um(n)=xm(n), m=1, 2, . . . 7 (1)
where um(n) is mth output value, m=1, 2, . . . , 7;
{circle around (2)} membership function layer: there are P neurons in the membership function layer, an output of the membership function layer is:
where μmp(n) is a center of pth membership function neuron with mth input, σp(n) is the standard deviation of pth membership function neuron, φp(n) is the output value of pth membership function;
{circle around (3)} rule layer: there are Q neurons in the rule layer, and an output value of the rule layer is:
where ηq(n) is an output of qth neuron;
{circle around (4)} output layer: there is a neuron in the output layer, and an output value of the output layer is:
where y(n) is an output value of fuzzy neural network, wq(n) is connection weight between qth neuron in the rule layer and the output layer neuron.
(3) Training the Fuzzy Neural Network Based on Multi-Objective Particle Swarm Optimization Algorithm
{circle around (1)} In the fuzzy neural network, each variable in an initial center vector μq(1) is randomly selected in the interval [−1, 1], an initial width σq(1) is assigned to 1, q=1, 2, . . . , Q; each variable in an initial connection weight vector w(1) is randomly selected in the interval [−1, 1]; and set a current iteration number t=1.
{circle around (2)} Set maximum number of iterations is Tmax, Tmax ∈[200, 500]; the number of particles in a population of the multi-objective particle swarm optimization algorithm is L, L ∈[50, 150], and each particle represents a fuzzy neural network; maximum number of neurons in the rule layer is 15, so fixed maximum dimension of the particle is set to 135, and each particle is represented by a 135-dimensional row vector; position and velocity of lth particle can be expressed as:
al(1)=[μl,1(1), σl,1(1), wl,1(1), μl,2(1), σl,2(1), wl,2(1), . . . , μl,Q
vl(1)=[vl,1(1), vl,2(1), . . . , vl,9Q
where l=1, 2, . . . , L, al(1) represents a position vector of initial lth particle, μl,k(1), σl,k(1), wl,k(1) represent a center vector, width and connection weight of kth neuron in the fuzzy neural network rule layer corresponding to the initial lth particle, respectively, k=1, 2, . . . , Ql(1), Ql(1) is the number of rule layer neurons corresponding to the initial lth particle, vi(1) represents an initial velocity vector of the lth particle; an initial position vector al(1) is determined by parameters and structure of initial fuzzy neural network; each variable of the initial velocity vector vl(1) can take any value in [−0.5, 0.5]; initial effective dimension of the lth particle is 9Ql(1); when the effective particle dimension is less than 135, values of remaining dimensions are filled with 0 to ensure consistency of the particle dimensions in the population.
{circle around (3)} The objective functions of multi-objective particle swarm optimization algorithm include accuracy and complexity of the fuzzy neural network; the accuracy of the fuzzy neural network is represented by a root mean square error, so the designed objective function is:
where yl(n) is a predicted output value of the fuzzy neural network corresponding to the lth particle al(t), ŷ(n) is an actual output value of the training sample, and fl(al(t)) is a first objective function value corresponding to the particle al(t) at the tth iteration. In addition, the objective function based on structure complexity is designed as:
where Ql(t) is the number of neurons in the layer corresponding to the lth particle at the tth iteration,
{circle around (4)} According to the function values fl(al(t)) and f2(al(t)) of multi-objective particle swarm optimization algorithm, crowded distances of particles in an objective space and a decision space are as follows:
where SO(al(t)) is the crowded distance of the particle al(t) in the objective space at the tth iteration, and SD(al(t)) is the crowded distance of the particle al(t) in the decision space at the tth iteration; based on the diversity and convergence of particles, a global optimal particle is selected:
where GR(al(t)) is a comprehensive index value of particle al(t) in the population at the tth iteration, as well as S′O(al(t)) and S′D(al(t)) are respectively SO(al(t)) and SD(al(t)) normalized crowding distance; the particle al(t) with smallest GR(al(t)) value in the population is the global optimal particle at the tth iteration.
{circle around (5)} Update dth dimensional velocity and position of the particle is:
v
l,d(t+1)=ωvl,d(t)+c1r1(pl,d(t)−αl,d(t))+c2r2(gd(t)−αl,d(t)) (13)
αl,d(t+1)=αl,d(t)+vl,d(t+1) (14)
where vl,d(t) represents the dth dimensional velocity of the lth particle at the tth iteration, al,d(t) represents the dth dimensional position of the lth particle at the tth iteration, vl,d(t+1) and al,d(t+1) represent the dth dimensional velocity and position of the lth particle at the t+1 iteration, d=1, 2, . . . , 135; an extra particle dimension is set to 0; ω is a weight of inertia, ω can be arbitrarily selected in [0, 1], c1 is individual learning factors, and c1 is arbitrarily selected in [1.5, 2]; c2 is global learning factors, and c2 is arbitrarily selected in [1.5, 2]; r1 and r2 represent random values uniformly distributed between [0, 1], pl(t)=[pl,1(t), pl,2(t), . . . , pl,135(t)], pl(t) is the lth individual optimal particle at the tth iteration, g(t)=[g1(t), g2(t), . . . g135(t)], g(t) is the global optimal particle at the tth iteration.
{circle around (6)} If mod (t, 5)≠0 and t<Tmax, the number of iterations t will increase by 1, and go to step {circle around (3)}; if mod (t, 5)=0 and t<Tmax, go to step {circle around (7)}; if t=Tmax, stop training process; mod ( ) is the remainder operation.
{circle around (7)} Update rules of the fuzzy neural network structure are as follows:
when Qave(t)<Ql(t), h=−1; when Qave(t)=Ql(t), h=0; when Qave(t)>Ql(t), h=1; Qg(t) is the number of neurons in the rule layer corresponding to the global optimal particle g(t) at the tth iteration, i is the difference with the current iteration number, i=0, 1, . . . , 4, Ql(t+1) represents the number of neurons in the rule layer corresponding to the t+1 iteration of the lth particle.
{circle around (8)} If t<Tmax, the number of iterations t increase by 1, and go to step {circle around (3)}; if t=Tmax, stop the training process.
(4) Total Nitrogen Concentration Prediction
The dosage, the oxidation-reduction potential in the middle of the anaerobic tank, the orthophosphate at the end of the second aerobic tank, pH in the inlet cell, the ammonia nitrogen in the inlet cell, the nitrate-nitrogen at the end of the anoxic tank and the chemical oxygen demand of the primary sedimentation tank are used as the input of the detection model; then the output value of the detection model is got and anti-normalized it to obtain the detection value of the total nitrogen concentration.
In an embodiment, the transmission device is used to transmit the received real-time data information to the fuzzy neural network as input. The data sets in the sensors are transmitted to the computer through the optical fiber communication network, and the computer is sent to the detection model by the Ethernet to realize the detection of the total nitrogen concentration.
The novelties of this patent contain:
(1) Aiming at the long detection time of total nitrogen in the wastewater treatment process, the present invention proposed a total nitrogen intelligent detection method, which solved the problem through automatic collection technology and intelligent detection methods based on fuzzy neural network.
(2) Aiming at the problem that a single learning objective is difficult to improve the generalization ability of fuzzy neural network, the invention developed multi-level generalization indicators, which used the multi-level generalization indicators as the objective functions for constructing the parameters and structure to make up for the shortcomings of a single objective.
(3) According to the multi-level learning functions, the method used an improved multi-objective particle swarm optimization algorithm to optimize the parameters and structure, so that the constructed model had suitable training accuracy and network structure. The method designed the model from the perspective of improving the generalization ability to solve the problems, which achieved the low-cost and high-precision detection requirements of the wastewater treatment plant.
The detailed description is described with reference to the figures.
The experimental data comes from the wastewater treatment plant. The data sets include the dosage, the oxidation-reduction potential in the middle of the anaerobic tank, the orthophosphate at the end of the second aerobic tank, pH in the inlet cell, the ammonia nitrogen in the inlet cell, the nitrate-nitrogen at the end of the anoxic tank and the chemical oxygen demand of the primary sedimentation tank. After eliminating the abnormal experimental samples, there are 500 sets of available data, where 350 sets are used as training samples and the remaining 150 sets are used as test samples.
A total nitrogen intelligent detection method based on multi-objective optimized fuzzy neural network comprises the following steps: (1) Selecting Input Variables and Collecting Data by Transmission Devices
Through the analysis of the wastewater treatment process, a least square method is used to extract feature variables; then, dosage, oxidation-reduction potential, orthophosphate, pH, ammonia nitrogen, nitrate-nitrogen and chemical oxygen demand are the feature variables that affect the total nitrogen concentration; each variable was measured by the dosage device, the oxidation-reduction potential sensor, the orthophosphate sensor, pH detector, the ammonia nitrogen sensor, the nitrate-nitrogen sensor and the chemical oxygen demand sensor, and then transmitted to the model of the computer by optical fiber communication network; where the dosage device is at an end of a second aerobic tank, the oxidation-reduction potential sensor in a middle of an anaerobic tank, the orthophosphate sensor at an end of the second aerobic tank, the pH detector in an inlet cell, the ammonia nitrogen sensor in the inlet cell, the nitrate-nitrogen sensor at the end of the first anoxic tank and the chemical oxygen demand sensor is at the end of a primary sedimentation tank; the sensors use probes to achieve variables concentration detection, and dosage device uses a flow meter to achieve detection; the feature variables are obtained by devices and normalized to [0, 1], and the total nitrogen concentration is normalized to [0, 1];
(2) Establishing an Initial Fuzzy Neural Network
A total nitrogen intelligent detection model based on fuzzy neural network contains four layers: an input layer, a membership function layer, a rule layer and an output layer; the fuzzy neural network is 7-P-Q-1, including 7 neurons in the input layer, P neurons in the membership function layer, Q neurons in the rule layer and a neurons in the output layer, P and Q are positive integers between [2, 15], and P=Q; the number of training samples is N, an input of the fuzzy neural network is x(n)=[x1(n), x2(n), . . . , (n)], x1(n) represents the dosage in nth sample; x2(n) represents the oxidation-reduction potential in the middle of anaerobic tank in nth sample, x3(n) represents the orthophosphate at the end of the second aerobic tank in nth sample, x4(n) represents pH in the inlet cell in nth sample, x5(n) represents the ammonia nitrogen in the inlet cell in nth sample, x6(n) represents the nitrate nitrogen at the end of the anoxic tank in nth sample, and x7 (n) represents the chemical oxygen demand of the primary sedimentation tank in nth sample, the output of fuzzy neural network is y(n) and the actual output is ŷ(n), n=1, 2, . . . , N; the fuzzy neural network includes:
{circle around (1)} input layer: there are 7 neurons in the input layer, an output of the input layer is:
um(n)=xm(n), m=1, 2, . . . , 7 (1)
where umm(n) is mth output value, m=1, 2, . . . , 7;
{circle around (2)} membership function layer: there are P neurons in the membership function layer, an output of the membership function layer is:
where μmp(n) is a center ofpth membership function neuron with mth input, σp(n) is the standard deviation of pth membership function neuron, φp(n) is the output value of pth membership function;
{circle around (3)} rule layer: there are Q neurons in the rule layer, and an output value of the rule layer is:
where ηq(n) is an output of qth neuron;
{circle around (4)} output layer: there is a neuron in the output layer, and an output value of the output layer is:
where y(n) is an output value of fuzzy neural network, wq(n) is connection weight between qth neuron in the rule layer and the output layer neuron.
(3) Training the fuzzy neural network based on multi-objective particle swarm optimization algorithm
{circle around (1)} In the fuzzy neural network, each variable in an initial center vector μq(1) is randomly selected in the interval [−1, 1], an initial width σq(1) is assigned to 1, q=1, 2, . . . , Q; each variable in an initial connection weight vector w(1) is randomly selected in the interval [−1, 1]; and set a current iteration number t=1.
{circle around (2)} Set the maximum number of iterations is Tmax, Tmax ∈[200, 500]; the number of particles in a population of the multi-objective particle swarm optimization algorithm is L, L ∈ [50, 150], and each particle represents a fuzzy neural network; maximum number of neurons in the rule layer is 15, so fixed maximum dimension of the particle is set to 135, and each particle is represented by a 135-dimensional row vector; position and velocity of lth particle can be expressed as:
al(1)=[μl,1(1), σl,1(1), wl,1(1), μl,2(1), σl,2(1), wl,2(1), . . . , μl,Q
vl(1)=[vl,1(1), vl,2(1), . . . , vl,9Q
where l=1, 2, . . . , L, al(1) represents a position vector of initial lth particle, μl,k(1), σl,k(1), wl,k(1) represent a center vector, width and connection weight of kth neuron in the fuzzy neural network rule layer corresponding to the initial lth particle, respectively, k=1, 2, . . . , Ql(1), Ql(1) is the number of rule layer neurons corresponding to the initial lth particle, vl(1) represents an initial velocity vector of the lth particle; an initial position vector al(1) is determined by parameters and structure of initial fuzzy neural network; each variable of the initial velocity vector vl(1) can take any value in [−0.5, 0.5]; initial effective dimension of the lth particle is 9Ql(1); when the effective particle dimension is less than 135, values of remaining dimensions are filled with 0 to ensure consistency of the particle dimensions in the population.
{circle around (3)} The objective functions of multi-objective particle swarm optimization algorithm include: accuracy and complexity of the fuzzy neural network; the accuracy of the fuzzy neural network is represented by a root mean square error, so the designed objective function is:
where yl(n) is a predicted output value of the fuzzy neural network corresponding to the lth particle al(t), ŷ(n) is an actual output value of the training sample, and fl(al(t)) is a first objective function value corresponding to the particle al(t) at the tth iteration. In addition, the objective function based on structure complexity is designed as:
where Ql(t) is the number of neurons in the layer corresponding to the lth particle at the tth iteration, ŷ is average output value of the N training samples, f2(al(t)) is a second objective function value corresponding to the particle al(t) at the tth iteration.
{circle around (4)} According to the function values f1(al(t)) and f2(al(t)) of multi-objective particle swarm optimization algorithm, crowded distances of particles in an objective space and a decision space are as follows:
where SO(al(t)) is the crowded distance of the particle al(t) in the objective space at the tth iteration, and SD(al(t)) is the crowded distance of the particle al(t) in the decision space at the tth iteration; based on the diversity and convergence of particles, a global optimal particle is selected:
where GR(al(t)) is a comprehensive index value of particle al(t) in the population at the tth iteration, as well as S′O(al(t)) and S′D(al(t)) are respectively SO(al(t)) and SD(al(t)) normalized crowding distance; the particle al(t) with smallest GR(al(t)) value in the population is the global optimal particle at the tth iteration.
{circle around (5)} Update dth dimensional velocity and position of the particle is:
v
l,d(t+1)=ωvl,d(t)+c1r1(pl,d(t)−αl,d(t))+c2r2(gd(t)−αl,d(t)) (13)
αl,d(t+1)=αl,d(t)+vl,d(t+1) (14)
where vl,d(t) represents the dth dimensional velocity of the lth particle at the tth iteration, αl,d(t) represents the dth dimensional position of the lth particle at the tth iteration, vl,d(t+1) and αl,d(t+1) represent the dth dimensional velocity and position of the lth particle at the t+1 iteration, d=1, 2, . . . , 135; an extra particle dimension is set to 0; ω is a weight of inertia, co can be arbitrarily selected in [0, 1], c1 is individual learning factors, and c1 is arbitrarily selected in [1.5, 2]; c2 is global learning factors, and c2 is arbitrarily selected in [1.5, 2]; r1 and r2 represent random values uniformly distributed between [0, 1], pl(t)=[pl,1(t), pl,2(t), . . . , pl,135(t)], pl(t) is the lth individual optimal particle at the tth iteration, g(t)=[g1(t), g2(t), . . . , g135(t)], g(t) is the global optimal particle at the tth iteration.
{circle around (6)} If mod (t, 5)≠0 and t<Tmax, the number of iterations t will increase by 1, and go to step {circle around (3)}; if mod (t, 5)=0 and t<Tmax, go to step {circle around (7)}; if t=Tmax, stop training process; mod ( ) is the remainder operation.
{circle around (7)} Update rules of the fuzzy neural network structure are as follows:
when Qave(t)<Ql(t), h=−1; when Qave(t)=Ql(t), h=0; when Qave(t)>Ql(t), h=1; Qg(t) is the number of neurons in the rule layer corresponding to the global optimal particle g(t) at the tth iteration, i is the difference with the current iteration number, i=0, 1, . . . , 4, Ql(t+1) represents the number of neurons in the rule layer corresponding to the t+1 iteration of the lth particle.
{circle around (8)} If t<Tmax, the number of iterations t increase by 1, and go to step {circle around (3)}; if t=Tmax, stop the training process.
(4) Total Nitrogen Concentration Prediction
{circle around (1)} The training results of the total nitrogen intelligent detection method are shown in
{circle around (2)} The trained total nitrogen intelligent detection model has been detected. The test result of the intelligent detection method is shown in
Tables 1-16 show the data in this present disclosure. Training samples and testing samples are provided as follows.
Number | Date | Country | Kind |
---|---|---|---|
202010964415.6 | Sep 2020 | CN | national |