Introduction

Physical and mechanical characteristics of rocks (UCS, porosity, density, abrasion resistance, etc.) affect their areas of application. The economic interest in carbonate rocks is not only associated with the field of civil engineering (e.g., construction materials: marble stones, freestone, aggregates, hydraulic binders) but also with the paper and plastics industries with rubbers, polymers, paints, sealants, adhesives, and pharmaceutical and cosmetic products.

The Uniaxial Compressive Strength (UCS) is one of the most critical mechanical parameters in rocks (Hasanipanah et al. 2022; Hassan & Arman 2022; Moussas & Diamantis 2021). However, in some cases a UCS test cannot be performed because it is costly, time-consuming, and destructive. Therefore, an accurate estimation of this parameter is required (Lai et al. 2016).

Several correlations between mechanical and physical parameters of geomaterials have been established with the UCS. Kurtulus et al. (Kurtulus et al. 2012) determined the mechanical properties of serpentinized ultrabasic rocks through ultrasonic velocity measurements. They found good relationships between UCS and various mechanical parameters (with static elasticity modulus values R2 = 0,7; with ultrasonic pulse velocity R2 is more than 0,8 and with Point load index is(50) R2 is more than 0,9).

Yasar and Erdogan (Yasar & Erdogan 2004) correlated the compressive strength with sound Velocity within carbonate rocks and they found R2 = 0,8. Within concrete, Del Rıo et al. (Del Río et al. 2004a) reported a exponential relationship between compressive strength and ultrasonic pulse velocity. Vasconcelos et al. (Vasconcelos et al. 2008) and Chen et al. (X. Chen et al. 2015) reported good relationships within granitic samples and basalt samples. They found determination coefficients 0,7 and 0,8 respectively. Shariati et al. (Shariati et al. 2011) reported a linear relationship between UCS and ultrasonic pulse velocity within concrete samples with R2 = 0,9. A recent Malaysian study established empirical correlations estimating UCS from ultrasonic velocity measurements for granite and schist samples with R2 = 0,9 (Lai et al. 2016).

Moreover, researchers have developed fast and reliable techniques to determine the characteristics of rocks, such as the ultrasonic method, which appears to be a promising technique for experimental laboratory tests (Lai et al. 2016). Numerous research works have developed different predictive models of the UCS in geomaterials. However, they have several drawbacks, such as lack of accuracy (Del Río et al. 2004b) found R2 = 0.48, Abdelhedi et al. (Abdelhedi et al. 2017) found R2 = 0,6; Arman (Arman 2021) found R2 = 0,5), a small sample size. Kumar et al. (Kumar et al. 2020) were studied a Multiple regression model with 7 samples; Xue and Wei (Xue & Wei 2020) were elaborated a hybrid model with 44 data points; Kamaci and Pelin. (Kamaci & Özer 2018) were established empirical models with 9 samples; Abdelhedi et al. (Mohamed Abdelhedi et al. 2020a) were studied artificial neural network models using 66 samples; Sakız et al. (Sakız et al. 2021) were used 37 samples to create fuzzy inference system models predicting drilling rate index from rock strength and cerchar abrasivity index properties), and the study's regional scope (Sharma et al. (Sharma et al. 2017) were Developed a novel models using neural networks and fuzzy systems for the prediction of strength of rocks in India; Ghorbani and Hasanzadehshooiili (Ghorbani & Hasanzadehshooiili 2018) established models to predict UCS and CBR of microsilica-lime stabilized sulfate silty sand using ANN and EPR models in Iran.

Gowida et al. (Gowida et al. 2021) were created models to predict UCS while drilling using artificial intelligence tools in the Eastern province of Saudi Arabia, Barham et al. (Barham et al. 2020) were staudied Artificial Neural Network models to predict UCS in Um-Qais city in Jordan, Assam and Agunwamba (Assam & Agunwamba 2020) were established models to predict CBR and UCS Values of Ntak Clayey Soils in AkwaIbom State, Nigeria).

Previous models for predicting the physical and mechanical characteristics of sedimentary rocks, such as carbonate rocks, have been found to have significant limitations and drawbacks (as discussed under the second section of this study). With the ongoing international need for the exploration of new georesources, particularly in the wake of recent economic crises, there is a growing need for new and effective methods of mining exploration. The development of models that can accurately predict the characteristics of sedimentary rocks, such as carbonate rocks, is of paramount importance for the identification and exploration of new georesources. These rocks, which are commonly found in various geological formations and are often used as construction materials, play a crucial role in the building industry (Ammari et al. 2022; Ben Othman et al. 2018; Calvo & Regueiro 2010; Mridekh 2002).‬

