Introduction

A large amount of industrial waste is released into aqua systems without treatment, creating pollution issues that seriously threaten both the environment and human health (Aruna et al. 2021).

The waste includes aromatic compounds, heavy metals, dyes, and toxic pollutants waste that are not efficiently removed by traditional wastewater treatment techniques.

Methylene Blue dye (MB) is one of the dyes that are discharged in aqueous systems (Turhan et al. 2012). This dye is a water-soluble azo dye that has a very deep colour and low degradation rate. It forms ammonium cations in the water and can cause severe environmental problems even at low concentrations (Zhu et al. 2018). As a result, a lot of effort is put into researching different ways for waste treatment before it is discharged into the environment to meet the legal limitations (Zeitoun et al. 2020).

The most common wastewater treatments are using physical, biological, and chemical methods (Ukiwe et al. 2014). Usually, photocatalysis, ion exchange, synthetic membrane separation, advanced oxidation processes and adsorption are highly efficient methods for treating wastewater (Katheresan et al. 2018). Adsorption offers benefits over other technologies because of its simple design and potential for minimal initial investment and land requirements. However, the selection of an appropriate adsorbent is a remarkable challenge, whereas the model adsorbent should have various features involving large surface area, high adsorption capacity, cost-effectiveness, eco-friendly, recyclability, and high selectivity for dye pollutants (Crini 2006).

Agricultural wastes are promising raw materials for adsorbents in wastewater treatment (Ahmad et al. 2012). These wastes contain valuable components such as cellulose, protein, tannin, lignin, resin, and other available compounds that could be used in diverse beneficial wastewater treatment applications (Wang et al. 2020)(Yu et al. 2019). Moreover, they increase at a rate of 5% to 10% every year and represent a remarkable source of environmental pollution since their safe disposal is very expensive, and they are commonly burned to be disposed of releasing harmful gases to the environment (Duque-Acevedo et al. 2020). As a result, using them as a raw material for adsorbents won’t only valorize these wastes but also avoid the consequences of their disposal. // 540 million metric tonnes of sugarcane bagasse, a large-scale agricultural waste, are generated each year worldwide. (Zhao et al. 2015). Sugarcane bagasse is used as an adsorbent for removing MB from aqueous solutions in different studies. The percent efficiencies of removal are investigated as follows: 98.49%, 90.1%, and 83.6% for the studies carried out by Kerrou et al. (2021) and Raghuvanshi (2004), Sharma and Kaur (2011), respectively. Sugarcane bagasse is a cellulosic structure (Mahmud and Anannya 2021). The presence of hydroxyl groups and the existence of other functional groups and their related strong chemical reactivity are attributed to cellulose's adsorption phenomena making it an efficient adsorbent for MB removal (Crini 2005). Moreover, cellulose adsorbents show high porosity which is a desirable feature of adsorbent materials because of the excess area it offers for adsorption (Tapia-Orozco et al. 2016).

Sugarcane bagasse pulp is a product of sugar extraction from sugarcane bagasse. This material is commonly used in the paper industry, and since the paper industry is declining due to e-books and online learning, this waste is abundant in massive amounts. To benefit from its cellulosic structure, availability, and low cost, Mpatani et al. in (2020) experienced the adsorption efficiency of the citrate-modified sugarcane bagasse pulp on MB removal at different conditions and their study gave maximum removal efficiency equal to 92.9% (Mpatani et al. 2020). Activated carbon prepared from the bagasse pulp also shows high removal efficiency of MB (Li et al. 2016). These results indicate the possibility of the use of sugarcane bagasse pulp and its derivatives in MB removal as an adsorbent. Its mechanical properties are superior to the raw sugarcane bagasse. Therefore, it can be used as raw material for membrane fabrication with different methods such as electrospinning, phase inversion, and dip coating (Zeitoun et al. 2022).

Our study examines the sugarcane bagasse pulp efficiency as an adsorbent for MB removal. Its functional groups and surface morphology are characterized. Parameters including adsorbent dose, temperature, contact time, pH, initial dye concentration, shaking speed, and particle size effect on adsorption are examined. Since the adsorption process is complicated in nature, many parameters interact together affecting it. Therefore, conventional mathematical modelling cannot be used to fully model and simulate the data. Artificial neural network (ANN) modelling has received a lot of attention in recent years from researchers looking to resolve environmental challenges because of its capability in capturing the nonlinear patterns in the data (Husien et al. 2022). It can be applied to resolve issues for which traditional statistical techniques are ineffective. Therefore, ANN is considered in this study as it is widely used and can address challenging scenarios (Onu et al. 2021). Using ANN is the primary goal of this work to assess the effectiveness of sugarcane bagasse pulp in removing MB by adsorption process.

