# IOT Based Smart Wastewater Treatment Model for Industry 4.0 Using Artificial Intelligence

Authors: Narendar Singh D; Murugamani C; Pravin R. Kshirsagar; Vineet Tirth; Saiful Islam; Sana Qaiyum; Suneela B; Mesfer Al Duhayyim; Yosef Asrat Waji
Journal: Scientific Programming
 (2022)

---

## Abstract

Wastewater is created by pharma firms and has become a huge worry for the ecosystem. There is a significant amount of toxins that are being dropped continuously from numerous pharmaceutical companies that causes serious damages to the environment and public health because of its comprising high organics as well as inorganic loadings and thus requirements appropriate treatment before final disposal to the ecosystem. Goal of this approach is to treat the wastewater treatment model with industrial data. Algorithms of the artificial neural network (ANN) were employed progressively to predict parameters for wastewater plants. This provision assists users to take remedial measures and function the process by the standards. It is proven as beneficial technology because of its complicated mechanism, dynamic and inconsistent changes in aspects, to overcome some of the limitations of common mathematical models for the wastewater treatment plant. The target is to achieve better prediction accuracy in wastewater treatment model. In this paper, ANN approaches are relevant to the prediction of input and effluent chemical oxygen demand (COD) for effluent treatment procedures. Artificial neural networks (ANNs) offer accurate technique modeling for complex systems using an artificial intelligence technique. Three distinct types of back-propagation ANN were devised to avoid the concentration of wastewater treatment facilities in the concentration of COD, suspended particles, and mixed liquid solids in an epidermal water treatment tank (MLSS). To anticipate COD levels in influential and effluent areas, two ANN-based techniques have been presented. The proper structure for the neural network models was identified via a variety of training and model testing methods. An efficient and robust forecasting tool has been created for the ANN model.


---

## Body

## 1. Introduction

Nowadays, intelligent models are advanced in wastewater process simulation such that they are extensively employed for modeling complicated processes. It is difficult to analyze and anticipate their performances exactly in complex interactions between the elements of ecological system activities [1]. Environmental impacts and their environmental engineers mainly have two main features: they depend on numerous factors and the complicated interactions between their factors that make them very difficult to assess. It is challenging and hard to operate industrial wastewater treatment facilities that have effluents that it has different quality and quantitative levels and have more uncertainty about urban wastewater and the nature of biological activities [2]. Techniques for artificial neural networks (ANN) in many environment fields, including wastewater treatment, have been implemented. The treatment of wastewater is quite complicated. Nevertheless, improvements in intelligent approaches allow them to be used in complicated modeling systems [3]. Due to their great precision, robustness, and very potential applications in engineering may be utilized for the improved prevision of performance characteristics. Some essential variables may be used to assess the wastewater treatment plant performance. These factors include chemical oxygen demand (COD), biological oxygen demand (BOD), and total suspended substances (TSSs). These features have been used as a model for wastewater treatment plants in the most accessible evaluations to present (WWTPs) [4].So encouraging techniques in the provision of records have been identified in neural networks. The effluent concentration may be predicted by the ANN model [5]. It is affected by the structure and operation of the brain and central nervous system. The purpose of the ANN is to convert a certain number of input patterns into certain output patterns first by training from a series of previous occurrences that characterize the system provided with input and output. To predict the correct output of a new input pattern, the system will next utilize training information. They need a minimum understanding of the system’s intrinsic activities [6, 7]. In particular, ANN can tackle issues with complicated non-linear mappings or connections that do not provide standard algorithmic solutions [8].In this paper two models for the prediction of COD, i.e. input COD and output COD, were developed using artificial neural networks (ANN). This research motivates to increase the performance in wastewater treatment model with the use of artificial intelligence approach.


## 2. Literature Survey

The ANN modeling method requires no characterization of the processes occurring either in micro or macro contexts and just requires knowledge of major process parameters. They can handle partial data, spread, and offer some tolerance to faults.Amoueyan [1] performed a QMRA to microbial infectious disease estimate and to evaluate the dangers of various drinking reuse systems. The evaluation of bioaerosol effects in wastewater treatment facilities and dangers of direct potable reuse was carried out by comparable QMRA experiments.Elgallal et al. [2] assessed the danger connected with the contaminants in the recovered groundwater was analyzed by a risk matrix technique, in terms of environment and health. They examined the effects of heavy metals, salinity, nutrients, suspended particles, and dangerous organics on soil, plants, humans, and surface waters.Courault et al. [4] applied a quantitative microbial risk analysis used the methodology for assessing air enteric viruses discharged from wastewater for irrigation (QMRA). They found that the result may help to formulate safe water recycling rules, but it takes higher computation time.Kulkarni and Chellam [5] suggested the artificial neural networks usage for the disinfection process, as opposed to traditional approaches, may increase the prediction of the inactivation of microorganisms over time and other physiochemical water factors, such as the temperature and pH.Kshirsagar et al. [9] develop the application of artificial intelligence for various challenges of categorization and prediction. In addition, the application of hybrid artificial intelligence for the extraction, classification, prediction, and modeling of features using multiple algorithms and optimization strategies is explained [10]. Significant advancements in machine learning [11], case-based reasoning, multiagency reasoning, time-specific planning [12], web crawler interpreting and translation, and a vision of virtual reality are all significant developments in the field of artificial intelligence [13].Manoharan et al. [14] examined the utilization of neural artificial networks to simulate the nonlinear process of biotechnology function. In the absence of a mathematical formula, the system’s behavior can be replaced and predicted on time by an artificial neural network trained in a collection of real data sets. Further, in identifying algorithms, predicting and diagnosing various biotechnology systems, this approach is beneficial. Data overfitting in large data processing may occur.Ren et al. [8] exhibited an effective optimization of the FFNN model by a scaling conjugate gradient and a good performance in terms of a correlation coefficient compared to other models (R). The improved FFNN model could forecast effluent TN accurately by using influential water characteristics and important control parameters. In this work, the improved FFNN model has achieved for the effective elimination of pollutants and the reduction in energy consumption in most WWTPs. This may help to application availability by ANN.


