# Nonlinear Autoregressive Neural Network for Antimicrobial Waste Water Treatment

Authors: Anwer Mustafa Hilal; Mashael M. Asiri; Shaha Al-Otaibi; Faisal Mohammed Nafie; Amal Al-Rasheed; Mohammed Rizwanullah; Ishfaq Yaseen; Abdelwahed Motwakel
Journal: Adsorption Science & Technology
 (2022)

---

## Abstract

Antibiotics become an emerging contaminant and receive more interests due to its ecotoxicological and strong stability in water ecosystems. Antibiotic adsorption onto carbon materials are biochars among the wastewater mechanisms. This research used machine learning (ML) techniques to generate general adsorption forecasting model for sulfamethoxazole (SMX) and tetracycline (TC) on CBM. Dirichlet design parameters and a combined combination of Neumann and Dirichlet boundary situation are applied to the system of differential equations. In addition, the proposed method use the learning under supervision technique of a nonlinear autoregressive for estimating the CO2 concentration and flows in units of rate of a reaction characteristics, an exogenous (NARX) neural network model with two activation functions was used (Log-sigmoid and hyperbolic tangent) and for both the findings of a TC and SMX absorption simulations showed the random forest performed support vector tree and nonlinear autoregressive exogenous neural networks and machine learning methods. Their relevance and complete dependency graph evaluation lead reasonable CBM uses for antimicrobial wastewater treatment. Also, machine learning forecasting model with good generalization capability is useful for building effective CBMs with few empirical screens. It evaluates the accuracy, precision, recall, false positive rate (FPR), and false negative rate (FNR) and also reduces the experimental screening.


---

## Body

## 1. Introduction

Antibiotics are good category of antipathogen medications that are frequently applied in a various disciplines, increasing unintended risk and release to the atmosphere [1]. Antibiotics have indeed been identified in urban wastewater, underground, and agricultural activities, among other complex compartments [2].Antibiotics are considered as contaminants in natural surroundings, with the ability to build antibacterial drugs microorganisms and antibiotic resistance genes [3, 4]. Adsorption is a good method for handling the antibiotic-rich effluents from industries in comparison to membrane technology, advanced oxidation processes, and bioremediation [5–7] because of its high extraction effectiveness, low price, and ease of handling [8]. Because of their large specific surface area (SSA), plentiful groups on the surface, and tune-able porous architectures, carbon-based materials (CBMs) have typically shown remarkable adsorption ability for antibiotics removal among the regularly researched adsorbents [9, 10].It examined the reaction mechanism of CO2 and phenyl glycidyl ether (PGE) in a hybrid process even during physiological CO2 absorption into PGE samples containing the catalysts THA–CP–MS41 [11]. The phenomenon of combination is described by nonlinear degree of difference equation, which was solved [12] to use the homotopy analytical method to connect the stable condition concentrations of CO2 and PGE. The cost-effective CBMs made from hydrocarbon through or agricultural residues, including such activated carbon (AC) and biochar (BC), can obtain waste minimization, recovery of resources, and valuation done at the same time [13–15]. Because of their well-formed organization and customized face composition, graphene and carbon nanotube-based resources too performed better in treating wastewater [16–18].Earlier studies utilizing classical adsorption behavior and isotherm models [19–21] explored extensively the antibiotics adsorption of these CBMs, indicating possible configuration settings such as particle adsorbents, h-bonding, electrostatic forces, and interrelations. Nevertheless, under the same research framework, a conventional manages changeable new procedure be not in favor of finding its correlations among every relevant element (e.g., substance qualities and adsorption circumstances) and adsorption capability [22]. As a result, universal model for predicting antibiotic adsorption and gaining fresh perspectives into attained significance of each necessary component and their group focus on antibiotic adsorption capacity which would be beneficial.The research helps to identify the solutions for:(1)
How quantity of adsorption predicted using machine learning in SMX and TC?(2)
How was nonlinear autoregressive exogenous (NARX) neural network antibiotic adsorption?(3)
How the broadcasting is experimentally reduced?The proposed nonlinear autoregressive exogenous (NARX) neural network and gradient boosting trees help to detect the antibiotic adsorption in carbon materials. The contribution of this research is shown below:(1)
To estimate the capability of SMX/TC antibiotic adsorption on CBM which has parameters in substances and adsorption circumstances(2)
To examine various ML methods quality presented by ANN algorithm and CPR algorithm(3)
Evaluate every substances power in attributes comparatively and ability of adsorption situation with TC and SMX, synergy among the element is analysed(4)
A simulation theorem for carbon dioxide (CO2) systems is offered. Moreover, the systems of unique nonlinear degree of difference methods for the normalized attention of CO2, TC with SMX optimized using a unique stochastic method based on nonlinear autoregressive exogenous (NARX) neural networks by means of the Levenberg–Marquardt method(5)
The results collected are evaluated with the values predicted, the A company also supports decomposed technique, machine learning methods, and numerical solution to authorize the correctness of the plan supervised knowledge processThe paper is structured as follows: Section2 has a brief description of existing adsorption on carbon-based material, nonlinear techniques, autoregressive exogenous techniques (NARX), and machine learning (ML) techniques. Section 3 consists of working nature of the proposed methodology. Section 4 has result evaluation details and gives algorithm performance measures. Section 5 finally concludes the work.