Materials and methods

Sugarcane cane bagasse pulp is purchased from a sugar company in Upper Egypt. MB with an empirical formula of C16H18ClN3S 3H2O, a molecular mass of 373.8 g mol−1, and a pure grade of 98.5% is used in the adsorption process. NaOH (98%) and HCl (37%) are used in adjusting the pH of the solution. All chemicals are purchased from Sigma-Aldrich company. A 500 mg/L stock solution of MB is prepared by dissolving 0.5 g of MB in 1000 mL distilled water in a volumetric flask. MB solutions of different concentrations of 25,50,100 and 200 mg/L are prepared by serial dilution from a stock solution according to the following equation.

$$ C_{{\text{o}}} \times V_{{\text{o}}} = C_{{\text{d}}} \times V_{{\text{d}}} $$
(1)

Chen et al. (2014) where Co is the stock solution’s concentration, Vo is the volume of stock solution being diluted, Cd is the dilute solution’s concentration, and Vd is the volume of the dilute solution.

After each experiment, the dye solution is filtered by using Whatman (number 541) filter paper and the filtrate is then analysed to get the MB concentration after adsorption. The concentration of MB in the filtrate is determined by using a dual-beam UV–Vis spectrophotometer (Shimadzu Brand UV-3000) where the absorbance of MB is measured at 665 nm. All determinations are performed in a total of three replicates per experiment, and the average values are reported. The removal efficiency is then calculated by using the following equation.

$$ {\text{Removal efficiency}}\left( \% \right) = {{\left( {C_{{\text{o}}} - C_{{\text{e}}} } \right)} \mathord{\left/ {\vphantom {{\left( {C_{{\text{o}}} - C_{{\text{e}}} } \right)} {C_{{\text{o}}} \times 100}}} \right. \kern-0pt} {C_{{\text{o}}} \times 100}} $$
(2)

Li et al. (2022) where \(C_{{\text{o}}}\) is the initial concentration (mg/L) and \(C_{{\text{e}}}\) is the residual concentration (mg/L) of the MB being studied.

Characterization techniques

Fourier transformation infra radiation FTIR

FTIR is carried on the sugarcane bagasse pulp powder to determine the functional groups and chemical bonds present. Attenuated total reflectance (ATR) mid-infrared spectra are acquired using a Tensor 27 (Bruker Optics). The spectrometer is equipped with A deuterated triglycine sulphate (DTGS) detector and a heated single reflectance diamond ATR accessory (Grase by Specac) with a sealed sapphire anvil. Spectra with 128 scans at 4 cm−1 resolution are selected for both samples at room temperature. The spectra are vector normalized over the entire wavelength range of 400–40 cm1.

X-ray diffraction XRD

XRD is utilized to determine and analyse the degree of crystallinity and physical properties of bagasse pulp powder. The spectra of the samples are collected using a Siemens D500 X-ray diffractometer using Cu k-alpha X-rays at 4 kV and 25 mA.

SEM scanning electron microscopy

SEM is used to study the morphological properties, homogeneity, and voids present in the bagasse powder. The Small particles of bagasse pulp are glued into a holder using Tissue Tek O.C.T compound and brought down to solid nitrogen temperature under vacuum, and then, they are fractured by a blade from the side brought up to 90 °C and platinum-coated and then imaged.

Adsorption study

A beaker containing 50 mL of MB solution is used in the experiments. The effect of adsorbent dose, temperature, initial concentration, contact time, shaking speed, pH, and particle size is examined.

The experimental procedures start with a temperature equal to 25 °C, at pH equal to 7, adsorbent dose equal to 20 g/L, initial dye concentration equal to 100 mg/L, at a shaking speed of 130 rpm, adsorbent particle size equal to 500 µm and take place as follows.

Examining the effect of temperature

The effect of different temperatures (25,40,55) °C is examined keeping all the other parameters constant at their initial values.

Examining the effect of pH

The effect of pH is studied by performing the experiments at H 4,7,9,10,12 while keeping all the other parameters constant. The pH is adjusted by using an HCl (chloride acid) purity of 37% (0.1 M) and NaOH (sodium hydroxide) purity of 98% (0.1 M).

