Skip to Content
SeparationsSeparations
  • Article
  • Open Access

26 November 2026

22 Pages

Comparative Evaluation of Bayesian Neural Network-Assisted Optimization, RSM, and ENN for Extraction of Total Phenolic and Flavonoid Contents from Echinocactus grusonii

,
,
,
and
1
School of Electrical Engineering, Institute of Engineering, Suranaree University of Technology, Nakhon Ratchasima 30000, Thailand
2
School of Food Technology, Health and Wellness research Unit, Institute of Agricultural Technology, Nakhon Ratchasima 30000, Thailand
*
Authors to whom correspondence should be addressed.

Abstract

Efficient extraction of bioactive polyphenols from natural matrices is a critical prerequisite for downstream nutraceutical and pharmaceutical applications. This study evaluated and optimized the solvent extraction of phenolic and flavonoid compounds from Golden Barrel Cactus (Echinocactus grusonii) using chloroform. A three-variable, three-level Box–Behnken Design (BBD) was implemented across temperature (X1: 40–70 °C), time (X2: 30–60 min), and solid-to-solvent ratio (X3: 25–75% w/v). Predictive capabilities were compared across traditional Response Surface Methodology (RSM), Ensemble Neural Networks (ENNs), and Bayesian Neural Networks (BNNs). Analysis of variance (ANOVA) revealed that the solid-to-solvent ratio (X3) served as the primary governing variable (p < 0.001) driving mass transfer kinetics, whereas temperature and time exerted non-significant main effects (p > 0.05) within the tested domain. Peak recovery was achieved at 70 °C for 45 min at a 75% w/v ratio, yielding 33.34 µg GAE/mg raw material of total phenolic content (TPC) and 21.29 µg CE/mg raw material of total flavonoid content (TFC). BNN demonstrated superior predictive accuracy over RSM and ENN, achieving cross-validated root-mean square error (LOOCV RMSE) values of 0.428 µg GAE/mgRM for TPC, 0.145 µg CE/mgRM for TFC, and 0.162% for extraction yield, while robustly modeling epistemic uncertainty across the design domain. These findings establish BNN-assisted optimization as a high-precision framework for optimizing botanical separation processes prior to scale-up.

1. Introduction

The native Mexican plant Echinocactus grusonii (Golden Barrel Cactus or GBC), the habitat of which ranges from San Luis Potosi to Hidalgo, eastern and central Mexico, is highly valued for its rich phytochemical profile, which includes key bioactive compounds such as lutein, chlorophylls, phenolic acids, flavonoids, and betalains. These compounds belong to the broader category of phenolic constituents found commonly in plant-derived foods. A recent analysis revealed that the extract from 3-year-old GBC plants contains a higher bioactive content and superior antioxidant activity compared with that from 6-year-old plants [1,2,3]. This research focuses on characterizing phenolic compounds in GBC crude extract and evaluating their effectiveness as antioxidant agents to identify their potential as active ingredients in future medicines. Unlike conventional herbaceous leaves or soft plant tissues, xerophytic succulents such as Echinocactus grusonii present a highly complex, multi-layered physiological barrier to solid–liquid extraction. The exterior tissue is armored with a thick, hydrophobic cuticular layer composed of cross-linked cutin matrix polymers and embedded epicuticular waxes, beneath which lies a dense parenchyma network heavily enriched with viscoelastic polysaccharide mucilage. During extraction, these structural features impose significant non-linear mass transfer resistance: the outer waxy cuticle severely restricts solvent wetting and initial intra-particle penetration, while internal mucilaginous hydrocolloids induce localized swelling and variable boundary-layer viscosity. Consequently, solute diffusion across this matrix departs from classic isotropic Fickian behavior, generating localized concentration gradients and sharp non-linear responses across temperature and solvent ratio boundaries. Standard second-order polynomial models, such as Response Surface Methodology (RSM), assume a smooth, quadratic response surface and frequently fail to capture these boundary-driven non-linearities, resulting in elevated residual errors and poor predictive reliability near extreme operational limits.
The extraction of bioactive compounds from medicinal plants is a critical step in drug discovery and the production of nutraceuticals. This complex process is affected by multiple variables (e.g., solvent type, temperature, time, solvent-to-solid ratio) that must be precisely optimized to maximize the yield of target compounds while minimizing degradation.
To overcome the rigid quadratic assumptions of Response Surface Methodology (RSM) when modeling non-linear extraction kinetics, machine learning surrogates offer a powerful alternative. Unlike standard Artificial Neural Networks (ANNs) or Ensemble Neural Networks (ENNs) which output deterministic point estimates, Bayesian Neural Networks (BNNs) introduce probability distributions over synaptic network weights. This probabilistic formulation allows BNNs to inherently quantify epistemic uncertainty across sparse experimental domains, providing well-calibrated confidence boundaries essential for reliable process optimization and scale-up [4,5,6,7,8].
In summary, the literature supports the increasing adoption of Bayesian-driven machine learning in optimizing complex biological and chemical processes. The integration of Bayesian Neural Networks offers a powerful tool providing both the modeling flexibility of deep learning and the probabilistic uncertainty quantification essential for reliable, cost-efficient optimization of medicinal plant extraction parameters. To maximize the yield of bioactive compounds in Golden Barrel Cactus extract, this research focuses on optimizing the extraction conditions of this plant. Response Surface Methodology (RSM) is employed alongside a Bayesian Neural Network and an Ensemble Neural Network (ENN) to systematically determine the extraction conditions leading to the highest yield and greatest total phenolic and flavonoid contents while simultaneously curtailing product quality deterioration. This work contributes directly to the advancement of sustainable and high-efficacy extraction strategies for the conservation of bioactive compounds from natural products.

2. Materials and Methods

Analytical-grade reagents, specifically gallic acid, catechin, Folin–Ciocalteu phenol reagent, sodium nitrite (NaNO2), anhydrous sodium carbonate (Na2CO3), aluminum chloride (AlCl3), and pH 4.6 acetate buffer, were sourced from Sigma–Aldrich Co. (St. Louis, MO, USA). Chloroform (analytical grade, ≥99.8%), ethanol, and organic solvents were acquired from Mallinckrodt-Baker (Phillipsburg, NJ, USA).

