Introduction

Sugarcane is a prime industrial and cash crop in Egypt. It has̄ been cultivated since 641 AD. In 2021, the total area growing sugarcane in Egypt was 104.2 thousand hectares, and the average yield was 91.7 t/ha. Sugarcane is the major crop used for sugar production (Mehareb et al. 2021).The sugarcane industry can currently be defined as an open industrial system that consumes material and energy and creates sugar and waste. In order to achieve sustainability, it is mandatory to focus on achieving a closed-loop system, where all materials are effectively used. Instead of being discarded or incinerated, the waste and byproducts resulting from the harvesting process should be employed efficiently.

Recycling sugarcane residue is a promising way to use as sustainability source. Every year, Egypt produces more than 16.8 million tons of sugarcane residue (Hamada 2011). During the sugar production process, multiple residues have generated these residues are 30% bagasse, 4% molasses, and 3.5% filter mud (cachaza) (Micheal & Moussa 2022).

The ideal scenario requires a complete metamorphosis of the sugar cane industry, transitioning it into an ecologically harmonious sector with the goal of attaining zero pollution or waste. In Egypt, significant strides have been made toward achieving environmental balance, with the establishment of key projects such as fiberboard, and paper industries, effectively utilizing the industry's residues. Nevertheless, to truly achieve sustainable excellence, the industry must strive to close the cycle of sugarcane production, seamlessly integrating the residues generated during harvesting and sugar production stages into the creation of environmentally friendly products, all while maintaining minimal costs and employing appropriate technologies.

Sugarcane bagasse is an easily obtainable agricultural waste that has significant potential, which remains predominantly untapped and is largely burned as a fuel source. Multiple processes can be done for optimizing the utilization of bagasse, and anaerobic digestion (AD) is considered as one of these utilizes being a viable option for biogas production. On the other hand, the complicated molecular structure of bagasse, which consists of hemicelluloses, cellulose, and lignin, makes a significant obstacle for anaerobic digestion, necessitating the application of several pre-treatment methods to simplify microbial digestion (Li et al. 2012).

Generally, biogas production is done under anaerobic conditions after incubating inoculum with pre-treated bagasse, and several factors control the amount of production such as operation temperature, pH, carbon/nitrogen (C/N) ratio, and liquid-to-solid ratio. These conditions change depending on the pre-treatment technique of substrate and the type of inoculum utilized (Abudi et al. 2020), (Lima et al. 2018), (Vats et al. 2019b).

It is fundamental to undergo a pre-treatment process that decreases the structure's hardness and makes the surface area of biomasses available to the accessibility of microbes which allows more hydrolysis, thus enhance biogas production (Kaur et al. 2020), (Zheng et al. 2014). Various physical, biological, and chemical methods can be used for biomass pre-treatment to enhance methane production, each has its own advantages and disadvantages (Ghosh et al. 2020), (Vats et al. 2019a). These methods can be applied individually or in combination (Abraham et al. 2020).

The bokashi technology is a process done under anaerobic conditions to recycle bio-waste by applying "effective microorganisms" (EM) which results to odor-free decomposition rather than putrefaction., as well as reducing greenhouse gas emissions (Olle 2021). Additionally, it is the most suitable option for treating organic waste due to its cost-effectiveness and yields results faster than other methods (Arumugam et al. 2022).

Ordinarily, Organic matter takes two to three months to decompose into simple organic compounds. In contrast, bokashi technology accelerates the decomposition process, which is typically done within two to four weeks. Furthermore, bokashi technology does not result in heat or a foul odor (Kumar & Bai 2008).

Bokashi technology showcases noticeable adaptability by transforming neglected nutrients from sources like fruit wastes into valuable resources that can be reused. Hence, Bokashi is able to convert waste into nutrients for microorganisms (Olle 2021). Bacteria, yeast, and fungi existing during the bokashi process engage in the enzymatic breakdown of organic compounds found in waste, producing organic acids, including but not limited to acetic acid and lactic acid (Awang & Awang 2021). The microbial degradation that occurs during the Bokashi process for less accessible lignocellulosic substances turns these stubborn materials into readily consumable polysaccharides. In other words, fermentation accelerates the breakdown of organic matter and supports production of bioactive materials (Arumugam et al. 2022).

