A hybrid model of random forest ensemble and resample for cardiotocography data classification
* Author to whom correspondence should be addressed.
Sigma Journal of Engineering and Natural Sciences 2025, Vol. 43, Issue 2, pp. 452-462; doi.org/10.14744/sigma.2024.00083
Abstract
Keywords: Bagging Classifier; Cardiotocography (CTG); Classification; Fetal Health; Random Forest Ensemble; Resampling; SmoteTomek
Introduction
In recent years, perinatal mortality rates have notably declined, attributed to heightened awareness of perinatal physiology and pathology, the expansion of regional centers, and the implementation of intrapartum electronic monitoring for in-utero surveillance. The intrapartum electronic fetal monitoring grows progressively and it helps in reducing morbidity and mortality rates,
especially in high-risk pregnancies [1]. Fetal Heart Rate tracking would address two issues. In the beginning, it would act as a screening procedure for severe asphyxia. Second, FHR monitoring would enable the early detection of asphyxia, enabling prompt obstetric intervention to prevent asphyxia-induced brain damage or the death of the newborn [2]. CTG involves continuous monitoring of the fetal heart rate via an ultrasound transducer
*Corresponding author. *E-mail address: hephzibahrajasekaran@gmail.com, christyhep@gmail.com This paper was recommended for publication in revised form by Editor-in-Chief Ahmet Selim Dalkilic Published by Yıldız Technical University Press, İstanbul, Turkey This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
positioned on the mother’s abdomen. Primarily employed throughout pregnancy, it serves to evaluate fetal well-being, particularly in cases of significant complications [3]. An essential component of antepartum and postpartum care is the routine recording of Fetal Heart Rate (FHR) using CTG monitoring. However, it became clear from several randomized trials that using CTG antenatally to improve fetal outcomes has only modest effectiveness. A comprehensive meta-analysis of studies examining intrapartum cardiotocography found a 50% decrease in perinatal mortality but a 2.5-fold rise in surgical interventions [4]. A cardiotocograph, generating a paper trace, electronically records both the newborn’s heart rate and the mother’s uterine contractions. This involves two transducers—one linked to a recording device and the other to a Doppler ultrasound transducer. External CTG monitoring is commonly continuous during labor, although intermittent usage is also practiced [5]. On CTG, four crucial features require analysis: the baseline rate, variability, accelerations, and decelerations. The normal range of the baseline rate is 110-160bpm and it is analyzed between 5 to 10mins. Variability is the bandwidth variation of the baseline after eliminating the decelerations and accelerations. The Acceleration is a short time improvement in the baseline of >15 bpm, enduring for 15 s or more and restoring to the normal baseline. Decelerations are defined as a temporary decrease in the fetal heart rate of more than 15 beats per minute, lasting for over 15 seconds [6]. Machine learning algorithms primarily classify CTG recordings as either normal or pathological based on the attributes of fetal heart rate and uterine contractions, aiding clinicians in decision-making. [7]. Different algorithms including the Naïve Bayes classifier, Decision tree (DT), Radial basis function, and Multilayer perceptron networks are utilized for classifying the CTG dataset [8]. Due to the imbalance in our CTG dataset, various sampling techniques like the Synthetic Minority Oversampling Technique (SMOTE) are employed to improve the classification performance of CTG data [9]. The paper is structured as follows: Section 2 reviews related works on CTG data classification. Section 3 outlines the methodology, while Section 4 details our proposed method. Experimental results are presented in Section 5, followed by a discussion of the findings in Section 6, and concluding remarks in Section 7. The key innovation of our method lies in integrating the Smote Tomek sampling technique with a Random Forest ensemble and bagging classifier for CTG data classification. This hybrid approach, utilizing ensemble learning with Random Forest as the base classifier and employing the bagging technique, enhances model performance by reducing variance, improving generalization, and offering insights into feature importance. It effectively tackles the challenge of imbalanced datasets often encountered in medical data analysis, particularly in fetal health monitoring during labor.
Materials And Methods
sampling techniques are introduced [26]. The CTG dataset obtained from the ML repository consists of 2126 instances with 23 features. The dataset includes 1655 instances classified as normal, 295 as suspect, and 176 as pathology classes, indicating an evident imbalance in the dataset. Hence, we applied the following techniques to get balanced data for our classification [27]. The main motive of the sampling technique is to balance the dataset where there is an imbalance. Two sampling techniques, namely oversampling and under-sampling, were employed. Given the data imbalance observed in our CTG dataset, we applied the following methodologies.
Dataset Description The CTG dataset, extracted from the University of California Irvine Machine Learning (ML) repository, consists of 2126 instances featuring 23 distinct attributes. Expert clinicians have classified the dataset, containing measurements of uterine contractions and fetal heart rates obtained through CTG, into three classes: Suspect, Pathology, and Normal, with 1655, 295, and 176 instances respectively. This publicly accessible dataset is partitioned into training and testing sets in a 70:30 ratio for classification purposes [23]. Resolving Data Imbalance Using Sampling Techniques The complication in considering the clinical dataset for experimentation is the imbalance in the dataset. The imbalance occurs when the dataset comprises more classes in the majority and very few classes in the minority [24]. These imbalances in data decrease the performance of the algorithms leading to incorrect classification performance [25]. This is because the classifiers have a bias toward the majority data while the minority class is considered noise and is avoided. It leads to greater misclassification in minority datasets. To overcome all these problems
Oversampling Techniques Oversampling techniques are employed to address the issue of dataset imbalance by producing a greater count of training samples for the minority classes. These techniques encompass Random Oversampling, Synthetic Minority Oversampling Technique (SMOTE), Borderline SMOTE, ADASYN, and Safe-level SMOTE, among others. In this study, we applied three oversampling techniques: Random Oversampling, SMOTE, and Borderline SMOTE. [28]. Random Oversampling In this Random oversampling technique, the randomly selected samples from the minority class are duplicated to balance the dataset. The benefit of this technique is that there is no loss of details but may cause overfitting since it makes a similar copy of minority class samples [29]. Synthetic minority oversampling technique (SMOTE) SMOTE is an Oversampling technique that increases the minority class by generating synthetic samples. These additional data points are created based on existing real data, with synthetic samples inserted along lines connecting the nearest neighbors of the minority class. Neighbors are selected randomly as needed [30]. While SMOTE’s primary advantage lies in its ability to generate diverse synthetic instances of the minority class, differing from substitution methods in other techniques, its main drawback is its disregard for neighboring class examples and vulnerability to data intricacy [31]. Borderline-smote Contrary to SMOTE, this technique generates minority samples besides the borderline and its k-nearest neighbors [29,32]. It is also classified as borderline-SMOTE1 and borderline-SMOTE2. It is also classified as borderline-SMOTE1 and borderline-SMOTE2. It has the advantage of sampling only the minority class’s boundary instances, which helps minimize operation time, but it lacks customized policies for dealing with other types of border instances [31] Under-sampling technique Under-sampling techniques aim to reduce the number of samples in the majority class. By decreasing the size of the majority class set A, these techniques help alleviate the
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
skewed distribution between A and the minority class set I. In this study, we applied three under-sampling techniques: Random Under-sampling, Tomek Links Under-sampling, and Edited Nearest Neighbors (ENN) Rule.
balance by eliminating large samples that form “Tomek link pairs” with each other in the dataset, but it ignores small samples and abnormal points in the data, and the sample distribution balancing is also limited [37].
Random under-sampling It is the simplest technique where the randomly selected samples are eliminated from the majority class which may lead to information loss [34]. It has the advantage of avoiding excess majority samples and shortening the prediction model’s training time, but the main limitation of this technique is that it removes the useful data that is needed for the induction process [35].
Edited Nearest Neighbors Rule (ENN) If the minority class has three nearest neighbors (k=3) belonging to the majority class, these neighbors are excluded, along with the majority class samples found in the boundary [38]. Despite removing more instances compared to Tomek links, ENN is efficient in eliminating misclassified cases from all classes based on the consensus of the three nearest neighbors. However, undersampling with ENN may sometimes discard potentially valuable instances from clinical datasets [39]. Figure 1 and Figure 2 represent the illustration of oversampling and undersampling techniques on a given dataset. The first box represents the distribution of the original dataset where each color represents the data in each class. Blue represents the normal, white represents the suspect and the red represents the pathology. The next three boxes represent the significant change in the number of samples
Tomek links under-sampling It is a method of under-sampling developed by Tomek which is an improvement of the Nearest-Neighbor Rule. Let u be an instance of class P and v an instance of class Q. Let d (u, v) be the distance between u and v. (u, v) is a T-Link if for any instance t, d (u, v) < d (u, t) or d (u, v) < d (v, t). If any two examples are T-Link then one will be noise and the other will be the examples that are located on the boundary of the classes [36]. It also improves the data
Figure 1. Visualizing over-sampling techniques for dataset representation.
Figure 2. Visualizing under-sampling techniques for dataset representation.
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
in each class after applying the oversampling and undersampling techniques.
SMOTETomek for Data Imbalance From our sampling techniques, we have combined Smote from oversampling and Tomek Links from the undersampling technique into SMOTETomek for our data imbalance [40]. We found that SMOTETomek performs very well than other techniques. We have implemented this technique in the Bagging with Random Forest classifier for classification.
Proposed Technique Our proposed approach integrates sampling techniques by combining SMOTE from Oversampling with TOMEK LINKS from Undersampling. This combination is implemented within the Bagging framework using the Random Forest classifier for classification. Some of the key assumptions include Class Imbalance, Feature Importance, and Model Generalization. To effectively apply the proposed method for CTG data classification:
1. Applying Smote Tomek sampling for class imbalance.
2. Training a Random Forest ensemble with a bagging classifier, tuning hyperparameters for optimal performance.
3. Evaluating the model using metrics like accuracy and
interpreting feature importance to enhance fetal health monitoring outcomes. Fig 3 represents the overall flowchart of our method.
Random Forest Classifier A classifier containing the multitude of tree structure classifiers used in the process of regression and classification is the Random Forest. The multitude of tree structures is represented as {g (x, ϕt), t=1….} where {ϕt} are unique random vectors that are distributed independently. Each tree votes for the desired class at input x. The selection is done by the forest for the classification based on the increased votes over all the trees in the forest. Every tree grows in the following procedure:
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
1. If M is the number of cases in the training set and if it
samples randomly M cases with replacement from original data then it is the training data for the tree.
2. If we give N input variables, the value of n<<N will be
represented at the individual node, and random selection of m variables out of M is done and the best split helps in splitting the node. The value of m is the constant during the growth.
3. Without any pruning, the tree grows to the maximum
extent [41]. RF introduces modifications to the way classification or regression trees are built and incorporates additional randomness through the use of diverse bootstrap samples from the dataset for each tree’s construction. In the context of our CTG dataset, which is used for classifying data into ‘normal,’ ‘suspect,’ or ‘pathology’ categories, the Random Forest method is described as follows:
1. Multiple bootstrap samples are drawn from the actual
dataset, creating a collection of ntree bootstrapped datasets.
2. For each of these bootstrap samples, an unpruned tree
is developed for classification or regression, with a key difference:
3. In each tree-building node, instead of selecting the best
split among all available predictors, a random subset of predictors is sampled, and the split is chosen from this subset. When the number of predictors sampled (mtry) equals the total number of predictors (p), it resembles the conventional bagging approach with no randomness.
4. To make predictions on new data, the results from the
trees are combined. For classification, majority votes are used, while for regression, the mean is employed [42].
2. Resample the training data using the SMOTE and
TomekLinks sampling strategy to produce two distinct datasets. 3. Construct a pipeline that includes oversampling, undersampling, and a random forest classifier with 1000 estimators.
4. Create a repeated stratified k-fold cross-validation
approach comprising 10 splits and 3 repetitions to evaluate pipeline performance using f1 micro-scoring. Form the pipeline to the training data and compute the average f1 score. 5. Create a bagging classifier with 1000 estimators, a sample size of 0.8, and a True Out-of-Bag score.
6. Apply the bagging classifier to the training data and
compute the Out-of-Bag score. Random Forest, as a standalone algorithm, already combines the predictions of multiple decision trees within the Random Forest model. In contrast, a bagging classifier with Random Forest as the base estimator combines the predictions of multiple base classifiers, with Random Forest. This approach leverages the diversity and strengths of various base classifiers to enhance overall performance and robustness.
Bagging Ensemble with Random Forest Classifier In our study, we employed a bagging classifier wherein the random forest serves as the base classifier. This ensemble learning technique combines bagging and the random forest algorithm to create a more resilient and precise model. It generates and consolidates multiple models from bootstrapped samples of the training set, with each model using a Random Forest Classifier as the base estimator. This classifier constructs numerous decision trees using random subsets of the training data and their respective features. The predictions from these trees are then amalgamated to produce the final prediction, enhancing accuracy while mitigating overfitting. The “fit()” function of the bag models is utilized to train the Bagging classifier on the training data. The “max_samples” parameter specifies the number of samples to be drawn from the training set. In a Bagged Random Forest (BRF), a distinct random subset of features is selected for each split within every tree, introducing an additional layer of diversity beyond bootstrap sampling. The overall summary of the proposed method is as follows:
Results And Discussion
Metrıcs for Assessment Accuracy (ACC) Accuracy is the measure of the ratio of precise predictions over the total number of samples evaluated. Acc = TN + TP / TP + FN + FP+ TN
Precision (P) Precision represents the accuracy of positive predictions among all positive samples predicted within a positive class. P = TP / FP+ TP
Recall (R) The recall is used to calculate the proportion of correctly classified positive samples. R = TP/TP+TN
F1-score This F1-score is the measure of the harmonic mean between the values of recall and precision F1-score = 2PR/P+R
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
where TP and TN represent the True Positives and Negatives and FP and FN represent the False Positives and Negatives
The evaluation performance of the under-sampling and over-sampling techniques implemented in the unbalanced data to enhance the classification process is given in Table 3 and Table 4. In the oversampling techniques, it is found that SMOTE with Random Forest produces a greater accuracy of 95% than the Random oversampling and Borderline SMOTE techniques. In the under-sampling technique, the Tomek links produce a very good accuracy of 93% than the Random under-sampling and edited nearest neighbor technique. The Under-sampling techniques other than Tomek Links produce a very low accuracy in comparison with basic RF. It is also seen that the oversampling techniques perform very well compared to the undersampling techniques in this dataset. The method in which we combine the oversampling and under-sampling techniques improves the performance of classification by removing the errors
Performance Evaluation The fetal CTG dataset is utilized for experimentation, and the method is implemented using Python on a system featuring an 11th Gen Intel(R) Core (TM) i5 processor running a 64-bit operating system, Windows 11. Google Colab with GPU backend is employed for executing the experimentation. The experimental results for basic Random Forest are given in Table 2. The overall accuracy of the Basic random forest is 93.57%. It is found that good results are produced in the classification of normal images with 95% of precision, 100% of recall, and 97% of F1-score.
Table 3. Performance of oversampling techniques with RF Technique
Table 4. Performance of undersampling techniques with RF Technique
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
in both samplings. This method yields better results and improves accuracy greatly. Here, in our results, we found that the random forest with SMOTE performs well in comparison to other techniques, and in under-sampling, it is found that the Random Forest in Tomek Links performs well and achieves the best results. Hence, we combine these two techniques as SMOTE from oversampling and Tomeklinks from Undersampling as SmoteTomek. Table 5 gives the results of SmoteTomek implemented in the RF classifier and also the results of the combined sampling technique (SmoteTomek) in the bagging ensemble method with the random forest classifier. The proposed technique is the combination of sampling techniques for balancing data and its implementation in the Bagging classifier in which random forest acts as the base classifier. The proposed approach attains a very high accuracy of 98.5%. It also achieves 100% of Precision and Recall in normal and pathology classes. Table 6 gives the accuracy of our dataset when implemented with other classifiers such as SVM, DT, and K-Nearest Neighbor (KNN). Among the compared deep learning classifiers in Table 7, the proposed model gets the best accuracy (98.5%), suggesting its superior performance. Deep Forest, Deep Neural Network, MKNet, and MKRNN had lesser accuracies ranging from 88.02% to 95.07%, indicating varied degrees of competence in classifying the dataset.
and under-sampling (Tomek links) techniques, resulted in a remarkable 98.5% accuracy in classification. This combined approach effectively addressed class imbalance, demonstrating the technical significance of the method. From a theoretical viewpoint, this method creatively combines resampling techniques and ensemble learning to handle imbalanced CTG datasets. It balances class distribution using Smote Tomek sampling and boosts model performance with a Random Forest ensemble using bagging. From an experimental viewpoint, this method notably enhances classification accuracy, achieving an impressive 98.5% accuracy in CTG data classification. It surpasses traditional classifiers and deep learning models, showcasing its effectiveness in precisely categorizing fetal states based on CTG signals.
Key Findings The CTG data classification of FHR signals using the Bagging technique with a Random Forest classifier yielded an impressive accuracy of 96.8%. Further enhancements, including the implementation of over-sampling (SMOTE)
Strengths and Limitations The technical significance of our method lies in its ability to achieve a high level of accuracy and effectively manage class imbalance using the hybrid resampling technique of SMOTE and Tomek links. This approach leverages the Bagging Classifier with a Random Forest base estimator, which not only reduces variance and overfitting but also enhances model generalization, provides valuable insights into feature importance, and benefits from parallel processing capabilities. However, a potential limitation of the Bagging ensemble with Random Forest is that it may increase computational complexity and resource requirements. The limitation of our method is the computational complexity compared to conventional Random Forest. This is because, in a Bagged Random Forest, a distinct random subset of features is chosen for each split within each tree,
Table 5. Performance of combined Techniques with RF Technique
Table 7. Comparison with other deep learning classifier Table 6. Performance of evaluation with competent classifiers
Sigma J Eng Nat Sci, Vol. 43, No. 2, pp. 452−462, April, 2025
adding an extra level of variation alongside the bootstrap sampling process.
Conflict Of Interest
Comparison with Similar Approaches Our proposed method was compared to other classifiers, and it outperformed them, achieving greater accuracy. A bar chart in Figure 6 provides a visual representation of the comparison of accuracies among different classifiers. Moreover, the performance details from relevant tables, including Table 2, which demonstrates that the basic Random Forest (RF) did not meet the expected accuracy for the data, prompted us to implement over-sampling and under-sampling techniques. The results in Table 3 and Table 4 indicated that SMOTE for oversampling and Tomek links for undersampling outperformed other techniques. Consequently, we decided to oversample our data with SMOTE and undersample with Tomek links, using a basic RF classifier resulting in the enhanced accuracy of 96.8% as demonstrated in Table 5. Tables 6 and 7 give the comparative performance with other ML and DL classifiers. The confusion matrix for our proposed Rf is illustrated in Fig:5.
Conclusion
The assessment of fetal state using the CTG is essential due to its critical importance, as it has the potential to result in fatal outcomes if not managed appropriately. The classification of fetal state from CTG using Machine Learning algorithms is presented. Though there are various machine learning classifiers implemented in this classification of CTG data it is found that there is an obvious need for the upgrade of accuracy. In this, we use the combined sampling technique in a Random Forest classifier with Bagging. We first implemented the oversampling techniques as smote, Random oversampling, and borderline smote. Then we implemented the under-sampling techniques such as Random under-sampling, Tomek Links, and Edited nearest neighbors. Based on the results, we combined the Smote from oversampling and Tomek Links from under-sampling as they performed well among the other techniques. Then we used the ensemble method of bagging with random forest as the base classifier. Our method achieves astonishing results of 98.5 % accuracy in the classification of this CTG data. Future works can be done by applying class weight after bootstrapping and improvement in feature selection can also be done.
The author declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Ethics
There are no ethical issues with the publication of this manuscript.
Share and Cite
HEPHZIBAH, R.; CHRISTINAL, A.H.; ALEX, D.M.; JAYANTHI, R.; CHANDY, D.A.; BAJAJ, C. A hybrid model of random forest ensemble and resample for cardiotocography data classification. Sigma Journal of Engineering and Natural Sciences 2025, Vol. 43, pp. 452-462. https://doi.org/10.14744/sigma.2024.00083

