Introduction

The compressive strength of concrete plays a pivotal role in the structural design and construction process of concrete structures like buildings, bridges, and infrastructure. Serving as a key indicator of overall concrete quality and durability, accurately predicting the compressive strength is essential not only to ensure that the concrete mix design aligns with the requirements of the intended structure, but also to avoid costly and time-consuming complications related to quality control, planning, and scheduling. The compressive strength of concrete is influenced by an array of factors, which include the quality of raw materials, water-to-cement ratio, curing process, ambient temperature, and humidity conditions during and after curing. As these factors can vastly vary, they significantly impact the final compressive strength of the concrete. Hence, precise prediction of the compressive strength is vital to ascertain if it meets the intended strength and durability requirements. Standard tests performed on concrete specimens such as cubes or cylinders are the frequent method employed to predict concrete’s compressive strength. These tests, carried out at varying ages, help assess the concrete’s compressive strength, which has the same mix ratio as the on-site cast concrete. The results can, hence, be used to estimate the compressive strength of in-field concrete and determine the structure’s quality accordingly. Another alternative approach is resorting to mathematical models based on regression analyses such as the maturity model. Accounting for the multiple factors affecting the compressive strength of concrete, mathematical models predict the compressive strength effectively, reducing cost, testing time, and eliminating the need for physical testing.

Ambient temperature and humidity considerably impact the development of concrete strength. Higher temperature and humidity expedite the hydration process, leading to rapid strength gain, yet increasing the potential for cracking and shrinkage. Conversely, low temperature and humidity slow the hydration process, decreasing the concrete's final strength. Optimal strength development necessitates maintaining appropriate temperature and humidity conditions during the curing period [1,2,3]. This importance extends to predicting the compressive strength of concrete, with the maturity method—which evaluates the impact of temperature and ageing on the compressive strength of concrete—being the most adopted approach [4]. To assess the compressive strength development of concrete under varied temperature and humidity conditions, several humidity-adjusted maturity models have been suggested [5, 6]. Despite prior research successfully assessing the time-dependent growth of concrete strength under temperature and humidity influences, the interdependence of these factors is still not fully understood, and there is scope for improving the evaluation's accuracy [5]. Traditional methods of predicting concrete strength mostly incorporate semi-theoretical and semi-empirical models, supplemented by parameters fitted mechanistically to formulate the strength development evaluation. Considering the time-consuming numerical implementation of such evaluation techniques, there is an urgent need for a more accurate and time-efficient evaluation method that improves computing efficiency.

The advent of Artificial Intelligence (AI) has provided a novel approach to predict concrete compressive strength through the application of Machine Learning (ML) models. These models are capable of processing vast amounts of data and identifying complex relationships between variables such as temperature, humidity, and other environmental factors, leading to more accurate predictions. Moreover, these methods are flexible and can adapt to changing conditions, thereby enhancing their robustness and reliability [7]. There has been a proliferation of research in the field of civil engineering utilizing ML approaches to predict the mechanical properties of structural concrete. Various ML algorithms, including Multiple linear regression(MLR) [8,9,10,11], Support vector machine (SVM) [12,13,14,15,16], Artificial neural network (ANN) [17, 18], Decision Trees (DTs) [19,20,21,22], Random Forests (RF) [21, 23], Adaptive boosting (AdaBoost) [13, 20, 21] and Extreme gradient boosting (XGBoost) [24,25,26], have been applied to this task and have shown promising results in structure/bridge health monitoring, mechanical performance prediction, and predictive maintenance.