Many research (Batstone et al. 2015), (Xie et al. 2016), (Montecchio et al. 2019) highlighted the significance of exploring and using mathematical models to understand the anaerobic digestion process. Lately, several models have been used to simulate the synthesis of methane. Under specific conditions, these models are used to simulate and forecast the amount of methane that will be created over time. These models can be thought of as an efficient substitute for experimental techniques, which take a lot of time and expensive prototypes. On the other hand, artificial neural networks (ANNs) have increasingly been used to predict or model a variety of environmental issues (Abdel Daiem Het al. 2021), (Dahunsi et al. 2017), (Valim et al. 2017) because of their advantages over traditional approaches, including their capacity to learn complex input/output relations, support for parallel processing, and ability for generalization.

This modeling approach has shown to be a beneficial tool for various issues connected to air quality and forecasting of emissions. ANNs learn from examples (Brunelli et al. 2008), (Singh et al. 2012), (Russo et al. 2013). Recent years have seen significant improvements in the use of ANNs for the specified area's prediction of CH4 because of their adaptability.

Three methane production models, modified Gompertz Model (Dhamodharan et al. 2015), transfer function model (Li et al. 2012), and logistic function model (Ware & Power 2017), are utilized in this study to assess which has the best correlation with the data from the experiments. The Gompertz model is found to be the most effective one for representing experimental data. Based on the outcomes of this model, TDMM was developed.

From this background, the primary purpose of this study is to evaluate the ecological viability of Egypt's sugar industry, striving for a harmonious environmental balance and minimal waste production. The focus lies in exploring the potential of combining bokashi with sugarcane bagasse to enhance the anaerobic biodegradability of waste-activated sludge, with the ultimate goal of achieving a nearly waste-free industry, as well as obtain the highest yield of methane biogas. Furthermore, different mathematical models for theoretical prediction of methane production using ANN and TDMIM methods are provided and compared to determine the most suitable one.

Materials and methods

In order to achieve the objectives of this study, the experiment was carried out in two phases. The first phase was bokashi Pre-treatment of sugarcane bagasse, while the second phase was anaerobic digestion for biogas production. In the first phase, bagasse undergoes a pre-treatment process using bokashi bran at room temperature for one month, one month and a half, and two months in an anaerobic environment. In the second phase, both pre-treated and untreated bagasse were combined with the same volume of sewage sludge and fermented under anaerobic conditions, and the production of biogas and methane were measured. Experimental data were summed then used to formulate two models, one depends on artificial neural networks and the other used a known models for methane production.

Substrates and inoculum

Sugarcane bagasse

Bagasse as an agricultural residue is classified as a type of lignocellulosic biomass that remains after juice extraction from sugar cane. The samples were collected from a sugar cane press, El-Sharkia Government, Egypt, and were teared and screened to achieve particles of 1 cm in size. Sugarcane bagasse is made up of the following: 74.98% carbohydrates, 1.52% Protein, 0.61% Lipid, and 117.63 C/N ratio. Consequently, significant economic advantages can be obtained in addition to considerable contributions toward environmental sustainability.

Sewage sludge

Samples of sewage sludge were gathered from an activated sludge wastewater treatment plant located in Ismailia Government, Egypt, then reserved at a temperature of 4.0 ± 0.5 degrees Celsius until they were ready to be used. The activated sludge was characterized by measurements of 20 g/l COD, 2.0% T.S., 71.4% TVS (percentage of TS), 6.35 C/N ratio, and a pH value of 7.10.

Experimental design

First phase: Bokashi pre-treatment of sugarcane bagasse

Bokashi bran and bucks’ preparation

Bokashi's preparation method was based on (Christel 2017). The ingredients utilized in producing bokashi bran include 1.8 kg of rice bran (sieved with a 2 mm sieve), 20 mL of EM1(manufactured by EMRO Malaysia Sdn Bhd), 20 ml molasses, and 900 mL water. EM1 and molasses were dissolved in water, prepared as a mixture then mixed with rice bran. The mixed ingredients were fermented in an anaerobic condition in a well-sealed bucket for two weeks and sun-dried.

Bokashi bucks were self-made using two buckets. The first buck (30 cm diameter) was drilled at the bottom with fifteen holes (10 mm diameter for every hole) before installing the other bucket (30.5 cm diameter) with a tap at the bottom of the bucket for leachate collection.

Bokashi applied

Typically, it is recommended to arrange the mixture with alternate layers of 2–3 tablespoons of bokashi bran over every 2 cm of bagasse until the top of the bucket, and for the best result, the bran is sprinkled evenly across the surface of bagasse. Each layer was compacted to remove as much air as possible, and the lid was wrapped tightly.

