1. Introduction
In recent years, Gut-on-a-Chip has emerged as an innovative bionic platform with promising applications. This platform can reconstruct the gut physical barrier, biochemical gradients, and cell–microbe interaction interfaces at the microscale. These capabilities have opened up broad prospects in drug development, the study of gut–microbiome mechanisms, and personalized therapies [
1,
2,
3]. Organ-on-a-chip technology is a novel tool that more closely mimics human physiological processes than traditional animal testing or two-dimensional cell cultures. It is increasingly being used to find alternatives to animal testing and to create human tissue models in the laboratory. In 2025, the U.S. Food and Drug Administration (FDA) formally launched a new policy to progressively replace animal testing, encouraging the use of “New Approach Methodologies” (NAMs) such as organ-on-a-chip, organoids, and AI simulations for drug safety and efficacy testing [
4]. This initiative marks a paradigm shift in global drug evaluation, advancing toward methods that are more human-relevant, reproducible, and ethically sound. Organ-on-a-chip platforms are evolving beyond basic research tools to become critical technologies for preclinical studies and regulatory decision-making. Consequently, the development of efficient and precise chip designs has become an urgent challenge.
For gut-on-a-chip development, microenvironmental factors are critical to replicating in vivo physiological functions—and among these, oxygen gradients stand out as a core variable for maintaining gut homeostasis and regulating microbe–host interactions [
5,
6]. Consequently, oxygen gradients have become a key indicator in gut-on-a-chip design and evaluation. In the physiological gut, the oxygen concentration gradually decreases from vascularized regions to the lumen, directly affecting epithelial cell metabolic activity and the stability of tight junction proteins, such as the claudin family and occluding, thereby regulating gut barrier integrity and microbial community structure [
7,
8,
9]. The maintenance of gut barrier function depends on the proper expression and localization of tight junctions between epithelial cells. Abnormal oxygen gradients disrupt this equilibrium, leading to barrier dysfunction. This further highlights the importance of precisely replicating oxygen gradients in Gut-on-a-Chip models. Currently, researchers are working to establish stable oxygen gradients on chips through strategies such as microfluidic structure design, oxygen diffusion pathway regulation, and oxygen-barrier material implementation. For instance, Shin et al. [
10] used the Finite Element Simulation (FES) to explore how flow rate and diffusion parameters affect oxygen distribution in microchannels. Liu et al. [
11] further optimized channel geometry and restricted ambient oxygen infiltration to enhance gradient formation. Ingber’s team [
12] introduced a polycarbonate oxygen barrier layer to establish microaerobic conditions, expanding the range of material-based control strategies. Other related studies are summarized in
Table 1. However, these studies that rely solely on COMSOL simulations typically depend on trial-and-error methods and limited parameter combinations, failing to generate large-scale datasets and lacking systematic optimization frameworks. Furthermore, existing research often does not adequately consider the interaction effects among parameters involved, nor does it sufficiently explore the interactions between parameters under steady-state conditions in complex microfluidic environments.
FES has been widely applied to simulate fluid flow and mass transfer processes in organ-on-a-chip due to its advantages in multiphysics coupling modeling [
19,
20]. To improve modeling efficiency and parameter coverage, some studies have incorporated the COMSOL LiveLink for MATLAB interface to automate simulation workflows through scripting, enhancing modeling efficiency and parameter coverage. For example, Junghwan Kook [
21] proposed a multiphysics topology optimization framework based on weak formulations, embedding governing equations into COMSOL through MATLAB scripts to automate structural design and sensitivity analysis. Ahmad Jafari [
22] adopted the extended FES and level-set strategies for full-process automation in porous media problems. These methods highlight the potential for deep integration between FES and advanced programming environments, but systematic research on oxygen gradient modeling and optimization remains lacking.
Concurrently, the widespread application of machine learning (ML) in engineering prediction and design optimization has sparked interest in data-driven approaches for organ-on-chip research. By integrating mathematical modeling with machine learning, these approaches have demonstrated substantial advantages in multi-parameter optimization for complex biological systems. For instance, in precision nutrition, techniques such as random forests and data augmentation efficiently handle multivariate interaction problems, leading to the precise optimization of complex objectives [
23]. This offers valuable insights for the systematic design of organ-on-a-chip systems, specifically in overcoming the limitations of traditional trial-and-error design through data-driven strategies. In the field of organ-on-a-chip technology, James et al. [
24] combined principal component analysis with random forests to develop regression models linking vascularized chip morphology to functional performance. Marina et al. [
25] employed convolutional neural networks to analyze chip imaging data for tumor progression prediction. They underscore ML’s significant potential for feature extraction and system modeling. However, no studies have yet combined automated finite element simulations with machine learning to systematically model the mapping between chip design parameters and oxygen distribution, thus failing to establish a systematic optimization framework for oxygen gradients in gut-on-a-chip.
To address these limitations, this paper proposes a method for generating COMSOL simulation data driven by MATLAB. This approach overcomes the computational efficiency limitations of traditional numerical modelling. It provides an efficient data generation scheme for machine learning algorithms to predict oxygen gradients under various parameter combinations. The Effective Region Percentage (ERP) was proposed as a quantitative metric for evaluating biomimetic performance. For the numerical prediction of oxygen gradient metrics, RF, XGBoost, and MLP algorithms were employed for numerical prediction of oxygen gradient metrics, while the BG-Net model is utilized for predicting oxygen distribution maps. Furthermore, the SHAP analysis method was applied to interpret the numerical prediction model for oxygen gradient metrics, revealing the relative importance of input features. To validate the effectiveness of the proposed model, the rationality of the innovative architecture design for the oxygen distribution image prediction model was evaluated using ablation experiments. The results demonstrate that this model performs exceptionally well in processing oxygen distribution images from gut-on-a-chip. In conclusion, this dual-prediction model not only accommodated diverse research needs but also supports the design and optimization of oxygen gradients in gut-on-a-chip, advancing their development as high-fidelity in vitro simulation platforms.
3. Results and Discussion
3.1. Validation of the Numerical Simulation Model
The gut-on-a-chip simulation model developed in this study demonstrates the oxygen concentration trends at three representative locations—the inlet, middle, and outlet—which closely align with the computational simulation results reported by Shin et al. [
10] (
Figure 7a). Specifically, our model brings these three locations closer to physiological gut oxygen concentrations. Shin et al. simplified the porous membrane to a thin film, which allowed the oxygenated medium in the endothelial channel to readily contact the hypoxic medium in the epithelial channel. Consequently, low oxygen concentrations (0.0083–0.0088 mol/m
3) were observed at the inlet (0 mm and 0.15 mm positions) (gray points in
Figure 7a). In contrast, our study accounts for the actual diffusion resistance of the porous membrane. The hypoxic medium in the epithelial channel cannot rapidly obtain oxygen diffusion from the endothelial side in the inlet segment. Therefore, the oxygen concentration at the inlet is 0 mol/m
3, which is consistent with the inlet concentration reported by Liu et al. [
11], who also simulated an gut-on-a-chip considering porous membrane structures (red points in
Figure 7a).
The central region constitutes the core functional zone of the gut villi. The results of this study exhibit high quantitative consistency with experimental data from Shin et al.: Vascular side (0 mm): Experimental value 0.072191 mol/m3, reference value 0.072400 mol/m3, relative error only 0.29%; Villus tip (0.15 mm position): Experimental value 0.057138 mol/m3, reference value 0.059900 mol/m3, relative error 4.61%. These results demonstrate that the simulation model developed in this study predicts oxygen concentrations with high precision, consistent with the physical laws of oxygen gradient transport.
Due to the porous membrane restricting oxygen transfer from the endothelium to the epithelial channel, coupled with continuous oxygen consumption by cells within the flow channel, the outlet concentration is lower (closer to the hypoxic environment at the gut end). In contrast, Shin’s simplified membrane model leads to faster oxygen diffusion, resulting in a relatively higher outlet oxygen concentration. The relative error in the outlet region is significant (22.03–30.42%). Overall, the simulation dataset generated in this study exhibits high reliability, providing effective numerical support for modeling oxygen distribution in gut-on-a-chip.
PO
2 profiles along these sites showed a steady decrease toward the villus tips, where the gradient flattened to its lowest value (
Figure 7b), mirroring earlier experimental findings [
46].
3.2. Comparison of Simulation Results
Figure 8a displays the unstructured finite-element oxygen concentration field obtained from COMSOL, whereas
Figure 8b shows the corresponding two-dimensional map reconstructed in MATLAB with natural-neighbor interpolation. The original data, constrained by intricate geometry and boundary conditions, contain pronounced irregularities. Interpolation projects the scattered values onto a uniform grid, yielding a noticeably smoother and continuous concentration field.
Comparing the color scales, we find that the interpolated gradients are consistent with the original simulation results, particularly in key regions like the upper and lower channel boundaries. The 0.05–0.15 mol m−3 concentration band remains intact. By smoothing the field, the interpolation not only sharpens visualization but also supplies a regular grid, which can be ingested by later machine-learning models, thus closing the loop between simulation and data-driven analysis.
To check whether the predicted oxygen field is physiologically plausible, we examined two reference lines: y = 0 and y = 0.15. In
Figure 8c the orange-red trace shows the profile at y = 0, close to the vascular bed; the pink band marks the accepted tissue interval of 0.054–0.135 mol m
−3 (40–100 mmHg). The blue trace, taken at y = 0.15 near the villus tip, is paired with a blue band indicating 0.0135–0.054 mol m
−3 (10–40 mmHg). White patches, where the computed concentration lies outside these ranges, probably indicate model limitations rather than genuine physiology.
MATLAB scripts were used to calculate the percentage of values within the physiological range. The results showed that 67.3% of concentrations at y = 0 and 63.9% at y = 0.15 fall within the expected range. Overall, the model successfully reproduced the expected gradient from high to low oxygen levels.
3.3. Performance Evaluation of the Numerical Prediction Models
Figure 9 presents the root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R
2) for each model on the test set, while
Figure 10a shows the linear regression fitting results.
The results indicate that XGBoost outperforms both RF and MLP across all metrics, achieving an R2 of 0.9945. This superior performance can be attributed to XGBoost’s adaptability to structured data, strong nonlinear modeling capabilities, and the use of regularization and subsampling techniques, which enhance both model stability and generalization. While Random Forest demonstrates good robustness, its ability to capture complex interactions is limited. The MLP model shows weaker fitting performance and lower training stability.
Figure 10b displays the residual distribution. XGBoost residuals are tightly clustered around zero and exhibit an approximately normal distribution. The standard deviation of residuals in the middle region (y_mid) is 1.3942, lower than the standard deviation of 1.9148 in the bottom region (y_bot), suggesting better prediction accuracy in the central area. In contrast, the RF model shows a larger residual standard deviation at y_bot (3.5165), indicating lower stability. MLP exhibits the greatest residual fluctuations, particularly at y_bot, where the standard deviation reaches 4.1006, reflecting weak fitting stability.
Based on the prediction results, the XGBoost model achieved the highest predictive accuracy. To clarify how each variable shapes the predicted oxygen gradient, we applied SHAP analysis to the same model.
Figure 11 ranks the input variables by their influence on the XGBoost output. Medium flow rate dominates, contributing 39.7% of the total SHAP importance, followed by external flux (26.9%), cellular oxygen consumption rate (24.8%), endothelial channel height (5.5%), and epithelial channel height (3.1%). Existing experimental studies have shown that by reducing the oxygen permeability of PDMS (external flux) and controlling flow rate, cells can achieve a steady-state oxygen gradient through natural oxygen consumption within channels. This finding aligns with the results of SHAP analysis in this study [
11,
34]. Furthermore, the research by Jomezadeh Kheibary et al. [
47] also indicates that oxygen transfer is influenced not only by diffusion but also by fluid flow rate and channel geometry. In microfluidic systems, increasing flow velocity enhances the convective effects, which helps oxygen spread and distribute more rapidly. This explains why flow rate emerged as the most significant feature in predicting oxygen gradients within this model.
To eliminate the influence of feature scaling or variable range differences on SHAP results,
Figure 12 further validates the robustness of the SHAP analysis.
Figure 12a,b respectively display the SHAP relative importance proportions for raw data and standardized data. Identical results confirm that SHAP feature importance rankings remain unaffected by feature dimensions and numerical ranges.
Figure 12c presents the results of the permutational feature importance analysis. The core influential features remain
, and
, and their importance ranking fully consistent with the SHAP analysis results. This high consistency between different interpretation methods further validates the reliability of the model’s key feature identification.
Figure 13 visualizes, for the XGBoost model, how every feature shapes the quantitative oxygen-gradient metric on the test set. Each dot is one test instance, and its horizontal position gives the SHAP value, i.e., the feature’s signed contribution to the predicted outcome. Colour encodes the feature’s magnitude: red for high, blue for low. Positive SHAP scores push the prediction upward, negative scores pull it downward. The plot reveals that a higher medium flow rate lifts the prediction and spans a wide value range; endothelial channel height also raises the output, though less broadly; cellular oxygen consumption can act in either direction; while external flux and epithelial channel height consistently reduce the predicted value.
Through SHAP interaction analysis, we further explored the synergistic and antagonistic relationships among features (
Figure 14).
Figure 14a displays the SHAP interaction matrix, revealing that the strongest interactions occur between
and itself (15.09),
and
(7.62), and
and itself (6.27). These results indicate significant nonlinear synergistic effects among these core features.
Figure 14b details the
-
interaction: at low
, increasing
substantially enhances the oxygen gradient; at high
,
’s effect reverses, attenuating the oxygen gradient. This finding complements the physical mechanism of “cooperative regulation of oxygen gradient by flow velocity and flux,” further enhancing the model’s interpretability.
3.4. Performance Evaluation of the Image Prediction Models
To evaluate the performance of the constructed image prediction model in the oxygen concentration distribution prediction task, both quantitative and qualitative analyses were conducted.
Figure 15a presents a comparison between the original oxygen concentration distribution and the BG-Net model-generated predicted image. The two images exhibited a high degree of consistency in the overall gradient shape, distribution region, and boundary transition features. This consistency indicates that the model effectively captures the continuous variation in oxygen concentration distribution. However, slight differences were observed in the boundary transition details: the original image shows clearer transitions, while the predicted image exhibits somewhat blurred and less accurate boundary transitions. This suggested that the model may have limitations in reproducing complex boundary transition details, failing to fully capture the intricate variations present in the original image.
Figure 15b illustrates the changes in the loss function and mean absolute error (MAE) during training and validation of the BG-Net model. In the early stages, both training and validation losses decreased rapidly. Training loss dropped sharply from approximately 0.19 to below 0.05, while validation loss decreased from around 0.13 to near 0.03. At the same time, training MAE and validation MAE showed higher initial values (approximately 0.13 and 0.12, respectively), but also declined rapidly. During the early training phase (first 10 epochs), the validation MAE exhibited significant fluctuations, peaking at around 0.04. This was potentially related to the model’s adaptation to the features in the validation set during the learning process. As training progressed (after approximately 20 epochs), all metrics gradually stabilized. Lastly, both training loss and validation loss converged to around 0.02, while training MAE and validation MAE stabilized within the 0.01–0.015 range, showing very close values. This indicated that the oxygen concentration image prediction model demonstrated robust predictive performance on both the training and validation sets. The high consistency between training and validation losses suggested the model effectively learned data features while maintaining strong generalization capabilities, without exhibiting significant overfitting.
The model was further assessed with SSIM and PSNR (
Figure 16). Mean SSIM reached 0.9220 and mean PSNR 33.71 dB, confirming that structural fidelity and visual quality were well preserved. The strong positive correlation between the two metrics reinforces this consistency. Box plots showed tight distributions with few outliers, underscoring stable performance across varied image-prediction tasks.
To further validate BG-Net’s superiority in oxygen distribution prediction, a comparative analysis was conducted against the cGAN baseline model using both quantitative metrics and qualitative visualization.
Figure 17 displays oxygen distribution prediction images generated by the BG-Net and cGAN models. Both models show similar overall gradient patterns and concentration distributions, capturing the continuous variations in oxygen distribution. However, subtle differences appear at boundaries: the BG-Net model’s predictions show clearer boundary transitions, whereas the cGAN model shows blurred transitions in certain regions. Overall, the BG-Net model achieves superior image quality.
Table 6 compares the performance of the two models on the test set. Compared to cGAN, BG-Net reduces MAE by 70.29% and MSE by 33.39%, while improving SSIM by 4.11% and PSNR by 18.83%. These error reductions suggest that BG-Net’s boundary-enhancement and multi-scale feature-fusion modules effectively reduce local prediction errors. The higher SSIM and PSNR further indicate better structural fidelity and visual consistency with the simulated data, alleviating cGAN’s tendency to produce over-smoothed images.
3.5. Ablation Experiment Results Analysis
Figure 18 compares the performance of each model variant against the baseline. Dropping the boundary-enhancement module caused the sharpest drop: MSE rose 46.1% and MAE 16.9%, underscoring that boundary-aware design is indispensable. SSIM, in contrast, barely moved (+0.55%). The metric captures global structural similarity, so the concentration field still shows the correct large-scale pattern even when fine boundary detail is missing. MSE, penalizing squared error, is far more reactive to local mismatches at the boundary. Thus, it provides a clearer readout of how much the enhancement module contributes in microfluidic tasks.
When the multi-scale feature fusion module was dropped, MAE rose by 9.1%, confirming that merging cues across spatial scales is essential for recovering concentration patterns. Positional encoding had a smaller effect: removing it lifted MAE by only 3.4%, implying that the convolutional layers already absorb most of the required spatial relationships and that explicit position signals add little in this task.
Among the dropout regularization tests, lowering the dropout rate from 0.3 to 0.1 was the only change that cut MAE by 6.6% and simultaneously lifted SSIM by 0.65%. This suggests that the baseline model had begun to overfit. When the network was trained with plain MSE loss, the MSE itself dropped 12.0%, yet MAE rose 15.6% and SSIM fell 1.60%; the training loss also collapsed to 0.00054, a clear sign of overfitting. These results confirm that a single pixel-wise loss cannot jointly preserve point accuracy, structural detail, and sharp boundaries in concentration-field reconstruction. Full metrics for every variant are given in
Table 7.
4. Discussion
This study introduces a MATLAB-driven COMSOL simulation data generation method. It effectively overcomes the computational efficiency limitations of traditional numerical simulations, providing an efficient data generation solution for machine learning algorithms to predict oxygen gradients under different parameter combinations.
For quantitative oxygen gradient prediction, three models—RF, XGBoost, and MLP—were employed. Among these models, XGBoost demonstrated the optimal predictive accuracy, achieving an RMSE of 1.68%. SHAP analysis revealed that medium flow rate (39.7%), external flux (26.9%), and cellular oxygen consumption rate (24.8%) significantly influenced prediction outcomes. Additionally, the analysis highlighted how these factors interact synergistically, offering a more profound understanding for the optimization and regulation of the oxygen gradient.
For spatial mapping, BG-Net was adopted to predict full oxygen images; the reconstructions matched experimental quality. Ablation experiments validated the rationality of the innovative architecture design for the oxygen distribution image prediction model. Results indicated that modules such as boundary enhancement and multi-scale feature fusion within the BG-Net model positively contributed to oxygen distribution image generation for gut-on-a-chip. The contrast with the cGAN baseline model further validates the domain-specific innovative value of BG-Net in predicting oxygen distribution in gut-a-chip. Future efforts may explore transferring this model to image generation tasks for other microfluidic chips.
The numerical prediction model provides the pass rate of oxygen concentration in chip channels corresponding to parameter combinations, while the image prediction model delivers the specific oxygen distribution patterns in chip channels under given parameter sets. This dual-prediction model not only meets the diverse needs of different researchers but also provides robust support for oxygen gradient design and optimization in gut-on-a-chip. This advancement promotes greater biological realism in organ-on-a-chip, enhancing their effectiveness in drug screening, disease research, and personalized medicine. Actually, this dual-prediction framework can accelerate the rational design process of gut-on-a-chip for preclinical drug screening and personalized gut microbiome therapy. Future research will focus on integrating in vitro experimental data to enable real-time prediction and extending the BG-Net architecture to the study of other microfluidic organ chips.