Related Experiment Video
Updated: Apr 17, 2026

Machine Learning Algorithms for Early Detection of Bone Metastases in an Experimental Rat Model
Published on: August 16, 2020
Diagnosing ectopic pregnancy using the bayes theorem and neural network: a validation of a retrospective cohort study
Larissa Maroni1, Pedro Clarindo Silva2, Rafael Kunst2
1Hospital de Clínicas de Porto Alegre Porto AlegreRS Brazil Hospital de Clínicas de Porto Alegre, Porto Alegre, RS, Brazil.
Objective:
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.
Methods:
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.
Results:
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.
Conclusion:
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.

