Removal efficiency prediction model based on the artificial neural network for pollution prevention in wastewater treatment plants

Purpose – Artificial intelligence (AI) models are demonstrating day by day that they can find long-term solutions to improve wastewater treatment efficiency. Artificial neural networks (ANNs) are one of the most important of these models, and they are increasingly being used to forecast water resource variables. The goal of this study was to create an ANN model to estimate the removal efficiency of biological oxygen demand (BOD), total nitrogen (TN), total phosphorus (TP) and total suspended solids (TSS) at the effluent of various primary and secondary treatment methods in a wastewater treatment plant (WWTP). Design/methodology/approach – The MATLAB App Designer model was used to generate the data set. Variouscombinationsofwastewaterqualitydata,suchastemperature(T),TN,TPandhydraulicretentiontime (HRT)areusedasinputsintotheANNtoassessthedegreeofeffectofeachofthesevariablesonBOD,TN,TPandTSSremovalefficiency.Twoofthemodelsreflecttwodifferenttypesofprimarytreatment,whiletheother ninemodelsrepresentdifferenttypesofsubsequenttreatment.TheANNmodel ’ s findingsare comparedto the MATLABAppDesignermodel.Forevaluatingmodelperformance,meansquareerror(MSE)andcoefficientof determinationstatistics( R 2) are utilized as comparative metrics. Findings – Forbothtrainingandtesting,the R valuesfortheANNmodelsweregreaterthan0.99.Basedonthe comparisons,itwasdiscoveredthattheANNmodelcanbeusedtoestimatetheremovalefficiencyofBOD,TN,TPandTSSinWWTPandthattheANNmodelproducesverysimilarandsatisfyingresultstothe APPDESIGNERmodel.The R -value (Correlation coefficient) of 0.9909 and the MSE of 5.962 indicate that the modelisaccurate.BecauseofthemanybenefitsoftheANNmodelsusedinthisstudy,ithasalotofpotentialas ageneralmodelingtoolforarangeofothercomplicatedprocesssystemsthataredifficulttosolveusingconventionalmodelingtechniques. Originality/value – The objective of this study was to develop an ANN model that could be used to estimate the removal efficiency of pollutants such as BOD, TN, TP and TSS at the effluent of various primary and secondary treatment methods in a WWTP. In the future, the ANN could be used to design a new WWTP and forecast the removal efficiency of pollutants.


