Introduction

One of the most critical global challenges stems from the extensive pollution released into the environment due to the rapid expansion of industrial and agricultural activities1. Dyes are a type of pollutant that is especially problematic because they are toxic and harm the process of photosynthesis2,3. Therefore, it is necessary to eliminate them from wastewater before it is discharged into the environment4. Scientific research indicates that an estimated 700,000 to 1,000,000 dyes are manufactured annually through diverse industrial processes5. Industries such as textiles, plastics, cosmetics, food processing, and pigments are majorly involved in these production procedures6. The most used dyes in various industries are synthetic, cationic dyes, and anionic dyes7. Disposal of these dyes into the environment has proven detrimental to aquatic environments, posing potential risks to aquatic life and human health8. Adverse effects manifest as aesthetic concerns like water discolouration and the release of unpleasant odours9,10. Furthermore, the ramifications extend to the deterioration of aquatic ecosystems due to reduced sunlight penetration and diminished oxygen levels within the water11.

Methylene blue (MB) is a commonly utilized dye in the textile sector, mainly used to provide colour and improve the overall aesthetic of fabrics12. MB concentrations in the environment from a few various nations are as follows: 0.02–0.13 mg/L in China13, 0.01–0.03 mg/L in the USA14, 0.2–0.5 mg/L in Bangladesh15, and 0.1-1.0 mg/L in India16. Various wastewater treatment techniques have been employed to remove the dye, including membrane filtration17, ion exchange18, coagulation19, advanced oxidation procedures20 and adsorption21. However, these processes have drawbacks such as high chemical requirements, residual metal solubility, expensive capital and operating expenses, and high sludge formation rates1. In contrast, adsorption is an effective and affordable method for wastewater treatment22, ensuring high MB removal efficiency23. Additionally, the adsorption process helps prevent the development of secondary contaminants that may result from MB oxidation or degradation24,25,26. Numerous adsorbent materials made from agricultural waste offer a promising solution for colour removal from wastewater such as biochar27,28,29 and activated carbon30,31,32,33. Recent research has concentrated on enhancing the adsorption procedure and identifying economically feasible, efficient, and environmentally sustainable dye removal adsorbent34,35,36. Effective adsorbents for wastewater treatment have been developed using various agricultural solid wastes37. Examples of potential adsorbent materials include biochar38, activated carbon39 modified sugarcane bagasse40, walnut shells41, pine wood42, and wheat43.

Rice straw (Oryza sativa), an agricultural residue resulting from the process of rice harvesting, has conventionally been retained post-harvest. Oryza sativa straw biomass (OSSB), a significant carbohydrate source in Asia, saw a global production of approximately 740 million tonnes of rice straw in 2014, as estimated by the Food and Agriculture Organization (FAO). However, this rice straw has typically been considered waste and either discarded or burnt. There have been numerous investigations to repurpose O. sativa, including its use in compost44, and a precursor for activated carbon45,46. The utilisation of OSSB straw aligns with the principles of a circular economy, emphasizing the utilisation and recycling of organic waste. Moreover, the adsorption process was improved by utilizing optimization approaches such as the response surface approach, artificial neural networks47, and adaptive neuro-fuzzy inference systems (ANFIS)48.

Nevertheless, the adsorption-based removal of MB dye as an adsorbent addresses a significant research gap in wastewater treatment and environmental sustainability. The research community has recognized a gap in the need for sustainable, cost-effective, and environmentally friendly adsorbents to remove MB dye49. The utilization of agricultural waste materials, such as OSSB, as potential adsorbents, offers an innovative and sustainable solution. Given the extensive use of such dyes in various industries and their harmful impact, the research conducted on effective and sustainable removal methods is not only timely but also essential for environmental protection50. The research emphasizes the possibilities of utilizing rice straw, a plentiful agricultural byproduct, as an adsorbent, thereby advancing principles of resource efficiency, minimizing waste, and providing economic advantages to both farmers and industries. Despite significant advancements in adsorption technologies for dye removal, several gaps remain in optimizing and modelling the process effectively. Previous studies have largely focused on single modelling techniques, such as response surface methodology (RSM) or artificial neural networks (ANN), neglecting the comparative evaluation of hybrid approaches like ANFIS, which integrates the strengths of ANN and fuzzy logic48,49. Additionally, while many studies emphasize experimental validation of adsorption parameters, the integration of advanced modelling tools to predict performance with high accuracy remains underexplored. There is also limited research on utilizing agricultural waste like OSSB as a cost-effective and sustainable adsorbent for industrial dye removal. Furthermore, detailed investigations into the thermodynamic, kinetic, and isothermal behaviours of such adsorbents, particularly under optimized conditions, are scarce. This research addresses these gaps by employing multiple modelling approaches and thoroughly analyzing OSSB’s potential, thus contributing to the advancement of sustainable dye removal technologies.

