Abstract
Background
Early miscarriage is a common complication following assisted reproductive technology (ART), affecting 20–30% of conceptions and creating challenges for patient counseling and treatment planning. Accurate prediction remains difficult because of the multifactorial nature of miscarriage and variability in ART outcomes. Machine learning (ML) offers promising opportunities for individualized risk assessment.
Objective
This study aimed to develop an ML-based framework for early prediction of chemical miscarriage in infertile women undergoing ART using only pre-treatment baseline clinical data.
Materials and Methods
In this developmental study, clinical data from 3000 infertile couples who attended the Yazd Reproductive Sciences Institute, Yazd, Iran, between March 2020 and September 2022 were extracted from medical records. After preprocessing, including missing data handling, outlier correction, normalization, and class balancing, a benchmark dataset of 1234 samples with 32 features were constructed and made publicly available. Multiple ML algorithms and feature selection methods were evaluated.
Results
Across both imbalanced and balanced datasets using synthetic minority oversampling technique and adaptive synthetic sampling, the random forest model achieved the best performance, with area under the receiver operating characteristic curve values of 70.9%, 70.3%, and 70.8%, and corresponding accuracies of 82.2%, 81.1%, and 80.0%, respectively. 12 clinically relevant predictors were identified, including maternal age, body mass index, previous abortions, thyroid-stimulating hormone levels, sperm parameters, ART-related protocols, history of intrauterine insemination, and menstrual regularity.
Conclusion
ML models, particularly random forest, can provide meaningful early prediction of miscarriage risk using baseline clinical data. The publicly available benchmark dataset supports reproducible research and future advances in predictive reproductive medicine.
Keywords: Infertility, Pregnancy loss, Assisted reproductive technology, Machine learning, Prediction, Classification.
1. Introduction
Infertility, which affects millions worldwide, is defined as the inability to achieve pregnancy after 12 months of regular, unprotected intercourse (1). Approximately one in 7 couples encounter this issue (2). Assisted reproductive technology (ART) provides hope for many, but early miscarriage remains a significant concern, particularly in pregnancies achieved through ART. Miscarriage rates are estimated to be around 10–15% in natural pregnancies, with higher rates observed in ART pregnancies. So far, various factors that influence early miscarriage in both natural and ART cycles have been recognized in medical studies (3). However, accurately predicting treatment outcomes can help alleviate the anxiety faced by couples undergoing ART.
In recent years, machine learning (ML) has been widely used in medical diagnosis and prediction (4–11), often with very good results. Yet, few studies have specifically explored the use of ML to predict miscarriage risk in ART pregnancies. Existing research has not thoroughly examined all relevant features, highlighting the need for a predictive model encompassing a broad range of factors.
An ML model developed using 66,706 ART cycles identified fetal heart rate, maternal age, body mass index (BMI), gestational sac diameter, and hormone levels as key predictors, with Random Forest (RF) showing the best performance (12).
A study compared XGBoost and RF, using time-lapse embryo imaging data, with deep learning. The model achieved 68% accuracy, highlighting the importance of uterine and maternal factors in miscarriage prediction (13).
A machine-learning framework using hill-climbing feature selection was developed for in vitro fertilization outcome prediction. Multiple classifiers (RF, support vector machine [SVM], multilayer perceptron, classification and regression trees, C4.5 decision tree [DT] algorithm [C4.5]) were evaluated, and RF performed best. Key predictors included age, antral follicle count and fertilization-related factors (14). Ensemble models were applied to 1664 single vitrified-warmed blastocyst transfer cycles, achieving an area under the receiver operating characteristic (ROC) curve (AUC) of 0.836 for pregnancy outcome prediction. Blastocyst quality was identified as a key predictive feature (15).
A DT-based model, using 1021 ART couples to predict miscarriage risk, achieved a mean accuracy of 0.84. Maternal age, embryo quality, and stimulation duration were identified as key predictors (16).
To the best of our knowledge, most ART miscarriage prediction studies rely on post-transfer or embryo-related variables, limiting their applicability to early infertility treatment.
In contrast, no prior studies have systematically developed predictive models using exclusively pre-treatment baseline clinical data, while simultaneously providing a publicly available benchmark dataset. This limits early-stage risk assessment and hinders reproducibility and comparative evaluation across studies.
This study develops an ML-based system using exclusively baseline clinical parameters recorded at the initial infertility evaluation to predict the risk of chemical pregnancy in infertile women. It introduces a benchmark dataset of 1234 real-world ART cases with 32 preprocessed features, publicly released as the first open-access resource in this domain for reproducibility and comparative analysis. Multiple ML algorithms are systematically evaluated on imbalanced data, balanced versions (synthetic minority oversampling technique [SMOTE] and adaptive synthetic sampling [ADASYN]), and reduced feature sets to identify optimal models and key abortion risk predictors.
2. Materials and Methods
In this developmental study, the comprehensive clinical data of 3000 infertile couples who were referred to the Yazd Reproductive Sciences Institute, Yazd, Iran from March 2020-September 2022 were extracted from their medical records.
Data collection
Data collection involved processes such as inner join and the creation of views to consolidate data from various tables in the institute's dataset. In this study, clinical pregnancy was defined as the ultrasound visualization of an intrauterine gestational sac with fetal cardiac activity at 6–7 wk of gestation, whereas chemical (biochemical) pregnancy loss was defined as a pregnancy diagnosed only by a positive serum beta-human chorionic gonadotropin test at 14 days after embryo transfer that subsequently declined without ultrasound evidence of an intrauterine pregnancy, the inclusion criterion for the study is a positive result during the chemical pregnancy stage, indicated by a positive beta-human chorionic gonadotropin test 14 days after embryo transfer. Couples pursued treatment for different reasons, including male factors, female factors, and unknown reasons, and underwent either in vitro fertilization or intracytoplasmic sperm injection, as determined by clinical diagnosis.
In the original collected data, 1234 records were divided into 2 groups: women whose pregnancies ended in chemical miscarriage (positive class, n = 257) and those whose pregnancies progressed to the clinical stage (negative class, n = 977). Clinical pregnancy was defined as the detection of fetal heart rate via ultrasonography, while chemical miscarriage was characterized as the termination of pregnancy prior to the detection of fetal heart rate.
Data preprocessing
Since the collected dataset was a real-world dataset with various noise and inconsistencies, preprocessing operations were essential to enhance its quality for analytical purposes (17). This stage included operations such as feature selection, replacing or removing missing data, eliminating outliers, normalizing data, transforming continuous feature values, and discretizing continuous features. It also involved adjustments like removing duplicates and addressing missing values. Some key steps undertaken in this study are as follows:
-
•
Feature selection: identification of influential features
A variety of features can influence the occurrence of miscarriage, with certain factors deemed more critical by specialists. To ensure we selected an appropriate number of features from our dataset, we identified those that impact chemical miscarriage, drawing on the insights of experts in obstetrics, gynecology, and reproductive biology. The selected features are summarized in table I.
-
•
Handling the missing data
Missing data are defined as instances where no value was recorded for a variable in an observation, which can significantly affect data analysis. The reasons for missing data include noise in the recorded data, non-registration, and invalid values (18). In this study, several methods were used to address the missing data, including sample deletion, manual filling, utilizing feature averages, and applying the most probable value approach.
-
•
Handling outliers
Outliers are identified as values that significantly deviate from the rest of the dataset (19). These outliers were detected using the box plot tool, as illustrated in figure 1. To address the outliers, specific ranges for each variable were established in consultation with specialists, and data points falling outside these ranges were flagged as outliers. These outliers were subsequently replaced with mean or median values. Initially, outliers are particularly noticeable in the thyroid-stimulating hormone (TSH) variable (Figure 1); however, data points falling within the defined medical range were preserved. To enhance the model performance, outliers were re-evaluated using the DBSCAN (density-based spatial clustering of applications with noise) algorithm (20), a clustering method effective for outlier detection. The outliers identified through this process were then replaced with mean or median values (19, 21). As shown in figure 2, replacing the outliers yielded in a more symmetric and compressed distribution of the TSH values, effectively reducing the influence of extreme values in the model. This refinement is essential for improving the model's reliability and reducing potential biases caused by skewed data.
-
•
Data normalization
The choice of measurement units can have a significant effect on data analysis. To mitigate reliance on the specific choice of measurement units, it is essential to normalize or standardize the data. This process involves transforming the data into a smaller, common range, typically between (0, 1). The goal of normalization is to ensure that all features carry equal weight, which is especially beneficial for classification algorithms. In this study, min-max scaling was utilized as the normalization method (18).
-
•
Data transformation
Most ML algorithms necessitate numerical matrices for effective learning. However, non-numeric data are frequently encountered in real-world datasets. To convert categorical data into a numerical format, we employed the one-hot encoding method. This technique creates binary columns for each category, allowing the algorithms to process the data appropriately. In this study, the variables ART protocol plan and infertility diagnosis category, directly extracted from electronic records, were included in the models as categorical features using this encoding method. As clinician-entered text fields describing the planned ART procedure and the recorded infertility diagnoses, respectively.
-
•
Reducing data redundancy
To evaluate the correlations among features, we utilized covariance and correlation analysis. Correlation specifically measures the linear relationship between 2 features, though it does not imply causation (18). Figure 3 presents the Pearson correlation heat map of numerical features, where the intensity of the color reflects the strength of the linear relationship. In this analysis, a threshold of 0.7 was selected to identify strongly correlated features. In clinical datasets, especially those related to reproductive medicine, moderate to strong correlations among features were common due to underlying biological associations.
Therefore, a relatively high threshold of 0.8 was adopted, following recommendations from applied modeling literature, which suggest that lower thresholds (e.g., 0.6 or 0.7) may lead to unnecessary exclusion of clinically important features (22). As shown in figure 3, none of the feature pairs exceeded this threshold, indicating an absence of severe correlation. Therefore, no features were removed based on the correlation analysis.
-
•
Data balancing
Imbalanced datasets are a frequent issue in medical data, presenting challenges as models may tend to overfit the majority class (23). In our dataset, the number of women without early miscarriage (n = 977, 79.17%) were significantly greater than that of women who experienced early miscarriage (n = 257, 20.83%). To tackle this imbalance, we employed oversampling methods to enhance the representation of the minority class. In this approach, new samples were generated by making minor adjustments to the values of the minority group. Essentially, the algorithm thus analyzes the feature space of data points within the minority class and considers their k nearest neighbors for sampling (24). There are various types of this method. In our study, we utilized the SMOTE and ADASYN algorithms to identify the most effective strategies for addressing the class imbalance (24–26).
Model generation and evaluation
In this stage, we focused on designing prediction models using various ML algorithms. The algorithms implemented and evaluated for the desired prediction model included DT, RF, SVM, and logistic regression (LR) (27, 28).
We evaluated the performance of the models using a range of metrics, including accuracy, recall, precision, F1-score, and AUC. The result of models for each sample was considered as true positive, or false positive, or true negative, or false negative cases based on their actual and predicted categories. Accordingly, the evaluation metrics were measured as follows:
AUC provides a single measure of the model's ability to distinguish between the classes. The larger the AUC value, the better the performance of the prediction algorithm, indicating a higher likelihood that the model will correctly classify positive and negative instances. An AUC of 1.0 signifies perfect classification, while an AUC of 0.5 suggests no discriminative ability, equivalent to random guessing.
Table 1.
Primary features of study couples
| Features | Type |
| Female age | Numeric |
| Male age | Numeric |
| Body mass index | Numeric |
| Primary infertility | Boolean |
| Secondary infertility | Boolean |
| Duration of primary infertility | Numeric |
| Duration of secondary infertility | Numeric |
| Gravidity | Numeric |
| Number of previous abortions | Numeric |
| Family marriage | Boolean |
| Regular menstruation | Boolean |
| Past medical history | Boolean |
| Family history | Boolean |
| Surgical history | Boolean |
| History of medication for infertility treatment | Boolean |
| Intrauterine insemination history | Boolean |
| ART history | Boolean |
| ART protocol plan | String |
| Protocol of ovarian stimulation | String |
| Check diagnosis | Boolean |
| Infertility diagnosis category | String |
| Anti-Mullerian hormone | Numeric |
| Thyroid-stimulating hormone | Numeric |
| Prolactin | Numeric |
| Antithyroid peroxidase antibody | Numeric |
| Hemoglobin | Numeric |
| Uterine shape | String |
| Sperm motility | Numeric |
| Sperm morphology | Numeric |
| Sperm non-progressive motility | Numeric |
| Chemical miscarriage (target) | Boolean |
| Boolean features represent binary yes/no categories (1 = yes/positive, 0 = no/negative). String features are categorical variables. Target variable: Chemical miscarriage (1 = positive/occurred, 0 = negative/clinical pregnancy progressed). ART: Assisted reproductive technology | |
Figure 1.