## 3. Types of Industrial Wastewater Treatment

The techniques and procedures utilized for the treatment of wastewater produced as a by-product of industrial or industrial activity are covered under industrial wastewater processing. Following the treatments, industrial waste (or effluent) treated water may be reused or disposed of in the environment in a sewer system or surface water. Although the latest trends are to avoid such products or to recycle wastewater in the manufacturing process in the industrialized world, most companies create certain wastewater. Many sectors remain, nevertheless, reliant on wastewater processing.


### 3.1. Effluent Treatment Plants (ETP)

It is employed in the chemical and pharmaceutical industry by the main firms. Such firms are using water purification technology and the removal of harmful and nontoxic compounds. ETPs help safeguard the environment. ETP is where wastewater and industrial effluent treatment is carried out. Pollutants and effluents are involved in the manufacture of pharmaceuticals. Pollution, dust, debris, polymers, and grain from the medication are being retrieved from treatment plants [15, 16]. In wastewater treatment, the ETP plant uses drying and evaporation processes. To eliminate any pollutants, effluent treatment is used. To limit the risk of contamination, wastewater treatment facilities are arranged [9, 17]. If the biodegradable organic substances are not resolved in good time, the pollution may grow.


### 3.2. Sewage Treatment Plants (STP)

Domestic wastewater treatment refers to a method through which impurities are eliminated. To remove natural and physiological impurities, the procedure employs chemical, physical, and biological procedures. It contributes to the generation of a waste stream, appropriate for environmental reuse [18]. Pretreatment procedures help in the removal of raw wastewater materials. The sewage water is stressed, and other items are removed from the sewage flux. The outcome is clean water that may be utilized around the house or at commercial premises for other reasons.


### 3.3. Common and Combined Effluent Treatment Plants (CETP)

Healing systems cannot be used in small industry and hence CETP can be used. The CETP is located where small industrial units are installed. The CETP’s major goal is to reduce the expenses of handling small businesses [10, 19]. The common and integrated effluent treatment systems can assist small enterprises to process wastewater without much money.


## 3.1. Effluent Treatment Plants (ETP)

It is employed in the chemical and pharmaceutical industry by the main firms. Such firms are using water purification technology and the removal of harmful and nontoxic compounds. ETPs help safeguard the environment. ETP is where wastewater and industrial effluent treatment is carried out. Pollutants and effluents are involved in the manufacture of pharmaceuticals. Pollution, dust, debris, polymers, and grain from the medication are being retrieved from treatment plants [15, 16]. In wastewater treatment, the ETP plant uses drying and evaporation processes. To eliminate any pollutants, effluent treatment is used. To limit the risk of contamination, wastewater treatment facilities are arranged [9, 17]. If the biodegradable organic substances are not resolved in good time, the pollution may grow.


## 3.2. Sewage Treatment Plants (STP)

Domestic wastewater treatment refers to a method through which impurities are eliminated. To remove natural and physiological impurities, the procedure employs chemical, physical, and biological procedures. It contributes to the generation of a waste stream, appropriate for environmental reuse [18]. Pretreatment procedures help in the removal of raw wastewater materials. The sewage water is stressed, and other items are removed from the sewage flux. The outcome is clean water that may be utilized around the house or at commercial premises for other reasons.


## 3.3. Common and Combined Effluent Treatment Plants (CETP)

Healing systems cannot be used in small industry and hence CETP can be used. The CETP is located where small industrial units are installed. The CETP’s major goal is to reduce the expenses of handling small businesses [10, 19]. The common and integrated effluent treatment systems can assist small enterprises to process wastewater without much money.


## 4. Techniques for Wastewater Treatment

### 4.1. Membrane Filtration

Ultrafiltration, reverse osmosis, and nanofiltration are the most prevalent membrane methods for removing metals from the wastewater.


#### 4.1.1. Ultrafiltration

Ultrafiltration is a membrane technology used to remove dissolved and colloidal particles at low transmembrane pressures. In the case of a hydrated ion or a small molecular weight complex in UF, the membrane pore dimensions are bigger than dissolved metal ions; these ions can pass easily through. Wastewater treatment with reuse application is reviewed in [20]. To achieve high efficiency of elimination, micellar-enhanced ultrafiltration (MEUF) enhanced micellar processes have served to remove copper, chromate, zinc, nickel, serinium, arsenate, and organic products such as phenol or cresol.


#### 4.1.2. Reverse Osmosis

The method of reverse osmosis (RO) involves a half-permeable membrane that may be passed through the filtered liquid, while the impurities are rejected. RO is one method that may eliminate from the water a wide variety of dissolved organisms.


#### 4.1.3. Nanofiltration

The intermediary between UF and RO is nanofiltration (NF). The NF is a promising technique for removing nickel, chromium, copper, and arsenic from wastewater heavy metal ions.


### 4.2. Adsorption

