Wednesday · October 7, 2026
Emerging

Scientists Built a Gut Bacteria Test to Spot Hidden Depression and Anxiety

Researchers built two machine-learning models from gut bacteria: one distinguishes chronic constipation from health (AUC 0.71), the other flags hidden depression or anxiety within constipated patients (AUC 0.67). Both are proof-of-concept, not diagnostic tools, but the bacterial signatures point to a real gut-brain link.

Scientists Built a Gut Bacteria Test to Spot Hidden Depression and Anxiety

If you've ever wondered whether your constipation and your mood are somehow the same problem wearing two faces, a new study gives that hunch some real data behind it. Researchers built two separate gut-bacteria models: one that can tell a person with chronic constipation apart from a healthy person, and a second, more ambitious one that tries to spot which constipated patients are also carrying a hidden depression or anxiety burden, using nothing but stool samples. Neither model is ready for a doctor's office yet, but the specific bacteria they flagged point to a real biological link between a sluggish gut and mental health that's worth understanding now.

Key Takeaways

  • Researchers built two machine-learning models from gut bacteria data: one spotted chronic constipation with modest accuracy (71%), the other flagged which constipated patients also had depression or anxiety (67% accuracy).
  • Both models fall short of the 80% accuracy doctors typically require for a clinical screening tool, so neither is diagnostic today.
  • Constipated patients, and especially those with a psychiatric comorbidity, showed depleted "good" bacteria (Faecalibacterium, Roseburia) that make short-chain fatty acids (SCFAs, gut-friendly compounds bacteria produce by fermenting fiber) and more of certain gas-producing microbes.
  • The findings are correlational, not causal, so no one should treat this as evidence that fixing gut bacteria alone would treat depression or constipation.

Gut Bacteria Distinguish Constipation Patients From Healthy People With Modest Accuracy

A study published in Microbiota Medicine Research found that a machine-learning model trained on gut bacteria composition could distinguish people with chronic constipation from healthy people, but only with modest accuracy. Researchers, led by Hongyan Qi and Yurong Tang at the First Affiliated Hospital with Nanjing Medical University, used a support vector machine (SVM, an algorithm that finds the best boundary separating two groups of data) built on 16S rRNA sequencing (a method that identifies bacteria by reading a specific gene fragment) from stool samples. The model reached an area under the curve (AUC, a 0-to-1 score for how well a test tells two groups apart, where 0.5 is a coin flip and 1.0 is perfect) of 0.71, which the researchers themselves describe as "modest." Compared with healthy people, the constipated group showed depleted Faecalibacterium and Roseburia (both prolific SCFA producers) and an expansion of Methanomassiliicoccus, a gas-producing microbe.

Why This Matters for People Managing Chronic Constipation, Depression, or Anxiety

Chronic constipation affects an estimated 11 to 20 percent of adults worldwide, and it frequently travels together with depression, anxiety, or other psychiatric conditions, a link other research on the gut-brain axis has also traced to reduced SCFA-producing bacteria. For anyone in that overlap, this study is a reminder that the connection isn't just in their head, or just in their gut, but plausibly both at once, mediated by the same bacterial community. The second, more targeted model in this study built on that overlap: among constipated patients, it tried to separate those carrying a diagnosed psychiatric condition from those without one, using only their stool bacteria. That model reached an AUC of 0.67, using an Elastic Net classifier (a statistical method that selects the most informative features from a large dataset) trained on a different, more specific bacterial signature: reduced Lachnospiraceae_ND3007_group and increased Methanosphaera in the psychiatric-comorbidity subgroup.

How the Study Was Built: A Public Discovery Cohort Plus an Independent Validation Group

The researchers didn't rely on a single small sample. They built a discovery cohort of 478 people (239 with chronic constipation, 239 healthy controls) from curated 16S rRNA gut microbiome profiles in the public GMrepo database, all originally collected through the American Gut Project. They then tested both models on an independent, external validation cohort of 45 people recruited at their own hospital (14 healthy controls, 31 patients with slow-transit constipation), a stronger design than most microbiome studies, which typically rely on a single small cohort with no outside check. Predicted metabolic function was also modeled using PICRUSt2 (a tool that estimates likely bacterial functions from 16S data rather than measuring them directly), and fecal metabolite levels were measured directly in a subset of samples to cross-check those predictions. That SCFA-motility connection is consistent with other work on the crosstalk between gut bacteria and colonic motility.

What This Could Mean if You're Managing Constipation and a Mood Condition