Box plot of outliers for the thyroid-stimulating hormone (TSH) variable.
Figure 2.

Box plot of the TSH variable after replacing the outliers.
Figure 3.

The correlation plot of numerical features in the dataset.
Ethical Considerations
This study was approved by the ethics committee of Shahid Sadoughi University of Medical Sciences, Yazd, Iran (Code: IR.SSU.REC.1401.087). All procedures were conducted in accordance with relevant ethical guidelines and regulations. Due to the retrospective nature of the study and the use of de-identified clinical data, the requirement for informed consent was waived by the ethics committee. Patient confidentiality and privacy were strictly maintained, and all data were anonymized prior to analysis.
3. Results
We evaluated the performance of each ML algorithm, mentioned in section 2.3, on the test data and compared them with each other. Initially, the dataset was randomly divided into training (70%) and testing (30%) sets. The Stratified K-Fold algorithm with 5-folds was employed for training the models. The algorithms were implemented using Python programming language version 9.3.4.1. The evaluation of the models was carried out in 3 stages, utilizing different datasets: the original imbalanced data, data balanced using the SMOTE and ADASYN algorithms, and a dataset generated with the most influential features. Below, we outline the results from each evaluation stage.
Evaluation of the models on the imbalanced dataset
In this experiment, we evaluated the ML models on the original imbalanced data. Due to the imbalanced nature of the dataset, we expect to see lower accuracy, especially for the minority class. Table II summarizes results on the test dataset. As shown in this table, among the evaluated models, the RF algorithm achieved the highest AUC (70.90%) and accuracy at 82.20%, demonstrating robustness in handling imbalanced data. However, its recall for the minority class remained low (24.10%), indicating limited effectiveness in identifying chemical miscarriages. The DT model delivered moderate performance with 73.60% accuracy and a recall of 44.30%. Although it balances precision and recall more effectively than other models, its overall accuracy is lower compared to RF. SVM achieved 80.30% accuracy, but suffers from low recall (19.00%), indicating difficulty in detecting the minority class. LR performs the weakest, with only 75.70% accuracy and a recall of 10.10%, confirming its ineffectiveness in managing data imbalance. In the context of clinical risk stratification, RF demonstrated a robust ability to identify low-risk patients, characterized by its high specificity. This feature enables healthcare professionals to fine-tune decision thresholds in scenarios where heightened sensitivity is required, particularly for enhancing the detection of miscarriages. Conversely, DT exhibited a superior recall rate of 44.3%, making it particularly effective for screening high-risk individuals. The complementary strengths of RF and DT suggested that a combined approach could enhance overall diagnostic capabilities, allowing for more nuanced risk assessments and better-informed clinical decisions.
Evaluation of the models on the balanced dataset
In this stage, the dataset was balanced using the SMOTE and ADASYN algorithms. These techniques aim to address the class imbalance by generating synthetic samples for the minority class. Following the application of these algorithms, we evaluated the performance of the models on the newly balanced datasets. The results from this evaluation highlighted improvements in accuracy and other performance metrics compared to the original imbalanced dataset.
-
•
SMOTE balanced dataset: this dataset contains 1945 samples, with 977 samples each in the majority and minority classes.
-
•
ADASYN balanced dataset: this dataset includes 1943 samples, with 977 samples in the majority class and 966 in the minority class.
To avoid data leakage, all oversampling procedures (SMOTE and ADASYN) were strictly confined to the training data. Both balanced datasets were divided in the same manner, with 70% allocated for training and 30% for testing. The performance of the different models on these 2 balanced datasets (evaluated on test data) were compared in table III. The results indicated that, again, the RF algorithm outperformed all other models, achieving 81.10% accuracy with the SMOTE dataset and 80.01% with the ADASYN dataset.
DT showed lower accuracy compared to RF, achieving 71.70% with the SMOTE dataset and 70.90% with the ADASYN dataset. SVM obtained 69.80% accuracy with SMOTE and 68.50% with ADASYN, while LR recorded the lowest accuracies of 58.20% and 56.60%, respectively. Although RF maintained the highest overall accuracy, class balancing techniques significantly improved the models’ ability to detect the minority class. The SVM demonstrated improved recall (53.20% with SMOTE and 55.70% with ADASYN), indicating that class balancing techniques have significantly enhanced its ability to detect chemical abortion cases. The LR, while showing the lowest accuracy (58.20% with SMOTE and 56.60% with ADASYN), achieved the highest recall among all models (54.40% and 57.00%, respectively), showing its increased sensitivity to the minority class after balancing.
The results indicated that both SMOTE and ADASYN effectively enhanced the models' ability to predict the minority class (chemical abortion), as demonstrated by the increases in recall and F1 scores. These improvements highlighted the importance of using balancing techniques to address class imbalances, ultimately leading to more accurate and reliable predictions for the minority class.
Figure 4 shows the comparison of AUC values for different models evaluated on 3 datasets: the imbalanced dataset, the balanced dataset with SMOTE, and the balanced dataset with ADASYN. The results reveal important insights into how data balancing affects model performance, highlighting the improvements achieved by using balancing techniques to enhance the predictive capabilities of models. This comparison emphasizes the important role that dataset characteristics play in determining the effectiveness of ML algorithms:
a) Imbalanced dataset: here, the RF algorithm achieved the highest AUC of 70.790%, which shows its superior performance in handling data imbalance compared to other models. In contrast, both SVM and LR showed lower AUC values, indicating their reduced ability to discriminate between classes effectively. This decrease in performance is largely attributed to the absence of the minority class, which hinders the predictive capabilities of these models in this field.
b) SMOTE-balanced dataset: balancing the dataset with SMOTE leads to moderate improvements in all models. The RF algorithm achieves an AUC of 70.30% and presents itself as the top-performing model, while the SVM achieved an AUC of 66.90%. DT and LR models also show some improvements, reaching 62.00% and 57.40% AUC, respectively. This point highlights the partial effectiveness of SMOTE in improving model performance.
c) ADASYN balanced dataset: using ADASYN, slight improvements in AUC were observed, especially for the RF algorithm, which achieved an AUC of 70.80%. Meanwhile, SVM maintained a comparable AUC of 66.20%, similar to its performance with SMOTE. DT and LR models reached 58.00% and 58.70% AUC, respectively, showing modest gains over the imbalanced dataset.
The above-stated findings confirm that class balancing techniques primarily improve the models sensitivity rather than overall accuracy, which is particularly important in imbalanced clinical datasets such as those related to chemical pregnancy loss.
Most influential features
Feature selection is utilized to optimize the model dimensions and improve the accuracy and performance (29). In this study, 3 feature selection algorithms, select K best (KBest), RF, and eXtreme gradient boosting (XGBoost), were employed to identify the most relevant predictors of miscarriage. To enhance model stability and ensure clinical interpretability, only the features consistently selected by all 3 methods are retained for model development. The final set of 12 influential features included female age, BMI, number of previous abortions, TSH, sperm non-progressive motility, sperm immotility, sperm morphology, ART protocol plan, ART history, ovarian stimulation protocol, history of intrauterine insemination, and menstrual regularity.
Table 2.
Performance of the models on the imbalanced dataset
| Model | Accuracy (%) | Recall (%) | Precision (%) | F1-score (%) | AUC (%) |
| DT | 73.60 | 44.30 | 39.30 | 41.70 | 63.00 |
| RF | 82.20 | 24.100 | 76.00 | 36.50 | 70.90 |
| SVM | 80.30 | 19.00 | 62.50 | 29.100 | 64.50 |
| LR | 75.70 | 10.100 | 29.600 | 15.100 | 57.50 |
| DT: Decision tree, RF: Random forest, SVM: Support vector machine, LR: Logistic regression, AUC: Area under the receiver operating characteristic curve | |||||
Table 3.
Performance comparison of the models on the balanced datasets
| Dataset | Model | Accuracy (%) | Recall (%) | Precision (%) | F1-score (%) | AUC (%) |
| DT | 71.70 | 43.00 | 36.20 | 39.30 | 62.00 | |
| RF | 81.10 | 36.70 | 59.20 | 45.30 | 70.30 | |
| SVM | 69.80 | 53.20 | 35.90 | 42.90 | 66.90 | |
| Balanced with SMOTE | LR | 58.20 | 54.40 | 26.50 | 35.70 | 57.40 |
| DT | 70.90 | 32.90 | 32.10 | 32.50 | 58.00 | |
| RF | 80.01 | 34.20 | 55.51 | 42.20 | 70.80 | |
| SVM | 68.50 | 55.70 | 34.90 | 42.90 | 66.20 | |
| Balanced with ADYNS | LR | 56.60 | 57.00 | 26.20 | 35.90 | 58.70 |
| SMOTE: Synthetic minority over-sampling technique, ADASYN: Adaptive synthetic sampling, DT: Decision tree, RF: Random forest, SVM: Support vector machine, LR: Logistic-regression, AUC: Area under the receiver operating characteristic curve | ||||||
Figure 4.