In the field of concrete research, extensive studies utilizing machine learning techniques have been conducted, covering various types of concrete such as ordinary concrete[27,28,29,30], high-performance concrete [29, 31,32,33,34], and recycled aggregate concrete [35,36,37]. Kakasor Ismael et al. [38] utilized machine learning techniques and multiscale models to assess the influence of silicon dioxide (SiO2) and calcium oxide (CaO) in fly ash on the compressive strength of fresh concrete. Additionally, Yasin et al. [39] employed artificial neural networks (ANNs) to predict the compressive strength of lightweight concrete containing different types of Tuff aggregates, optimizing the optimal content of Tuff aggregates in lightweight concrete. Furthermore, Ahmed et al. [40] introduced innovative modeling techniques, including Multi-Expression Programming (MEP), artificial neural networks (ANNs), and Full Quadratic (FQ) models, to predict the compressive strength of geopolymer concrete, emphasizing the significant impact of curing temperature on the compressive strength of geopolymer concrete. Moreover, Ojeda et al. [41] developed a Convolutional Neural Network (CNN) model trained on a database containing 2650 images of failed concrete cylinders to predict failure types during compression testing of concrete cylinders. While recent studies have focused on improving the accuracy and interpretability of models for predicting the compressive strength of ordinary concrete[42]. It is noteworthy that most research primarily discusses the use of admixture mixing proportions as features for predicting compressive strength, neglecting the influence of curing conditions such as curing temperature and relative humidity, which warrants further investigation.

To address these issues, this study collected a dataset comprising 432 sets of data related to the compressive strength of cement mortars under varying curing conditions. In this dataset, three factors—curing temperature, relative humidity, and curing time—serve as input variables, while the compressive strength functions as the output. This study conducted a comparative analysis of the prediction accuracy of four machine learning models against the empirical mathematical models commonly used in model codes. An investigation into the role of each curing condition on compressive strength was carried out through a 'feature importance' analysis. Leveraging the XGBoost model, the relative importance of different individual features was analyzed to understand the interplay of multiple environmental factors on compressive strength. This study's findings enhance comprehension of the influence of various curing conditions on cement mortars' compressive strength development.

Models for the prediction of compressive strength

Empirical mathematical models

Three empirical mathematical models were also used in this work to estimate the compressive strength of concrete under different curing settings as a verification of the accuracy of the ML method. Two of them are the strength prediction model from the ACI model and the fib model code. Both approaches are based on the maturity method, which involves first calculating the equivalent time and then estimating the compressive strength of concrete using the strength-time development equations, shown as the following equations.

Maturity function

$$t_{e} = \sum\limits_{0}^{t} {e^{{\left[ {13.65 - \frac{4000}{{273 + T}}} \right]}} } \cdot \Delta t$$
(1)

Strength-time equation of ACI model

$$f_{{{\text{cm}}}} (t) = \left[ {\frac{t}{a + b \cdot t}} \right] \cdot f_{{{\text{cm28}}}}$$
(2)

Strength-time equation of fib model

$$f_{{{\text{cm}}}} (t) = e^{{s\left( {1 - \sqrt{\frac{28}{t}} } \right)}} \cdot f_{{{\text{cm28}}}}$$
(3)

where, te is the equivalent time; T is the temperature; \(\Delta t\) is the time interval that the temperature T prevails; \(f_{{{\text{cm}}}} (t)\) is the computed strength in MPa at the age t; \(f_{{{\text{cm28}}}}\) is the mean compressive strength of concrete at the age of 28 days; a, b and s are coefficients depended on both the type of cement and the curing condition of concrete. As the cement applied in this study is CEM I class cement, the parameter values are taken as a = 4.0, b = 0.85, s = 0.38.

The following equations illustrate another empirical mathematical model that we applied to the strength-time equation of the fib model code for strength prediction. This model is based on our previously proposed relative humidity modified maturity method.

RH-modified model

$$t_{{e_{{T,{\text{RH}}}} }} = \sum\limits_{0}^{t} {e^{{\left[ {13.65 - \frac{4000}{{273 + T}}} \right]}} } \cdot \gamma_{{{\text{RH}}}} \cdot \Delta t$$
(4)
$$\gamma_{{{\text{RH}}}} = \frac{{{\text{RH}}}}{100 - k(100 - RH)}$$
(5)

where, \(t_{{e_{{T,{\text{RH}}}} }}\) is the equivalent time effected with temperature T and relative humidity RH; \(\gamma {\text{RH}}\) is the relative humidity factor; k is a coefficient depended on curing age and specimen size.

Machine learning models

The best accurate model for predicting compressive strength in diverse curing conditions is created using four widely used machine learning techniques: linear regression, decision trees, random forests, and XGBoost. The decision tree is a common tree-based single model, while random forests and XGBoost are two frequently employed ensemble models. Linear regression serves as the baseline for all of these models. These models provide in-depth machine learning analysis of concrete compressive strength predictions in this study.

Linear regression