Pre-treatment process

The first stage of this study involved the pre-treatment of three bagasse samples using bokashi bran. The first sample underwent a treatment period of one month, the second sample was treated for one month and a half, and the third was treated for two months. Bagasse samples were filled into batch reactors and tightly sealed. After the treatment process, the energy of both the treated and untreated bagasse was measured.

Second phase: anaerobic digestion for biogas production:

Pre-treated and fresh bagasse samples were mixed with sludge and digested under anaerobic conditions, and both biogas and methane yield were measured during the experiment period. Every treatment was done three times frequently.

An anaerobic batch reactor was formed from a glass reactor that was associated with a gas collector via a polyvinyl chloride (PVC) tube. The biogas collector was linked to an open jar using a tube with a valve to observe the water volume generated from the biogas pressure produced. As shown in Fig. 1a, and to preserve a constant temperature of 35 ± 1 °C, the anaerobic reactors were positioned in a glass basin with a heater and thermostat. Five batch reactors (5 L volume) were used in this study (the first one for sewage sludge, the second for sewage with fresh bagasse, the third for sewage with treated bagasse one month, the fourth for sewage with treated bagasse one and half month and the last one for sewage with treated bagasse two month). The mixing ratio of sludge and bagasse (based on weight) was 14%, which was kept constant at all reactors, to achieve the recommended ratio of C/N for an anaerobic process from 21 to 35.

Figure 1
figure 1

a Batch anaerobic reactor schematic diagram. b a photograph of the used anaerobic batch reactors

During the experiment, it was important to shake flasks every day to ensure that the fermentation materials are sufficiently mixed. The pH values were in range from 7.1 to 7.3, and these values were suitable for an efficient performance and stability in the anaerobic process to obtain maximal biogas yield (Liu et al. 2008). Figure 1b shows a photograph of the used anaerobic batch reactors in this study.

Analytical methods

Based on the Standard Methods Examination of Water and Wastewater (Federation & Association 2005), TS, TVS, COD, N and C were obtained, while the pH value was measured using an auto-titrating pH meter (ep HI 98107 pocket-sized). Furthermore, carbohydrates, proteins, and lipids were measured and determined according to the method of Ebner et al. (2016).

Methane production and its composition

The biogas production and its composition were measured regularly during the methanogenesis stage. The methane yield was determined according to the German technical guideline VDI 4630 [32]. A water replacement device was used to measure the biogas volume, the methane and carbon dioxide percentage were measured in the gas analyzer (IMR 1400C).

The specific biogas and methane yields were usually converted to standard conditions 273 K and 1013 mbar. The measurement of biogas continues until an observed slight production.

Theoretical methane potential based on the organic components

The theoretical methane potential (BMPThOFC) can be estimated from the chemical of organic fraction composition, and this is a good assuming method, where non-convertible biomass compounds such as lignin and ash were considered.

The theoretical methane potential (BMPThOFC) (L of CH4 kg−1 VS) of fresh bagasse was calculated based on the stoichiometric conversion of organic fraction composition using a formula by (Di Girolamo et al. 2013) as shown in equation.

$${BMP}_{ThOFC}=415\times carbohydrate \%+496\times protein+1014\times lipid$$
(1)

The bagasse biodegradability was determined by comparing the theoretical methane potential with the cumulative methane production until the end of the incubation.

$$BD\%={BMP}_{end}/{BMP}_{ThOFC}\times 100$$
(2)

where BMP end (LCH4/kgVS) is the cumulative methane production until the end of the incubation, and BMPThOFC (LCH4/kgVS) is the theoretical methane potential.

Energy measurement after bokashi technology

The gross energy is similar to the heat, which emits from the complete oxidation of a material (Pond et al. 1995). The energy of fresh and treated bagasse was measured by an oxygen bomb calorimeter (IKA calorimeter C4000 adiabatic) according to DIN 51900.

The specific gross calorific value was calculated according to the following equation.

$$Gross energy\left(kJ/kg\right)\left(DM\right)\left(C\times \Delta T-QF\right)/\left(Mp\right)$$
(3)

where C is the heat capacity of the calorimeter system determined from benzoic acid calibration standards (J/k); ∆T is the measured temperature rise; QF is the sum of all foreign energies (wire and capsule (J)); Mp is the weight of the sample (g).

Energy measurement of methane product

The methane calorific value is 50 MJ/kg according to (Agency 2009), so it is 36 megajoules per cubic meter whereas the methane density = 0. 72 kg.m.−3

