Intelligent Detection System of Effluent Total Nitrogen based on Fuzzy Transfer Learning Algorithm

20220267169 · 2022-08-25

    Inventors

    Cpc classification

    International classification

    Abstract

    An intelligent detection system of effluent total nitrogen (TN) based on fuzzy transfer learning algorithm belongs to the field of intelligent detection technology. To detect the TN concentration, the artificial neural network can be used to model wastewater treatment process due to the nonlinear approximation ability and learning ability. However, wastewater treatment process has the characteristic of time-varying dynamics and external disturbance, artificial neural network prediction method cannot acquire sufficient data to ensure the accuracy of TN prediction, and data loss and data deficiency will make the prediction model invalid. The invention proposed an intelligent detection system of effluent total nitrogen based on fuzzy transfer learning algorithm; the proposed system contains several functional modules, including detection instrument, data acquisition, data storage and TN prediction. For the TN prediction module, the fuzzy transfer learning algorithm build the fuzzy neural network based intelligent prediction model, which the parameters are adjusted by the transfer learning method.

    Claims

    1. An intelligent detection system of effluent total nitrogen (TN) based on fuzzy transfer learning algorithm, its characteristic is that The detection instrument contains ammonia nitrogen (NH.sub.4-N) detector, nitrate nitrogen (NO.sub.3-N) detector, suspended solids (SS) concentration detector, biochemical oxygen demand (BOD) detector and total phosphorus (TP) detector; the detection instruments are connected with programmable logic controller; the programmable logic controller is connected with data processing module by the fieldbus; the variables of wastewater treatment process are analyzed by Principal Component Analysis, and the input variables of TN prediction model are selected as: NH.sub.4-N, NO.sub.3-N, SS, BOD, TP, The output value of TN prediction model is the TN values; the data processing module is connected with data storage module by the fieldbus; the data storage module is connected with TN prediction module using communication interface; The TN prediction module comprise the following steps: (1) Establish prediction model of effluent TN based on fuzzy-neural-network The structure of fuzzy-neural-network contains four layers: input layer, membership function layer, rule layer and output layer, the network is 5-10-10-1, including 5 neurons in input layer, 10 neurons in membership function layer, 10 neurons in rule layer and 1 neurons in output layer; connecting weights between input layer and membership function layer are assigned as 1, connecting weights between membership layer and rule function layer are assigned 1, connecting weights between rule layer and output layer are randomly initialized in [−1, 1]; the number of the training sample of prediction model is T, the input of fuzzy-neural-network prediction model is o(t)=[o.sup.1(t), o.sup.2(t), o.sup.3(t), o.sup.4(t), o.sup.5 (t)] at time t, o.sup.l(t) represents NH.sub.4-N concentration at time t; o.sup.2(t) represents NO.sub.3-N concentration at time t, o.sup.3(t) represents SS concentration at time t, o.sup.4(t) represents BOD value at time t, and o.sup.5(t) represents TP concentration at time t, the output of fuzzy neural network is y(t) and the actual output is y.sub.d(t); fuzzy-neural-network prediction model includes: 1) Input layer: there are 5 neurons in this layer, the output is:
    x.sup.p(t)=o.sup.p(t),  (1) where x.sup.p(t) is the pth output value of input neuron at time t, t=1, T, p=1, . . . , 5, 2) Membership function layer: there are 10 neurons in membership function layer, the output of membership function neuron is: φ k ( t ) = .Math. p = 1 5 exp ( - ( x p ( t ) - c p k ( t ) ) 2 2 ( σ p k ( t ) ) 2 ) , ( 2 ) where ϕ.sup.k(t) is the kth output value of membership function neuron at time t, k=1, . . . , 10, c.sup.pk(t) is the pth center of the kth membership function neuron at time t, which is randomly initialized in [−1, 1]; σ.sup.pk(t) is the pth width of the kth membership function neuron at time t, which is randomly initialized in [−1, 1]; 3) Rule layer: there are 10 neurons in this layer, and the output of rule neuron is: v k ( t ) = φ k ( t ) .Math. k = 1 10 φ k ( t ) , ( 3 ) where v.sup.k(t) is the kth output value of rule neuron at time t; 4) Output layer: the output of output neuron is: y ( t ) = .Math. k = 1 1 0 w k ( t ) v k ( t ) , ( 4 ) where y(t) is the output of fuzzy-neural-network prediction model at time t, w.sup.k(t) is the connecting weight between kth rule neuron and output neuron; (2) Establish the reference model of effluent TN to acquire knowledge The structure of reference model is same as the prediction model, the number of the training sample of reference model is N; 1) Construct the reference model: y Z ( n ) = .Math. k = 1 1 0 w Z k ( n ) .Math. p = 1 5 exp ( - ( x Z p ( n ) - c Z p k ( n ) ) 2 2 ( σ Z p k ( n ) ) 2 ) .Math. k = 1 1 0 .Math. p = 1 5 exp ( - ( x Z p ( n ) - c Z p k ( n ) ) 2 2 ( σ Z p k ( n ) ) 2 ) , ( 5 ) where y.sub.Z(n) is the output of fuzzy neural network reference model at time n, n=1, . . . , N,w.sub.Z.sup.k(n) is the connecting weight between kth rule neuron and output neuron at time n, which is randomly initialized in [0, 1], c.sub.Z.sup.pk(n) is the pth center of the kth membership function neuron at time n, which is randomly initialized in [−1, 1], σ.sub.Z.sup.pk(n) is the pth width of the kth membership function neuron at time n, which is randomly initialized in [−1, 1]; 2) Leverage gradient descent algorithm to train the reference model; the center, width and weight of the reference model are updated as: E ( n ) = 1 2 ( y Z ( n ) - y Z d ( n ) ) 2 , ( 6 ) c Z p k ( n + 1 ) = c Z p k ( n ) - λ E ( n ) c Z p k ( n ) , ( 7 ) σ Z p k ( n + 1 ) = σ Z p k ( n ) - λ E ( n ) σ Z p k ( n ) , ( 8 ) w Z k ( n + 1 ) = w Z k ( n ) - λ E ( n ) w Z k ( n ) , ( 9 ) where E(n) is the objection function of reference model at time n, y.sub.Zd(n) is the desired output of reference model at time n, 2 is the learning rate of gradient descent algorithm, which is randomly initialized in [0;01, 0;1]; 3) Compute E(n+1) using equation (6), if n<N or E(n+1)>0;01, n=n+1, go to step {circumflex over (2)}; else stop the training process, given c.sub.Z.sup.pk(n), σ.sub.Z.sup.pk(n), w.sub.Z.sup.k(n) to the reference model; 4) Acquire parameter knowledge from the reference model; the parameter knowledge can be given as
    k.sub.Z.sup.k(n)=[c.sub.Z.sup.1k(n), . . . , c.sub.Z.sup.Pk(n), σ.sub.Z.sup.1k(n), . . . , σ.sub.Z.sup.Pk(n), w.sub.Z.sup.k(n)].sup.T,  (10) where k.sub.Z.sup.k(n) is the kth parameter knowledge extracted from reference model at time n, K.sub.Z(n)=[k.sub.Z.sup.1(n).sup.T, . . . , k.sub.Z.sup.10(n).sup.T].sup.T is the parameter knowledge extracted from reference model at time n; (3) Leverage parameter knowledge and data to train prediction model; 1) Adjust parameter knowledge using particle filter algorithm; particle filter algorithm consists of three steps: knowledge sampling, knowledge evaluation and knowledge fusion; the knowledge sampling process is
    K.sub.l(t)=K.sub.Z(n)+δ.sub.l(t),  (11) where K.sub.l(t) is the lth sampling knowledge, l=1, . . . , L, L=30 is the number of sampling, δ.sub.l(t) is the random sampling vector, which is randomly initialized in [0, 1]; knowledge evaluation includes two indexes of knowledge matching degree and knowledge diversity, which are expressed as
    ω.sub.l(t)=1−e.sup.−(D.sup.l.sup.(t)+M.sup.l.sup.(t)).sup.2,  (12)
    M.sub.l(t)=e.sup.−(y(K.sup.l.sup.(t),o(t))−y.sup.d.sup.(t)).sup.2,  (13)
    D.sub.l(t)=e.sup.−cos(K.sup.l.sup.(t),K.sup.Z.sup.(n)),  (14) where ω(t) is the importance weight of the lth sampling knowledge at time t, M.sub.l(t) is the knowledge matching degree between lth sampling knowledge and the training data at time t, y(K.sub.l(t), o(t)) is the output of prediction model with K.sub.l(t) as parameter at time t, y.sub.d(t) is the desired output of prediction model at time t, D.sub.l(t) is the knowledge diversity of lth sampling knowledge at time t; based on the sampling knowledge and importance weight, the knowledge fusion process can be expressed as K R ( t ) = .Math. l = 1 L K l ( t ) .Math. ω l ( t ) , ( 15 ) where K.sub.R(t)=[k.sub.R.sup.1(t).sup.T, . . . , k.sub.R.sup.10(t).sup.T].sup.T is the reconstruction knowledge at time t, k.sup.k.sub.R (t) is the kth reconstruction knowledge
    k.sub.R.sup.k(t)=[c.sub.R.sup.1k(t), . . . , c.sub.R.sup.pk(t), . . . , c.sub.R.sup.Pk(t), σ.sub.R.sup.1k(t), . . . , σ.sub.R.sup.pk(t), . . . , σ.sub.R.sup.Pk(t), w.sub.R.sup.k(t)].sup.T.  (16) 2) Leverage reconstruction knowledge and data to adjust the parameters of prediction model; The objective function of the prediction model is E K D ( t ) = α ( t ) e ( t ) 2 + β ( t ) .Math. k = 1 1 0 ( w k ( t ) - w R k ( t ) ) 2 .Math. p = 1 5 ( c pk ( t ) - c R pk ( t ) ) 2 + ( σ pk ( t ) - σ R pk ( t ) ) 2 , ( 17 ) where E.sup.KD(t) is the objection function of prediction model at time t, e(t)=y(t)−y.sub.d(t) is the output error of prediction model at time t; α(t)∈(0;5, 1] and β(t)∈(0, 0;1] are balancing parameter, the updating process of c.sup.pk(t), σ.sup.pk(t), w.sup.k(t), α(t) and β(t) are c p k ( t + 1 ) = c p k ( t ) - λ E K D ( t ) c p k ( t ) , ( 18 ) σ p k ( t + 1 ) = σ p k ( t ) - λ E K D ( t ) σ p k ( t ) , ( 19 ) w k ( t + 1 ) = w k ( t ) - λ E K D ( t ) w k ( t ) , ( 20 ) α ( t + 1 ) = α ( t ) - λ E K D ( t ) α ( t ) , ( 21 ) β ( t + 1 ) = β ( t ) - λ E K D ( t ) β ( t ) , ( 22 ) 3) Compute E.sup.KD(t+1) using equation (17), if t<Q or E.sup.KD(t+1)>0.01, t=t+1, go to step 2); else stop the training process, given c.sup.pk(t), σ.sup.pk(t), w.sup.k(t) to the prediction model; (4) Effluent total nitrogen TN concentration prediction; The number of the testing samples is M; the testing samples are used as the input of prediction model, the output of prediction model is the soft-computing values of TN concentration.

    Description

    DESCRIPTION OF DRAWINGS

    [0039] FIG. 1 is the structure of intelligent detection system

    [0040] FIG. 2 is the algorithm of fuzzy transfer algorithm

    [0041] FIG. 3 is the structure of fuzzy neural network

    [0042] FIG. 4 is the prediction result diagram of the TN concentration

    [0043] FIG. 5 is the prediction error diagram of the TN concentration

    DETAILED DESCRIPTION OF THE INVENTION

    [0044] The experimental data come from the 2017 water quality data analysis report of a wastewater treatment plant. Where the actual testing data about NH.sub.4-N, NO.sub.3-N, SS, BOD, TP are selected for the experimental sample data. There are 400 groups data are available after eliminate the abnormal, where 5000 history samples are selected as the reference dataset and 4000 current samples are selected as the prediction dataset. For the prediction dataset, 2000 samples are used for training prediction model and 2000 samples are used for testing prediction model.

    [0045] 1. An intelligent detection system of effluent total nitrogen (TN) based on fuzzy transfer learning algorithm, its characteristic is that

    [0046] The hardware includes several functional modules, including detection instrument, data acquisition, data processing, data storage and TN prediction, which can be seen in FIG. 1;

    [0047] the detection instrument contains ammonia nitrogen (NH.sub.4-N) detector, nitrate nitrogen (NO.sub.3-N) detector, suspended solids (SS) concentration detector, biochemical oxygen demand (BOD) detector and total phosphorus (TP) detector; the detection instruments are connected with programmable logic controller to realize data acquiring;

    [0048] the programmable logic controller is connected with data processing module to realize feature selection of TN; wherein the data processing module use Principal Component Analysis to select a group of auxiliary variable which is closely related to the TN; the input variables of TN prediction model are selected as: NH.sub.4-N, NO.sub.3-N, SS, BOD, TP, The output value of TN prediction model is the TN values, the units are mg/l;

    [0049] the data processing module is connected with data storage module;

    [0050] the data storage module is connected with TN prediction module using communication interface;

    [0051] the TN prediction module comprise the following steps: first, the algorithm use the fuzzy neural network to establish the reference model and prediction model of effluent TN. Then, the parameter knowledge is obtained through the reference model and the particle filter algorithm is designed to correct the parameter knowledge. In the end, the parameters of the prediction model are adjusted by using the parameter knowledge and data of the wastewater treatment process to realize online TN prediction, which can be seen in FIG. 2;

    [0052] (1) Establish Prediction Model of Effluent TN Based on Fuzzy-Neural-Network

    [0053] The structure of fuzzy-neural-network contains four layers: input layer, membership function layer, rule layer and output layer, which can be seen in FIG. 3; the network is 5-10-10-1, including 5 neurons in input layer, 10 neurons in membership function layer, 10 neurons in rule layer and 1 neurons in output layer; connecting weights between input layer and membership function layer are assigned as 1, connecting weights between membership layer and rule function layer are assigned 1, connecting weights between rule layer and output layer are randomly initialized in [−1, 1]; the number of the training sample of prediction model is T, the input of fuzzy-neural-network prediction model is o(t)=[o.sup.1(t), o.sup.2(t), o.sup.3(t), o.sup.4(t), o.sup.5(t)] at time t, o.sup.1(t) represents NH.sub.4-N concentration at time t; o.sup.2(t) represents NO.sub.3-N concentration at time t, o.sup.3(t) represents SS concentration at time t, o.sup.4(t) represents BOD value at time t, and o.sup.5(t) represents TP concentration at time t, the output of fuzzy neural network is y(t) and the actual output is y.sub.d(t); fuzzy-neural-network prediction model includes:

    [0054] 1) Input layer: there are 5 neurons in this layer, the output is:


    x.sup.p(t)=o.sup.p(t),  (1)

    where x.sup.p(t) is the pth output value of input neuron at time t, t=1, . . . , T, p=1, . . . , 5,

    [0055] 2) Membership function layer: there are 10 neurons in membership function layer, the output of membership function neuron is:

    [00009] φ k ( t ) = .Math. p = 1 5 exp ( - ( x p ( t ) - c p k ( t ) ) 2 2 ( σ p k ( t ) ) 2 ) , ( 2 )

    where φ.sup.k(t) is the kth output value of membership function neuron at time t, k=1, . . . , 10, c.sup.pk(t) is the pth center of the kth membership function neuron at time t, which is randomly initialized in [−1, 1]; σ.sup.pk(t) is the pth width of the kth membership function neuron at time t, which is randomly initialized in [−1, 1];

    [0056] 3) Rule layer: there are 10 neurons in this layer, and the output of rule neuron is:

    [00010] v k ( t ) = φ k ( t ) .Math. k = 1 10 φ k ( t ) , ( 3 )

    where v.sup.k(t) is the kth output value of rule neuron at time t;

    [0057] 4) Output layer: the output of output neuron is:

    [00011] y ( t ) = .Math. k = 1 1 0 w k ( t ) v k ( t ) , ( 4 )

    where y(t) is the output of fuzzy-neural-network prediction model at time t, w.sup.k(t) is the connecting weight between kth rule neuron and output neuron;

    [0058] (2) Establish the reference model of effluent TN to acquire knowledge

    [0059] The structure of reference model is same as the prediction model, the number of the training sample of reference model is N;

    [0060] 1) Construct the reference model:

    [00012] y Z ( n ) = .Math. k = 1 1 0 w Z k ( n ) .Math. p = 1 5 exp ( - ( x Z p ( n ) - c Z p k ( n ) ) 2 2 ( σ Z p k ( n ) ) 2 ) .Math. k = 1 1 0 .Math. p = 1 5 exp ( - ( x Z p ( n ) - c Z p k ( n ) ) 2 2 ( σ Z p k ( n ) ) 2 ) , ( 5 )

    where y.sub.Z(n) is the output of fuzzy neural network reference model at time n, n=1, . . . , N, w.sub.Z.sup.k(n) is the connecting weight between kth rule neuron and output neuron at time n, which is randomly initialized in [0, 1], c.sub.Z.sup.pk(n) is the pth center of the kth membership function neuron at time n, which is randomly initialized in [−1, 1], σ.sub.Z.sup.pk(n) is the pth width of the kth membership function neuron at time n, which is randomly initialized in [−1, 1];

    [0061] 2) Leverage gradient descent algorithm to train the reference model; the center, width and weight of the reference model are updated as:

    [00013] E ( n ) = 1 2 ( y Z ( n ) - y Z d ( n ) ) 2 , ( 6 ) c Z p k ( n + 1 ) = c Z p k ( n ) - λ E ( n ) c Z p k ( n ) , ( 7 ) σ Z p k ( n + 1 ) = σ Z p k ( n ) - λ E ( n ) σ Z p k ( n ) , ( 8 ) w Z k ( n + 1 ) = w Z k ( n ) - λ E ( n ) w Z k ( n ) , ( 9 )

    where E(n) is the objection function of reference model at time n, y.sub.Zd(n) is the desired output of reference model at time n, λ is the learning rate of gradient descent algorithm, which is randomly initialized in [0;01, 0;1];

    [0062] 3) Compute E(n+1) using equation (6), if n<N or E(n+1)>0;01, n=n+1, go to step {circumflex over (2)}; else stop the training process, given c.sub.Z.sup.pk(n), σ.sub.Z.sup.pk(n), w.sub.Z.sup.k(n) to the reference model;

    [0063] 4) Acquire parameter knowledge from the reference model; the parameter knowledge can be given as


    k.sub.Z.sup.k(n)=[c.sub.Z.sup.1k(n), . . . , c.sub.Z.sup.Pk(n), σ.sub.Z.sup.1k(n), . . . , σ.sub.Z.sup.Pk(n), w.sub.Z.sup.k(n)].sup.T,  (10)

    where k.sub.Z.sup.k(n) is the kth parameter knowledge extracted from reference model at time n, K.sub.Z(n)=[k.sub.Z.sup.1(n).sup.T, . . . , k.sub.Z.sup.10(n).sup.T].sup.T is the parameter knowledge extracted from reference model at time n;

    [0064] (3) Leverage parameter knowledge and data to train prediction model;

    [0065] 1) Adjust parameter knowledge using particle filter algorithm; particle filter algorithm consists of three steps: knowledge sampling, knowledge evaluation and knowledge fusion; the knowledge sampling process is


    K.sub.l(t)=K.sub.Z(n)+δ.sub.l(t),  (11)

    where K.sub.l(t) is the lth sampling knowledge, l=1, . . . , L, L=30 is the number of sampling, δ.sub.l(t) is the random sampling vector, which is randomly initialized in [0, 1]; knowledge evaluation includes two indexes of knowledge matching degree and knowledge diversity, which are expressed as


    ω.sub.l(t)=1−e.sup.−(D.sup.l.sup.(t)+M.sup.l.sup.(t)).sup.2,  (12)


    M.sub.l(t)=e.sup.−(y(K.sup.l.sup.(t),o(t))−y.sup.d.sup.(t)).sup.2,  (13)


    D.sub.l(t)=e.sup.−cos(K.sup.l.sup.(t),K.sup.Z.sup.(n)),  (14)

    where ω.sub.l(t) is the importance weight of the lth sampling knowledge at time t, M.sub.l(t) is the knowledge matching degree between lth sampling knowledge and the training data at time t, y(K.sub.l(t), o(t)) is the output of prediction model with K.sub.l(t) as parameter at time t, y.sub.d(t) is the desired output of prediction model at time t, D.sub.l(t) is the knowledge diversity of lth sampling knowledge at time t; based on the sampling knowledge and importance weight, the knowledge fusion process can be expressed as

    [00014] K R ( t ) = .Math. l = 1 L K l ( t ) .Math. ω l ( t ) , ( 15 )

    where K.sub.R(t)=[k.sub.R.sup.1(t).sup.T, . . . , k.sub.R.sup.10(t).sup.T].sup.T is the reconstruction knowledge at time t, k.sub.R.sup.k(t) is the kth reconstruction knowledge


    k.sub.R.sup.k(t)=[c.sub.R.sup.1k(t), . . . , c.sub.R.sup.pk(t), . . . , c.sub.R.sup.Pk(t), σ.sub.R.sup.1k(t), . . . , σ.sub.R.sup.pk(t), . . . , σ.sub.R.sup.Pk(t), w.sub.R.sup.k(t)].sup.T.  (16)

    [0066] 2) Leverage reconstruction knowledge and data to adjust the parameters of prediction model; The objective function of the prediction model is

    [00015] E K D ( t ) = α ( t ) e ( t ) 2 + β ( t ) .Math. k = 1 1 0 ( w k ( t ) - w R k ( t ) ) 2 .Math. p = 1 5 ( c pk ( t ) - c R pk ( t ) ) 2 + ( σ pk ( t ) - σ R pk ( t ) ) 2 , ( 17 )

    where E.sup.KD(t) is the objection function of prediction model at time t, e(t)=y(t)−y.sub.d(t) is the output error of prediction model at time t; α(t)∈(0;5, 1] and β(t)∈(0, 0;11 are balancing parameter, the updating process of c.sup.pk(t), σ.sup.pk(t), w.sup.k(t), α(t) and β(t) are

    [00016] c p k ( t + 1 ) = c p k ( t ) - λ E K D ( t ) c p k ( t ) , ( 18 ) σ p k ( t + 1 ) = σ p k ( t ) - λ E K D ( t ) σ p k ( t ) , ( 19 ) w k ( t + 1 ) = w k ( t ) - λ E K D ( t ) w k ( t ) , ( 20 ) α ( t + 1 ) = α ( t ) - λ E K D ( t ) α ( t ) , ( 21 ) β ( t + 1 ) = β ( t ) - λ E K D ( t ) β ( t ) , ( 22 )

    [0067] 3) Compute E.sup.KD(t+1) using equation (17), if t<Q or E.sup.KD(t+1)>0.01, t=t+1, go to step 2); else stop the training process, given c.sup.pk(t), σ.sup.pk(t), w.sup.k(t) to the prediction model;

    [0068] (4) Effluent total nitrogen TN concentration prediction;

    [0069] The number of the testing samples is M; the testing samples are used as the input of prediction model, the output of prediction model is the soft-computing values of TN concentration; the testing results are shown in FIG. 4 and FIG. 5, FIG. 4 is the prediction result diagram of the TN concentration, FIG. 5 is the prediction error diagram of the TN concentration.