Diagnosing ectopic pregnancy using the bayes theorem and neural network: a validation of a retrospective cohort study
Open Access
- 4 March 2026
- journal article
- Published by Federação das Associações de Ginecologia e Obstetrícia in Revista Brasileira de Ginecologia e Obstetrícia
- Vol. 48
Abstract
To evaluate the accuracy of neural networks and Naïve Bayes models in diagnosing ectopic pregnancy, using clinical data, hCG levels, and transvaginal ultrasound findings from a real dataset. This was a retrospective cohort study based on a public dataset of 2,495 first-trimester pregnant women with confirmed pregnancy under 13 weeks, documented transvaginal ultrasound reports, and follow-up on pregnancy outcome. The cohort presented a natural imbalance (8.5% ectopic, 91.5% intrauterine pregnancies), reflecting real-world clinical prevalence. Data on risk factors, clinical symptoms, ultrasound findings, and serial hCG levels were included. The dataset was preprocessed and split into training (80%) and testing (20%) sets using stratified sampling based on pregnancy outcome to preserve the proportion of ectopic cases in both sets. The main outcome measures were accuracy, sensitivity, specificity, and F1 score. The neural network model achieved an accuracy of 99.4%, sensitivity of 94.6%, specificity of 97.2%, and an F1 score of 95.9%. The Naïve Bayes model showed an accuracy of 96.5%, sensitivity of 98.1%, specificity of 71.2%, and an F1 score of 82.5%. Both models were validated without evidence of overfitting. The neural network model demonstrated statistically significant superior accuracy and reliability in diagnosing ectopic pregnancy compared to the Naïve Bayes model (McNemar's test, p < 0.001), suggesting the potential of machine learning models, particularly deep learning, to enhance early diagnosis and clinical decision-making.Keywords
This publication has 12 references indexed in Scilit:
- Enhancing ectopic pregnancy detection: a machine learning approach using ultrasound imagingJournal of the Chinese Institute of Engineers, 2025
- Diagnosing ectopic pregnancy using Bayes theorem: a retrospective cohort studyFertility and Sterility, 2022
- Machine Learning for Critical Internet of Medical Things2022
- Foundations of Machine Learning-Based Clinical Prediction Modeling: Part II—Generalization and Overfitting2021
- Deep learning in cancer diagnosis, prognosis and treatment selectionGenome Medicine, 2021
- Ectopic pregnancyObstetrics, Gynaecology & Reproductive Medicine, 2020
- Review of Medical Decision Support and Machine-Learning MethodsVeterinary Pathology, 2019
- Big Data and Machine Learning in Health CareJAMA, 2018
- Diagnosing ectopic pregnancy in the emergency settingUltrasonography, 2018
- New Evidence to Guide Ectopic Pregnancy Diagnosis and ManagementObstetrical & Gynecological Survey, 2017