$$C.V=M.P\times FC$$
(4)

where C.V = Calorific value (KJ/kg), M.P = total methane production (L/kg), and Fc = conversion factor = 36 (MJ.m−3).

In the next two subsections, two methods of model creation will be presented and used in this work. Models were built depending on the experimental data of the 4 types of treated bagasse and fresh one.

Artificial neural networks (ANN)

ANN is one of artificial intelligence algorithms used to predict a model that expresses the input/output data collected from experiment. The model was built using two operation conditions (treatment type of bagasse, and number of days) as inputs and methane volume as output. When constructing an ANN model, it is crucial to take into account four specific features of the architecture that are significant in determining the final design of the network. Hidden layer’s number (r), number of neurons in each hidden layers \(({L}_{i}, i=\mathrm{1,2},\cdots , r)\), the training algorithm used to train the ANN model (trainbr, trainlm, trainbfg, traincgp, trainrp), and type of activation function in each of the layers is crucial as well. In the current study, five training algorithms are considered and compared, namely trainbr, trainlm, trainbfg, traincgp, and trainrp. These are built-in MATLAB functions, and their description is given in Table 4. With respect to the activation functions, we use tansig and purelin functions for the hidden layer and output layer, respectively.

Backpropagation is a technique used in training algorithms. This approach updates the network parameters (weights) while minimizing the error by first moving information from the input layer to the output layer and then moving it backward.

Equations 5, 6 express performance of the ANN model which are mean squared error (MSE) and coefficient of correlation (R).

$$MSE=\frac{\sum_{i=1}^{N}{\left({Ex}_{i}-{M}_{i}\right)}^{2} }{N}$$
(5)
$$R=\frac{\sum_{i=1}^{N}\left({Ex}_{i}-\overline{Ex }\right)\left({M}_{i}-\overline{M }\right)}{\sqrt{\sum_{i=1}^{N}{\left({Ex}_{i}-\overline{Ex }\right)}^{2}\sum_{i=1}^{N}{\left({M}_{i}-\overline{M }\right)}^{2}}}$$
(6)

where

$${Ex}_{i}:$$

\({M}_{i}\): Experimental value

Predicted value

\(\overline{\mathrm{M} }\): Mean of computed data

\(\overline{\mathrm{Ex} }\):

\(N\): Mean of experimental data

Number of datasets/models

A key performance metric in determining whether the model can be regarded as usable is the value of MSE, which offers information about the ANN model's correctness. It displays the variation between experimental data and expected (computed) values. The accuracy of the fit increases as the MSE value decreases. The R-score is used to assess and show how well the data fit the regression line. A value closer to 1 denotes a lower discrepancy between the observed data and the fitted values. R values vary from − 1 to 1.

Two-dimensional mathematical models (TDMM)

This part offered an innovative two-dimensional version for a collection of classical mathematical models that are believed to have strong conformance and high correlation to the current experimental data. The goal of the extension to the two-dimensional situation is to produce a simple equation that incorporates both the time (t) and experiment Id (I) as shown in Table 1 and represents the specific model. In the literature, three models have been found to conform to the experimental results in a satisfactory manner.

Table 1 Description of experimental data

The sigmoidal functions that relate the growth of methanogenic archaea in the biodigester with methane production are represented by the modified Gompertz model and the logistic function model. The transfer function (Donoso-Bravo et al., 2010) has also been utilized, proposing that methane production follows a first-order curve, with the highest rate occurring at the start and gradually decreasing to nearly zero at the conclusion of the experimental period.

In order to extend the two-dimensional modeling, a two-step curve fitting process was employed. During the first step, the model parameters that resulted in the best goodness of fit for each experiment were identified. The first step of the two-dimensional modeling approach resulted in a set of values that corresponded uniquely to the experiment ID (I). In the second step, a curve fitting was conducted to model the relationship between each parameter and its corresponding experiment ID (I) value. A polynomial function was utilized to accurately model the relationships between the parameter values and experiment IDs (I).

In the problem under investigation, bagasse was mixed with sludge after being treated by bokashi for determined periods, while the volume of the methane production was recorded until the production has become negligible. For mathematically modeling the methane production used as a function of both the time and experiment Id (I).

Modified Gompertz model (Dhamodharan et al. 2015)

$$y=P\times \mathit{exp}\left[-exp\left(\frac{\gamma \times e}{P}\times \left(L-t\right)+1\right)\right]$$
(7)