Examining effect of adsorbent dose

MB solution is divided into 6 beakers. Each beaker contains 50 ml of MB prepared solution. Different doses of sugarcane bagasse pulp adsorbent are added as follows (4, 8, 10, 20, 30, 40) g/L. The optimum adsorbent dose is chosen for continuing the study.

Examining the effect of dye initial concentration

Five different initial concentrations of MB are prepared by dissolving 25, 50, 100, 200, and 300 mg of dye solution in a 1000-mL beaker keeping all the other parameters constant at their initial values, dose, pH, and temperature at their optimum values.

Examining the effect of contact time

The chosen dose of sugarcane bagasse pulp is added to the solution prepared at the optimum initial concentration to experience different contact times (15, 30, 60, 120, and 180) minutes. The experiments are carried out at the chosen dose, temperature, and pH. Particle size = 500 µm and shaking speed equals 130 rpm.

Examining the effect of shaking speed

Different shaking speeds (80, 100, 130, 200, and 300) rpm are examined while keeping all the other parameters constant at their optimum values.

Examining the effect of particle size

Finally, the effect of adsorbent particle size is investigated at (200, 500, and 1000 (µm)), where all the other factors remain constant as shown at their optimum conditions.

Results and discussion

Characterization techniques

Fourier transformation infraradiation (FTIR)

FTIR analysis of sugarcane bagasse pulp shows peaks at frequency ranges of (3700–3200), (1678–1600), and (1225–1163) cm−1 (Fig. 1). These ranges indicate the presence of functional groups OH, C=O, and CO, respectively. Al-Mokhalelati et al. proved that the adsorption process of MB is chemical in nature and the OH, C=O, and CO groups are particularly responsible for MB dye adsorption (Al-Mokhalelati et al. 2021).

Fig. 1
figure 1

FTIR analysis for sugarcane bagasse pulp

X-ray diffraction XRD

XRD result of sugarcane bagasse pulp shows the presence of a peak at a wavelength equal to 22. This result corresponds to the results obtained in the XRD of the cellulose material analysed by Ishak et al. (2018). As a result, the sugarcane bagasse pulp proves to be cellulosic material that has great efficiency in the removal of different dyes, especially the cationic ones (Su et al. 2017; Ma et al. 2020) (Fig. 2).)

Fig. 2
figure 2

XRD analysis for sugarcane bagasse pulp

Scanning electron microscope (SEM)

The sugarcane bagasse pulp SEM image shows no agglomeration of its fibres. This indicates that the functional groups of the sugarcane bagasse pulp will be more subjected to the reaction with the dye. In adsorption experiments, the more the agglomeration decreases, the more the usable surface area, and thus, the more efficient the adsorption is (Diephuis et al. 2022) (Fig. 3).

Fig. 3
figure 3

SEM image of sugarcane bagasse pulp

Parameters effect

Effect of temperature

The temperature directly affects the rate of adsorption (Rashid et al. 2016). The results show an increase in efficiency as the temperature rises from 25 to 55 °C. This is contributed to the fact that as the temperature increases, the rate of diffusion of the adsorbate molecules across the external boundary layer and internal pores of adsorbent particles increases. Moreover, an increased number of molecules may obtain sufficient energy to interact with active sites at the surface of the adsorbent (Santos and Boaventura 2016). Hence, the amount of dye removal increases. Results show no great difference between the 79.04% efficiency obtained at 40 °C and the 80.54% efficiency obtained at 55 °C. Since there is no great rise in removal efficiency between 79.04 and 80.54% at temperatures equal to 40 and 55 °C, respectively, the temperature for continuing the study is chosen to be 40 °C for saving energy (Fig. 4).

Fig. 4
figure 4

Effect of different temperatures on MB removal efficiency

Effect of pH