## 2. Related Works

The explosive growth of easy-to-interpret machine learning techniques and analysis and understanding for ML representation (e.g., local open to interpretation model-agnostic explanations) has made machine learning (ML) an useful tool for elaborating difficult multivariate relationships [23, 24]. Recent research has used machine learning techniques to improve adsorption settings, build adsorption equations [25, 26], and develop inverted adsorbent substances [27].These physicochemical features of CBM are evaluated among the 6 groups. A pattern of O/C versus H/C fraction reflects the level of carbon and solubility in water of CBMs and was shown using a Van Krevelen diagram [28]. The molecular proportions of H/C under 0.3 substantially indicate carbonized architecture inside the CBM frameworks, whereas molecular proportions H/C over 0.72 indicate an incomplete carbonized structure [29, 30].Grouping, predictive modeling, linear regression, identification, minimization, and predictions are all tasks that artificial neural networks (ANNs) are employed for [31]. ANNs are analysis models which are activated by the biomedical neural circuits and also contain a remarkable capability to study, retain, and remember in sequence. These are black-box simulation software that could do nonlinear translation starting such an n-dimensional contribution vector to an m-dimensional production sequence with undetermined output signals regions [32].An ANN model is chosen and determined by the previous understanding of the system to be modeled. NARX is a negative variant of the autoregressive exogenous (ARX) instruments, which would be widely used to find depth industry algorithms. Double responsive controllers engage with double detectors [33], chaotic series data predictions [34], everyday concentrated sunlight energy forecasting [35], and lengthy time series forecasting [36] are just a few of the nonlinear dynamical systems that NARX frameworks have been used to simulate. NARX stands for recurring energetic neural system, which is a sort of neural network so as to study from past knowledge. It has numerous levels of input links which surround the system.Heat impacts charge transport dynamics and interactions among adsorbent materials and adsorption isotherms, making it yet another important component in adsorptive activity [37]. According the PDP findings, the adsorption rate of TC on CBMs temperature increases, which could be explained in parts to enhanced TC dispersion and chemical bonding at the surface [38]. Since it has simply three CBMs having carbon concentrations more than 90% in the TC adsorption study, the falling trend lacking statistical validity should be disregarded whenever the measured values are scarce.Physical interactions and electrochemical reactions (e.g., covalently connectivity and ionic bond formation) among antibiotics and the adsorbent are involved in the adsorption of antibiotic on CBMs [7]. As a result, physicochemical possessions of adsorbents, molecular structural organization of antibiotics, and adsorption circumstances (e.g., pH, dose, and solutions biochemistry) are the primary determinants of adsorption performance [11].Even without basic premises of typical model of isotherm, the unique model ML was constructed straight using accessible new information in the writing (such as monolayer adsorption with Langmuir representation). Finally, ML algorithms consist of superior representational power for a wide application range in settings and CBM adsorbents [38], but the prediction model reliability is based on the availability and quality of data entering. This prediction ability of generated models might considerably decrease the moment and costly scientific method for CBM design and application with the specialized growth of ML methodology intended for comprehending the antibiotics adsorption mechanism.