Logistic function model (Ware & Power 2017)

$$y=\frac{P}{1+exp\left(\frac{4\times \gamma \times \left(L-t\right)}{P}+2\right)}$$
(8)

Transfer function model (Li et al. 2012)

$$y=P\times \left(1-exp\left(-\frac{\gamma \times \left(t-L\right)}{P}\right)\right)$$
(9)

where P represents potential methane production (mL CH4 g−1), \(\gamma\) is the maximum rate of methane production (mL CH4 g−1 h−1), L is the lag time phase (h), y is the methane accumulated at time t, t is the measured time (h), and \(e=exp\left(1\right)\).

All the parameters in the above equations are evaluated by performing curve fitting by cftool in MATLAB R2018b to minimize the sum of the square errors (Montecchio et al. 2019) between the experimental data and computed methane production y by the above three models. The goodness of the parameter fit was diagnosed by SSE, correlation coefficient (R2).

Results and discussion

Anaerobic digestion of bagasse for biogas production:

The cumulative biogas production based on fresh matter [L/kg] has been summarized as observed from Fig. 2 for activated sludge and the co-digestion of sludge with the mixing of treated and untreated sugarcane. The results show that the biogas yield starts from the beginning of the experiment strongly, and this is related to the degradation of the soluble sugar in treated and untreated bagasse. The anaerobic digestion experiments were continuous for 140 days, whereas the experiment continued until the production became neglected.

Fig. 2
figure 2

Cumulative biogas production

It can be seen from the production figure that a shorter biogas production period is typically observed when the material has undergone a longer bokashi period before entering the biogas production stage. This is often attributed to the better preparation of bagasse for the digestion process. This agrees with (Kumar & Bai 2008) findings that the bokashi technology refers to employ effective microorganisms to digest the feedstocks, with a particular emphasis on applying these microorganisms to speed up and facilitate the decomposition process.

This matches with (Olasesan et al. 2022) who reported that during bokashi anaerobic fermentation the magical transformation of carbohydrates into either alcohol or organic acids, by dint of the wizardry of microorganisms like yeast or bacteria. This process has two prominent manifestations: one is the lactic acid, and the other is the alcoholic. As the result of glucose metabolism, pyruvate, undergoes a spellbinding metamorphosis by bacteria and yeast during fermentation. Lactic acid emerges as a result of the continuation of the transformation of pyruvate molecules crafted during the intricate glucose glycolysis, the existence of lactic acid makes digestion more palatable and easily. Thus, the bokashi technique leads to sugars dissolving which encourages bacteria growth.

Additionally, it was noted that the highest biogas production occurred with a mixture of sludge and bagasse treated for 1.5 months, with a production rate of 15.84 L/kg. This was followed by a mixture of sludge and bagasse treated for 2 months, which produced biogas at a rate of 13.08 L/kg. The third-highest rate was observed in a mixture of sludge and bagasse treated for 1 month, with a rate of 12.34 08 L/kg. In contrast, untreated bagasse produced biogas at a rate of 8.05 L/kg.

Assessing how using the bokashi technology on bagasse impacts the generation of methane was one of the aims of this study. In order to determine the actual methane yield from bagasse, the biogas production of sludge under identical conditions was deducted, and the results are presented in Fig. 3.

Fig. 3
figure 3

Methane production from fresh and treated bagasse

Bagasse that underwent treatment for one month had the greatest methane yield, followed by bagasse that was treated for 1.5 months. The bagasse that was treated for two months came in third place in terms of production, while the fresh bagasse had the lowest production. This matches with Arumugam et al. (2022) who reported that the basic action in bokashi technology is to utilize bokashi bran, which is low-cost. Bokashi bran plays a fundamental role in the process by introducing lactic acid bacteria to process in order to enhance the decomposition rate.

Figure 3 demonstrates how the use of bokashi technology enhances methane production, implying that treating the bagasse results in better preparation for the digestion process. This is consistent with Olle (2021) who reported that utilizing effective microorganisms (EM) in conjunction with the organic matter has several advantages as fermenting organic matter and producing nutrient-rich organic acids. There is a correlation between the duration of the bagasse treated and the decrease in methane production, as the longer, the bagasse is processed, the lower methane production of the bagasse, this corresponds to the reduction in energy that occurs during the storage period of bagasse.

The role and impact of organic components in the production of methane.:

