In a new study using AI and machine learning, EPFL researchers have found that it’s not only what we eat, but how consistently we eat it that plays a crucial role in gut health.

The gut microbiota is the community of microorganisms, including bacteria, viruses, fungi and other microbes, that lives in our digestive systems – some of these microbes are helpful and others can be harmful.
Many previous studies have shown that what we eat has an impact on our gut microbiota. Healthy diets rich in fruit, vegetables, fiber and nuts are strongly associated with increased microbial diversity and better stomach health.
But now, for the first time, EPFL research has shown that the regularity with which we eat a healthy diet is just as important for gut health as the amount of what we consume.
The importance of nutritional quality and regularity
In a new paper, just published in the journal Nature Communications, researchers in EPFL’s Digital Epidemiology Laboratory, part of both the Schools of Computer and Communication and Life Sciences, confirmed earlier research that certain types of foods, such as fruit and vegetables, contribute to a more diverse gut microbiota. Working with colleagues at the University of California, San Diego, they also made several striking new discoveries.
First, they found that it’s not just the consumption of fruit, vegetables and grains that create a healthy gut microbiota, but whether you eat them regularly or not. Whilst there’s always been a hunch that it’s important to eat good food regularly, encouraged by campaigns such as ‘five fruits and vegetables a day’, it has always been just that – a hunch.
“This research clearly shows that you cannot binge on vegetables on your healthy day and then eat in an unhealthy way for the rest of the week or month,” said Associate Professor Marcel Salathé, head of the Digital Epidemiology Lab and co-director of the EPFL AI Center. “In fact, our study suggests that irregular consumption of healthy foods undoes many of their beneficial effects on the gut microbiota. This is a real incentive for future studies to not just look at what people are eating but the patterns of what they are eating over time.”
Predicting diet from the microbiome
Second, the team was also able to show that a person’s gut bacteria and what they eat can predict each other with up to 85% accuracy. With just a simple stool sample — an increasingly common component of medical research — advanced machine learning techniques could predict a person’s diet using their microbiota and vice versa.
“For our collaborators in San Diego, who are some of the world’s leading experts in microbiome research, this was exciting,” explained Salathé. “Getting such data from a stool sample is relatively easy, but understanding someone’s diet is notoriously difficult, it’s data that’s been challenging to collect.”
The power of real-time data
The study was made possible by using detailed nutritional information from about 1000 participants who were part of the “Food & You” cohort.
High-resolution dietary data was collected via the AI-powered app MyFoodRepo, developed by the same EPFL lab, which allowed users to log their meals in real time by snapping photos or scanning barcodes. The app’s AI then analysed these entries for nutritional content, later verified by human reviewers.
“Historically, nutrition research has relied on food frequency questionnaires and 24-hour dietary recalls. In theory, you could ask somebody to write down everything they eat but in practice it’s just not done because it’s borderline impossible. Now, the AI is so good that we can do this data collection at a large scale,” said Rohan Singh, a Doctoral Assistant in the Digital Epidemiology Lab and lead author of the paper.
“Our study has been particularly interesting because when you look at lifestyle-oriented gastrointestinal disorders, they often develop gradually. Since nutrition is one of the big contributors to these diseases, analyses like ours may be able to assess what can be improved in a person’s diet. AI can then help nudge people to adjust their food intake accordingly,” he continued.
Looking ahead
Salathé believes the study’s findings suggest that current dietary guidelines may need to be updated to emphasize not just the types and quantities of food, but the regularity of healthy eating behaviors.
And, while this research project has ended, the MyFoodRepo app continues to be used by the Digital Epidemiology Lab team for other research. They are currently involved in a pilot project on nutrition and cognitive performance, studying potential links between the two.
Also, through the use of barcoded food data from the Food & You study, the researchers are investigating the link between food additives, like emulsifiers, found in ultra-processed foods, and the gut microbiota.
“There’s a strong hypothesis that some of these additives really may negatively impact your microbiota, and we have some early indications that this could indeed be the case. We’re still in the analysis stage but we are quite excited about early results,” said Salathé.
More generally, they are gratified that the MyFoodRepo app is now opening the door to important nutrition studies globally.
“From the outset, we knew we needed something extremely consumer friendly and easy to use, while still providing the data that we needed. We built it to serve our own research needs, but also in a way which others would find useful – and it’s now being used in many other nutrition studies globally,” Salathé concluded.
Funding and strategic partnerships
The MyFoodRepo app was funded and supported by several organizations, including the Kristian Gerhard Jebsen Foundation, the Seerave Foundation, and the Leenaards Foundation.
References
Temporal nutrition analysis associates dietary regularity and quality with gut microbiome diversity: insights from the Food & You digital cohort, Nature Communications 16, 8635 (2025). DOI: 10.1038/s41467-025-63799-z
Author: Tanya Petersen
Source: EPFL