3. Intelligent modeling approach based on SOFNN

An intelligent method based on SOFNN is proposed to predict the effluent ammonia nitrogen (SNH) in urban WWTP. The main challenges are the selection of the principal process variables, the construction of the model structure and the adjustment of the model parameters.

#### 3.1. Selection of principal process variables

To determine the principal process variables of the effluent SNH, the mechanism analysis is firstly applied to determine the related process variables, and then principal component analysis (PCA) is introduced to lower the dimension of the original process variables. This method has the advantage of extracting the important information from the coupling process variables and reducing the computational complexity of prediction models.

For the effluent SNH, the mechanism models are described as:

$$\frac{d\mathbf{S\_{NH}}}{dt} = \upsilon\_{1,\text{NH}\_4} \cdot (\rho\_1 + \rho\_2 + \rho\_3) - \left(\frac{1}{Y\_A} + i\_{\text{N,RM}}\right) \cdot \rho\_{16} - \upsilon\_{17,\text{NH}\_4}\rho\_{17\prime} \tag{1}$$

where

$$\nu\_{1,NH\_4} = -\left(1 - f\_{s\_1}\right) \cdot i\_{\rm N\_rS\_{\overline{r}}} - f\_{S\_1} \cdot i\_{\rm N\_rS\_1} + i\_{\rm N\_rX\_{\overline{s}'}} \tag{2}$$

subsaturation coefficient of oxygen, KNO<sup>3</sup> is the heterotrophic bacteria subsaturation coefficient of nitrate, KS is the heterotrophic bacteria subsaturation coefficient of COD, KP is the phosphorus storage saturation coefficient, XP is the particulate products arising from biomass decay, XH is the water solubility, bAUT is the decay rate, KALK is the growth factor of alkalinity, SO<sup>2</sup> is the dissolved oxygen, SNO<sup>3</sup> is the nitrate, SPO<sup>4</sup> is the total phosphorus, SALK is the alkalinity and

According to the mechanism models in Eqs. (1)–(8), it can be concluded that the related process variables to the effluent SNH are SNO3, XS, SO2, SPO4, SALK, XAUT and XH. Combining with the real data collected from urban WWTP, oxidation-reduction potential (ORP), total suspended solids (TSS), temperature (T), PH, influent ammonia nitrogen (SNH,i) and effluent nitrate nitrogen (SNO,e) are also considered as the influencing variables of the effluent SNH. Then,

For reducing the dimension of the process variables, the first important thing is to remove the

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

where σ<sup>i</sup> is the standard error and ū<sup>i</sup> is the average value of the ith column sample data; the error between the sample and the average value is shown as vi = ui-ū<sup>i</sup> (i = 1, 2,…, 13), if vi satisfies

it is considered as abnormal data and then, it is removed. Due to the fact that the 13 columns of process variables have different magnitudes, data normalization processing should be

uinorm <sup>¼</sup> ui � uimin

where uinorm is the value after normalization and uimin and uimax are the minimum and maximum of the ith column sample data, respectively. After the normalization treatment, all the sample data are within [0, 1]. It is worth noting that the testing outputs should be anti-

Then, the covariance matrix S is calculated and decomposed according to their singular values

r<sup>11</sup> r<sup>12</sup> ⋯ r1,m r<sup>21</sup> r<sup>22</sup> ⋯ r2,m ⋮ ⋮ ⋮⋮ rm, <sup>1</sup> rm, <sup>2</sup> ⋯ rm,m

<sup>S</sup> <sup>¼</sup> <sup>V</sup>ΛV<sup>T</sup>, (13)

S ¼

uimax � uimin

uj,i � ui � �<sup>2</sup>

,

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

l, (9)

http://dx.doi.org/10.5772/intechopen.74984

95

, (11)

, (12)

vi j j > 3σi, (10)

X l

vuut

j¼1

PCA is utilized to select the principal variables from the 13 related variables.

abnormal data according to the standard deviation calculation formula

σ<sup>i</sup> ¼

XAUT is the autotrophic concentration.

conducted

normalized to the original ranges.

into matrices V and Λ

$$
\sigma\_{17,NH\_4} = \tau f\_{X\_1} \cdot i\_{N,X\_1} - \left(1 - f\_{X\_1}\right) \cdot i\_{N,X\_\*} + i\_{N,RM\prime} \tag{3}
$$

$$\rho\_1 = K\_h \cdot \eta\_k \cdot \frac{k\_{O\_2}}{k\_{O\_2} + \text{S}\_{O\_2}} \cdot \frac{\text{S}\_{\text{NO}\_3}}{\text{K}\_{\text{NO}\_3} + \text{S}\_{\text{NO}\_3}} \cdot \frac{\text{X}\_{\text{s}}/\_{\text{X}\_H}}{\text{K}\_X + \text{x}\_{\text{s}}/\_{\text{X}\_H}} \cdot \text{X}\_{\text{H}\_Y} \tag{4}$$

$$\rho\_2 = K\_h \cdot \eta\_{NO\_3} \cdot \frac{k\_{O\_2}}{k\_{O\_2} + S\_{O\_2}} \cdot \frac{S\_{NO\_3}}{K\_{NO\_3} + S\_{NO\_3}} \cdot \frac{\chi\_{\text{s}}/\_{\chi\_H}}{K\_X + \chi\_{\text{s}}/\_{\chi\_H}} \cdot X\_{H\nu} \tag{5}$$

$$\rho\_3 = K\_h \cdot \frac{\mathbf{S}\_{\rm O\_2}}{\mathbf{K}\_{\rm O\_2} + \mathbf{S}\_{\rm O\_2}} \cdot \frac{\mathbf{x}\_{\rm S} /\_{\rm X\_H}}{\mathbf{K}\_X + \mathbf{x}\_{\rm S} /\_{\rm X\_H}} \cdot \mathbf{X}\_{\rm H\_2} \tag{6}$$

$$\rho\_{16} = \mu\_{AlT} \cdot \frac{\mathbf{S}\_{O\_2}}{\mathbf{K}\_{O\_2} + \mathbf{S}\_{O\_2}} \cdot \frac{\mathbf{S}\_{PO\_4}}{\mathbf{K}\_P + \mathbf{S}\_{PO\_4}} \cdot \frac{\mathbf{S}\_{NH\_4}}{\mathbf{K}\_{NH\_4} + \mathbf{S}\_{NH\_4}} \frac{\mathbf{S}\_{NH\_4}}{\mathbf{K}\_{ALK} + \mathbf{S}\_{ALK}} \cdot \mathbf{X}\_{ALT} \tag{7}$$

$$
\rho\_{17} = b\_{AIT} \cdot X\_{AIT}.\tag{8}
$$

where YA is the autotrophic bacteria yield coefficient of chemical oxygen demand, iN,BM, iN,S1, iN,XS and iN,X<sup>1</sup> are the parameters of nitrogen content, fs<sup>1</sup> is the proportion of inert chemical oxygen demand in granular matrix, fX<sup>1</sup> is the proportion of inert chemical oxygen demand in oxide, Kh is the water solubility rate function, μAUT is the maximum growth rate, XS is the slowly biodegradable substrate, KNO<sup>3</sup> is the subsaturation coefficient of nitrate, KNH<sup>4</sup> is the autotrophic bacteria subsaturation coefficient of nitrogen, KO<sup>2</sup> is the heterotrophic bacteria subsaturation coefficient of oxygen, KNO<sup>3</sup> is the heterotrophic bacteria subsaturation coefficient of nitrate, KS is the heterotrophic bacteria subsaturation coefficient of COD, KP is the phosphorus storage saturation coefficient, XP is the particulate products arising from biomass decay, XH is the water solubility, bAUT is the decay rate, KALK is the growth factor of alkalinity, SO<sup>2</sup> is the dissolved oxygen, SNO<sup>3</sup> is the nitrate, SPO<sup>4</sup> is the total phosphorus, SALK is the alkalinity and XAUT is the autotrophic concentration.

3. Intelligent modeling approach based on SOFNN

and reducing the computational complexity of prediction models.

dt <sup>¼</sup> <sup>v</sup>1,NH<sup>4</sup> � <sup>r</sup><sup>1</sup> <sup>þ</sup> <sup>r</sup><sup>2</sup> <sup>þ</sup> <sup>r</sup><sup>3</sup> ð Þ� <sup>1</sup>

ν1,NH<sup>4</sup> ¼ � 1 � f <sup>s</sup><sup>1</sup>

<sup>r</sup><sup>1</sup> <sup>¼</sup> Kh � <sup>η</sup><sup>k</sup> � kO<sup>2</sup>

<sup>r</sup><sup>2</sup> <sup>¼</sup> Kh � <sup>η</sup>NO<sup>3</sup> � kO<sup>2</sup>

KO<sup>2</sup> þ SO2

<sup>r</sup><sup>16</sup> <sup>¼</sup> <sup>μ</sup>AUT � SO<sup>2</sup>

v17,NH4 ¼ -f <sup>X</sup><sup>1</sup> � iN,X<sup>1</sup> � 1 � f <sup>X</sup><sup>1</sup>

kO<sup>2</sup> þ SO<sup>2</sup>

kO<sup>2</sup> þ SO<sup>2</sup>

KO<sup>2</sup> þ SO2

� SPO<sup>4</sup> KP þ SPO<sup>4</sup>

<sup>r</sup><sup>3</sup> <sup>¼</sup> Kh � SO<sup>2</sup>

For the effluent SNH, the mechanism models are described as:

3.1. Selection of principal process variables

94 Wastewater and Water Quality

dSNH

where

An intelligent method based on SOFNN is proposed to predict the effluent ammonia nitrogen (SNH) in urban WWTP. The main challenges are the selection of the principal process variables,

To determine the principal process variables of the effluent SNH, the mechanism analysis is firstly applied to determine the related process variables, and then principal component analysis (PCA) is introduced to lower the dimension of the original process variables. This method has the advantage of extracting the important information from the coupling process variables

YA

� SNO<sup>3</sup> KNO<sup>3</sup> þ SNO<sup>3</sup>

� SNO<sup>3</sup> KNO<sup>3</sup> þ SNO<sup>3</sup>

where YA is the autotrophic bacteria yield coefficient of chemical oxygen demand, iN,BM, iN,S1, iN,XS and iN,X<sup>1</sup> are the parameters of nitrogen content, fs<sup>1</sup> is the proportion of inert chemical oxygen demand in granular matrix, fX<sup>1</sup> is the proportion of inert chemical oxygen demand in oxide, Kh is the water solubility rate function, μAUT is the maximum growth rate, XS is the slowly biodegradable substrate, KNO<sup>3</sup> is the subsaturation coefficient of nitrate, KNH<sup>4</sup> is the autotrophic bacteria subsaturation coefficient of nitrogen, KO<sup>2</sup> is the heterotrophic bacteria

� XS <sup>=</sup>XH KX þ XS =XH

� SNH<sup>4</sup> KNH<sup>4</sup> þ SNH<sup>4</sup>

þ iN,BM 

> � XS <sup>=</sup>XH KX þ XS =XH

> > � XS <sup>=</sup>XH KX þ XS =XH

> > > SNH<sup>4</sup> KALK þ SALK

r<sup>17</sup> ¼ bAUT � XAUT: (8)

� r<sup>16</sup> � v17,NH<sup>4</sup> r17, (1)

� iN,Xs þ iN,BM, (3)

� XH, (4)

� XH, (5)

� XAUT, (7)

� XH, (6)

� iN,SF � f <sup>S</sup><sup>1</sup> � iN,S<sup>1</sup> þ iN,XS , (2)

the construction of the model structure and the adjustment of the model parameters.

According to the mechanism models in Eqs. (1)–(8), it can be concluded that the related process variables to the effluent SNH are SNO3, XS, SO2, SPO4, SALK, XAUT and XH. Combining with the real data collected from urban WWTP, oxidation-reduction potential (ORP), total suspended solids (TSS), temperature (T), PH, influent ammonia nitrogen (SNH,i) and effluent nitrate nitrogen (SNO,e) are also considered as the influencing variables of the effluent SNH. Then, PCA is utilized to select the principal variables from the 13 related variables.

For reducing the dimension of the process variables, the first important thing is to remove the abnormal data according to the standard deviation calculation formula

$$
\sigma\_{l} = \sqrt{\sum\_{j=1}^{l} \left( u\_{j,i} - \overline{u}\_{i} \right)^{2}} \Bigg/ \mathsf{l}\_{\star} \tag{9}
$$

where σ<sup>i</sup> is the standard error and ū<sup>i</sup> is the average value of the ith column sample data; the error between the sample and the average value is shown as vi = ui-ū<sup>i</sup> (i = 1, 2,…, 13), if vi satisfies

$$|v\_i| > \Im \sigma\_{i\nu} \tag{10}$$

it is considered as abnormal data and then, it is removed. Due to the fact that the 13 columns of process variables have different magnitudes, data normalization processing should be conducted

$$
\mu\_{\rm inorm} = \frac{\mu\_{\rm i} - \mu\_{\rm imin}}{\mu\_{\rm imax} - \mu\_{\rm imin}},
\tag{11}
$$

where uinorm is the value after normalization and uimin and uimax are the minimum and maximum of the ith column sample data, respectively. After the normalization treatment, all the sample data are within [0, 1]. It is worth noting that the testing outputs should be antinormalized to the original ranges.

Then, the covariance matrix S is calculated and decomposed according to their singular values into matrices V and Λ

$$\mathbf{S} = \begin{bmatrix} r\_{11} & r\_{12} & \cdots & r\_{1,m} \\ r\_{21} & r\_{22} & \cdots & r\_{2,m} \\ \vdots & \vdots & \vdots & \vdots \\ r\_{m,1} & r\_{m,2} & \cdots & r\_{m,m} \end{bmatrix},\tag{12}$$

$$\mathbf{S} = \mathbf{V} \mathbf{A} \mathbf{V}^{\mathrm{T}},\tag{13}$$

where rm,<sup>m</sup> is the correlation coefficient and Λ is a diagonal matrix of the eigenvalues associated with the eigenvectors contained in the columns of matrix V. The contribution rate of each component is calculated by Λ, the principal component factor loading matrix P is then calculated according to Λ and V. The projected matrix T in the new space is defined as

$$\mathbf{T} = \mathbf{X}\mathbf{P}^{\mathsf{T}} + \mathbf{E},\tag{14}$$

vl <sup>¼</sup> <sup>ϕ</sup><sup>l</sup> P P j¼1 ϕj

<sup>ϕ</sup><sup>j</sup> <sup>¼</sup> <sup>Y</sup> k

neuron, respectively, and

learning rate defined as:

the RBF layer.

given by

and vectors.

i¼1 Ai <sup>j</sup> xj � � <sup>¼</sup> <sup>Y</sup> k

<sup>¼</sup> <sup>e</sup> � Pk i¼1 xi�<sup>c</sup> ð Þil <sup>2</sup> 2σ2 il

i¼1 e � xi�<sup>c</sup> ð Þij 2 2σ2 ij ¼ e � Pk i¼1 xi�<sup>c</sup> ð Þij 2 2σ2

P P j¼1 e � Pk i¼1 xi�<sup>c</sup> ð Þij 2 2σ2 ij

The number of neurons in the radial basis function (RBF) layer is equal to the number of

c<sup>j</sup> = [c1j,c2j,…,ckj] and σ<sup>j</sup> = [σ1j, σ2j,…,σkj] are the vectors of centers and widths of the jth RBF

where x = [x1,x2,…,xk] is the input vector of the input layer and U = [u1,u2,…,uk] is the input of

Following the computation procedure in the Levenberg-Marquardt algorithm, the updated rule of the adaptive second-order algorithm for the parameters in fuzzy neural network is

where Ψ(t) is the quasi-Hessian matrix, Ω(t) is the gradient vector, I is the identity matrix which is employed to avoid the ill condition in solving inverse matrix and λ(t) is the adaptive

where τmax(t) and τmin(t) are the maximum and minimum eigenvalues of Ψ(t), respectively, (0 < τmin(t) < τmax(t), 0 < λ(t) < 1,) and the variable vector Θ(t) contains three kinds of variables:

<sup>Θ</sup>ð Þ¼ <sup>1</sup> <sup>w</sup>1ð Þ<sup>1</sup> ; <sup>⋯</sup>; <sup>w</sup>3ð Þ<sup>1</sup> ; <sup>⋯</sup>; wPð Þ<sup>1</sup> ; <sup>c</sup>1ð Þ<sup>1</sup> ; <sup>⋯</sup>; <sup>c</sup>jð Þ<sup>1</sup> ; <sup>⋯</sup>; <sup>c</sup>Pð Þ<sup>1</sup> ;σ1ð Þ<sup>1</sup> ; <sup>⋯</sup>;σjð Þ<sup>1</sup> ; <sup>⋯</sup>; <sup>σ</sup>Pð Þ<sup>1</sup> � �

In this adaptive second-order optimization algorithm, the output parameter matrix W, the center vector c and the width vector σ can be optimized simultaneously. The quasi-Hessian matrix Ψ(t) and the gradient vector Ω(t) are accumulated as the sum of related submatrices

the output parameter matrix W, the center vector c and the width vector σ

neurons in the normalized layer, and ϕ<sup>j</sup> is the output value of the jth RBF neuron

, j ¼ 1, 2, …, P; l ¼ 1, 2, …, P, (17)

http://dx.doi.org/10.5772/intechopen.74984

97

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

ij , i ¼ 1, 2, …, k; j ¼ 1, 2, …, P, (18)

ui ¼ xi, i ¼ 1, 2, …, k, (19)

λðÞ¼ t μð Þt λð Þ t � 1 , (21)

: (23)

<sup>Θ</sup>ð Þ¼ <sup>t</sup> <sup>þ</sup> <sup>1</sup> <sup>Θ</sup>ð Þþ <sup>t</sup> ð Þ <sup>Ψ</sup>ð Þþ <sup>t</sup> <sup>λ</sup>ð Þ� <sup>t</sup> <sup>I</sup> �<sup>1</sup> � <sup>Ω</sup>ð Þ<sup>t</sup> , (20)

<sup>μ</sup>ðÞ¼ <sup>t</sup> <sup>τ</sup>minð Þþ <sup>t</sup> <sup>λ</sup>ð Þ <sup>t</sup> � <sup>1</sup> � �<sup>=</sup> <sup>τ</sup>max ð Þ ð Þþ <sup>t</sup> <sup>1</sup> , (22)

where matrix E is used to detect misbehavior in the modeling process.

#### 3.2. Self-organizing fuzzy neural network

To predict the effluent SNH through the principal process variables, a multi-input and singleoutput SOFNN is developed. The structure of the fuzzy neural network is shown in Figure 2.

The mathematical description of this multi-input and single-output fuzzy neural network is given below:

$$
\widehat{\mathcal{g}} = \mathbf{W}\mathbf{v},
\tag{15}
$$

where ĝ is the output of the output layer, W = [w1, w2,…, wP] are the weights between the output layer and the normalized layer, P is the number of neurons in the normalized layer and v is the output of the normalized layer and for a fuzzy model

$$\widehat{\mathbf{g}} = \mathbf{W}\mathbf{v} = \frac{\sum\_{l=1}^{p} \mathbf{z}v\_l \mathbf{e}}{\sum\_{j=1}^{p} \mathbf{z}^{-\sum\_{i=1}^{k} \frac{\mathbf{z}\_{ij} - c\_{ij}}{2s\_{ij}^2}}} \tag{16}$$

where vl is the output of the lth normalized neuron and v = [v1, v2,…,vP] <sup>T</sup> and

Figure 2. The structure of fuzzy neural network.

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process http://dx.doi.org/10.5772/intechopen.74984 97

$$\sigma\_{l} = \frac{\phi\_{l}}{\sum\_{j=1}^{p} \phi\_{j}} = \frac{e^{-\sum\_{i=1}^{k} \frac{\left(x\_{i} - c\_{i}\right)^{2}}{2x\_{i}^{2}}}}{\sum\_{j=1}^{p} e^{-\sum\_{i=1}^{k} \frac{\left(x\_{i} - c\_{i}\right)^{2}}{2x\_{i}^{2}}}}, \quad j = 1, 2, \dots, P; \ l = 1, 2, \dots, P. \tag{17}$$

The number of neurons in the radial basis function (RBF) layer is equal to the number of neurons in the normalized layer, and ϕ<sup>j</sup> is the output value of the jth RBF neuron

where rm,<sup>m</sup> is the correlation coefficient and Λ is a diagonal matrix of the eigenvalues associated with the eigenvectors contained in the columns of matrix V. The contribution rate of each component is calculated by Λ, the principal component factor loading matrix P is then calcu-

To predict the effluent SNH through the principal process variables, a multi-input and singleoutput SOFNN is developed. The structure of the fuzzy neural network is shown in Figure 2. The mathematical description of this multi-input and single-output fuzzy neural network is

where ĝ is the output of the output layer, W = [w1, w2,…, wP] are the weights between the output layer and the normalized layer, P is the number of neurons in the normalized layer and

> P P l¼1 wle � Pk i¼1 xi�<sup>c</sup> ð Þil <sup>2</sup> 2σ2 il

P P j¼1 e � Pk i¼1 xi�<sup>c</sup> ð Þij 2 2σ2 ij

<sup>T</sup> <sup>¼</sup> XP<sup>T</sup> <sup>þ</sup> <sup>E</sup>, (14)

<sup>b</sup><sup>g</sup> <sup>¼</sup> Wv, (15)

, (16)

<sup>T</sup> and

lated according to Λ and V. The projected matrix T in the new space is defined as

where matrix E is used to detect misbehavior in the modeling process.

v is the output of the normalized layer and for a fuzzy model

<sup>b</sup><sup>g</sup> <sup>¼</sup> Wv <sup>¼</sup>

where vl is the output of the lth normalized neuron and v = [v1, v2,…,vP]

3.2. Self-organizing fuzzy neural network

Figure 2. The structure of fuzzy neural network.

given below:

96 Wastewater and Water Quality

$$\phi\_j = \prod\_{i=1}^k A\_j^i(\mathbf{x}\_j) = \prod\_{i=1}^k e^{-\frac{\left(\mathbf{x}\_i - \epsilon\_{\bar{\eta}}\right)^2}{2\sigma\_{\bar{\eta}}^2}} = e^{-\sum\_{i=1}^k \frac{\left(\mathbf{x}\_i - \epsilon\_{\bar{\eta}}\right)^2}{2\sigma\_{\bar{\eta}}^2}}, \quad i = 1, 2, \dots, k; \quad j = 1, 2, \dots, P. \tag{18}$$

c<sup>j</sup> = [c1j,c2j,…,ckj] and σ<sup>j</sup> = [σ1j, σ2j,…,σkj] are the vectors of centers and widths of the jth RBF neuron, respectively, and

$$
\mu\_i = \mathbf{x}\_i \quad \mathbf{i} = 1, 2, \dots, k \tag{19}
$$

where x = [x1,x2,…,xk] is the input vector of the input layer and U = [u1,u2,…,uk] is the input of the RBF layer.

Following the computation procedure in the Levenberg-Marquardt algorithm, the updated rule of the adaptive second-order algorithm for the parameters in fuzzy neural network is given by

$$
\Theta(t+1) = \Theta(t) + \left(\Psi(t) + \lambda(t) \times \mathbf{I}\right)^{-1} \times \Omega(t), \tag{20}
$$

where Ψ(t) is the quasi-Hessian matrix, Ω(t) is the gradient vector, I is the identity matrix which is employed to avoid the ill condition in solving inverse matrix and λ(t) is the adaptive learning rate defined as:

$$
\lambda(t) = \mu(t)\lambda(t-1),\tag{21}
$$

$$
\mu(t) = \left(\tau^{\min}(t) + \lambda(t-1)\right) / (\tau^{\max}(t) + 1),
\tag{22}
$$

where τmax(t) and τmin(t) are the maximum and minimum eigenvalues of Ψ(t), respectively, (0 < τmin(t) < τmax(t), 0 < λ(t) < 1,) and the variable vector Θ(t) contains three kinds of variables: the output parameter matrix W, the center vector c and the width vector σ

$$\Theta(1) = \left[ w\_1(1), \dots, w\_3(1), \dots, w\_{\mathbb{P}}(1), \mathbf{c}\_1(1), \dots, \mathbf{c}\_{\mathbb{P}}(1), \dots, \mathbf{c}\_{\mathbb{P}}(1), \mathfrak{a}\_1(1), \dots, \mathfrak{a}\_{\mathbb{P}}(1), \dots, \mathfrak{a}\_{\mathbb{P}}(1) \right]. \tag{23}$$

In this adaptive second-order optimization algorithm, the output parameter matrix W, the center vector c and the width vector σ can be optimized simultaneously. The quasi-Hessian matrix Ψ(t) and the gradient vector Ω(t) are accumulated as the sum of related submatrices and vectors.

$$\mathbf{\dot{V}}(t) = \mathbf{j}^T(t)\mathbf{j}(t),\tag{24}$$

<sup>A</sup>ðÞ¼ <sup>t</sup> ð Þ <sup>Z</sup>ð Þ<sup>t</sup> <sup>T</sup>Zð Þ<sup>t</sup>

<sup>B</sup>ðÞ¼ <sup>t</sup> ð Þ <sup>Z</sup>ð Þ<sup>t</sup> <sup>T</sup>Zð Þ<sup>t</sup>

S(t)=[ξ 1, ξ 2,…, ξ P] is the eigenvectors of Î(t)(Î(t))<sup>T</sup>

where y(t) and ĝqt) are the desired and real output values.

with the largest relative importance index

of (Î(t))<sup>T</sup>

neuron.

1. Growing phase.

h i-1

h i-1

where <sup>A</sup>(t) is <sup>P</sup>�<sup>P</sup> and <sup>B</sup>(t) is <sup>P</sup>�1, <sup>Ĝ</sup>(t)=[ĝ(t), <sup>ĝ</sup>(t�1), …, <sup>ĝ</sup>(t-<sup>N</sup> + 1)]T and

ð Þ <sup>Z</sup>ð Þ<sup>t</sup> <sup>T</sup>

Î(t), Δ(t) is the singular matrix of Î(t), Î l(t)=[w l(t)�vl(x(t)), w l(t)�vl(x(t�1)),…, w l(t)�

� ð Þ y tð Þ-bg tð Þ <sup>2</sup>

If E(Θ(t)) is larger than E(Θ(t�1)), a new neuron will be inserted to the normalized layer. The parameters of the new normalized neuron are designated by the normalized neuron

R(t)=[R 1(t), R 2(t), …, RP(t)], Rm(t) is the mth normalized neuron with the largest relative

1 2

> � Pk i¼1

where cnew(t) and σnew(t) are the center vector and width vector of the new normalized neuron, respectively, wnew(t) is the weight of new normalized neuron, cm(t) and σm(t) are

importance index. The parameters of new normalized neuron are designed as:

cnewðÞ¼ t c<sup>P</sup>þ<sup>1</sup>ðÞ¼ t

wnewðÞ¼ <sup>t</sup> y tð Þ� <sup>b</sup>g tð Þ=<sup>e</sup>

the center vector and width vector of the mth normalized neuron, respectively.

vl(x(t–T + 1))]<sup>T</sup> and T is the preset number of sample. The relative importance index of each normalized neuron represents the contribution of each normalized neuron to each output

Before introducing the self-organizing mechanism, the error of the output is defined as:

1 2

Eð Þ¼ Θð Þt

The procedure of the proposed self-organizing mechanism is given as follows:

<sup>G</sup><sup>b</sup> ðÞ¼ <sup>t</sup> ð Þ <sup>Z</sup>ð Þ<sup>t</sup> <sup>T</sup>

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

ð Þ <sup>Z</sup>ð Þ<sup>t</sup> <sup>T</sup> <sup>b</sup>IðÞ¼ <sup>t</sup> ð Þ <sup>Z</sup>ð Þ<sup>t</sup> <sup>T</sup> <sup>b</sup>Ið Þ<sup>t</sup> , (34)

ZðÞ¼ t Sð Þt Sbð Þt , (36)

bIðÞ¼ t Sð Þt Δð Þt Sbð Þt , (37)

RmðÞ¼ t max Rð Þt , (39)

σnewðÞ¼ t σ<sup>P</sup>þ<sup>1</sup>ðÞ¼ t σmð Þt , (41)

uið Þ�<sup>t</sup> <sup>c</sup> ð Þ inewð Þ<sup>t</sup> <sup>2</sup> 2σ2 inewð Þ<sup>t</sup>

ð Þ cmð Þþ t xð Þt , (40)

, (42)

, Ŝ(t)=[ζ 1, ζ 2,…, ζP] is the eigenvectors

, (38)

Gb ð Þt , (35)

99

http://dx.doi.org/10.5772/intechopen.74984

$$\mathbf{Q}(t) = \mathbf{j}^T(t)e(t),\tag{25}$$

$$e(t) = y(t) - \widehat{\mathcal{g}}(t),\tag{26}$$

where e(t) is the error between the output layer and the real output at time t, and the Jacobian vector j(t) is calculated as:

$$\mathbf{j}(t) = \begin{bmatrix} \frac{\partial \mathbf{e}(t)}{\partial w\_1(t)}, \dots, \frac{\partial \mathbf{e}(t)}{\partial w\_2(t)}, \dots, \frac{\partial \mathbf{e}(t)}{\partial w\_P(t)}, \frac{\partial \mathbf{e}(t)}{\partial \mathbf{c}\_1(t)}, \dots, \frac{\partial \mathbf{e}(t)}{\partial \mathbf{c}\_j(t)}, \dots, \frac{\partial \mathbf{e}(t)}{\partial \mathbf{c}\_P(t)}, \frac{\partial \mathbf{e}(t)}{\partial \mathbf{c}\_1(t)}, \dots, \frac{\partial \mathbf{e}(t)}{\partial \mathbf{c}\_P(t)}, \dots \frac{\partial \mathbf{e}(t)}{\partial \mathbf{c}\_P(t)} \end{bmatrix}. \tag{27}$$

The elements of the Jacobian vector j(t) are given as:

$$\frac{\partial \mathbf{e}(t)}{\partial w\_p(t)} = -\upsilon\_p(t), \quad p = 1, 2, \cdots, P,\tag{28}$$

$$\frac{\partial \mathbf{c}(t)}{\partial \mathbf{c}\_{j}(t)} = \left[ \frac{\partial \mathbf{c}(t)}{\partial \mathbf{c}\_{1j}(t)}, \frac{\partial \mathbf{c}(t)}{\partial \mathbf{c}\_{2j}(t)}, \dots, \frac{\partial \mathbf{c}(t)}{\partial \mathbf{c}\_{kj}(t)} \right],\tag{29}$$

$$\frac{\partial \mathbf{c}(t)}{\partial \mathbf{c}\_{\vec{\eta}}(t)} = -\frac{2\mathbf{z}\mathbf{w}(t) \times \mathbf{w}\_{i}(t) \times \left[\mathbf{x}\_{i}(t) - \mathbf{c}\_{\vec{\eta}}(t)\right]}{\sigma\_{\vec{\eta}}(t)}, \quad \mathbf{i} = 1, 2, \cdots, k,\tag{30}$$

$$\frac{\partial \mathbf{e}(t)}{\partial \sigma\_{j}(t)} = \begin{bmatrix} \frac{\partial \mathbf{e}(t)}{\partial \sigma\_{1j}(t)}, \frac{\partial \mathbf{e}(t)}{\partial \sigma\_{2j}(t)}, \dots, \frac{\partial \mathbf{e}(t)}{\partial \sigma\_{kj}(t)} \end{bmatrix},\tag{31}$$

$$\frac{\partial c(t)}{\partial \sigma\_{\vec{\eta}}(t)} = -\frac{w\_{\vec{\eta}}(t) \times \sigma\_{\vec{\imath}}(t) \times \left\| \mathbf{x}\_{\vec{\imath}}(t) - c\_{\vec{\imath}}(t) \right\|^2}{\sigma\_{\vec{\imath}}^2(t)}.\tag{32}$$

With Eqs. (28)–(32), all the elements of the Jacobian vector j(t) can be calculated. Then, the quasi-Hessian matrix Ψ(t) and the gradient vector Ω(t) are obtained from Eqs. (24)–(25), so as to apply the updated rule (20) to parameter adjustment. From the former analysis, some remarks are emphasized.

To grow or prune the structure of the fuzzy neural network, relative importance index is utilized. The values of relative importance index can be used to determine the proportion of output values in a multiple regression equation. The relative importance index of each neuron in the normalized layer is defined as:

$$R\_k(t) = \frac{\sum\_{l=1}^{P} a\_{kl}(t) \times b\_l(t)}{\sum\_{l=1}^{P} \sum\_{l=1}^{P} a\_{kl}(t) \times b\_l(t)}, k = 1, 2, \dots, P,\tag{33}$$

where R k(t) is the relative importance index of the kth normalized neuron at time t; the regression coefficients B(t)=[q 1(t), b 2(t),…, b P(t)]<sup>T</sup> and A(t)=[a 1(t), a 2(t),…, a P(t)] (a l = [a 1 l(t),…, a Pl(t)]<sup>T</sup> ) can be calculated as:

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process http://dx.doi.org/10.5772/intechopen.74984 99

$$\mathbf{A}(t) = \left[ (\mathbf{Z}(t))^{\mathrm{T}} \mathbf{Z}(t) \right]^{\mathrm{1}} (\mathbf{Z}(t))^{\mathrm{T}} \widehat{\mathbf{I}}(t) = (\mathbf{Z}(t))^{\mathrm{T}} \widehat{\mathbf{I}}(t), \tag{34}$$

$$\mathbf{B}(t) = \left[ (\mathbf{Z}(t))^{\mathrm{T}} \mathbf{Z}(t) \right]^{-1} (\mathbf{Z}(t))^{\mathrm{T}} \widehat{\mathbf{G}}(t) = (\mathbf{Z}(t))^{\mathrm{T}} \widehat{\mathbf{G}}(t) \tag{35}$$

where <sup>A</sup>(t) is <sup>P</sup>�<sup>P</sup> and <sup>B</sup>(t) is <sup>P</sup>�1, <sup>Ĝ</sup>(t)=[ĝ(t), <sup>ĝ</sup>(t�1), …, <sup>ĝ</sup>(t-<sup>N</sup> + 1)]T and

$$\mathbf{Z}(t) = \mathbf{S}(t)\dot{\mathbf{S}}(t),\tag{36}$$

$$
\dot{\mathbf{I}}(t) = \mathbf{S}(t)\boldsymbol{\Delta}(t)\dot{\mathbf{S}}(t), \tag{37}
$$

S(t)=[ξ 1, ξ 2,…, ξ P] is the eigenvectors of Î(t)(Î(t))<sup>T</sup> , Ŝ(t)=[ζ 1, ζ 2,…, ζP] is the eigenvectors of (Î(t))<sup>T</sup> Î(t), Δ(t) is the singular matrix of Î(t), Î l(t)=[w l(t)�vl(x(t)), w l(t)�vl(x(t�1)),…, w l(t)� vl(x(t–T + 1))]<sup>T</sup> and T is the preset number of sample. The relative importance index of each normalized neuron represents the contribution of each normalized neuron to each output neuron.

Before introducing the self-organizing mechanism, the error of the output is defined as:

$$E(\Theta(t)) = \frac{1}{2} \times \left( y(t) \text{-} \widehat{\mathbf{g}}(t) \right)^2,\tag{38}$$

where y(t) and ĝqt) are the desired and real output values.