Calculating the methane production with the biochemical methane potential method using the chemical composition of organic fraction allows the prediction of conceivable scenarios. Table 2 shows the theoretical methane potential according to each organic component in fresh bagasse and actual methane from Fresh and treated bagasse, which results from methanogenesis fermentation. The biodegradability of fresh bagasse was 32.88% from theoretical methane production. While became 75.04%, 74.16%, and 57.86% for bagasse after a month, a month and a half, and two months, respectively. These differences could have several reasons, one of them is the variation in the organic component’s degradation to intermediate products.

Table 2 Theoretical methane potential BMPThOFC and biodegradability

The variation between the theoretical and actual biochemical methane potential gives an idea of the bokashi period’s effect on the biodegradability of bagasse. As can be seen, the biochemical methane potential calculated methane production was close to the actual production from treated samples, as a consequence, increases the probability of experimental success.

The high results of treated bagasse compared to untreated also give a hint that the experiment to produce methane from the bagasse structure will be successful as well as worth trying, it’s seen that the use of pre-treatment bagasse for biogas production is perfectly promising in terms of energy production. There is also, however, a further point to be considered, the variable effect on methane yield depending on the bokashi incubation period.

Bokashi as technology leads to a variable effect on methane yield depending on the incubation period. Bagasse treated by bokashi technology after one month, 1.5 month, and two months achieved a significant gain in methane production (+ 128.18%, + 125.51%, + 75.95% vs. the untreated, respectively). Facing this raise in methane production, the modest biodegradability of Fresh bagasse (32.88% for untreated) was augmented up to 75.04% in treated bagasse after one month. There is no public assent about time and catalyst arrangement in pre-treatment composition, which is harmonious with the variation in results.

Energy balance at bokashi incubation and anaerobic digestion periods

There is insufficient research on energy balance during the bokashi incubation period until the final product of biogas to draw any firm conclusions about the energy conversion from fresh material until the biogas production stage. This paper is an overview of a preliminary attempt to follow-up the energy from the fresh stage through the bokashi storage stage for different periods to the biogas production stage.

During the bokashi incubation period, the gross energy of samples was measured by their complete oxidation while the gross energy was evaluated during the anaerobic digestion period by the methane production.

Table 3 highlights gross energy after different bokashi incubation periods which is inversely proportional to the length of the incubation period. As can be seen, the energy values which converted to methane increased with the bagasse-treated samples compared to the bagasse untreated sample. Results from samples treated by bokashi have been very encouraging. This result has further strengthened our conviction that bokashi technology is a promising pre-treatment to bagasse when used as a substrate for biogas. The bokashi technology makes bagasse more suitable for degradation by microorganisms and saves bagasse from Deterioration if stored in aerobic conditions.

Table 3 Gross energy (kJ/kg) for Solid and gas phase

Effect of anaerobic digestion on (Solids/COD) properties

Figures 4, 5, and 6 show the influent, effluent and reduction values of TS, TVS and COD, respectively. It is noticed that the initial TS, TVS, and COD contents increased by the addition of bagasse to the sludge. This is the result to the C/N contents of fresh bagasse being higher in the mixture than in the unmixed sludge.

Fig. 4
figure 4

Effect of anaerobic digestion on total solids

Fig. 5
figure 5

Effect of anaerobic digestion on total volatile solids

Fig. 6
figure 6

Effect of anaerobic digestion on COD

The reductions of TS were 25%, 40.8%, 48.9%, 63.4% and 51.3% at the reactor of sludge, sludge with fresh bagasse, sludge with treatment bagasse after one month, sludge with treatment bagasse after one and half month, finally sludge with treatment bagasse after two months, respectively. These results match with the cumulative biogas production results exhibited in Fig. 2.

The influent values of TVS were 1.5%, 3.8%, 3.2%, 3.5% and 3%, at the reactor of sludge, sludge with fresh bagasse, sludge with treatment bagasse after one month, sludge with treatment bagasse after one and half month, finally sludge with treatment bagasse after two months, respectively. These values dropped to 1%, 1.5%, 1.3%, 1% and 1%, respectively, as a result to the degradation of organic matter and conversion into biogas by anaerobic bacterial activation, which supports the researches of (Ware & Power 2017), (Gaur & Suthar 2017).

Figure 6 exhibits that the lowest reduction of COD was 45.0% at first reactor (sludge), while the higher reduction of COD was 82.2% at fourth reactor (sludge with treatment bagasse after one and half month) where the highest biogas production was obtained at this reactor as presented in Fig. 2.

ANN modeling of methane production