pH is an important parameter in the absorption process, and it affects the adsorption capacity (Idan et al. 2018; Alhogbi et al. 2021). The degree of its adsorption onto the adsorbent surface is influenced by the surface charge on the adsorbent which in turn is influenced by the solution pH. MB shows a very small adsorption value of 85.52% in an acidic solution at pH 3.0. This is discussed by Alhogbi et al. (2021). MB is a cationic dye, which exists in an aqueous solution in form of positively charged ions. At low pH, the number of negatively charged adsorbent sites decreases, and the positively charged surface sites increase which will not favour the adsorption of cationic dyes due to electrostatic repulsion which will occur between the adsorbent surface and the MB ions. On the other hand, the results show increasing the dye removal efficiency with increasing system pH till it reaches 93.85% at pH = 12. The negatively charged adsorbent sites increased, which enhanced the adsorption of positively charged dye cations through electrostatic forces of attraction (Banerjee and Chattopadhyaya 2017). Due to the slight difference in the adsorption capacity at pH from 7 to 12.0, pH 7 is used as the optimum pH for continuing the study (Fig. 5).

Fig. 5
figure 5

Effect of solution pH on removal efficiency

Effect of adsorbent dose

The adsorbent dose has a major role in the dye removal process (Singh 2014). Figure 6 shows the effect of the adsorbent dose on the adsorption efficiency. The removal efficiency increases from 42.85 to 95.135% as the adsorbent dose increases from 4 to 40 g/L. Increasing the adsorbent dose increases the surface area available for adsorption and consequently the available active sites (Mahmud and Salman). Hence, the amount of dye adsorbed increases and the efficiency increases. The results also show that after reaching the adsorbent dose equal to 20 g/L, an extra increase in adsorbent does not appreciably change MB removal. This is attributed to the fact that the adsorption sites are efficiently saturated at a lower adsorbent dose (Gorzin and Bahri Rasht Abadi 2018). To continue the study, the optimum adsorbent dose is chosen to be 20 g/L with an elimination percentage equal to 93.54%. The chosen amount minimizes the consumption of the amount of the dose to half compared to 20 g/L with a percentage of 95.135% close to that of 40 g/L.

Fig. 6
figure 6

Effect of adsorbent dose on MB removal efficiency

Effect of initial dye concentration

Choosing the optimum adsorbent dose to be 20 g/L and the temperature of adsorption to be 40 °C, the effect of the initial concentration of MB on the removal efficiency is studied at different initial concentrations, ranging from 25 to 300 mg/L while keeping all the other parameters constant. Figure 7 shows that the percentage of MB removal is high for low initial concentrations and then decreases from 94 to 54% as the initial concentration of the dye increases from 25 to 300 mg/L.

Fig. 7
figure 7

Effect of initial MB concentration on removal efficiency

This is explained by Saha et al. (2020), at low initial solution concentration the surface area of the adsorbent, and thus, the number of adsorption binding sites is high, so the dye molecules can easily bind to the adsorbent surface. However, as the concentration increases, the total available adsorption sites are limited, which may result in a reduction in the percentage removal of contaminants (Gamoudi and Srasra 2019). For continuing the study, solution with a concentration of 25 mg/L is chosen.

Effect of contact time on MB adsorption

The contact time effect has been studied by varying the contact time from 15 to 180 min while keeping all the other parameters constant. Figure 8 shows that dye adsorption is rapid at first with a high dye removal efficiency in the first 15 min reaching 94%. The removal efficiency then begins to decrease at a slow rate as the contact time increases from 15 to 180 min reaching a removal efficiency equal to 88%. This result is obtained because sugarcane bagasse pulp’s active sites are accessible for adsorption during the first 15 min, and afterward, the active sites become gradually occupied reducing the amount being adsorbed, since repulsion action takes place between bulk phases and the sugarcane bagasse pulp adsorbed molecules. These results match the results obtained by Kurniawati et al. (2021).

Fig. 8
figure 8

Effect of contact time on MB dye removal efficiency

The optimum contact time for continuing the study is chosen to be 15 min.

Effect of shaking speed

The study is conducted on a magnetic stirrer. The effect of shaking speed is studied by varying it from 80 to 300 rpm at contact time equals 15 min. The results, shown in Fig. 9, indicate that the removal efficiency increases with increasing magnetic stirrer shaking speed. This is contributed to the fact that the increase in shaking speed results in an increase in the kinetic energy of both dyes molecules and adsorbent particles. Therefore, more adsorbent particles get the chance to react with more dye molecules and more bonds are formed (Aljeboree et al. 2017). However, a further increase in the shaking speed results in excess kinetic energy than the required one. Therefore, collision starts resulting in breaking the formed bonds and detaching the adsorbed molecules (Khan MaqsoodBinSalam et al. 2014). Thus, the efficiency decreases from 94.73 at 100 to 86.84% at 300 rpm. The optimum shaking speed is chosen to be 100 rpm for continuing the study.