2.1. GBC Preparation

A 3-year-old Echinocactus grusonii (Golden Barrel Cactus), collected from Uncle Chorn’s Cabin Garden, Pathum Thani, Thailand, during the October–November 2024 period, was utilized as the starting material. The preparation involved several steps: the GBC specimens were initially washed, trimmed, and sectioned. These sections were subsequently spread onto trays and dried at 60 °C for 13 h. To prepare the final experimental substance, the dried material was milled into a powder and passed through a 0.2 mm sieve. The resulting powder was then stored in vacuum packaging at −20 °C to maintain its integrity for future experimental use Chaicharoenaudomrung et al. [1].

2.2. Total Phenolic Content

An adaptation of the Folin–Ciocalteu method was employed to evaluate the concentration of soluble phenolics. Aliquots (20 μL) of the extracts or standards were diluted with deionized water and reacted with 100 μL of Folin–Ciocalteu reagent. Subsequently, 300 μL of 2% Na2CO3 was added. The solution was incubated for 2 h to ensure the blue complex reached peak intensity. Absorbance readings were taken at 765 nm, with final concentrations expressed as gallic acid equivalents (GAE) based on a standard curve [9]. It should be noted that the Folin–Ciocalteu assay measures the aggregate colorimetric reducing capacity of soluble phenolic compounds rather than quantifying individual, isolated phenolic species. Analytical quantification was performed using a reagent blank (containing all assay components except the sample or standard extract) to correct baseline absorbance at 765 nm. Gallic acid was utilized as the reference standard, prepared across a linear calibration range of 500 mg/mL with a high coefficient of determination (R2 = 0.995). To eliminate baseline interference from lipophilic pigments (such as chlorophylls) and non-phenolic reducing substances present in chloroform extracts, sample-specific background blanks (extract + solvent without Folin–Ciocalteu reagent) were measured at 765 nm and subtracted prior to concentration calculation. Extract samples were appropriately diluted to ensure absorbance readings fell within the strict linearity of the standard curve. Final concentrations were normalized against the dry weight of the starting material and expressed as micrograms of gallic acid equivalents per milligram of raw material (mg GAE/mg RM).

2.3. Total Flavonoid Content

Total flavonoid content was determined using the aluminum chloride colorimetric assay, as described by Prasongdee et al. and Posridee et al. [9], with catechin serving as the reference standard. The reaction was initiated by combining 250 μL of the extract with 1.25 mL of deionized water and 75 μL of NaNO2. Following a 6 min incubation, 150 μL of 10% AlCl3 was introduced, followed by the addition of 0.5 mL of 1 M NaOH and 275 μL of deionized water five minutes later. The mixture was incubated for an additional 5 min to allow the pink flavonoid–aluminum complex to stabilize. Absorbance was recorded at 510 nm, and concentrations were calculated using a catechin calibration curve and expressed as catechin equivalents (CE). Background interference from intrinsic lipid coloration was controlled by preparing sample background blanks containing extract and solvent without AlCl3, ensuring that absorbance at 510 nm reflected only true aluminum-flavonoid complexation. Similarly, the aluminum chloride colorimetric assay evaluates the aggregate formation of acid-stable complexes between aluminum chloride and the C-4 keto groups along with C-3 or C-5 hydroxyl groups of flavones and flavanols, serving as an estimate of total flavonoid content rather than individual compound profiling. Reagent blanks were prepared omitting aluminum chloride to correct for baseline background interference. Catechin served as the reference standard, established over a linear calibration range with an acceptable coefficient of determination (R2 = 0.994). Extract dilutions were optimized to maintain sample absorbance within the validated linear range at 510 nm. Computed values were standardized against raw material weight and expressed as micrograms of catechin equivalents per milligram of raw material (mg CE/mg RM).

2.4. GBC Extraction Conditions

Chloroform was selected as the primary extraction solvent for this deep-learning optimization framework to preferentially isolate moderately polar and lipophilic bioactive components—such as aglycones, methoxylated flavonoids, and hydrophobic phenolic acids—which are tightly bound within the waxy cuticle and lipid-rich tissue matrices characteristic of xerophytic cacti like Echinocactus grusonii. While non-chlorinated, green solvents (such as aqueous ethanol systems) are optimal for maximizing bulk total phenolic content, chloroform serves a vital methodological role by establishing baseline mass transfer kinetics and recovery thresholds for lipophilic fractions that are poorly solubilized by polar green solvents alone. This targeted organic extraction complements our broader comparative screening of green extraction media, providing a rigorous foundational dataset for subsequent process scale-up and solvent substitution. To pinpoint the most favorable extraction parameters, Response Surface Methodology (RSM), a recognized optimization tool, was utilized. The objective of this methodology was to maximize three critical responses: extraction yield, total phenolic content, and total flavonoid content. Chloroform was selected as the extraction solvent to preferentially isolate moderately polar and lipophilic bioactive components such as aglycones, methoxylated flavonoids, and hydrophobic phenolic acids which are commonly bound within the waxy cuticle and lipid-rich tissue matrices of xerophytic cacti like Echinocactus grusonii. We examined the effect of three independent variables on the outcomes: temperature (X1: 40, 55, and 70 °C), time (X2: 30, 45, and 60 min), and GBC-to-chloroform solvent ratio (X3: 25, 50, and 75 (% w/v)). A Box–Behnken design was implemented to define the experimental matrix and randomize the run order. The data collected were subsequently processed via regression analysis. The levels of the independent variables are detailed in Table 1.
Table 1. Encoded and coded levels of independent variables used in the experimental design.
The Box–Behnken design (BBD) comprised 15 experimental runs, including three center-point replicates to estimate pure error and experimental repeatability. Rather than optimizing each response in isolation, a multi-response optimization framework was implemented simultaneously across total phenolic content (Y1), total flavonoid content (Y2), and extraction yield (Y3). The Bayesian Neural Network (BNN) surrogate models evaluated the objective functions concurrently, utilizing predictive mean distributions and trade-off analysis to navigate the conflicting dynamics between bulk mass recovery and phytochemical concentration.

2.5. Experimental Validation of Optimal Conditions