In the current experiment, the focus is on methane volume as the output of the experiment, while the type of sugarcane bagasse processing and the number of days (at which the measured amount of methane was formed) are taken into account as the two inputs to the experiment. ANN model is used to predict the amount of methane formed at any inputs that were not even considered during the experiment. Architecture of neural network is one of major task for finding the best model which predicts perfectly produced methane volume that is close to the experimental values of methane volume. The experimental data patterns (329 patterns) are divided into three portions: 60% for training, 20% validation, and 20% testing in all training algorithms except trainbr algorithm will split database as (67%) for training and (33%) for testing. In the case of "trainbr," the algorithm incorporates its own internal validation mechanism. Consequently, there is no necessity for a separate validation dataset since the purpose of validation is to assess whether the error on the validation set improves or deteriorates during the training process.

Comparative studies of five training algorithms (listed in Table 4) each with different topologies of neural networks are introduced in this section. Results are summarized in two tables: first table, Table 5 concerns with results of single hidden layer, and the second table, Table 6 surveys results of two hidden layers. Each table presents results of R and MSE of five training algorithms for different numbers of hidden neurons.

Table 4 Artificial neural networks training algorithms
Table 5 Comparison of different learning algorithms in single hidden layer neural networks
Table 6 Comparison of different learning algorithms in two hidden layers neural networks

Table 5 illustrates that the lowest of MSE achieved at hidden neurons but close to its value at 20 hidden neurons. The highest R value achieved after training the neural network is 0.999 by using Bayesian regularization backpropagation (trainbr) training algorithm in two cases of hidden neurons 20, 25 hidden neurons. Figure 7 presents the results of the regression for training, testing, and all data of trainbr algorithm at 25 hidden neurons.

Fig. 7
figure 7

Regression of single hidden layer neural network with 25 hidden neurons

Figure 8 displays the results of the regression for training, testing, and all data of trainbr algorithm when using 10 hidden neurons at the two hidden layers. From Table 6, we can conclude that the result of lowest MSE and highest R occurs when training the network by trainbr algorithm using 10 hidden neurons at the two hidden layers. This shows that there is not a relation between number of hidden neurons and the performance of model obtained from neural network. But trainbr algorithm has best results in all cases studied in Tables 5 and 6.

Fig. 8
figure 8

Regression of neural network with two hidden layers with 10 hidden neurons in each layer

The cause is hidden in trainbr's benefits for creating neural networks. For instance, there is a low probability that a neural network would be over-fit and over-trained; it is also unaffected by the network's size and only needs a little amount of data (Burden & Winkler 2009). Bayesian neural networks also produce results that are consistent with the data. Therefore, to create the ANN model for anaerobic digestion and aerobic process, the BR training algorithms were adopted.

Application of TDMMs to the experimental data

Results in this section are divided into two subsections. First is a comparison of three models of methane production surveyed in literature. Second subsection is based on the model that most fitting the experimental data depending on results obtained in first subsection and finds a two-dimensional model that predicts a volume of methane produced depending on the type of experiment (I) and the time(day) at which measure the amount of produced methane.

Comparison of the methane production models

Experimental data consist of 329 data points corresponding to five different bagasse treatments as illustrated in Table 1. Here, the curve fitting tool “cftool (X, Y)” in the MATLAB program (2018) using nonlinear least squares method is used to estimate P,\(\upgamma ,\mathrm{ L}\) in Eqs. (79) of the three methane production models. Table 7 illustrates values of parameter’s models of the different experiments shown in Table 1. Figure 9 shows curve fitting based on different three models for different experimental conditions.

Table 7 Comparison of applied models in data of sludge experiment
Fig. 9
figure 9

Curve fitting based on different three models for different experimental conditions: a pure sludge. Then sludge + bagasse after fermentation periods 0, 1, 1.5, 2 months in (b), (c), (d), and (e), respectively

Results show that Gompertz model outperforms other models in almost all experiments. Transfer model outperforms Gompertz model in only two experiments (sludge and sludge + bagasse after one-month experiments). So, values of parameters obtained by Gompertz model will be used to predict the two-dimensional mathematical models.

Two-dimensional mathematical models

In this section, the Gompertz model's parameter values will be used to determine two-dimensional mathematical models. The goal of this extension to the two-dimensional example is to offer an accessible equation that captures the specific model and contains both the time (t) and the experiment ID (I).

The parameters summarized in Table 8 are reliable in forming a two-dimensional mathematical model for methane production by means of the experiments presented in this paper.