The goal of linear regression is to minimize the residual sum of squares (RSS) between the dataset's responses and the approximations provided by the linear model. Linear regression is still a helpful and popular machine learning technique, despite the fact that it may appear rather straightforward in comparison to other of the more advanced statistical learning techniques. Given a sample \({{\varvec{x}}}_{i}\) with p features, the predicted value \(\widehat{y}\) is determined by:

$$\hat{y}_{i} = w0 + w_{1} x_{i,1} + \ldots w_{i,p} x_{i,p} = {\varvec{x}}^{T} {\varvec{w}}$$
(6)

where, \({\varvec{w}}=\left({w}_{1}, \dots , {w}_{p}\right)\) is the regression coefficients; T denotes the transpose, so that \({{\varvec{x}}}^{{\text{T}}}{\varvec{w}}\) is the inner product between vectors \({{\varvec{x}}}_{i}\) and \({\varvec{w}}\). In the least-squares setting, the optimum coefficients are defined as such that minimizes the sum of mean squared loss:

$${\varvec{w}} = \mathop {\min }\limits_{\beta } \left\| {{\varvec{X}}^{T} {\varvec{w}} - {\varvec{Y}}} \right\|_{2}^{2}$$
(7)

To get the optimized value of the regression coefficients, this process starts with random values for \({\varvec{w}}\), then repeatedly updates the values.

Decision trees

Decision trees (DTs) are a nonparametric supervised learning technique that can be applied to classification and regression issues. It entails breaking up the predictor space into a variety of simple sections. The average of the training observations is often employed to forecast a particular observation. It is a tree-based approach that is straightforward and helpful to explain. However, in terms of prediction accuracy, DTs usually cannot compete with integrated supervised learning methods such as XGBoost.

The predictor space of \({\varvec{X}}\) is divided into J distinct and non-overlapping high-dimensional subspaces, \({R}_{1}, {R}_{2}, \dots , {R}_{J}\). Finding \({R}_{1}, {R}_{2}, \dots , {R}_{J}\) that minimizes the RSS is the objective, given by

$$\sum\limits_{j = 1}^{J} {\sum\limits_{{i \in R_{j} }} {\left( {y_{i} - \hat{y}_{{R_{j} }} } \right)} }^{2}$$
(8)

where, \({\widehat{y}}_{{R}_{j}}\) is the mean response for the training observations within the j-th subspace. To reduce on computing consumption, a greedy top-down method known as recursive binary splitting is employed.

To execute recursive binary splitting, predictor xi,j is initially selected as the cut point, which enables the predictor space to be divided into the regions \(x_{i} \left| {x\left( {i,j} \right)} \right. < s\) and \(\left\{ {x_{i} \left| {x_{i,j} } \right. < s} \right\}\), thereby minimizing the RSS. For any j and s, the pair of half-planes is defined as

$$R_{1} = (j,s) = \left\{ {{\varvec{x}}_{i} \left| {x_{i,j} < s} \right.} \right\}\;{\text{and}}\;R_{2} = (j,s) = \left\{ {{\varvec{x}}_{i} \left| {x_{i,j} < s} \right.} \right\}$$
(9)

and the value of j and s that minimize the equation

$$\sum\limits_{{i:{\varvec{x}}_{i} \in R_{1} (j,s)}} {\left( {y_{i} - \hat{y}_{{R_{1} }} } \right)^{2} } + \sum\limits_{{i:{\varvec{x}}_{i} \in R_{2} (j,s)}} {\left( {y_{i} - \hat{y}_{{R_{2} }} } \right)^{2} }$$
(10)

where \(\hat{y}R_{1}\), \(\hat{y}R_{2}\) are the mean responses of the training observations in R1 (j, s) and R2 (j, s), respectively. To further divide the data and reduce the RSS within each resulting region, the procedure is then repeated in search of the optimum predictor and cut point.

Random forest

Random forest (RF) is an ensemble model that uses bagging as the ensemble method and DTs as the individual model. A seemingly insignificant change that decorrelates the trees makes it superior than packaged trees. The prediction of an ensemble model, typically bagging, is given by

$$\hat{y}_{i} = f({\varvec{x}}_{i} ) = \sum\limits_{k = 1}^{K} {f_{k} ({\varvec{x}}_{i} )}$$
(11)