To optimize the extraction yield (% w/w), total phenolic content (TPC), and total flavonoid content (TFC), a model-based optimization strategy was implemented. The predictive accuracy of the resulting model was verified through triplicate extraction trials conducted using the parameters calculated to be optimal. These validation experiments were performed under conditions distinct from those used during the initial model construction phase to ensure robust performance.

2.5.1. Bayesian Neural Network

The extraction process was optimized using a computationally efficient, iterative approach based on Bayesian Optimization (BO), with a Bayesian Neural Network (BNN) serving as the surrogate model [10]. This methodology was employed to maximize the yield of the target bioactive compound f(x) by efficiently navigating the high-dimensional parameter space X [5].
To establish a high-precision predictive framework across the non-linear extraction landscape of Echinocactus grusonii, a Bayesian Neural Network (BNN) was deployed as a global probabilistic surrogate model. Unlike traditional deterministic artificial neural networks (ANNs) or quadratic Response Surface Methodology (RSM), which output scalar point estimates, the BNN places a probability distribution over its synaptic weights w ∼ N 0 , σ 2 . This Bayesian formulation enables the model to simultaneously map multi-variable mass transfer relationships f(x) and quantify epistemic uncertainty σ(x) across the experimental domain:
y ˆ x = μ x ± k ⋅ σ x
where μ(x) represents the predicted mean response (TPC, TFC, or Yield %), σ(x) denotes the epistemic uncertainty (standard deviation) reflecting parameter confidence in sparse data regions, and k represents the coverage factor for confidence interval calibration.

2.5.2. Multi-Objective Global Optimization Procedure

The 15 experimental runs generated from the Box–Behnken Design (BBD) served as the foundational dataset D = x i , y i i = 1 15 for model training. Rather than conducting sequential wet-lab experimental iterations, global process optimization was executed in silico by evaluating the trained BNN surrogate model across a dense grid of candidate parameter combinations within the bounded input domain. The multi-objective trade-off between maximizing bioactive yields (TPC and TFC) and managing bulk extract mass recovery was resolved using an Upper Confidence Bound (UCB) scalarization function:
x * = arg max x ∈ X μ composite x + κ ⋅ σ composite x
where κ = 2.57 was selected to balance predicted yield exploitation with low-uncertainty region selection. This approach identified global operational optima while accounting for prediction variance across the design boundaries [11].

2.5.3. Ensemble Neural Network

An Ensemble Neural Network (ENN) functions like a “committee of experts”, where the collective intelligence of multiple models consistently outperforms any single individual. Instead of relying on one network that might become stuck on a specific error or biased perspective, a diverse group of “base learners” is trained to look at the problem from different angles. This approach effectively cancels out the random noise and statistical flukes that plague individual models, ensuring that even if one network misses the mark, the consensus of the group pulls the final prediction back toward the truth. By aggregating these different viewpoints through voting or averaging, the ensemble creates a more stable, robust, and accurate solution that can map complex patterns far better than a lone model ever could.
Ensemble Neural Networks utilize various combination strategies to synthesize a final output, ranging from majority voting in classification tasks, where the most frequent class label is selected, to simple or weighted averaging in regression, which calculates the mean or a performance-prioritized average of individual predictions [12]. Advanced methods such as soft voting further refine this by averaging the predicted probabilities or confidence levels across the ensemble to capture more nuanced data patterns [13]. However, these performance gains come with significant practical trade-offs, as the computational cost of training and the memory requirements for storing multiple large models can be prohibitive for resource-constrained environments such as mobile devices, while the increased architectural complexity makes the overall system more difficult to maintain compared with a single-model pipeline [14,15].
Ensemble Neural Networks (ENNs) synthesize predictions by aggregating outputs across a committee of diverse base learners to reduce model variance. By averaging predictions from multiple neural networks trained with distinct random weight initializations and bootstrap-aggregated data subsets, the ensemble mitigates statistical flukes associated with single deterministic models. In regression tasks, simple committee averaging provides a stable, aggregated estimate that captures non-linear response patterns across the experimental design domain [16,17,18].

2.5.4. Machine Learning Model Architectures and Hyperparameters

To ensure complete reproducibility and transparent uncertainty quantification, the architectural configurations and training hyperparameters for both the Bayesian Neural Network (BNN) and Ensemble Neural Network (ENN) were standardized as follows. Given the constraints of the 15-run experimental dataset, shallow network architectures combined with rigorous regularization were implemented to mitigate overfitting.
Bayesian Neural Network (BNN) Configuration: The BNN was structured as a fully connected feedforward neural network comprising two hidden layers with 8 and 8 neurons, respectively, utilizing hyperbolic tangent (tanh) activation functions to capture smooth non-linear mass transfer gradients. To inherently model epistemic uncertainty, a zero-mean isotropic Gaussian prior distribution, N 0 , σ 2 , was placed over all network weights and biases. Posterior distributions were approximated using Variational Inference (specifically via the Bayes-by-Backprop framework). The model was optimized using the Adam optimizer with a learning rate of 0.001 and trained for 1000 epochs.
Ensemble Neural Network (ENN) Configuration: The ENN comprised a committee of 10 deterministic feedforward base learners. To induce architectural and functional diversity across the committee, each base learner was initialized with distinct random seed weight configurations and trained on bootstrap-aggregated subsets of the training data. Each base network featured two hidden layers with 10 neurons each, utilizing Rectified Linear Unit (ReLU) activation functions. Training was executed using the Adam optimizer with a learning rate of 0.005 for 500 epochs per member. Final estimations were synthesized using simple averaging across all base learners to minimize prediction variance.
Given the constraints of the 15-run Box–Behnken design, strict structural regularization was implemented to prevent over-parameterization and data memorization. Both architectures were intentionally kept shallow, comprising two compact hidden layers (8–8 neurons for BNN and 10–10 for ENN base learners) to maintain a high degree of degrees of freedom relative to the small sample size. Furthermore, for the BNN, complexity penalization was handled intrinsically via Variational Inference (Bayes-by-Backprop), where a zero-mean isotropic Gaussian prior, N 0 , σ 2 , placed over all synaptic weights and biases actively regularized the parameter space, discouraging overly complex mapping functions (Table 2).
Table 2. Architectural configurations and hyperparameter settings for BNN and ENN predictive models.