The objective of this study is to evaluate the performance of state-of-the-art machine learning models in predicting the Uniaxial Compressive Strength (UCS) of carbonate rocks using basic physical tests, namely Ultrasonic Pulse Velocity (UPV), density, and effective porosity.

The remainder of this paper is organized as follows. Section 2 presents the dataset and the machine learning techniques employed in this study. In Sect. 3, the results of the computational experiments are presented and analysed. The findings are then discussed and compared to existing literature in Sect. 4. Finally, in Sect. 5, conclusions are presented.

Literature description

The uniaxial compressive strength (UCS) is a critical mechanical property of the rocks used in various engineering projects. It is used to assess the structural stability against the load. To determine the UCS, it is necessary to use high-quality core samples, which are difficult to obtain because of the presence of foliated, fractured, and weak rocks.

Accordingly, several research works have proposed prediction models of the UCS using different tools (new or classic modeling). Table 1 summarizes previous works that established models that predict the UCS.

Table 1 Literature review

The previous works presented in Table 1 illustrate deferent limitations, such as the lack of metrics for model evaluation. In other words, some metrics do not reflect the accuracy of models. In addition, the lack of data hinders the creation of good models especially when they are restricted to a specific area or country. This table appears to be summarizing various studies that have used different models and input variables to predict various outputs, such as uniaxial compressive strength (UCS). The studies have used a variety of machine learning techniques, including artificial neural networks (ANN), support vector machines (SVM), extreme learning machines (ELM), multivariate regression, and geostatistical algorithms. The sample sizes for the studies range from 9 to 1771, and the models were trained and tested on samples collected from various locations around the world. The models generally achieved good accuracy, with R-squared values ranging from 0.5 to 0.99 and root mean squared error (RMSE) values ranging from 0.09 to 8.17. However, some of the studies had low sample sizes or were limited to a specific region, which may have reduced the generalizability of the results. Some studies also only used one evaluation metric or had low accuracy.

Dataset

In this study, 1001 sets of data samples were gathered from references listed in Table 2. These samples came from a variety of countries, as shown in Fig. 1. The data were obtained from scientific articles published in research journals, and they were collected from studies that aimed to create models for predicting physical and mechanical characteristics of carbonate rocks. The data collected for this study were used to train and test the models, and the results of the modeling efforts were used to predict UCS in carbonate rocks.

Table 2 Origin of the dataset
Fig. 1
figure 1

Samples areas from different countries worldwide

Machine learning algorithms

•Artificial intelligence (AI) is a rapidly advancing field that encompasses a wide range of computational techniques for clustering, prediction, and classification tasks (Ebid 2020). The development of AI algorithms has led to significant advancements in a variety of fields, including healthcare (Elleuch et al. 2021), agriculture (Ayadi et al. 2020), sustainability (Abulibdeh et al. 2022; R; Jabbar et al. 2021; Zaidan et al. 2022), mines exploration (Mahmoodzadeh et al. 2022a) and transportation (Ben Said & Erradi 2022; Rateb Jabbar et al. 2018; Mirzaei et al. 2022; Mahmoodzadeh et al. 2022b; Mahmoodzadeh et al. 2022c; Mahmoodzadeh et al. 2022d; Mahmoodzadeh et al. 2022e).

The field of geology has seen a significant interest in the application of artificial intelligence (AI) in recent years. AI has been applied to a variety of geoscience-related tasks such as the determination of reservoir rock properties, drilling optimization, and enhanced production facilities (Solanki et al. 2022). Additionally, these techniques have been used in carbonate rock exploration for the prediction of rock and mortar UCS values (M Abdelhedi et al. 2020a, b, c). Furthermore, AI has been applied in mining and geological engineering, including rock mechanics, mining method selection, mining equipment, drilling-blasting, slope stability, and environmental issues (Bui et al. 2021).. These applications of AI in geology demonstrate the potential of this technology to revolutionize the field and provide new insights and solutions to geoscience-related problems. It can lead to more accurate and efficient predictions of geotechnical parameters, understanding of rock properties and ultimately to more efficient and sustainable resource management. The use of AI in geology can also aid in the exploration and discovery of new mineral and energy resources. This highlights the potential of AI to be a valuable tool for geologists and engineers in the field of geology, as it can help to improve our understanding of the earth and its resources.