where \(f( \cdot )\) is final strong learner; \(f_{k} ( \cdot )\) is weak learner generated by the DTs model; K is the number of weak learners.

XGBoost

XGBoost is an upgraded version of the ensemble learning technique Gradient Enhanced Decision Tree (GBDT). It provides an improvement with regard to loss function and loss optimization method. With the assistance of XGBoost, many data science issues may be quickly and accurately solved. To learn the set of weak learners employed in the ensemble model as shown in Eq. (12), XGBoost minimizes the following regularized loss function:

$${\mathcal{L}} = \sum\limits_{i} {l(\hat{y}_{i} ,y_{i} )} + \sum\limits_{k} {\left( {\gamma N + \frac{1}{2}\lambda \left\| {\beta_{k} } \right\|^{2} } \right)}$$
(12)

Here the first term l in the right-hand side measures the difference between the prediction \(\hat{y}_{i}\) and the target yi. The second term Ω penalizes the complexity of the model, where N is tree node number; \(\gamma\) and λ are penalty coefficients; βk is leaf scores. The first term typically uses a squared loss function, while the second term is based on the tree node number N and the leaf's L2 norm. Newton Raphson is adopted for the optimization together with a second-order Taylor's approximation.

Experimental dataset and performance measures

Experimental procedure

The applied dataset includes a total of 432 samples of compressive strength results from experimental test. Temperature, relative humidity, specimen size and curing age are the main features to be investigated in this study. The samples were used with cement mortar and cement paste with a water-to-cement ratio of 0.5, the detail of the mix proportion is shown in Table 1. Cylindrical specimens of two sizes, 5 cm diameter with 10 cm height and 10 cm diameter with 20 cm height, were used for the compressive strength test. Specimens of each size were cured within the curing chamber at three different temperatures with 10℃, 18℃, and 40℃ and four different relative humidity levels with 70%, 80%, 90%, and 100%. Water bath curing is conducted as 100% relative humidity at each temperature during the experiment. After casting, all specimens were immediately relocated to their appropriate curing chambers to suffer the curing temperature and RH on the specimens. According to the ASTM standard test method for compressive strength of cylindrical concrete specimens [43], the mean compressive strength values of each type of mortar were determined based on measurements from three corresponding specimens. To account for the influence of curing temperature and relative humidity (RH) on the specimens at an early age, all specimens were promptly transferred to designated curing chambers immediately after casting. Demolding of the specimens occurred between 12 and 15 h post-casting, depending on the extent of hardening observed in the specimens. Subsequently, all specimens were subjected to a predetermined temperature and RH environment for the specified curing duration. During compressive strength testing, a uniform loading rate of 0.006 mm/sec was applied to ensure consistency across all tests conducted in the study.

Table 1 Mixing proportion of test specimen, unit: kg/m3

Performance measures

In this study, the performance of the prediction algorithms used was examined by taking regular performance measurements using three metrics: correlation of determination (R2), root-mean-squared error (RMSE), and mean absolute error (MAE). R2 denotes the extent of the linear correlation between the predicted and tested values. The value of R2 ranges from zero to one. As R2 is closer to one, the better the performance exhibited by the prediction model. The RMSE is defined as the square root of the mean square error average, which represents the deviation between predicted and actual values. The MAE is a statistical measure of prediction accuracy that reveals the error between predicted and actual data. The lower the RMSE and MAE values, the better the prediction algorithm. The three measures are listed as:

Correlation of determination (R2)

$$R^{2} = 1 - \frac{{\sum\nolimits_{i = 1}^{j} {\left( {P_{i} - T_{i} } \right)^{2} } }}{{\sum\nolimits_{i = 1}^{j} {\left( {T_{i} - \overline{T}} \right)^{2} } }}$$
(13)

Root-mean-squared error (RMSE)

$${\text{RMSE = }}\sqrt {\frac{{\sum\nolimits_{i = 1}^{j} {\left( {P_{i} - T_{i} } \right)^{2} } }}{j}}$$
(14)

Mean absolute error (MAE)

$${\text{MAE}} = \frac{{\sum\nolimits_{i = 1}^{j} {\left| {P_{i} - T_{i} } \right|^{2} } }}{j}$$
(15)