Introduction
Domestic and industrial untreated wastewater is one of the most serious producing environmental pollutants.To realize the treatment of wastewater, it is very important in increasing the removal efficiency of contaminants and the stability of operation in the wastewater treatment systems.Therefore, a computing operating system can be developed to enhance the stability of wastewater treatment systems (Niu et al., 2020).However, the wastewater treatment process is extremely complicated, its mechanism is difficult to understand, and a traditional operating system based on a mathematical model could not effectively simulate the wastewater treatment process.With artificial intelligence (AI) development, AI has obvious advantages over traditional process control methods, which could model the complex nonlinear wastewater treatment processes by modeling human thinking processes (Qiao, Wang, Li, & Li, 2018).
So, neural networks (NNs) are one of the most rapidly developing AI technologies.On the other hand, they can not only describe complex phenomena by mapping nonlinear functions, but they also have the advantage of being self-learning and self-adaptive, allowing them to compensate for the shortcomings of traditional control systems (Shin, Kim, Yu, Kim, & Hwang, 2019).In recent years, NN has been capable of successfully modeling wastewater treatment.
In the literature, it was an intermittent cycle extended aeration-sequential batch reactor, and artificial neural network (ANN) models were developed to predict faecal coliform and total coliform elimination (ICEAS-SBR).This network was developed using wastewater influent pH, biochemical oxygen demand (BOD), chemical oxygen demand (COD), total suspended solids (TSS), oil and grease (O&G), total Kjeldahl nitrogen (TKN), ammoniacal nitrogen (AN), total phosphorus (TP), faecal coliform and total coliform.ANN models allow for the regulation of faecal coliform and total coliform levels in treated wastewater effluent, lowering public health concerns, particularly for oyster consumers (Khatri, Khatri, & Sharma, 2020).
In another previous study, ANNs were used to mimic an anaerobic fermentation process for biogas production coupled with wastewater purification in a modern wastewater treatment plant (WWTP).Based on real-scale industrial data, neural models were trained, validated and tested, considering both technological aspects of the process and the quality of treated effluent.A parameter sensitivity study revealed that the operation process factors had a greater impact on biogas yield than the wastewater quality (COD, BOD 5 , TSS, Pg and Ng).The proposed ANN model can be employed as a forecasting tool, as well as in the testing of other prospective process intensification and optimization scenarios (Sakiewicz, Piotrowski, Ober, & Karwot, 2020).
In one more study, the Jamnagar Municipal Corporation Sewage Treatment Plant (JMC-STP) was investigated in order to create a feedforward artificial neural network (FF-ANN) model.It was an alternative to the flexible physical, chemical and biological treatment process simulations for JMC-STP modeling and prediction.pH, BOD, COD, TSS, total Kjeldahl nitrogen (TKN), AN and TP were the expected effluent parameters.FF-ANN models were assessed using the MAD (mean absolute deviation), MSE (mean square error), RMSE (root mean square error) and MAPE (mean absolute percentage error).This serves as a helpful tool for the management of the plant to maximize the treatment quality while improving the plant's efficiency and dependability (Khatri, Khatri, & Sharma, 2019).
AI models have also been used to anticipate BOD elimination; a hyperbolic design equation was created using the ANN predictions.This equation combines zero and first-order kinetics.The results of the ANNs and the model design equation were compared to data from the literature and found to be reasonably accurate.The elimination of COD was shown to be highly linked with the removal of BOD.A formula for predicting COD elimination was also developed (Akratos, Papaspyros, & Tsihrintzis, 2008).
ANN models can be used to solve a variety of modeling problems in rivers, lakes, WWTPs, groundwater, ponds and streams (Chen, Song, Liu, Yang, & Li, 2020).
Another study describes the creation of a synthetic neural network model for predicting annual BOD values using widely accessible sustain-ability and economic/industrial parameters as inputs, after which the initial general regression neural network (GRNN) model was trained, validated and tested using 20 inputs.The proposed GRNN model can be ANN for pollution prevention in WWTPs beneficial as a tool to support the decision-making process on sustainable development at a regional, national and worldwide level, it was determined in the end ( Silji c, Antanasijevi c, Peri c-Gruji c, Risti c, & Pocajt, 2014).
Various treatment processes, including air flotation, chemical coagulation, sedimentation and biological treatment through a fully mixed activated sludge process in a water purification process, were used to treat the entire effluent and waste disposal in the detergent industry before the soft computing techniques.Then a feed-forward with five layers The backpropagation ANN model was successfully used to optimize the proposed models, yielding the lowest root mean square error (0.066), mean square error (0.0043) and greatest R 2 value (0.996); these values demonstrate that the predicted and experimental responses were similar, and ANN may be used to describe the process (Jana, Bhunia, Das Adhikary, & Bej, 2022).
In this study, the purpose is developing the ANN-based models to predict the removal efficiency of BOD, TN, TP and TSS in a variety of primary and biological treatment systems in a WWTP.To achieve this purpose the neuron numbers in the hidden layer were varied to create models with different ANN topologies.For training and independent validation, the correlation coefficient and MSE were used to assess the performance of the created ANN models.So the removal effectiveness of BOD, TN, TP and TSS in the effluent for disposal is monitored using these models.Also the created ANN models can be used to manage the BOD, TN, TP and TSS removal efficiency to limit the danger of public health and discharge highquality treated wastewater to receiving water bodies.Thus, it can be said that AI models, particularly NNs, make it possible to manage the operation of treatment plants and control pollutants without having to conduct traditional tests.This saves time and money, and in the future, it will aid designers in creating treatment plants more quickly, with higher treatment efficiency.

Materials and methods
The idea of duplicating the working principles of the brain on digital computers gave rise to the concept of ANNs, and the initial studies concentrated on mathematical modeling of the biological cells that make up the brain, referred to as neurons in the literature (akda g & Karahan, 2014).
The operation of biological neurons served as the inspiration for the numerical method known as the ANN.An input signal vector x i with the values 1, 2,. .., L is received by neuron m from a total of L input channels.The neuron then calculates the weighted sum of components x i by multiplying each component x i by the coefficient w mi that reflects the significance of the input channel i as shown in Figure 1 (Cardoso, de Almeida, Dias, & Coelho, 2008).