RSM, a statistical and mathematical combination, was instrumental in determining the ideal operating conditions for the system and developing a model to elucidate how these conditions affect the response. The central composite design (CCD) under RSM was employed as an experimental design to determine effective parameters with the fewest tests and explore interactions between them51. To better understand the adsorbent and the adsorption process, kinetics, equilibrium isotherms, and thermodynamics were thoroughly investigated. The adsorbent was characterized using FTIR, and SEM52,53. The novelty of this study lies in the application of artificial intelligence, employing modelling and analysis of MB using ANN and ANFIS, thus revealing the relationship between input and output parameters. This work aims to compare the three data-driven methods for the removal of MB dye using an effective adsorbent that is easily accessible and inexpensive raw material for efficiently removing a persistent and prevalent water contaminant. The findings offer a holistic approach to addressing the environmental impact of dye pollutants and contribute to the development of efficient and eco-friendly dye removal methods, aligning with the broader goals of sustainable and responsible industrial and agricultural practices.

Materials and methods

Preparation of adsorbate (MB)

In this study, we conducted experimental adsorption using MB (C16H18ClN3S) of analytical grade. Table S1 illustrates the molecular weight, structure, and other characteristics of MB. A stock solution of MB (500 mg/L) was prepared by dissolving the required amount of MB dye powder in deionized water. The chemicals used in this study were sourced from the Central Drug House Pvt. Ltd. in New Delhi, India. They were of analytical grade and were obtained following proper procedures to ensure high quality.

Preparation of adsorbent (OSSB)

The parali, known as OSSB, was derived from agricultural residue in Haryana, India and was employed as an adsorbent in this study. The properties and composition of OSSB have been analysed by various researchers, as shown in Table S2. A thorough cleansing of OSSB was carried out to eliminate impurities using distilled water. Following chopping into minute pieces, OSSB was dried in a 70 °C oven for a full day. The dried OSSB was milled to produce a powder with a particle size of 50 μm. This resulting powder was stored for use in the MB dye adsorption process.

Characterization of adsorbent (OSSB)

The surface morphology of the biomass was analysed using SEM. Morphological characteristics of the samples were acquired using a Hitachi 2300 Scanning Electron Microscope. The SEM functioned under high-vacuum circumstances with an accelerating voltage at 15 kV to acquire high-resolution images of the OSSB surface. Surface characteristics, including pore structure and surface roughness, were visually examined to identify probable adsorption sites for Methylene Blue. FTIR, which ranges from 400 to 4000 cm−1, was utilized for the characterization of OSSB, with spectra acquired using the JASCO FTIR 4100. Dried OSSB samples were carefully crushed and combined with KBr (potassium bromide) to produce apparent pellets for analysis.

Results and discussion

Adsorbent characterization

SEM analysis

Surface morphology analysis was performed on the OSSB using SEM to gain insights into its structure and surface characteristics for the adsorption processes. The SEM study revealed that the surface of OSSB exhibited thin, overlapping, and wrinkled sheets of carbon, giving it a distinct structure54. Reports suggest that the irregular and rough features on the surface of OSSB contribute to its excellent adsorption properties. The layers and creases observed in OSSB are believed to have formed due to oxygen-containing functional group interactions55. Notably, Fig. 1A demonstrates the presence of a significant number of aggregate particles and heterogeneous pores. These particles on the OSSB surface may be silica residues, while the pores could have originated from intercellular spaces56. Furthermore, the loading of the MB dye molecule induced changes in the surface of OSSB, making it smoother and more compact (Fig. 1A). The study successfully achieved a highly porous material with surface pores, enabling effective adsorption by providing ample free spaces for the target adsorbate57.