where, Ti and Pi is the experimental compressive strength and predicted compressive strength, respectively; \(\overline{T}\) is the mean experimental compressive strength; j is the number of samples.

Cross-validation of ML models

To construct the prediction model, the experimental data was divided into two parts: the training set and the testing set. The training set is used to create the learners, while the testing set is used to demonstrate the accuracy of the model. In this study, the percentages of the training and test sets in the whole experimental dataset are 80% and 20%, respectively. A tenfold cross-validation procedure was utilized to further illustrate the performance of ML models. This technique separates the experimental data samples into 10 equal subsets, then establishes a good learner with 9 subsets and verifies the model with 1 subset. After repeating this operation 10 times consecutively, the obtained accuracy of the 10 times is averaged as the accuracy of the algorithm. The flowchart of the research procedure is shown in Fig. 1. The sample distribution of the adopted dataset is shown in Fig. 2.

Fig. 1
figure 1

Flowchart of the prediction of compressive strength

Fig. 2
figure 2

Statistical distributions of input variables

Result and discussion

Performance measures of utilized machine learning methods and empirical mathematical models

The comparative performance of applied Machine Learning (ML) models and empirical mathematical models is illustrated in Fig. 3. Evidently, the XGBoost model outperforms others, achieving a remarkable prediction performance, signified by R2 = 0.9293, RMSE = 2.8671, and MAE = 1.9348. The Random Forest model, while not far behind, displays marginally inferior performance with R2 = 0.9264, RMSE = 2.9255, and MAE = 2.0314. Both employ an integrated learning algorithm, amalgamating several weak learners engendered by single learning algorithms to furnish more precise and robust predictions. The Decision Tree model also shows commendable prediction capabilities with R2 = 0.9197, RMSE = 3.0565, and MAE = 2.1403. Despite Decision Tree models typically lagging behind integrated learning algorithm models, in this study it showed comparable performance to the Random Forest model and the XGBoost model. This could be attributed to the relatively small dataset with limited features and samples, which leads to enhanced accuracy and generalizability of the tree models as well as integrated models. It also highlights the suitability of machine learning models for this problem, surpassing the overall accuracy of traditional methods. Furthermore, as the number of samples and features in the dataset grows, the generalization potential of the integrated model, with fitting hyperparameter settings, will further manifest, and even higher accuracy be anticipated. Among the suite of ML models utilized, the Linear Regression model delivered the least desirable performance. With respect to empirical mathematical models, both the ACI and the fib models notably underperformed in terms of model efficiency. The RH-modified model, a derivation of the fib model, significantly enhanced the model's predictive accuracy by integrating the RH influence factor. Consequently, its R2 increased dramatically from 0.2134 to 0.8386. Despite this improvement, its predictive precision still falls short when measured against the prowess of integrated machine learning algorithms. Machine learning algorithms, more specifically the XGBoost and Random Forest models, demonstrate considerable supremacy in predicting the compressive strength of concrete.

Fig. 3
figure 3

Performance measures of utilized prediction models

The predictive outcomes for the compressive strength from the four utilized machine learning (ML) procedures are portrayed in Fig. 4a. The x-axis represents the quantity of samples tested, while the y-axis denotes the compressive strength. The experimental compressive strength is illustrated by the black curve in the figure. The black dashed line in the figure represents the experimental compressive strength, while the colored dashed lines represent the predicted values of each model. The closer the colored dashed lines are to the black dashed line, the more accurate the model predictions are. In the context of Fig. 3, the accuracy of the model's predictions can be assessed by calculating the MAE between the predicted compressive strength values and the experimental curve. A lower MAE indicates greater accuracy, implying that the predicted results are closer to the true values represented by the black curve. Therefore, as the predicted outcomes from decision trees, random forest, and XGBoost exhibit smaller deviations from the experimental curve compared to linear regression, they are considered to have higher accuracy in predicting compressive strength.

Fig. 4
figure 4

Experimental and predicted data of compressive strength by different methods

Figure 4b presents the results of compressive strength evaluation from existing empirical mathematical models. A notable variance is seen between the predicted value of the ACI and fib models and actual experimental values, imputing a low evaluation accuracy. The inaccuracy in these two compressive strength prediction models stems from their failure to accurately determine strength growth under variant temperature and humidity conditions, as they weigh the effects of temperature on strength development and neglect the role of relative humidity. Additionally, the ACI and fib models show strikingly close predicted values. Both models, while employing different strength-time functions, rely on the same maturity model, rendering their development curves analogous at an early age (up to 28 days).

