1 Introduction

Water is one of the essential components of the ecosystem in which the continuous existence of flora and fauna on planet earth is impinged on. Industrialization and other anthropogenic activities have threatened the aqueous environment, thus endangering the hydrosphere due to the introduction of contaminants and toxic materials [1] which can be categorized as chemical and biological contaminants. The chemical pollutant sources include contamination due to domestic wastes (sewage and sludge), industrial waste such as insecticides and herbicides producing industries, food processing waste, mining industries, pharmaceutical industries, textile industries, pollutants from livestock operations, metal plating facilities, refineries, and polymer industries [2].

Research has shown that the major contaminant associated with all these anthropogenic activities is the introduction of heavy metals. The bioavailability and toxicity of these metals depend on the state or the environmental condition. Synergistic effects of Pb2+ in the aquatic environment have been shown to cause structural damage or physiological alteration in the fin, alteration of hepatocytes in fishes, and some other aquatic fauna [3, 4]. Due to their non-biodegradable nature, they tend to be persistent in the environment and could be bioaccumulated in aquatic plants and animals [2], which could find its way into the human food chain. Moreover, aquatic fauna served as one of the major sources of protein to humans. They are said to be lethargic even at a low concentration of 10 μg/dL for adult and for children 5 μg/dL, resulting in a series of chronic health challenges in humans [2, 5]. Some of such lethargic impact includes live or kidney damages, abnormality of endocrine glands and cardiovascular, gastrointestinal, and central nervous system [68]. Also, viruses, bacteria, and other microbes in water have been shown to cause cholera, dysentery, typhoid fever, etc. These are common waterborne diseases [9]. This type of contamination is also majorly attributed to human and animal waste due to the discharge of pathogenic microorganisms into water bodies [10, 11].

Several methods have been in place to rid the water body of these toxicants to achieve a contaminant-free aquatic environment. These techniques include reverse osmosis, ultrafiltration, ion-exchange, chemical precipitation, phytoremediation, and adsorption [11, 12]. However, adsorption has gained wide interest because of its advantages such as versatility and ease of operation, among others [12, 13]. The commonly used adsorbent for water purification is activated carbon (AC), but it suffers a setback due to high cost of production. Therefore, efforts have focused on the facile preparation of cheap, easy to prepare, versatile, and efficient adsorbent, which can easily be prepared and utilized in rural settings to remove water contaminants. This necessitated the development of cost-effective alternative technologies, thereby resulting in the emergence of agricultural waste vis-à-vis its composite as an alternative for the development of economical and eco-friendly treatment process of wastewater.

Biosorption is a technique that involves selective sequestration of contaminants in water by using plant or animal-based adsorbent [14, 15]. This has been reportedly employed for the decontamination of industrial effluents. An efficient adsorption process of removing heavy metals present in simulated or real wastewater using low-cost plant-based adsorbents has been demonstrated [1518], for instance, biosorption of lead ions from its solution using biomass and biomass-based adsorbents [14, 19, 20]. Various studies on the biosorption of various toxic metals, namely, Pb2+, Zn, and Cd+, have been reported [11, 21]. Other biosorption studies have employed Mango peel [22], orange peel [23], Theobroma cacao pod [4], and banana peel [24].

Furthermore, the excellent ecofriendly characteristics of chitosan which includes biodegradability, nontoxicity, biocompatibility, good antimicrobial properties, and ability to chelate with a series of chemical substances have accorded it a great attention for potential application in wastewater treatment. This scavenging potential is due to the presence of amino (-NH2) and hydroxyl (-OH) moiety in chitosan molecule [25]. However, research has shown that the active sites which are responsible for adsorption purposes could not be directly accessed by potential adsorbents [26]. This is as a result of the conformation and configuration of linear chains of chitosan which crystallizes with another chain through the formation of hydrogen bond thus resulting to the poor solubility and reactivity of chitosan. In order to address these challenges and thus harness the adsorptive potential of chitosan, it is therefore imperative to modify it with a low cost and environmentally friendly material thus forming a composite.

Recently, composites have been synthesized for heavy metal adsorption from an aqueous solution. Unuabonah et al. [27] developed a composite constituting Carica papaya seeds and Musa paradisiaca (plantain peels), which demonstrated better affinity for phosphate ions while chitosan-functionalized eggshell for the removal of Cu2+ ion from aqueous solution [28] has also been reported. However, there is no report on the antimicrobial study of chitosan/walnut composites and their mechanistic biosorption behavior for Pb2+ ions from wastewater.

For the first time, the present study describes the development of chitosan biomass-based composite materials for the antimicrobial activity and efficient adsorptive removal of Pb2+ ions from an aqueous solution. The study was carried out to harness the viability of walnut shell—an agricultural waste—as potential adsorbent to ameliorate the challenges associated with agricultural waste management and heavy metal pollution control. Furthermore, this study is aimed at enhancing the uptake capacity of these biomass materials by functionalizing with chitosan for better and maximum removal of Pb2+ ions. The procedures for synthesizing the aforementioned materials for this study are not cumbersome and thus amenable for industrial scale-up and eco-friendly fabrication.

2 Materials and methods

2.1 Preparation of the adsorbents

The walnut fruits were obtained from Kuto market, Abeokuta, Ogun state, Nigeria. The shells were crushed and were thoroughly washed with distilled water in order to remove the dirt. The walnut shells (WNS) were air-dried, ground to powder using an electrical blender. The resultant was sieved using British Standard Sieves with 100 um mesh size in order to obtain a fine particle. Chitosan (CH) was obtained from Sigma Aldrich. The WNS–CH composites were obtained by dissolution of CH and WNS separately in 2 and 10 % aqueous acetic acid, respectively. Furthermore, WNS was treated with 2 % NaHCO3 for neutralization. Then, the neutralized WNS solution was added to CH solution, and the mixture was treated with an alkaline coagulant solution at ratio of 5:4:1 w/w of H2O, MeOH and NaOH, respectively. The WNS–CH (5:1) composite thus obtained was washed with distilled water, oven dried at 60 °C for 10 h, and stored for further experimental use.