Fig. 1
Fig. 1
Full size image

(A) SEM image showed OSSB and (B) FTIR plot shows the OSSB before and after adsorption.

FTIR analysis

FTIR spectroscopy was used to examine the surface of OSSB prior to and after the adsorption of MB dye (Fig. 1B). This investigation sought to discover changes in surface characteristics and improve the chemical properties. Furthermore, it was employed to detect the existence of functional groups. The peak at 2899 cm− 1 was attributed to the stretching vibrations of OH groups in carboxylic acids, while the broadband at 3328 cm− 1 resulted from the overlapping N-H and OH groups. Bands at 1619 cm− 1 were linked to aldehydes, lactones, ketones, and the carboxyl group58. The OSSB plant exhibited symmetric and asymmetric vibrations of the ionic carboxylic group at 1330 cm− 1. Additionally, C-O and C-O-C stretching vibrations associated with carboxylic acids, alcohols, phenols, and ester groups were observed in bands ranging from 1200 to 1000 cm− 159,60,−61.

The abundance of active groups on the surface of OSSB facilitated the adsorption of MB dye molecules, primarily through electrostatic interactions. The FTIR spectrum of OSSB before adsorption indicated the presence of numerous functional groups, including carbonyl and carboxylic species, on the plant’s outer surface62. After MB dye adsorption, shifts and intensification of specific bands were observed. Notably, new bands associated with nitro (1240 cm− 1) were attributed to MB dye deposition on the surface of O. sativa.

RSM optimisation process

RSM utilizes statistical and mathematical methods to investigate the connections between multiple independent variables, referred to as factors, and one or more dependent variables, known as responses. RSM is employed to construct models by establishing a sequence of experimental runs and fitting empirical models to the data collected under the selected design63. The procedure for implementing RSM is outlined as follows: selecting the independent variables that significantly influence the process or system (screening design); determining the experimental design; fitting the experimental data to a polynomial function; assessing the model’s fitness; and identifying the optimal values of the variables64. The experimental design delineates the model that the experimental data is expected to conform to; the regression model is employed to align with the data. CCD is frequently employed for the optimization of the coagulation process utilized in wastewater treatment. The CCD comprises three unique sets of experimental runs: the initial set utilizes a two-level factorial design, the subsequent set represents the centre point, and the final set consists of the star points63. In factorial design, the lowest level value is represented as (− 1), while the highest level value is represented as (+ 1). The second experimental set serves as the centre point, assigned a coded value of (0). The third experimental set consists of the star points, which are positioned outside the factorial space (the optimal prediction within it). These points are utilized to obtain an accurate estimation of quadratic terms. Nonetheless, they must fall within the operable range, with their coded values denoted as (−α) and (+α)65.

The RSM with a CCD was employed to optimize and improve the adsorption process utilizing O. sativa. Design Expert software, version 13.0, facilitated the implementation and analysis of the RSM. In the batch adsorption process, each independent variable could assume one of five values, with -α, -1, 0, + 1, and + α chosen as the axial levels66. The selected independent variables, their ranges, and the values used in the study are outlined in Table 1. Following adsorption, the solution underwent centrifugation at 120 rpm for 60 min to eliminate any residual dye concentration21. Spectrophotometric analysis was conducted on the solution at 664 nm, the maximum absorption wavelength for MB, to determine the dye concentration after reaching equilibrium adsorption.

Table 1 Variables and their levels of codification in the RSM model.

The extent of dye adsorption can be quantified using three key adsorption metrics: adsorption capacity (Qm), adsorption capacity at a specific time (Qt), and removal efficiency (%). These metrics can be calculated using Eqs. (1, 2, and 3)67.

$$\:{\text{Q}}_{\text{m}}=\frac{{\text{C}}_{\text{o}}-{\text{C}}_{\text{e}}\left(\text{V}\right)}{\text{W}}$$
(1)
$$\:{\text{Q}}_{\text{t}}=\frac{{\text{C}}_{\text{o}}-{\text{C}}_{\text{e}}\left(\text{V}\right)}{\text{W}}$$
(2)
$$\%\, \text{dye removal} = \frac{{\text{C}}_{\text{o}}-{\text{C}}_{\text{e}}}{{\text{C}}_{\text{o}}}{*}100$$
(3)

