Predicting maternal risk level using machine learning models Authors: Sulaiman Salim Al Mashrafi, Laleh Tafakori, Mali Abdollahian Published: 2024 ABSTRACT BackgroundMaternal morbidity and mortality remain critical health concerns globally. As a result, reducing the maternal mortality ratio (MMR) is part of goal 3 in the global sustainable development goals (SDGs), and previously, it was an important indicator in the Millennium Development Goals (MDGs). Therefore, identifying high-risk groups during pregnancy is crucial for decision-makers and medical practitioners to mitigate mortality and morbidity. However, the availability of accurate predictive models for maternal mortality and maternal health risks is challenging. Compared with traditional predictive models, machine learning algorithms have emerged as promising predictive modelling methods providing accurate predictive models.MethodsThis work aims to explore the potential of machine learning (ML) algorithms in maternal risk level prediction using a nationwide maternal mortality dataset from Oman for the first time. A total of 402 maternal deaths from 1991 to 2023 in Oman were included in this study. We utilised principal component analysis (PCA) in the ML algorithms and compared them to the results of model performance without PCA. We employed and compared ten ML algorithms, including decision tree (DT), random forest (RF), K—Nearest Neighbors (KNN), Naïve Bayes (NB), Extreme Gradient Boosting (xgboost), Linear Discriminant Analysis (LDA), Quadratic Discriminant Analysis (QDA), Logistic Regression (LR), Support Vector Machine (SVM) and Artificial Neural Network (ANN). Different metrics, including, accuracy, sensitivity, precision, and the F1- score, were utilised to assess Model performance.ResultsThe results indicated that the RF model outperformed the other methods in predicting the risk level (low or high) with an accuracy of 75.2%, precision of 85.7% and F1- score of 73% after PCA was applied.ConclusionsWe applied several machine learning models to predict maternal risk levels for the first time using real data from Oman. RF outperformed the other algorithms in this classification problem. A reliable estimate of maternal risk level would facilitate intervention plans for medical practitioners to reduce maternal death.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12884-024-07030-9. Introduction Maternal mortality is the death of a pregnant woman or the death of a woman during childbirth or within 42 days of pregnancy termination from any related pregnancy causes, regardless of the duration and the site of pregnancy [1]. The definition excludes incidental or accidental causes, such as road traffic accidents or other external causes. The Civil Registration and Vital Statistics (CRVS) system is the preferable source of maternal deaths with one condition, which is a high percentage of completeness and high-quality cause of death reporting. The maternal mortality ratio (MMR) is a global indicator that reflects maternal status globally. The MMR is calculated as the number of maternal deaths for a specified period divided by the number of live births in the same period [2]. The final result is multiplied by a factor of 100,000. Hence, the MMR is expressed per 100,000 live births. On the basis of recent estimates, every day, there are about 800 maternal deaths, which is approximately equivalent to the death of a woman every two minutes [3]. The global MMR was estimated to be 223 per 100,000 live births in 2020, with an average reduction rate of 2.1% from 2000–2020. The forecasted MMR value for 2030 is estimated to be 222, which is three times higher than the targeted value of MMR = 70 [3]. According to the World Health Organization’s estimates, the MMR in the Arab states was 145 per 100,000 live births in 2020, a significant decrease of about 44% compared with that in 2000 [3]. Despite this decrease in the MMR, more effort is still needed to minimise the burden of maternal deaths in Arab countries [4]. Reports from the Gulf Cooperation Council (GCC) Statistical Centre reveal the differences in the MMR among the six countries (Oman, United Arab Emirates (UAE), Qatar, Kuwait, Kingdom of Saudi Arabi (KSA), and Bahrain). The latest report showed that Oman has the highest MMR, with a value of 45.7 maternal deaths per 100,000 live births during the COVID-19 pandemic in 2021. This value is significantly higher than the lowest MMR of 1.9 reported in Kuwait, and the second highest country which is Bahrain with an MMR equal to 21.5 [5]. The other countries ranked from highest to lowest were the KSA, Qatar, and UAE, with MMRs of 11.9, 3.5, and 3.0, respectively. Moreover, in 2023, MMR increased in Oman to 19.9 (17.1 in 2022) [6]. In addition, the reduction is very slow in Oman, with no clear trend. For instance, when the MMR in 2023 was compared with that in 1998, the MMR was reduced by only 5.4%. In addition, the indicator fluctuated during this period and reached different peaks in some years as shown in Fig. 1. The MMR is defined as the number of maternal deaths divided by the total number of live births for the same period multiplied by 100,000. Therefore, any fluctuation in the number of maternal deaths or live births would change the value of MMR. For example, in 2021, there were 32 maternal deaths among Omani women, with 75,192 live births; thus, the MMR was calculated to be 42.5. Compared to 2019, (maternal deaths = 11 and the number of live births = 77,947, resulting in an MMR of 14.1).Fig. 1MMR among Omani females aged (15–49) years from 1998 to 2023 MMR among Omani females aged (15–49) years from 1998 to 2023 In the following section, the application of machine learning models to predict maternal mortality risk and the variables associated with it are outlined Key predictors of maternal mortality Different distal and proximal key performance indicators (KPIs), including demographic, socioeconomic, health status, and health system-related factors, contribute significantly to the rise in MMR globally. This section outlines the key significant predictors of maternal mortality. The WHO utilised three main determinants to predict maternal mortality in a time series model [3]. These factors include gross domestic product (GDP), general fertility rate (GFR), and skilled attendance at birth (SAB). Similar predictors were identified in the different research outcomes with varying study designs. For instance, GDP and the percentage of current health expenditures of the total GDP were found to be significantly associated with maternal deaths in other countries, such as South Sudan [7], China [8] and Ecuador [9]. The population’s demographic characteristics play a crucial role in the epidemiological status of the population. The age of the mother has been reported to be a significant predictor of maternal death [10]. It has been reported that giving birth at ages less than 18 years or above 35 years is associated with a higher risk of maternal complications [11, 12]. For instance, the increase in MMR in the Netherlands was attributed to the increase in the average age of pregnancy [13]. A study from Canada reported that mothers aged 40–44 years and mothers aged 45 years or older are at higher risk of maternal death, with odds ratios of 3.39 and 4.39, respectively, than are mothers aged 20–24 years [14]. Furthermore, Poorolajal et al. [15] reported that advanced maternal age (≥ 35 years) is associated with a greater risk of maternal death by more than eight times than maternal age less than 34 years (odds ratio = 8.48). Thus, there is consensus among studies that maternal age is a risk factor for maternal mortality. Additionally, some predictors at the individual level, such as high parity, gravidity, and gestational weeks, were found to have a statistically significant relationship with maternal death. Moyo et al. [16] reported that a parity of more than 8 increases the risk of maternal mortality by an odds ratio of 2 compared with a parity of 0–4. A case–control study in Nigeria reported that women with zero parity and women with a parity greater than 4 have a higher risk of maternal death, with odds ratios of 2.17 and 2.91, respectively, than women with (1–2) parity [17]. Gestational age (GA) in weeks is another significant factor related to maternal death. Preterm GA (< 37 weeks) is associated with a 1.73-fold greater risk of maternal death than term GA (37 -42 weeks) is [15]. Apart from this, maternal education has been found to have a positive impact on reducing maternal deaths in low- and middle-income countries, however, in upper-middle-income countries, no consensus has been found concerning this factor [18]. A case–control study from Zambia revealed that women with formal education have a lower risk of maternal death than women with no education (odds ratio = 0.5) [16]. A study from Argentina, an upper-middle country, reported no differences between educational levels and maternal death status [19]. Hence, maternal educational level has different impacts in countries according to income level. Pregnant women with existing comorbidities and risk factors are at higher risk of developing adverse health outcomes. For instance, obesity is a well-known risk factor for comorbidities and mortality. In addition, obesity has been reported as a common comorbidity associated with maternal death [20]. It has been reported that morbidly obese women are at higher risk of developing direct maternal causes, such as hemorrhage, as well as indirect causes, including cardiac diseases [13]. Furthermore, nutritional status and medical history are risk factors of maternal death [10]. Ray et al. [21] reported that 68% of maternal deaths in Canada from 2002 to 2017 had at least one severe maternal morbidity indicator compared with 1.7% of women who survived. Additionally, compared with surviving mothers, mothers who died more often had higher existing diabetes (16.6% vs 7.2%), higher gestational hypertension (9.4% vs 4.0%), hypertension (12.7% vs 3.4%), and higher renal disorders (8.3% vs 0.3%). Socioeconomic status is a predictive factor for good health. There are apparent disparities between low-income countries and high-income countries. Overall, low-income countries have higher MMR rates than high-income countries do [22]. Jeong et al. [23] stated that women with lower incomes have a 2.42 times higher risk of developing maternal death within six weeks than women with higher incomes. The authors added that in low-income settings, this risk is greater among women living in rural areas, aged 35–39 years and who delivered via cesarean section. Additionally, the MMR is influenced by racial disparities. For example, the MMR was found to be higher among black women than among white women, and the MMR is more prevalent among American Indian females and Alaskan Native individuals [24]. Machine learning algorithms to predict maternal health risk ML applications are widely spreading across all areas, including healthcare, owing to their ability to model linear and nonlinear relationships [25, 26]. Exploring the predictors of maternal mortality and pregnancy health risks using new technologies such as ML and AI is necessary in modern life [27]. ML algorithms could make diagnosis easier by explaining intricate relationships, helping to reduce medical errors, and improving the population's health [28, 29]. In the last few years, the employment of ML in pregnancy-related predictions has increased [28]. This paper explores maternal risk level prediction utilising different machine learning applications. Early diagnosis of pregnancy health risks is of paramount importance to reduce maternal mortality. Özsezer and Mermer [27] employed ML algorithms, including Logistic Regression (LR), Random Forest (RF), K-Nearest Neighbor (KNN), Artificial Neural Networks (ANN), Support Vector Machine (SVM = SVC), CatBoost, XGBoost (XGB), LightGBM and Classification, Regression Tree (CART) and Gradient Boosting Machine (GBM), to predict risks during pregnancy. The study concluded that CatBoost and LightGBM provided the best prediction models, with an accuracy of 88%. Assaduzzaman et al. [29] reported that random forest is the best ML algorithm for predicting the level of risk of maternal health (low, medium, and high), with accuracy, precision, recall, and an F1- score of 90% each. In addition, the study concluded that blood sugar has the most significant impact on the classification results, followed by age. Ravi et al. [30] found a similar conclusion, with the highest accuracy of 85.8% achieved by random forest. The authors in [31] applied a cross-industry standard process for data mining (CRISP-DM) using a decision tree and random forest for classifying maternal risk (Yes, No) and concluded that the random forest has 98% accuracy for this classification problem. Togunwa, Babatunde and Abdullah [32] utilised maternal health risk data to classify maternal risk levels using14 ML algorithms. The authors reported that RF attained the highest accuracy of 76%. They also developed a hybrid model by combining RF and ANN to improve the performance of the predictive model. The hybrid model improved the performance measures significantly, with 90% accuracy, precision, and recall and an F1- score of 0.97. Rahman and Alam [33] classified the maternal risk level with its three levels using 14 ML algorithms and reported that the Gradient Boosting algorithm achieved the highest accuracy (90.6%), followed by RF (90.1%). They identified blood sugar, diastolic blood pressure, and age as the most important features ranked from highest to lowest. In [34], several traditional ML algorithms for predicting maternal risk levels were compared with other traditional methods. The study reported that the RF algorithm based on k-fold cross-validation outperformed other algorithms, with an accuracy of 70.2%. One study proposed classifying maternal health risk levels using the Naïve Bayes algorithm. Multinomial, Bournolli, and Gaussian [35]. The multinomial and Bournolli models produced the highest accuracy rate of 84.8%, whereas the Gaussian model achieved an accuracy of 82.6%. The early identification of vulnerable groups at high risk during pregnancy is paramount. The identification of new innovative predictive methods is necessary to identify high-risk pregnant women in Oman. ML applications are widely spreading across all areas including, healthcare due to their ability to model complex linear and nonlinear relationships [25, 26]. Therefore, this paper explores several ML algorithms for predicting the level of maternal risk (low or high) for maternal mortality using real de-identified data from the health information system in Oman. This paper will add value to the growing body of ML applications in the health sector and enhance evidence-based decision-making in Oman to improve the health of mothers and babies. Studies predicting the risk level of maternal mortality are scarce globally, and none have been found in Arab countries, including Oman. Methods Data description This study is a quantitative research design that uses nationwide secondary data from different available sources in Oman. The primary source of births and deaths is Oman’s Civil Registration and Vital Statistics (CRVS) system. Data are collected routinely by the health information system in Oman, where every single birth or death is notified directly from the health institution. The information was cross-checked with the hospital patient management system (ALSHIFA). Furthermore, information was validated from records collected by the National Maternal Mortality Review Committee (NMMRC). The committee collects and reviews the information on every single maternal death in Oman to ensure data quality checks. The list of variables used in this study together with their types are presented in Table 1.Table 1List of variablesFeatureroleTypedefinitionRisk levelOutcomeBinary(Low, High)The grade or level of maternal riskGravidaIV*NumericalThe number of pregnanciesAgeIV *NumericalAge of mother at deathabortionsIV *NumericalNumber of previous abortionsLive birthsIV *NumericalNumber of previous live birthsGestational AgeIV *NumericalThe age of the pregnancy (weeks)ParityIV *NumericalNumber of deliveries*Independent variable Table 1List of variablesFeatureroleTypedefinitionRisk levelOutcomeBinary(Low, High)The grade or level of maternal riskGravidaIV*NumericalThe number of pregnanciesAgeIV *NumericalAge of mother at deathabortionsIV *NumericalNumber of previous abortionsLive birthsIV *NumericalNumber of previous live birthsGestational AgeIV *NumericalThe age of the pregnancy (weeks)ParityIV *NumericalNumber of deliveries*Independent variable List of variables Binary (Low, High) *Independent variable The retrospective cohort design in this study utilised all 402 reported maternal deaths in Oman from 1991 to 2023. The inclusion of all the cases in the study can prevent selection bias and strengthen the generalisability of the findings to the total population. The inclusion and exclusion criteria will be in accordance with the definition of maternal death by the World Health Organisation. Deaths of a woman during pregnancy or after termination of pregnancy within 42 days are considered maternal death. Furthermore, maternal deaths of reproductive age 15–49 years were included in this study. Pregnant women who died from external or incidental causes such as road traffic accidents were excluded from the study. Data preprocessing Descriptive statistics, bar plots, histograms, and density plots are presented. Correlations between features will be tested. In our study, the data are divided randomly into training sets (80%) and test sets (20%) for the applications of the ML algorithms. The data are partitioned into training and test sets using tenfold cross-validation (k = 10) for all the algorithms. All analyses were performed using R version 4.4.0 with a 5% level of significance. Common packages for data visualisation, data preprocessing task, such as Principal Component Analysis (PCA), and machine learning models in R have been utilised. Imbalanced data In real life, the collected data are not always balanced. This is often the case with data collected from medical records, where some diseases occur less frequently than other health outcomes. In our dataset, the proportions of high- and low-risk maternal deaths are significantly different. The imbalanced dataset may yield a bias in the learning process toward the majority of the classes and mislead the results of the model’s accuracy [36]. As a result, the evaluation metrics can be misleading, and the accuracy of the model may be deceptive. We applied SMOTE (Synthetic Minority Over-Sampling Technique) to handle the imbalanced dataset. The SMOTE method has been found to outperform other methods, such as boosting, and they are reported as good alternatives in supervised ML [37, 38]. Furthermore, with highly dimensional datasets, SMOTE is beneficial because it reduces the data variability and does not affect the mean of a specific class [39]. Moreover, SMOTE is efficient with minority class datasets or small datasets as well as data with large sample sizes where it can produce better accuracy levels [40]. Multicollinearity evaluation Before employing ML algorithms, it is important to assess the associations between variables. Plotting the correlation heatmap allows us to explore the positive or negative correlations among the different features and to identify multicollinearity in the dataset. Spearman correlation between continuous variables is utilised in the heatmap [41]. Correlations between features are visualised with colours in the heatmap, where the strength of each relationship is represented by the intensity of each colour. Furthermore, a correlation matrix between independent variables is presented. High correlations between features are handled by Principal Component Analysis (PCA), which is a powerful tool in dimensionality reduction [42]. PCA includes linear independent combinations called principal components that can explain the structure of the variance- covariance of the independent variables [43]. These components are used to account for the variation in the data. Machine learning algorithms This section outlines the ML algorithms used to predict maternal mortality risk levels in Oman. Our study utilises supervised ML algorithms according to the data type used in our project. In supervised ML, the classes are labelled or predetermined so that the model connects the inputs to the required outcomes [41, 44]. This means that the outcome is known for each observation in the dataset (labelled) [45]. We employed ten machine learning algorithms to predict maternal mortality. Naïve Bayes (NB) NB is a supervised ML method commonly used in classification and clustering problems and is based on the Bayes theorem [46]. It is called Naïve because it assumes independence between features in different classes [25]. This algorithm is a probabilistic approach that calculates probabilities of each potential class, and the correct class chosen by the classifier is the one with the highest probability [45]. The probability is conditional on the occurrence of an event that has already occurred [30]. NB can be supervised, unsupervised, or semi-supervised ML, depending on the problem [47]. Furthermore, it is suitable for datasets with high input dimensionality [48]. Alazwari et al. [25] stated that NB can produce efficient probability estimates from a simple structure and does not require a large number of training datasets. Random Forest (RF) RF is an ensemble algorithm consisting of the construction of multiple decision trees by bagging (boot-strap aggregation) [49]. RF does not rely on a single decision tree but averages various decision trees from multiple subsets [50]. In addition, dimensionality is not an issue in RF, as modelling is built on the basis of feature selection; therefore, RF is capable of handling a large number of features [49]. RF can be applied for both regression and classification problems. The technique utilised by RF can overcome the issue of overfitting, which occurs when the model performs well on the training, but the performance is poor on the test set. Extreme Gradient Boosting (XGBoost) XGBoost combines two ML algorithms to build an efficient predictive model. These algorithms are RF and gradient-boosting [51]. This algorithm corrects the errors made by previous trees, enabling a more powerful representation of the data. K—Nearest Neighbors (KNN) KNN is a well-known classification algorithm and can be used in data mining and regression problems [52]. It is known for its simplicity and interpretability, where it finds the nearest data point (neighbours) from the training dataset to the unseen dataset. KNN divides the dataset into smaller clusters, thereby reducing computational complexity and selecting the most informative features [53]. However, for large datasets, KNN could be computationally expensive. Decision Tree (DT) DTs are suitable for both regression and classification. However, it is widely used in the latter [47]. It consists of nodes that form the root tree with other nodes forming the leaves where the feature classification begins at the root node, also called the decision node [48]. The final predictions are represented by the leaf nodes. Alloghani et al. [47], in their systematic review of ML applications, stated that if data are collected with the same collection procedure, DTs can produce a higher rate of accuracy. The DT is known for its flexibility with nonlinear predictors and its ability to handle high interactions among them [45]. Trees may be very sensitive to any data perturbations, and the DT algorithm is prone to overfitting. Linear Discrimination Analysis (LDA) and Quadratic Discrimination Analysis (QDA) The LDA algorithm is utilised in classification problems as well as in dimensionality reduction, where LDA can map the feature space to a space with lower dimensionality [54]. It maximises the between-class scatter to within-class scatter ratio to obtain the most separation of groups from one another to yield a prime subspace from a feature space [55]. On the other hand, QDA is a classification algorithm in ML that uses a similar approach as LDA but cannot be used for the reduction of dimensionality. Logistic Regression (LR) Regression modelling builds a relationship between one outcome and one or more independent variables [56]. It measures how the dependent variable changes with the change in an independent variable while adjusting for other independent variables. In machine learning, the dependent variable is known as the target or label, and different terminologies are used to describe the independent variables, such as features, inputs, observations, data points, and dimensions [41]. We will apply logistic regression to classify maternal health risk because our target is binary. Artificial Neural Network (ANN) The concept of ANNs is derived from biological neural networks, and the neurons are connected similarly to complex signalling systems [45]. It can be deployed with dynamic or non-linear relationships, and it does not require strong assumptions such as the independence of variables, normality, or linearity [57]. The ANN assigns a weight to each connection between each input and output. These weights are adjusted during the training phase to learn to predict the output class [58]. ANNs are usually divided into three main layers: inputs, hidden, and outputs. The input layer is responsible for receiving information, the hidden layer accounts for the internal processing and exploring patterns, and the final outputs are presented by the output layer [59]. In high-dimensional data, ANNs can discern hidden non-linear and linear relationships [60]. Support Vector Machine (SVM) SVM is one of the most powerful supervised ML algorithms. It can be also applied for regression and classification problems [46]. In the latter, SVM can provide balanced predictive models even in studies with limited sample sizes [61]. SVMs create a hyperplane which is a boundary that segregates the data points of the different classes [45]. The optimal hyperplane is the one that takes a boundary with the maximum separation of the classes or margins [25, 45]. However, on many occasions, observations need to be transformed before the separation process by the hyperplane. As a result, SVM is capable of handling this issue via an algorithm called Kernel functions and can produce predictive models with high accuracy [57]. Model evaluation Model evaluation is an essential step in assessing and comparing the performance of different models. A tenfold cross-validation is applied for all the ML models. Since our study is a classification of binary outcomes, model performance is evaluated using several measures including accuracy, specificity, sensitivity, precision, and the F1- score [50]. Accuracy is an important model performance measure. It is the rate of correctly predicted or classified values [62]. It is expressed as a percentage of correct predictions out of the total predictions. As we apply supervised ML, the confusion matrix is a means to evaluate error, especially in classification problems. This allows us to identify accurate and inaccurate instances. Higher values of accuracy suggest that the model is predicting higher correct instances. Precision is also referred to as the positive predictive value (PPV) [63]. Precision is the rate of true positives identified by the model. A value closer to 1 means higher precision, and the model results in fewer false positives (FPs). The Precision is calculated as Precision = TP/ (TP + FP). Sensitivity (Recall) is the ratio of true positives (TPs) to false negatives (FNs). It is also known as the true positive rate (TP rate). High recall values suggest that many TP and small FN values are correctly identified by the model [64]. It is expressed as follows: Recall = TP/(TP + FN) [49]. Specificity measures the percentage of correctly identified negative instances, and specificity = TN/(TN + FP). Thus, if the specificity increases, the sensitivity decreases. The F1- score or the F-measure is the harmonic mean of both the recall and precision [64]. Compared with the arithmetic mean, the harmonic mean assigns higher weights to lower values. Hence, the F1- score balances the sensitivity and precision of a single score, especially when the model has high sensitivity and low precision or vice versa. It provides a holistic view of the performance of the model. An F1- score closer to one indicates that the balance between recall and precision is good. It is a good accuracy measure in the case of imbalanced data. The F-measure, also known as the F1 score, is calculated using the following equation: F1 score = 2 x [(Precision x Recall)/ (Precision + Recal)]. The confusion matrix provides the following key metrics, as detailed in references [34, 49, 64]:True Positive (TP): The positive classes are correctly predicted as positive.False Positive (FP): The negative classes are predicted as positive.True Negative (TN): The negative classes are correctly predicted as negative.False Negative (FN): The negative classes are incorrectly predicted as negative.The accuracy of the model is calculated using the following equation: Accuracy = (TP + TN) / (TP + TN + FP + FN).To select the best model with the highest performance, the evaluation measures are assessed. Model accuracy and the F1- score are the most important measures. The higher the accuracy is, the better the model. True Positive (TP): The positive classes are correctly predicted as positive. True Positive (TP): The positive classes are correctly predicted as positive. False Positive (FP): The negative classes are predicted as positive. False Positive (FP): The negative classes are predicted as positive. True Negative (TN): The negative classes are correctly predicted as negative. True Negative (TN): The negative classes are correctly predicted as negative. False Negative (FN): The negative classes are incorrectly predicted as negative. False Negative (FN): The negative classes are incorrectly predicted as negative. The accuracy of the model is calculated using the following equation: Accuracy = (TP + TN) / (TP + TN + FP + FN). The accuracy of the model is calculated using the following equation: Accuracy = (TP + TN) / (TP + TN + FP + FN). To select the best model with the highest performance, the evaluation measures are assessed. Model accuracy and the F1- score are the most important measures. The higher the accuracy is, the better the model. To select the best model with the highest performance, the evaluation measures are assessed. Model accuracy and the F1- score are the most important measures. The higher the accuracy is, the better the model. Results This section presents the main findings of our study on maternal mortality risk level prediction from the balanced dataset after applying the SMOTE method and PCA to handle the issues of imbalanced data and multicollinearity. We first present some descriptive statistics for the outcome and the predictors included in the prediction process. This is followed by the results of each ML algorithm. Furthermore, the results section includes a comparison summary of the models’ performance evaluation measures. Descriptive statistics and correlations The distribution of risk levels according to categories is illustrated in Fig. 2. The proportion of high-risk maternal deaths is approximately 53%, and the proportion of low-risk maternal deaths is 47%.Fig. 2The distribution of maternal risk level The distribution of maternal risk level The mean maternal age was 30.5 years, and the median maternal age was 30.0 years. The maximum maternal age was 48 years, and the minimum maternal age was 15 years (Table 2). This range is within the women’s reproductive age (15- 49), specified in the definition of maternal mortality. Figure 3 and Table 2 present the distributions of maternal age at different maternal risk levels. The median age for high-risk patients was 32 years, and that for low-risk patients was 28.6 years, as shown in Table 2. Therefore, low-risk maternal women have a lower median age than high-risk women do.Table 2Summary statistics of the independent variablesLow risk levelAgeGravidaGestation ageAbortionsParityLive births Minimum1616000 Maximum40944377 Mean28.32.830.00.31.81.8 Median28.62.334.001.51.7 Standard Deviation5.11.710.10.51.61.5High risk level Minimum1515000 Maximum48174461515 Mean32.55.031.20.53.73.7 Median32.04.03403.03.0 Standard Deviation6.43.48.70.93.43.3Fig. 3The distribution of age by the level of maternal risk Table 2Summary statistics of the independent variablesLow risk levelAgeGravidaGestation ageAbortionsParityLive births Minimum1616000 Maximum40944377 Mean28.32.830.00.31.81.8 Median28.62.334.001.51.7 Standard Deviation5.11.710.10.51.61.5High risk level Minimum1515000 Maximum48174461515 Mean32.55.031.20.53.73.7 Median32.04.03403.03.0 Standard Deviation6.43.48.70.93.43.3 Summary statistics of the independent variables The distribution of age by the level of maternal risk Different predictors were collected from our dataset, including gravida, the number of previous abortions, the number of previous live births, gestational age, and parity. The median gravida in our dataset was 3. As illustrated in Fig. 4 and summarised in Table 2, the median gravida for high-risk maternal deaths was 4, and low-risk maternal deaths had a lower median gravida of 2.3. The density plots indicate the different distributions of gravida by level. The histograms of low- and high-risk levels suggest positive skewness.Fig. 4The distribution of gravida by the level of maternal risk The distribution of gravida by the level of maternal risk The gestational age indicates the age of pregnancy measured in weeks from the last menstrual period. The minimum gestational age was 5 weeks, and the maximum was 44 weeks. Half of the mothers who died were pregnant at more than 34 weeks. High-risk maternal deaths and low-risk had the same median gestational age of 34, as presented in Table 2. Figure 5 illustrates that the gestational age for the low and high-risk groups was negatively skewed. The vast majority of the maternal deaths had no previous history of abortion, as shown in Fig. 5. The distributions of low- and high-risk levels regarding the number of previous abortions were the same, with peaks at abortions equal to zero for low- and high-risk levels. Parity is another feature included in our study. Table 2 shows that the median parity for the high-risk group was higher than that for the low-risk group, with medians of 3.0 and 1.5, respectively. There was a positive skewedness in the distribution of parity for low- and high-risk levels. On the other hand, the median number of previous live births was greater for the high-risk group (3.0) than for the low-risk group (1.7) (Table 2). Hence, there are differences in the median of each selected feature by maternal risk level.Fig. 5The distribution of some features by risk level The distribution of some features by risk level We explore the relationships among the independent variables. Multicollinearity or high correlation is an issue in ML applications, although some ML algorithms, such as decision trees, random forests, and support vector machines, can handle multicollinearity. The correlation matrix for all independent variables presented in Fig. 6, shows a significantly high correlation between parity and gravida and between parity and live births, and moderate correlations between other features. Therefore, multicollinearity reduction is necessary before further analysis can be performed.Fig. 6The correlation matrix The correlation matrix Figure 7 depicts the Spearman correlation of the independent variables. The visual representation contains the total correlation as well as the correlation by level of risk for each feature.Fig. 7Spearman Correlation by risk level Spearman Correlation by risk level Principal Component Analysis (PCA) As mentioned in the methodology section, PCA is a powerful tool for handling multicollinearity in the dataset, which is an essential step preceding any further applications of ML algorithms. This section highlights the application of PCA to reduce multicollinearity in our dataset. We employed PCA to explore the percentage of variation explained by each principal component. The results of the principal components and the variance explained are summarised in Table 3. Nearly, 58.4% of the variance is explained by the first principal component, whereas approximately 77% of the data variance is explained by the first two principal components and 91% is explained by 3 principal components. The remaining three principal components explain only 9% of the data variation. We chose to select PC3 because it demonstrates a significant amount of variation and provides a greater explanation of the data's variability compared to the other principal components.Table 3Principal Component Analysis (PCA)MeasurePC1PC2PC3PC4PC5PC6Standard Deviation1.87101.05150.92610.714640.132530.08749Proportion of variance0.58350.18430.14290.085120.002930.00128Cumulative proportion0.58350.76770.91070.995800.998721.00000 Table 3Principal Component Analysis (PCA)MeasurePC1PC2PC3PC4PC5PC6Standard Deviation1.87101.05150.92610.714640.132530.08749Proportion of variance0.58350.18430.14290.085120.002930.00128Cumulative proportion0.58350.76770.91070.995800.998721.00000 Principal Component Analysis (PCA) Figure 8 shows that the standard deviation decreases as the number of components increases. On the other hand, the variance explained increases with each successive component.Fig. 8The Variance explained by PCA and the Standard deviation The Variance explained by PCA and the Standard deviation In addition, we calculated how much each principal component contributed to explaining the variation in the data. This contribution is shown in the scree plot in Fig. 9, where the components are listed from the highest to the lowest contribution. The figure illustrates that the first three principal components account for the most variation in the data.Fig. 9PC Variance explanation plot PC Variance explanation plot Machine learning performance and comparison Ten classification ML algorithms have been utilised to predict the maternal mortality risk level with a ratio of 8:2 for training and testing and a tenfold cross-validation for model evaluation. Six independent variables; namely, age, gravida, parity, live births, abortions, and gestational age, were used in the models. The first method applied was Linear Discriminant Analysis (LDA), which yields an F1- score of 60.9% and an accuracy of 64%. There was no significant improvement when Quadratic Discrimination Analysis (QDA) was applied (the F1- score reached 60.5%). The accuracy improved slightly to 65.6%, as displayed in Table 4.Table 4Cross-validation (k = 10) results of the ten MLS predictive modelsSNMethodAccuracySensitivitySpecificityPrecisionF1 ScoreMethod1QDA0.6560.50000.83050.76740.60552LDA0.6400.53030.76270.71430.60873LR0.6480.54550.76270.720.62074KNN0.7120.57580.86440.82610.67865ANN0.67200.66670.67800.69840.68226RF0.7520.63640.88140.85710.73047xgboost0.69600.60610.79660.76920.67808DT0.67200.56060.79660.75510.64359SVM0.6480.53030.77970.72920.61410NB0.6560.59090.72880.70910.6446 Table 4Cross-validation (k = 10) results of the ten MLS predictive modelsSNMethodAccuracySensitivitySpecificityPrecisionF1 ScoreMethod1QDA0.6560.50000.83050.76740.60552LDA0.6400.53030.76270.71430.60873LR0.6480.54550.76270.720.62074KNN0.7120.57580.86440.82610.67865ANN0.67200.66670.67800.69840.68226RF0.7520.63640.88140.85710.73047xgboost0.69600.60610.79660.76920.67808DT0.67200.56060.79660.75510.64359SVM0.6480.53030.77970.72920.61410NB0.6560.59090.72880.70910.6446 Cross-validation (k = 10) results of the ten MLS predictive models In addition, Naïve Bayes (NB) did not perform well in predicting maternal health risk because of its accuracy (65.6%) and F1- score (64.5%). The accuracy level of the NB algorithm is very close to that of the LDA algorithm (Table 4). The Support Vector Machine (SVM) achieved an accuracy rate of 64.8% and an F1- score of 61.4%. We applied Logistic Regression (LR), as it is commonly used in classification problems. LR achieved an accuracy of 64.8% and an F1- score of 62.1%. The highest accuracy of K- nearest neighbours (KNN) was achieved when the number of neighbours was equal to k = 3, as illustrated in Fig. 10. The accuracy rate is 71.2%, and it decreases as the number of neighbours increases. The K-Nearest Neighbours Error bar plot is presented in Fig. 11. The x-axis represents the number of neighbours (k), whereas the y-axis represents the accuracy rate. The bars represent the confidence intervals of the measurement accuracies. The bars are shorter before k = 7, indicating lower variability in the data, which indicates greater reliability of the model performance at that specific k value.Fig. 10Accuracy level with respect to the number of neighboursFig. 11The K-nearest neighbours error bar Accuracy level with respect to the number of neighbours The K-nearest neighbours error bar The Artificial Neural Networks (ANN) achieved an accuracy of 67.2% and an F1- score of 68.22%. The Decision Tree (DT) algorithm achieved an F1- score of 64.3%, and an accuracy of 67.2%, similar to the ANN. The extreme Gradient Boosting (Xgboost) algorithm achieved an accuracy of 69.6% and an F1- score of 67.8%. The Random Forest (RF) algorithm outperformed the other algorithms, with an accuracy of 75.2%, and an F1- score of 73%. To obtain a comprehensive picture of the model’s performance, we included the accuracy of the ten ML algorithms ranked from highest to lowest for the training and testing datasets separately in Table 5. The comparison of the accuracy of RF between training and the testing datasets suggests that this algorithm is more stable than other algorithms.Table 5Accuracy rates of the ten ML algorithms with PCA on the training and testing datasetsRankML algorithmTrainingTesting1RF0.7820.7522KNN0.7700.7123Xgboost0.7480.6964ANN0.7220.6725DT0.7040.6726QDA0.6850.6567NV0.6830.6568LR0.6830.6489SVM0.6790.64810LDA0.6950.640 Table 5Accuracy rates of the ten ML algorithms with PCA on the training and testing datasetsRankML algorithmTrainingTesting1RF0.7820.7522KNN0.7700.7123Xgboost0.7480.6964ANN0.7220.6725DT0.7040.6726QDA0.6850.6567NV0.6830.6568LR0.6830.6489SVM0.6790.64810LDA0.6950.640 Accuracy rates of the ten ML algorithms with PCA on the training and testing datasets PCA results of variable importance This section highlights the contribution of features in each PC. Transforming the data to PCA space enables us to identify the most informative features. The results of our PCA demonstrated that PC1 explained the highest variation of the data (58.3%). We applied the squared cosine (COS2) to evaluate the quality of the representation of the variables in the principal components. This measure helps us identify how much variance of each original variable is explained by each principal component. Figure 12 illustrates that all variables have a high value of COS2 except for age. This finding indicates that gestational age, parity, live births, abortions, and gravida contribute the most to PC1, PC2, and PC3.Fig. 12COS2 values for quality of representation of variables for dimensions 1 to 3 COS2 values for quality of representation of variables for dimensions 1 to 3 The contribution of each variable at each PC is represented in Fig. 13. The red dashed line in the figure represents the expected average contribution. Three features exceed this threshold in the first component, namely, gravida, parity, and live births, ie, significantly contribute to PC1. For PC2, gestational age and the number of previous abortions exceeded the expected average contribution. The variable age is lower than the threshold in all three principles, although it is very close in PC1. The correlation matrix in Fig. 14 represents the contribution of each feature in PC1, PC2 and PC3.Fig. 13The contribution of features in each PCFig. 14Correlation plot of the contribution of features on each PC The contribution of features in each PC Correlation plot of the contribution of features on each PC The loadings of each feature on each principal component are extracted using the rotation matrix. These loadings are presented in Table 6. Examining variable loadings allows us to identify the important features of each PC. The loadings are the correlation of each original variable and a PC. The higher magnitude of the loadings suggests a higher correlation with the PC. Gravida, the number of previous live births, and parity have the highest absolute loading values (above 0.5 and positive correlations) in PC1, indicating that they are the most important in explaining the variance in PC1. On the other hand, gestational age and number of abortions had the highest loadings on PC2. In contrast, the number of previous abortions was positively correlated with PC2, and gestation age was negatively correlated with PC2 (Fig. 15).Table 6PC loadingsFeaturePC1PC2PC3PC4PC5PC6age0.3960.1890.0200.8980.028-0.006Gravida0.5250.0220.0003-0.210-0.8010.194Parity0.512-0.153-0.185-0.2000.1967-0.775Abortions0.2000.6090.700-0.2390.200-0.042Live births0.511-0.158-0.191-0.2000.5270.600Gestational age0.066-0.7380.6620.112-0.0050.002Fig. 15Loading Plot using PC1 and PC2 Table 6PC loadingsFeaturePC1PC2PC3PC4PC5PC6age0.3960.1890.0200.8980.028-0.006Gravida0.5250.0220.0003-0.210-0.8010.194Parity0.512-0.153-0.185-0.2000.1967-0.775Abortions0.2000.6090.700-0.2390.200-0.042Live births0.511-0.158-0.191-0.2000.5270.600Gestational age0.066-0.7380.6620.112-0.0050.002 PC loadings Loading Plot using PC1 and PC2 Results of the ML algorithms without PCA For further analysis and comparison of the results, we run our models without the implementation of the PCA. Table 7 presents the accuracy levels of the ten ML algorithms. The highest accuracy was achieved by RF, with a rate of 81.6%, followed by XGboost and KNN. The decision tree performed well in this classification problem without applying the PCA and it produced an accuracy of 74%. Figure 16 illustrates the accuracy of the models for both scenarios (with and without PCA). The RF model remains the best model in both scenarios.Table 7Accuracy levels of the ten ML algorithms without PCARankML algorithmTrainingTesting1RF0.8440.8162Xgboost0.8730.7843KNN0.8340.7604DT0.7740.7445ANN0.7330.6646QDA0.7040.6567SVM0.6510.6488LDA0.6500.6409NB0.6620.63210LR0.6510.616Fig. 16Accuracies of the ten ML algorithms with PCA and without PCA Table 7Accuracy levels of the ten ML algorithms without PCARankML algorithmTrainingTesting1RF0.8440.8162Xgboost0.8730.7843KNN0.8340.7604DT0.7740.7445ANN0.7330.6646QDA0.7040.6567SVM0.6510.6488LDA0.6500.6409NB0.6620.63210LR0.6510.616 Accuracy levels of the ten ML algorithms without PCA Accuracies of the ten ML algorithms with PCA and without PCA Discussion Maternal health is a critical concern globally and locally in Oman. Maternal complications may occur during pregnancy, during birth, or after the termination of pregnancy. Therefore, identifying pregnant women at risk is crucial. One of the most important aspects that may help mitigate adverse outcomes is the classification of maternal health risk into different levels. Consequently, our study aimed to identify women at risk (low or high) using ML algorithms and a dataset collected at the national level. AI-based approaches, including ML help identify complex relationships and can produce accurate results [65]. However, research that has applied ML algorithms to health-related problems in Oman is scarce. To the best of our knowledge, this is the first study that predicts the risk level of pregnant women in Oman. Using a representative sample enhances our findings’ generalisability to the country’s target population. We included all maternal deaths registered in Oman from 1991 to 2023 (n = 402). This study performed a thorough exploration of the recommended ML algorithm in the prediction of maternal health risk levels in Oman. It is worth mentioning that datasets and studies on the classification of maternal risk levels are scarce, as a significant number of studies have utilised the same open-source dataset, such as Kaggle and the University of California, Irvine (UCI) machine learning repository. Out of the 13 cited articles in our study, we identified 10 studies that utilised the above maternal health risk data. The dataset includes 1014 observations and 7 attributes, namely, Systolic Blood Pressure (SBP), Diastolic Blood Pressure (DBP), Blood glucose levels (BG), Body Temperature (BT), Heart Rate (HR), and the outcome is the risk level (low, medium and high) [66]. However, the data were collected in one area in Bangladesh. Therefore, the generalisability of the results may be a concern. In addition, there was no explanation of the inclusion/ exclusion criteria of the maternal health risk data [32]. Furthermore, some researchers dropped some records from the dataset because the figures were not reliable. For instance, Assaduzzaman et al. [29] dropped the variable Heart rate, saying that it may not be reliable. They stated that the individual heart rate at rest is between 60 and 100 beats per minute. However, the maternal risk level dataset contains some anomalies where two cases had a heart rate of 7 beats per minute. In our proposed research, we utilised a de-identified dataset from Oman with features collected carefully by the national maternal mortality review committee. The outcome, which is the maternal health risk level, was categorised into 3 levels in the Bangladesh dataset, but in our study, it was classified into two levels of risk, namely, high or low. This approach was used in two other distinct studies where risk was classified into two categories: risk or no risk [31, 67]. It depends on the nature of the collected dataset and experts’ opinions on how they want to interpret the results. Typically, binary classification problems are easier to interpret and require fewer computational resources and training. Among the ten ML algorithms employed in our study, the RF algorithm has the best performance, with the highest accuracy of 75.2%, followed by the KNN algorithm, with an accuracy of 71.2% (Table 4). RF is efficient with high-dimensional datasets [30]. Our results are in line with those of other studies [31, 34, 67, 68]. Studies on maternal risk level prediction that apply data balancing methods are rare. For example, Mondal et al. [68] utilised the Synthetic Minority Over-Sampling Technique (SMOTE) for an imbalanced dataset. The authors stated that SMOTE was chosen over other methods, including oversampling and under-sampling, as the latter methods could yield overfitting for oversampling and data loss for under-sampling [68]. The highest accuracy (93.14%) was obtained by RF with the SMOTE [68], as presented in Table A, additional file 1. In our study, we applied the SMOTE method because our collected data are imbalanced, which is the case in real life, especially with health datasets. In addition, to reduce the impact of multicollinearity, we applied PCA and identified the contribution of each feature in each PC. According to the PCA, parity, gravida and the number of previous live births significantly contributed to PC1, whereas age had a relatively lower contribution, as illustrated in Fig. 13. Compared with other studies reviewed in our article, only some have identified the importance of the features in predicting maternal risk levels. Moreover, features that are utilised in their prediction differ from our features. Most studies used systolic and diastolic blood pressure, heart rate, and body temperature as predictors because they used the same open-sourced dataset. Some have identified age as one of the important features [29, 33, 66, 69]. In another study that utilised different features, the hemoglobin level was the most significant factor identified by RF [67]. Table A in additional file 1, summarises different studies that applied ML to predict maternal risk levels and the algorithm that had the best performance. In this research, we also modelled the maternal risk level without applying PCA to compare the performance of the ten ML algorithms. RF remains the best option for predicting maternal risk levels, with an accuracy level of 81.6% (Table 7). The accuracy produced by the RF without PCA is higher than its accuracy with PCA (81.6% vs 75.2%), as illustrated in Fig. 16. RF is known for its ability to handle issues in the data, including overfitting and multicollinearity. PCA may remove some important features and reduce the performance of the model; however, this process involoves minimal information loss. However, with high multicollinearity in our dataset, we decided to apply PCA to address this issue. Interestingly, the performance ranks of the algorithms differ between using and not using PCA. For instance, XGboost was the second-best performing algorithm without PCA (Table 7), but in the scenario with PCA, KNN became the second-best model (Table 5). Hence, applying methods for handling issues in the data, such as dimensionality and multicollinearity, impacts the results of the model performance. In our present research, several limitations should be acknowledged. Because we used secondary data, no clinical features were included for predicting maternal mortality risk levels in our study. Hence, future studies should include health-related predictors, and demographic, health, and medical features to improve the accuracy and robustness of the results. Conclusion MMR is one of the most significant public health challenges worldwide. Despite the fact that MMR in Oman has been the highest among the Gulf Cooperation Council (GCC), no previous research has attempted to develop models to predict maternal risk levels. A reliable estimate of maternal risk level would facilitate intervention plans for medical practitioners to reduce maternal death. This study utilised 10 recommended ML modes to predict maternal risk level. Machine learning algorithms are generally recommended for the early identification of groups at risk and the early detection of adverse outcomes, including morbidity and mortality. However, research on this topic is scarce. Specifically, articles applying ML in the health field in Oman are rare. To our knowledge, this is the first study that employed ML models to predict maternal risk levels and identify their significant factors in Oman utilising nationwide maternal mortality records. To reduce the impact of multicollinearity, we applied Principal Component Analysis (PCA) and identified the contribution of each feature to an individual PC. According to the PCA, parity, gravida, and the number of previous live births, significantly contributed to the maternal risk level. All the ML models have been utilised with and without imposing PCA. Our analysis revealed that RF is the best-performing algorithm for predicting maternal risk level, with an accuracy of 75.2% with PCA and 81.6% without PCA. Women’s health is one of the priorities in Oman’s health vision for 2040. This work aligns with the vision strategies for improving women’s health. The results presented in this paper can help medical practitioners identify pregnant women at risk of maternal mortality and monitor the significant factors associated with maternal risk to reduce/prevent maternal death. Furthermore, ML predictive models are currently not widely utilised in Oman, especially in the health sector. Our study can serve as a stepping stone and empower evidence-based decision-making in the field of maternal health in the country. The main contribution of this work is that it enables health professionals to identify pregnant women at risk of maternal mortality. Consequently, the ability of health services for the protection of pregnant women and newborns in Oman should be improved. All of these factors will contribute to the global reduction in the MMR and achieve the SDG target by 2030. Our analysis showed that RF is the best performing algorithm for predicting the risk level, followed by KNN. Future work should include more clinical and lifestyle factors related to the mother and other factors related to the fetus and the baby to further evaluate and improve the model for predicting maternal risk level. Supplementary Information Supplementary Material 1. Supplementary Material 1.