Adsorption is regarded to be one of the most successful, affordable, and ecologically friendly processing processes used in wastewater treatment. Water reuse requirements and rigorous requirements of runoff are sufficiently robust in the industry. Adsorption is essentially a process of mass transfer, which involves transferring the metal ion from the fluid to the sorbent’s surface and is bound up by physical and/or chemical interaction [21]. The functional groups, therefore, contribute significantly to the efficiency, capacity, selectivity, and reusability of these adsorbents.The major processes involved in pollutant adsorption on solid adsorbents are(1)
Transmission of metal ions to the external surface of the adsorbent from the liquid phase.(2)
Internal pore molecular diffusion from the external adsorbent surface to the interior large surface area.(3)
Adsorption of adsorbate in the pores of adsorbent at the binding sites.(4)
The total adsorption rate is either film production or intraparticle dissemination or both are very fast as compared to the other two processes as the last phase of adsorption.


## 4.1. Membrane Filtration

Ultrafiltration, reverse osmosis, and nanofiltration are the most prevalent membrane methods for removing metals from the wastewater.


### 4.1.1. Ultrafiltration

Ultrafiltration is a membrane technology used to remove dissolved and colloidal particles at low transmembrane pressures. In the case of a hydrated ion or a small molecular weight complex in UF, the membrane pore dimensions are bigger than dissolved metal ions; these ions can pass easily through. Wastewater treatment with reuse application is reviewed in [20]. To achieve high efficiency of elimination, micellar-enhanced ultrafiltration (MEUF) enhanced micellar processes have served to remove copper, chromate, zinc, nickel, serinium, arsenate, and organic products such as phenol or cresol.


### 4.1.2. Reverse Osmosis

The method of reverse osmosis (RO) involves a half-permeable membrane that may be passed through the filtered liquid, while the impurities are rejected. RO is one method that may eliminate from the water a wide variety of dissolved organisms.


### 4.1.3. Nanofiltration

The intermediary between UF and RO is nanofiltration (NF). The NF is a promising technique for removing nickel, chromium, copper, and arsenic from wastewater heavy metal ions.


## 4.1.1. Ultrafiltration

Ultrafiltration is a membrane technology used to remove dissolved and colloidal particles at low transmembrane pressures. In the case of a hydrated ion or a small molecular weight complex in UF, the membrane pore dimensions are bigger than dissolved metal ions; these ions can pass easily through. Wastewater treatment with reuse application is reviewed in [20]. To achieve high efficiency of elimination, micellar-enhanced ultrafiltration (MEUF) enhanced micellar processes have served to remove copper, chromate, zinc, nickel, serinium, arsenate, and organic products such as phenol or cresol.


## 4.1.2. Reverse Osmosis

The method of reverse osmosis (RO) involves a half-permeable membrane that may be passed through the filtered liquid, while the impurities are rejected. RO is one method that may eliminate from the water a wide variety of dissolved organisms.


## 4.1.3. Nanofiltration

The intermediary between UF and RO is nanofiltration (NF). The NF is a promising technique for removing nickel, chromium, copper, and arsenic from wastewater heavy metal ions.


## 4.2. Adsorption

Adsorption is regarded to be one of the most successful, affordable, and ecologically friendly processing processes used in wastewater treatment. Water reuse requirements and rigorous requirements of runoff are sufficiently robust in the industry. Adsorption is essentially a process of mass transfer, which involves transferring the metal ion from the fluid to the sorbent’s surface and is bound up by physical and/or chemical interaction [21]. The functional groups, therefore, contribute significantly to the efficiency, capacity, selectivity, and reusability of these adsorbents.The major processes involved in pollutant adsorption on solid adsorbents are(1)
Transmission of metal ions to the external surface of the adsorbent from the liquid phase.(2)
Internal pore molecular diffusion from the external adsorbent surface to the interior large surface area.(3)
Adsorption of adsorbate in the pores of adsorbent at the binding sites.(4)
The total adsorption rate is either film production or intraparticle dissemination or both are very fast as compared to the other two processes as the last phase of adsorption.


## 5. Hybrid AI Techniques

The hybrid AI system uses an expert system to tackle some of the main disadvantages of experts’ systems in combination with other AI technologies [11]. The expert system depends on expert consultations on data gathering, and no important data can be synthesized into the complicated environment until new data becomes required.The AI hybrid model includes neural and specialist technologies [22]. The AI hybrid controlling model WWTP is shown in Figure 1. From the export-controlled system, the training data required for the neural network were created [23]. The neural network thereby acquired the expert system control pattern. The expert system creates a chemical oxygen demand (COD) value limit within the aeration tank and transmits this value to the nerve network via a sludge recycling rate. If the recycled sludge rate can only discharge a serious condition, i.e., if the COD concentration in the aeration tank is high, the expert system will create a second COD objective, and control will take place again before the critical situation in operation can be released [24].Figure 1
A system for the control of a WWT plant with hybrid AI.


## 6. Methodology