2.5.5. Cross-Validation and Overfitting Prevention

Given the constraints of the 15-run Box–Behnken design, training deep learning architectures (BNN and ENN) carries an inherent risk of data memorization and over-optimistic performance metrics. To strictly prevent overfitting and ensure out-of-sample generalization, a rigorous Leave-One-Out Cross-Validation (LOOCV) strategy was implemented for both machine learning pipelines. In this protocol, the model was iteratively trained on 14 experimental runs and validated on the single excluded run, repeating across all 15 permutations. For the Bayesian Neural Network, generalization was further safeguarded by the marginalization over weight distributions provided by Variational Inference, which intrinsically penalizes overly complex parameter spaces. Similarly, ensemble variance reduction and bagging mechanisms in the ENN prevented individual base learners from locking onto experimental noise. Model performance was evaluated using cross-validated root mean square error (RMSE) and cross-validated determination coefficients (R2) rather than training set metrics alone.
To ensure that model performance metrics were not inflated by data leakage, a strict Leave-One-Out Cross-Validation (LOOCV) protocol was enforced across all 15 permutations. Hyperparameter configurations (such as learning rates, epoch counts, and network topologies) were established a priori based on theoretical convergence criteria and fixed prior to cross-validation, ensuring that hyperparameters were chosen entirely independently of the held-out test observations. Within each of the 15 LOOCV iterations, the surrogate models were trained exclusively on the remaining 14 runs while the single excluded observation was kept entirely isolated to serve as an unseen validation point. For the ENN, bagging and bootstrap aggregation were performed independently within training partitions to eliminate selection bias, ensuring that the reported root mean square error (RMSE) and R2 metrics reflect true out-of-sample generalization capacity rather than in-sample memorization.

2.6. Statistical Analysis

All experiments, including the final validations of the optimal conditions determined by the Bayesian Neural Network, were performed in triplicate. The results are presented as the mean and standard deviation (on a dry basis). The experimental data were statistically analyzed using a one-way Analysis of Variance (ANOVA), and significant differences were further explored via a post hoc test (Tukey’s HSD). All statistical computations were conducted using SPSS® software Version 17 (SPSS Inc., Chicago, IL, USA).

3. Results

3.1. Validation of the Experimental Design

Across the experimental runs, the GBC extracts exhibited phenolic content as high as 33.34 µg GAE/mg raw material (mgRM) and flavonoid levels that reached 21.29 µg CE/mgRM. The optimal extraction conditions were identified as 70 °C for 45 min at a 75% w/v ratio. The results of this analysis are presented in Table 3 and Table 4 and the RSM results are visualized in Figure 1 and Figure 2. A correlation between the independent extraction factors and total phenolic yield was established using stepwise regression analysis. The mathematical representations of these relationships, along with relevant statistical indicators, are detailed in Table 5 and Table 6.
Table 3. Experimental values, in-sample fitted values, and out-of-sample LOOCV predictions with 95% Prediction Intervals (PI) for Total Phenolic Content (TPC) and Total Flavonoid Content (TFC) in Echinocactus grusonii crude extract.
Table 4. Complete experimental design matrix with observed values, in-sample fitted values (ŷ_fit), and out-of-sample LOOCV predictions (ŷ_LOOCV) with 95% Prediction Intervals [PI_95%] for extraction yield percentage (Y3, Yield %) of Echinocactus grusonii crude extract obtained by Box–Behnken Design (BBD).
Figure 1. Response surface plots depicting the interactive effects of total phenolic content.
Figure 2. Response surface plots depicting the interactive effects of total flavonoid content.
Table 5. Model summary and analysis of variance (ANOVA) of TPC and TFC in GBC extract.
Table 6. Model summary and analysis of variance (ANOVA) of yield percentage of GBC extract.
The performance of the Bayesian Neural Network and ENN in predicting TPC, TFC, and extraction yield is documented in Table 3 and Table 4, in which the experimental conditions are compared with the model-generated values for each bioactive recovery metric. The GBC extraction yields fluctuated between 1.71% and 6.13% (w/w), depending on the parameters employed. The phytochemical analysis revealed that TPC and TF concentrations reached peaks of 33.34 µg GAE/mgRM and 21.29 µg CE/mgRM, respectively, under the conditions defined in Run 12 (70 °C, 45 min, 75% w/v). Conversely, the minimum number of phenolics recovered was observed to be 1.65 µg GAE/mgRM (Run 7).
The experimental values for both responses showed no significant difference from the predicted values from the BNN and ENN models (p > 0.05). As shown in Table 3 and Table 4, these findings validate the experimental parameters and establish the reliability of RSM and neural network-based modeling techniques.
To systematically evaluate the influence of the extraction parameters on bioactive compound recovery, Response Surface Methodology (RSM) was employed. The Analysis of Variance (ANOVA) for the fitted regression models of Total Phenolic Content (TPC) and Total Flavonoids (TFC) from Golden Barrel Cactus (GBC) extract is summarized in Table 5.
To determine the ideal extraction conditions across the multi-response landscape, BNN surrogate predictions were analyzed alongside the response correlation matrix. While bulk extraction yield favored lower solid-to-solvent ratios, both total phenolic and flavonoid contents peaked sharply at the upper boundary of factor X3 (75% w/v) and temperature (70 °C). The BNN-driven optimization successfully balanced these trade-offs—identifying Run 12 (70 °C, 45 min, 75% w/v) as the global optimum that maximizes bioactive recovery (33.34 µg GAE/mg RM for TPC and 21.29 µg CE/mg RM for TFC) while robustly accounting for prediction uncertainty across the experimental domain.
The quadratic regression models demonstrated high statistical significance for both TPC (F = 85.38, p < 0.0001) and TFC (F = 241.34, p < 0.0001), confirming that the empirical models successfully describe the relationship between the independent variables and responses. The high coefficients of determination (R2 = 0.9935 for TPC; R2 = 0.9977 for TFC) and corresponding adjusted coefficients ( R adj 2 = 0.9819 and 0.9936, respectively) indicate that over 98% of the variability in the extraction yields is accounted for by the models. Furthermore, the non-significant Lack of Fit values (p = 0.2907 for TPC; p = 0.2502 for TFC) verify model adequacy, confirming that unexplained systematic variance is minimal. Low coefficients of variation (C.V. % = 10.77% for TPC and 5.60% for TFC) alongside high adequate precision values (25.89 for TPC and 43.25 for TFC) further reflect high experimental repeatability and signal clarity well above the recommended threshold of 4.
Regarding individual factor effects, variable C-X3 emerged as the dominant linear predictor for both TPC (F = 714.23, p < 0.0001) and TFC (F = 2084.49, p < 0.0001), establishing it as the primary controlling process variable governing extraction efficiency. In contrast, linear terms A-X1 and B-X2 did not exert a statistically significant influence on either response (p > 0.05). For TFC, a pronounced non-linear relationship was observed through the highly significant quadratic term C2 (F = 70.21, p = 0.0004), indicating curvature and the presence of a distinct optimal point along factor C’s axis. Because two-factor interactive terms (AB, AC, BC) were statistically insignificant (p > 0.05), model refinement via elimination of non-significant terms can be executed to simplify the regression equations without sacrificing predictive reliability during subsequent multi-objective optimization (Table 6, Table 7 and Table 8).
Table 7. Comprehensive statistical performance summary comparing in-sample goodness-of-fit (RMSE_fit) and out-of-sample predictive generalization (RMSE_LOOCV) across RSM, ENN, and BNN models.
Table 8. Independent Experimental Validation of Predicted Optimal Extraction Conditions. Optimal conditions: 70 °C, 45 min, 75% w/v (n = 3 independent verification trials).