Fig. 9
figure 9

Effect of varying shaking speed on MB removal efficiency

Effect of particle size

The effect of particle size is studied by examining 3 different particle sizes 200, 500, and 1000 µm. The results show that the increase in particle size will increase the removal efficiency to a maximum value, and then, the efficiency will be decreased again with further particle size increase. This is explained by the fact that at very small particle sizes the adsorbent particles will be carried on the surface of the solution. Therefore, a large part of the active sites will be missed, while increasing the particle size over a certain value will result in declining the accessibility of the dye to the adsorbent pores (Adeyemo et al. 2017; Nunes et al. 2009). Therefore, the efficiency decreases again. The optimum particle size is then chosen to be 500 µm (Fig. 10 and Table 1).

Fig. 10
figure 10

Effect of particle size on MB removal efficiency

Table 1 Summary of conditions values involved in the experiments

ANN results

ANN is chosen to be applied to the results of the experiment to get the optimum conditions that maximize the removal efficiency. The Moth Search Algorithm (MSA) is applied to the ANN model. The ANN results and the residual are given. ANN is implemented using MATLAB (R2019a), and the feed-forward network is selected. The network consists of an input layer, several hidden layers, and an output layer, where the input and output layers contain seven neurons and one neuron, respectively. The number of neurons in the hidden layer is ten after applying for different numbers; the number ten results in the lowest mean square error. The transfer function between the input and hidden layers is tan sigmoid (Tansig), and the transfer function between the hidden and output layers is a pure line (Purline). When ANN data are applied to the previous table, the optimum conditions are found to be Temperature = 42.34 °C, Adsorbent dose = 34.682 g/L (Fig. 11).

Fig. 11
figure 11

ANN model architecture used

Dye concentration: 160.25 mg/L, time: 71.313 min, 127.4656 rpm, pH: 11, particle size: 770.99 µm. Figure 12 demonstrates the regression plot. The regression plot shows an R2 value of 0.98158 which ensures that it is an effective and reliable technique to model the adsorption process.

Fig. 12
figure 12

Regression plot for the adsorption by bagasse pulp

Experimenting under these conditions yields a removal effectiveness of 94.98%, which is remarkably like the 95% efficiency observed under the optimum experimental conditions.

This suggests that there are two optimum conditions, one derived from experimental work and the other derived from ANN modelling, both of which yield efficiency close to 95% (Table 2).

Table 2 Experimental data for the adsorption by bagasse pulp and ANN results

Conclusion

In this study, sugarcane bagasse pulp is examined as an adsorbent for MB removal, the FTIR analysis of the surface shows the presence of OH, C=O, and CO groups which are responsible for Mb removal, XRD analysis proves its cellulosic structure, while SEM image shows no agglomeration in its fibres. Parameters affecting the adsorption are studied. As temperature increases, removal efficiency increases showing an optimum temperature value equal to 40 °C. MB adsorption is found to favour the alkaline medium. The removal efficiency increases with increasing the adsorbent dose and reaches saturation at the adsorbent dose equal to 20 g/L. Removal efficiency is found to be decreasing with increasing both contact time and the initial dye concentration. Therefore, the optimum value is chosen to be 15 min for the contact time and 25 mg/L for the initial dye concentration. On the other hand, adsorption efficiency increases with increasing the initial shaking speed till it reaches an optimum value and then decreases again after exceeding it. The same effect is found with the adsorbent particle size. 130 rpm and 500 µm are chosen as the optimum values for the shaking speed and adsorbent particle size, respectively. The efficiency of MB adsorption onto sugarcane bagasse pulp is investigated using the ANN model. The R2 value of 0.98158 for ANN is investigated which ensures that it is an effective and reliable technique to model the adsorption process. The best removal efficiency is predicted at conditions at temperature = 42.34 °C, pH = 11, adsorbent dose = 34.682 g/L, contact time, initial dye concentration: 160.25 mg/L, contact time: 71.313 min, 127.4656 rpm, pH: 11, and particle size: 770.99 µm. Removal efficiency of 95% is achieved under these conditions. Therefore, the study's findings demonstrate that employing sugarcane bagasse pulp is an effective method for removing dyes from aqueous solutions. However, this study method is limited to countries which grow sugarcane bagasse. Moreover, it is suggested that it can be used to prepare activated carbon physically or chemically for further increase in the removal efficiency with a low amount of adsorbent dose.