## 3. Proposed NARX Methodologies

The suggested method employs nonlinear autoregressive exogenous (NARX) neural network, and random forest with gradient boosting plants for predicting the amount of antibiotics adsorption in carbon-based materials. It tests tetracycline (TC) and sulfamethoxazole (SMX) adsorption in CBMs. It also forecasts numerous attributes based on molecular organization, pragmatic concepts, and TC and SMX levels. Relative significance and biased dependence graphs evaluation may lead to appropriate CBM usage for antimicrobial treatment of wastewater, but trustworthy ML forecast approaches by means of overview for building efficient CBM with less testing practically. Figure1 describes the proposed architecture of system.Figure 1
Architecture of proposed system.


### 3.1. Data Collection from Carbon-Based Materials for Antibiotic Adsorption

The data is gathered for TC, and SMX adsorption on carbon materials (CBM) was gathered out of a total of 40 published journals published within last decades. The additional materials summarize the event that took place for required TC and SMX adsorptions. The arrangement lists of the molecules and physic-chemical TC are SMX parameters. In [24], the relevant characteristic of CBM is associated with antibiotic ability of adsorption wad obtained straightly using starting databases or derived from isotherm models. Biochar materials (BC, 61 items), activated form of carbon (AC, 27substance), waste as feedstock (WF, 4.0substance), magnetically altered biochar (MBC, 12 substance), carbon nanotube (CNTs, 3 items), and graphene oxide were among the 111 different types of CBM adsorbents used in the study (GO, 2 items).A majority of such CBM adsorbent materials were made from forest management biomass waste and some additional particular industrial waste. Such waste material was processed using thermochemical process and/or mechanical grinding [31], resulting in porous valuation of CBM that is used as an expense, and resources recovery is ecologically a flexible approach. Ten important parameters were chosen review of relevant literature and separated into three categories in ability to forecast the adsorption capability (Q, mg/g) of CBMs for antibiotics and evaluate the varied effects of CBM features just on sorption for TC and SMX.


### 3.2. Comparison of Physiochemical Characteristics

Some physicochemical features of CBM are evaluated at six categories by quantitative test. This had an impact substantially on adsorption of antibiotic capability. A range of H/C and O/C mass proportion, which reflects its carbon level along with hydrophilicity of CBMs, was shown using a Van Krevelen diagram [32]. H/C molar ratios less than 0.3 indicate a substantially inside the carbon architecture of frameworks, whereas molecular proportion of H/C is greater than 0.7 which indicates an inadequate carbonized architecture [33, 34]. The level of carbonization and trace minerals of various CBM is evaluated using C weight and ash weight percent. Box plots obtain the probability of SBET parameters and pHpzc of several CBM. The Pearson’s association coefficient was also used to create linear correlation among any two features of ACs and BCs [24].


### 3.3. Preprocessing the Data

For developing the machine learning representation, the information of contributing feature as input were only adjusted withZ-score equality by the following equation.
(1)XnI∗=XnI−μσ.Here, theXnI∗ represents the range of normalization and XnI is a represented input variable with new standard. Where μ as mean and σ as standard deviation are used for calculation.The natural neural network, which consists of a nonlinear mapping arrangement by means of an input, hidden, and output layers, is considered as an inspiration for ANN. A feed-forward error-based back propagation method is used for classification. The signal factors (e.g., sigmoid and ReLu) and connection factor in various level help in node generation value at output, then finally, goal is achieved with outcome. The perceptron parameters were twisted of difference among anticipated and principles mentioned as possible.The records are separated between trained data and testing data in 80 : 20 ratio, having various types of carbon materials being good at each category. For comparison of estimated result in ML model, they utilize the divides. With the learning model, five-fold cross validation is used for obtaining best high energy, whereas test dataset left behind was utilized to calculate approximately the model presentation considered as a social approval process.(2)R2−1−∑I=1NypIexp−ypIprediction2∑I−1NypIexp−ypave−exp2(3)RMSE=1N∑I−1NypIexp−ypIprediction2Here,ypIexp and ypIprediction are the standard prediction, and ypave−exp is represented as principles tentatively.