For now, this study doesn't hand anyone a test to take or a supplement to buy. Neither model performed well enough to diagnose constipation or flag a hidden mood disorder in an individual person, and the researchers are explicit that the current version isn't a screening tool. What it does offer is a validated biological thread worth being aware of: if you're dealing with chronic constipation and also notice symptoms of depression or anxiety, this study supports treating both as connected rather than coincidental, and it's a reasonable thing to mention together the next time you talk to a doctor, rather than treating them as two separate complaints. Nothing here establishes that any specific probiotic, fiber supplement, or dietary change would fix either problem; that link remains unproven.

The Accuracy Ceiling: Why an AUC of 0.71 or 0.67 Isn't a Diagnosis

Both models land below the AUC of 0.80 that's generally considered the threshold for a clinically useful diagnostic or screening test. The researchers state this directly in their own conclusion: the current models "do not meet the performance standards required for clinical decision-making." There's also a design limitation worth flagging. The study is cross-sectional, meaning every sample was taken at a single point in time, so it can show that certain bacteria and certain conditions co-occur, but it cannot show that one causes the other. The discovery cohort was also built from public data originally collected across a wide, heterogeneous population, which introduces variability that a single-site study wouldn't have, even though the external validation step was designed specifically to check whether the pattern held up outside that original dataset.

What Comes Next for Gut-Bacteria Diagnostics in Constipation and Mental Health

The researchers frame these models as a proof of concept rather than a finished tool, and they lay out a specific path forward: larger, multi-center cohorts, direct measurement of bacterial activity (rather than the predicted function used here), and integration of clinical and metabolomic data alongside the bacterial signature. That combination, they argue, is what it would take to close the gap to the 0.80 accuracy threshold. No timeline for a clinical-grade version was given.

Common Questions

Does this study prove that gut bacteria cause depression or constipation? No. The study is correlational: it shows that certain gut bacteria patterns are associated with constipation and with a psychiatric comorbidity within constipation, but it doesn't test whether changing those bacteria would change either condition.

Could I get this microbiome test at a doctor's office right now? No. Both models were built for research purposes and fell short of the accuracy threshold used for real diagnostic tools, so there's no clinical version of this test available.

Which specific bacteria were most important in the models? Faecalibacterium and Agathobacter (both SCFA producers) were the top features distinguishing constipated patients from healthy people, while Cutibacterium (elevated) and Paracoccus (reduced) were the most informative for spotting the psychiatric-comorbidity subgroup.

Does having low Faecalibacterium mean I have hidden depression? No. These are population-level statistical associations from a research model, not individual diagnostic markers; a single person's bacterial profile can't be reliably interpreted this way outside a clinical test.

Evidence Rating

ESTABLISHED — 86/100

Caveats

  • AUC 0.71/0.67 are modest per the authors, below the 0.80 threshold they cite for clinical screening tools
  • cross-sectional/correlational, machine-learning classification not causal proof
  • discovery cohort built from public 16S datasets (heterogeneity risk), though externally validated

Discovery cohort n=478 (public 16S datasets) + external validation n=45 (institutional). SVM model distinguishing chronic constipation from healthy controls: AUC=0.71. Elastic Net model identifying psychiatric distress within constipation patients: AUC=0.67 (authors themselves call this "modest", below the 0.80 clinical-screening threshold). CC patients show depleted Faecalibacterium/Roseburia (SCFA producers) and enriched Methanomassiliicoccus vs healthy; psychiatric-distress subgroup shows further shifts (reduced Lachnospiraceae_ND3007, increased Methanosphaera).

References

  1. Hongyan Qi, Ting Yu, Weichen Liu, et al. (2026). The Microbiome as a Mirror: Distinguishing Healthy Individuals From Chronic Constipated Patients and Identifying Those With Hidden Psychiatric Burden. Microbiota Medicine Research. https://doi.org/10.1002/mmr3.70010
  2. Xiangyan Zhou, Sixing Wang, Xiaohui Wang, et al. (2025). Mechanisms of the effect of gut microbes on depression through the microbiota-gut-brain axis. Frontiers in Nutrition. https://doi.org/10.3389/fnut.2025.1634548
  3. Ruili Pan, Linlin Wang, Xiaopeng Xu, et al. (2022). Crosstalk between the Gut Microbiome and Colonic Motility in Chronic Constipation: Potential Mechanisms and Microbiota Modulation. Nutrients. https://doi.org/10.3390/nu14183704