Pai 2011
Pai 2011
a r t i c l e i n f o a b s t r a c t
Article history: In this study, three types of adaptive neuro fuzzy inference system (ANFIS) were employed
Received 22 April 2009 to predict effluent suspended solids (SSeff), chemical oxygen demand (CODeff), and pHeff
Received in revised form 17 December 2010 from a wastewater treatment plant in industrial park. For comparison, artificial neural net-
Accepted 11 January 2011
work (ANN) was also used. The results indicated that ANFIS statistically outperformed ANN
Available online 22 January 2011
in terms of effluent prediction. The minimum mean absolute percentage errors of 2.67%,
2.80%, and 0.42% for SSeff, CODeff, and pHeff could be achieved using ANFIS. The maximum
Keywords:
values of correlation coefficient for SSeff, CODeff, and pHeff were 0.96, 0.93, and 0.95, respec-
Adaptive neuro fuzzy inference system
Artificial neural network
tively. The minimum mean square errors of 0.19, 2.25, and 0.00, and the minimum root
Biological wastewater treatment plant mean square errors of 0.43, 1.48, and 0.04 for SSeff, CODeff, and pHeff could also be achieved.
Conventional activated sludge process ANFIS’s architecture can overcome the limitations of traditional neural network. It also
Industrial park revealed that the influent indices could be applied to the prediction of effluent quality.
Ó 2011 Elsevier Inc. All rights reserved.
1. Introduction
Wastewater treatment becomes more important in Taiwan due to the amount of wastewater from industries is steadily
increasing every year with the development of industries. If the industry locates in the industrial park, the effluent from one
industry will be collected into the wastewater treatment plant (WWTP) of industrial park for regulation. The activated
sludge process (ASP) is broadly used in the WWTP of Taiwan’s industrial parks. Since the untreated industrial wastewater
contains several thousand types of chemicals, some problems will be encountered when adopting ASP in the WWTP of
industrial park. Literatures have shown that many water-quality indices have been investigated to implement detailed study
or to valid mechanistic models. So the more the items for wastewater characterization are, the better the reactions in ASP can
be understood. In our previous work, different mechanistic models including Activated Sludge Model (ASM) and Taiwan
Extension Activated Sludge Model No. 1 (TWEA1) were employed to describe the reactions in ASP [1–9].
In Taiwan, if the effluent comes from the designated sewers of industrial park, only four effluent characteristics, i.e., sus-
pended solids (SS), biochemical oxygen demand (BOD), chemical oxygen demand (COD) and true color, are regulated accord-
ing to effluent standard. Meanwhile, in order to save cost, effluent quality investigation from WWTP is only carried out to
meet regulation standard, so their investigation data are few and incomplete compared with general study cases. Under this
situation, the effluent quality cannot be predicted appropriately using some numerical models, especially mechanism
⇑ Corresponding author at: Department of Environmental Engineering and Management, Chaoyang University of Technology, Wufeng, Taichung 41349,
Taiwan, ROC. Tel.: +886 4 23323000 4465, fax: +886 4 23742365.
E-mail address: [email protected] (T.Y. Pai).
0307-904X/$ - see front matter Ó 2011 Elsevier Inc. All rights reserved.
doi:10.1016/j.apm.2011.01.019
T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684 3675
models. Some soft computation techniques, such as artificial neural network (ANN), in which the mechanism reactions can be
ignored are available presently and applied in biological wastewater treatment process [10–15]. Although ANN can predict the
effluent from WWTPs successfully, traditional neural network schemes still have several limitations which are resulted from
the possibility of getting trapped in local minimum, and the choice of model architecture. If the predicting performance can be
further promoted, better operation strategy can be formed. To overcome these limitations of traditional ANNs, and to increase
their reliability, many new training algorithms have been proposed such as adaptive neuro fuzzy inference system (ANFIS)
(Jang, 1993). ANFIS’s architecture consists of both ANN and fuzzy logic including linguistic express of membership functions
(MFs) and if-then rules. ANFIS has been successfully applied in many fields of wastewater treatment [16–23]. However, no
study has been applied in the prediction of effluent quality from industrial WWTP using ANFIS and influent quality.
The objectives of this study are listed as follows: (1) determine the correlation coefficients between effluent and influent
quality of a WWTP. (2) Use ANFIS with different conditions to establish the relationship between effluent and influent qual-
ity, then to predict the effluent quality. (3) For comparison, ANN was also employed to predict the effluent in this study.
The WWTP in the industrial park locating in middle part of Taiwan was selected for study. The total number of industries
in this park is 225 including manufacturers of fabricated metal products (25%), manufacturers of basic metal (11%), manu-
facturers of machinery equipment and repairing (7%), manufacturers of plastic products (7%), manufacturers of non-metallic
mining (6%) and others (44%). In this WWTP, the treatment processes were comprised of bar rack, aerated grit chamber,
equalization tank, primary settling tank, aeration tank of conventional ASP, secondary settling tank. The flow rate was
7500 cubic meters per day (CMD). The influent and effluent quality data from 3 January 2005 to 6 October 2005 were inves-
tigated. They were sampled and investigated every 2–3 days and their total number was 160. Among the total number of
data, the numbers for training and testing (predicting) were 130 and 30, respectively. The input parameters included influent
pH (pHinf), influent temperature (Tempinf), influent SS (SSinf), and influent COD (CODinf). The output parameters included
effluent SS (SSeff), effluent COD (CODeff) and effluent pH (pHeff). All analytical methods used in this study were according
to the Standard Method [24].
Both ANN and fuzzy logic are adopted in ANFIS’s architecture in which if-then rules with appropriate MFs and the spec-
ified input–output pairs are used. The learning algorithms of neural network are used for ANFIS training. Two methods are
employed for updating MF parameters in ANFIS learning: (1) backpropagation for all parameters (steepest descent method),
and (2) backpropagation for the parameters associated with the input MFs and least squares estimation for the parameters
associated with the output MFs. Subsequently, the training errors decrease, at least locally, during the learning procedure.
The more the initial MFs resemble the optimal ones, the more quickly the training parameters converge.
The fuzzy inference system with three inputs (I1, I2 and I3) and one output (Of) is taken for example to explain the ANFIS
architecture in this study. Considering a first order Sugeno type of fuzzy model, the if-then rule base can be expressed as
Rule 1 : If I1 is A1 and I2 is B1 and I3 is C 1 ;
Then f 1;1;1 ¼ a1;1;1 I1 þ b1;1;1 I2 þ c1;1;1 I3 þ g1;1;1 :
Rule 2 : If I1 is A1 and I2 is B1 and I3 is C 2 ;
Then f 1;1;2 ¼ a1;1;2 I1 þ b1;1;2 I2 þ c1;1;2 I3 þ g1;1;2 :
Rule 3 : If I1 is A1 and I2 is B1 and I3 is C 3 ; ð1Þ
Then f 1;1;3 ¼ a1;1;3 I1 þ b1;1;3 I2 þ c1;1;3 I3 þ g1;1;3
..
.
Rule 27 : If I1 is A3 and I2 is B3 and I3 is C 3 ;
Then f 3;3;3 ¼ a3;3;3 I1 þ b3;3;3 I2 þ c3;3;3 I3 þ g3;3;3 ;
where Ai, Bj, and Ck (i = 1 to 3) are the linguistic labels associated with this node function, respectively, i.e., the MFs for inputs
Ii. ai,j,k, bi,j,k), ci,j,k and gi,j,k (i, j, k = 1 to 3) denote the consequent parameters [25]. As shown in Fig. 1, the ANFIS’s architecture
is formed by using five layer and 27 if-then rules as follows:.
2.2.1. Layer 1
Each ‘‘i’’ node in this layer is a square node with a node function as
O11;i ¼ lAi ðI1 Þ; for i ¼ 1; 2; 3;
O12;j ¼ lBj ðI2 Þ; for j ¼ 1; 2; 3; ð2Þ
O13;k ¼ lCk ðI3 Þ; for k ¼ 1; 2; 3;
3676 T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684
I 1 I 2 I3
w1 w 1 ,1 ,1
w1,1,1 f1,1,1
w 1 ,1 , 2
A1
I1
w 1 ,1 , 3
Highest A2
R
w 1 , 2 ,1
A3 w 1,2 ,2
--------------------------------------
w 1,2 ,3
-----------------------------
B1
I2 w 1 , 3 ,1
th
2 Highest Of
B2
R w 1,3 ,2
B3 w 1,3 ,3
------------
------------
C1
I3
3th Highest
C2
R
C3 w 3 , 3 ,1 w3,3,3 f3,3,3
w 3 ,3 ,2
w 3 ,3 ,3
where I1, I2 and I3 are inputs to node i, and O11;i , O12;j and O13;k are the MFs of Ai, Bj, and Ck, respectively. The fuzzy MFs of lAi ðI1 Þ,
lAi ðI1 Þ, and lAi ðI1 Þ can be described in many types. In this study, four types of common MFs including Gaussian, generalized
bell shaped, triangular, and trapezoidal shaped functions with maximum value of 1 and minimum value of 0 were tested to
find out the appropriate one and described as follows:
ðI-cÞ2
Gaussian lðIÞ ¼ e 2r2 ; ð3aÞ
1
Bell shape lðIÞ ¼ Ic2b ; ð3bÞ
1þ a
Ia cI
Triangular shape lðIÞ ¼ max min ; ;0 ; ð3cÞ
ba cb
I-a cI
Trapezoidal shape lðIÞ ¼ max min ; 1; ;0 ; ð3dÞ
ba cb
T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684 3677
where a, b, c and r are the parameter set which are referred as premise parameters.
2.2.2. Layer 2
In Layer 2, each circle node labeled G multiplies the incoming signals and sends the product out. For instance,
2.2.3. Layer 3
In Layer 3, each circle node is labeled by N. The ith node calculates the ratio of the ith rule’s firing strength to the sum of all
rule’s firing strengths, i.e., the normalized firing strength.
wi;j;k
O3i;j;k ¼ wi;j;k ¼ P3 ; i; j; k ¼ 1; 2; 3: ð5Þ
i;j;k¼1 wi;j;k
2.2.4. Layer 4
Each square node i in this layer is a linear node function described as,
2.2.5. Layer 5
The single circle node in this layer is depicted by R and computes the overall output as the summation of all incoming
signals:
X P
wi fi
O5;i ¼ Overall output ¼ wi fi ¼ Pi : ð7Þ
i i wi
When adopting ANFIS, two parameters with higher correlation coefficients (ANFIS2-1), three parameters with higher corre-
lation coefficients (ANFIS3-1) and all four parameters (ANFIS4-1) were taken as the input layer variables, respectively. Mean-
while, each effluent quality, i.e., SSeff, CODeff and pHeff, was the single output layer variable.
The ANN modeling approach in which the important operation features of human nervous system is simulated attempts
to solve problems by using information gained from past experience to new problems. In order to operate analogous to a
human brain, many simple computational elements called artificial neurons that are connected by variable weights are used
in the ANN. With the hierarchical structure of a network of interconnected neurons, an ANN is capable of performing com-
plex computations, although each neuron, alone, can only perform simple work. The multi-layer perceptron structure is
commonly used for prediction among the many different types of structures. A typical neural network model consists of
three independent layers: input, hidden, and output layers. Each layer is comprised of several operating neurons. Input neu-
rons receive the values of input parameters that are fed to the network and store the scaled input values, while the calculated
results in output layer are assigned by the output neurons. The hidden layer performs an interface to fully interconnect input
and output layers. The pattern of hidden layer to be applied in the hierarchical network can be either multiple layers or a
single layer. Each neuron is connected to every neuron in adjacent layers before being introduced as input to the neuron
SSinf and COD inf (mg L ), Temp inf ( C), pHinf
400 100
pHinf SSinf CODinf Tempinf
SSeff and COD eff (mg L ), pHeff
350 90
SSeff CODeff pHeff
o
80
300
-1
70
250 60
-1
200 50
150 40
30
100
20
50 10
0 0
01/03/05
01/10/05
01/17/05
01/24/05
01/31/05
02/07/05
02/14/05
02/21/05
02/28/05
03/07/05
03/14/05
03/21/05
03/28/05
04/04/05
04/11/05
04/18/05
04/25/05
05/02/05
05/09/05
05/16/05
05/23/05
05/30/05
06/06/05
06/13/05
06/20/05
06/27/05
07/04/05
07/11/05
07/18/05
07/25/05
08/01/05
08/08/05
08/15/05
08/22/05
08/29/05
09/05/05
09/12/05
09/19/05
09/26/05
10/03/05
Time (date)
in the next layer by a connection weight, which determines the strength of the relationship between two connected neurons.
Each neuron sums all of the inputs that it receives and the sum is converted to an output value based on a predefined
activation, or transfer, function. For prediction problems, a supervised learning algorithm is often adopted for training the
network how to relate input data to output data. In recent years, the backpropagation algorithm is widely used for teaching
multi-layer neural networks. Traditionally, the algorithm uses a gradient search technique (the steepest gradient descent
method) to minimize a function equal to the mean square difference between the desired and the actual network outputs.
To compare with ANFIS, two parameters with higher R (ANN2-1), three parameters with higher R (ANN3-1) and all four
parameters (ANN4-1) were taken as the input layer variables, respectively. Meanwhile, each effluent quality, i.e. SSeff, CODeff
and pHeff, was the single output layer variable. The calculation of both ANFIS and ANN was carried out using MATLAB.
Table 1
The correlation coefficients between the effluent quality and influent quality.
Table 2
The selected input variables in ANFIS and ANN.
ANFIS ANN
Structure Input variables Structure Input variables
SSeff
ANFIS2-1 CODinf, pHinf ANN2-1 CODinf, pHinf
ANFIS3-1 CODinf, pHinf, Tempinf ANN3-1 CODinf, pHinf, Tempinf
ANFIS4-1 CODinf, pHinf, Tempinf, SSinf ANN4-1 CODinf, pHinf, Tempinf, SSinf
CODeff
ANFIS2-1 SSinf, pHinf ANN2-1 SSinf, pHinf
ANFIS3-1 SSinf, pHinf, CODinf ANN3-1 SSinf, pHinf, CODinf
ANFIS4-1 SSinf, pHinf, CODinf, Tempinf ANN4-1 SSinf, pHinf, CODinf, Tempinf
pHeff
ANFIS2-1 pHinf, SSinf ANN2-1 pHinf, SSinf
ANFIS3-1 pHinf, SSinf, CODinf ANN3-1 pHinf, SSinf, CODinf
ANFIS4-1 pHinf, SSinf, CODinf, Tempinf ANN4-1 pHinf, SSinf, CODinf, Tempinf
Table 3
Determination of the appropriate ANFIS and ANN models.
ANFIS ANN
Items 4-1 3-1 2-1 Items 4-1 3-1 2-1
Basic structure Basic structure
No. of total layers 7 7 7 No. of total layers 3 3 3
No. of layers excepting input and output layer 5 5 5 No. of hidden layer 1 1 1
No. of nodes in input layers 4 3 2 No. of neurons in input layers 4 3 2
No. of nodes in output layers 1 1 1 No. of neuron in output layers 1 1 1
SSeff SS
Shape of MFs Bell Bell Bell Speed of training 0.1 0.1 0.1
No. of MFs 4 4 4 No. of neurons in hidden layers 16 16 16
No. of training 100 110 130 No. of training 14,000 16,000 17,000
No. of fuzzy rules 44 43 42
CODeff COD
Shape of MFs Bell Bell Bell Speed of training 0.1 0.1 0.1
No. of MFs 4 4 4 No. of neurons in hidden layers 16 16 16
No. of training 100 120 130 No. of training 15,000 17,000 17,000
No. of fuzzy rules 44 43 42
pHeff pH
Shape of MFs Bell Bell Bell Speed of training 0.1 0.1 0.1
No. of MFs 4 4 4 No. of neurons in hidden layers 16 16 16
No. of training 100 110 120 No. of training 14,000 16,000 18,000
No. of fuzzy rules 44 43 42
f
e
c
a
d
b
Concentration (mg L-1 ) Concentration (mg L-1 ) Concentration (mg L -1) Concentration (mg L-1 ) Concentration (mg L-1) Concentration (mg L-1)
0
10
20
30
40
50
0
10
20
30
40
50
0
10
20
30
40
50
0
10
20
30
40
50
0
10
20
30
40
50
2.4. Evaluation of predicting performance
0
10
20
30
40
50
3-Jan 3-Jan 3-Jan 3-Jan 3-Jan
3-Jan 13-Jan 13-Jan 13-Jan 13-Jan 13-Jan
13-Jan
23-Jan 23-Jan 23-Jan 23-Jan 23-Jan
23-Jan
2-Feb 2-Feb 2-Feb 2-Feb 2-Feb
2-Feb
12-Feb 12-Feb 12-Feb 12-Feb 12-Feb
12-Feb
22-Feb 22-Feb 22-Feb 22-Feb 22-Feb
22-Feb
4-Mar 4-Mar 4-Mar 4-Mar 4-Mar
4-Mar
14-Mar 14-Mar 14-Mar 14-Mar 14-Mar
14-Mar
24-Mar 24-Mar 24-Mar 24-Mar 24-Mar
24-Mar
Obs_SS
Obs_SS
Obs_SS
Obs_SS
Obs_SS
Obs_SS
3-Apr
13-Apr 13-Apr 13-Apr 13-Apr 13-Apr 13-Apr
23-Apr 23-Apr 23-Apr 23-Apr 23-Apr
23-Apr
3-May 3-May 3-May 3-May 3-May 3-May
13-May 13-May 13-May 13-May 13-May 13-May
23-May 23-May 23-May 23-May 23-May 23-May
Time (date)
Time (date)
Time (date)
Time (date)
Time (date)
2-Jun 2-Jun 2-Jun 2-Jun 2-Jun 2-Jun
Pred_SS
Pred_SS
Pred_SS
Pred_SS
Pred_SS
Pred_SS
12-Jun
Time (date)
12-Jun 12-Jun 12-Jun 12-Jun 12-Jun
22-Jun 22-Jun 22-Jun 22-Jun 22-Jun 22-Jun
2-Jul 2-Jul 2-Jul 2-Jul 2-Jul 2-Jul
12-Jul 12-Jul 12-Jul 12-Jul 12-Jul 12-Jul
22-Jul 22-Jul 22-Jul 22-Jul 22-Jul 22-Jul
Traning
Traning
Traning
Traning
Traning
Traning
Predicting
Predicting
Predicting
Predicting
Predicting
Predicting
Fig. 3. Prediction results of SSeff. (a) ANFIS2-1, (b) ANFIS3-1, (c) ANFIS4-1, (d) ANN2-1, (e) ANN3-1, and (f) ANN4-1.
tion coefficient (R), mean square error (MSE), and root mean square error (RMSE) were employed and described as,
3679
In order to evaluate the predicting performance of ANFIS and ANN, the mean absolute percentage error (MAPE), correla-
3680 T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684
n
1X
obsi prei 100%;
MAPE ¼ ð8Þ
n i¼1 obsi
Pn
i¼1 ðobsi obsÞðprei preÞ
R ¼ qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
Pn ffi; ð9Þ
2 Pn 2
i¼1 ðobs i obsÞ i¼1 ðpre i preÞ
1X n
MSE ¼ ðobsi prei Þ2 ; ð10Þ
n i¼1
rffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
1 Xn
RMSE ¼ ðobsi prei Þ2 ; ð11Þ
n i¼1
where obsi is the observed value, prei is the prediction value, obs and pre are the average values of observed values and pre-
diction values, respectively.
The number of data investigated from 3 January 2005 to 6 October 2005 was totally 160, as shown in Fig. 2. Among the
total numbers of data, the numbers for training and testing (predicting) were 130 and 30, respectively. In Taiwan, the efflu-
ent regulation limits of SSeff and CODeff were 30 and 100 mg L1, respectively. The effluent quality from this WWTP met the
Effluent Standard of Taiwan..
The correlation coefficients (R) between the effluent quality (SSeff, CODeff, and pHeff) and four different influent wastewa-
ter quality indices (pHinf, Tempinf, SSinf, and CODinf) were calculated as shown in Table 1. The R values of SSef were in the
following order: CODinf (0.0421) > pHinf (0.0023) > Tempinf (0.2057) > SSinf (0.0402). Those of CODeff were in the following
order: SSinf (0.1075) > pHinf (0.0576) > CODinf (0.0065) > Tempinf (0.1592). Those of pHeff were in the following order: pHinf
(0.1176) > SSinf (0.1099) > CODinf (0.1129) > Tempinf (0.1164). Based on the results of R values, the selected input
Table 4
Predicting performance using different ANFIS and ANN.
ANFIS ANN
ANFIS4-1 ANFIS3-1 ANFIS2-1 ANN4-1 ANN3-1 ANN2-1
SSeff
MAPE (%) Train 12.21 11.68 9.58 19.89 18.92 18.15
Predict 5.63 4.66 2.67 7.30 4.64 4.64
R Train 0.95 0.95 0.97 0.83 0.84 0.88
Predict 0.87 0.91 0.96 0.87 0.92 0.89
MSE Train 1.67 1.45 0.92 4.90 4.69 3.48
Predict 0.96 0.64 0.19 1.31 0.59 0.50
RMSE Train 1.29 1.20 0.96 2.21 2.17 1.87
Predict 0.98 0.80 0.43 1.15 0.77 0.71
CODeff
MAPE (%) Train 9.95 8.75 7.66 11.57 10.86 9.91
Predict 4.54 3.66 2.80 5.87 4.89 4.77
R Train 0.80 0.84 0.88 0.70 0.74 0.79
Predict 0.80 0.88 0.93 0.82 0.85 0.83
MSE Train 14.77 12.59 9.04 19.85 17.57 14.68
Predict 4.40 2.81 2.25 5.37 4.57 6.11
RMSE Train 3.84 3.55 3.01 4.45 4.19 3.83
Predict 2.10 1.66 1.48 2.32 2.14 2.47
pHeff
MAPE (%) Train 0.69 0.66 0.59 0.79 0.74 0.69
Predict 0.59 0.50 0.42 0.66 0.64 0.53
R Train 0.92 0.94 0.96 0.91 0.93 0.93
Predict 0.87 0.90 0.95 0.86 0.90 0.93
MSE Train 0.01 0.00 0.00 0.01 0.00 0.00
Predict 0.00 0.00 0.00 0.00 0.00 0.00
RMSE Train 0.07 0.07 0.06 0.07 0.07 0.07
Predict 0.06 0.05 0.04 0.06 0.06 0.05
1) were shown in Table 2.
f
e
c
d
b
a
Concentration (mg L -1 ) Concentration (mg L -1 ) Concentration (mg L-1 ) Concentration (mg L -1 ) Concentration (mg L-1 ) Concentration (mg L-1 )
100
20
40
60
80
0
100
100
100
100
20
40
60
80
20
40
60
80
20
40
60
80
20
40
60
80
0
0
0
0
100
20
40
60
80
0
3-Jan 3-Jan 3-Jan 3-Jan 3-Jan 3-Jan
13-Jan 13-Jan 13-Jan 13-Jan 13-Jan 13-Jan
23-Jan 23-Jan 23-Jan 23-Jan 23-Jan 23-Jan
2-Feb 2-Feb 2-Feb 2-Feb 2-Feb 2-Feb
12-Feb 12-Feb 12-Feb 12-Feb 12-Feb 12-Feb
22-Feb 22-Feb 22-Feb 22-Feb 22-Feb 22-Feb
4-Mar 4-Mar 4-Mar 4-Mar 4-Mar 4-Mar
14-Mar 14-Mar 14-Mar 14-Mar 14-Mar
Obs_COD
Obs_COD
Obs_COD
14-Mar
Obs_COD
Obs_COD
Obs_COD
3-Apr 3-Apr
13-Apr 13-Apr 13-Apr 13-Apr 13-Apr 13-Apr
23-Apr 23-Apr 23-Apr 23-Apr 23-Apr 23-Apr
3-May 3-May 3-May 3-May 3-May 3-May
13-May 13-May 13-May 13-May 13-May 13-May
23-May 23-May 23-May 23-May 23-May
Time (date)
23-May
Time (date)
Time (date)
Time (date)
Time (date)
Time (date)
Pred_COD
Pred_COD
Pred_COD
2-Jun
Pred_COD
Pred_COD
Pred_COD
Traning
22-Jul
Traning
Traning
Traning
Traning
Traning
Predicting
30-Sep
Predicting
Predicting
Predicting
Predicting
30-Sep
Fig. 4. Prediction results of CODeff. (a) ANFIS2-1, (b) ANFIS3-1, (c) ANFIS4-1, (d) ANN2-1, (e) ANN3-1, and (f) ANN4-1.
3681
functions, and the parameters in Eqs. (1) and (3) were tested to determine an appropriate ANFIS model. After many trials in
variables in three types of ANFIS (ANFIS2-1, ANFIS3-1 and ANFIS4-1) and in three types of ANN (ANN2-1, ANN3-1 and ANN4-
The types and numbers of MFs in Layer 2 including Gaussian, generalized bell shaped, triangular and trapezoidal shaped
3682 T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684
which backpropagation for the parameters were implemented, the final architectures of the ANFIS models are given in
Table 3. With different input variables, all ANFIS models had generalized bell shaped MFs and four MFs for each input
variables gave the best result. Their numbers of training were between 100 and 130. The numbers of fuzzy rules in ANFIS
models which showed the highest accuracy are also provided in Table 3.
To compare with ANFIS, the appropriate ANN models were also shown in Table 3. All ANN consisted of three independent
layers: input, hidden, and output layers. The hidden layer was comprised of 16 operating neurons. The number of training
was between 14,000 and 18,000.
a
Concentration (mg L-1 )
20
15 Obs_pH Pred_pH Traning Predicting
10
5
0
3-Jan
4-Mar
2-Feb
13-Jan
23-Jan
14-Mar
24-Mar
2-Jul
3-May
2-Jun
22-Jul
12-Feb
22-Feb
3-Apr
13-May
23-May
12-Jun
22-Jun
12-Jul
10-Sep
20-Sep
30-Sep
13-Apr
23-Apr
1-Aug
11-Aug
21-Aug
31-Aug
Time (date)
b
Concentration (mg L-1 )
20
15 Obs_pH Pred_pH Traning Predicting
10
5
0
3-Jan
4-Mar
2-Jul
13-Jan
23-Jan
2-Feb
3-May
2-Jun
14-Mar
24-Mar
12-Feb
22-Feb
3-Apr
22-Jul
10-Sep
20-Sep
30-Sep
13-May
23-May
12-Jun
22-Jun
12-Jul
1-Aug
13-Apr
23-Apr
11-Aug
21-Aug
31-Aug
Time (date)
c
Concentration (mg L-1 )
20
15 Obs_pH Pred_pH Traning Predicting
10
5
0
3-Jan
4-Mar
13-Jan
23-Jan
2-Jun
2-Jul
2-Feb
3-May
14-Mar
24-Mar
12-Feb
22-Feb
3-Apr
10-Sep
20-Sep
30-Sep
13-May
23-May
12-Jun
22-Jun
12-Jul
22-Jul
1-Aug
13-Apr
23-Apr
11-Aug
21-Aug
31-Aug
Time (date)
d
Concentration (mg L-1 )
20
15 Obs_pH Pred_pH Traning Predicting
10
5
0
3-Jan
4-Mar
13-Jan
23-Jan
2-Feb
3-May
2-Jun
2-Jul
14-Mar
24-Mar
12-Feb
22-Feb
3-Apr
10-Sep
20-Sep
30-Sep
13-May
23-May
12-Jun
22-Jun
12-Jul
22-Jul
1-Aug
13-Apr
23-Apr
11-Aug
21-Aug
31-Aug
Time (date)
e
Concentration (mg L-1 )
20
15 Obs_pH Pred_pH Traning Predicting
10
5
0
3-Jan
4-Mar
13-Jan
23-Jan
2-Jun
2-Jul
2-Feb
3-May
14-Mar
24-Mar
12-Feb
22-Feb
3-Apr
10-Sep
20-Sep
30-Sep
13-May
23-May
12-Jun
22-Jun
12-Jul
22-Jul
1-Aug
13-Apr
23-Apr
11-Aug
21-Aug
31-Aug
Time (date)
f
Concentration (mg L-1 )
20
15 Obs_pH Pred_pH Traning Predicting
10
5
0
3-Jan
4-Mar
13-Jan
23-Jan
2-Feb
3-May
2-Jun
2-Jul
14-Mar
24-Mar
12-Feb
22-Feb
3-Apr
10-Sep
20-Sep
30-Sep
13-May
23-May
12-Jun
22-Jun
12-Jul
22-Jul
1-Aug
13-Apr
23-Apr
11-Aug
21-Aug
31-Aug
Time (date)
Fig. 5. Prediction results of pHeff. (a) ANFIS2-1, (b) ANFIS3-1, (c) ANFIS4-1, (d) ANN2-1, (e) ANN3-1, and (f) ANN4-1.
T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684 3683
Figs. 3(a)–(f) depict the prediction results of SSeff using ANFIS2-1, ANFIS3-1, ANFIS4-1, ANN2-1, ANN3-1, and ANN4-1,
respectively. All MAPE, R, MSE, and RMSE values are shown in Table 4The 1st to 130th values were used for model training,
131st to 160th values were used to evaluate the fitness. As shown in Table 4, when training, MAPEs between the predicted
and observed values of SSeff were between 9.58% and 12.21% using ANFIS, but they were 18.15–19.89% using ANN. When
predicting, the MAPEs lay between 2.67% and 5.63% adopting ANFIS, but they were between 4.64% and 7.30% when using
ANN. When training, R values increased from 0.83–0.88 to 0.95–0.97 using ANFIS. When predicting, R values also increased
from 0.87–0.92 to 0.87–0.96. MSE and RMSE values also showed that the predicting performance of ANFIS prevailed. The
MSE values of 0.92–1.67 using ANFIS were lower than those of 3.48–4.90 using ANN when model training. When predicting,
the MSE values of 0.19–0.92 using ANFIS were also lower than those of 0.50–1.31 using ANN. When training, the RMSE val-
ues of 0.96–1.29 using ANFIS were lower than those of 1.87–2.21 using ANN. The RMSE values of 0.43–0.98 using ANFIS were
also lower than those of 0.71–1.15 using ANN when predicting.
Figs. 4(a)–(f) shows the prediction results of CODeff. When training, the MAPE values of 7.66–9.95% using ANFIS were lower
than those of 9.91–11.57% using ANN. The MAPE values of 2.80–4.54% using ANFIS were also lower than those of 4.77–5.87%
using ANN when predicting. When training, the R values of 0.80–0.88 using ANFIS were higher than those of 0.70–0.79 using
ANN. The R values of 0.88–0.93 using ANFIS were also higher than those of 0.83–0.85 using ANN when predicting, excepting
those of ANFIS4-1 vs. ANN4-1. When training, the MSEs of CODeff were between 9.04 and 14.77 using ANFIS, but they were
14.68–19.85 using ANN. When predicting, the MSEs lay between 2.25 and 4.40 adopting ANFIS, but they were between 4.57
and 6.11 when using ANN. The RMSE values of 3.01–3.84 using ANFIS were lower than those of 3.83–4.45 using ANN when
model training. When predicting, the RMSE values of 1.48–2.10 using ANFIS were also lower than those of 2.14–2.47 using ANN.
The prediction results of pHeff are shown in Figs. 5(a)–(f)When training, the MAPE values of 0.59–0.69% using ANFIS were
lower than those of 0.69–0.79% using ANN. The MAPE values of 0.42–0.59% using ANFIS were also lower than those of 0.53–
0.66% using ANN when predicting. When training, the R values of 0.92–0.96 using ANFIS were higher than those of 0.91–0.93
using ANN. The R values of 0.87–0.95 using ANFIS were also higher than those of 0.86–0.93 using ANN when predicting.
When training and predicting, the MSEs using both ANFIS and ANN were analogous, lying between 0.00 and 0.01, respec-
tively. The RMSE values of 0.06–0.07 using ANFIS were lower than those of 0.7 using ANN when model training. When pre-
dicting, the RMSE values of 0.04–0.06 using ANFIS were also lower than those of 0.05–0.06 using ANN.
Comparable observations were similarly made by Lee et al. [15]. Lee et al. [15] developed a real-time remote monitoring
system for WWTP to give local operators a guideline that allowed them to arrive at the optimum operational strategy in the
early stage of a process disturbance. They found that the RMSE values of the training and testing datasets were 0.787 and
1.287, respectively. Civelekoglu et al. [21] employed ANFIS to develop models for the prediction of carbon and nitrogen re-
moval in the aerobic biological treatment stage of a full-scale WWTP in the sugar production industry. For the COD model;
RMSE, average percentage error (APE) and R values were 9.4 mg/L, 8.37% and 0.978%, respectively. Such values for the nitro-
gen model were 4.3 mg/L, 23.65% and 0.992%. Güçlü and Dursun [14] combined the mechanistic model and ANN in parallel
configuration to predict effluent COD concentrations and compare the results for the purpose of evaluation of treatment per-
formance. The results indicated that the best values of R, RMSE, and MAPE were 0.88%, 2.56%, and 4.25%, respectively when
training. These values were 0.91%, 2.64%, and 4.08%, respectively when testing.
In this study, the minimum MAPEs of 2.67%, 2.80%, and 0.42% for SSeff, CODeff and pHeff could be achieved using ANFIS. The
maximum R values for SSeff, CODeff, and pHeff were 0.96, 0.93, and 0.95, respectively. The minimum MSEs of 0.19, 2.25 and 0.00,
and the minimum RMSEs of 0.43, 1.48 and 0.04 for SSeff, CODeff and pHeff could also be achieved. ANFIS’s architecture consists of
both ANN and fuzzy logic including linguistic express of MFs and if-then rules, so it can overcome the limitations of traditional
neural network including possibility of getting trapped in local minimum and the choice of model architecture, and to increase
the predicting performance. It also indicated that the influent indices could be applied on the prediction of effluent quality.
4. Conclusions
Three types of ANFIS were used to predict SSeff, pHeff and CODeff from a WWTP of industrial park in Taiwan. The ANN was
also adopted for comparison. The simulation results can be drawn as follows:
According to the results, ANFIS could predict the variation of industrial effluent. The minimum MAPEs of 2.67%, 2.80%, and
0.42% for SSeff, CODeff and pHeff could be achieved using ANFIS. The maximum R values for SSeff, CODeff, and pHeff were
0.96, 0.93, and 0.95, respectively. The minimum MSEs of 0.19, 2.25, and 0.00, and the minimum RMSEs of 0.43, 1.48,
and 0.04 for SSeff, CODeff, and pHeff could also be achieved.
3684 T.Y. Pai et al. / Applied Mathematical Modelling 35 (2011) 3674–3684
It also revealed that the influent indices could be applied to the prediction of effluent quality.
After prediction, it is suggested that the ANFIS can be used as the objective function or constrains in optimization for best
design or operation in the future study.
Acknowledgments
The authors are grateful to the National Science Council of Taiwan, ROC for financial support under the Grant No. NSC 97-
2221-E-324-048.
References
[1] T.Y. Pai, C.F. Ouyang, J.L. Su, H.G. Leu, Modelling the steady-state effluent characteristics of the TNCU process under different return mixed liquid, Appl.
Math. Model. 25 (12) (2001) 1025–1038.
[2] T.Y. Pai, Y.P. Tsai, Y.J. Chou, H.Y. Chang, H.G. Leu, C.F. Ouyang, Microbial kinetic analysis of three different types of EBNR process, Chemosphere 55 (1)
(2004) 109–118.
[3] T.Y. Pai, S.H. Chuang, Y.P. Tsai, C.F. Ouyang, Modelling a combined A2 O and RBC process under DO variation by using an activated sludge – biofilm
hybrid model, J. Environ. Eng. ASCE 130 (12) (2004) 1433–1441.
[4] T.Y. Pai, Modeling nitrite and nitrate variations in A2 O process under different return oxic mixed liquid using an extended model, Process Biochem. 42
(6) (2007) 978–987.
[5] T.Y. Pai, S.C. Wang, H.M. Lo, C.F. Chiang, M.H. Liu, R.J. Chiou, W.Y. Chen, P.S. Hung, W.C. Liao, H.G. Leu, Novel modeling concept for evaluating the effects
of cadmium and copper on heterotrophic growth and lysis rates in activated sludge process, J. Hazard. Mater. 166 (1) (2009) 200–206.
[6] T.Y. Pai, H.Y. Chang, T.J. Wan, S.H. Chuang, Y.P. Tsai, Using an extended activated sludge model to simulate nitrite and nitrate variations in TNCU2
process, Appl. Math. Model. 33 (11) (2009) 4259–4268.
[7] T.Y. Pai, S.C. Wang, C.Y. Lin, W.C. Liao, H.H. Chu, T.S. Lin, C.C. Liu, S.W. Lin, Two types of organophosphate pesticides and their combined effects on
heterotrophic growth rates in activated sludge process, J. Chem. Technol. Biotechnol. 84 (12) (2009) 1773–1779.
[8] T.Y. Pai, T.J. Wan, Y.P. Tsai, C.J. Tzeng, H.H. Chu, Y.S. Tsai, C.Y. Lin, Effect of sludge retention time on biomass and kinetic parameter of two nitrifying
species in anaerobic/oxic process, CLEAN – Soil, Air, Water 38 (2) (2010) 167–172.
[9] T.Y. Pai, R.J. Chiou, C.J. Tzeng, T.S. Lin, S.C. Yeh, P.J. Sung, C.H. Tseng, C.H. Tsai, Y.S. Tsai, W.J. Hsu, Y.L. Wei, Variation of biomass and kinetic parameter for
nitrifying species in TNCU3 process at different aerobic hydraulic retention time, World J. Microbiol. Biotechnol. 26 (4) (2010) 589–597.
[10] T.Y. Pai, Y.P. Tsai, H.M. Lo, C.H. Tsai, C.Y. Lin, Grey and neural network prediction of suspended solids and chemical oxygen demand in hospital
wastewater treatment plant effluent, Comput. Chem. Eng. 31 (10) (2007) 1272–1281.
[11] T.Y. Pai, Grey and neural network prediction of effluent from the wastewater treatment plant of industrial park using influent quality, Environ. Eng. Sci.
25 (5) (2008) 757–766.
[12] T.Y. Pai, S.H. Chuang, H.H. Ho, L.F. Yu, H.C. Su, H.C. Hu, Predicting performance of grey and neural network in industrial effluent using online monitoring
parameters, Process Biochem. 43 (2) (2008) 199–205.
[13] T.Y. Pai, S.H. Chuang, T.J. Wan, H.M. Lo, Y.P. Tsai, H.C. Su, L.F. Yu, H.C. Hu, P.J. Sung, Comparisons of grey and neural network prediction of industrial park
wastewater effluent using influent quality and online monitoring parameters, Environ. Monit. Assess. 146 (1–3) (2008) 51–66.
[14] D. Güçlü, S. Dursun, Amelioration of carbon removal prediction for an activated sludge process using an artificial neural network (ANN), CLEAN – Soil
Air Water 36 (9) (2008) 781–787.
[15] M.W. Lee, S.H. Hong, H. Choi, J.H. Kim, D.S. Lee, J.M. Park, Real-time remote monitoring of small-scaled biological wastewater treatment plants by a
multivariate statistical process control and neural network-based software sensors, Process Biochem. 43 (10) (2008) 1107–1113.
[16] J.P. Steyer, D. Rolland, J.C. Bouvier, R. Moletta, Hybrid fuzzy neural network for diagnosis – application to the anaerobic treatment of wine distillery
wastewater in a fluidized bed reactor, Water Sci. Technol. 36 (6–7) (1997) 209–217.
[17] J.H. Tay, X. Zhang, Neural fuzzy modeling of anaerobic biological wastewater treatment systems, J. Environ. Eng. ASCE 125 (12) (1999) 1149–1159.
[18] A. Perendeci, S. Arslan, A. Tanyolaç, S. Çelebi, Evaluation of input variables in adaptive-network-based fuzzy inference system modeling for an
anaerobic wastewater treatment plant under unsteady state, J. Environ. Eng. ASCE 133 (7) (2007) 765–771.
[19] A. Perendeci, S. Arslan, S.S. Çelebi, A. Tanyolaç, Prediction of effluent quality of an anaerobic treatment plant under unsteady state through ANFIS
modeling with on-line input variables, Chem. Eng. J. 145 (1) (2008) 78–85.
[20] M. Cakmakci, Adaptive neuro-fuzzy modelling of anaerobic digestion of primary sedimentation sludge, Bioprocess Biosyst. Eng. 30 (5) (2007) 349–357.
[21] G. Civelekoglu, A. Perendeci, N.O. Yigit, M. Kitis, Modeling carbon and nitrogen removal in an industrial wastewater treatment plant using an adaptive
network-based fuzzy inference system, CLEAN – Soil, Air, Water 35 (6) (2007) 617–625.
[22] T.Y. Pai, T.J. Wan, S.T. Hsu, T.C. Chang, Y.P. Tsai, C.Y. Lin, H.C. Su, L.F. Yu, Using fuzzy inference system to improve neural network for predicting hospital
wastewater treatment plant effluent, Comput. Chem. Eng. 33 (7) (2009) 1272–1278.
[23] T.Y. Pai, S.C. Wang, C.F. Chiang, H.C. Su, L.F. Yu, P.J. Sung, C.Y. Lin, H.C. Hu, Improving neural network prediction of effluent from biological wastewater
treatment plant of industrial park using fuzzy learning approach, Bioprocess Biosyst. Eng. 32 (6) (2009) 781–790.
[24] APHA, AWWA, WEF, Standard Methods for the Examination of Water and Wastewater, 19th ed., American Public Health Association/American Water
Works Association/Water Environment Federation, Washington, DC, 1995.
[25] J.S.R. Jang, ANFIS: adaptive-network-based fuzzy inference system, IEEE Trans. Syst. Man Cybernet. 23 (3) (1993) 665–685.