The operations in the current ETP have shown in Figure2 and replicate more or less the existing reality in the pharmaceutical industry for wastewater treatment [12].Figure 2
Process flow diagram.Screening: It aims to remove coarse and fine materials from the intake, preventing in consecutive phases deposition and obstruction. Raw spring effluent is often received gravitationally into the bar screen chamber [25]. The supplied screen removes any floating and large-sized components, including pipelines and pumps, such as plastic buckets, polythene, glasses, and stones.Equalization Tank: Effluent for equalization is collected and intended for a minimum of 8 hours of typical storage. Municipal water is combined here with primary water. Air blower and the distribution system for gross bubble aeration to obtain a consistent and uniform blend of discharge concentrations [13, 14]. The primary plant raw garbage is initially collected through a bar screen in the pumping tank. The tank is meant to hold air grids attached to air blowers for hydraulic use of approximately 10 hours to keep the solids in suspension.Flocculation and Clarification: In the flocculation compartment, coagulant and plasma will then be dosed in the air by the equalized effluent water in the flocculation tank. By dosing with pumping or gravitative force, alum, lime, and polyelectrolyte are introduced to the sludge forming reaction tank [8]. The reagents are injected and valve controlled in the pipeline feeder. Preparing and dosing a chemical solution depends on the BOD, COD, and suspended substances qualities in this phase and decreases by roughly 50%. For additional treatment to remove BOD, COD, etc., overflow from the LAMELLA clarification tank is used, while the underflow is used for sludge treatment.Neutralization: The acidic pH of the wastewater and basic dosage is needed to raise pH to level (6–9). The average pH of the raw effluent is 3.3. The appropriate pH for anaerobic conditions is 8 to 9, while the appropriate pH for aerobic microorganism is 7 to 8. The anaerobic microorganisms lower their biochemical reactors by a minimum of pH by 0.5–1.5 through the production of organic acids and neutralize [16] pH by regulated alkali dosage in the effluent pH 9.0 for plant safety purposes.Anaerobic Digestion and Clarification: For the biochemical reaction, the effluent from a highly dirty equalizing tank is poured into an anaerobic digester. Some cow dung may normally be utilized in the earliest stages as anaerobic microbial fertilizer (up to 5 days). CH4 gases, organic acids, N2, and Co2 produced will also be lowered and pH lowered by the biological response in this area [18, 19]. The nutrients as nitrogen and phosphorous supply are used for the aerobic biomass. Finally, this digestion minimizes the overall amount of sludge.Aerobic Digestion and Clarification: In oxidation, microbial activity oxidized aerobic bacteria and microorganisms are neutral effluents, to reduce the pollution burden (BOD, COD, TDS, TSS, etc.). Especially sensitive to these bacteria are the pH, temperature, dissolved oxygen, and nutrients. Aeration delivers oxygen, in the form of an aeration bubble, oxidizing organic and inorganic oxidizing substances by using air diffusers through a biochemical process. The quantity of heavy metals eliminated in the effluent is a major characteristic of several bacterial sulfates [23].This tank is split into two halves, and the air diffuser supplies oxygen in the tank. These sulfides form very insoluble precipitates with heavy metals, such as cd, cu, zn, cr, and are eliminated from the reduction system leading to the synthesis of biogenic sulfide.After oxidation, a cleaner is applied to the new cell at the bottom of the clearing unit with suspended sludge. The activated sludge is also provided in the distribution tank, and part of it is carried as fertilizers at the sludge drying bed or filter press, and a portion is transported to the anaerobic pond [2, 4, 8]. Clearwater is overflowing by clarifier drain in a clear water tank/posts oxidation tank to keep a specified level of MLSS (3500–3800pc) in the oxidation tank as great accuracy.Chlorination: The excess of the secondary clarification lamella is collected in a clear water tank, where sodium hypochlorite chlorine is administered to assist in the disinfection process. The disinfected water is next filtered to attain the required quality of the water.Filtration and Adsorption on Activated Carbon: Chlorinated wastewater is subsequently pushed into the multifunctional filter to remove hanging solids. For additional cleansing and removal of excess chlorine, the filtered water is next put through activated carbon filters. In the treated water tank, the ACF is collected from where filters are pumped for reverse washing [23, 24]. The unclean backwash is returned to the pump tank. For low-end purposes, such as toilets and gardening, filtered water can be used.Sludge Management: The sludge is subsequently sent to the bed or filter press. For disposal, as landfilling, the dried-up muck is carefully removed. Aerobic digesters will create a very minimum amount of sludge when dry and anaerobic sludge is cleaned once a year and disinfected by sodium hypochloride. It can be used as fertilizer or as a soil supply system.


## 7. ANN Model Development

Figure3 illustrates the ANN modeling technique, comprising multiple steps: training data collection, preprocessing the data collected, selecting the ANN structure, ANN parameters determination, the training of ANN, and training failures analysis [15]. The design phases are iterated to the satisfaction of the user [26]. Figure 3 describes the technique for developing ANN model.Figure 3
Steps of the model development process.


### 7.1. Data Collection and Preprocessing

The accuracy of ANN training and evaluating raw plant information were assessed. Interpolation was used to calculate the missing values. By visualizing and analyzing statistics, anomalies were eliminated [9]. The whole set of data included CODInlet from six industry sectors, COD from pull-out, and COD outlet. The input and output ANN variables for an ETP must be selected based on an engineering evaluation on which the input and output of an effluent COD may have a substantial influence. The purpose is to achieve the best effluent forecast with less input. As the number of input variables rises, the complexity of the model and effluent training and assessment are required greater, and unwanted noise can also occur [4].


### 7.2. Model Design

We use neural ware predicting technologies to design models. The feed for forwarding backpropagation ANN was taken on the view of their shown capacity for water quality predictions, utilizing a supervised normal cumulative delta [10, 17] (NCD) analysis and an activation/transference hyperbolic tangent (tanh) model.


#### 7.2.1. Feed-Forward Netural Network Model Structure