### 3.4. Artificial Neural Networks (ANN) and NARX Model

Grouping, classification techniques, linear regression, identification, minimization, and forecasting are all tasks that artificial neural networks (ANNs) are employed for [30, 31]. ANNs are analysis models which are activated by the human neural circuits and also have a remarkable ability to study, retain, and remember in order. These are indeed a sort of black modeling framework which can conduct nonlinear translation as of such an n-dimensional participation data to an m-dimensional productivity vector when both the incoming and outgoing regions are uncertain [32].An ANN representation chosen is determined by the previous understanding of the system to be modeled. NARX is a negative variation of the autoregressive exogenous (ARX) instruments that is used to detect linear black-box structures. Double responsive controllers interface with the dual sensors [33], unpredictable series data predictions [34], everyday concentrated sunlight energy forecasting [35], and long-term instance sequence forecasting [36] are just a few of the nonlinear systems that NARX models have been used to simulate. NARX stands for recurrent dynamic neural network, which is a sort of neural network that learns on prior experiences. It has numerous levels of output links that surround the networks.As shown in Figure2, NARX has two frameworks: sequence and similar framework and parallel framework.Figure 2
Architecture of NARX neural networks.The concentrations and adsorption of CO2 into a CBM are investigated using a parallel architecture NARX model in this model. The NARX model in general is as follows:
(4)Y^T+1=fYT,YT−1,⋯..,YT−NY,XT+1XT,XT−1,⋯⋯..,XT−NX.The timeframe is represented byT, outputs of the NARX at period interval T are represented by Y^T+1, and the incoming and outgoing latencies are represented by NX and NY. A transfer function of neural networks is F..The primary benefit of employing layered architecture would be that the standard multilayer perceptron (MLP) training technique be able to be utilized to training neurons. The MLP has a strong framework that helps it possible to train any sort of continuously nonlinear mapping. There are three main levels in a conventional MLP: input, hidden, and output. Additional components include neurons, commencement function, and weight.The Log-sigmoid and hyperbolic tangent were utilized as activation functions in this investigation. These algorithms have a substantially faster rate of convergence than some other establishment purpose. Log sigmoid and hyperbolic tangent activation functions have higher optimum gradients ratios over start purpose, making these distinct. Equations (5) and (6) give the mathematical representation for these activation functions, accordingly.
(5)f1X=11+e−X`,(6)f2X=eX−eXeX+e−X`.


## 3.1. Data Collection from Carbon-Based Materials for Antibiotic Adsorption

The data is gathered for TC, and SMX adsorption on carbon materials (CBM) was gathered out of a total of 40 published journals published within last decades. The additional materials summarize the event that took place for required TC and SMX adsorptions. The arrangement lists of the molecules and physic-chemical TC are SMX parameters. In [24], the relevant characteristic of CBM is associated with antibiotic ability of adsorption wad obtained straightly using starting databases or derived from isotherm models. Biochar materials (BC, 61 items), activated form of carbon (AC, 27substance), waste as feedstock (WF, 4.0substance), magnetically altered biochar (MBC, 12 substance), carbon nanotube (CNTs, 3 items), and graphene oxide were among the 111 different types of CBM adsorbents used in the study (GO, 2 items).A majority of such CBM adsorbent materials were made from forest management biomass waste and some additional particular industrial waste. Such waste material was processed using thermochemical process and/or mechanical grinding [31], resulting in porous valuation of CBM that is used as an expense, and resources recovery is ecologically a flexible approach. Ten important parameters were chosen review of relevant literature and separated into three categories in ability to forecast the adsorption capability (Q, mg/g) of CBMs for antibiotics and evaluate the varied effects of CBM features just on sorption for TC and SMX.


## 3.2. Comparison of Physiochemical Characteristics