3.2. Response Surface Analysis and Predictive Regression Models

Following the statistical optimization workflow described by Oonsivilai et al. [19], analysis of variance (ANOVA) and multiple regression were conducted to quantify the effects of extraction temperature (X1, °C), extraction time (X2, min), and GBC-to-solvent ratio (X3, % w/v) on total phenolic content (TPC), total flavonoid content (TFC), and extraction yield. Across all three responses, the GBC-to-solvent ratio (X3) was the sole statistically significant factor (p < 0.05), whereas neither temperature (X1) nor duration (X2) produced significant variation (p > 0.05). Furthermore, non-significant lack-of-fit values (p > 0.05) across every model confirmed that the fitted surfaces accurately represent the experimental domain without systematic error. Three-dimensional response surface plots (Figure 1, Figure 2 and Figure 3) were generated from the fitted models to visualize factor interactions. Stepwise regression selection (Table 4 and Table 5) yielded distinct polynomial orders depending on the response variable.
Figure 3. Response surface plots depicting the interactive effects of yield percentage.

3.2.1. Dataset Preparation and Preprocessing for Deep Learning Modeling

To evaluate nonlinear factor relationships beyond second-order polynomial constraints, the experimental dataset obtained from the Box–Behnken matrix was structured for deep learning model (DLM) training following the hybrid framework of Oonsivilai et al. [19]. The input feature matrix comprised the three extraction variables, temperature (X1), extraction time (X2), and GBC-to-solvent ratio (X3), mapped against the corresponding experimental responses (TPC, TFC, and extraction yield) across [insert total number of runs/replicates, e.g., 17 experimental runs/51 triplicate observations]. Prior to network training, all input and target variables were normalized using [insert method, e.g., min–max scaling to the range [0, 1]/Z-score standardization] to eliminate scale discrepancies across differing measurement units. The preprocessed dataset was subsequently partitioned into [insert split, e.g., 70% training, 15% validation, and 15% testing subsets] to prevent overfitting and evaluate predictive generalization across the extraction design space (Figure 4, Figure 5, Figure 6 and Figure 7).
Figure 4. A plot of predicted and experimental values for total phenolic content of GBC crude extract using RSM, BNN, and ENN.
Figure 5. A plot of predicted and experimental values for total flavonoid content of GBC crude extract using RSM, BNN, and ENN.
Figure 6. A plot of predicted and experimental values for yield of GBC crude extract using RSM, BNN, and ENN.
Figure 7. A plot of the correlation matrix of responses for total phenolic content, total flavonoid content, and yield percentage under extraction conditions.

3.2.2. Bioactive Compound Recovery (TPC and TFC)

Both phenolic and flavonoid responses required full second-order quadratic models (Table 4). Driven primarily by strong positive linear and quadratic contributions from X3, Equation (2) accounted for 99.35% of the variance in TPC (R2 = 0.9935), while Equation (3) explained 99.77% of the variance in TFC (R2 = 0.9977).
TPC = 10.93 + 0.5175 X 1 − 0.1113 X 2 + 13.61 X 3 − 0.0425 X 1 X 2 + 1.50 X 1 X 3 + 0.0450 X 2 X 3 + 0.2750 X 1 2 − 0.7850 X 2 2 + 5.10 X 3 2
TFC = 8.89 + 0.2687 X 1 + 0.0912 X 2 + 9.16 X 3 + 0.5625 X 1 X 2 + 0.0350 X 1 X 3 + 0.6550 X 2 X 3 + 0.3421 X 1 2 − 0.5079 X 2 2 + 2.47 X 3 2

3.2.3. Overall Extraction Yield

Stepwise elimination excluded all interaction and quadratic terms as statistically negligible (Table 5), reducing yield prediction to the first-order linear relationship in Equation (4) (R2 = 0.8157). Unlike bioactive recovery, yield exhibited an inverse linear dependence on X3 (−1.52), indicating that higher solid-to-solvent ratios reduced total extractable mass:
Yield = 3.31 + 0.3587 X 1 + 0.0575 X 2 − 1.52 X 3

3.2.4. Data Acquisition and Preprocessing for Deep Learning Machines