A usually excellent FFNN model and weight system adjusted to the error of predicted and actual values have been achieved via constant improvement (Equation (1)). In the neural network, there is an input layer, a hidden layer, and an output layer structure [21]. The standard FFNN models were set up to provide six variable values including influential water quality (COD, SS, and MLSS) and wastewater treatment plant concentration levels were set as outputs for effluent chemical oxygen demand (COD), suspended solids (SS), and the MLSS mixed liquor suspended solids (MLSS). Figure 4 illustrates the approach for FFNN-base modeling and encoding [18]. Data were relatively small, so that the number of hidden layers was modified to save working time, improve efficiency, and avoid overlap. The empirical equation (2) was used to compute the number of nodes in the hidden layer.(1)s=Xf+u,where “s” is the output variable, “X” is the weight matrix, “f” is the input variable, and “u” is the matrix of biases in the network.(2)g=j+v+P.Figure 4
The model AN architecture for predicting concentration of COD, SS, and MLSS.If “g” is the number of nodes in the hidden layer, “j” refers to the number of nodes in the input layer, “v” represents the number of layer nodes in the output, and “p” is the adjustment constant between 1 and 10.


#### 7.2.2. FFNN Model Optimisation (Feed-Forward Neural Network)

The back propagation (BP) neural network was the first basic FFNN system constructed. The error between the forecasted values and actual values could revert to the buried level during the training process on the BP neural network [11, 21]. The neural network BP could continually alter the weight of the network until the mistake was minimized, depending on backward propagation. The algorithm of gradient descent was the most prevalent approach used to continually modify weight. It can change the network weight towards a gradient descent and can finally make a minimal mistake [12]. The technique of linear regression is often reduced to a minimum local value rather than a minimum global value during the actual process of training and affecting the accuracy and efficiency of learning. To maximize the FFNN model, 3 optimization algorithms (L-M, BR, and SCG) have been applied to enhance learning efficiency and prediction accuracy.(1). L–M algorithm. The Gauss–Newton (G–N) algorithm and descending gradient method are incorporated into the L–M method. Compared to the conventional approach of descending gradients, the local minimum may be efficiently avoided and convergence speed to the global minimum improved [9]. The weights of the BP neural network are represented by vector W. The quadratic error sum (E) is(3)E=12∑∑pki−Zkj2=12∑εk2=12ε2,where k is the number of samples, pki is the sample expected output of k at node i of the output layer, Zkj is the actual output, and εk is a member of vector ε.(2). BR Algorithm. By Bayes’s approach, BR may regulate the neural network. Regularization refers to limiting network complexity by the addition of a penalty term during the training phase [10, 17]. The fitting phenomena might successfully be avoided following regularization to increase the ability to generalize. Overall, the neural network performance function (F) is(4)F=T.The performance function is changed into a penalty term forTW.(5)F=αTW+βT,TW=12W2.The proportion of the penalty term is determined by the relative magnitude of∝ and β. If ∝≪β, the training error is minimized, but overfitting is maximized. If ∝≫β, it concentrates on the network limit, making the prediction ability of the model weak. Therefore, it is important to know how to obtain the values ∝ and β.(3). SCG Algorithm. The SCG is an enhanced BP standard neural network. In the usual way of descending gradients, the path of descent is perpendicular to the preceding one [11], which makes it difficult to estimate the global minimum. The SCG algorithm is adjusted accordingly(6)An+1=An+θnjn,where an is a point in An, jn is the search direction, and θn is the search step size of iteration n.(7)θn=−hnTjnjnTHnjn,where hn is the function’s current gradient and Hn is the Hessian matrix of iteration n.


### 7.3. Model Training and Testing

The purpose of training is to establish the link between historical inputs and corresponding model outputs. When training data are shown on the input layer on the system, the backpropagation begins. Based on weight, transmission function, and form of the grid, the input signal passes via the network to create an output signal [12]. The process of learning helps the network to choose several weights that provide an optimal mapping of input/output. In the process, an error function is used to compare the resulting signal with the desired output signal, as shown in equation (8)(8)Yt=12∑cjt−xjt2,where the global error function is Y (t), xj(t) is the network output predicted at a discrete-time t, and cj(t) is the network output at a discrete-time t. Small, random quantities are first given to weights. The weights are continuously updated or changed using the “normal cumulative delta rule” to attempt and reduce the error function as the learning continues.Depending on the learning rate and the inertia value, the size of the time, the derivation of the transfer function, and the resulting node, the quantity of each connection weight is changed. Training has finished in this analysis when the forecasts received via an additional test data set have not improved significantly (RMSE decrease) [13, 25]. In comparison with the right value of the provided patterns, this value, which is the projected model value, is changed to lower the total squared error in line with the backpropagation procedure. Root mean square mistakes (RMSE) in equation (9) and average absolute errors (AAE) between the real and forecast values indicated in equation are the most common performance measurement in ANN models in equation (10).


### 7.4. Model Execution

Once we have completed the training and testing, the model can be run and the values may be obtained.


### 7.5. Data Collection

The data are collected over 31 months from a standard wastewater treatment facility. A total of 250 data are picked, of which 175 for training and 75 for testing are used.


### 7.6. Evaluation of Model Performance