Creating the neural network
An ANN is made up of a collection of very simple and densely interconnected processors known as neurons, which are similar to biological neurons in the brain.Weighted linkages connect the neurons, transferring messages from one to the other.Through its connections, each neuron gets a variety of input signals, but it never creates more than one output signal.The outgoing link of the neuron transmits the output signal (corresponding to the biological axon).The outgoing link then separates into several branches, each of which transmits the same signal (the signal is not divided among these branches in any way).The incoming connections of other neurons in the network end the outward branches.Figure 1 symbolized the way an artificial neuron works (Negnevitsky, 2005).
The addition function operates as given in equation ( 1).
As shown in Figure 1, each input generates a change in the neuron output, and the magnitude of this change is determined by the connection gains that determine the input's effect degree, the adder's threshold value and the type of neuron activation function.Where V is the addition function; gains denoted by W i are weight; X i inputs; θ j value as the threshold; y output; The f function is also called the neuron activation function.As can be seen from the equations above, since the threshold value is independent of the inputs, in cases where all inputs are zero, the value of f ðθÞ is observed at the neuron output instead of f ð0Þ, which eliminates the necessity for the neuron output to be zero under the specified conditions.The use of the threshold value is considered in practice as an input with a value of þ1 or À1 entering the adder with a link with a weight of θ.
The activation function of the neuron is one of the most critical aspects in influencing neuron behavior.This function analyzes the neuron's net input and calculates the output the neuron will produce in response to it ( € Oztemel, 2008).There are many approaches for calculating the output in this function, similar to the addition function, and not all process elements must utilize the same activation function.Depending on the type of problem and the network structure employed, different functions may be preferred.The linear function, step function, sigmoid function and hyperbolic tangent function are commonly employed as activation functions (Yurto glu, 2005).The mathematical expressions of three of these activation functions used are given below.

Sigmoid type activation function:
Tangent sigmoid type activation function: Hyperbolic tangent type activation function:

Architecture of a typical artificial neural network ANN for pollution prevention in WWTPs
The input layer, the output layer and the hidden layer are the three primary layers.The input layer is the first layer, and it feeds the ANN with external data input.In statistics, these data correspond to independent variables.The number of neurons in the input layer is formed by the number of parameters affecting the problem, and the number of parameters affects the number of neurons in the input layer.The output layer is the final layer, and it is responsible for transmitting data to the outside world.In statistics, output variables correspond to dependent variables.The hidden layer is the layer that sits between the input and output layers in the model.The neurons in the hidden layer are not connected to the outside world.As in a biological neural network, learning in ANNs is the act of altering the weight values between neurons to fulfill a specified function.These weight values are initially assigned at random.As examples are displayed to ANNs, their weight values fluctuate.The goal is to determine the weight values that will result in the correct outputs for the network's examples.When the network's weight values are correct, it suggests the network can generalize about the events represented by the samples."Network learning" is the process of ANNs obtaining the ability to generalize about unknown cases by extracting specific information from previous examples (Agatonovic- Kustrin and Beresford, 2000).
"Testing" the network refers to attempts to determine whether the network learns (performs) after the training is completed.Examples that the network has not seen during learning are utilized for testing.Using the connection weights calculated during training, the network generates outputs for these occurrences that it does not see.The accuracy values of the produced outputs provide information on the network's learning.The better the results, the more effective the training.The "training set" is a sample set used in education, and the "test set" is a sample set used for testing ( € Oztemel, 2008).We can define the ANN's learning of the relationship in the data structure as the determination of the most appropriate values of the network weights with the help of the examples of the problem.For any weight (W); The equation expresses how learning takes place mathematically.The ΔW in equation ( 5) is calculated according to a certain rule and gives the amount of change of the current weight values.The rules defined for determining ΔW are called "learning algorithms".Many learning algorithms have been proposed to help find the best weight set (Chang, Chen, & Shieh, 2001).

Evaluation of predicting performance
To evaluate the predicting performance of ANN, correlation coefficient (R) and MSE were employed and described as: AGJSR 41,4 where obs i is the observed value, pre i is the prediction value, obs and pre are the average values of observed values and prediction values, respectively (Pai et al., 2009).

Applying of ANN model on WWTP
The Durug€ ol Advanced Biological WWTP was controlled by an ANN that was put to the test.Additionally, the MATLAB App Designer model was developed and compared to the neural networks model using data from the Durug€ ol Advanced Biological WWTP processing facility.
After biological treatment, the Durug€ ol Advanced Biological WWTP has a capacity of 212,000 persons/day and was built using physical (coarse screen, fine screen and primary settler units) and advanced biological treatment projects (anaerobic tanks, aeration tanks and secondary settler).The year 2014, saw its commissioning as a discharge.
In order to protect the system, the grits that are present in the influent wastewater are removed from the grit chamber.During the primary treatment, a sizable portion of BOD, COD, SS and other pollutants are eliminated.As shown in Figure 2, the secondary treatment unit, which comprises anaerobic tanks, aeration tanks and a secondary settler receives effluent from the primary settler.The aeration tanks offer the ideal environment for the microorganisms needed to develop and produce sludge as they break down the residual dissolved organic contaminants in the wastewater.In the secondary settler, gravity sedimentation is used to separate the sludge from the cleaned water.To keep the microbe concentration high, some of the sludge is returned to the aeration unit, while the waste sludge is taken out and delivered to the sludge treatment plant.In order to apply control strategy or optimization approaches to the plant and improve treatment efficiency, a proper model may be helpful.In 2018, wastewater samples were taken twice a month from the Durug€ ol Advanced Biological WWTP intake and exit.