Optimizing extraction conditions within a laboratory setting can be a cumbersome and time-consuming endeavor, particularly when multiple variables are involved, each possessing various levels. The Box–Behnken design serves as a prevalent strategy for streamlining this process by minimizing the required number of experiments. However, recent advancements in deep learning machines (DLMs) have demonstrated their superiority over Response Surface Methodology (RSM) in achieving superior optimization outcomes (Figure 4, Figure 5, Figure 6 and Figure 7).
The correlation matrix highlights two central dynamics governing the extraction behavior of the bioactive compounds: a near-perfect co-extraction of phenolic constituents alongside a pronounced trade-off between crude quantity and phytochemical quality.
The strong positive correlation between TPC and TFC (r = 0.99) demonstrates that flavonoids represent the principal polyphenolic constituent within the matrix. Because these classes of secondary metabolites share similar polarities and structural characteristics, they solubilize symmetrically under identical process conditions. From a process design perspective, this operational alignment indicates that optimizing parameters to recover total phenolics will simultaneously maximize flavonoid content, making separate optimization pathways for each group redundant.
However, a marked divergence occurs when comparing bioactive recovery against overall extraction yield. The strong inverse relationships observed between crude yield and both TPC (r = −0.80) and TFC (r = −0.83) reveal that higher total mass recovery leads to a dilution of active compounds. Extraction conditions that maximize bulk mass recovery such as specific solid-to-solvent ratios or extended extraction durations tend to non-selectively solubilize non-bioactive matrix components (e.g., structural lipids, waxes, and co-extracted mucilaginous hydrocolloids). This influx of non-target mass inflates total crude yield while reducing the relative concentration (density) of target phenolics and flavonoids.

4. Discussion

4.1. Empirical Screening and Governing Factor Identification

The empirical findings of the Response Surface Methodology (RSM) analysis demonstrate that the solid-to-solvent ratio (X3) serves as the primary governing variable (p < 0.001) driving total phenolic content (TPC), total flavonoid content (TFC), and extraction yield, whereas extraction temperature (X1) and duration (X2) exhibited negligible main effects (p > 0.05) within the evaluated experimental domain. Across all three dependent variables, Analysis of Variance (ANOVA) screening confirmed that the solid-to-solvent ratio (X3) was the single dominant factor exerting a statistically significant primary effect (p < 0.001). Stepwise regression yielded distinct structural complexities across the targeted responses: while extraction yield percentage was adequately described by a first-order linear model (R2 = 0.8157, R adj 2 = 0.7655 , with an adequate precision of 0.6452 indicating certain limitations in signal-to-noise ratio for bulk mass transfer) (Table 5), both TPC and TFC required second-order quadratic equations to capture non-linear curvature and factor interactions (Table 4). For TPC, X3 exerted a strong positive linear effect (p < 0.001) coupled with a positive quadratic term (p < 0.05), underscoring a synergistic enhancement in phenolic recovery as the solid-to-solvent ratio (X3) increased toward the upper boundary of the experimental domain (75% w/v). Conversely, TFC exhibited a robust positive linear coefficient for X3 (+9.16, p < 0.01) alongside significant quadratic curvature (C2, p = 0.0004), yielding an overall model fit (R2 = 0.9977, adequate precision = 43.25) capable of explaining over 99% of the response variability (Table 4).

4.2. Mass Transfer Kinetics and Theoretical Interpretation

While internal diffusion coefficients and mass-transfer kinetics were not directly measured in this investigation, these observed empirical patterns can be conceptually interpreted through the theoretical framework of Fick’s second law of diffusion. Specifically, variations in the solid-to-solvent ratio (X3) dictate the solute accumulation and driving force for mass transfer. Operating at higher solid-to-solvent ratios (75% w/v) maximizes the mass concentration of plant tissue relative to solvent volume, driving elevated phenolic and flavonoid concentration yields in the extract. Similar RSM optimizations on botanical matrices, such as Echinocactus grusonii and artichoke polyphenol extractions, have likewise reported that solvent-to-matrix ratios exert a far more decisive influence on phenolic yields than moderate variations in extraction time or temperature. Furthermore, the non-significant lack-of-fit (p > 0.05) observed across all fitted regression models confirms that the polynomial equations adequately map the response surfaces without omitting critical parameter interactions.

4.3. Phytochemical Recovery, Solvent Selection, and Green Chemistry Transition

This study extends previous investigations into the Golden Barrel Cactus (Echinocactus grusonii) by refining extraction protocols to enhance phytochemical recovery. These findings indicate that using chloroform as a solvent significantly boosts the total phenolic concentration, reaching a peak of 33.34 µg GAE/mg RM. Furthermore, the optimization of process parameters proved critical; the highest levels of phenolic compounds were achieved using a 75% (w/v) GBC-to-solvent ratio at a temperature of 70 °C for a duration of 45 min.
While green solvents such as aqueous ethanol are ideal for sustainable industrial extraction, chloroform was intentionally selected in this fundamental study as a targeted analytical probe to evaluate lipophilic recovery limits from the waxy cuticular matrix of Echinocactus grusonii. Comparing solvent performance highlights distinct selectivity profiles: 90% aqueous ethanol extracted 12.54 µg GAE/g RM of broad polar phenolics, whereas chloroform achieved a peak yield of 33 µg GAE/mg RM representing a 2.6-fold increase in phenolic concentration per unit raw mass. This confirms that chloroform preferentially solubilizes highly lipophilic aglycones and wax-bound phenolics that remain insoluble in aqueous-organic media. Consequently, chloroform serves as a necessary analytical benchmark for lipophilic extraction before transitioning to eco-friendly solvent mixtures in pilot scale-up.
Recent research on the Golden Barrel Cactus (Echinocactus grusonii) has refined our understanding of phytochemical extraction by demonstrating that younger, 3-year-old specimens yield significantly higher phenolic content and antioxidant activity than 6-year-old plants, challenging earlier assumptions about plant maturity [1]. While previous studies relied on general solvents such as methanol, contemporary findings highlight that acetonitrile paired with sonication-assisted extraction at specific temperatures (15 °C) maximizes the recovery of heat-sensitive pigments such as lutein and chlorophyll [20]. The computational and methodological advancements in this work explicitly build upon and transcend our previous optimization study on Boesenbergia rotunda (Fingerroot). While [19] evaluated deep learning-assisted extraction of active metabolites from B. rotunda rhizomes using aqueous-organic solvent systems, that matrix represents a relatively porous, hydrophilic herbaceous rhizome where mass transfer is primarily governed by continuous liquid diffusion and swellable parenchyma tissues. In stark contrast, Echinocactus grusonii represents a xerophytic tissue matrix dominated by hydrophobic cuticular wax layers and viscous mucilage, requiring targeted organic extraction (chloroform) to recover tightly bound lipophilic and moderately polar phenolic fractions. Methodologically, while [19] demonstrated the superiority of deterministic neural architectures over standard RSM for yield enhancement, deterministic models (including ensemble neural networks, ENNs) output single scalar point estimates and remain prone to localized over-parameterization when trained on sparse Design of Experiments (DoE) datasets. The present study [21] addresses this critical bottleneck by implementing a Bayesian Neural Network (BNN) framework integrated with epistemic uncertainty quantification (σ2). By parameterizing synaptic weights as probability distributions rather than fixed scalar values, the BNN intrinsically quantifies prediction variance across boundary-constrained domains, successfully preventing model over-smoothing and providing calibrated confidence intervals essential for scaling up complex xerophytic extraction processes. Crucially, the cross-validated evaluation demonstrates BNN’s superior out-of-sample predictive precision over traditional RSM polynomials and deterministic ENNs (Table 6). Under Leave-One-Out Cross-Validation (LOOCV), BNN achieved the lowest LOOCV RMSE for TPC (0.428) and TFC (0.145) compared to RSM (1.440 and 0.5675, respectively) and ENN (0.785 and 0.312, respectively). By incorporating probabilistic weight distributions, BNN systematically mitigated variance error and avoided local minima stagnation without overfitting the sparse Box–Behnken dataset (Table 9).
Table 9. Comparative Extraction Performance and Phytochemical Selectivity Comparison between Green Solvent (90% Aqueous Ethanol) and Analytical Probe Solvent (Chloroform).
Furthermore, while earlier work focused purely on raw extract potency, current investigations using Caco-2 cell models have established that lutein maintains a high digestive stability of 69%, whereas chlorophylls significantly degrade to a 37.64% transport rate, providing a more accurate assessment of the plant’s actual nutraceutical value [1].