Table 8 Parameters obtained by Gompertz model and presented in Table 7

Polynomial of the third degree is selected for parameters P, L and \(\upgamma\), respectively, as they each produced the best fitting results for the corresponding parameter.

The obtained equations for each parameter are as follows:

$$P\left(I\right)=-31.2633{ I}^{3}+100.045 {I}^{2}-73.2317 I+16.31$$
(10)
$$L\left(I\right)=-30.1533 {I}^{3}+95.37 {I}^{2}-68.8967 I+16.72$$
(11)
$$\gamma \left(I\right)= -0.1208 {I}^{3}+0.3355 {I}^{2}-0.1637 I+0.085$$
(12)

Substituting Eqs. (1012) into Eq. 3 yields the following 2D-Gompertz Model:

$$\mathrm{y}\left(I,t\right)=\left(-31.2633{ I}^{3}+100.045 {I}^{2}-73.2317 I+16.31\right)\times \mathrm{ exp}\left\{-\mathrm{exp}\left[\frac{\left(-0.1208 {I}^{3}+0.3355 {I}^{2}-0.1637 I+0.085\right) \times \mathrm{e}}{-31.2633{ I}^{3}+100.045 {I}^{2}-73.2317 I+16.31}\times \left(-30.1533 {I}^{3}+95.37 {I}^{2}-68.8967 I+16.72-\mathrm{t}\right)+1\right]\right\}$$
(13)

Equation 13 was plotted as a function of both t and I in Fig. 10, and MSE and R2 were calculated as 0.10646 and 0.99667, respectively.

Fig. 10
figure 10

Methane production modeling results that were obtained using Gompertz model

Conclusions

Sugarcane bagasse is a commonly obtainable agricultural waste and it has high energy potential. Producing biogas as an energy souse by anaerobic digest optimizes the exploitation of bagasse. Its complex structure has led to obstruction to the anaerobic digestion process, indicating that its degradability can be by a pre-treatment process. There is a lack of available literature on methane production from bagasse pre-treated.

Bokashi technology can be considered an emerging area of research for improving biomass digestion and its valorization for methane production and other bioproducts along with its positive impact on the environment and economy.

The research aimed to apply the bokashi technology as a pre-treatment for bagasse in order to improve its degradability. The target of this treatment gets the highest possible biomethane outputs from bagasse in a brief period. Hence, it can promote methane production from locally available biomass and organic materials for benefiting both the environment and the economy.

At first, bagasse is pre-treated with bokashi bran for three different time periods one, one and a half, and two months at room temperature under anaerobic conditions. Later, anaerobic co-digestion for fresh and untreated bagasse was performed at 37 °C in batch experience with sewage sludge.

This research demonstrated that the maximum ultimate yield of methane was 243.80 LCH4/kgVS after one month treated, followed by 240.94 LCH4/kgVS after 1.5 months, 187.99 LCH4/kgVS after two months, and the lowest one was 106.84 LCH4/kgVS from fresh bagasse. Although the potential energy in the fresh bagasse was higher than treated. Accordingly, it has been observed that applying bokashi technology on sugarcane bagasse appears to be strongly effective as it can successfully break down the fiber structures, leading to a significant increase in methane production yield. Further, it has been observed that a longer term of bokashi technology before the biogas production stage leads to a shorter biogas production period. This is thought to be due to the enhanced preparation of the bagasse substrate for the digestion process and for extreme recovery of energy. In conclusion, sugarcane bagasse can be considered a potential source of methane production after undergoing appropriate selective pre-treatment. Further research is required to determine suitable pre-treatments to achieve maximum sugarcane bagasse exploitation.

As well as improvement of biogas yield recorded, there were improvement of reduction of TS, TVS, COD when mixing treated bagasse with sludge. The lowest reductions of TS, TVS and COD were 25.5%, 33.30% and 45%, respectively, recorded at sludge without bagasse. On the other hand, these values increased to 63.40%, 71.40% and 82.22% at rector of mixing sludge with one and half month treated bagasse.

Furthermore, two different approaches are used to construct model that predicts the volume of methane produced.

In comparison to the TDMM, the model created by ANN produced high correlation coefficients, showing that it is the most effective method for simulating the methane production process, whereas, in ANN, all experimental data are trained to find the model that fitted experimental data. Unlike TDMM, the model is obtained in two stages: in the first, data are entered for each separate experiment to find the model parameters, and then, data are fitted it to find the TDMM in the second stage.