Comparison of AUC values for the evaluated ML models on A) The original imbalanced dataset, B) The dataset balanced with SMOTE, and C) The dataset balanced with ADASYN. The figure illustrates how the model's discriminative performance varies across different data-balancing strategies.
4. Discussion
This study developed an ML-based framework for early prediction of chemical miscarriage in ART pregnancies using exclusively pre-treatment baseline clinical data. Unlike many previous studies that incorporate post-transfer or embryo-specific variables, this approach enables risk assessment at the initial stage of infertility evaluation, thereby supporting earlier and more actionable clinical decision-making.
Among the evaluated models, the RF algorithm consistently achieved the best overall performance across both imbalanced and balanced datasets. In particular, RF obtained AUC values of 70.9%, 70.3%, and 70.8% on the imbalanced, SMOTE-balanced, and ADASYN-balanced datasets, respectively, with corresponding accuracies of 82.2%, 81.1%, and 80.0% (Tables II and III). The superior performance of RF can be attributed to its ability to capture complex nonlinear relationships and interactions among clinical variables, which are common in multifactorial conditions such as early pregnancy loss. In contrast, linear models such as LR demonstrated limited performance, likely due to their inability to model such complex dependencies. Although DT models showed lower overall accuracy, their relatively higher recall for the minority class suggests potential utility in high-sensitivity screening scenarios.
An important observation in this study is that class balancing techniques (SMOTE and ADASYN) primarily improved model sensitivity rather than overall accuracy. This is consistent with the nature of imbalanced clinical datasets, where detecting the minority class (miscarriage cases) is inherently challenging. From a clinical perspective, improving recall is particularly important, as failure to identify high-risk patients may lead to missed opportunities for closer monitoring or early intervention.
Feature selection identified 12 influential predictors, including maternal age, BMI, number of previous abortions, TSH, sperm-related parameters, ART protocol characteristics, and menstrual regularity. These predictors are not only statistically significant but also biologically and clinically plausible. Maternal age is strongly associated with increased chromosomal abnormalities and reduced oocyte quality, which are major contributors to early pregnancy loss. BMI influences hormonal balance, insulin resistance, and endometrial receptivity, all of which play critical roles in implantation and early pregnancy maintenance. TSH is essential for early embryonic development, and thyroid dysfunction has been linked to increased miscarriage risk even within subclinical ranges. A history of previous abortions may indicate underlying reproductive or uterine conditions predisposing patients to recurrent pregnancy loss. In addition, sperm motility and morphology reflect sperm quality and genetic integrity, which directly influence embryo viability. Menstrual regularity is indicative of the stability of the hypothalamic-pituitary-ovarian axis and overall endocrine function. Finally, ART-related variables, such as ovarian stimulation protocols and treatment history, may indirectly capture patient-specific reproductive conditions. The alignment between model-identified predictors and established biological mechanisms supports the clinical validity and interpretability of the proposed approach.
Compared with previous studies, several important distinctions emerged. Many prior works rely on post-transfer variables, such as fetal heart rate, embryo quality, or time-lapse imaging data, which inherently provide stronger predictive signals due to their proximity to the outcome. In contrast, the present study focuses exclusively on pre-treatment clinical variables, making the prediction task more challenging but significantly more valuable for early-stage clinical use. Despite this, the performance achieved in this study (AUC 0.70) was comparable to or reasonably close to studies incorporating more informative post-treatment features. Furthermore, differences in dataset size, feature types, and prediction timing should be considered when comparing reported performance across studies. For instance, studies using imaging data or larger cohorts often report higher accuracy, whereas the present study demonstrates that meaningful prediction is achievable even with baseline clinical data alone.
From a clinical perspective, early prediction of miscarriage risk using baseline data has important implications. It can support personalized patient counseling, guide treatment planning, and enable risk stratification prior to initiating ART procedures. In addition, the identification of key predictors provides actionable insights for clinicians to better understand patient-specific risk profiles.
A key contribution of this work is the preparation and public release of a benchmark clinical dataset comprising 1234 real-world ART cases with 32 features. This dataset provides a valuable resource for reproducibility, comparative evaluation, and future research in predictive reproductive medicine. In addition, the study demonstrated a rigorous and transparent ML pipeline, including careful preprocessing, handling of missing data and outliers, and strict prevention of data leakage.
Despite these strengths, several limitations should be acknowledged. First, the analysis is based on a retrospective, single-center dataset, which may limit the generalizability of the findings. Although internal validation was performed using stratified train-test splitting and cross-validation, external validation on independent datasets was not conducted. Therefore, the proposed models should not be considered for routine clinical use. Future research should focus on validating the proposed approach using multi-center and temporally independent datasets to enhance generalizability and clinical applicability.
5. Conclusion
This study illustrates that ML models, particularly RF and DT, can serve as valuable tools for predicting early miscarriage in ART. More importantly, the release of a high-quality benchmark dataset represents an important step toward collaborative research and the development of clinically robust predictive models, ultimately supporting better outcomes for couples undergoing infertility treatment. It is noteworthy that although the proposed models showed promising performance, they are not yet intended for routine clinical use and require further external validation on independent cohorts.
Data Availability
Study data are publicly available to the research community and can be shared electronically through the corresponding author's email.
Author Contributions
M. Zare Ebrahimabad and N. Tabibnejad designed the study, collected the data, analyzed data, implemented the models, and wrote the initial version of the manuscript. M. Hashemzadeh designed and monitored the study, analyzed the results, and critically reviewed the manuscript. All authors approved the final version of the manuscript and take responsibility for the integrity of the data.
Conflict of Interest
The authors declare that there is no conflict of interest.
Acknowledgments
We would like to convey our heartfelt thanks to the Yazd Reproductive Sciences Institute, Yazd, Iran for providing the essential data and support for this research. We also extend our gratitude to the medical professionals and experts whose insights and expertise were invaluable in shaping this study. Additionally, we appreciate our colleagues for their assistance during the data preprocessing and analysis phases, which greatly contributed to the success of this work. No artificial intelligence (AI) tools or automated systems were used at any stage of this study, including data analysis, manuscript writing, editing, revision, translation, or grammar checking. All aspects of the research and manuscript preparation were performed solely by the authors. This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.
References
- 1.World Health Organization Infertility. 2020. https://www.who.int/news-room/fact-sheets/detail/infertility
- 2.Bashiri A, Halper KI, Orvieto R. Recurrent implantation failure-update overview on etiology, diagnosis, treatment and future directions. Reprod Biol Endocrinol. 2018;16:121.:121. doi: 10.1186/s12958-018-0414-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 3.Kolte AM, Bernardi LA, Christiansen OB, Quenby S, Farquharson RG, Goddijn M, et al. Terminology for pregnancy loss prior to viability: A consensus statement from the ESHRE early pregnancy special interest group. Hum Reprod. 2015;30:495–498. doi: 10.1093/humrep/deu299. [DOI] [PubMed] [Google Scholar]
- 4.Hashemzadeh M, Adlpour Azar B. Retinal blood vessel extraction employing effective image features and combination of supervised and unsupervised machine learning methods. Artificial Intelligence Med. 2019;95:1–15. doi: 10.1016/j.artmed.2019.03.001. [DOI] [PubMed] [Google Scholar]
- 5.Farajzadeh N, Sadeghzadeh N, Hashemzadeh M. A fully-convolutional residual encoder-decoder neural network to localize breast cancer on histopathology images. Comput Biol Med. 2022;147:105698. doi: 10.1016/j.compbiomed.2022.105698. [DOI] [PubMed] [Google Scholar]
- 6.Farajzadeh N, Sadeghzadeh N, Hashemzadeh M. Brain tumor segmentation and classification on MRI via deep hybrid representation learning. Exp Syst Appl. 2023;224:119963 [Google Scholar]
- 7.Farajzadeh N, Sadeghzadeh N, Hashemzadeh M. IJES-OA net: A residual neural network to classify knee osteoarthritis from radiographic images based on the edges of the intra-joint spaces. Med Eng Physics. 2023;113:103957. doi: 10.1016/j.medengphy.2023.103957. [DOI] [PubMed] [Google Scholar]
- 8.Mohammadian Takaloo V, Hashemzadeh M, Ghavidel Neycharan J. DiagCovidPNA: Diagnosing and differentiating COVID-19, viral and bacterial pneumonia from chest X-ray images using a hybrid specialized deep learning approach. Soft Comput. 2023;28:8657–8680. [Google Scholar]
- 9.Luo X, Liang M, Zhang D, Huang B. Identification of diagnostic genes and the miRNA-mRNA-TF regulatory network in human oocyte aging via machine learning methods. J Assist Reprod Genet. 2025;42:319–333. doi: 10.1007/s10815-024-03311-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Liang Q, Yang S, Mai M, Chen X, Zhuet X. Mining phase separation-related diagnostic biomarkers for endometriosis through WGCNA and multiple machine learning techniques: A retrospective and nomogram study. J Assist Reprod Genet. 2024;41:1433–1447. doi: 10.1007/s10815-024-03079-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Colaco S, Narad P, Singh AK, Gupta P, Choudhury A, Sengupta A, et al. Fertility predictor-a machine learning-based web tool for the prediction of assisted reproduction outcomes in men with Y chromosome microdeletions. J Assist Reprod Genet. 2025;42:473–481. doi: 10.1007/s10815-024-03338-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Liu L, Jiao Y, Li X, Ouyang Y, Shi D. Machine learning algorithms to predict early pregnancy loss after in vitro fertilization-embryo transfer with fetal heart rate as a strong predictor. Comput Methods Programs Biomed. 2020;196:105624. doi: 10.1016/j.cmpb.2020.105624. [DOI] [PubMed] [Google Scholar]
- 13.Amitai T, Kan-Tor Y, Or Y, Shoham Z, Shofaro Y, Richter D, et al. Embryo classification beyond pregnancy: Early prediction of first trimester miscarriage using machine learning. J Assist Reprod Genet. 2023;40:309–322. doi: 10.1007/s10815-022-02619-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Hassan MR, Al-Insaif S, Hossain MI, Kamruzzaman J. A machine learning approach for prediction of pregnancy outcome following IVF treatment. Neural Comput Appl. 2020;32:2283–2297. [Google Scholar]
- 15.Liu L, Liu B, Wu H, Gan Q, Huang Q, Li M. Optimizing predictive features using machine learning for early miscarriage risk following single vitrified-warmed blastocyst transfer. Front Endocrinol (Lausanne) 2025;16:1557667. doi: 10.3389/fendo.2025.1557667. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Drapkina YS, Makarova NP, Kalinin AP, Vasiliev RA, Amelin V. [Experience in machine learning application to predict pregnancy loss after assisted reproductive technologies] Obstet Gynecol. 2024;9:90–98. In Russian. [Google Scholar]
- 17.García S, Luengo J, Herrera F. Data preprocessing in data mining. Vol. 72. Switzerland: Springer; 2015. [Google Scholar]
- 18.Han J, Kamber M, Pei J. Data mining: Concepts and techniques. 3. USA: Morgan Kaufmann; 2022. [Google Scholar]
- 19.Aggarwal CC. Outlier ensembles. 2. USA: Springer; 2017. [Google Scholar]
- 20.Ester M, Kriegel H-P, Sander J, Xu X. A density-based algorithm for discovering clusters in large spatial databases with noise; Proceedings of a Second International Conference on Knowledge Discovery and Data Mining (KDD'96); August 2-4, 1996; Portland. 1996. pp. 226–231. [Google Scholar]
- 21.Suri NNRR, Murty MN, Athithan G. Outlier detection: Techniques and applications. USA: Springer; 2019. [Google Scholar]
- 22.Mukaka MM. Statistics corner: A guide to appropriate use of correlation coefficient in medical research. Malawi Med J. 2012;24:69–71. [PMC free article] [PubMed] [Google Scholar]
- 23.He H, Garcia EA. Learning from imbalanced data. IEEE Transact Knowledge Data Eng. 2009;21:1263–1284. [Google Scholar]
- 24.Chawla NV, Bowyerk KW, Hall LO, Kegelmeyer W., Philip SMOTE: Synthetic minority over-sampling technique. J Artificial Intelligence Res. 2002;16:321–357. [Google Scholar]
- 25.Soltanzadeh P, Feizi-Derakhshi MR, Hashemzadeh M. Addressing the class-imbalance and class-overlap problems by a metaheuristic-based under-sampling approach. Pattern Recognition. 2023;143:109721 [Google Scholar]
- 26.Soltanzadeh P, Hashemzadeh M. RCSMOTE: Range-controlled synthetic minority over-sampling technique for handling the class imbalance problem. Informat Sci. 2020;542:92–111. [Google Scholar]
- 27.Veisi H, Ghaedsharaf HR, Ebrahimi M. [Improving the performance of machine learning algorithms for heart disease diagnosis by optimizing data and features] Soft Comput J. 2019;8:70–85. In Persian. [Google Scholar]
- 28.Fazeli M, Kazemi A, Haghighat S. [Application of decision tree and logistic regression algorithms to predict lymphedema in breast cancer patients] Razi J Med Sci. 2019;25:84–95. [Google Scholar]
- 29.Pathan MS, Nag A, Pathan MM, Dev S. Analyzing the impact of feature selection on the accuracy of heart disease prediction. Healthcare Analytics. 2022;2:100060 [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
Study data are publicly available to the research community and can be shared electronically through the corresponding author's email.