The procedure of the proposed self-organizing mechanism is given as follows:

1. Growing phase.

ΨðÞ¼ t j

ΩðÞ¼ t j

vector j(t) is calculated as:

<sup>∂</sup>w1ð Þ<sup>t</sup> ; <sup>⋯</sup>; <sup>∂</sup>e tð Þ

<sup>∂</sup>w2ð Þ<sup>t</sup> ; <sup>⋯</sup>; <sup>∂</sup>e tð Þ

The elements of the Jacobian vector j(t) are given as:

∂e tð Þ

<sup>∂</sup>wPð Þ<sup>t</sup> ;

∂e tð Þ

∂e tð Þ

∂e tð Þ

∂e tð Þ

RkðÞ¼ t

P P l¼1

P P k¼1 P P l¼1

) can be calculated as:

<sup>∂</sup>cjð Þ<sup>t</sup> <sup>¼</sup> <sup>∂</sup>e tð Þ

<sup>∂</sup>σjð Þ<sup>t</sup> <sup>¼</sup> <sup>∂</sup>e tð Þ

<sup>∂</sup>cijð Þ<sup>t</sup> ¼ � <sup>2</sup>wjð Þ� <sup>t</sup> við Þ� <sup>t</sup> xið Þ� <sup>t</sup> cijð Þ<sup>t</sup> � �

