ARTIFICIAL NEURAL NETWORKS
MODELLING FOR AL-RUSTUMIYA
WASTWATER TREATMENT PLANT IN
BAGHDAD
Dalia H. aldahy*
Civil Engineering Department, College of Engineering, Al-Nahrain University,
Baghdad, Iraq
st.dalia.hussein@ced.nahrainuniv.edu.iq
Mohammed A. Ibrahim
Civil Engineering Department, College of Engineering, Al-Nahrain University,
Baghdad, Iraq
Reception: 03/12/2022 Acceptance: 27/01/2023 Publication: 13/02/2023
Suggested citation:
H. A., Dalia and A. I., Mohammed (2023). Articial Neural Networks
Modelling For AL-Rustumiya Wastwater Treatment Plant in Baghdad . 3C
Empresa. Investigación y pensamiento crítico, 12(1), 257-271. https://doi.org/
10.17993/3cemp.2023.120151.257-271
https://doi.org/10.17993/3cemp.2023.120151.257-271
257
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
ABSTRACT
In the present research, Artificial Neural Networks (ANNs) were developed for
modelling the performance of Al-Rustamiya wastewater treatment plant, Baghdad,
Iraq. There were created two models and the outputs were the removal efficiency of
BOD and COD parameters. Four main input parameters were selected for modelling,
namely Total suspended solids (TSS), Total dissolved solids (TDS), chloride ion (Cl-),
and pH. Influent and effluent concentrations of the parameters were collected from
Mayoralty of Baghdad for the period from 2011 to 2021. The results of the modelling
were in terms of mean square error (MSE) and correlation coefficient (R). The results
indicated that the ANNs models were accurately able to predict the removal of the
BOD, and COD, and the optimum topology of the ANNs is obtained at 13 neurons in
the hidden layer for both with 3.09 MSE, 0.96 and 4.28 MSE, 0.96 R for BOD and
COD respectively.
KEYWORDS
ANNs, BOD, COD, modelling, wastewater
PAPER INDEX
ABSTRACT
KEYWORDS
INTRODUCTION
WORK METHOD
1. Description of the Study Area
2. Data Collection
3. ANNs modelling in MATLAB
RESULTS AND DISCUSSION
1. Removal Efficiency of BOD and COD
2. ANNs
2.1. ANNs for BOD modelling
2.2. ANNs for COD modelling
CONCLUSION
ACKNOWLEDGEMENTS
CONFLICT-OF-INTEREST STATEMENT
REFERENCES
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
258
INTRODUCTION
The change in the life styles due to urbanization and industrial practices has
resulted in increasing production of wastewater that adversely impacts on human lives
[1]. Water can be contaminated by human utilization in any mixture of mechanical,
residential, businesses, storm water, surface overflow, and inflow of sewers [1, 2].
Wastewater treatment plants (WWTPs) are considered as significant infrastructure for
a society. With the realization of the importance of such plants, the achievement of
integrated and efficient units demands adequate operational and maintenance
practices. Wastewater treatment plants mainly consist of three process, primary,
secondary, and tertiary treatments. The combinations of these processes depends on
the characteristics requirements of effluent [3]. Typically, the reduction degree in the
biological oxygen demand (BOD) as well as chemical oxygen demand (COD)
represent the basic indicator of the effectiveness of the plant [4, 5].
Moreover, modelling of WWTPs represents a difficult task as the treatment involves
complex processes. The physical, biological, and chemical stages of the treatment
plants provide non-linear performance which is complicated to presented in linear
models. Thus, providing an efficient monitoring technique can be accomplished by the
development of non-linear model to predict the performance of the treatment plant
under previous observed water characteristics. Artificial neural networks (ANNs)
represent computerized non-linear models for simulating the decision-making and
functions of the brain of humans. It is being used for many wastewater quality issues.
It has also been properly used in the modelling of the WWTPs for predicting
wastewater characteristics, controlling stages of treatments, and providing estimation
of effluent characteristics [6-9].
ANNs are usually used for predicting the parameters of water quality. It solves an
issue through the development of a memory with the ability to relate large input data
with a set of outputs [10]. A significant feature of the ANNs is its ability to handle
considerable and complicated systems with various related parameters [11]. ANNs
forms the basis of deep learning where the modelling algorithms are inspired by the
brain structure of humans. After taking in the data, the ANNs train themselves for the
recognition of data patterns and providing outputs. The model consists of grouped
artificial neurons representing the core units of the modelling process [12]. The model
represents an alternative method to conventional water quality models through the
provision of advanced predictions and forecasts [13, 22].
In Baghdad, the capital city of Iraq, Al-Rustumiya WWTP is one of the main sewage
water treatment facilities in the country. The plant recently has been expanded (3rd
expansion) with the construction of nearby new plant for increasing capacity
purposes. It releases the treated waters in Diyala River and then into the Tigris River
[14, 15]. This study aims to at develop an ANNs model in MATLAB for investigating
correlation between pairs of parameters to predict the performance of the 3rd
expansion plant in terms of the removal efficiency of BOD, and COD. This work can
assist in facilitating assessment or process control of effluent quality.
https://doi.org/10.17993/3cemp.2023.120151.257-271
259
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
WORK METHOD
1. DESCRIPTION OF THE STUDY AREA
Baghdad is the capital city of Iraq with an area approximately equals 800 square
miles and population of 7.145 million according to the water and sewage sector report
[16]. Three significant central WWTPs were built in Baghdad., namely Al-Karkh
wastewater treatment plant, Southern Al-Rustumiya WWTP numbered 0, 1, and 2,
and Northern Al-Rustumiya WWTP (3rd expansion). The effluent from the old plant
being discharged in Tigris River while for the 3rd expansion, it is being discharged in
Diyala River (also known as Sirwan River). The 3rd expansion of the plant began in
1984. Approximately third of the population in the city depends on the Al-Rustumiya
WWTP [17]. The plant lies on the south-east part of Baghdad, Iraq, on Diyala River
with longitudinal coordinate of 44˚32΄05˝E and latitudinal coordinate of 33˚17΄15˝N.
The plant was mainly designed for the treatment of domestic wastewater which serves
a population of 1500000 [17]. The plant consists of conventional activated sludge for
biologically treating carbon compounds with average wastewater influent capacity
equals 300MLD [17]. Figure 1 showed the 3rd expansion of the plant.
Figure 1. Al-Rustumiya WWTP3rd expansion in Baghdad, Iraq [14].
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
260
2. DATA COLLECTION
The required data were obtained from Al-Rustamiya WWTP administration Office
Mayoralty of Baghdad, over the period of ten years from January 2011 and December
2021 on a monthly basis. Two locations were selected: at entrance of the plant, and
after secondary treatment. The selected physiochemical parameters included the
biochemical oxygen demand (BOD5), chemical oxygen demand (COD), chloride (Cl-)
and Total dissolved solids(TDS), and total suspended solids (TSS). The Removal
efficiency of BOD, and COD were determined using Equation (1):
Removal efficiency (%) = (1)
3. ANNS MODELLING IN MATLAB
The ANNs were created in MATLAB. This software allows creation, usage, export,
and input of neural networks. Two models were created, with 4 inputs and 1 output.
The modelling procedure and equations were based on Tümer and Edebali [18],
Ammari [19] and Alsulaili and Refaie [20].
The ANNs architecture was defined by its number of layers and their neurons.
Feedforward multi-Layered perception ANNs consist of various artificial neurons
known as nodes, or processing elements (PEs). These are normally arranged in three
layers, input, hidden or intermediate, and output layers. As was indicated in Figure 2
that for each processing element, the input from a layer (xi) was multiplied by an
adjustable connection weight (wij). The summation was performed for the weighted
inputs with the addition of a threshold value (θj). The resulted combined input was
then transferred to activation function (f(ij)) for generating the output (yj). This output
was then used as input for the next layer. The activation function represents the
nonlinear mapping tool in the network before delivering the output to the next layer.
Figure 2. Typical structure and operation of ANNs [21].
The summary of the process was indicated in Equations (1 & 2) as follows:
Summation f(IJ) = (2)
Transfer (yj)= f(Ij) (3)
inputvalue outputvalue
inputvalue
x
100
WijXi+θj
https://doi.org/10.17993/3cemp.2023.120151.257-271
261
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
Where,
f(IJ) is the level of activation at j node,
Wij is the weight of the connection between the nodes i and j,
xi is the i node input and equals 0, 1,2, …,n,
θj is the threshold for j node,
j is the j node output, and
f(ij) is the activation function.
Backpropagation algorithm is normally used for excellent results and easy
application. The ANNs data propagation began at the input layer at which the
information was provided. In order for the weights to be assigned, the network utilized
the presented information and learning rule for the production of input and output
maps with negligible errors. This is called training or learning which was divided into
supervised and unsupervised learnings. Feedforward ANNs usually works with
supervised learning. In this, model inputs and desired outputs were provided to the
network. Errors were determined through the network by comparing the desired and
actual ANNs produced outputs. These errors were then utilized for adjusting the
weights given to the connections between the input and the outputs for reducing the
errors between the actual output and the desired ones. Thus, the network learns for
the presented data for adjusting the weights and capturing the relationship between
the input and the output without the need of any previous knowledge about such
relationship. Thus it regulates the bias and weights of the Multi-Layered perception
ANNs. In order to evaluate the efficiency of the treatment plant, the backpropagation
algorithm was improved by the incorporation of Levenberg-Marquadrt algorithm. This
algorithm is a local optimization algorithm with a gradient basis. The advantage of its
utilization over normal backpropagation is the better stability, advanced performance,
and faster and advanced training and convergence properties.
Several forms are available for the activation function. The most commonly known
were used in this research which was hyperbolic tangent transfer and logistic sigmoid
functions. The functions are presented in Equations (4 & 5):
Hyperbolic tangent transfer function (3)
logistic sigmoid function (4)
)()(
)()(
)( jj
jj
II
II
jee
ee
If
+
=
)(
1
1
)(
j
I
j
e
If
+
=
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
262
RESULTS AND DISCUSSION
1. REMOVAL EFFICIENCY OF BOD AND COD
Figures 3 presented the average yearly removal efficiency of BOD and COD from
Al-Rustumiya WWTP. The figure indicated that the removal efficiencies were variable
for both water parameters, mostly more than 80% and having approximately the same
trend. The greatest removal efficiency occurred in 2020 with about 93% for BOD and
95% for COD. Generally, the removal efficiency of the plant increased from 2015
onwards. The lowest BOD and COD removals occurred in 2012. This could be
attributed to the improper aeration in the aeration basin, or the measurement of high
concentration of settling microbial mass in the secondary clarifier.
Figure 3. Removal efficiency of BOD and COD from Al-Rustumiya WWTP.
2. ANNS
The results of the ANNs modelling were evaluated in terms of Mean Square Error
(MSE) and correlation coefficient (R) The functions are presented in Equations (6&7):
Correlation coefficient (R) = (6)
Mean Square Error (MSE) = (7)
where X= observed yt , = mean of X, Y= predicted yt, = mean of Y, and n=
number of observations.
Removal Efficiency
0
25
50
75
100
Year
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
BOD COD
n
i=1
(X¯
X)(Y¯
Y)
n
i=1 (
X¯
X
)
2
(
Y¯
Y
)
2
n
i=1
(XY)
2
¯
X
¯
Y
https://doi.org/10.17993/3cemp.2023.120151.257-271
263
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
These are the most common criteria for the evaluation of a model’s performance.
The MSE provides the difference between the outputs and the targets. The R
coefficient reflects how well the created model fits with used outputs. An R equaling 1
means a very close relationship while an R equaling 0 means a random relationship.
Models were carried out for the removal efficiency of both BOD and COD. They
represent the main parameters for evaluating organic pollution. They provide
measurements of organic matter and oxygen demands.
2.1. ANNS FOR BOD MODELLING
The modelling results in terms of the MSE with the number of hidden layers are
shown in Figure 4. and Table 1. The results indicated that the MSE was significantly
decreased with the increase in the number of hidden neurons from 2 to 9 and the
minimum MSE result is obtained at 13 hidden neurons. Afterward, training was
stopped when reached 90 epochs for the Levenberg–Marquardt algorithm as shown
in Figure 5. This is because of the difference between the training and validation
errors increases. A plot of Levenberg–Marquardt algorithm regression for training,
validation, and testing with R is shown in Figure 6. This revealed that the R values
were 0.98, 0.94, 0.88, and 0.96 for training, validation, testing, and for all data
respectively. Thus, the optimum topology of the ANNs is obtained at 13 neurons in the
hidden layer with 3.09 MSE and 0.96 R. The architectural model of the optimum
topology is shown in Figure 7. This is 4:13:1, indicating the input layer with the used
four parameters, thirteen neurons at the hidden layers, and the output layer in terms
of the removal efficiency of the BOD.
Figure 4. Mean Square Error (MSE) with different numbers of neurons at the hidden layers
for ANNs modelling of BOD output.
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
264
Table 1. ANNs details for BOD modelling.
Figure 5. Training, validation, and test mean square errors for the Levenberg–Marquardt
algorithm for BOD removal.
BOD
Model No. No. of neurons at hidden
layers
MSE Correlation Coefficient (R)
1 2 15.72 0.80
2 3 14.13 0.83
3 4 13.59 0.83
4 5 12.83 0.84
5 6 9.75 0.88
6 7 6.00 0.93
7 8 4.87 9.43
8 9 3.42 0.96
9 10 3.96 0.95
10 11 3.41 0.96
11 12 4.00 0.95
12 13 3.09 0.96
13 14 4.43 0.95
14 15 3.21 0.96
https://doi.org/10.17993/3cemp.2023.120151.257-271
265
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
Figure 6. Training, validation and testing regression for the Levenberg–Marquardt
algorithm for BOD removal.
Figure 7. The architecture of the ANN model for the prediction of BOD removal.
2.2. ANNS FOR COD MODELLING
The modelling results in terms of the MSE with the number of hidden layers are
shown in Figure 8. and Table 2. The results indicated that the MSE was significantly
decreased with the increase in the number of hidden neurons from 2 to 11 and the
minimum MSE result is obtained at 13 hidden neurons. Afterward, training was
stopped when reached 78 epochs for the Levenberg–Marquardt algorithm as shown
in Figure 9. This is because of the difference between the training and validation
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
266
errors increases. A plot of Levenberg–Marquardt algorithm regression for training,
validation, and testing with R is shown in Figure 10. This revealed that the R values
were 0.96, 0.94, 0.96, and 0.96 for training, validation, testing, and for all data
respectively. Thus, the optimum topology of the ANNs is obtained at 13 neurons in the
hidden layer with 4.28 MSE and 0.96 R. The architectural model of the optimum
topology is shown in Figure 11. This is 4:13:1, indicating the input layer with the used
four parameters, thirteen neurons at the hidden layers, and the output layer in terms
of the removal efficiency of the COD.
Figure 8. Mean Square Error (MSE) with different numbers of neurons at the hidden layers
for ANNs modelling of COD output.
Table 2. ANNs details for COD modelling.
COD
Model No. No. of neurons at
hidden layers
MSE Correlation Coefficient (R)
1 2 19.34 0.79
2 3 16.79 0.82
3 4 14.74 0.84
4 5 12.03 0.87
5 6 11.58 0.88
6 7 8.81 0.91
7 8 8.31 0.90
8 9 7.68 0.91
9 10 6.36 0.93
10 11 6.85 0.93
11 12 4.61 0.95
https://doi.org/10.17993/3cemp.2023.120151.257-271
267
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
Figure 9. Training, validation, and test mean square errors for the Levenberg–Marquardt
algorithm for COD removal.
Figure 10. Training, validation and testing regression for the Levenberg–Marquardt
algorithm for COD removal.
12 13 4.28 0.95
13 14 4.50 0.95
14 15 4.86 0.95
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
268
Figure 11. The architecture of the ANN model for the prediction of COD removal.
CONCLUSION
The results of the ANNs modelling for the prediction of BOD, and COD provided
several advantages over the traditional calculation methods. The models were
accurately able to determine the removal efficiency of the BOD, and COD of Al-
Rustumiya WWTP by the use of raw dataset. The developed models can be
considered as simple, fast, and most accurate determination tools. This proved that
the developed MLP network trained with backpropagation incorporated with
Levenberg–Marquardt algorithm was adequate in predicting the performance of Al-
Rustamiya WWTP. For BOD and COD, the best results were obtained with 13
neurons at 3.09 MSE and 0.96 R for BOD and 4.28 MSE and 0.95 R for COD.
ACKNOWLEDGEMENTS
This research was carried out in Civil Engineering at Al-Nahrain University,
Baghdad, Iraq. The assistance and support of Al-Rustamiya WWTP Administration
Office Mayoralty of Baghdad are gratefully acknowledged.
CONFLICT-OF-INTEREST STATEMENT
The authors declare no conflict of interest for this research
REFERENCES
(1) Fahad A., Mohamed R. M. S., Bakar R., and Al-Sahari M. (2019). Wastewater
and its Treatment Techniques: An Ample Review. Indian Journal of Science
and Technology, 12(25).
https://doi.org/10.17993/3cemp.2023.120151.257-271
269
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
(2) Kılıç Z. (2021).
Water Pollution: Causes, Negative Effects and Prevention
Methods. IZU Journal of the Institute of Science and Technology, 3(2).
(3) Al-Attar R. T., Faris H. Al-Ani, and Al-Khafaji M. S. (2022).
SWOT-Based
Assessment of the Maintenance Management of the Wastewater Treatment
Plants in Iraq. Engineering and Technology Journal, 40(5), 677-694.
(4)
G. Sin, S. W. H. Van Hulle, D. J. W. De Pauw, A. van Griensven and P. A.
Vanrolleghem. (2005).
A critical comparison of systematic calibration
protocols for activated sludge models: A SWOT analysis. Water Research,
39(12), 2459–2474.
(5) A. A. Abbas, Y. T. Yousif and H. H. Almutter. (2022).
Evaluation of Al-Thagher
Wastewater Treatment Plant. Periodica Polytechnica Civil Engineering
, 66(1),
112–126.
(6) Han H. G., Qiao J.F., and Chen Q.L. (2012).
Model predictive control of
dissolved oxygen concentration based on a self-organizing RBF neural
network, Control. Eng. Pract., 20(4), 465–476.
(7) Olyaie E., Banejad H., Chau K.W., and Melesse A.M. (2015)
A comparison of
various artificial intelligence approaches performance for estimating
suspended sediment load of river systems: A case study in United States.
Environ. Monit. Assess., 187(4),189.
(8) Seo Y., Kim S., and Singh V.P. (2018).
Comparison of different heuristic and
decomposition techniques for river stage modelling.
Environ. Monit.
Assess., 190(7), 392.
(9)
Shamshirband S., Jafari Nodoushan E., Adolf J.E., Abdul Manaf A., Mosavi A.,
and Chau K.W. (2019). Ensemble models with uncertainty analysis for multi-
day ahead forecasting of chlorophyll a concentration in coastal waters.
Eng. Appl. Comp. Fluid., 13(1), 91–101.
(10)
Ahmed A. A. M., Hossain M. I., Rahman M. T. and Chowdhury M. A. I. (2013).
Application of artificial neural network models for predicting dissolved
oxygen concentration for Surma River, Bangladesh.
Journal of Applied
Technology in Environmental Sanitation, 3(3), 135–140.
(11) Nourani V., Kisi O., and Komasi M. (2011).
Two hybrid Artificial Intelligence
approaches for modeling rainfall runoff process. Journal of Hydrology
, 402,
41-59.
(12) Mohammed N. Y. (2016).
Assessment and Modelling of the Performance of
Al Wahda Water Treatment Plant. Master Thesis: University of Baghdad.
(13) Abrahart R., Kneale P. E. and See L. M. (2004).
Neural networks for
hydrological modelling. CRC Press.
(14) Ali ZH., Abd. Salman K., and Abd-Alateef K.A. (2001).
Evaluating the efficiency
of the filter in AlRustamiya wastewater treatment plant. Almustansriyah J.
,
12, 200-212.
(15) Rasheed Kh. A. (2016).
Study the Efficiency of two waste Treatment Plants
in the Al-Karkh and Al-Rusafa of Baghdad Region in 2015.
J. Int.
Environmental Application & Science, 11(2), 176-179.
(16) Dunia Frontier Consultants. (2013).
Water and Sewage Sectors in Iraq: Sector
Report. A report for JCCME prepared by Dunia.
https://doi.org/10.17993/3cemp.2023.120151.257-271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023
270
(17) Amanat Baghdad. (2021).
Baghdad Water Supply and Sewerage
Improvement Project. https://amanatbaghdad.gov.iq/page.php?
link=World%20Bank%20ads&lang=en
(18) Tümer A. E. and Edebali S. (2015).
An Artificial Neural Network Model for
Wastewater Treatment Plant of Konya.
International Journal of Intelligent
Systems and Applications in Engineering, 3(4), 131-135.
(19) Ammari A. (2016). MATLAB Code of Artificial Neural Networks Estimation.
ResearchGate.
(20) Alsulaili A. and Refaie A. (2021).
Artificial neural network modeling approach
for the prediction of five-day biological oxygen demand and wastewater
treatment plant performance. Water Supply, 21(5), 1861-1877.
(21) Shahin M. A. (2003).
Use of artificial neural networks for predicting
settlement of shallow foundation on conhesionless soils.
The university of
Adelaide school of civil and environmental engineering, 6-37.
(22)
Ibrahim M. A., Mohammed-Ridha M. J., Hussein H. A., and Faisal A. A.H. (2020).
Artificial Neural Network Modeling of the Water Quality Index for The
Euphrates River in Iraq. Iraqi Journal of Agricultural Sciences,
51(6),
1572-1580.
https://doi.org/10.17993/3cemp.2023.120151.257-271
271
3C Empresa. Investigación y pensamiento crítico. ISSN: 2254-3376
Ed. 51 Iss.12 N.1 January - March, 2023