In computing RMSE, AAE, and MAPE between model output and measurements of training and testing data sets in Equations ((9) to (11)), the performances of each ANN model were measured. In addition, there was a correlation coefficient (r) of (12) in the test findings for the minimal mistakes [11]. These r values were utilized to determine the ideal model structure as additional criteria. RMSE is used to assess the model accuracy indicated in (9) root mean square error. Although RMSE values are used to distinguish between model performance during training and testing [10], it may also be used to evaluate individual model performance with other predictive models.(9)RMSE=∑i=1kpi−mi2k,(10)AAE=1k∑i=1kpi−mi,(11)MAPE=1k∑i=1kpi−mipi×100,(12)r=∑p−p¯m−m¯∑p−p¯2∑m−m¯2,where pi and mi are the values observed and predicted, p¯andm¯ are the average of the values observed and predicted, and k is the total number of outputs of model.


## 7.1. Data Collection and Preprocessing

The accuracy of ANN training and evaluating raw plant information were assessed. Interpolation was used to calculate the missing values. By visualizing and analyzing statistics, anomalies were eliminated [9]. The whole set of data included CODInlet from six industry sectors, COD from pull-out, and COD outlet. The input and output ANN variables for an ETP must be selected based on an engineering evaluation on which the input and output of an effluent COD may have a substantial influence. The purpose is to achieve the best effluent forecast with less input. As the number of input variables rises, the complexity of the model and effluent training and assessment are required greater, and unwanted noise can also occur [4].


## 7.2. Model Design

We use neural ware predicting technologies to design models. The feed for forwarding backpropagation ANN was taken on the view of their shown capacity for water quality predictions, utilizing a supervised normal cumulative delta [10, 17] (NCD) analysis and an activation/transference hyperbolic tangent (tanh) model.


### 7.2.1. Feed-Forward Netural Network Model Structure

A usually excellent FFNN model and weight system adjusted to the error of predicted and actual values have been achieved via constant improvement (Equation (1)). In the neural network, there is an input layer, a hidden layer, and an output layer structure [21]. The standard FFNN models were set up to provide six variable values including influential water quality (COD, SS, and MLSS) and wastewater treatment plant concentration levels were set as outputs for effluent chemical oxygen demand (COD), suspended solids (SS), and the MLSS mixed liquor suspended solids (MLSS). Figure 4 illustrates the approach for FFNN-base modeling and encoding [18]. Data were relatively small, so that the number of hidden layers was modified to save working time, improve efficiency, and avoid overlap. The empirical equation (2) was used to compute the number of nodes in the hidden layer.(1)s=Xf+u,where “s” is the output variable, “X” is the weight matrix, “f” is the input variable, and “u” is the matrix of biases in the network.(2)g=j+v+P.Figure 4
The model AN architecture for predicting concentration of COD, SS, and MLSS.If “g” is the number of nodes in the hidden layer, “j” refers to the number of nodes in the input layer, “v” represents the number of layer nodes in the output, and “p” is the adjustment constant between 1 and 10.


### 7.2.2. FFNN Model Optimisation (Feed-Forward Neural Network)

The back propagation (BP) neural network was the first basic FFNN system constructed. The error between the forecasted values and actual values could revert to the buried level during the training process on the BP neural network [11, 21]. The neural network BP could continually alter the weight of the network until the mistake was minimized, depending on backward propagation. The algorithm of gradient descent was the most prevalent approach used to continually modify weight. It can change the network weight towards a gradient descent and can finally make a minimal mistake [12]. The technique of linear regression is often reduced to a minimum local value rather than a minimum global value during the actual process of training and affecting the accuracy and efficiency of learning. To maximize the FFNN model, 3 optimization algorithms (L-M, BR, and SCG) have been applied to enhance learning efficiency and prediction accuracy.(1). L–M algorithm. The Gauss–Newton (G–N) algorithm and descending gradient method are incorporated into the L–M method. Compared to the conventional approach of descending gradients, the local minimum may be efficiently avoided and convergence speed to the global minimum improved [9]. The weights of the BP neural network are represented by vector W. The quadratic error sum (E) is(3)E=12∑∑pki−Zkj2=12∑εk2=12ε2,where k is the number of samples, pki is the sample expected output of k at node i of the output layer, Zkj is the actual output, and εk is a member of vector ε.(2). BR Algorithm. By Bayes’s approach, BR may regulate the neural network. Regularization refers to limiting network complexity by the addition of a penalty term during the training phase [10, 17]. The fitting phenomena might successfully be avoided following regularization to increase the ability to generalize. Overall, the neural network performance function (F) is(4)F=T.The performance function is changed into a penalty term forTW.(5)F=αTW+βT,TW=12W2.The proportion of the penalty term is determined by the relative magnitude of∝ and β. If ∝≪β, the training error is minimized, but overfitting is maximized. If ∝≫β, it concentrates on the network limit, making the prediction ability of the model weak. Therefore, it is important to know how to obtain the values ∝ and β.(3). SCG Algorithm. The SCG is an enhanced BP standard neural network. In the usual way of descending gradients, the path of descent is perpendicular to the preceding one [11], which makes it difficult to estimate the global minimum. The SCG algorithm is adjusted accordingly(6)An+1=An+θnjn,where an is a point in An, jn is the search direction, and θn is the search step size of iteration n.(7)θn=−hnTjnjnTHnjn,where hn is the function’s current gradient and Hn is the Hessian matrix of iteration n.


## 7.2.1. Feed-Forward Netural Network Model Structure