Despite the RH-modified model producing relatively satisfying evaluation results (owing to the model considering both temperature effects and introducing the effect factor of relative humidity into the maturity model), it still lacks the precision of ML methods such as random forest and XGBoost. The tight coupling of parameter fluctuations with specimen size and curing ages was observed while problem-solving related parameters. This model, although advancing over the limitations of the primary maturity method and amplifying the accuracy of compressive strength prediction, doesn't match the accuracy offered by ML methods. The root cause resides in the intrinsic characteristics of prediction methodologies—empirical mathematical models adhere to individual learning algorithms, whereas ML procedures like random forest and XGBoost follow integrated learning algorithms. As integrated learning algorithms incorporate numerous weak learners generated by multiple individual learning algorithms, better-performing weak learners receive higher weights, whereas poor-performing ones get lower weights. Hence, integrated learning algorithms are capable of delivering more accurate predictions.

Figure 5 depicts the scatter plots of the prediction results of each ML models and the empirical numerical models versus the experimental results. The sparsity and linearity of the scatter points offer a better description of the superiority of each prediction approach. Noticeably, the predictions of the ML methods employed in Fig. 5b, c and d are more linear with respect to the experimental values and show better performance in predicting compressive strength. It is worth noting that the empirical mathematical models in Fig. 5e and f result in multiple cases with the same prediction value. This is attributed to the fact that these two models do not have a mechanism for computing humidity. Therefore, different relative humidity conditions at each temperature are considered as in the case of RH = 100 for the calculation. However, during the concrete curing process, it is difficult to maintain curing humidity at 100%, whereby the conventional empirical numerical model overestimates the compressive strength of concrete, which is unfavorable to guiding practical work. The RH-modified model in Fig. 5 improves the prediction accuracy of the empirical mathematical model to a large extent by introducing a humidity factor. Furthermore, it can be found in Fig. 5g that this model shows a higher prediction accuracy in the range of strength ≤ 10 MPa.

Fig. 5
figure 5

Scatter plots of predictive versus experimental compressive strength

Undoubtedly, the evidence above has established the proficiency of machine learning methods in accurately predicting the compressive strength of concrete under various curing conditions. Traditional numerical techniques solely factor in temperature while neglecting the influence of curing humidity, rendering the strength prediction outcomes inaccurate. Conversely, the numerically empirical model with RH adjustment necessitates complicated regression calculations for parameter determination, leading to inefficiency in computation. When juxtaposed with either traditional empirical numerical models or the modified variant, machine learning procedures have evidently exhibited superiority in prediction precision, efficiency, and user-friendliness.

Analysis of the importance of features

Figure 6 illustrates the feature importance ranking of the XGBoost model, trained with typical hyperparameter settings: gamma = 0.1, max_depth = 4, min_child_weight = 4. As depicted in Fig. 6, curing time emerges as the most influential factor affecting compressive strength, with the relative contribution of curing humidity to strength nearly equivalent to that of temperature, underscoring the critical role of relative humidity in strength enhancement. This underscores the importance of incorporating relative humidity when determining the compressive strength of cement. Reflecting on the impact of curing time, temperature, and relative humidity on the process of cement hydration and the progression of strength offers valuable understanding about the dynamics that dictate the compressive strength of concrete. Several research studies have reiterated the indispensable role of these factors. They assert that the curing temperature and relative humidity have a profound and direct effect not only on the process of cement hydration but also on the evolution of the concrete's strength[44]. Suitable curing conditions for concrete are critical for its strength development, durability, and overall performance. According to the American Concrete Institute (ACI), proper curing maintains the desired moisture and temperature conditions both at depth and near the surface for extended periods of time[45]. Therefore, to develop the most accurate predictive models for the compressive strength of concrete, one must take into account the interplay between these crucial factors—curing time, temperature, and relative humidity. This comprehensive understanding aids in our quest to engineer concrete variants with improved performance and functionality.

Fig. 6
figure 6

Relative importance of XGBoost model

