SCIENTIFIC REPORTS, cilt.16, 2026 (SCI-Expanded, Scopus)
Surface roughness in CNC turning is a pivotal quality metric shaping functional performance, service life and production cost. This study investigates data-driven prediction of arithmetic mean surface roughness (Ra) during the turning of AISI H13 steel under both new-tool and progressively worn-tool conditions. Several machine learning models including k-Nearest neighbors (KNN), random forest (RF) and extra trees (ExT) are evaluated and compared with a stacking ensemble model that integrates these base learners using a linear regression meta-learner. The input variables consist of cutting speed, feed rate, depth of cut and triaxial cutting force components. The results show that the KNN model exhibits limited predictive accuracy whereas the RF and ExT models achieve competitive performance. The proposed stacking ensemble consistently outperforms all individual models achieving a coefficient of determination (R²) exceeding 0.98 along with substantial reductions in root mean square error (RMSE) and mean absolute error (MAE) under tool-wear conditions indicating strong generalization capability. To enhance model transparency SHapley additive exPlanations (SHAP) and local interpretable model-agnostic explanations (LIME) are employed. The interpretability analyses identify feed rate as the dominant factor influencing surface roughness while the importance of cutting forces and the interaction between depth of cut and feed rate increases as tool wear progresses. Overall the findings demonstrate that the proposed stacking-based hybrid model provides an accurate, robust and explainable framework for surface roughness prediction in CNC turning offering practical potential for in-process quality monitoring and decision support applications.