A usually excellent FFNN model and weight system adjusted to the error of predicted and actual values have been achieved via constant improvement (Equation (1)). In the neural network, there is an input layer, a hidden layer, and an output layer structure [21]. The standard FFNN models were set up to provide six variable values including influential water quality (COD, SS, and MLSS) and wastewater treatment plant concentration levels were set as outputs for effluent chemical oxygen demand (COD), suspended solids (SS), and the MLSS mixed liquor suspended solids (MLSS). Figure 4 illustrates the approach for FFNN-base modeling and encoding [18]. Data were relatively small, so that the number of hidden layers was modified to save working time, improve efficiency, and avoid overlap. The empirical equation (2) was used to compute the number of nodes in the hidden layer.(1)s=Xf+u,where “s” is the output variable, “X” is the weight matrix, “f” is the input variable, and “u” is the matrix of biases in the network.(2)g=j+v+P.Figure 4
The model AN architecture for predicting concentration of COD, SS, and MLSS.If “g” is the number of nodes in the hidden layer, “j” refers to the number of nodes in the input layer, “v” represents the number of layer nodes in the output, and “p” is the adjustment constant between 1 and 10.


## 7.2.2. FFNN Model Optimisation (Feed-Forward Neural Network)

The back propagation (BP) neural network was the first basic FFNN system constructed. The error between the forecasted values and actual values could revert to the buried level during the training process on the BP neural network [11, 21]. The neural network BP could continually alter the weight of the network until the mistake was minimized, depending on backward propagation. The algorithm of gradient descent was the most prevalent approach used to continually modify weight. It can change the network weight towards a gradient descent and can finally make a minimal mistake [12]. The technique of linear regression is often reduced to a minimum local value rather than a minimum global value during the actual process of training and affecting the accuracy and efficiency of learning. To maximize the FFNN model, 3 optimization algorithms (L-M, BR, and SCG) have been applied to enhance learning efficiency and prediction accuracy.(1). L–M algorithm. The Gauss–Newton (G–N) algorithm and descending gradient method are incorporated into the L–M method. Compared to the conventional approach of descending gradients, the local minimum may be efficiently avoided and convergence speed to the global minimum improved [9]. The weights of the BP neural network are represented by vector W. The quadratic error sum (E) is(3)E=12∑∑pki−Zkj2=12∑εk2=12ε2,where k is the number of samples, pki is the sample expected output of k at node i of the output layer, Zkj is the actual output, and εk is a member of vector ε.(2). BR Algorithm. By Bayes’s approach, BR may regulate the neural network. Regularization refers to limiting network complexity by the addition of a penalty term during the training phase [10, 17]. The fitting phenomena might successfully be avoided following regularization to increase the ability to generalize. Overall, the neural network performance function (F) is(4)F=T.The performance function is changed into a penalty term forTW.(5)F=αTW+βT,TW=12W2.The proportion of the penalty term is determined by the relative magnitude of∝ and β. If ∝≪β, the training error is minimized, but overfitting is maximized. If ∝≫β, it concentrates on the network limit, making the prediction ability of the model weak. Therefore, it is important to know how to obtain the values ∝ and β.(3). SCG Algorithm. The SCG is an enhanced BP standard neural network. In the usual way of descending gradients, the path of descent is perpendicular to the preceding one [11], which makes it difficult to estimate the global minimum. The SCG algorithm is adjusted accordingly(6)An+1=An+θnjn,where an is a point in An, jn is the search direction, and θn is the search step size of iteration n.(7)θn=−hnTjnjnTHnjn,where hn is the function’s current gradient and Hn is the Hessian matrix of iteration n.


## 7.3. Model Training and Testing

The purpose of training is to establish the link between historical inputs and corresponding model outputs. When training data are shown on the input layer on the system, the backpropagation begins. Based on weight, transmission function, and form of the grid, the input signal passes via the network to create an output signal [12]. The process of learning helps the network to choose several weights that provide an optimal mapping of input/output. In the process, an error function is used to compare the resulting signal with the desired output signal, as shown in equation (8)(8)Yt=12∑cjt−xjt2,where the global error function is Y (t), xj(t) is the network output predicted at a discrete-time t, and cj(t) is the network output at a discrete-time t. Small, random quantities are first given to weights. The weights are continuously updated or changed using the “normal cumulative delta rule” to attempt and reduce the error function as the learning continues.Depending on the learning rate and the inertia value, the size of the time, the derivation of the transfer function, and the resulting node, the quantity of each connection weight is changed. Training has finished in this analysis when the forecasts received via an additional test data set have not improved significantly (RMSE decrease) [13, 25]. In comparison with the right value of the provided patterns, this value, which is the projected model value, is changed to lower the total squared error in line with the backpropagation procedure. Root mean square mistakes (RMSE) in equation (9) and average absolute errors (AAE) between the real and forecast values indicated in equation are the most common performance measurement in ANN models in equation (10).


## 7.4. Model Execution

Once we have completed the training and testing, the model can be run and the values may be obtained.


## 7.5. Data Collection

The data are collected over 31 months from a standard wastewater treatment facility. A total of 250 data are picked, of which 175 for training and 75 for testing are used.


## 7.6. Evaluation of Model Performance

In computing RMSE, AAE, and MAPE between model output and measurements of training and testing data sets in Equations ((9) to (11)), the performances of each ANN model were measured. In addition, there was a correlation coefficient (r) of (12) in the test findings for the minimal mistakes [11]. These r values were utilized to determine the ideal model structure as additional criteria. RMSE is used to assess the model accuracy indicated in (9) root mean square error. Although RMSE values are used to distinguish between model performance during training and testing [10], it may also be used to evaluate individual model performance with other predictive models.(9)RMSE=∑i=1kpi−mi2k,(10)AAE=1k∑i=1kpi−mi,(11)MAPE=1k∑i=1kpi−mipi×100,(12)r=∑p−p¯m−m¯∑p−p¯2∑m−m¯2,where pi and mi are the values observed and predicted, p¯andm¯ are the average of the values observed and predicted, and k is the total number of outputs of model.