where Co and Ce are the MB dye concentrations (mg/L) at the start and equilibrium, W is the adsorbent (mg), and V is the volume (mL) of the solution.

Key experimental factors were chosen for this study as input variables, including the adsorbent dose (mg), solution concentration (mg/L), pH, and solution temperature (°C). The software suggested 30 experiments based on the given parameter conditions and ranges (Table S3). The RSM-optimized conditions for MB adsorption on OSSB were identified, resulting in a projected MB removal of 92.6%, closely aligned with the actual MB removal of 93%. These optimized conditions included a 20 mg adsorbent dosage, 40 mg/L MB concentration, initial pH of 7, and a contact duration of 60 min at 30 °C. This statistical approach allows for the determination of ideal dye adsorption settings by establishing a regression equation that elucidates the relationship between the independent variables and MB dye adsorption. The regression equation for these experiments’ coded values is provided as

$$\begin{aligned} \:{\text{Dye}}\:{\text{removal}}\:\left( \% \right) = & + \:86.70\: + \:206\:{\text{*}}\:{\text{A}}\:\: - 0.0417\:*\:{\text{B}}\: + \:0.4642\:*\:{\text{C}}\: + \:0.6592 \\ & *\:{\text{D}} - \:0.4737*\:{\text{AB}}\:\: - 0.4700\:*\:{\text{AC}} - \:0.4375\:*\:{\text{AD}}\: + \:0.2088 \\ & *\:{\text{BC}} - \:0.1913\:*\:{\text{BD}}\:\: - 0.5700\:*\:{\text{CD}}\: + \:0.9271*\:{\text{A}}^{2} \: + 0.8771 \\ & *\:{\text{B}}^{2} \: + \:1.31\:*\:{\text{C}}^{2} \: + \:1.16\:*\:{\text{D}}^{2} \\ \end{aligned}$$

Analysis of variance and regression analysis

Analysis of variance (ANOVA) was employed to assess the variance and establish the statistical significance of the FCCCD model. Table 2 presents the ANOVA results for the quadratic model of the projected response surface, elucidating the importance of the model coefficients based on their F and p values. A p-value of 0.05 is typically considered statistically significant, while a p-value of 0.00 is also significant based on established literature68,69. The quadratic model for MB exhibited a maximum R2 value of 0.9216 and an adjusted R2 of 0.861, with a standard deviation of 0.52.

Table 2 Adsorption statistics using the FCCCD Model for MB.

Efficacy of the model

Regression models serve as a valuable tool to assess the predictive capacity of a model concerning a specific response variable. The relationship between the observed MB adsorption values and the anticipated values derived from the data, resulting in an R2 value of 0.9216. This R2 value validates the model’s precision, affirming its applicability for experimental use.

Normal probability plot (NPP) for residuals

An essential statistical measure for assessing the model’s adequacy is the Normal Probability Plot (NPP) of the residuals70. As depicted in Figure S1(A), the NPP of the residuals for MB removal adheres to a normal distribution with a diagonal spread, aligning well with the predicted data. This alignment indicates the suitability of the model. Figure S1(B) presents a plot of residuals versus expected MB elimination percentages, illustrating a close fit of the points around the diagonal line, further affirming the model’s accuracy.

Graphical representation of regression model through RSM and ANFIS

Response surface plots were generated using the mathematical model and the explored experimental range to depict both direct and indirect interactions among the process parameters71. These plots illustrated the optimal conditions for maximizing MB uptake onto OSSB surface. Two variables were altered within the experimental range to create the quadratic model’s response surface, while the other two variables remained at the central level. In Fig. 2A, it is evident that higher temperature and adsorbent dose were crucial for achieving enhanced adsorption capacity of OSSB. The concentration gradient between the dye content in the solution and on the surface of OSSB, acting as the primary driving force for mass transfer during adsorption, may explain this behaviour under increased MB dye concentration conditions72. Figure 2A demonstrates the magnitude of the combined effect of temperature and adsorbent dose. OSSB exhibited significantly enhanced adsorption capability at higher temperatures and lower adsorbent doses. On the other hand, Fig. 2B indicates that a change in pH had no discernible effect on adsorption capacity. The adsorption ability of OSSB was expected to be heightened with decreasing dye concentration and pH, as illustrated in Fig. 2B.