In this study, four techniques were applied for learning: Random-forest regressor, MLP regressor, support vector machine, and XGB regressor. Cross-validation and the GridSearchCV were used for model optimization. In this study, we focused on supervised machine learning models, which are trained using labeled data and are able to make predictions about new, unseen data. We used the most commonly employed methods for building these models, which involve using algorithms to analyze and learn from the data in order to make accurate predictions. The goal of our study was to compare and evaluate the effectiveness of these methods for predicting geotechnical parameters. By understanding the accuracy and capabilities of these models, we can better understand and predict the behavior of geomaterials, which is important for a variety of engineering applications.

Random-forest Regressor

Over the last decades, random forest (RF) has received considerable attention owing to its reliability and Competitive performance. (Bagherzadeh et al., 2021a; Bagherzadeh et al., 2021b; Bagherzadeh & Shafighfard 2022; Shafighfard et al. 2022; Tang & Na 2021). Figure 2 illustrates this technique: a supervised ensemble learning algorithm that constructs a "forest" or ensemble of decision trees (DT). Each DT classifies the data instances. The final classification decision is obtained by aggregating the classification results of all the DTs. The common aggregation mechanism is bagging, which attributes the last class based on majority voting.

Fig. 2
figure 2

Random Forest algorithm

At each node of the decision tree (Fig. 2) entropy is given by:

$$\mathrm{E}=-\sum_{\mathrm{i}=1}^{\mathrm{c}}\mathrm{pi x log}(\mathrm{pi})$$
(1)

where E: Entropy.c: The number of unique classes.pi: Prior probability of each given class.

(Schonlau & Zou 2020).

MLPRegressor

Multi Layer Perceptron is a class of neural network that consists of a set of neurons that are connected in a layered fashion. Each neuron at the intermediate layers is fully connected to neurons from the previous layers. At the neuron level, non linear transformation is applied and results are forwarded to the next layer. MLP is trained using backpropagation algorithm with the objective of minimizing a loss function (Okan 2020). The transformation at the neuron is expressed by:

Then, the output can be expressed by:

$${\widehat{y}}^{(\mathrm{l})}={\int }^{(\mathrm{l})}\left(\sum_{i=1}^{q(l-1)}{w}_{i,j}^{(l)}{\widehat{y}}_{i}^{(l-1)}+{b}_{j}^{(l)}\right)$$
(2)

where: \({\int }^{(\mathrm{l})}\): the activation function of the hidden layer.\({\widehat{\mathrm{y}}}_{\mathrm{i}}^{(\mathrm{l}-1)}\): the output of the neuron of the (l-1)hidden layer.\({\mathrm{w}}_{\mathrm{i},\mathrm{j}}^{(\mathrm{l})}\): the weight between the neuron of the hidden layer and the output layer.b: the bias of the output layer.l: the hidden layer.

(Seo & Cho 2020).

Support vector machine (SVM)

Support vector machine (SVM)(Cortes et al. 1995; Mahmoodzadeh et al. 2022a, b, c, d, e, f) is a traditional machine learning algorithm well known for its simplicity and flexibility in addressing different classification problems. Remarkably, this algorithm has proven its efficiency even for small-scale data sets. The aim of this method is to identify the best position for splitting the data set into a multidimensional space called a hyper plane. A two-dimensional space has a one-dimensional hyper plane, which is just a line. For a three-dimensional space, its hyper plane is a two-dimensional plane that slices the cube, as illustrated in Fig. 3.

Fig. 3
figure 3

Support Vector Machine (SVM)

Support vector regression (SVR) is a flexible technique not only applicable to linear models but also robust to outliers. Large residuals contribute linearly, whereas the loss function ignores points with small residuals (on the basis of a predefined threshold ε). Using linear kernels, SVR is applicable to linear models. By using radial or polynomial kernels, it becomes suited for non-linear predictions. The expression minimized in SVR is provided below where Le is the loss and c is the cost parameter.