∂e tð Þ <sup>∂</sup>c1ð Þ<sup>t</sup> ; <sup>⋯</sup>;

∂e tð Þ

98 Wastewater and Water Quality

remarks are emphasized.

(a l = [a 1 l(t),…, a Pl(t)]<sup>T</sup>

in the normalized layer is defined as:

jðÞ¼ t

where e(t) is the error between the output layer and the real output at time t, and the Jacobian

∂e tð Þ

� �

<sup>∂</sup>c1jð Þ<sup>t</sup> ; <sup>∂</sup>e tð Þ

<sup>∂</sup>σ1jð Þ<sup>t</sup> ; <sup>∂</sup>e tð Þ

<sup>∂</sup>σijð Þ<sup>t</sup> ¼ � wjð Þ� <sup>t</sup> við Þ� <sup>t</sup> xið Þ� <sup>t</sup> cijð Þ<sup>t</sup> �

With Eqs. (28)–(32), all the elements of the Jacobian vector j(t) can be calculated. Then, the quasi-Hessian matrix Ψ(t) and the gradient vector Ω(t) are obtained from Eqs. (24)–(25), so as to apply the updated rule (20) to parameter adjustment. From the former analysis, some

To grow or prune the structure of the fuzzy neural network, relative importance index is utilized. The values of relative importance index can be used to determine the proportion of output values in a multiple regression equation. The relative importance index of each neuron

aklð Þ� t blð Þt

aklð Þ� t blð Þt

where R k(t) is the relative importance index of the kth normalized neuron at time t; the regression coefficients B(t)=[q 1(t), b 2(t),…, b P(t)]<sup>T</sup> and A(t)=[a 1(t), a 2(t),…, a P(t)]

<sup>∂</sup>cjð Þ<sup>t</sup> ; <sup>⋯</sup>; <sup>∂</sup>e tð Þ

<sup>∂</sup>c2jð Þ<sup>t</sup> ; <sup>⋯</sup>; <sup>∂</sup>e tð Þ

<sup>∂</sup>σ2jð Þ<sup>t</sup> ; <sup>⋯</sup>; <sup>∂</sup>e tð Þ

� �

� �

σ2

<sup>T</sup>ð Þ<sup>t</sup> <sup>j</sup>ð Þ<sup>t</sup> , (24)

<sup>T</sup>ð Þ<sup>t</sup> e tð Þ, (25)

<sup>∂</sup>σ1ð Þ<sup>t</sup> ; <sup>⋯</sup>; <sup>∂</sup>e tð Þ

<sup>σ</sup>ijð Þ<sup>t</sup> , i <sup>¼</sup> <sup>1</sup>, <sup>2</sup>, <sup>⋯</sup>, k, (30)

� 2

ijð Þ<sup>t</sup> : (32)

, k ¼ 1, 2, ⋯, P, (33)

<sup>∂</sup>σjð Þ<sup>t</sup> ; <sup>⋯</sup> <sup>∂</sup>e tð Þ

, (29)

, (31)

∂σPð Þt

: (27)

e tðÞ¼ y tðÞ� <sup>b</sup>g tð Þ, (26)

<sup>∂</sup>cPð Þ<sup>t</sup> ; <sup>∂</sup>e tð Þ

<sup>∂</sup>wpð Þ<sup>t</sup> ¼ �vpð Þ<sup>t</sup> , p <sup>¼</sup> <sup>1</sup>, <sup>2</sup>, <sup>⋯</sup>, P, (28)

∂ckjð Þt

∂σkjð Þt

� �

If E(Θ(t)) is larger than E(Θ(t�1)), a new neuron will be inserted to the normalized layer. The parameters of the new normalized neuron are designated by the normalized neuron with the largest relative importance index

$$R\_m(t) = \max \mathbf{R}(t),\tag{39}$$

R(t)=[R 1(t), R 2(t), …, RP(t)], Rm(t) is the mth normalized neuron with the largest relative importance index. The parameters of new normalized neuron are designed as:

$$\mathbf{c}\_{new}(t) = \mathbf{c}\_{P+1}(t) = \frac{1}{2}(\mathbf{c}\_{\text{m}}(t) + \mathbf{x}(t)),\tag{40}$$

$$\mathfrak{o}\_{new}(t) = \mathfrak{o}\_{P+1}(t) = \mathfrak{o}\_{m}(t),\tag{41}$$

$$\pi w\_{new}(t) = y(t) - \widehat{\mathfrak{g}}(t) / e^{-\sum\_{i=1}^{k} \frac{\left(\frac{\mathfrak{u}\_{i}(t) - c\_{\text{inner}}(t)}{2\sigma\_{\text{inner}}^2(t)}\right)^2}{2\sigma\_{\text{inner}}^2(t)}},\tag{42}$$

where cnew(t) and σnew(t) are the center vector and width vector of the new normalized neuron, respectively, wnew(t) is the weight of new normalized neuron, cm(t) and σm(t) are the center vector and width vector of the mth normalized neuron, respectively.

2. Pruning phase.

In the training process, if E(Θ(t)) is less than E(Θ(t�1)) and

$$R\_h(t) \le R\_{r\prime} \tag{43}$$

experts in urban WWTP, five process variables have been chosen as the input variables to develop the intelligent method: SPO4, ORP, SO2, TSS and PH, respectively. SPO<sup>4</sup> is an important index of the effluent, ORP reflects the concentration of oxide, SO<sup>2</sup> is an important indicator to the growth of organic matter and the nitrification reaction, TSS stands for the degree of wastewater treatment and PH stands for the acid-base property of the wastewater. The input variables determined for the effluent SNH are listed in Table 1. The detailed selection process and analyzation process are shown in [22]. Meanwhile, the online measurement instruments

CHM-301 is the SPO<sup>4</sup> detector, AODJ-QX6530 is the portable ORP probe, WTW oxi/340i is the

Taking advantage of the abovementioned analysis, an experimental hardware is set up.

WWTP (shown in Figure 3). In this experimental hardware, online sensors, effluent SNH

The online sensors consist of five parts: TP detector, ORP probe, SO probe, TSS analyzer and PH detector. The output signals from the sensors are integrated and connected to programmable logical controller (PLC, S7-200) for transmitting primary indictors. The PLC system is interfaced with equipped sensors and collected reliable data in form of 4-20mA electrical signals with a fast response time. Moreover, the PLC system has been connected through a serial port (RS 232, Siemens AG) of the host computer, which uses the real-time data to calculate the values of key variables and also stores the data in form of local file. The sensors are operated in continuous/online measurement mode, and the historical process data are routinely acquired and stored in the data acquisition system. The process data are periodically collected from the reactor to check whether the system is operating as scheduled during the experiments. Then, after preprocessing, the data are applied to the proposed SOFNN method. In SOFNN, five neurons are determined in the input layer based on the analyzed related process variables SPO4, ORP, SO2, TSS and PH. According to the experienced experts, there are 10 neurons in both RBF layer and normalized layer initially, and then the neurons in normalized layer are self-organized based on the relative importance index to guarantee the prediction accuracy. The number of output neuron is one, which represents the predicted

Variables Units Main apparatus and instrument

SPO<sup>4</sup> (total phosphorus) mg/L CHM-301 ORP (oxidation reduction potential) — AODJ-QX6530 SO<sup>2</sup> (dissolved oxygen) mg/L WTW oxi/340i TSS (total suspended solid) mg/L 7110 MTF-FG PH — pH 700

Table 1. The principal variables' measurement with online sensors.

/O) treatment process with the online sensors is employed in urban

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