Fig. 2
Fig. 2
Full size image

Response surface plots for the CCD model between different variables (A) adsorbent dose - temperature (B) pH- dye concentration.

Artificial neural network (ANN) optimization process

ANN is a computer tool that mimics the intricate relationships and learning patterns found in the biological nervous system73. Its structure comprises interconnected processing units, resembling neural connections, allowing for distributed information processing. This inherent parallelism facilitates efficient operations and handling of complex tasks21. ANN represent a machine learning approach characterized by their classification as a black box model, as they do not require information regarding the underlying physical parameters74. There are various types of ANN based on their architecture; the most frequently utilized type is the backpropagation (BP) feedforward neural network, commonly referred to as the multi-layer perceptron (MLP)75. A MLP is composed of an input layer, an output layer, and one or more hidden layers, as illustrated in (Figure S2). Each layer is composed of a specific quantity of neurons; the quantity of neurons in the input and output layers corresponds to the number of input and output variables, respectively. The values of neurons in both the hidden and output layers are contingent upon the weights assessed throughout the training phase. A threshold signal is assigned a weight and incorporated into each neuron within the hidden and output layers76. The construction of ANN models involves three stages: training, validation, and testing. Consequently, the data set is divided into three categories: training, validation, and testing. The majority of the data resides in the training dataset, often comprising 70–80% of the total data. The residual data is allocated between the validation and testing data sets. The training phase is the initial step in developing an artificial neural network, serving as a learning process to establish the relationship between input and output. The weights associated with each neuron are modified at each epoch throughout the training phase until the termination criteria are met. The terminating criteria may include minimal error value, number of epochs, or iteration and validation assessments. After the training phase, the validation dataset is employed to assess the predictive capability of the ANN model. Implementing numerous validation tests ensures the avoidance of local minimums75.In this study, an ANN model for MB adsorption was meticulously constructed using MATLAB software77. The transfer functions logsig and PURELIN was strategically employed to facilitate seamless data transfer from the input to the hidden layer and further establish the hidden layer connections to the output layer78. The experimental values, akin to those used in the RSM model, were utilized as inputs to the ANN model66. This approach aimed to accurately predict the percentage of MB eliminated based on the specified experimental conditions and parameters. As reported, the Marquardt-Levenberg method with the lowest MSE provides the best fit79. The results of dye removal prediction using the developed ANN model are depicted in Figure S2. This model incorporates five hidden neurons, four in the input layer (representing sorbent dose, dye concentration, pH value, and temperature) and one in the output layer (representing dye removal). The experiment’s data on dye removal is utilized to “train” the artificial neural network (ANN). Table S4 provides details regarding the weights and biases assigned to each layer of the trained ANN model. The training, validation, and error rates of an ANN model can be described in terms of their progression over a specified number of learning epochs. Training concludes when the test error is at its lowest and has not increased for six consecutive training rounds.

Figure S3(A) shows the MSE plots for each epoch for the constructed ANN model together with the training plots for each epoch. In Figure S3(B), the actual values of the training, validation, testing, and overall data sets are displayed alongside their projected values. The R2 values for these data sets are 0.9673,0.9999,0.9999, and 0.9756, respectively. The results demonstrate an important relationship between the test and predicted values. The results also showed that the model’s training set was adequate and was also able to anticipate how the validation and testing data would respond80.

Development of the ANFIS model

The ANFIS is an artificial intelligence model that seamlessly integrates fuzzy logic and neural networks, aiming to comprehend intricate industrial processes with minimal steady-state error81,82. The ANFIS model integrates the learning capabilities of artificial neural networks with the reasoning capabilities of fuzzy systems. In comparison to other artificial neural networks, the ANFIS model necessitates fewer configurable parameters and has superior accuracy. Dolatabadi formulated models to examine the adsorption removal process of dyes83. The neural network training method can automatically generate the membership function (MF) and rule table for a fuzzy system, provided that the pertinent input-output data sets are available to the system. The Sugeno fuzzy inference system (FIS) was selected due to its robust predictive capabilities. ANFIS mitigates the limitations of ANN and FIS while integrating their advantages84. Consequently, its generalization performance is improved, complex nonlinear mappings are maintained, and a reliable solution is offered85. The five components of an ANFIS network include the “fuzzy,” “product,” “normalized,” “de-fuzzy,” and “final output” layers86. Through a two-step learning approach, it refines its ability to learn autonomously. Initially, it constructs fuzzy controllers and rules in an adaptation mode, and subsequently, it modifies these rules and controllers in an alteration mode, thereby enhancing its capacity for self-learning87.

