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

Department of Electronics and Communication Engineering, Anurag University, Hyderabad, India HoD-IT, Bhoj Reddy Engineering College for Women, Hyderabad, India Department of Artificial Intelligence, G. H. Raisoni College of Engineering, Nagpur 440016, India Mechanical Engineering Department, College of Engineering, King Khalid University, Abha 61411, Asir, Saudi Arabia Civil Engineering Department, College of Engineering, King Khalid University, Abha-61411, Asir, Saudi Arabia Center for Research in Data Sciences, Universiti Teknologi PETRONAS, Seri Iskandar 32610, Malaysia Department of Electronics and Communication Engineering, Lords Institute of Engineering &Technology, Hyderabad, India Department of Natural and Applied Sciences, College of Community-Aflaj, Prince Sattam bin Abdulaziz University, Al-Kharj, Saudi Arabia Department of Chemical Engineering, College of Biological and Chemical Engineering, Addis Ababa Science and Technology University, Addis Ababa, Ethiopia


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. e 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. ese factors include chemical oxygen demand (COD), biological oxygen demand (BOD), and total suspended substances (TSSs).
ese 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. e 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. e 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. ey 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). is research motivates to increase the performance in wastewater treatment model with the use of artificial intelligence approach.

Literature Survey
e ANN modeling method requires no characterization of the processes occurring either in micro or macro contexts and just requires knowledge of major process parameters. ey 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. e 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. ey 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).
ey 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). e 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. is may help to application availability by ANN.

Types of Industrial Wastewater Treatment
e 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.

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.

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. e sewage water is stressed, and other items are removed from the sewage flux. e outcome is clean water that may be utilized around the house or at commercial premises for other reasons.

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

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

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.

Reverse Osmosis.
e 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.

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

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]. e functional groups, therefore, contribute significantly to the efficiency, capacity, selectivity, and reusability of these adsorbents.
e 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) e 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.

Hybrid AI Techniques
e hybrid AI system uses an expert system to tackle some of the main disadvantages of experts' systems in combination with other AI technologies [11]. e 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. e AI hybrid model includes neural and specialist technologies [22]. e 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]. e neural network thereby acquired the expert system control pattern. e 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].

Methodology
e operations in the current ETP have shown in Figure 2 and replicate more or less the existing reality in the pharmaceutical industry for wastewater treatment [12].

Scientific Programming
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]. e 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]. e primary plant raw garbage is initially collected through a bar screen in the pumping tank. e 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].
e 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: e acidic pH of the wastewater and basic dosage is needed to raise pH to level (6)(7)(8)(9). e average pH of the raw effluent is 3.3. e appropriate pH for anaerobic conditions is 8 to 9, while the appropriate pH for aerobic microorganism is 7 to 8. e 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]. e 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.
e quantity of heavy metals eliminated in the effluent is a major characteristic of several bacterial sulfates [23].
is tank is split into two halves, and the air diffuser supplies oxygen in the tank. ese 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. e 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: e 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. e 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]. e unclean backwash is returned to the pump tank. For low-end purposes, such as toilets and gardening, filtered water can be used.
Sludge Management: e sludge is subsequently sent to the bed or filter press. For disposal, as landfilling, the driedup 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. Figure 3 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]. e design phases are iterated to the satisfaction of the user [26]. Figure 3 describes the technique for developing ANN model.

Data Collection and Preprocessing.
e 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]. e whole set of data included CODInlet from six industry sectors, COD from pull-out, and COD outlet. e 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. e 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].

Model Design.
We use neural ware predicting technologies to design models. e 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.

Feed-Forward Netural Network Model Structure.
A usually excellent FFNN model and weight system adjusted to   (1)). In the neural network, there is an input layer, a hidden layer, and an output layer structure [21]. e 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. e empirical equation (2) was used to compute the number of nodes in the hidden layer.
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.
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.

FFNN Model Optimisation (Feed-Forward Neural Network).
e back propagation (BP) neural network was the first basic FFNN system constructed. e 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]. e neural network BP could continually alter the weight of the network until the mistake was minimized, depending on backward propagation. e 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]. e 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. e 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]. e weights of the BP neural network are represented by vector W.
e quadratic error sum (E) is where k is the number of samples, p ki is the sample expected output of k at node i of the output layer, Z kj 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]. e fitting phenomena might successfully be avoided following regularization to increase the ability to generalize. Overall, the neural network performance function (F) is e performance function is changed into a penalty term for T W .
e 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. erefore, it is important to know how to obtain the values ∝ and β.
(3). SCG Algorithm. e 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. e SCG algorithm is adjusted accordingly where a n is a point in A n , j n is the search direction, and θ n is the search step size of iteration n.
where h n is the function's current gradient and H n is the Hessian matrix of iteration n.

Model Training and
Testing. e 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]. e 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) 6 Scientific Programming 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. e 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).

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

Data Collection.
e 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.

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]. ese 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.
where p i and m i are the values observed and predicted, (p) and (m) are the average of the values observed and predicted, and k is the total number of outputs of model.

Results and Discussions
In this case, the series of data is the target (real) output and the equivalent output values generated by the model. e R 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 (%): e 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: e 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.
Error analysis based on the differences between predicted values and actual data helps compare model outcomes. e results of the trained and tested models and the       regression coefficients for the same series are summarized in Table 2. As seen in Table 2 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 3 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    Figure 9. e training setup, training time, and MSE are obtained for L-M, BR, and SCG.

Conclusion and Future Scope
A potential method in predicting and forecasting water variables is the artificial neural network. is 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 nonlinear in terms of physical, chemical, and biochemical dynamics. For both the model, still ANN produces highly successful outcomes. e value of R 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][28][29].
Data Availability e data sets used and/or analyzed during the current study are available from the corresponding author on reasonable request.

Conflicts of Interest
e authors declare no conflicts of interest.