4.4. Comparative Machine Learning Frameworks and Industrial Scale-Up

When evaluating how machine learning architecture models the extraction dynamics of Golden Barrel Cactus, model architecture plays a critical role in handling response surfaces generated from sparse experimental matrices. Traditional Bayesian Neural Networks (BNNs) excel on small, sensitive biological datasets by treating synaptic weights as probability distributions rather than fixed scalar points, enabling robust quantification of epistemic uncertainty [21]. Although Ensemble Neural Networks (ENNs) aggregate predictions across multiple deterministic sub-models to reduce variance [22,23], ENNs are prone to slight over-parameterization and overfitting when trained on constrained Design of Experiments (DoE) sample sizes [18]. Consequently, BNNs’ built-in Bayesian regularization prevents over-smoothing and localized overfitting, allowing them to capture subtle non-linear mass transfer gradients more reliably than ensemble approaches in small-sample extraction trials [19].
The empirical comparison between classical Response Surface Methodology (RSM) and neural machine learning frameworks demonstrates the critical importance of out-of-sample cross-validation when modeling plant extraction kinetics. While in-sample metrics (RMSEfit) reflect model capacity to fit training points, out-of-sample evaluation (RMSELOOCV) confirms true predictive generalization on unseen operational conditions. Grounded strictly on out-of-sample LOOCV evaluation (Table 6), the BNN model achieved the lowest out-of-sample RMSE across all evaluated metrics (RMSELOOCV = 0.428 µg GAE/mg for TPC, 0.145 mg CE/mg for TFC, and 0.162% for yield), outperforming both deterministic ENN (RMSELOOCV = 0.785, 0.312, and 0.285) and quadratic RSM (RMSELOOCV = 1.625, 0.648, and 0.712). This superior out-of-sample precision highlights the ability of Bayesian regularization to prevent overfitting in small-sample extraction matrices [21,22].
From an economic and process engineering perspective, this probabilistic output enables plant operators to identify high-yield parameter spaces that simultaneously possess low predictive uncertainty prior to pilot-scale capital investment. While BNNs carry a slightly higher computational training burden than quadratic RSM equations, this minor computational requirement is vastly outweighed by the reduction in expensive wet-lab verification trials, establishing BNN-assisted optimization as a highly sample-efficient, risk-mitigated, and cost-effective framework for industrial process scale-up. Consequently, while RSM remains valuable for initial factor screening, BNN serves as the most accurate and statistically robust predictive tool for process scale-up and industrial extraction optimization.

5. Conclusions

Ultimately, while classical RSM remains a practical, low-cost tool for preliminary factor screening, it lacks the non-linear flexibility required for complex multi-component extraction dynamics. The main novelty and practical advantage of integrating Bayesian Neural Networks over deterministic neural ensembles (ENNs) is the intrinsic modeling of prediction uncertainty across sparse Box–Behnken datasets. By providing probabilistic confidence boundaries alongside high-precision yield forecasts, BNN-assisted optimization equips food and chemical engineers with a reliable, risk-mitigated decision-making framework for process scale-up, quality control, and industrial valorization of natural product extracts.

Author Contributions

A.O. (Alethea Oonsivilai), writing—original draft preparation, resources, software; K.C., methodology, formal analysis, data curation; K.P., formal analysis, data curation, writing—original draft preparation; R.O., conceptualization, methodology, validation, writing—review and editing; A.O. (Anant Oonsivilai), conceptualization, methodology, investigation, resources, software, funding acquisition, writing—review and editing. All authors have read and agreed to the published version of the manuscript.

Funding

This research has received funding support from the Suranaree University of Technology Research and Development Fund.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article; further inquiries can be directed to the corresponding authors.

Acknowledgments

The authors would like to thank Suranaree University of Technology for providing their laboratory facilities.

Conflicts of Interest

The authors hereby declare that there are no conflicts of interest in this article.

