Introduction

The primary goal of antenatal testing is to detect fetal hypoxia before the fetus suffers long-term harm. Intrapartum fetal heart rate (FHR) monitoring is fundamental for assessing fetal well-being during labor1. Failing to recognize or address a concerning FHR can result in various health risks and devastating injuries such as hypoxia/anoxia, partial or complete brain damage, cerebral palsy, paralysis, nerve damage, and stillbirth2. Nonreassuring fetal heart (NFH) is not an adverse event in and of itself but rather a symptom of an underlying condition that causes temporary or permanent oxygen deprivation in the fetus, which can lead to fetal hypoxia and metabolic acidosis3. Because fetal oxygenation is dependent on maternal oxygenation and placental perfusion, changes in maternal oxygenation, uterine blood supply, placental transfer, or fetal gas transport may result in fetal hypoxia and unsatisfactory fetal status4. Conditions commonly reported to be associated with NFH include maternal comorbidities such as cardiovascular disease, anemia, diabetes, hypertension, infection, placental abruption, abnormal presentation of the fetus, intrauterine growth restriction and umbilical cord compression, among other obstetric, maternal or fetal conditions5. The ability to predict NFH is critical for reducing perinatal complications. Since the use of machine learning (ML) algorithms in establishing risk predictors in medicine has grown in popularity over the previous decade6,7,8, thus, this study seeks to determine whether a machine learning-based model can predict NFH. The advanced research on artificial intelligence (AI) in clinical medicine demonstrated noteworthy outcomes, inspiring us to utilize AI models more enthusiastically9,10,11.

Methods

This was a retrospective study of data collected from singleton cases above the gestational age of 28 weeks that attempted vaginal delivery between January 2020 and January 2022. Exclusion criteria included elective scheduled cesarean and fetal anomalies. The findings of this retrospective cohort study are based on birth records obtained from the “Iranian Maternal and Neonatal Network (IMaN Net),” a legitimate national system. IMaN Net is a comprehensive system for registering maternal and newborn information on the outcomes of each delivery, which is completed daily by midwives in all birth centers and hospitals throughout Iran in an integrated manner12. All patients’ personal information was deidentified and not disclosed.

The target population in this study was divided into the NFH group and the reassuring fetal heart (RFH) group. We used The International Federation of Gynecology and Obstetrics (FIGO) consensus guidelines on intrapartum fetal monitoring cardiotocography tracing classifications13 to define fetal status (Table 1).

Table 1 FIGO guidelines for interpretation of fetal heart rate via continuous cardiotocography.

Because of the limited studies on the identification of NFH predictors, we decided to use the Chi-Square test to compare all available demographic, obstetric, maternal, and neonatal factors of eligibale women to identify NFH predictors. Then, all variables with p-values less than 0.05 were considered potential NFH predictors.

A predictive ML model was built using four statistical ML models, including decision tree classification, random forest classification, extreme gradient boost classification (XGBoost), and permutation feature classification with k-nearest neighbors (KNN). Classification trees were used because our dataset were split into classes that correspond to the response variable. In most circumstances, the answer was “Yes” or “No.” As a result, there were only two classes that were mutually exclusive. In cases of more than two classes in some circumstances, we just applied a modification of the classification tree technique.

We followed the Guidelines for Developing and Reporting Machine Learning Predictive Models in Biomedical Research: A Multidisciplinary View to report our findings. The programming language Python was chosen to create the machine learning model. Scikit-learn was used to implement the ML algorithm. Scikit-learn is a machine-learning library written in Python. It includes an extensive collection of cutting-edge machine-learning algorithms for both supervised (including the multi-output classification and regression algorithm) and unsupervised problems14.

Internal validation was carried out with the help of k-fold cross-validation. The cases were randomly assigned to either the “training set” (70%) or the “test set” (30%) using a random number generator. The original dataset kept the rate of NFH and RFH groups in the training and test sets constant. Using the training set, we arranged the parameters of the prediction models and evaluated their performance using the “test set.” The average performance was calculated by repeating these ten times.

Metrics, including area under the receiver operating characteristic curve (AUROC), accuracy, precision, recall, and F1 score were used to assess the predictive power of the models. The accuracy metric calculates how often a model is correctly predicted across the entire dataset. Precision measures how many of the model’s “positive” predictions were correct. Recall is a metric that evaluates the frequency at which a ML model accurately detects positive instances (true positives) among all the existing positive samples in the dataset. The F1 score, also known as the F-measure, is defined as the harmonic average of precision and recall in a classification model. Both metrics play an equal role in the score, guaranteeing that the F1 metric accurately reflects the reliability of a model. We used AUROC as the primary performance metric because it is a widely used index to describe the ML model’s ability to predict outcomes. The metrics were scaled from 0 to 1, with higher values indicating a better model15.

Patient characteristics were presented using frequencies (percentage). The chi-square test and Fisher’s exact test were used for categorical variables. All statistical analyses were done using SPSS (version 25.0, IBM Corp. Armonk, NY, United States) and Python software (Version 3.7.0). All statistical tests were two-tailed; p < 0.05 was considered statistically significant.

Results

661 (9.2%) of the 7166 eligible mothers experienced NFH. Table 2 shows the maternal demographic factors associated with antenatal fetal distress. NFH was found to be related to living residency. NFH was more common in mothers living in urban areas.

Table 2 Demographic factors associated with NFH.

Table 3 shows the relationship between NFH and obstetrical factors. Primiparous mothers who had induced labour at less than 37 weeks or more than 40 weeks of gestational age or more had a higher rate of NFH. Mothers who had doula support during labor experienced less NFH.

Table 3 Obstetric factors associated with NFH.