In this study, the ANFIS model for improved dye removal prediction was meticulously developed using MATLAB 2016a (Mathworks Inc.) software and the fuzzy logic toolbox (anfisedit). Like ANN modelling, the dataset was divided into training, testing, and validating categories to ensure effective model evaluation. A systematic approach was used to divide the data into three parts: 15% for testing, 15% for validation, and the remaining 70% for training. The suggested ANFIS paradigm’s design, as depicted in Figure S4, encompassed crucial components such as input, input membership functions (inputmf), rules, output membership functions (outputmf), and output88. A Sugeno-fuzzy model employing IF-THEN rules was specifically crafted in this study to predict results based on four input parameters. For the evaluation and training phases, a subset of the experimental trials from the RSM design was utilized. Out of the 30 experimental runs, nine were used for evaluating the ANFIS paradigm, and the remaining 21 were employed for the training process. The training involved defining fuzzy subsets and their respective membership functions, with the membership function output ranging between 0 and 1, representing the degree of membership in the fuzzy set89. ANN for modelling MB adsorption due to their ability to capture complex, non-linear relationships among variables like sorbent dose, dye concentration, pH, and temperature. ANNs, using backpropagation and the Marquardt-Levenberg algorithm, outperformed decision trees and random forests in accuracy and generalization.

Triangular membership functions are utilized, as they outperform Gaussian and bell-shaped membership functions. The prediction model anticipates a maximum of 60 epochs (Table S5). This is because the prediction model is simpler yet highly accurate due to the absence of fuzzy rules and fewer input variables. The optimal ANFIS model is generated by balancing the contribution of the membership function against the model’s coefficients of determination (R2), mean square error (MSE), root mean square error (RMSE), and mean absolute error (MAE). The statistical analysis considers R2, MSE, RMSE, and MAE90,91. These statistical analysis indices are routinely used to compare the efficiency of models employing various types of machine learning applications. The effectiveness of the ANFIS prediction system is assessed by employing various sets of membership functions. The ANFIS model is examined with membership functions (9 sets), then trained (30 sets), and subsequently tested (21 sets), as depicted in Figures S5(A), (B), and (C) for dye removal.

Adsorption mechanism

The fundamental components of the dye adsorption mechanism encompass electrostatic attraction, pore filling, hydrogen bond formation, and ion exchange92. Weak hydrogen bonding and pore diffusion significantly influence the adsorption mechanism93. The material’s surface, rich in hydroxyl groups, facilitated numerous adsorption sites94. The interactions between the hydroxyl groups on the adsorbent surface and the benzene ring of the MB molecule, including hydrogen bonds and n-type interactions, enhanced the adsorption capacity95. An effective adsorption technique for the removal of MB may utilize electrostatic attraction between regions of low electronic density in the molecule and the surface groups of OSSB, including hydroxyl and carboxyl groups. The FTIR characterisation facilitated the identification of these groupings. Non-electrostatic linkages are present in oxygen-containing groups that can form hydrogen bonds with MB dye species96. An exemplary instance of this interaction is the stacking of benzene rings in MB and the adsorbent97. The net positive charge of MB induces electrostatic attraction to the negatively charged groups on the adsorbent. The adsorbent and methylene blue interact via hydrogen bonding. In the ultimate contact mechanism, the MB molecule and the adsorbent exchange cations. This suggests that adsorbents rich in benzene, hydroxyl, and carboxyl groups are likely to demonstrate enhanced adsorption capabilities. Figure 3 depicts the possible adsorption mechanism between OSSB and the MB dye molecule.

Fig. 3
Fig. 3
Full size image

Adsorption mechanism for MB dye onto OSSB (adapted and modified from41) copyright 2025.

