Optimized machine learning models have been developed to predict the compressive strength of concrete exposed to wastewater environments. The best-performing model achieved an R2 of 0.96 on testing data, highlighting the potential of data-driven methods to assess concrete strength. Researchers published their findings in the journal Scientific Reports.
Study: Machine learning-based prediction of compressive strength of wastewater-exposed concrete using explainable and optimized models. Image Credit: Bilanol/Shutterstock.com
Why Wastewater Infrastructure Needs Better Strength Predictions
To address the challenges of predicting the compressive strength of concrete exposed to wastewater, this study employed a suite of machine learning (ML) models enhanced with particle swarm optimization (PSO).
The selected models included PSO-XGBoost, PSO-GEP (gene expression programming), PSO-SVR (support vector regression), and PSO-LightGBM. Multiple linear regression (MLR) was also included as a baseline for comparative analysis against the more advanced, optimized non-linear models.
Particle swarm optimization, a computational technique inspired by the social foraging behavior of fish and birds, was utilized to effectively handle discontinuous and non-linear datasets. PSO operates by processing a population of candidate solutions (particles) in parallel, guiding them through a defined search space to identify optimal hyperparameters for each ML model.
Training Machine Learning Models on Concrete Strength Data
The methodology commenced with data collection and preparation, which is fundamental to the models' credibility. A dataset of 138 samples
sourced from previously published academic research focusing on ML-based prediction studies, was compiled. This data underwent critical preprocessing steps, including normalization to a consistent scale (interval [−1, 1]) to standardize input features and minimize the impact of noise.
Outliers, constituting approximately 5% of the samples, were identified and removed using a two-tailed statistical detection method based on the ± 3 σ rule, which further refined the data. To ensure model generalization and mitigate overfitting, the dataset was split into an 80:20 ratio, dedicating 110 samples for training and 28 for independent testing.
For model selection and optimization, particle swarm optimization (PSO) was integrated with XGBoost, GEP, SVR, and LightGBM. PSO systematically searched for optimal hyperparameters (such as learning rate, maximum tree depth, number of estimators, etc.) for each algorithm by minimizing validation error.
Model performance was rigorously evaluated using several statistical metrics: the coefficient of determination (R2), mean absolute error (MAE), root-mean-square error (RMSE), and the a-20 index. An R2 value of 0.85 or higher indicated a strong correlation between experimental and predicted values.
The a-20 index, which measures model reliability within a ± 20% range of actual values, was particularly useful for assessing models with high R2 values that might still exhibit significant errors.
Finally, the study incorporated Shapley explanation analysis (SHAP) to interpret the models' behavior. SHAP quantifies the impact of each input feature on the prediction outcomes, revealing whether a feature has a positive or negative influence and its magnitude.
Download a free copy of this page here!
PSO-XGBoost Delivers the Most Accurate Predictions
The rigorous data preprocessing steps, including normalization and outlier removal, enhanced the model’s performance and effectively reduced overfitting, though the limited dataset size is a limitation when assessing generalizability. Hyperparameter tuning using PSO was instrumental in optimizing each algorithm.
For instance, in PSO-XGBoost, an optimal learning rate of 0.10 and 100 estimators, with a maximum depth of five, balanced non-linearity and complexity. This systematic optimization identified favorable hyperparameter configurations with the specified search ranges before performance assessment.
The K-fold cross-validation results demonstrated the predictive robustness of the developed models. PSO-XGBoost emerged as the top performer, achieving the highest mean R2 value of 0.95 and the lowest RMSE of 1.5 MPa across the K-fold validation.
PSO-LightGBM, PSO-GEP, and PSO-SVR also exhibited acceptable non-linearity in their prediction capabilities, with mean R2 values of 0.9 (LightGBM), 0.9 (GEP), and 0.92 (SVR), respectively, and corresponding RMSEs.
SHAP provided crucial insights into the contribution of various input parameters to the predicted output. Notably, the water-to-cement (W/C) ratio was identified as having a major influence on concrete compressive strength predictions. This highlights the practical value of SHAP in understanding model behavior and feature contributions.
A prototype graphical user interface (GUI) was also developed to demonstrate the potential deployment of these models, particularly the high-performing PSO-XGBoost, for practical estimation of concrete compressive strength. While currently a conceptual tool, it illustrates the feasibility of converting the approach into a real-world application.
A comparative analysis with recent literature suggested the competitive performance of the optimized models in this study. Approximately a 10–15% improvement in R2 and a 15–25% enhancement in RMSE were observed compared to other optimized models in various studies, even with a relatively small dataset. However, it should be noted that differences in datasets and evaluation methods limit direct comparisons.
Toward Practical AI-Based Concrete Strength Assessment
This research successfully developed and validated machine learning models for estimating concrete compressive strength reduction in the presence of sanitary wastewater.
The integration of particle swarm optimization with advanced algorithms like XGBoost, GEP, LightGBM, and SVR significantly enhanced predictive capabilities. PSO-XGBoost demonstrated superior performance, achieving an R2 value of 0.97 for training data and 0.96 for testing data, with a root-mean-square error of 1.25 MPa for the test data.
Future work should focus on building a more comprehensive database incorporating additional parameters such as mixture composition, time, H2S concentration, pH level, and temperature to enhance the models' generalizability and enable direct prediction of remaining strength and deterioration of structures.
Journal Reference
Aslam F., and Ahmad F. (2026). Machine learning-based prediction of compressive strength of wastewater-exposed concrete using explainable and optimized models. Scientific Reports. DOI: 10.1038/s41598-026-72533-8, https://www.nature.com/articles/s41598-026-72533-8.