Table 4 shows the relationship between maternal and neonatal clinical factors and NFH. Preeclampsia, placenta abruption. Intrauterine growth restriction, meconium amniotic fluid, and newborn sex were all associated with NFH.

Table 4 Maternal and neonatal clinical factors associated with NFH.

In this study, we attempt to evaluate parameters and feature selection based on performance parameters using various ML algorithms. A plot ROC chart, as shown in Fig. 1, and calculate AUROC as a plot that allows the user to visualize the tradeoff between the classifier’s sensitivity. Decision tree classification (AUROC: 0.76), random forest classification (AUROC: 0.77), and XGBoost classification (AUROC: 0.76) had a higher performance than the permutation feature classification with KNN (AUROC: 0.71) as shown in Fig. 1.

Fig. 1
figure 1

AUROC of ML models.

Other performance parameters for each algorithm are shown in Table 5. Permutation feature classification with KNN had the lowest performance to predict NFH with an accuracy of 0.71 and precision of 0.66, while the higher performance belonged to random forest classification with an accuracy of 0.77 and precision of 0.72.

Table 5 Performance parameters of machine learning models.

Figure 2 presents an analysis of the importance of variables in random forest classification. As the feature importance rank was identified, onset of labor, preeclampsia, placenta abruption, gestational age, parity, and intrauterine growth restriction were the top critical predictors of NFH.

Fig. 2
figure 2

Feature importance of the random forest classification in the prediction of NFH.

Discussion

The incidence of NFH in our study population was 9.2%. Based on our findings NFH was more common in cases of intrauterine growth restriction, late-term, post-term, and preterm births, preeclampsia, placenta abruption, primiparous, induced labor, male fetus, and lower in birth with the presence of doula support .

Intrauteine growth restriction is one of the well-known cases of fetal distress. In fact, the same mechanisms that cause intrauterine growth restrictions by disrupting the placental blood supply can cause abnormal changes in the fetal heart rate during labor16.

There is not much information available regarding the relationship between gestational age and NFH. As we expected the rate of NFH in late-term and post-term pregnancies in our study population were higher. We also observed more rate of NFH in preterm births. However, based on our data, we cannot determine that the primary cause of fetal distress was the condition causing premature delivery or the administration of tocolytics to avoid premature delivery, which is one of our study’s limitations. As one study reported pregnant women who had tocolytic treatment more than one time during pregnancy were found to be at higher risk of NFH when compared to pregnant women without any tocolytic treatment17.

Based on our finding the NFH rate was more common in pregnant women diagnosed with preeclampsia. Poor utero-placental circulation in preeclamptic women retards fetal growth and causes NFH18.

The placenta provides the fetus with oxygen and nourishment while also excreting waste materials. Diffusion to and from the maternal circulatory system is crucial for the placenta’s life-sustaining capabilities19. When blood accumulates and separates the placenta from the maternal vascular network, these important placental activities are stopped, therefore in cases of placenta abruption the NFH is common.

Based on our analysis parity was among associated factors of NFH. As we observed NFH was more common in primiparous women. No explanation for this associtation has been reported yet. More resrech in this field might help to make a better conclusions.

Th onset of labor was another associated factors of NFH. Those with induced labor was more at risk of NFH. Synthetic oxytocin is the most often used method of inducing labor; nevertheless, the improper use of certain medicines, known as high-risk pharmaceuticals, can cause considerable damage to the patient. The link between oxytocin and hyperstimulation, NFH, and adverse neonatal consequences is known well20,21.

Based on our findings the rate of NFH was higher in male fetus than females. Some studies showed that male fetuses are at increased risk for fetal distress during labor, for low Apgar scores, and for perinatal death22,23. However we could not find any scientific reason to explane this issue.

Living residency were also associated with NFH. Those who lived in urban area with at higher risk of showing NFH compared to rural residents. We believe that sociodemographic factors should be more studied in different research to conclude the real association between them and health issues.

The new finding of our study was the presence of doula support during labor that was associated with lower risk of NFH. We expeculate that the presence of doula during labor prevent some conditions such as hyperstimualtion of uterous caused by uncontrolled use of oxytocin in cases of induced labor. There might be other explenations that need to be investigated.

This study was designed to assess the predictive ability of the maternal characteristics for NFH using ML models. Random forest classification (AUROC: 0.77), decision tree classification and extreme gradient boost classification (AUROC: 0.76), and permutation feature classification with K-nearest neighbors (AUROC: 0.77), all showed good performance in predicting NFH. Permutation feature classification with k-nearest neighbors had the lowest performance to predict NFH with an accuracy of 0.71 and precision of 0.66, while the higher performance belonged to random forest classification with an accuracy of 0.77 and precision of 0.72. With this account, it can be said that our study, like similar studies24,25,26,27, has succeeded in predicting cases of fetal distress using machine learning methods. Although a definitive conclusion to determine the effectiveness of this method requires more studies in the future.

The study of predicting NFH using the ML approach, which is the first to our knowledge, is a strength of the current research. The present study has attempted to simultaneously evaluate some predictors of NFH by using an appropriate sample size and statistical methods. Even though we used a large dataset with a lot of maternal and neonatal information, a significant variable, such as the use of tocolitic in preterm births, differen techniques used for induced labor (whether it was mechanical or medications), the maternal body mass index, was missing in the majority of the birth records, so we couldn’t use this factor in our selection features, which is a significant limitation of the study.

Conclusion

Identifying the risk factors of NFH can help clinicians guide patient counselling and anticipate the need for operative delivery or additional neonatal support at birth. ML approach adequately predicted NFH and allowed us to identify prediction variations based on specific case characteristics. The model revealed specific risk groups linked to NFH. Using ML approaches to predict NFH yielded promising results. As a result, this study might add to the current literature. More research is needed to make a better conclusion on the performance of ML models in predicting NFH.