2.2 Adsorbate

Analytical grade chemicals were used in this study without further purifications. The standard solution of Pb (II) was prepared from Pb(NO3)2 by dissolving 1.598 g of the salt in 1,000 mL distilled water. This stock solution was then diluted to required concentrations, and the pH values of resulting solutions were adjusted using a digital pH meter to desired values with 1.0 mol/L NaOH or HCl. Different concentrations were prepared from the respective stock solution using serial dilution.

2.3 Characterization of the biosorbent

Determination of the morphological changes in the adsorbent before modification with CH, after modification and adsorption of metal ion, was observed using a scanning electron microscope (SEM) (Tescan, UK). The surface chemistry of the adsorbents was analyzed with the Fourier transform infrared spectroscope (FT-IR) (Buck Scientific, Model 530M, USA) with KBr disk technique used to establish the main functional groups present on the adsorbent and their interaction with the metal ions.

2.4 Adsorption equilibrium study

The batch adsorption experiments were carried out by exposing 50 mL of 20 mg/ L Pb2+ solution to 300 mg of WNS-CH composite in 250 mL Erlenmeyer flasks. These were allowed to reach equilibrium in an orbital shaker (Thermo Fisher scientific, USA) at 180 rpm for 120 min after which the aliquots were withdrawn and filtered. The filtrate was analyzed for residual Pb2+ concentration using an AAS spectrophotometer (Buck Scientific, 200 series, USA). The quantity of the pollutants adsorbed onto unit weight of the adsorbents was calculated using Eqs. (1) and (2)

$${q}_e=\frac{\left({\textbf{C}}_{\textbf{o}}-{\textbf{C}}_{\textbf{e}}\right)\textbf{V}}{\textbf{m}}$$
(1)
$$\%R=\frac{{\textbf{C}}_{\textbf{o}}-{\textbf{C}}_{\textbf{e}}}{\textbf{C}\textbf{o}}\times 100$$
(2)

where qe, Co, and Ce, V, m, and %R represent the amount of pollutant adsorbed (mg/g), initial and equilibrium liquid-phase concentrations of the pollutants (mg/L), the volume of the solution (L), weight of the sorbent used (g), and percent pollutant removal respectively. The data obtained were fitted to the adsorption and kinetic models for a better understanding of adsorption process.

2.5 Isotherm models

In order to optimize the design of an adsorption system for the removal of adsorbate (Pb2+), different models were used to explain the relation between adsorbate equilibrium concentration on the solid phase and in the liquid phase at room temperature. This is useful in establishing the most suitable correlation for the adsorption equilibrium curves. In this study, the nonlinear expression of Langmuir (Eq. 3), Freundlich (Eq. 4), Langmuir-Freundlich (Eq. 5), Brouers Sotolongo (Eq. 6), and Temkin (Eq. 7) were applied. The nonlinear equations representing these isotherm models are illustrated below:

$${q}_e=\frac{Q_m{K}_L{C}_e}{1+{K}_L{C}_e}$$
(3)
$${q}_e={K}_F\left({C}_e\right.\Big){}^{1/n}$$
(4)
$${q}_e=\frac{Q_m\left({k}_a\left.{C}_e\right)\right.}{K_a{C}_e+1}$$
(5)
$${q}_e={q}_m\left(1-\left({e}^{\left({k}_w|{C}_e\right)\left.\upalpha \right)}\right.\right)$$
(6)
$${q}_e={q}_m\ln \left({K}_T{C}_e\right)$$
(7)

where qe is amount of pollutant adsorbed at equilibrium, qmax is maximum adsorption capacity (mg/g), Ce is the equilibrium concentration (mg/L), KF is Freundlich constant, n equals to adsorption intensity, Ka is affinity constant for adsorption (L/mg), Kw is index of heterogeneity KF/qmax, and α measures the energy heterogeneity of the adsorbent of the adsorbent surface [29].

2.6 Effects of process variables

The effect of initial metal ion concentration ranging from 20 to 100mg/ L on the adsorption of Pb2+ using 300mg WNS-CH composite was studied. For the effect of adsorbent dose, the dose was varied from 150 to 450 mg, while the effect of pH was studied using initial solution pH values ranging from 2.0 to 10.0. The solution pH was adjusted with 0.1M HCl and 0.1M NaOH. And finally the effect of solution temperature was examined between 10 and 50 °C on adsorption of 20 mg/ L Pb2+ Kinetic 4studies. This gives important details on the reaction pathway and provides a better explanation of the relationship between amounts of pollutant removal and the rate of adsorption. For the sake of this study, a similar experiment in the adsorption equilibrium study was carried out; however, aliquots were withdrawn from the reaction medium at intervals of 5, 10, 20, 40, 60, 80, 100, 120, 140, and 160 min and analyzed for the concentration of residual Pb2+ in solution. The experimental data were fitted to the pseudo-first-order (PFOM), pseudo-second-order (PSOM), and the Brouers-Sotolongo Kinetic models (BS). By applying these models, the correlation coefficient, R2, can be determined.

The general expression for the pseudo-first-order kinetic models is

$$\frac{d{q}_t}{dt}={k}_1\left({q}_e-{q}_t\right)$$
(8)

where k1, qe, qt represent rate constant of the PFOM sorption (min−1), the amount of adsorbed adsorbate at equilibrium (mg/g), and the amount of adsorbate adsorbed at time t (min) (mg/g), respectively.

The nonlinear expression for the PFOM is

$${q}_t={q}_e-{q}_e{e}^{-{k}_1t}$$
(9)

The PSOM equation is given as [30]

$$\frac{d{q}_t}{dt}={k}_2{\left({q}_e-{q}_t\right)}^2$$
(10)

While the nonlinear form is given as

$${q}_t=\frac{k_2{q}_e^2t}{\left(1+{q}_e{k}_2t\right)}$$
(11)

The BS interpolates between the PFOM and PSOM kinetics, and it introduces n, a (a fractional order), which characterizes the time variation of k2. The equation for the BWS is given as

