Ministry of Construction and Housing
National Center for Construction Laboratories
Artificial Intelligence Course
Final Report
Predicting Concrete Compressive
Strength Using Machine Learning
By:
Dr. Abdulrazzaq Fouad Noori
Kenan Mahdi Ahmed
Sahar Issam Wadih
Zeina Zeki Jameel
Hiba Jasim Mohamed
2025
Abstract:
Concrete is one of the most widely used construction materials, with its
compressive strength serving as a critical parameter for ensuring the structural
integrity and durability of built infrastructure. This mechanical property is
influenced by the composition and proportions of key constituents, including
cement, blast furnace slag, fly ash, water, superplasticizer, coarse aggregate, fine
aggregate, and the age of the concrete. Traditionally, the determination of
compressive strength relies on destructive laboratory testing, which is both time-
consuming and costly. As an alternative, computational intelligence techniques—
particularly machine learning (ML)—offer a promising, non-destructive, and
efficient approach to predicting concrete strength based on historical data.
This study focuses on the development of predictive models using various ML
algorithms implemented in Python to estimate the compressive strength of
concrete. The models explored include Linear Regression, Random Forest
Regressor, Support Vector Machines (SVM), Lasso Regression, K-Nearest
Neighbors (KNN), Gradient Boosting Regression, XGB Regressor, Adaptive
Boosting Regressor, Bagging Regressor, Artificial Neural Network (ANN) and
Decision Tree algorithms. The dataset, obtained from a reputable and widely-
used source, was partitioned into training and testing sets to evaluate model
performance. The research emphasizes the importance of data preprocessing,
appropriate model selection, and the use of relevant evaluation metrics.
Experimental results indicate that the applied ML models exhibit strong
predictive capabilities, demonstrating their potential to serve as effective tools in
the assessment of concrete compressive strength.
1
1. Introduction
Concrete is a fundamental structural material and one of the most widely used
and cost-effective resources in modern construction. Its application spans a broad
range of infrastructure projects, including buildings, bridges, tunnels, and
roadways. The structural integrity and long-term durability of these
constructions—particularly their ability to withstand significant loads and
adverse environmental conditions—rely heavily on the performance of high-
strength concrete.
The primary constituents of concrete include cement, fine aggregate (sand),
coarse aggregate, and water, often combined with various chemical admixtures
to enhance workability and performance. The compressive strength of concrete
is influenced by a multitude of factors, such as the type and proportion of raw
materials, curing time, mix design, and surrounding environmental conditions.
Among these, the physical and mechanical properties of individual components
play a particularly crucial role in determining the final strength of the material.
Traditionally, the compressive strength of concrete is assessed through
destructive testing methods, which involve casting and crushing cylindrical or
cubical specimens after a designated curing period. While such tests are reliable,
they are inherently time-consuming, labor-intensive, and costly. Furthermore, the
accuracy of the results can be affected by several factors, including mix
proportions, testing conditions, and potential human or calculation errors.
In light of these limitations, recent advancements in computational methods have
introduced machine learning (ML) as a promising alternative for predicting the
compressive strength of concrete. By leveraging historical datasets and advanced
algorithms such as: Linear Regression, Random Forest Regressor, Support
Vector Machines (SVM), Lasso Regression, K-Nearest Neighbors (KNN),
Gradient Boosting Regression, XGB Regressor, Adaptive Boosting Regressor,
Bagging Regressor, Artificial Neural Network (ANN) and Decision Tree. ML
models can estimate concrete strength with a high degree of accuracy,
significantly reducing the dependence on physical testing. The objective of this
study is to develop and evaluate a machine learning-based predictive model
capable of estimating concrete compressive strength using input variables such
as material composition and curing age. This approach aims to enhance
efficiency, minimize testing costs, and support data-driven decision-making in
construction engineering.
2
2. Methodology
2.1. Data Collection and Preprocessing
The dataset used for this study originates from the UCI Machine Learning
Repository, containing concrete mixture proportions and corresponding
compressive strength values. The dataset consists of 1030 samples with the
following key features:
Cement content (kg/m³): A binding substance used in construction.
Blast furnace slag (kg/m³): A byproduct from metal extraction.
Fly ash (kg/m³): A byproduct of coal combustion.
Water content (kg/m³): Used to form a paste with cement.
Superplasticizer (kg/m³): Enhances the workability of concrete.
Coarse aggregate (kg/m³): Irregular broken stone or naturally-occurring
rounded gravel.
Fine aggregate (kg/m³): Smaller particles (less than 4.75mm) used in
concrete.
Age (days): The age of the concrete, which impacts its strength.
These variables are used to predict the target variable: compressive strength
(measured in MPa).
2.2. Machine Learning Algorithms
Table (1) is a summary of Machine Learning Algorithms Used in this work for
Predicting Concrete Compressive Strength
Algorithm Description Strengths Limitations
K-Nearest Instance-based Simple, intuitive, Sensitive to feature
Neighbors (KNN) method that predicts non-parametric scaling, high
by averaging the computation for
values of the 'K' large datasets
nearest training
samples based on
distance.
Random Forest Ensemble of Robust to Less interpretable,
decision trees built overfitting, handles computationally
on bootstrap samples high-dimensional heavier than single
with random feature data, provides trees
selection; outputs feature importance
are averaged.
Support Vector Finds the optimal Effective in high- Computationally
Machine (SVM) hyperplane in dimensional space, expensive, requires
feature space; good for small careful parameter
supports kernel datasets tuning
methods for non-
linear regression.
3
Decision Tree Recursive splitting Easy to interpret, Prone to overfitting,
of features to predict no need for feature sensitive to data
outputs based on scaling variations
tree structure.
Lasso Regression Linear regression Reduces May ignore
with L1 overfitting, important
regularization that interpretable, correlated features
shrinks some automatic variable
coefficients to zero, selection
performing feature
selection.
Multiple Linear Linear model that Fast, interpretable Poor performance
Regression relates a dependent on non-linear data,
variable to multiple sensitive to
independent multicollinearity
variables under
assumptions of
linearity.
Gradient Boosted Sequential ensemble High accuracy, Requires tuning,
Regression (GBR) of decision trees handles non- prone to overfitting,
where each corrects linearity well slower training
the error of its
predecessor.
XGBoost Optimized gradient Highly efficient, Complex tuning,
Regressor boosting using accurate, scalable, risk of overfitting if
advanced regularized to not well regularized
regularization and reduce overfitting
parallel processing.
AdaBoost Sequential boosting Simple, improves Sensitive to noise
Regressor of weak learners weak models, and outliers
where each focuses reduces bias
on correcting
previous errors using
sample weighting.
Bagging Regressor Parallel ensemble Reduces variance, High computational
using bootstrap prevents cost, less
samples to train overfitting, stable interpretable
multiple regressors
and aggregate
predictions.
Artificial Neural Layered network of Powerful for Requires large data,
Network (ANN) neurons trained with complex patterns, architecture tuning,
backpropagation to flexible, handles black-box model
model complex non- high-dimensional
linear relationships. data
4
3. Results and Discussion
In machine learning, implementing models and ensuring effective data
preprocessing are crucial for achieving accurate predictions. This section outlines
the key steps involved in implementing a machine learning model using Python
as in Appendix (A). The process includes data preprocessing, model training, and
evaluation its performance.
3.1. Import Libraries
Begin by importing essential libraries for data manipulation,
preprocessing, model training, and performance evaluation. The most
commonly used libraries include:
pandas for data manipulation
numpy for numerical operations
matplotlib and seaborn for data visualization
StandardScaler from [Link] for feature
normalization
Model libraries such as sklearn for training various models
Evaluation metrics such as mean_absolute_error and
mean_squared_error from [Link]
3.2. Data Preprocessing
A summary of the numerical data in a DataFrame as shown in Table (2) below.
It gives a concise statistical overview of the dataset's features and is extremely
useful for exploring the data as follows:
Dataset Size:
The dataset contains 1030 observations for each variable, indicating no missing
values in the summary
5
Component-Level Observations
Cement:
1. Mean: 281.17 kg/m³ indicates the average amount of cement used per
mixture.
2. Range: Values vary significantly, from 102 kg/m³ (min) to 540 kg/m³
(max).
3. Distribution:
- 25% of the samples use ≤192.38 kg/m³, while 75% use ≤350
kg/m³.
- Cement usage tends to concentrate in the mid-range.
Blast Furnace Slag:
1. Mean: 73.90 kg/m³ suggests moderate use, but many mixtures may not
include it.
2. Min = 0: Some mixtures don’t use blast furnace slag.
3. Max = 359.4: Certain mixtures rely heavily on it as a substitute for
cement.
4. Skewed Distribution:
- Median is 22 kg/m³, indicating many low-usage samples.
Fly Ash :
1. Mean = 54.19 kg/m³: Fly ash is used sparingly.
2. Min = 0: Some mixtures omit fly ash entirely.
3. Max = 200.1 kg/m³: A few mixtures heavily utilize it.
4. Median = 0: Over 50% of the samples don’t use fly ash.
Water :
1. Mean = 181.57 kg/m³: Typical water content per mixture.
2. Range:
- Min = 121.75 kg/m³, Max = 247 kg/m³.
- Controlled variation in water content likely ensures
workability and strength.
3. Concentration: 50% of samples use between 164.90–192 kg/m³.
Superplasticizer:
1. Mean = 6.20 kg/m³: Average usage indicates minimal but significant
impact.
2. Min = 0: Some mixtures don’t use superplasticizers.
3. Max = 32.20 kg/m³: Occasionally, high quantities are added for specific
properties.
4. Skewness: Most values lie in the lower range.
Coarse Aggregate:
1. Mean = 972.92 kg/m³: Coarse aggregate dominates the mixture.
2. Range: Min = 801 kg/m³, Max = 1145 kg/m³, showing consistent
inclusion.
6
3. Concentration: 50% of values are tightly grouped around the median (968
kg/m³).
Fine Aggregate :
1. Mean = 773.58 kg/m³: Fine aggregate is another significant component.
2. Range: Min = 594 kg/m³, Max = 992.60 kg/m³.
3. Consistency: Values are concentrated, with most mixtures using
between 730.95–824 kg/m³.
Time Factor: Age (days)
Mean = 45.66 days: Average curing time.
Range: Min = 1 day, Max = 365 days indicates diverse curing durations.
Median = 28 days: Aligns with standard concrete curing practices.
Concrete Compressive Strength (MPa)
1. Mean = 35.82 MPa: Typical strength of the concrete mixtures.
2. Range: Min = 2.33 MPa, Max = 82.60 MPa reflects mixtures designed for
different purposes.
3. Distribution:
- 25% of samples have strengths below 23.71 MPa, while
75% are below 46.14 MPa.
- High-strength mixtures (>75 MPa) are rare but present.
Key Insights
1. Cement and Aggregates: Cement, coarse aggregate, and fine aggregate
dominate the mixture, with limited use of fly ash and slag in many samples.
2. Superplasticizer and Water: Low but critical amounts of superplasticizers
are used to adjust the mixture’s workability. Water content remains tightly
controlled.
3. Curing Time Variance: Mixtures with longer curing times likely
correspond to higher compressive strengths.
4. Strength Distribution: Most mixtures achieve moderate compressive
strengths, with a few outliers designed for high-performance applications.
3.3. Exploratory Data Analysis (EDA)
EDA is an important step to build any machine learning project, it is an
approach of analyzing datasets to summarize their main characteristics. With
the help of EDA, we can able to take knowledge of features by just observing
the plots and graphs.
7
Fig (1) Correlation Matrix
3.3.1. Insights from the Correlation Matrix:
1. Cement and Concrete Compressive Strength:
Correlation: 0.50 – This represents a moderate positive
correlation. As the amount of cement increases, the compressive
strength of the concrete also tends to increase.
2. Water and Superplasticizer:
Correlation: -0.66 – A strong negative correlation indicates
that as the amount of superplasticizer increases, the amount of
water required decreases. Superplasticizers improve the
8
workability of concrete, allowing for reduced water content
without compromising fluidity.
3. Fly Ash and Superplasticizer:
Correlation: 0.38 – A moderate positive correlation suggests
that as the quantity of fly ash increases, the quantity of
superplasticizer also tends to increase. This could be because
both components enhance workability and reduce water content
in the concrete mix.
4. Fine Aggregate and Water:
Correlation: -0.45 – A moderate negative correlation implies
that an increase in the amount of fine aggregate is associated
with a decrease in the amount of water used. This could be due
to the ability of fine aggregates to absorb some of the water in
the mix.
5. Age and Concrete Compressive Strength:
Correlation: 0.33 – A positive correlation, though not very
strong, indicates that as the concrete ages, its compressive
strength tends to increase, which aligns with the expected
behavior of concrete gaining strength over time.
6. Blast Furnace Slag and Fly Ash:
Correlation: -0.32 – A negative correlation suggests that in
concrete mixes where blast furnace slag is used, the amount of
fly ash tends to be lower, and vice versa.
7. Water and Cement:
Correlation: -0.08 – This very weak negative correlation
suggests that there is no significant relationship between the
quantities of water and cement in the concrete mix.
These insights from the correlation matrix provide a better understanding of
how different components interact in the concrete mix and can guide decisions
for optimizing concrete strength and workability.
3.3.2. Pairplot:
This pairplot offers a comprehensive visualization of the relationships between
pairs of variables in the dataset. Below is an analysis of the insights derived
from Fig (2):
9
1. Distribution of Individual Variables:
Histograms along the diagonal: These reveal the distribution of each
individual variable.
Cement, blast furnace slag, and fly ash: These variables exhibit a
right-skewed distribution, suggesting that lower values are more
common, with some higher outliers.
Water, superplasticizer, and age: These show a near-normal or
uniform distribution, indicating that their values are more evenly
spread.
Coarse aggregate and fine aggregate: Both variables are left-
skewed, with larger quantities being more frequent.
Concrete compressive strength (csMPa): This variable appears
normally distributed, which is beneficial for many statistical
analysis methods that assume normality.
2. Pairwise Relationships:
Scatter plots off the diagonal: These illustrate the relationships between
pairs of variables.
Cement and concrete compressive strength: A positive
relationship is evident, where higher cement content is generally
associated with higher compressive strength.
Age and compressive strength: A non-linear relationship is
observed, with strength increasing with age up to a certain point
before plateauing. This aligns with the natural curing process of
concrete.
Water and superplasticizer: A negative correlation is visible,
indicating that superplasticizers help reduce water content while
maintaining the workability of the concrete.
Coarse aggregate: It shows no clear correlation with other
variables, especially with compressive strength, suggesting a
weaker or non-existent relationship with other components.
3. Data Density:
Point density in scatter plots: The density of data points varies across
scatter plots, with certain areas being more densely populated. This
suggests that certain mix proportions are more commonly used in the
dataset than others.
10
Fig. (2) Pairplot
This pairplot provides valuable insights into the distribution of individual
variables, their relationships with each other, and the overall density of the data,
helping to guide further analysis and model development.
3.4. Split Features and Target
Separate the dataset into input features (denoted as X) and the target
variable (denoted as y). The input features are the independent variables
that will be used to predict the target.
11
3.5. Train-Test Split
To ensure that the model is evaluated on unseen data, split the dataset into
training and testing sets, typically using an 80/20 split. This allows the
model to learn from a portion of the data while evaluating performance on
the remaining 20%.
3.6. Standardize Features
Normalize the input features using StandardScaler to ensure uniform
feature distribution. This step is crucial as it standardizes the data to have
a mean of 0 and a standard deviation of 1, helping the model to learn
effectively.
3.7. Train the Model
Initialize and train the chosen machine learning model using the scaled
training data. Various models can be used, depending on the task (e.g.,
Linear Regression, Random Forest Regressor, Support Vector Machines
(SVM), Lasso Regression, K-Nearest Neighbors (KNN), Gradient
Boosting Regression, XGB Regressor, Adaptive Boosting Regressor,
Bagging Regressor, Artificial Neural Network (ANN) and Decision Tree).
3.8. Make Predictions
Once the model is trained, generate predictions for the test set. These
predictions will be compared with the actual values to assess model
performance as shown in Fig (3). The scatter plots offer a visual
comparison of how well each model predicted concrete compressive
strength compared to the actual values. The dashed diagonal line in each
subplot represents the ideal case where predicted values perfectly match
the true values (i.e., Predicted = Actual). Here's what we can infer from
each model’s performance:
Top Performers (High Alignment with the Diagonal Line):
Random Forest, XGBoost, Bagging Regressor, and Gradient
Boosting Regressor show points tightly clustered around the diagonal.
These models exhibit high predictive accuracy and low error,
confirming their strong performance as also reflected by their R² scores
above 0.89.
ANN Regressor also shows a relatively tight cluster around the
diagonal with slightly more scatter, indicating good performance
though not as consistent as ensemble models.
12
Moderate Performers (Some Deviation):
Decision Tree and AdaBoost show a reasonable alignment but with
slightly more scatter compared to the top models. These models capture
the underlying pattern well but may overfit or underfit in certain
regions.
KNN Regressor shows more variability and deviation, especially at
higher values, which is typical of instance-based learning algorithms
that can struggle with sparse or high-dimensional data.
Lower Performers (Wider Scatter):
Linear Regression and Lasso Regression have broader scatter
patterns, especially at extreme values. These models struggle with the
nonlinear relationships in the data, leading to underestimation or
overestimation in many cases.
Support Vector Regressor (SVR) also shows considerable deviation
from the diagonal line, with predictions underestimating the actual
values in many instances. This might be due to suboptimal kernel choice
or regularization parameters.
Summary of Visual Insights
Models that utilize ensemble learning (e.g., Random Forest, XGBoost)
clearly outperform others both quantitatively (R²) and visually.
Linear models and simpler methods like Lasso and SVR underperform
due to their limited ability to model complex relationships.
The ANN Regressor, while slightly less accurate than tree-based
ensembles, shows promise with further hyperparameter tuning.
These visualizations reinforce the numerical findings, illustrating that
nonlinear and ensemble models are best suited for predicting concrete
compressive strength due to their ability to capture intricate patterns in the
data.
13
Fig. (3) Actual vs Predicted Concrete Strength
3.9. Evaluate the Model
To evaluate the performance of different machine learning algorithms for
predicting concrete compressive strength, we compared the R² scores across a
range of models as shown in Table (3) and Fig (4). The R² score indicates how
well the model explains the variance in the target variable — with values closer
to 1.0 signifying better performance.
14
Table (3) R² score of each model
Fig (4) Models Comparison
3.9.1. Top Performers
The Random Forest Regressor achieved the highest accuracy with an R² score
of 0.9266, followed closely by XGBoost (0.9213) and Bagging Regressor
(0.9087). These ensemble methods leverage multiple decision trees and
techniques like boosting and bagging, which help in reducing variance and
improving generalization. Their performance confirms that ensemble methods
are particularly effective in capturing complex, nonlinear relationships in the
concrete strength dataset.
15
3.9.2. Deep Learning Approach
The Artificial Neural Network (ANN) Regressor achieved an R² of 0.8536,
which, while lower than the ensemble models, still demonstrates solid predictive
capability. ANN models typically require more tuning (e.g., epochs, layers, and
batch size), so with further optimization, it may perform on par with or better than
traditional models.
3.9.3. Tree-Based vs. Linear Models
While Decision Tree and AdaBoost regressors showed decent performance
(0.8136 and 0.8084, respectively), they were outperformed by their ensemble
counterparts. On the other hand, Linear Regression and Lasso Regression,
which assume a linear relationship between input features and target variable,
recorded much lower scores (~0.69). This suggests that the relationship between
concrete mix components and compressive strength is highly nonlinear.
3.9.4. Support Vector and KNN
The KNN Regressor (0.7967) and Support Vector Regressor (0.6898)
underperformed compared to others. KNN may suffer in high-dimensional
spaces, and SVR can be sensitive to kernel and parameter settings, possibly
explaining their relatively lower accuracy.
4. Conclusion
This study explored the application of various supervised machine learning
algorithms to predict the compressive strength of concrete based on its constituent
materials and curing age. By utilizing a well-established dataset from the UCI
Machine Learning Repository, we implemented and evaluated eleven different
models: Linear Regression, Lasso Regression, K-Nearest Neighbors (KNN),
Decision Tree, Random Forest Regressor, Support Vector Machine (SVM),
Gradient Boosting Regression, XGBoost Regressor, Adaptive Boosting
Regressor, Bagging Regressor, and Artificial Neural Network (ANN).
Comprehensive data preprocessing—including standardization, exploratory data
analysis (EDA), and correlation analysis—helped uncover key relationships
among variables, such as the positive correlation between cement content and
compressive strength, as well as the negative correlation between water and
superplasticizer. These insights informed model selection and guided
expectations regarding the nonlinear interactions in the dataset.
16
The models were evaluated based on multiple performance metrics, with R²
scores serving as the primary benchmark for predictive accuracy. The following
results were observed:
Random Forest Regressor achieved the highest performance with an R² score of
0.927, indicating strong generalization capability and robustness against
overfitting.
Other high-performing models included XGBoost (R² = 0.921), Bagging
Regressor (R² = 0.909), and Gradient Boosting (R² = 0.890), all of which
demonstrated excellent accuracy in predicting compressive strength.
The ANN model also performed well (R² = 0.854), validating its effectiveness
for capturing complex, nonlinear relationships in the data.
Traditional linear models such as Linear Regression (R² = 0.695) and Lasso
Regression (R² = 0.696) underperformed due to their limited ability to model
nonlinear interactions, which are critical in predicting concrete strength.
KNN and SVM displayed moderate predictive ability but were less robust and
sensitive to parameter settings and data scaling.
Overall, the ensemble-based methods outperformed individual learners and linear
models, emphasizing their superior ability to handle nonlinearities, interactions
between features, and variability within the dataset. These findings support the
viability of machine learning—particularly ensemble and deep learning
methods—as efficient, non-destructive tools for predicting concrete compressive
strength with high accuracy.
4.1. Suggestions:
1. Practical Applications:
Implementation in Construction Industry: Encourage construction companies
to integrate ML models into quality control systems for real-time strength
prediction.
Early Detection of Faulty Mixes: Suggest using the model to identify
potentially weak mixes before casting, reducing structural failure risk.
2. Real-World Testing
Field Validation: Recommend applying the model to real-world concrete samples
and comparing predicted vs actual strengths for validation.
17
3. Data Improvement
Expand Dataset Diversity: Recommend collecting data from various
geographic regions, climates, and mix designs to enhance generalizability.
Include More Features: Suggest incorporating additional input features such
as temperature, humidity during curing, or admixtures for better prediction
accuracy.
4. Educational Implications
Curriculum Integration: Suggest incorporating ML-based concrete analysis into
civil engineering curricula to equip students with modern tools.
4.2. Limitations:
1. Limited Dataset Size and Diversity
The dataset used may not cover a wide variety of concrete mix designs,
environmental conditions, or regional practices, which can reduce the
generalizability of the model.
2. Data Quality Issues
The accuracy of predictions heavily depends on the quality of the input data.
Inaccuracies or missing values in the dataset may have affected the model
performance.
3. Simplified Feature Set
Some influential factors such as curing temperature, humidity, or specific types
of admixtures may not have been included due to data unavailability, possibly
limiting prediction accuracy.
4. Assumption of Constant Material Properties
The model may assume constant properties for cement, aggregates, and water,
which may vary in reality due to supplier differences or storage conditions.
5. specifications & instructions
At present, there are no established specifications or instructions regarding the
adoption of artificial intelligence and machine learning applications in conducting
tests to support and enhance work in this area.
18
Appendix (A)
Python Code
19