Cureus. 2026 Mar;18(3):
e104782
Background and aim Gestational diabetes mellitus (GDM) affects 6-15% of pregnancies globally and is traditionally diagnosed at 24-28 weeks of gestation. Early identification of high-risk women during the first trimester could enable timely interventions and improved pregnancy outcomes. This study aimed to develop and evaluate machine learning models for early GDM prediction using first-trimester clinical and laboratory parameters. To achieve this aim, the study has the following five key objectives: first, to generate a clinically representative synthetic dataset incorporating demographic characteristics, clinical risk factors, and first-trimester laboratory parameters; second, to implement comprehensive feature selection methodologies to identify optimal predictors from candidate variables; third, to systematically evaluate multiple machine learning algorithms with hyperparameter optimization; fourth, to assess model interpretability using SHapley Additive exPlanations (SHAP) analysis; and fifth, to establish clinically actionable threshold values for first-trimester biomarkers. Methods A synthetic dataset of 10,000 patient records was generated using evidence-based probabilistic modeling, incorporating demographic characteristics (maternal age, pre-pregnancy BMI, ethnicity), clinical risk factors (family history of diabetes, previous GDM, polycystic ovary syndrome (PCOS), previous macrosomia), and first-trimester laboratory parameters (random blood sugar, post-prandial blood sugar, HbA1c, and oral glucose tolerance test {OGTT} values). Seven feature selection methodologies were employed to identify optimal predictors from 18 candidate variables. Eleven machine learning algorithms were systematically evaluated, with hyperparameter optimization performed via GridSearchCV (France, Le Chesnay-Rocquencourt: INRIA) using 10-fold stratified cross-validation. Model interpretability was assessed using SHapley Additive exPlanations (SHAP) analysis. Results The Multi-layer Perceptron neural network achieved optimal performance, with an F1-score of 0.7213, an accuracy of 71.7%, and an AUC-ROC of 0.7692 on the independent test set. Feature importance analysis identified early HbA1c as the primary predictor (importance score: 0.405), followed by pre-pregnancy BMI (0.291) and family history of diabetes (0.271). SHAP analysis confirmed these findings, with family history demonstrating the highest mean absolute SHAP value. Clinically actionable thresholds were identified as follows: early RBS ≥125 mg/dL (borderline) and ≥140 mg/dL (concerning); early PPBS ≥160 mg/dL (borderline) and ≥180 mg/dL (concerning); and HbA1c ≥5.7% (intermediate risk), ≥6.0% (high risk), and ≥6.5% (diagnostic). Conclusions First-trimester laboratory parameters, particularly HbA1c combined with clinical risk factors, enable effective early GDM risk stratification with clinically acceptable accuracy. The machine learning framework demonstrates potential for enhancing prenatal screening through personalized risk assessment, though prospective validation in real-world clinical populations is essential before implementation.
Keywords: early prediction; first trimester screening; gestational diabetes mellitus; machine learning; maternal health; shap analysis