Some physicochemical features of CBM are evaluated at six categories by quantitative test. This had an impact substantially on adsorption of antibiotic capability. A range of H/C and O/C mass proportion, which reflects its carbon level along with hydrophilicity of CBMs, was shown using a Van Krevelen diagram [32]. H/C molar ratios less than 0.3 indicate a substantially inside the carbon architecture of frameworks, whereas molecular proportion of H/C is greater than 0.7 which indicates an inadequate carbonized architecture [33, 34]. The level of carbonization and trace minerals of various CBM is evaluated using C weight and ash weight percent. Box plots obtain the probability of SBET parameters and pHpzc of several CBM. The Pearson’s association coefficient was also used to create linear correlation among any two features of ACs and BCs [24].


## 3.3. Preprocessing the Data

For developing the machine learning representation, the information of contributing feature as input were only adjusted withZ-score equality by the following equation.
(1)XnI∗=XnI−μσ.Here, theXnI∗ represents the range of normalization and XnI is a represented input variable with new standard. Where μ as mean and σ as standard deviation are used for calculation.The natural neural network, which consists of a nonlinear mapping arrangement by means of an input, hidden, and output layers, is considered as an inspiration for ANN. A feed-forward error-based back propagation method is used for classification. The signal factors (e.g., sigmoid and ReLu) and connection factor in various level help in node generation value at output, then finally, goal is achieved with outcome. The perceptron parameters were twisted of difference among anticipated and principles mentioned as possible.The records are separated between trained data and testing data in 80 : 20 ratio, having various types of carbon materials being good at each category. For comparison of estimated result in ML model, they utilize the divides. With the learning model, five-fold cross validation is used for obtaining best high energy, whereas test dataset left behind was utilized to calculate approximately the model presentation considered as a social approval process.(2)R2−1−∑I=1NypIexp−ypIprediction2∑I−1NypIexp−ypave−exp2(3)RMSE=1N∑I−1NypIexp−ypIprediction2Here,ypIexp and ypIprediction are the standard prediction, and ypave−exp is represented as principles tentatively.


## 3.4. Artificial Neural Networks (ANN) and NARX Model

Grouping, classification techniques, linear regression, identification, minimization, and forecasting are all tasks that artificial neural networks (ANNs) are employed for [30, 31]. ANNs are analysis models which are activated by the human neural circuits and also have a remarkable ability to study, retain, and remember in order. These are indeed a sort of black modeling framework which can conduct nonlinear translation as of such an n-dimensional participation data to an m-dimensional productivity vector when both the incoming and outgoing regions are uncertain [32].An ANN representation chosen is determined by the previous understanding of the system to be modeled. NARX is a negative variation of the autoregressive exogenous (ARX) instruments that is used to detect linear black-box structures. Double responsive controllers interface with the dual sensors [33], unpredictable series data predictions [34], everyday concentrated sunlight energy forecasting [35], and long-term instance sequence forecasting [36] are just a few of the nonlinear systems that NARX models have been used to simulate. NARX stands for recurrent dynamic neural network, which is a sort of neural network that learns on prior experiences. It has numerous levels of output links that surround the networks.As shown in Figure2, NARX has two frameworks: sequence and similar framework and parallel framework.Figure 2
Architecture of NARX neural networks.The concentrations and adsorption of CO2 into a CBM are investigated using a parallel architecture NARX model in this model. The NARX model in general is as follows:
(4)Y^T+1=fYT,YT−1,⋯..,YT−NY,XT+1XT,XT−1,⋯⋯..,XT−NX.The timeframe is represented byT, outputs of the NARX at period interval T are represented by Y^T+1, and the incoming and outgoing latencies are represented by NX and NY. A transfer function of neural networks is F..The primary benefit of employing layered architecture would be that the standard multilayer perceptron (MLP) training technique be able to be utilized to training neurons. The MLP has a strong framework that helps it possible to train any sort of continuously nonlinear mapping. There are three main levels in a conventional MLP: input, hidden, and output. Additional components include neurons, commencement function, and weight.The Log-sigmoid and hyperbolic tangent were utilized as activation functions in this investigation. These algorithms have a substantially faster rate of convergence than some other establishment purpose. Log sigmoid and hyperbolic tangent activation functions have higher optimum gradients ratios over start purpose, making these distinct. Equations (5) and (6) give the mathematical representation for these activation functions, accordingly.
(5)f1X=11+e−X`,(6)f2X=eX−eXeX+e−X`.


## 4. Result Analysis

The proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees in predicting antibiotic adsorption in CBM. Biochars (BC), activated carbons (AC), waste feeds (WF), magnetic modified biochar (MBC), carbon nanotubes (CNT), and graphene oxides are some of the characteristics used in the suggested research (GO). It assesses accuracy, execution time, correctness, recall, false positive rate (FPR), and false negative rate (FNR). The python environment is used to compute the results.


### 4.1. Accuracy

It correctly classifies the CO2 adsorption in carbon-based materials. This is a metric which is used to predict the overall percentage of true positive and true negative elements throughout every component, and then it is written like this:
(7)A=Tp+TnTp+Tn+Fp+Fn.Figure3 shows that the proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees techniques that classify the data accurately with biochar 95.55% and activated carbon 96%.Figure 3
Accuracy.


### 4.2. Execution Time

Execution time is evaluated by the number of CBMs and the number of seconds which take for completing the rounds. Initially, the data are given and then it executes each CBMs. It executes each task.Figure4 shows the execution time of the proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees system. Compared with other algorithms, the proposed method reduces the execution time.Figure 4
Execution time.


### 4.3. Precision

It precisely classifies the carbon-based materials in the dataset using the following equation.(8)precision=TPTP+FP×100.Figure5 represents precision rate on carbon materials detected. The proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees that outperforms with the traditional random forest model.Figure 5
Precision.


### 4.4. Recall

The positive values are correctly classified from the dataset. It has numerous parameters for classification. The values are evaluated based on the following equation.(9)recall=TPTP+FN.Figure6 represents proposed recall measures. The proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees method that outperforms well.Figure 6
Recall.


## 4.1. Accuracy

It correctly classifies the CO2 adsorption in carbon-based materials. This is a metric which is used to predict the overall percentage of true positive and true negative elements throughout every component, and then it is written like this:
(7)A=Tp+TnTp+Tn+Fp+Fn.Figure3 shows that the proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees techniques that classify the data accurately with biochar 95.55% and activated carbon 96%.Figure 3
Accuracy.


## 4.2. Execution Time

Execution time is evaluated by the number of CBMs and the number of seconds which take for completing the rounds. Initially, the data are given and then it executes each CBMs. It executes each task.Figure4 shows the execution time of the proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees system. Compared with other algorithms, the proposed method reduces the execution time.Figure 4
Execution time.


## 4.3. Precision

It precisely classifies the carbon-based materials in the dataset using the following equation.(8)precision=TPTP+FP×100.Figure5 represents precision rate on carbon materials detected. The proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees that outperforms with the traditional random forest model.Figure 5
Precision.


## 4.4. Recall

The positive values are correctly classified from the dataset. It has numerous parameters for classification. The values are evaluated based on the following equation.(9)recall=TPTP+FN.Figure6 represents proposed recall measures. The proposed nonlinear autoregressive exogenous (NARX) neural network outperforms gradient boosting trees method that outperforms well.Figure 6
Recall.


## 5. Conclusion

Antibiotic adsorption on CBM like charcoals and activated carbons is considered as the most efficient solution for wastewater treatments. For TC and SMX in the present model, the random forest algorithm and ANN techniques are used to forecast the amounts of antibiotics in the CBMs. The broadcast efforts of the trials to reduce antibiotics from industrial effluent tend to be a bit tricky. For forecasting antibiotic quantities in industrial wastewater, the suggested method employs nonlinear autoregressive exogenous (NARX) neural network that outperforms gradient boosting trees biochar (BC), activated carbons (AC), waste feeds (WF), magnetic modified biochars (MBC), carbon nanotubes (CNT), and graphene oxides are some of the characteristics used in the suggested research (GO). It evaluates the accuracy, recall, precision, false positive rate (FPR), and false negative rate (FNR). It reliably predicts and aids in the removal of antibiotics from wastewater, as well as reducing the need for experimental screenings. In future, various machine learning techniques can be included for carbon adsorption techniques, and recently, optimization algorithms play a vital role. Swarm intelligence techniques can be used in this carbon adsorption for optimal solution.



---

*Source: 6292200-2022-03-31.xml*