# Machine learning and the role of the vaginal and fecal microbiome in miscarriage: a matched case-control study

**Authors:** Unnur Gudnadottir, Stefanie Prast-Nielsen, Nicole Wagner, Luisa W. Hugerth, Vilma Kuttainen Alderheim, Anusha T. Antony, Juan Du, Jorge Reis Guerreiro, Fredrik Boulund, Eva Wiberg-Itzel, Lars Engstrand, Ina Schuppe-Koistinen, Nele Brusselaers, Emma Fransson

PMC · DOI: 10.1038/s41522-026-00956-2 · 2026-03-13

## TL;DR

This study explores how the vaginal and fecal microbiome, along with HPV infection, may predict miscarriage risk using machine learning and data from a Swedish cohort.

## Contribution

The study introduces machine learning models for predicting miscarriage using microbiome and questionnaire data, highlighting specific microbiome types and HPV as risk factors.

## Key findings

- Non-vaccine type HPV and specific vaginal microbiome types (CST II and CST-IVB) are associated with increased miscarriage risk.
- Machine learning models achieved 81-85% accuracy in predicting miscarriage using microbiome and questionnaire data.
- Combined data from vaginal and fecal microbiomes did not significantly improve prediction accuracy over individual data sources.

## Abstract

Miscarriage occurs in approximately 15% of all pregnancies, and recent studies have suggested a potential role of the microbiome. A nested case-control study from the Swedish Maternal Microbiome cohort was conducted, including 34 participants who sent at least one vaginal or fecal microbiome sample and questionnaire data before miscarrying (n = 34), and matched controls (n = 105 for regression models, n = 27 for machine learning models). Non-vaccine type HPV (aOR 3.95, 95%CI 1.04–15.06) and vaginal microbiome with community state type (CST) II (aOR 6.52, 95%CI 1.58–26.98) or CST-IVB (aOR 4.18, 95%CI 1.08–16.18) in early pregnancy were associated with an increased risk of miscarriage. Furthermore, we explored six machine learning algorithms using 70% of the cohort for training and 30% for testing, for the prediction of miscarriage using vaginal (AUROC 85%), fecal (AUROC 81%) and questionnaire (AUROC 82%) data separately and combined (AUROC 82%). Our results highlight the urgency of HPV screening and vaccine development for women’s reproductive health. Despite limitations, including a small number of miscarriage cases, our results indicate the potential for both vaginal and fecal microbiomes in the prediction of miscarriage.

## Full-text entities

- **Genes:** CST12P (cystatin 12, pseudogene) [NCBI Gene 106478911] {aka Cst, Ctes4, E2}
- **Diseases:** RPL (MESH:D000026), birth (MESH:D000014), Alcohol Use Disorder (MESH:D000437), heartburn (MESH:D006356), cervical cancer (MESH:D002583), dysplasia (MESH:D015792), Miscarriage (MESH:D000022), hyperemesis gravidarum (MESH:D006939), PTB (MESH:D047928), endometriosis (MESH:D004715), hypothyroidism (MESH:D007037), obese (MESH:D009765), Depression (MESH:D003866), HPV infection (MESH:D030361), genital infections (MESH:D007239), symphysis pubis dysfunction (MESH:D059388), IUFD (MESH:D005313), Covid-19 (MESH:D000086382), stillbirth (MESH:D050497), Emesis (MESH:D014839), sexually transmitted infection (MESH:D012749), inflammatory (MESH:D007249), gestational diabetes (MESH:D016640), eating disorder (MESH:D001068), PCOS (MESH:D011085), underweight (MESH:D013851), chromosomal disfunction (MESH:D057215), overweight (MESH:D050177), vaginal bleeding (MESH:D014592), thyroid disease (MESH:D013959), chromosomal abnormalities (MESH:D002869)
- **Chemicals:** alcohol (MESH:D000438), Nucleotide (MESH:D009711), aspirin (MESH:D001241)
- **Species:** Lactobacillus crispatus (species) [taxon 47770], Lactobacillus jensenii (species) [taxon 109790], Homo sapiens (human, species) [taxon 9606], Lactobacillus iners (species) [taxon 147802], Nicotiana tabacum (American tobacco, species) [taxon 4097], Bacteria Latreille et al. 1825 (Bacteria stick insect, genus) [taxon 629395], gut metagenome (species) [taxon 749906], Human papillomavirus (species) [taxon 10566], Clostridia (class) [taxon 186801], Actinomycetota (actinobacteria, phylum) [taxon 201174], Bifidobacterium (genus) [taxon 1678], Bacillota (clostridial firmicutes, phylum) [taxon 1239]

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/PMC13009249/full.md

---
Source: https://tomesphere.com/paper/PMC13009249