Controlled release of a desired drug from porous polymeric biomaterials was analyzed via computational method. The method is based on simulation of mass transfer and utilization of artificial intelligence (AI). This study explores the efficacy of three regression models, i.e., Kernel Ridge Regression (KRR), Gaussian Process Regression (GPR), and Gradient Boosting (GB) in determining the concentration of a chemical substance (
C
) based on coordinates (
r
,
z
). Leveraging Firefly Optimization (FFA) for hyperparameter optimization, the models are fine-tuned to maximize their predictive performance. The findings unveil notable disparities in the performance metrics of the models, with GB showcasing the most impressive R
2
score of 0.9977, indicative of a remarkable alignment with the data. GPR closely trails with an R
2
score of 0.88754, while KRR falls short with an R
2
score of 0.76134. Additionally, GB manifests the most modest Mean Squared Error (MSE) and Root Mean Squared Error (RMSE) among the trio of models, further cementing its supremacy in predictive precision. These outcomes accentuate the significance of judiciously selecting regression methodologies and optimization approaches for adeptly modeling intricate spatial datasets.