Adsorption isotherms and kinetics study

The adsorption isotherms were derived from the results obtained in the batch experiments by varying the adsorbent dose98. Specifically, we examined two widely used isotherm models: the Langmuir model and the Freundlich model. Table S6 presents the equations for these isotherm models, the values of the isotherm parameters, and the corresponding correlation coefficients (R2) for the optimal dose. Additionally, we delved into the adsorption kinetics of the process by studying the removal of MB by OSSB at different temperatures, providing a comprehensive understanding of the adsorption behaviour over varying thermal conditions79. In this research, a two-kinetics model was employed to encompass both pseudo-first order and pseudo-second-order kinetics, allowing a comprehensive understanding of the adsorption process dynamics. The mathematical formulations representing these models can be found in Table S6, which are widely recognized and reported in the literature for their applicability in similar studies99,100.

Based on the Langmuir isotherm adsorption model, it is observed that adsorbate atoms (molecules, ions) tend to form monolayers on a uniform surface. In Fig. 4A, graphs from the Langmuir isotherm model are illustrated. The results in Table 3, with an R2 of 0.9799 for MB, demonstrate that the Langmuir isotherm model adequately describes the data. This suggests that the adsorption of MB is homogeneous, and the dye monolayer is the major layer covered by the adsorbent45,73. In contrast, the Freundlich isotherm model represents multi-facet adsorption on an adsorbent with a heterogeneous surface (Fig. 4B). The R2 coefficient obtained from the linear plots of the isotherm models was utilized to analyze the acquired data.

To assess the effectiveness of adsorption, the separation factor (RL) was calculated from the Langmuir isotherms for each dye. The obtained RL values for the dyes were less than 1 (Table 3), indicating highly effective adsorption of the dye onto the adsorbent57.

Table 3 Analysis of isotherms adsorption, kinetics, and thermodynamics study parameters.

To investigate the adsorption mechanisms and potentially rate-determining phases, a kinetic model is employed. Unlike the pseudo-first-order model, which relies on solid capacitance, the pseudo-second-order model, incorporating valence forces, is effective for the adsorption of analytes from aqueous solutions41. This process involves the sharing or trading of electrons between the adsorbent and the analyte101. The pseudo-second-order equation exhibits an R2 coefficient of 0.999, signifying the best fit for MB. Table 3 presents the kinetic characteristics for pseudo-first order and pseudo-second order. Figure 4C shows the typical pseudo-2nd-order equation plot. The results show that the MB dyes are chemisorbed onto the OSSB adsorbent via a pseudo-second-order binding mechanism. The chemisorption mechanism for MB dye adsorption onto OSSB suggests a process involving valence forces and electron sharing between the dye molecules and the adsorbent surface. The high R² (0.999) value for the pseudo-second-order model indicates that chemisorption is likely the primary mechanism, where chemical bonds form between the dye and the adsorbent. However, relying solely on pseudo-second-order kinetics offers limited insight into the adsorption mechanism. Additional models, like intra-particle diffusion or Elovich, could clarify other stages, such as surface adsorption and diffusion. These models would help distinguish rate-controlling steps and better describe the adsorption’s multi-step nature. Additionally, there is a strong affinity between the dye and the adsorbent. This is demonstrated by the quick half adsorption time attained with many dyes eliminated.

Fig. 4
Fig. 4
Full size image

Linear plot of Langmuir Isotherm Model (A), Freundlich Isotherm Model (B), pseudo 2nd order (C) and Graph plot between MB adsorption and temperature (D).

Adsorption thermodynamics study

To unravel the thermodynamics of MB adsorption on O. sativa, an assessment was made by quantifying alterations in Gibbs free energy (G; kJ mol− 1), entropy (S; J mol− 1), and enthalpy (H; kJ mol− 1). The following three equations were employed to derive the thermodynamic variables:

$$\:{\text{k}}_{\text{c}}=\frac{{\text{c}}_{\text{a}}}{{\text{c}}_{\text{e}}}$$
(4)
$$\:\varDelta\:\text{G}=-\text{R}\text{T}\text{l}\text{n}{\text{k}}_{\text{c}}$$
(5)
$$\:\varDelta\:\text{G}=\varDelta\:\text{H}-\text{T}\varDelta\:\text{S}$$
(6)