$${q}_{n,a}(t)= qe\left[1-{\left[1+\left[n-1\right]{\left[t/{\tau}_{n33,a}\right]}^{\alpha}\right]}^{-1/\left(n-1\right)}\right.$$
(12)

Also, the experimental data for the effect of temperature was fitted into the Vant Hoff equation to obtain the thermodynamic parameters:

$$\ln {K}_C=\frac{\Delta {S}^{{}^{\circ}}}{R}-\frac{\Delta {H}^{{}^{\circ}}}{RT}$$
(13)

where ∆S° is entropy change (J·mol−1·K−1), ∆H° is enthalpy change (J·mol−1), R is universal gas constant (8.314 J·mol−1·K−1), T is absolute temperature (K), and KC is the dimensionless thermodynamic equilibrium constant calculated using the Eq. 14 [31].

$${K}_C={M}_w\times 55.5\times 1000\times qe$$
(14)

where Mw is the atomic weight of the Pb2+ (207.4 g·mol−1), the factor 55.5 is the number of moles of pure water per liter (1000 g/L divided by 18 g/mol), and qe (mg/g) is the adsorption equilibrium constant for the adsorption of Pb2+ at different temperature (10–50 °C) onto WNS-CH.

$$\Delta G\left(\ \textrm{Gibbs}\ \textrm{free}\ \textrm{energy}\ \left(\textrm{J}/\textrm{mol}\right)\right)=\Delta H-T\Delta S$$
(15)

2.7 Experimental procedure for the antimicrobial study of WNS-CH composite

2.7.1 Preparation of inoculums

For inoculum’s preparation, Mueller Hinton broth was prepared according to the manufacturer’s instruction and 5 mL of broth medium was dispensed into each screw capped test tube and sterilized by autoclaving at 121°C for 15 min. The test tubes were cooled and kept in an incubator for 24 h at 37 °C to check sterility. The isolates were inoculated into the sterilized test tubes containing the medium and placed in an incubator overnight at 37 °C.

The presence of turbidity in broth culture was adjusted equivalent to 0.5 McFarland standards to obtain standardized suspension by adding sterile normal saline or broth to obtain a turbidity optically comparable to that of the 0.5 McFarland standard or against a white background with contrasting black line. The McFarland 0.5 standard provides turbidity comparable to bacterial suspension containing 1.5 × 108 CFU/mL [32]

Note this was used (suspension) within 5 min to avoid population increased.

2.7.2 Determination of antimicrobial activity (agar well diffusion method)

Antibacterial activities of the biosorbent on Bacillus subtilis and Klebsiella pneumoniae were evaluated by the well plate agar diffusion method using the modified Aida et al. method [33]. The bacterial cultures were adjusted to equal 0.5 McFarland turbidity standards and inoculated on nutrient agar plate (diameter 9 cm) by flooding the plate with 1 mL of each of the standardized test organism; swirled and excess inoculum was carefully decanted. A sterile cork borer was used to make wells (6 mm in diameter) on the agar plates.

The composite was dissolved in dimethyl sulfoxide (DMSO). DMSO was taken as negative control, and a different concentration of WNS-CH composite solutions was prepared. These solutions were applied on each of the well in the culture plates previously inoculated with the test organisms and left on the bench for 1 h for proper diffusion of the samples with a micropipette. Thereafter, the plates were incubated at 37 °C for 24 h. Antibacterial activity was determined by measuring the zone of inhibition around each well.

2.8 Adaptive neuro-fuzzy inference system

Adaptive neuro-fuzzy inference system (ANFIS) combines the learning ability of artificial neural network (ANN) and fuzzy inference systems (FIS) adaptively with the antecedent and consequence elements connected by fuzzy rules [29, 34]. ANFIS contains a set of fuzzy IF-THEN rules that have the learning ability to approximate nonlinear functions. It is a multilayer, adaptive, and feedforward network that estimates precise and uninterrupted functions. The model uses the least-square method, hybrid learning algorithm, and the backpropagation gradient-descent methods that enhance the resulting linear parameters of the output and the nonlinear premises parameter with fuzzy membership [35, 36]. Eqs. 16 and 17 represent the set of fuzzy inference rules for two inputs x and y and an output F.

$$\textrm{Rule}\ 1: If\ x\ is\ {A}_1\ and\ y\ is\ {B}_1,\kern0.5em {F}_1={p}_1x+{q}_1y+{r}_1$$
(16)
$$\textrm{Rule}\ 2: If\ x\ is\ {A}_2\ and\ y\ is\ {B}_2,\kern0.5em {F}_2={p}_2x+{q}_2y+{r}_2$$
(17)

where A1, B1, A2, B2 are membership functions, x and y are input parameter, and F1 and F2 are outputs acquired from the system, while p, q, and r are nodal consequent parameters. Figure 1 represents the architectural framework of the ANFIS with five layers.

Fig. 1
figure 1

Architectural framework of the ANFIS structure

At the first layer called the fuzzy layer, the membership grade at each node j is generated and contains the input and output functions as expressed in Eq. 18. The output function is defined by F1j, while τAi(x) and τBi(y) define the membership functions.

$${F}_{1j}=\tau {A}_i(x)\ and\kern0.5em {F}_{1j}=\tau {B}_i(y)$$
(18)

The second layer is the product layer where all the nodes are fixed while the output represents the firing strength (w1) estimated through multiplication in each nodes. The fuzzy layer’s output becomes the product of the signal for the input as expressed in Eq. 16.

$${F}_{2j}=\tau {A}_i(x)\times \tau {B}_i(y)$$
(19)

At the normalization layer, output is a fraction of the firing strength of the node to the sum of all firing strength of the other nodes as in Eq. 20.

$${F}_{3j}={\overline{w}}_i=\frac{w_1}{w_1+{w}_2+{w}_3},$$
(20)

At the defuzzification layer, the signal from the normalization layer is multiplied with fuzzy rule’s function such that the output F3j is expressed as given in Eq. 21.

$${F}_{4j}={\overline{w}}_i{f}_i={w}_1\left({p}_1x+{q}_1y+{r}_1\right)$$
(21)

At the fifth layer, the output is computed. In this layer, a single node calculates the total output by adding all signal from all layers using a summation function as given in Eq. 22.

$${F}_{5j}=\sum_{i=1}^n{\overline{w}}_i{f}_i=\frac{\sum_{i=1}^n{w}_i{f}_i}{\sum_{i=1}^n{w}_i}$$
(22)

2.9 Data clustering

In neuro-fuzzy-based modeling, clustering is a critical requirement for grouping data points into a similar fuzzy cluster, assigning membership functions (MF) and generating fuzzy inference system (FIS) structure for the data. It has been used to describe the connections between unlabeled data sets, thereby establishing a high degree of intersimilarity within and across clusters [37, 38]. This technique entails classification of a data set C into cluster sets Qi (⊆i = 1, 2, 3…. . q) in an unsupervised approach, i.e., without a preknowledge of the information about the data structure such as the group numbers, cluster members, and their definition. This is achieved with common clustering algorithms, namely, grid partitioning, subtractive clustering, and fuzzy c-means. There is a careful selection of clustering techniques in ANFIS modeling owing to its significant effects on the performance of the model in approximating an output function. The fuzzy c-means and the grid-partitioning method are selected to optimal design the best model for the prediction of the removal rate in this study. The significant difference in the intensity and computation speed and time of these two techniques as a basis for comparing their performances has motivated their choice.

2.9.1 Fuzzy c-means clustering

Fuzzy c-means (FCM) is a data clustering technique that groups a data set into clusters such that each data point belongs to every cluster to a certain degree. This technique clusters a finite set of data X = (x1, x2……. xm) into cluster numbers in an iterative minimization steps, where xi, i = 1, ……. m is a l-dimensional vectors [39]. The fuzzy c-means clustering is preferred for an application where speed is preferred due to its speed boost capacity, thus motivating its choice in this study [36]. The objective function of the FCM clustering which minimizes the distance center is given in Eq. 23 [40].

$$\underset{U,V}{\min }C\left(U,V\right)=\sum_{i=1}^n\sum_{j=1}^c{U_{ij}}^m{d_{ij}}^2$$
(23)
$$0\le {U}_{ij}\le 1,\kern1em \sum_{i=1}^c{U}_{ij}=1,0<\sum_{i=1}^n{U}_{ij}<n$$
(24)

The local minimum of JFCM can be reached by meeting up with the following conditions:

$${U}_{ij}=\frac{1}{\sum_{k=1}^c{\left(\frac{d_{ij}}{d_{ik}}\right)}^{\frac{2}{m-1}}}$$
(25)

and

$${V}_j=\frac{\sum_{i=1}^n{U_{ij}}^n{x}_i}{\sum_{i=1}^n{U_{ij}}^m}$$
(26)

2.9.2 Grid partitioning

This is a clustering technique in which the input space is divided into rectangular subspace through the use of a few local fuzzy regions by axis-paralleled partition depending on the type and number of the pre-defined membership function [41]. In the exponential relationship between the number of fuzzy rules m and the number of input m resulting number of fuzzy rules in the order nm, thus, a small number of membership function requirement has been necessitated. This demerit of this technique is a major setback because it consequently results in a large memory prerequisite and often led to curse dimensionality [34] which indicates that the number of samples needed to estimate an arbitrary function with a given level of accuracy grows exponentially with respect to the number of input variables (i.e., dimensionality) of the function. It means that the number of objects in the data set that need to be accessed grows exponentially with the underlying dimensionality. This exponential growth leads to a more computationally intense model due to the higher memory size and time required. Abonyi et al. describe the grid partitioning clustering technique in details [42].

2.10 Building the neuro-fuzzy model

An optimal model building of the neuro-fuzzy model was carried out in this study to predict the residual rate by checking the impact of the hyperparameters of the clustering algorithm on the model’s performance. The significant difference in the intensity and computation speed and time of these two techniques as a basis for comparing their performances has motivated their choice. The FCM and GP techniques were used in this study to generate the fuzzy inference system. A range of 2–8 number of clusters was optimized for the FCM algorithm to optimally select the best model which gives the best performance. The prominent input membership types are guassMF, triMF, trapMF, and gauss2MF while a linear output membership function type was tested for the GP technique. Other parameters specified for the model are presented in Table 1. The training was done using the 70 % of the experimental data set while the remaining 30 % hold-out data were used for testing the model’s accuracy. Before building the model, the data used for training was normalized with Eq. 27 to ascertain that they were in the same range.

$${y}_{norm}=\frac{x-{x}_{\textrm{min}}}{x_{\textrm{max}}-{x}_{\textrm{min}}}$$
(27)
Table 1 Specified control parameters for the FCM and GP clustered-ANFIS model

where ynorm = the normalized data, x = the mean of the variable, xmin = minimum variable, and xmax = maximum variable. The scripts for the algorithm were computed on MATLAB (R2015a) installed on a computing device with 64 bits, 4GB ram Intel(R) core(TM)i3 configuration. The parameters specified for the algorithm are presented in the model presented in Table 1.

Model performance and the fitness between the data were evaluated using statistical metrics, namely, Mean Absolute Percentage Error (MAPE), Mean Absolute Deviation (MAD), Root Mean Square Error (RMSE), and correlation coefficient (R2). They are computed as presented in Eqs. 2831 respectively.

$$MAPE=\frac{1\ }{N}\sum_{i=1}^N\left|\frac{O_i-{P}_i}{O_i}\right|\ x\ 100\%$$
(28)
$$MAD=\sum_{i=1}^N\frac{\left({O}_i-{P}_i\right)}{N}$$
(29)
$$RMSE={\left(\sum_{i=1}^N\frac{{\left({P}_i-{O}_i\right)}^2}{N}\right)}^{{~}^{1}\!\left/ \!{~}_{2}\right.}$$
(30)
$${R}^2=1-{\left[\frac{\sum_{i=1}^n\left({O}_i-O\right)\left({P}_i-P\right)}{\sqrt{\sum_{i=1}^n{\left({O}_i-O\right)}^2\ x\ {\sum}_{i=1}^n{\left({P}_I-P\right)}^2\ }\ }\right]}^2$$
(31)

where N = the number of samples, i = the sample index, Pi = value of the predicted outcome for ith sample, Oi = experimental outcome for the ith sample, O = average experimental outcome, and P = average predicted outcome.

3 Results and discussion

3.1 Antimicrobial study of WNS-CH composite

The antibacterial behavior of WNS-CH composite against Bacillus subtilis and Klebsiella pneumonia was examined by measuring the observed zones of inhibition, thereby showing the antibacterial activity of WNS-CH as presented in Fig. 2. These microorganisms have been noted to be one of the major causes of wound infections and food contamination. The synthesized composites recorded outstanding bioactivities against the test organisms. A recorded mean ZI of 5.3±1.16 mm was noted on Bacillus subtilis, while 6.0 ±1.00 mm was recorded on Klebsiella pneumoniae. The biological activity of the synthesized composite could be attributed to the interaction between the adsorbent and the lipid-bilayer cell membrane of the microorganisms [43]. Due to the interionic interaction between the charged surface of the bacterial cell membrane and the functional groups (such as –NH, –COOH, and –SH) of the composite thereby leading to the disruption of the microorganism cytomembrane/cell.

The complexation due to functionalization of WNS with CH molecule improves the lipophilicity of the adsorbent surface thereby facilitating the WNS-CH composite-lipid bilayer interaction of the microorganism and as such increased intracellular rapid uptake and permeation of the composite through the cell membranes of Bacillus subtilis and Klebsiella pneumonia [44]. The antimicrobial activity resulting in cell lysis occurs by the adsorbent-cell membrane interaction involving the interference of the adsorbent with cell replication, thus damaging the cell membrane and DNA of the cell [45]. This shows that WNS-CH has the potential for bio applications in water purification to act as a biofilter for the removal of the Bacillus subtilis and Klebsiella pneumoniae.

Fig. 2
figure 2

The antimicrobial study of WNS-CH on Bacillus subtilis and Klebsiella pneumoniae

3.2 Scanning Electron Microscopy analysis

The SEM micrograph of the adsorbents; WNS, WNS-CH, and Pb2+-loaded WNS-CH are shown in Fig. 3a–c, respectively. The micrograph of WNS shows an irregular hollow shape with a spongy surface prior functionalizing WNS with CH. Marked observable changes in the surface of WNS were noticed after functionalization with CH which showed a homogenous well-organized regular hollow ellipsoidal morphology. Comparing Fig. 3a, b shows that CH was effective in producing biosorbent with higher porosity. The pores formed as a result of functionalization were wider and developed more uniformly. This was attributed to the effective physiochemical activation in removing volatile component(s) and tarry materials that blocked the pores. Based on the pore sizes, it can be said that WNS-CH demonstrated heterogeneous pores which is requisite for effective uptake of Pb2+ ions, upon comparing the micrograph of WNS-CH composite shown in 3b with Pb2+-loaded WNS-CH (Fig. 3c) after absorption. A change in the morphology of Pb2+-loaded WNS-CH was observed which could be attributed to the influx of Pb II ions thus resulting to its adsorption on the surface of the bio sorbent, thereby depicting the blockage of the well-organized hollow channel.

Fig. 3
figure 3

The Scanning Electron Microscopy of a walnut shell (WNS), b chitosan functionalized walnut shell (WNS-CH) composite, and c WNS-CH after adsorption of Pb2+

3.3 Fourier transform infrared (FTIR)

The FTIR analyses provided spectra and the detailed surface chemistry of the adsorption and the corresponding mechanism of adsorption of Pb2+ onto WNS-CH loaded WNS-CH composite which was prepared from the native WNS. Figure 4 presents detailed band information of the WNS and WNS-CH composites WNS-CH+ Pb2+, and the corresponding band assignments are presented in Table 2. The FTIR spectra showed some typical absorption band ranges as presented in Table 2. This includes the native WNS and WNS-CH composite at 3570–3200 cm−1 and 3400–3380 cm−1, which are assigned to the hydroxyl, amino, and carbonyl groups, respectively. The observed band shift in the spectra of the composite suggests that modification has taken place, thereby leading to the structure and functional changes/rearrangements owing to the presence of chitosan on the walnut. The significant changes in FTIR spectra resulted in band shifting or broadening, thus confirming the modification effects in creating structural changes in WNS-CH in comparison with WNS.

As seen in Table 2, the negatively charged functional groups of O-H (hydroxyl) were observed to promote the biosorption process of positively charged Pb2+ ions and the disinfection of microbes onto WNS-CH [46]. Upon comparing the FTIR result of Pb II ion-loaded composite WNS-CH and with WNS-CH prior absorption, an observed change that corresponds to shift in the absorption bands of the analyzed functional groups was observed. The majority of the functional group of the Pb II ion-loaded composite WNS-CH were observed to have shifted to a lower absorption band. Only the ester moiety was observed to increase as shown in Table 2. This phenomenon is, however, attributed to the interactions of the Pb ions with the functional groups of the composite. This is due to the functional group’s high reactivity, thus resulting in their respective deprotonation. This was in agreement with previous functionalization studies on the other adsorbents reported [47, 48]. This, however, corroborated the SEM result due to the formation of a well-defined regular porous surface. The synergistic effect resulted in the provision of more functional groups available for metal binding, thereby facilitating its rapid uptake from their respective solutions.

Fig. 4
figure 4

The FTIR spectra of a WNS, b WNS-CH composite, and c lead-treated WNS-CH composite

Table 2 FTIR peaks and their corresponding functional groups

3.4 Kinetic analysis

Table 3 shows various kinetic parameters for each model, and Fig. 5 shows the kinetic model plots used in studying the adsorption-time relationship of the adsorption process. Figure 5 shows that uptake of Pb2+ significantly increased firstly and changed slowly with time until adsorption equilibrium was reached (0–60 mins). This is assumed to result from higher availability of vacant pores on the adsorbent and a larger concentration gradient, resulting in adsorption speed. Based on correlation coefficient (R2) obtained for all three kinetic models, namely, PFOM, PSOM, and Elovich. It was observed that the R2 values for all models were close to unity, whereas, based on the error values, PSOM had the lowest error value of 0.1389. This indicates that the removal could be best fitted to PSOM model with R2 = 0.9674. This shows that the exchange or sharing of electrons between the adsorbent and the adsorbate is the rate limiting step, thus suggesting chemisorption. It is assumed that Pb2+ species are likely moved from the bulk solution into the solid phase through an intraparticle diffusion process.

Table 3 Various predicted kinetic data for the adsorption of Pb2+ on the adsorbent
Fig. 5
figure 5

Kinetic model plots for the adsorption of Pb2+onto the WNS-CH adsorbent

PSOM pseudo-second-order model, PFOM pseudo-first-order model, Elovich model

3.5 Isothermal analysis

Nonlinear forms of four theoretical models were used to test the experimental isotherm data obtained, namely, the Brouers-Sotolongo, Freundlich, Langmuir, and Temkin models. Figure 6 shows the isotherm plots of Pb2+ onto WNS-CH, and the respective isotherm parameters of each plot are presented in Table 4. With respect to close comparison of coefficient of determination (R2), error values, and other parameters for all the isotherms, it can be deduced that the adsorption of Pb2+ onto WNS-CH is best fitted to the Brouers-Sotolongo (R2 = 0.9506 , error= 2.4289) and Langmuir (R2= 0.9509, error= 1.8104) isotherm models, with a marginal difference between the predicted parameters for both models. According to the Brouers-Sotolongo adsorption capacity of WNS-CH for Pb2+ is predicted to be ≈ 371 mg Pb2+/every g of WNS-CH. This isotherm assumes that WNS-CH has a homogeneous surface that contains sites with same energy resulting in complete monolayer adsorption of Pb2+. The theoretical Qm value of 370.5838 mg/g obtained for BS showed a good fit with an R2 value of 0.9506, while Langmuir showed an adsorption capacity of WNS-CH with Qm value ≈ 14 mg/g and least R2 value of 0.8712 compared to the other isotherm as presented in Table 4. The separation factor (RL) is an important Langmuir parameter which tells about the favorability (favorable: (0 < RL < 1)) of adsorption which was used to evaluate the adsorption process. In the concentration range studied (20–100 mg/L), the recorded RL value is 0.85700 thus suggesting a favorable adsorption in the Pb2+-WNS-CH system. Similar study for Pb2+ was reported by [49]. The Brouer-Sotolongo model assumes the presence of heterogenous active sites on the surface of WNS-CH adsorbent with equal energy responsible for uptake of Pb2+.

Fig. 6
figure 6

Isotherm plots for the adsorption of Pb2+ on WNS-CH

Table 4 Adsorption isotherm data for the adsorption of Pb2+ on to WNS-CH adsorbent

More so, the heterogeneity factor (n) of Freundlich model can be used to indicate the degree of favorability of adsorption [50, 51]. The Freundlich constant (n ≈ 3) (Table 4) shows a highly favorable adsorption of Pb2+ on the surface of the WNS-CH [9].

3.6 Mechanism of Pb2+ ion removal

A marked difference was observed in the FTIR spectra of the adsorbent (WNS-CH) before and after adsorption of the metal ions as shown in Fig. 4a–c. As shown in Table 2, the metal-loaded WNS-CH appeared at 1320–1210 cm−1, which was attributed to the carbonyl groups. After the interaction of the metal ions with the adsorbents, a decrease in the O-H absorption band of Pb2+-WNS-CH was observed at 3523 cm−1 compared to WNS-CH at 3580 cm−1. Furthermore, the same trend was observed in the C-N absorption band, in which a decrease in the C-N absorption band of Pb2+-WNS-CH at 1016 cm−1 was noticed compared to WNS-CH at 1079 cm−1 as shown in Table 2. The observed C-N absorption also corresponds to the observed vibrational frequency of the methylamino group (>N-CH3) in which a blue shift was observed in the vibrational frequency of Pb2+-WNS-CH 2782 cm−1 as against WNS-CH at 2798.

Furthermore, the wavenumber range 3270–3540 cm−1 corresponds to the internal bonded O-H stretch. However, an interhydrogen bonding vibrational shift to 3544 and 3523 cm−1 was observed in Pb2+-WNS-CH compared to the 3580 cm−1 observed in WNS-CH. Also, an NH3 rocking vibration noticed in WNS-CH with wavenumber 876 cm−1 was absent in Pb2+-WNS-CH compared as shown in Table 2, indicating that adsorption has successfully taken place. This band disappearance can be translated to the open pore in WNS-CH becoming occupied and trapped by the Pb2+ during the sorption process resulting in the unavailability of surface functional groups for further interaction of the WNS-CH with Pb2+. Albeit, the observed changes in the intensity of adsorption and the wavenumber of functional groups strongly validate the occurrence of complexation between nitrogen and oxygen atoms on the adsorbent binding sites and the metal ions. However, from the FTIR spectra, it is suggested that the maximum uptake of lead ions from their respective solutions by the WNS-CH composite is due to the availability of more number of N and O atoms.

In addition, the observed SEM micrograph after adsorption with Pb2+ +-loaded composite showed a uniform but seems blocked (i.e., occupied) surface with fiber-like features compared to WNS and WNS-CH which could be suggested to be due to adsorption of the metal (Pb2+) ion become trapped by the adsorbents. This can be further corroborated with the kinetic plot that the sorption process becomes less competitive as the process approaches steady-state equilibrium

3.7 Effects of process variables on adsorption of Pb2+

3.7.1 Effect of adsorbent dose

Figure 7 shows the result of Pb2+ uptake profile versus the adsorbent dose. The dosage varied from 0.15–0.45 g, keeping all other operating variables constant. As illustrated in Fig. 5, the percentage uptake of Pb2+ is observed to increase from 60% to 92.5% as the dosage of adsorbents increases. This may result from increased available active sites on the WNS-CH surface area as the dosage increases. This is similar to other studies that have reported metal removal efficiency increased with increasing adsorbent dosage as a result of more adsorptive sites on adsorbent surfaces [52]. The optimum dose for this study is 0.45 g.

Fig. 7
figure 7

Effect of adsorbent dose on the adsorption of Pb2+ onto the WNS-CH adsorbent

3.7.2 Effect of pH

Purification of wastewater using adsorbents has been discovered to be highly pH-dependent, majorly acidity, since this may greatly influence the adsorbent charged surface and the degree of ionization of various pollutants. In this study, pH was varied between 3 and 10 and investigation revealed 58% as minimum uptake of Pb2+ at pH 3.0, which further increased with increasing pH (Fig. 8). The pH 10 was found as the optimum pH with maximum adsorption efficiency of 94%. It is assumed that lower adsorption occurred at low pH which may be due to the competition for active sites between the H+ and Pb2+ and could also cause restriction in dissociation of carboxyl group on WNS-CH surface. On the other hand, as pH increases, more functional groups became available for Pb2+ adsorption, resulting in a reduction in H+ concentrations and subsequently enhanced adsorption. It can be suggested that the adsorption of Pb2+ is unfavorable at lower pH (acidic).

Other researchers have reported similar findings on the effects of pH on heavy metal removal using various carbonaceous sorbents [19, 53]. It can also be assumed that the WNS-CH surface becomes positively charged at lower pH values, leading to electrostatic repulsion, thereby making Pb2+ more difficult to be adsorbed unto the surface. Contrarily, at higher pH value, WNS-CH surface becomes negatively charged, and more active adsorption sites are available, leading to higher adsorption as a result of electrostatic attraction between active sites and Pb2+.

Fig. 8
figure 8

Effects of pH on the adsorption of Pb2+ onto the WNS-CH adsorbent

3.7.3 Effect of temperature

The results in Fig. 9 demonstrate that Pb2+ uptake tends to increase slightly from 20 °C to 40 °C showing better adsorption at a higher temperature, which is an endothermic process. An increase in temperature may result in a swelling effect within the internal structure of the adsorbents, which enables more Pb2+ penetration [14, 54]. An increase in kinetic energy of absorbent with an increase in temperature is assumed to be responsible for enhanced adsorption efficiency. Secondly, at a higher temperature, there is bond rupture of functional groups on the adsorbent surface, and this could lead to an increase in the number of active sites on the adsorbents, which in turn could lead to an increase in adsorption with the rise in temperature [14, 15]. The optimum temperature for the process is 40°C with 97.07% adsorption capacity. From the temperature of 40–50 °C, a slight decrease in the adsorption of Pb2+ was observed, which may be due to weakening of the physical bonds between the adsorbate molecules and the active site of the adsorbent at an extremely higher temperature.

Fig. 9
figure 9

Effect of temperature on the adsorption of Pb2+ onto the WNS-CH adsorbent

3.7.4 Thermodynamics studies for the adsorption of Pb2+ on to WNS-CH adsorbent

Tables 5 show the thermodynamic parameters for the adsorption of Pb2+ unto WNS-CH. The ΔG° values at all temperature considered were all negative. In addition, the ΔG° values are observed to decrease with an increase in temperature. Furthermore, positive ΔH° and ΔS° values were obtained. The results indicate that the adsorption process is endothermic and indicating that the uptake of Pb2+ on the surface of the adsorbent is spontaneous [55].

Table 5 Thermodynamics table for the adsorption of Pb2+ on to WNS-CH adsorbent

3.8 Performance metrics of the neuro-fuzzy model

The neuro-fuzzy model has a merit of computational flexibility and framework which allows variation of its hyperparameters to achieve optimality in the model [56]. Sequel to the significant effect of the control parameters of the clustering on the performance of neuro-fuzzy models, this study tested the ANFIS model clustered with the GP and FCM with their varying hyperparameters. Shown in Table 6 is the performance metrics of FCM-ANFIS models with cluster numbers 2–8. The computational time of all submodels is also presented in Table 5. The performance in the FCM-clustered ANFIS model followed a similar trend as the cluster number increases from 2 to 8 with marginal variation across all metrics. Based on the RMSE values, the performance of the FCM-clustered model is in the following order: FCM − ANFIS2RMSE = 1.353 > FCM − ANFIS8RMSE = 1.355 > FCM − ANFIS1RMSE = 1.445 > FCM − ANFIS4RMSE = 1.532 > FCM − ANFIS5RMSE = 1.543 > FCM − ANFIS3RMSE = 1.563 > FCM − ANFIS7RMSE = 1.7435. Considering a minimum MAPE value of 2.983 (FCM − ANFIS2Cluster number = 3) and maximum of 5.012 (FCM − ANFIS7Cluster number = 8), the accuracy of all the FCM-ANFIS model is in the range 95.09 % to 97.12 % at the testing phase. These values are reasonable as it depicts acceptable fit between the experimental and predicted values of Removal rate. Above cluster number 8, no significant improvement was observed in the performance but rather a decline in performance with uncertainty, overfitting, and noise [57]. Based on minimum error criteria, the best FCM-clustered ANFIS model was obtained at cluster number 3 (FCM-ANFIS2) with RMSE, MAD, MAPE, and R2 values of 1.046, 0.514, 1.645, and 0.9956, respectively, at the training phase and 1.353, 0.632, 2.983 and 0.9911, respectively, at the testing phase. The lowest RMSE and MAD values of the FCM-ANFIS2 depicts the reliability and eligibility of the model in predicting the removal rate of Pb2+ onto the WNS-CH adsorbent. The model is 97.12 % accurate (MAPE=2.983), representing the strongest agreement between the experimental and predicted removal rate of Pb2+ onto the WNS-CH adsorbent.

Table 6 Performance metrics outcome of the FCM-clustered ANFIS models

Table 7 represents the evaluation outcomes of the GP-clustered ANFIS model based on the selected metrics. The GP technique tested four input membership function types based on their prominent applications in previous studies [34]. A close-range performance was observed in all the submodels based on the GP clustering with marginal discrepancies. Based on RMSE values, the performance of the GP-ANFIS models is in the order GP − ANFIS2triMF > GP − ANFIS1gaussMF > GP − ANFIS4gauss2MF > GP − ANFIS3trapMF. Based on the MAPE values, the accuracies of the models were in the following order: GP − ANFIS2triMF (98.31%) > GP − ANFIS1gaussMF (97.35%) > GP − ANFIS3trapMF (97.32%) > GP − ANFIS2gauss2MF (96.76%). The triMF gave the best outcome with the lowest prediction error and highest accuracy Owing to the computational intensity of the grid partitioning techniques based on a large rule base, the computational time is an metrics for evaluating its performance [58]. The GP-ANFIS recorded higher computational time than the FCM-ANFIS model. Comparatively, it was observed that there was a trade-off in the computational time and accuracy of all the GP-ANFIS, as it gives a more accurate result than the FCM-clustered model which computed in lesser time. The overall best model was obtained with the GP-ANFIS model with triangular membership function (triMF) with the following statistical metrics values: RMSEtriMF = 1.217, MADtriMF = 0.563, MAPEtriMF = 1.698 and R2triMF = 0.9966. The RMSE and MAD values of the GP − ANFIS2 depicts the reliability and eligibility of the model in predicting the removal rate of Pb2+ onto the WNS-CH adsorbent while its accuracy of 98.31 % depicts an excellent agreement in the experimental and predicted removal rate.

Table 7 Performance metrics outcome of the FCM-clustered ANFIS models

Figures 10 and 11 represent the comparison plot of experimental and predicted removal rate values using the best FCM-ANFIS and GP-ANFIS model at the training and testing phase, respectively. The figures show a strong agreement between the experimental data and the predicted values with a very less misprediction. A similar trend exists between the predicted and experimental data for both optimal FCM-ANFIS and GP-ANFIS, giving the best prediction outcomes.

Fig. 10
figure 10

Comparison plot of the experimental and predicted removal rate of Pb2+ onto the WNS-CH adsorbent at the training phase

Fig. 11
figure 11

Comparison plot of the experimental and predicted removal rate of Pb2+ onto the WNS-CH adsorbent at the testing phase

The regression plot of the best FCM-ANFIS and GP-ANFIS model is presented in Figs. 12 and 13. It is revealed that the experimental and predicted removal rate Pb2+ onto the WNS-CH adsorbent had the best GP-ANFIS and FCM-ANFIS had the highest density point clustering around zero while low density of data is far away from the origin which means that the model provides a good fit to the data.

Fig. 12
figure 12

Regression plot of the experiment and the FCM-ANFIS predicted removal rate of Pb2+ onto the WNS-CH adsorbent

Fig. 13
figure 13

Regression plot of the experimented and the GP-ANFIS predicted removal rate of Pb2+ onto the WNS-CH adsorbent

3.9 Comparison of the present study with previous works on Pb2+ adsorption

WNS-CH was observed to compare favorably in terms of strength and adsorptive capacity with other biomass-derived or synthesized adsorbents used for the removal of lead ions from the aqueous phase documented in the literature as presented in Table 8. Furthermore, WNS-CH in this study shows a better performance with excellent percentage sorption capacity (>90%) compared to earlier reported studies [19, 50, 61] as shown in Table 8.

Table 8 Comparison of the sorption capacity value of Pb2+ using different adsorbents

3.10 Cost analysis

The price difference (cost analysis) between WNS-CH and commercial activated carbon (CAC) is shown in Table 9. This recorded a simple proof that WNS-CH is very cheap than CAC. According to the table, the total cost of purchasing 1 kg of CAC (with transportation fee) was estimated at 392.50 USD, while the total cost recorded for the preparation, with the chitosan (1 kg) used for modifying the WNS, transportation to filtration and cost of energy supplied. The electricity bill recorded a total value of 131.57 USD, while chitosan was observed to account for the most significant cost in the production of the adsorbent as presented in Table 9. However, the adsorbent is far cheaper than CAC, suggesting the consideration of the composite use in the study as an alternative for CAC.

Table 9 Price difference between WNS-CH and CAC

4 Conclusion

The study assessed the use of walnut shell and chitosan as suitable precursors for the preparation of a composite material (WNS-CH) with great potentials for Pb2+ uptake from aqueous solution vis-à-vis its antimicrobial activity on Bacillus subtilis and Klebsiella pneumoniae. It was observed that the adsorption of Pb2+ increased with an increased in temperature, pH, and adsorbent dosage. Adsorption efficiency of 94 % was obtained under the conditions of initial pH 10, dosage 45 mg, and temperature of 40 °C. The thermodynamic parameters revealed that the adsorption process is spontaneous and endothermic in nature. Equilibrium data were well explained by Freundlich isotherm with R2 = 0.9509 indicating a multilayer adsorption, while pseudo-first-order kinetics was best fit for the kinetic data with an R2 value of 0.9674 at a qe value of 6.0493 mg/g. WNS-CH showed a biopotency against Bacillus subtilis and Klebsiella pneumoniae with a mean ZI of 5.3±1.16 and 6.0 ±1.00. The SEM and FTIR showed a well-organized hollow channel, with O-H, N-H, C-N, and C-O functional groups which are responsible for the adsorption process as evident in the morphological restructuring and changes in the IR bands.

Lastly, a study involving cost-effective machine learning models revealed that GP-clustered ANFIS model (with RMSE = 1.217, MAD = 0.563, MAPE =1.698, and R2 = 0.9966 at the testing phase) is an effective model tool for predicting the adsorption process based on the input of relevant parameters. The findings of this study show WNS-CH composite as an inexpensive dual purpose adsorbent system: biosorbent and biofilter. Albeit, further modifications of WNS-CH are necessary to enhance its adsorption capacity and subsequent work should extend the application of WNS-CH into practical application with associated regeneration.