Evaluation accuracy at various features

The identification of each environmental parameter's contribution to compressive strength substantially enriches our understanding of the process of strength generation. In this study, an importance analysis was executed on the dataset with each individual feature applied independently. The specific procedure was carried out in the following steps. First, the datasets were partitioned to obtain numerous sub-datasets under distinct curing conditions. Next, XGBoost-based machine learning prediction was implemented on each sub-dataset separately to discern the importance of features under singular conditions. Ultimately, the results of the feature importance under each corresponding condition were collated and subjected to cross-analysis. Utilizing the methodology of the control variable, we were able to ascertain the relative importance of the residual features in compressive strength under a selected feature. Figure 7 graphically represents the relative influence of each feature on compressive strength for a chosen feature. This methodical and systematic approach allows for a more intimate understanding of the intricate interplay between environmental parameters and their impact on the compressive strength of concrete.

Fig. 7
figure 7

Relative importance at each individual feature

The analysis presented in Fig. 7a and b showcases intriguing findings regarding the influence of specific parameters on the compressive strength of concrete specimens. Documented in Fig. 7a, is the observation of how the relative impact of curing temperature and relative humidity on compressive strength diminishes as the size of the specimen increases. In contrast, the impact of curing time on compressive strength noticeably intensifies, suggesting larger specimens are less susceptible to environmental variables like temperature and relative humidity. Thus, larger specimens depict improved cement hydration conditions compared to their smaller counterparts. In Fig. 7b, the relative influence of specimen size, relative humidity, and curing time on compressive strength across multiple curing temperature conditions is depicted. Across the range of curing temperatures, the effects on compressive strength from specimen size, relative humidity, and curing time are observed to be comparatively balanced. Notwithstanding, the data reveals that curing time has the most significant impact on compressive strength, followed by curing temperature, while specimen size carries the least influence. Interestingly, it emerges that the influence of variables other than temperature on strength tends to remain constant across varying temperatures. Insights from these observations carry profound implications for concrete material composition and curing techniques.

In Fig. 7c, an interesting pattern presents itself—as the relative humidity escalates, the effect of the sample size on compressive strength dwindles, even reaching zero when the relative humidity attains a full 100%. This inverse relationship can be attributed to the similar rates of water loss from the surfaces of all specimen sizes under a fixed, unsaturated relative humidity. Consequently, larger specimens reportedly hold more average interior moisture than their smaller counterparts [5]. Thus, showcasing a superior internal environment for cement particles to undergo ample hydration reactions, larger specimens affirm their increased significance. Figure 7d showcases the changing dynamics of effects by relative humidity and temperature on compressive strength with respect to curing time. The influence of relative humidity on compressive strength gains steady traction as curing time elapses, while the impact of temperature wanes in comparison over the same duration.

This pattern implies that sufficient moisture within the specimens expedites cement hydration at the initial curing phase, causing temperature to primarily dictate compressive strength formation. However, with the rise in curing age, the internal moisture in specimens gradually succumbs to the influence of environmental relative humidity, thereby affecting the cement hydration process. By the 28th day of curing, the curing temperature and relative humidity demonstrate nearly matching influences on compressive strength. Nevertheless, the more pronounced average internal humidity in large-sized specimens under unsaturated relative humidity conditions, as compared to their smaller counterparts, leads to greater impacts on compressive strength over time.

Parametric analysis

The application of a machine learning approach effectively enables the generation of prediction results within a specific range of variables. It not only renders it possible to accurately derive predictive findings across a defined array of variables, but also to dissect the impact that shifting curing variables have on the compressive strength of cement mortar in granular detail. Presented in Fig. 8, is the intricate interrelationship drawn from a pairwise analysis of crucial parameters: curing time, temperature, and relative humidity, on the outcome variable—compressive strength. The dynamics demonstrated in this figure underscore the interplay between these parameters in regulating the strength characteristics of the cured cement mortar. When examining each combination of parameters, the third one is held constant and utilized as a reference point. For instance, the influence of time relative humidity on compressive strength, depicted in Fig. 8a, was derived while maintaining the temperature at a steady 18 °C. Here, the selected reference benchmarks for relative humidity, temperature, and curing time are assigned 100% RH, 18 °C, and 28 days, respectively.

Fig. 8
figure 8