Where ca stands for the MB solution concentration, kc, ca, and T are the adsorption distribution coefficient, the amount of MB absorbed per unit mass of adsorbent, and temperature in kelvin, respectively102.

The temperature range optimal for MB adsorption onto OSSB was determined to be between 15 and 30 degrees Celsius. Table 3 presents the thermodynamic parameters, encompassing Gibbs free energy (ΔG°), enthalpy (ΔH°), and entropy (ΔS°). The adsorption process of MB onto OSSB was naturally occurring and successful, as indicated by the negative value of ΔG°. The adsorption of MB onto OSSB reduces the disorder at the solid/liquid interface, resulting in a negative value of entropy, ΔS (-19.03 JK− 1mol− 1), and a positive value of enthalpy, ΔH (-1457.2 kJ/mol), consistent with the exothermic nature of the reaction. A high concentration of H is an indication of a positive between OSSB and MB. The enthalpy and entropy of the MB adsorption can be calculated using the Gibbs free energy(G) and temperature(K) as shown in Fig. 4D.

RSM, ANN, and ANFIS paradigm comparisons

The efficacy of RSM, ANFIS, and ANN models in indicating the non-linear properties of the MB dye adsorption removal process was assessed by graphical and statistical techniques. Their correlation coefficients indicated the close fit of the models in Fig. 5A. The values are significantly above the least recommended value of 0.8 for optimal correlation between experimental and projected values 23. The optimal values for each input factor (adsorbent dose 20 mg, dye concentration 40 mg/L, pH 7, and temperature 30 °C) as predicted by RSM, ANN, and ANFIS are presented in Table 4.

Nonetheless, their predictive efficiencies regarding MB adsorption were statistically assessed by calculating the MSE, RMSE, and MAE of the three models to establish a ranking of their performance. The statistical indices’ results are displayed in Table 4. Reduced values of MSE, RMSE, and MAE signified superior performance. For dye removal, RSM, ANN, and ANFIS achieved R2 values of 0.9216, 0.8864, and 0.9589, respectively. MAE for all responses with ANN, RSM, and ANFIS was 0.0952, 0.1466, and 0.0952, respectively. This indicates that among the two models considered, the ANFIS model demonstrated the least significant difference between the calculated value and the actual data. Based on the statistical indices, ANFIS gave better accuracy and precision in predicting MB adsorption, while other models show the least precision, which is supported by the lowest MSE, RMSE, and MAE values. So, the ANFIS model, followed by the RSM model and the ANN model, was found to be the most accurate in predicting the outcomes (Fig. 5B).

Fig. 5
Fig. 5
Full size image

Actual versus predicted plot for MB removal by (A) ANN, ANFIS, RSM and (B) Comparison of predicted values of dye removal with actual values.

Table 4 Comparison of experimental validation and performance of predicted models.

Conclusions

Conventional time series prediction algorithms are inadequate to handle complex nonlinear forecasts. ML prediction techniques are unable to accommodate the complex and unknown prediction procedures required to incorporate the outcome’s complex attitudinal aspects. Moreover, these methods cannot reduce the computational expense of extensive data collection without losing substantial information. This study presents a unique predictive model that integrates the RSM, ANN, and ANFIS methodologies to simulate the removal of MB dye using the OSSB under investigation. MB adsorption using OSSB under optimized conditions, 7 pH, 60-minute contact times, 20 mg adsorbent doses, and 30 °C temperatures. The pseudo-second-order model and the Langmuir model effectively described the kinetics and isotherm modelling of MB dye adsorption, respectively. The MB removal process was spontaneous, endothermic, and exhibited enhanced randomness, as indicated by the Gibbs free energy change (∆G = -9.1489 kJ/mol), enthalpy change (∆H = -1457.2 kJ/mol), and entropy change (∆S = -19.03 J mol−1 K−1). The ANN, RSM, and ANFIS models were successfully employed to model the MB removal process, with R² values of 0.8864, 0.9216, and 0.9589, respectively. Based on the statistical error metrics ANFIS model showed superior quality and reliability followed by ANN and RSM models. The results strongly indicate OSSB as a cost-effective, easily accessible, and practical solution for removing dye in the textile industry.