ANN for pollution prevention in WWTPs
Different types of primary treatment (two models) and secondary treatment (nine models) were the main processing techniques of the wastewater treatment plan.Two types of primary treatment techniques were modeled, the first is a mechanical screen and primary sedimentation tank and the second is the mechanical screen, grit removal, grease trap and primary sedimentation tank.
As for secondary treatment, a comparison was made between nine different models that were clarified in Table 1.
The MATLAB program was used to create a model that helps to control and predict the expected results of WWTPs (primary treatment and secondary treatment) using the App Designer command.Then, these results were compared with the WATER POLLUTION CONTROL REGULATION (Turkey) for treated wastewater to be drained into receiving water body.The model relies on a set of inputs within a given code to produce the outputs as shown in Figures ( 2a and b).
The inputs and outputs of the MATLAB model were used to then model the results obtained using the neural networks model, and Table 2 shows part of the results of the App Designer model.
Among the most important inputs are the hydraulic retention time (HRT), temperature (T) and dissolved oxygen (DO).As for the output ratio, it is the removal efficiency of biological oxygen demand (BOD 5 ), TN, TP and TSS.The results of the App Designer models are shown in Table 3.
The results obtained from the App Designer model were modeled using neural networks.On the other hand, the network was built with its three layers (inputs, hidden layers and outputs).The transition function is (in this study, the tangent sigmoid function) is selected.
The difference between the actual and desired output values is calculated, and the network model's link weights are adjusted based on the results.The creation of the network, which starts with the connections of the output layers and concludes with the connections of the input layers, realizes the return passage resulting from the weights of the connections.The data in the data set are divided into three portions at random: training, validity and test sets.The data from the training set is utilized to train the network.The validity set is used in conjunction with a classifier's weights.The validity set is used to determine how many hidden units are present in an ANN.The test set is used to assess the training's effectiveness.As stated in Table 4, 70% of the observation data is allocated to the training set, 15% to the validity set and 15% to the test set.The input layer contains two neurons, the hidden layer contains eight neurons and the output layer contains four neurons.The input neurons represented App Designer model variables (such as DO concentration, temperature and HRT), whereas the output neurons indicated BOD, TN, TP and TSS elimination efficiency.To acquire the minimum value of mean square error, the number of The ANN model was tested after it had been trained.When the test set estimates (BOD, TN, TP and TSS) were compared to the values obtained from the MATLAB App Designer model, it was discovered that the ANN estimates produced results that were very near to those observed.Figure 5 shows that the projected values are quite similar to the observed values, their trends are nearly identical, and the figure also indicates that the model can be used to manage the WWTP.In addition, Figure 6 depicts the ANN model's best validation performance.When the comparisons are made, it becomes clear that the ANN model and the MATLAB App Designer model produce extremely similar outcomes.
The ANN model was evaluated after training.It was found that the ANN estimates yielded outcomes that were extremely close to those observed when the test set estimates (BOD, TN, TP and TSS) were compared to the values acquired from the WWTP.The best validation performance of the ANN model was also shown in Figure 6.It is evident from the comparisons that the results produced by the ANN model and the observed values are comparable.Additionally, the ANN technique is cost-effective, allowing us to construct prototype models swiftly and cheaply for the complicated industrial system.ANN also helps us construct correct models in less time, even if we only have a limited amount of experience and knowledge.The process expert can lead the ANN process to derive more sophisticated and accurate AI models by incorporating the expertise of the human expert and altering the functional sets.Future automatic real-time control systems for WWTP may use ANNs due to their capacity to forecast and quickly respond to changes in the status of dynamic processes.
Figure 2. (a) The interface of the MATLAB App Designer model for primary treatment (b) The interface of the MATLAB App Designer model for secondary treatment Results and discussionBased on the data generated by the App Designer model using MATLAB software (MathWorks Inc., USA); an ANN model was created to estimate the final removal efficiency of BOD, TN, TP and TSS.The first model used a three-layer feed-forward neural network (2-8-4).

Figure 3 .
Figure 3.The distribution of the App Designer model and predicted values for ANN model Figure 5.Comparison between the removal efficiency of BOD, TN, TP and TSS for the MATLAB App Designer model and the ANN model (model no. 4 as an example) Figure 6 (K€ uç€ ukkocaoglu, Keskin Benli, & Kucuksozen, 2005)input layer(K€ uç€ ukkocaoglu, Keskin Benli, & Kucuksozen, 2005).From the moment they are born, people begin the process of "learning by doing."The brain continues to develop during this process.Learning occurs as we live and experience by modifying synaptic connections and even generating new ones.This holds true for ANN as well.Learning occurs through training with examples; in other words, realization occurs through processing input/output data, i.e. the training algorithm modifying the synapses' weights using that data until convergence is attained.

Table 5 .
The accuracy of the ANN models