## 8. Results and Discussions

In this case, the series of data is the target (real) output and the equivalent output values generated by the model. TheR and RMS errors show how “similar” a data series to another is to be. R ranges between −1.0 and +1.0. A greater value (absolute value) R shows a greater correlation. In the training and test sets, the R values for the model are close together, which allows the model to generalize correctly and predict exactly.Accuracy (%): The proportion of forecast results falls inside the tolerance zone of the respective goal values given by the operator.Confidence Interval (%): Sets the range (target value ± trust interval) in which the associated expected output happens with a set level of trust.Model analysis: The training will be based on 175 data and the entire 250 tests will require 75 data, as shown in Table 1. Results are predicted from neural products.Table 1
Two models for the prediction of COD, i.e., input COD and output COD, were developed using artificial neural networks (ANN).
Model 1COD/eqRRMSAccuracy (30%)Conf. interval (90%)RecordsAll0.9125140.5692.67273.786250Train0.9342129.4591.25245.897175Test0.8798163.3493.42340.43275Model 2COD/OutletRRMSAccuracy (30%)Conf. interval (90%)RecordsAll0.72897.456789.2314.567250Train0.79347.012592.4513.892175Test0.64898.456283.4516.98275Error analysis based on the differences between predicted values and actual data helps compare model outcomes. The results of the trained and tested models and the regression coefficients for the same series are summarized in Table2. As seen in Table 2, after model training, RMSEs, AAEs, and MAPEs were 3.21, 1.99 mg/L, 4.56% for the COD model, 0.72, 7.23% for SS, 0.51 mg/L, and 2.3% for MLSS and 39.45, 31.34 mg/L and 3.01% for the models for MLSS. As regard model testing, for the SS, 1.65, 1.34, and 17.45 percent for SS and 53.67, 45.78 mg/L, and 4.02 percent for the MLSS model were 3.45, 2.34 mg/L, and 5.15 percent for the COD model, respectively. The prediction performance with high accuracy is indicated by models COD, SS, and MLSS based on error analysis. Performance metrics of training and testing of COD effluent are shown in Figure 5, performance metrics of training and testing of SS effluent are shown in Figure 6, performance metrics of training and testing of MLSS effluent are shown in Figure 7, and correlation coefficient (r) of different effluents is shown in Figure 8.Table 2
ANN performance statistics computed across all training and test data.
Effluent CODEffluent SSMLSSTrainingTestingTrainingTestingTrainingTestingr0.890.860.950.690.920.85RMSE (mg/L)3.213.450.721.6539.4553.67AAE (mg/L)1.992.340.511.3431.3445.78MAPE (%)4.565.157.2317.453.014.02Figure 5
Performance metrics of training and testing of COD effluent.Figure 6
Performance metrics of training and testing of SS effluent.Figure 7
Performance metrics of training and testing of MLSS effluent.Figure 8
Correlation coefficient (r) of different effluents.


### 8.1. Comparison of Three Optimization Algorithms

Table3 summarizes significant FFNN training parameters based on various optimization strategies. All three FFNN models were found to have appropriate MSE (<0.001), which was better than the model during the training process; however, the methods were not optimized. Due to its shortest training duration, the SCG algorithm was characterized by the fastest training strategy. The performance of different optimization algorithms for MSE is shown in Figure 9. The training setup, training time, and MSE are obtained for L-M, BR, and SCG.Table 3
Appropriate FFNN training variables based on various optimization algorithms.
AlgorithmTraining stepTraining timeMSEL-M11610.00023BR1005200.00095SCG170<<10.00049Figure 9
Performance of different optimization algorithms for MSE.


## 8.1. Comparison of Three Optimization Algorithms

Table3 summarizes significant FFNN training parameters based on various optimization strategies. All three FFNN models were found to have appropriate MSE (<0.001), which was better than the model during the training process; however, the methods were not optimized. Due to its shortest training duration, the SCG algorithm was characterized by the fastest training strategy. The performance of different optimization algorithms for MSE is shown in Figure 9. The training setup, training time, and MSE are obtained for L-M, BR, and SCG.Table 3
Appropriate FFNN training variables based on various optimization algorithms.
AlgorithmTraining stepTraining timeMSEL-M11610.00023BR1005200.00095SCG170<<10.00049Figure 9
Performance of different optimization algorithms for MSE.


## 9. Conclusion and Future Scope

A potential method in predicting and forecasting water variables is the artificial neural network. This paper shows that COD prediction with ANN proves superior to standard mathematical modeling. Wastewater treatments using ETP are a succession of complicated processes, which are non-linear in terms of physical, chemical, and biochemical dynamics. For both the model, still ANN produces highly successful outcomes. The value ofR for model 1 is 0.91, showing a high correlation between actual CODeq and predicted CODeq. Likewise, the R-value is 0.72 for model-2 and RMS is 7.45 and demonstrates superior outcomes. Accuracy for Model 1 is 92 percent while Model 2 is 89 percent. ANN learns from past plant data to obtain more accurate findings with the advancement of technology. In future, the work may be extended with the optimized performance of waste water treatment model in various analyzed states. Swarm intelligence technique is determined to get the better outcome [27–29].



---

*Source: 5134013-2022-02-25.xml*