References

  1. Chaicharoenaudomrung, N.; Posridee, K.; Oonsivilai, A.; Oonsivilai, R. Golden Barrel Cactus: Unveiling Its Potential as a Functional Food and Nutraceutical Source. Foods 2024, 13, 1137. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Son, J.Y.; Park, S.Y.; Kim, J.Y.; Won, K.C.; Choi, Y.J.; Zheng, M.S.; Son, J.K.; Kim, Y.W. Orthosiphon stamineus reduces appetite and visceral fat in rats. J. Korean Soc. Appl. Biol. Chem. 2011, 54, 200–205. [Google Scholar] [CrossRef] [Scilit]
  3. Gomes-Araújo, R.; Martínez-Vázquez, D.G.; Charles-Rodríguez, A.V.; Rangel-Ortega, S.; Robledo-Olivo, A. Bioactive compounds from agricultural residues, their obtaining techniques, and the antimicrobial effect as postharvest additives. Int. J. Food Sci. 2021, 2021, 936722. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Brochu, E.; Cora, V.M.; de Freitas, N. A tutorial on Bayesian optimization of expensive cost functions, with application to opposition research. arXiv 2010, arXiv:1012.2599. [Google Scholar] [CrossRef] [Scilit]
  5. Frazier, P.I. A tutorial on Bayesian optimization. In Scalable Optimization via Randomized Search and Consensus; Springer: Cham, Switzerland, 2018; pp. 25–56. [Google Scholar] [CrossRef] [Scilit]
  6. Neal, R.M. Bayesian Learning for Neural Networks. Ph.D. Thesis, University of Toronto, Toronto, ON, Canada, 1995. [Google Scholar]
  7. Qi, B.; Zhang, L.; Liang, J.; Tong, J. Combinatorial Techniques for Fault Diagnosis in Nuclear Power Plants Based on Bayesian Neural Network and Simplified Bayesian Network-Artificial Neural Network. Front. Energy Res. 2022, 10, 920194. [Google Scholar] [CrossRef] [Scilit]
  8. Chen, T.; Chang, J.; Dong, X.; Huang, W. A Comparative Study of Deep Learning and Statistical Models for Fraud Detection. In Artificial Intelligence (CSAI 2025), Beijing, China, 12–15 December 2025; ACM: New York, NY, USA, 2025; 6p. [Google Scholar] [CrossRef] [Scilit]
  9. Prasongdee, P.; Posridee, K.; Oonsivilai, A.; Oonsivilai, R. A Culinary and Medicinal Gem: Exploring the Phytochemicaland Functional Properties of Thai Basil. Foods 2024, 13, 632. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  10. Snoek, J.; Swersky, K.; Richard, S.; Zemel, R.; Adams, R.P. Input warping for Bayesian optimization of non-stationary functions. arXiv 2014, arXiv:1402.0929. [Google Scholar] [CrossRef] [Scilit]
  11. Hutter, F.; Springenberg, J.T.; Falkner, S.; Klein, A.; Shahriari, B. Bayesian Optimization with Robust Bayesian Neural Net-Works; Advances in Neural Information Processing Systems: San Mateo, CA, USA, 2017; Volume 30, Available online: https://ml.informatik.uni-freiburg.de/wp-content/uploads/papers/16-NIPS-BOHamiANN.pdf (accessed on 18 October 2026).
  12. Dietterich, T.G. Ensemble Methods in Machine Learning. In Multiple Classifier Systems. MCS 2000; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2000; Volume 1857, pp. 1–15. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  13. Zhou, Z.-H. Ensemble Methods: Foundations and Algorithms; CRC Press: Boca Raton, FL, USA, 2012. [Google Scholar]
  14. Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; MIT Press: Cambridge, MA, USA, 2016; Available online: http://www.deeplearningbook.org (accessed on 18 October 2026).
  15. Araz, J.Y.; Spannowsky, M. Combine and conquer: Event reconstruction with Bayesian Ensemble Neural Networks. J. High Energy Phys. 2021, 4, 296. [Google Scholar] [CrossRef] [Scilit]
  16. Kennedy, J.; Eberhart, R. Particle Swarm Optimization. In Proceedings of ICNN’95—International Conference on Neural Net-works, Perth, 27 November–December 1995; IEEE: Piscataway, NJ, USA, 1995; pp. 1942–1948. [Google Scholar] [CrossRef] [Scilit]
  17. Caruana, R.; Niculescu-Mizil, A.; Crew, G.; Ksikes, A. Ensemble selection from libraries of models. In I Conference: Machine Learning, Proceedings of the Twenty-first International Conference (ICML 2004), Banff, AB, Canada, 4–8 July 2004; Association for Computing Machinery: New York, NY, USA, 2004. [Google Scholar] [CrossRef] [Scilit]
  18. Shahriari, B.; Swersky, K.; Wang, Z.; Adams, R.P.; de Freitas, N. Taking the human out of the loop: A review of Bayesian optimization. Proc. IEEE 2016, 104, 148–175. [Google Scholar] [CrossRef] [Scilit]
  19. Pao-la-Or, P.; Posridee, K.; Buranakon, P.; Singthong, J.; Oonmetta-Aree, J.; Oonsivilai, R.; Oonsivilai, A. Beyond Traditional Methods: Deep-Learning Machines Empower Fingerroot (Boesenbergia rotunda) Extract Production with Superior Antioxidant Activity. Foods 2024, 13, 2676. [Google Scholar] [CrossRef] [Scilit] [PubMed] [PubMed Central]
  20. Moeurng, S.; Posridee, K.; Kamkaew, A.; Thaiudom, S.; Oonsivilai, A.; Oonsivilai, R. Identification of Pheophytin a and Hy-droxy Pheophytin a from Rang Chuet (Thunbergia laurifolia Linn.) as Potent NQO-1 Inducers in Liver Cells. Foods 2024, 13, 1443. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  21. Kim, Q.; Ko, J.H.; Kim, S.; Park, N.; Jhe, W. Bayesian neural network with pretrained protein embedding enhances pre-diction accuracy of drug-protein interaction. Bioinformatics 2021, 37, 3428–3434. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  22. Wilson, A.G. The case for Bayesian deep learning. Adv. Neural Inf. Process. Syst. 2020, 33, 12722–12737. [Google Scholar]
  23. Farris, R.; Telari, E.; Bruix, A. Bayesian neural networks versus deep ensembles for uncertainty quantification in machine learning interatomic potentials. arXiv 2025, arXiv:2509.01918. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.