Compressive strength at different curing parameters

An intriguing observation manifests in the distinct effects of varied curing parameters on the compressive strength. This translates into a variety of three-dimensional curve forms, represented by the diverse surface patterns revealed in Fig. 8. As shown in Fig. 8a, in the short term (1-day curing period), with the increase of relative humidity (RH), the compressive strength gradually increases, but the magnitude of increase is limited. This indicates that in the initial stage, the influence of relative humidity on compressive strength may be relatively small, and the increase in strength is limited. During the long-term curing period (28-day curing period), with the increase of curing humidity, the compressive strength value increases sharply. This suggests that as the curing time increases, the influence of curing humidity on strength becomes more significant, and the magnitude of increase is also greater. This may imply that in long-term curing, curing humidity plays a more important role in the development of concrete strength. Similar findings are observed regarding the influence of temperature on strength (Fig. 8b). As shown in Fig. 8c, under low temperature (10 °C) conditions, the compressive strength of concrete rapidly increases as the RH rises from 70 to 80%, and remains stable when approaching 100% RH. This phenomenon is not observed under high temperature conditions (40 °C). This indicates that under high temperatures, the influence of relative humidity on the compressive strength of concrete is lower, or that temperature dominates the variation in concrete compressive strength. Additionally, the increase in temperature has a positive effect on the compressive strength of concrete, and this effect is consistent across different relative humidity conditions. These results suggest that there is an interaction between temperature and relative humidity, both of which collectively influence the compressive strength of concrete. However, their effects may exhibit different trends and degrees under different temperature conditions. The computational strength of the employed machine learning method underpins its capability to rapidly and accurately yield predicted results for each unique combination of parameters. This serves to illuminate the intertwined relationship between the parameters, enhancing our comprehension of the mechanisms driving the predictive results significantly.

Conclusion

This study aimed to predict concrete strength using both empirical mathematical models and machine learning techniques across various curing conditions. The original maturity model and an enhanced mathematical model were employed alongside machine learning algorithms such as linear regression, decision tree, random forest, and XGBoost. A dataset comprising 432 experimental compressive strength sets under diverse curing temperatures and humidity levels was utilized. The results emphasized the importance of considering curing parameters, particularly humidity, in concrete strength prediction models. Through evaluating predictive performance, feature importance, and parametric analysis, several significant conclusions were derived.

  • The XGBoost ML model demonstrated remarkable predictive accuracy with an R2 value of 0.9293, outperforming traditional empirical models. Its RMSE of 2.8671 and MAE of 1.9348 underscore its efficacy in predicting concrete compressive strength.

  • Curing time emerged as the most critical factor influencing compressive strength, while curing humidity also played a significant role. The relative contribution of curing humidity to strength nearly matched that of temperature, indicating its importance in strength augmentation.

  • Traditional empirical models like the ACI and fib models showed lower prediction accuracy, with an R2 of only 0.2134. These models often failed to account for curing humidity effects, resulting in less accurate strength predictions compared to ML models.

  • The parametric analysis unveils complex relationships between curing parameters and compressive strength. Notably, it shows that while curing humidity gradually boosts strength over time, temperature fluctuations have varying effects. Concrete strength increases rapidly under low temperatures as humidity rises, but remains stable at higher temperatures.

Despite the effectiveness of machine learning methods in predicting concrete compressive strength under diverse curing conditions, challenges remain regarding model interpretability and real-world applicability. The inherent complexity and opaque nature of many machine learning models hinder the understanding of underlying prediction mechanisms. This lack of interpretability may impede engineers' ability to extract actionable insights, particularly in critical construction scenarios. Practical implementation of machine learning models on construction sites may be constrained by logistical and operational factors, such as the availability of resources and technical expertise.

In future research on compressive strength forecasting, several promising directions are worth noting. Firstly, exploring and experimenting with more advanced machine learning models might yield better results. For instance, ensemble methods could combine the predictions of several smaller models to enhance performance and predictability. Secondly, using larger and more diverse datasets can ensure that the model generalizes the compressive strength prediction better. Moreover, data augmentation techniques can be used to artificially expand the available data. Including more mix variables such as proportions of various ingredients, age of the concrete, type of cement used, and curing conditions can enhance prediction capabilities.