$$c{\sum }_{i=1}^{n}{L}_{e} (yi-\widehat{y}i+ {\sum }_{j=1}^{p}\widehat{{\beta }^{2}j}$$
(3)
$$L_e\left(yi-\widehat yi\right)=\left\{\left|yi-\widehat y\left.i\right|\right.-\overset{0\;\mathrm{if}\;yi-\widehat yi<\varepsilon}{\varepsilon otherwise}\right\}$$
(4)

(Gupta et al. 2019).

XGBRegressor

XGBoost (T. Chen & Guestrin 2016) is another tree-based algorithm that is highly effective and widely used in ML applications. It has successfully solved numerous challenging problems in data science (T. Chen & He 2020; Luckner et al. 2017; Paradkar et al. 2001) and has won several ML competitions (Nielsen 2016). XGBoostis trained using a boosting strategy in which multiple successive weak learners are trained. A weak learner, typically a shallow DT, is generally a lightweight model with several parameters. At each step, another weak learner is added to learn from the error of the previous one, as illustrated in Fig. 4. This algorithm has substantial advantages, including memory efficiency and the specificity of weak learners. More specifically, training vulnerable learners requires less memory than the sequential strategy of RF, where strong learners need to be trained to reach a consensus on an instance class. Furthermore, although weak learners do not perform well generally, they perform well in some data instances.

Fig. 4
figure 4

Gradient Boosting Decision Trees

By adding a regularization term into the objective function, the XGBoost algorithm becomes more robust against over-fitting. The overall regularized XGBoost loss is expressed as:

$${\mathrm{Obj}}^{(\mathrm{r})}= \sum\nolimits_{\mathrm{i}=1}^{\mathrm{n}}\mathrm{L}\left(\mathrm{yi}, {\widehat{\mathrm{y}}}_{\mathrm{i}}^{(\mathrm{r})}\right)+\sum\nolimits_{\mathrm{i}=1}^{\mathrm{r}}\Omega ({\mathrm{g}}_{\mathrm{r}})$$
(5)

where yi is the real value, \({\widehat{\mathrm{y}}}_{\mathrm{i}}^{(\mathrm{r})}\) is the prediction at the r-th round, gr is the term denoting the structure of the decision tree, L \(\left(\mathrm{yi}, {\widehat{\mathrm{y}}}_{\mathrm{i}}^{(\mathrm{r})}\right)\) is the loss function, n is the number of training examples, and \(\Omega \left({\mathrm{g}}_{\mathrm{r}}\right)\) is the regularization term given by:

$$\Omega \left({\mathrm{g}}_{\mathrm{r}}\right)=\mathrm{\gamma T}+\frac{1}{2}\uplambda \sum\nolimits_{\mathrm{j}=1}^{\mathrm{T}}{\mathrm{w}}_{\mathrm{j}}^{2}$$
(6)

where T is the number of leaves, w is the weight of the leaves, \(\uplambda\) and \(\upgamma\) are coefficients whose default values are set at \(\uplambda =1\), \(\upgamma\) = 0(Rzychoń et al. 2021).

Cross-validation

Cross validation is a model evaluation method that is better than residuals. The problem with residual evaluations is that they do not give an indication of how well the learner will do when it is asked to make new predictions for data it has not already seen. One way to overcome this problem is to not use the entire data set when training a learner. Some of the data is removed before training begins. Then when training is done, the data that was removed can be used to test the performance of the learned model on ``new'' data (Anderssen et al. 2006; Brereton 2006; Broadhurst & Kell 2006; Westerhuis et al. 2008).

GridSearchCV

Adjustable parameters called hyperparameters can be used to control the training process of a model. To find the best configuration of these hyperparameters, we can use a process called hyperparameter optimization. This involves searching for the combination of hyperparameters that leads to the best model performance. However, this process is often manual and requires significant computational resources.

GridSearchCV is a class established by a scikit-learn framework for parameters adjustment that estimators implement (Müller & Guido 2016).

Model's metrics

In this study, three performance indices, namely the coefficient of determination (R2), the mean absolute error (MAE) and the root mean square error (RMSE) were used.

The mean absolute error (MAE) and root-mean-square error (RMSE) for evaluating the performance of the established model and the correlation coefficient (R) are defined as follows:

$$MAE=\frac{1}{n}{\sum }_{i=1}^{n}\left|{y}_{i}-{x}_{i}\right|$$
(7)
$$RMSE=\sqrt{\frac{1}{n}{\sum }_{i=1}^{n}(}{y}_{i}-{x}_{i}{)}^{2}$$
(8)
$${R}^{2}=1-\frac{{\sum }_{i=1}^{n}{(Y}_{i}-{\widehat{Y}}_{i}{)}^{2}}{{\sum }_{i=1}^{n}{(Y}_{i}-{\overline{Y} }_{i}{)}^{2}}$$
(9)

where yi and xi denote respectively the preferred output and estimated output;y̅ and x̅ denote average values, whereas n denotes each sample in the data set (Abdurrahim Akgundogdu 2020; Mahmoodzadeh et al. 2022a, b, c, d, e, f; Tiyasha et al. 2020).

SHapley Additive exPlanations (SHAP)

The Shapley Additive Explanations (SHAP) method was utilized in the analysis of primary factors that influence Uniaxial Compressive Strength (UCS) value of carbonate rocks. SHAP (Biecek & Burzykowski 2021; Molnar 2022), as a game theoretic method, explains the output of any machine learning model by connecting optimal credit allocation to local explanations through the use of game theory's traditional Shapley values and their related extensions.

In mathematical terms, the Shapley values, denoted by ϕj, provide a way to attribute a "fair" value of a feature j to the prediction of an instance. The Shapley values are defined as the average marginal contribution of a feature j over all possible coalitions of feature values. Mathematically, the Shapley values for a feature j can be defined as:

$$\mathrm{\phi j}(\mathrm{f})=(1/|\mathrm{F}|!) \sum \_\{\mathrm{S}\subseteq \mathrm{F}-\{\mathrm{j}\}\} |\mathrm{S}|! (|\mathrm{F}|-|\mathrm{S}|-1)!\mathrm{ f}(\mathrm{S}\cup \{\mathrm{j}\})-\mathrm{f}(\mathrm{S})$$
(10)

Where F is the set of all features, S is a subset of F, and f is the prediction function.

The SHAP values, denoted by Φj, are a unified measure that combines the Shapley values with local explanations. The SHAP values represent the contribution of a feature j to the prediction of an instance and are defined as:

$$\mathrm{\Phi j}(\mathrm{x})=\mathrm{\phi j}(\mathrm{f})+\mathrm{E}[\mathrm{f}(\mathrm{x})]-\mathrm{E}[\mathrm{f}({\mathrm{x}}^{\mathrm{^{\prime}}})]$$
(11)

Where x is the instance being explained, x' is a reference instance sampled from the background dataset, and E[f(x)] is the expected value of the prediction function over the background dataset.

As conclusion, SHAP uses the Shapley values to attribute a fair value to each feature and combines them with local explanations to provide a unified measure of feature importance called SHAP values.

Carbonate rock tests

Tests must be performed in the laboratory to determine the physical and mechanical parameters of rocks. The uniaxial compressive strength test (UCS), effective porosity, density, and ultrasonic pulse velocity are parameters that determine the mechanical and physical characteristics of rocks.

UCS

We calculated the UCS by dividing in the loaded surface area (MPa) the applied compressive stress applied by the testing machine (Amiri et al. 2022; Y. Liu & Dai 2021; Mohamed et al. 2018).

Ultrasonic velocity test

We used the transmission method to identify the 'P' longitudinal wave velocities. We placed the ultrasonic receiver transducers and the transmitter perpendicularly to the load axis. The ultrasonic device determined the ultrasonic pulse velocity (Mohamed Abdelhedi et al. 2020a; Mohamed Abdelhedi & Abbes 2021).

Effective porosity and density

The volume occupied by the water flow represents the effective porosity. Thus, we saturated the specimens with water to identify the effective porosity (Pe), defined as the following:

$${\mathrm{P}}_{\mathrm{e}}={\mathrm{V}}_{\mathrm{pi}}/{\mathrm{V}}_{\mathrm{t}}$$
(12)

Where Vpi and Vt represent respectively the volume of the connected pores and the sample volume (Lafhaj & Goueygou 2009; Peng & Zhang 2007).

The density represents the mass of the specimen contained in a given volume unit, expressed in kN/m3 or kg/m3(Mohamed Abdelhedi et al. 2020b; Peng & Zhang 2007).

Results and discussion

We conduct correlation analysis to investigate the relationship between data features. Figure 5 shows relationships between different variables (dependent and independent). It is noted that the coefficient of determination varies between -1 and 1. When the color is very dark or very light, a strong relationship between the two corresponding variables is determined.

Fig. 5
figure 5

Variables Heatmap

This figure shows a strong negative linear relationship between the uniaxial compressive strengthand effective porosity, and in contrast, a strong negative linear relationship between effective porosity and ultrasonic wave velocity. However, there is a strong positive linear relationship between ultrasonic velocity and uniaxial compressive strength.

Nguyen-Sy et al. (Nguyen-Sy et al. 2020) used a similar representation in rating the relationship between cement ratio, blast furnace slag, fly ash, water, superplasticizer, coarse aggregate, fine aggregate, age, and UCS within concrete. This study found a good relationship between the UCS and age and between the UCS and cement ratio within concrete samples.

Table 3 shows the statistical parameters of the dataset. The range of all variables was enormous: ultrasonic velocity was 6325 m/s, density was 1.91, effective porosity was 42.14%, and MPa of UCS was 179.76. This extensive range allows a good modelling margin, making the model more valuable and the prediction more feasible.

Table 3 Dataset statistical parameters

The density of the samples varied between 1.43 and 3.34, where as the effective porosity varied between 0.01% and more than 40%.Theuniaxial compressive strength varied between less than 1and more than 180 MPa, where as ultrasonic velocity varied between 1110 and 7435 m/s. These results indicate different categories of carbonate rocks such as hard, ductile, and brittle.

Four machine learning algorithms were applied to create four different models predicting this parameter: 'RandomForestRegressor' (Fig. 6), 'MLPRegressor' (Fig. 7), 'support vector machine' (Fig. 8), and 'XgboostRegressor' (Fig. 9).

Fig. 6
figure 6

Expected versus observed UCS values using RandomForestRegressor modeling

Fig. 7
figure 7

Expected versus observed UCS values using MLPRegressor modeling

Fig. 8
figure 8

Expected versus observed UCS values using SVM modeling

Fig. 9
figure 9

Expected versus observed UCS values using XgboostRegressor modeling

RandomForestRegressor algorithm (Fig. 6) shows a straight distribution of points, giving a coefficient of determination (R2) equal to 0.65.

The points illustrated in Fig. 7 are more aligned, providing a better coefficient of determination (R2 = 0.94). This figure shows the model created by the MLPRegressor algorithm.

Figure 8 presents a model correlating the predicted UCS values using SVM modelling with the tested values. The coefficient of determination of this linear relationship is 0.78.

The XgboostRegressor algorithm's model gives a linear relationship with R2 = 0.89 between predicted UCS values and observed values.

These models were optimized using 'Grid_searchcv' as an optimization algorithm and validated using 'cross-validation.

Table 4 shows the evaluation of the different models using different metrics. In this study, we compared the prediction accuracy of UCS in various machine learning models. We employed three different metrics: mean squared error (MSE), coefficient of determination (R2), and mean absolute error (MAE).

Table 4 Machine learning models evaluation

Before optimization and validation of models, the MLPRegressor algorithm had the lowest mean squared error (584.06), the lowest mean absolute error (20.07), and the best coefficient of determination (0.94). However, with the RandomForestRegressor algorithm, MSE = 5949.55, MAE = 60.35 and R2 = 0.65, with the SVM algorithm, MSE = 3109.17, MAE = 40.99 and R2 = 0.78, and with the XGBRegressor algorithm, MSE = 1753.56, MAE = 32.83 and R2 = 0.85.

After model optimization, the majority of scores improved, and the results show that both SVM and MPL models are the best, with a score equal to 0.91.

After model validation, the cross-validation algorithm divides the data into four parts, and we obtained four very similar scores for each metric, which indicates very good validations (Table 4).

The model that contains the lowest number of errors was created by the XGBRegressor algorithm (MSE is between 438.95 and 590.46, and MAE is between 17.22 and 18.79). However, two models show good coefficients of determinations (R2 of the MLPRegressor model is between 0.92 and 0.94, and R2 of the XGBRegressor model is between 0.91 and 0.94).

The model created by MLPRegressor showed, after validation, good coefficients of determination, but it also had vast errors (more than 6000 of MSE).

The results indicated the best model that presents the best coefficients of determinations and fewer errors is the model created by the XGBRegressor algorithm.

Furthermore, a three-fold cross-validation analysis(Schaffer & Edu 1993) was performed to validate the performance of the proposed model and mitigate the potential issue of over fitting. The data was partitioned into three equal segments and each segment was utilized as the validation set while the remaining two were employed as the training set. The results of the validation were then averaged to obtain a comprehensive accuracy score for the model. This procedure was repeated three times, with each segment utilized once as the validation set, thereby ensuring the comprehensive testing of the model on all available data. The results of the analysis confirmed the obtained findings and demonstrate that the best model, in terms of its coefficients of determination and lower error rates, was the model created by the XGBRegressor algorithm.

Liu et al. (Z. Liu et al. 2015) also used MLPRegressor (artificial neural networks using an extreme learning machine) and found scores of approximately 0.7. However, they employed small data sets to estimate the UCS of carbonate rocks (54 samples).

Aboutaleb et al. (Aboutaleb et al. 2018) used 482 samples to create three models (support vector machine, artificial neural network, and multiple regression analysis) predicting the UCS of carbonate rocks. The authors found three R2 higher than 0.9. However, they were selected from one place (Iran), and thus, the interpretation of the results was regional.

Ceryan and Samui (Ceryan & Samui 2020) established three models by applying the extreme learning machine (ELM), the minimax probability machine regression (MPMR), and the least square support vector machine (LS-SVM). They found R2 of approximately 0.9; however, they used just 47 samples, and the study was localized in NE Turkey.

Nguyen-Sy (Nguyen-Sy et al. 2020) established three models by applying the ANN, SVM, and XGBoost methods with 1030 collected concrete datasets. They found R2 between 0.91 and 0.93.

From the Middle East region in the Eastern Province of Saudi Arabia, a data set of 1771 data points was obtained. To create the models, researchers employed the support vector machine (SVM), the adaptive neuro-fuzzy inference system (ANFIS), and the artificial neural network (ANN).Models were evaluated using the R-value and AAPE as metrics (Gowida et al. 2021).

The Shapley Additive Explanations (SHAP) method was utilized in this study to conduct a comprehensive analysis of the primary factors that impact the Uniaxial Compressive Strength (UCS) of carbonate rocks. The SHAP method, rooted in coalitional game theory, was employed to calculate the Shapley values, which are a fair measure of feature importance among the data instances. The feature values were considered as players in a coalition and the Shapley values determined their relative contributions to the prediction of UCS.

The results of the feature importance analysis, as presented in Fig. 10, indicated that Density and Porosity were the most significant features affecting the Uniaxial Compressive Strength (UCS) of carbonate rocks. In contrast, Ultrasonic Pulse Velocity was found to have limited impact on the prediction of UCS. These results suggest that Density and Porosity play a crucial role in determining the UCS of carbonate rocks.

Fig. 10
figure 10

Feature importance analysis of UCS factors using SHAP

To further evaluate the generalization capability of the proposed model, a second feature importance method, Permutation Importance, was applied using the Eli5 library (Korobov 2017). The results of this analysis were consistent with the findings obtained through the SHAP method, emphasizing the crucial role of Density and Porosity in the prediction of UCS. The weight values of Density and Porosity were 0.9014 ± 0.0876 and 0.7843 ± 0.0822, respectively, while Ultrasonic Pulse Velocity had a weight value of 0.0291. These results reinforce the conclusion that Density and Porosity are the primary determinants of UCS in carbonate rocks.

Conclusions

The goal of this study was to develop an accurate international model for predicting the uniaxial compressive strength (UCS) of carbonate rocks using ultrasonic velocity, effective porosity, and density as input variables. A dataset was compiled from 26 countries worldwide, consisting of data from scientific papers that used these input variables to predict UCS. Four artificial intelligence models were trained and tested using this dataset: random forest regressor, MLPRegressor, SVM, and XGBRegressor.

Initially, the model developed using the MLPRegressor method was found to be the best according to the evaluation metrics used. However, after optimization and validation, both the MLPRegressor and XGBRegressor models were found to have good performance based on the R2 metric. Upon further evaluation using all three metrics (R2, MSE, and MAE), the XGBRegressor model was found to be the most accurate, with R2 values between 0.92 and 0.94, MSE less than 600, and MAE less than 20.

This study represents the first attempt to predict the UCS of carbonate rocks using a model that spans 16 countries and four continents. The results of this study show that the XGBRegressor model developed in this study can be used to accurately estimate the UCS of any carbonate rock found on the earth's surface.

As future work, we plan to investigate the use of advanced machine learning techniques, such as deep learning or transfer learning, to develop and refine models for predicting the uniaxial compressive strength of carbonate rocks. This could potentially improve the accuracy and performance of the models. Additionally, we will continue to study the influence of variables such as grain size, mineral composition, and rock type on the uniaxial compressive strength of carbonate rocks to gain a more comprehensive understanding of the factors that contribute to the strength of these materials.