http://dx.doi.org/10.5772/intechopen.74984

101

portable SO<sup>2</sup> probe, 7110 MTF-FG is the TSS analyzer and pH 700 is the PH detector.

used for obtaining the process values are also displayed.

models based on fuzzy neural network are schematically shown.

Anaerobic-anoxic-oxic (A<sup>2</sup>

effluent SNH.

Rr∈(0, E0) is the threshold, where

$$R\_h(t) = \min \, \mathbf{R}(t). \tag{44}$$

Then, the hth normalized neuron will be pruned and the parameters of remaining normalized neuron will be updated

$$\mathbf{c}'\_{h'}(t) = \mathbf{c}\_{h'}(t),\tag{45}$$

$$\mathfrak{o}\_{h'}'(t) = \mathfrak{o}\_{h'}(t),\tag{46}$$

$$w\_{\dot{h}^{\prime}}(t) = \frac{w\_{\dot{h}^{\prime}}(t)e^{-\sum\_{i=1}^{k}\left(u\_{i}(t) - c\_{\dot{\imath},\dot{h}^{\prime}}(t)\right)^{2}/2\sigma\_{\dot{\imath},\dot{h}^{\prime}}^{2}(t)}{e^{-\sum\_{i=1}^{k}\left(u\_{i}(t) - c\_{\dot{\imath},\dot{h}^{\prime}}(t)\right)^{2}/2\sigma\_{\dot{\imath},\dot{h}^{\prime}}^{2}(t)}},\tag{47}$$

$$\mathbf{c}'\_h(t) = \mathbf{0},\tag{48}$$

$$
\mathfrak{o}'\_h(t) = 0,
\tag{49}
$$

$$\mathbf{w}'\_h(t) = \mathbf{0},\tag{50}$$

where the h'th normalized neuron is nearest to the hth normalized neuron with the smallest Euclidean distance, w<sup>h</sup> 0 (t) and wh'(t) are the hth weight vector and the h'th weight vector after pruning the hth normalized neuron, respectively, c<sup>h</sup> 0 (t) and σ<sup>h</sup> 0 (t) are the center vector and width vector of the hth normalized neuron after the neuron is pruned, respectively, and c<sup>0</sup> <sup>h</sup>'(t) and σ<sup>0</sup> <sup>h</sup>'(t) are the center vector and width vector of the h'th normalized neuron after the neuron is pruned, respectively.

#### 4. Simulation results and analysis

In this section, the effectiveness of the proposed intelligent modeling method based on SOFNN is evaluated. A brief introduction to experimental setup is provided before the experimental results are detailed.

#### 4.1. Experimental setup

The performance of the online prediction for the effluent SNH depends heavily on the determination of the input variables. Based on the analysis of PCA and the work experience of the experts in urban WWTP, five process variables have been chosen as the input variables to develop the intelligent method: SPO4, ORP, SO2, TSS and PH, respectively. SPO<sup>4</sup> is an important index of the effluent, ORP reflects the concentration of oxide, SO<sup>2</sup> is an important indicator to the growth of organic matter and the nitrification reaction, TSS stands for the degree of wastewater treatment and PH stands for the acid-base property of the wastewater. The input variables determined for the effluent SNH are listed in Table 1. The detailed selection process and analyzation process are shown in [22]. Meanwhile, the online measurement instruments used for obtaining the process values are also displayed.

2. Pruning phase.

100 Wastewater and Water Quality

Rr∈(0, E0) is the threshold, where

ized neuron will be updated

wh'ðÞ¼ t

smallest Euclidean distance, w<sup>h</sup>

<sup>h</sup>'(t) and σ<sup>0</sup>

4. Simulation results and analysis

neuron after the neuron is pruned, respectively.

tively, and c<sup>0</sup>

are detailed.

4.1. Experimental setup

wh'ð Þt e � Pk i¼1

In the training process, if E(Θ(t)) is less than E(Θ(t�1)) and

Rhð Þt ≤ Rr, (43)

RhðÞ¼ t min Rð Þt : (44)

<sup>h</sup>'ðÞ¼ t σh'ð Þt , (46)

ð Þ uið Þ�<sup>t</sup> ci, <sup>h</sup>ð Þ<sup>t</sup> <sup>2</sup>

<sup>h</sup>ðÞ¼ t 0, (48)

<sup>h</sup>ðÞ¼ t 0, (49)

<sup>h</sup>ðÞ¼ t 0, (50)

(t) and wh'(t) are the hth weight vector and the h'th weight

<sup>h</sup>'(t) are the center vector and width vector of the h'th normalized

0

(t) and σ<sup>h</sup>

0

0ð Þt , (45)

=2σ<sup>2</sup> i, <sup>h</sup>ð Þt

, (47)

(t) are the center

Then, the hth normalized neuron will be pruned and the parameters of remaining normal-

c0 h 0ðÞ¼ t c<sup>h</sup>

σ0

=2σ<sup>2</sup> i, <sup>h</sup>'ð Þ<sup>t</sup> <sup>þ</sup> wq <sup>h</sup>ð Þt e � Pk i¼1

> =2σ<sup>2</sup> i, <sup>h</sup>' ð Þt

uið Þ�t ci,h'ð Þt � �<sup>2</sup>

where the h'th normalized neuron is nearest to the hth normalized neuron with the

vector and width vector of the hth normalized neuron after the neuron is pruned, respec-

In this section, the effectiveness of the proposed intelligent modeling method based on SOFNN is evaluated. A brief introduction to experimental setup is provided before the experimental results

The performance of the online prediction for the effluent SNH depends heavily on the determination of the input variables. Based on the analysis of PCA and the work experience of the

uið Þ�t ci,h'ð Þt � �<sup>2</sup>

0

vector after pruning the hth normalized neuron, respectively, c<sup>h</sup>

e � Pk i¼1

c0

σ0

w<sup>0</sup>

CHM-301 is the SPO<sup>4</sup> detector, AODJ-QX6530 is the portable ORP probe, WTW oxi/340i is the portable SO<sup>2</sup> probe, 7110 MTF-FG is the TSS analyzer and pH 700 is the PH detector.

Taking advantage of the abovementioned analysis, an experimental hardware is set up. Anaerobic-anoxic-oxic (A<sup>2</sup> /O) treatment process with the online sensors is employed in urban WWTP (shown in Figure 3). In this experimental hardware, online sensors, effluent SNH models based on fuzzy neural network are schematically shown.

The online sensors consist of five parts: TP detector, ORP probe, SO probe, TSS analyzer and PH detector. The output signals from the sensors are integrated and connected to programmable logical controller (PLC, S7-200) for transmitting primary indictors. The PLC system is interfaced with equipped sensors and collected reliable data in form of 4-20mA electrical signals with a fast response time. Moreover, the PLC system has been connected through a serial port (RS 232, Siemens AG) of the host computer, which uses the real-time data to calculate the values of key variables and also stores the data in form of local file. The sensors are operated in continuous/online measurement mode, and the historical process data are routinely acquired and stored in the data acquisition system. The process data are periodically collected from the reactor to check whether the system is operating as scheduled during the experiments. Then, after preprocessing, the data are applied to the proposed SOFNN method. In SOFNN, five neurons are determined in the input layer based on the analyzed related process variables SPO4, ORP, SO2, TSS and PH. According to the experienced experts, there are 10 neurons in both RBF layer and normalized layer initially, and then the neurons in normalized layer are self-organized based on the relative importance index to guarantee the prediction accuracy. The number of output neuron is one, which represents the predicted effluent SNH.


Table 1. The principal variables' measurement with online sensors.

The predicting results and the predicting error of the effluent SNH concentration are shown in Figures 4–6. Additionally, to show the performance of SOFNN clearly, Table 2 shows the network structure, the mean testing RMSE and the mean accuracy in comparison with other methods.

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

http://dx.doi.org/10.5772/intechopen.74984

103

The prediction results of the effluent SNH based on SOFNN are displayed in Figures 4–6. The training RMSE of the effluent SNH is shown in Figure 4; it can be observed that the final value can reach 0.02. In Figure 5, the predicted results are displayed, both the SOFNN outputs and real outputs. The predicted outputs based on SOFNN can approximate the real outputs with little errors. Meanwhile, the errors are displayed in Figure 6, which remain in the range of

Figure 4. The training RMSE.

Figure 5. The testing results of the effluent SNH.

Figure 3. Experiment diagram of the online modeling.

#### 4.2. Experimental results

An intelligent modeling method based on the proposed SOFNN is proposed to predict the effluent SNH concentration by the determined principal process variables. All data are collected on a daily basis and covered all four seasons. The daily frequency of measurements is considered sufficient because of the long residence times in WWTP. To guarantee the efficiency in this soft-computing method, all variables are normalized and denormalized by taking advantage of the maximum and minimum values before and after application. The input-output water quality data were collected from a real-world wastewater treatment plant (Beijing, China) over the year 2014. After deleting the abnormal data, 280 samples were obtained and normalized; 140 samples from 1/5/2014 to 30/9/2014 were taken as the training data while the remaining 140 samples from 1/10/2014 to 30/11/2014 were employed as testing data.

The error measures for the effluent NH4 are 0.1 mg/L confidence limits. Both the mean testing

$$\text{RMSE} \sqrt{\sum\_{n=1}^{N} \left( y\_n(t) - \widehat{g}\_n(t) \right)^2} / N \text{ and the mean predicting accuracy} \left( \sum\_{t=1}^{\text{Days}} \left( 1 - e(t) / \widehat{g}(t) \right) / \text{Days} \right)^2$$

are utilized as the performance indices to assess the modeling performance, where N is the number of samples.

The predicting results and the predicting error of the effluent SNH concentration are shown in Figures 4–6. Additionally, to show the performance of SOFNN clearly, Table 2 shows the network structure, the mean testing RMSE and the mean accuracy in comparison with other methods.

The prediction results of the effluent SNH based on SOFNN are displayed in Figures 4–6. The training RMSE of the effluent SNH is shown in Figure 4; it can be observed that the final value can reach 0.02. In Figure 5, the predicted results are displayed, both the SOFNN outputs and real outputs. The predicted outputs based on SOFNN can approximate the real outputs with little errors. Meanwhile, the errors are displayed in Figure 6, which remain in the range of

Figure 4. The training RMSE.

4.2. Experimental results

102 Wastewater and Water Quality

Figure 3. Experiment diagram of the online modeling.

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi

ynð Þ� <sup>t</sup> <sup>b</sup>gnð Þ<sup>t</sup> � �<sup>2</sup>

=N

data.

RMSE

P N n¼1

number of samples.

s

An intelligent modeling method based on the proposed SOFNN is proposed to predict the effluent SNH concentration by the determined principal process variables. All data are collected on a daily basis and covered all four seasons. The daily frequency of measurements is considered sufficient because of the long residence times in WWTP. To guarantee the efficiency in this soft-computing method, all variables are normalized and denormalized by taking advantage of the maximum and minimum values before and after application. The input-output water quality data were collected from a real-world wastewater treatment plant (Beijing, China) over the year 2014. After deleting the abnormal data, 280 samples were obtained and normalized; 140 samples from 1/5/2014 to 30/9/2014 were taken as the training data while the remaining 140 samples from 1/10/2014 to 30/11/2014 were employed as testing

The error measures for the effluent NH4 are 0.1 mg/L confidence limits. Both the mean testing

are utilized as the performance indices to assess the modeling performance, where N is the

and the mean predicting accuracy

Days P t¼1

ð Þ <sup>1</sup> � e tð Þ=bg tð Þ <sup>=</sup>Days !

Figure 5. The testing results of the effluent SNH.

adaptive learning rate has the ability to improve the accuracy of approximating the global optimization parameters during the learning process. The detailed testing samples are

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

http://dx.doi.org/10.5772/intechopen.74984

105

2.18 2.55 2.21 2.73 3.00 2.81 2.75 2.83 2.94 3.17 2.70 3.24 3.13 3.32 3.43 2.74 2.82 2.59 2.47 2.20 2.39 2.32 2.60 2.23 2.53 2.11 2.10 2.73 2.54 2.58 2.70 2.65 2.78 2.67 2.83 2.72 2.99 2.83 2.98 2.73 3.05 3.00 2.76 2.38 2.88 2.95 3.04 2.97 3.36 2.75 3.42 3.03 3.41 3.23 3.08 2.97 3.09 3.03 2.95 3.06 2.76 2.24 2.58 2.60 2.88 2.32 2.55 2.60 2.27 1.92 1.82 1.73 2.51 2.33 2.53 2.21 2.65 2.19 2.85 2.23 2.48 1.94 1.97 1.52 1.67 1.60 1.43 1.53 1.57 1.57 1.54 1.69 1.44 1.21 1.19 1.11 1.00 1.00 0.90 0.80 0.68 0.62 0.54 0.52 0.47 0.44 0.35 0.34 0.30 0.30 0.27 0.29 0.28 0.25 0.25 0.23 0.23 2.24 2.27 0.27 2.18 2.55 2.21 2.73 3.00 2.81 2.75 2.83 2.94 3.17 2.70 3.24 3.13 3.32 3.43 2.74 2.82 2.59 2.47 2.20

17.43 16.54 16.79 15.13 17.18 28.20 35.76 43.97 51.53 57.17 63.07 71.01 76.85 82.49 87.81 91.91 95.37 98.19 101.14 104.21 97.80 89.28 80.69 77.49 71.98 73.83 68.64 67.23 71.14 80.82 97.61 103.57 108.32 112.16 115.49 117.99 120.05 121.65 123.12 122.67 121.20 119.79 120.75 108.44 56.21 49.86 48.84 49.22 46.34 51.40 48.01 54.99 52.94 49.67 47.75 45.95 46.21 45.63 45.76 36.40 11.73 12.11 6.09 39.74 15.25 13.01 11.28 10.25 13.33 22.24 31.66 41.28 51.47 60.63 66.27 62.36 61.34 57.11 60.89 32.05 39.55 37.56 38.33 37.69 37.43 36.66 35.89 34.48 33.07 31.08 30.76 27.62 26.47 33.33 27.82 43.26 55.95 63.90 71.85 78.90 84.09 88.90 94.22 96.97 99.28 102.42 105.50 108.64 112.10 115.56 117.99 121.07 124.47 126.84 129.21 133.06 135.43 137.09 138.95 140.94 142.67 144.02 144.85 146.52 147.48 147.99 149.02 150.62 151.90 153.63 155.49 157.28 159.08 158.76 160.87 163.24 165.94 170.17 172.79 174.78

shown in Tables 3–9.

Table 3. Testing inputs SPO4.

Table 4. Testing inputs ORP.

Figure 6. The testing errors of the effluent SNH.


Table 2. Performance comparison between different methods.

0.3. From this figure, it can be observed that the proposed adaptive fuzzy neural network has the superior prediction ability by using SPO4, ORP, SO2, TSS and PH as the inputs.

In addition, the results of SOFNN are also compared with other modeling methods, SOFNN with fixed learning rate, the self-organizing fuzzy neural network with adaptive computation algorithm (SOFNN-ACA)[23], fast and accurate online self-organizing fuzzy neural network (FAOS-PFNN) [24], growing-and-pruning fuzzy neural network (GP-FNN)[25] and the mathematic model [12].

Table 2 indicates that the proposed SOFNN can achieve with compact structure than other compared methods, the number of the final normalized neurons is 13. Higher mean accuracy is acquired by this proposed SOFNN with adaptive learning rate (mean accuracy value is 97.94%), which is higher than the proposed SOFNN-ACA [23], FAOS-PFNN [24], GP-FNN [25] and the mathematic model [12]. This means that this proposed SOFNN with


adaptive learning rate has the ability to improve the accuracy of approximating the global optimization parameters during the learning process. The detailed testing samples are shown in Tables 3–9.

Table 3. Testing inputs SPO4.

0.3. From this figure, it can be observed that the proposed adaptive fuzzy neural network has

Methods No. of final normalized neurons Mean testing RMSE Mean accuracy (%)

13 0.103 97.94

13 0.112 97.76

In addition, the results of SOFNN are also compared with other modeling methods, SOFNN with fixed learning rate, the self-organizing fuzzy neural network with adaptive computation algorithm (SOFNN-ACA)[23], fast and accurate online self-organizing fuzzy neural network (FAOS-PFNN) [24], growing-and-pruning fuzzy neural network (GP-FNN)[25] and the math-

Table 2 indicates that the proposed SOFNN can achieve with compact structure than other compared methods, the number of the final normalized neurons is 13. Higher mean accuracy is acquired by this proposed SOFNN with adaptive learning rate (mean accuracy value is 97.94%), which is higher than the proposed SOFNN-ACA [23], FAOS-PFNN [24], GP-FNN [25] and the mathematic model [12]. This means that this proposed SOFNN with

the superior prediction ability by using SPO4, ORP, SO2, TSS and PH as the inputs.

SOFNN-ACA [23] 19 0.162 96.76 FAOS-PFNN [24] 25 0.221 95.58 GP-FNN [25] 19 0.191 96.18 Mathematic model [12] — 0.772 84.56

ematic model [12].

SOFNN

SOFNN

(adaptive learning rate)

104 Wastewater and Water Quality

(fixed learning rate)

Figure 6. The testing errors of the effluent SNH.

Table 2. Performance comparison between different methods.


Table 4. Testing inputs ORP.


7.93 7.93 7.93 7.93 7.92 7.91 7.90 7.89 7.88 7.87 7.86 7.86 7.85 7.85 7.84 7.84 7.84 7.85 7.85 7.85 7.85 7.85 7.86 7.86 7.86 7.86 7.86 7.86 7.87 7.87 7.86 7.86 7.86 7.86 7.86 7.86 7.86 7.86 7.86 7.86 7.87 7.87 7.87 7.88 7.91 7.92 7.92 7.92 7.92 7.92 7.91 7.91 7.91 7.90 7.90 7.90 7.90 7.90 7.90 7.90 7.95 7.95 7.95 7.89 7.90 7.91 7.92 7.92 7.92 7.92 7.91 7.90 7.90 7.90 7.89 7.89 7.89 7.89 7.89 7.93 8.02 8.02 8.02 8.02 8.02 8.01 8.01 8.01 8.01 8.01 8.01 8.00 8.00 7.99 8.02 8.02 8.02 8.01 8.01 8.01 8.00 7.99 7.98 8.00 8.01 8.02 8.02 8.02 8.01 8.00 7.99 8.00 8.00 8.00 8.00 8.01 8.00 8.00 7.99 7.99 7.99 7.99 7.99 7.99 7.99 7.99 8.00 8.01 8.00 8.00 8.00 8.01 8.01 8.01 8.01 8.00 8.00 8.00 7.99 7.99

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

http://dx.doi.org/10.5772/intechopen.74984

107

3.22 3.24 3.25 3.25 3.34 3.33 3.41 3.33 3.38 3.44 3.46 3.44 3.41 3.38 3.47 3.61 3.56 3.95 3.67 3.81 3.82 3.97 3.63 3.52 3.51 3.70 3.61 3.61 3.47 3.67 3.26 3.29 3.26 3.20 3.24 3.37 3.50 3.85 3.75 3.81 3.61 3.66 3.65 3.65 3.66 3.66 3.62 2.98 3.64 4.31 4.90 5.42 5.77 5.95 6.35 6.82 7.27 7.62 8.08 8.20 8.38 8.50 8.78 9.02 9.32 9.26 9.99 10.16 10.54 11.11 11.38 11.71 11.77 11.97 11.76 12.41 12.77 12.52 12.52 12.59 12.65 12.35 12.41 11.95 12.15 12.17 12.24 12.37 12.76 12.89 12.88 13.19 12.93 12.58 12.92 12.65 12.68 12.81 12.68 12.89 12.82 12.43 11.73 11.17 10.87 11.30 11.12 11.16 10.59 10.14 9.11 9.02 8.75 8.95 8.83 8.58 8.64 8.88 8.90 9.07 8.97 9.35 3.22 3.28 3.33 3.32 3.36 3.37 3.30 3.36 3.37 3.45 3.49 3.40 3.44 3.39 3.51 3.58 3.53 3.70

Table 7. Testing inputs PH.

Table 8. Testing outputs SNH.

Table 5. Testing inputs SO2.


Table 6. Testing inputs TSS.


Table 7. Testing inputs PH.

7.64 6.35 4.34 2.63 1.84 1.54 1.34 1.33 1.41 1.73 1.77 1.86 1.97 2.41 2.77 2.92 2.80 3.76 5.62 6.02 6.11 6.04 5.91 6.12 5.90 5.22 4.02 3.43 2.71 2.30 2.36 2.59 2.77 3.30 3.49 3.77 4.02 4.22 4.16 4.28 5.59 7.49 7.97 7.93 7.64 6.91 6.54 6.35 6.35 6.60 6.57 6.75 6.84 6.83 6.88 7.10 7.17 7.11 7.07 7.84 7.95 7.65 7.36 7.96 7.80 5.98 4.08 2.72 2.04 1.87 2.10 3.20 4.75 5.59 5.95 6.22 6.54 7.12 7.75 5.97 7.67 6.55 6.09 6.09 6.40 6.63 6.92 6.85 6.67 6.78 7.05 7.35 7.63 7.77 0.81 0.81 0.84 0.86 0.89 0.86 0.99 1.14 0.73 0.68 0.65 0.68 0.66 0.56 0.50 0.53 0.55 0.54 0.49 0.49 0.48 0.49 0.48 0.51 0.53 0.50 0.53 0.57 0.54 0.54 0.59 0.62 0.53 0.52 0.49 0.50 0.51 0.52 0.45 0.43 0.46 0.46 0.46 0.48 0.51 0.47

2.83 2.72 2.83 2.77 2.81 2.82 2.74 2.77 2.78 2.77 2.78 2.78 2.80 2.80 2.75 2.79 2.77 2.83 2.79 2.79 2.78 2.76 2.80 2.81 2.80 2.85 2.80 2.82 2.90 2.81 2.81 2.78 2.90 2.81 3.17 2.80 2.92 2.85 2.80 2.82 2.82 2.89 2.91 2.80 2.79 2.81 2.82 2.88 2.84 2.83 2.82 2.82 2.80 2.82 2.83 2.87 2.77 2.82 2.82 2.82 2.81 2.84 2.83 2.83 2.86 2.77 2.73 2.78 2.80 2.79 2.81 2.80 2.74 2.81 2.81 2.78 2.87 2.83 2.87 2.88 2.86 2.82 2.95 2.89 2.88 2.90 2.89 2.95 2.90 2.92 2.93 2.89 2.93 2.90 2.82 2.82 2.81 2.80 2.77 2.82 2.80 2.84 2.81 2.82 2.79 2.78 2.85 2.78 2.73 2.74 2.78 2.71 2.77 2.84 2.87 2.86 2.90 2.88 2.90 2.84 2.80 2.88 2.85 2.82 2.78 2.78 2.79 2.81 2.78 2.75 2.75 2.71 2.76 2.75 2.77 2.72 2.71 2.71 2.74 2.68

Table 5. Testing inputs SO2.

106 Wastewater and Water Quality

Table 6. Testing inputs TSS.


Table 8. Testing outputs SNH.


[2] Du B, Price AE, Scott WC, et al. Comparison of contaminants of emerging concern removal, discharge, and water quality hazards among centralized and on-site wastewater treatment system effluents receiving common wastewater influent. Science of the Total

Intelligent Modeling Approach to Predict Effluent Quality of Wastewater Treatment Process

http://dx.doi.org/10.5772/intechopen.74984

109

[3] Mailler R, Gasperi J, Coquet Y, et al. Study of a large scale powdered activated carbon pilot: Removals of a wide range of emerging and priority micropollutants from wastewa-

[4] Marques R, Rodríguez-Caballero A, Oehmen A, et al. Assessment of online monitoring strategies for measuring N2O emissions from full-scale wastewater treatment systems.

[5] Goldstein RER, Micallef SA, Gibbs SG, et al. Detection of vancomycin-resistant enterococci (VRE) at four US wastewater treatment plants that provide effluent for reuse.

[6] Gong T, Zhang X. Detection, identification and formation of new iodinated disinfection byproducts in chlorinated saline wastewater effluents. Water Research. 2015;68:77-86

[7] Haimi H, Mulas M, Corona F, et al. Data-derived soft-sensors for biological wastewater treatment plants: An overview. Environmental Modelling & Software. 2013;47:88-107

[8] Liu Y, Pan Y, Sun Z, et al. Statistical monitoring of wastewater treatment plants using variational Bayesian PCA. Industrial & Engineering Chemistry Research. 2014;53(8):3272-3282 [9] Symonds EM, Breitbart M. Affordable enteric virus detection techniques are needed to support changing paradigms in water quality management. CLEAN–Soil, Air, Water.

[10] Zou X, Kang M, Li A, et al. Spray inlet proton transfer reaction mass spectrometry (SI-PTR-MS) for rapid and sensitive online monitoring of benzene in water. Analytical

[11] Li WW, Yu HQ, He Z. Towards sustainable wastewater treatment by using microbial fuel cells-centered technologies. Energy & Environmental Science. 2014;7(3):911-924

[12] Kaelin D, Manser R, Rieger L, et al. Extension of ASM3 for two-step nitrification and denitrification and its calibration and validation with batch tests and pilot scale data.

[13] Wen X, Xing C, Qian Y. A kinetic model for the prediction of sludge formation in a

[14] Yu H, Wilson F, Tay JH. Prediction of the effect of recirculation on the effluent quality of anaerobic filters by empirical models. Water Environment Research. 2000;

[15] Bhowmick A, Irvine K, Jindal R. Mathematical modeling of effluent quality of cha-Am municipality wastewater treatment pond system using PCSWMM. Journal of Water Man-

membrane bioreactor. Process Biochemistry. 1999;35(3):249-254

ter treatment plant effluents. Water Research. 2015;72:315-330

Science of the Total Environment. 2014;466:404-411

Environment. 2014;466:976-984

Water Research. 2016;99:171-179

2015;43(1):8-12

72(2):217-224

agement Modeling. 2017

Chemistry. 2016;88(6):3144-3148

Water Research. 2009;43(6):1680-1692

Table 9. Real outputs SNH.
