Abstract
Accurate prediction of gas (K(rg)) and oil (K(rog)) relative permeability is essential for reliable multiphase flow modeling in petroleum reservoirs. This study presents a comparative machine learning framework leveraging 1,026 petrophysical data points and advanced techniques, including Transformer networks, Random Forest (RF), and Extreme Gradient Boosting (XGBoost), alongside conventional linear regression. Explainability was incorporated from the outset using SHAP (Shapley Additive Explanations) to interpret feature contributions and ensure physically meaningful predictions. The Transformer model, empowered by self-attention mechanisms, consistently outperformed all baselines, achieving R² values up to 0.94 and accurately capturing nonlinear interactions. Scatter plots, Bland-Altman analyses, residual diagnostics, and quantile-quantile (Q-Q) plots revealed minimal bias, tight confidence bounds, and homoscedastic residuals across diverse saturation regimes. RF and XGBoost showed competitive performance (R² ≥ 0.88), particularly in heterogeneous formations, while linear regression underperformed, displaying systematic errors and wide prediction intervals. SHAP analyses highlighted gas saturation (S(g)) and residual oil saturation (S(org)) as dominant controls, with Transformers capturing percolation thresholds, pore-blocking effects, and lithological heterogeneities more effectively than ensemble methods. This Transformer-based framework sets a new benchmark for data-driven K(r) estimation, combining predictive accuracy with transparent, physically consistent reasoning, and is highly suitable for field-scale reservoir simulation and uncertainty quantification in enhanced recovery applications.