Stanford’s AI spots hidden disease warnings that show up while you sleep
One night of sleep may reveal hidden clues about diseases years before they strike.
- Date:
- January 9, 2026
- Source:
- Stanford Medicine
- Summary:
- Stanford researchers have developed an AI that can predict future disease risk using data from just one night of sleep. The system analyzes detailed physiological signals, looking for hidden patterns across the brain, heart, and breathing. It successfully forecast risks for conditions like cancer, dementia, and heart disease. The results suggest sleep contains early health warnings doctors have largely overlooked.
- Share:
A restless night often leads to fatigue the next day, but it may also signal health problems that emerge much later. Scientists at Stanford Medicine and their collaborators have developed an artificial intelligence system that can examine body signals from a single night of sleep and estimate a person's risk of developing more than 100 different medical conditions.
The system, called SleepFM, was trained using almost 600,000 hours of sleep recordings from 65,000 individuals. These recordings came from polysomnography, an in-depth sleep test that uses multiple sensors to track brain activity, heart function, breathing patterns, eye movement, leg motion, and other physical signals during sleep.
Sleep Studies Hold Untapped Health Data
Polysomnography is considered the gold standard for evaluating sleep and is typically performed overnight in a laboratory setting. While it is widely used to diagnose sleep disorders, researchers realized it also captures a vast amount of physiological information that has rarely been fully analyzed.
"We record an amazing number of signals when we study sleep," said Emmanual Mignot, MD, PhD, the Craig Reynolds Professor in Sleep Medicine and co-senior author of the new study, which will publish Jan. 6 in Nature Medicine. "It's a kind of general physiology that we study for eight hours in a subject who's completely captive. It's very data rich."
In routine clinical practice, only a small portion of this information is examined. Recent advances in artificial intelligence now allow researchers to analyze these large and complex datasets more thoroughly. According to the team, this work is the first to apply AI to sleep data on such a massive scale.
"From an AI perspective, sleep is relatively understudied. There's a lot of other AI work that's looking at pathology or cardiology, but relatively little looking at sleep, despite sleep being such an important part of life," said James Zou, PhD, associate professor of biomedical data science and co-senior author of the study.
Teaching AI the Patterns of Sleep
To unlock insights from the data, the researchers built a foundation model, a type of AI designed to learn broad patterns from very large datasets and then apply that knowledge to many tasks. Large language models like ChatGPT use a similar approach, though they are trained on text rather than biological signals.
SleepFM was trained on 585,000 hours of polysomnography data collected from patients evaluated at sleep clinics. Each sleep recording was divided into five-second segments, which function much like words used to train language-based AI systems.
"SleepFM is essentially learning the language of sleep," Zou said.
The model integrates multiple streams of information, including brain signals, heart rhythms, muscle activity, pulse measurements, and airflow during breathing, and learns how these signals interact. To help the system understand these relationships, the researchers developed a training method called leave-one-out contrastive learning. This approach removes one type of signal at a time and asks the model to reconstruct it using the remaining data.
"One of the technical advances that we made in this work is to figure out how to harmonize all these different data modalities so they can come together to learn the same language," Zou said.
Predicting Future Disease From Sleep
After training, the researchers adapted the model for specific tasks. They first tested it on standard sleep assessments, such as identifying sleep stages and evaluating sleep apnea severity. In these tests, SleepFM matched or exceeded the performance of leading models currently in use.
The team then pursued a more ambitious objective: determining whether sleep data could predict future disease. To do this, they linked polysomnography records with long-term health outcomes from the same individuals. This was possible because the researchers had access to decades of medical records from a single sleep clinic.
The Stanford Sleep Medicine Center was founded in 1970 by the late William Dement, MD, PhD, who is widely regarded as the father of sleep medicine. The largest group used to train SleepFM included about 35,000 patients between the ages of 2 and 96. Their sleep studies were recorded at the clinic between 1999 and 2024 and paired with electronic health records that followed some patients for as long as 25 years.
(The clinic's polysomnography recordings go back even further, but only on paper, said Mignot, who directed the sleep center from 2010 to 2019.)
Using this combined dataset, SleepFM reviewed more than 1,000 disease categories and identified 130 conditions that could be predicted with reasonable accuracy using sleep data alone. The strongest results were seen for cancers, pregnancy complications, circulatory diseases, and mental health disorders, with prediction scores above a C-index of 0.8.
How Prediction Accuracy Is Measured
The C-index, or concordance index, measures how well a model can rank people by risk. It reflects how often the model correctly predicts which of two individuals will experience a health event first.
"For all possible pairs of individuals, the model gives a ranking of who's more likely to experience an event -- a heart attack, for instance -- earlier. A C-index of 0.8 means that 80% of the time, the model's prediction is concordant with what actually happened," Zou said.
SleepFM performed especially well when predicting Parkinson's disease (C-index 0.89), dementia (0.85), hypertensive heart disease (0.84), heart attack (0.81), prostate cancer (0.89), breast cancer (0.87), and death (0.84).
"We were pleasantly surprised that for a pretty diverse set of conditions, the model is able to make informative predictions," Zou said.
Zou also noted that models with lower accuracy, often around a C-index of 0.7, are already used in medical practice, such as tools that help predict how patients might respond to certain cancer treatments.
Understanding What the AI Sees
The researchers are now working to improve SleepFM's predictions and better understand how the system reaches its conclusions. Future versions may incorporate data from wearable devices to expand the range of physiological signals.
"It doesn't explain that to us in English," Zou said. "But we have developed different interpretation techniques to figure out what the model is looking at when it's making a specific disease prediction."
The team found that while heart-related signals were more influential in predicting cardiovascular disease and brain-related signals played a larger role in mental health predictions, the most accurate results came from combining all types of data.
"The most information we got for predicting disease was by contrasting the different channels," Mignot said. Body constituents that were out of sync -- a brain that looks asleep but a heart that looks awake, for example -- seemed to spell trouble.
Rahul Thapa, a PhD student in biomedical data science, and Magnus Ruud Kjaer, a PhD student at Technical University of Denmark, are co-lead authors of the study.
Researchers from the Technical University of Denmark, Copenhagen University Hospital -Rigshospitalet, BioSerenity, University of Copenhagen and Harvard Medical School contributed to the work.
The study received funding from the National Institutes of Health (grant R01HL161253), Knight-Hennessy Scholars and Chan-Zuckerberg Biohub.
Story Source:
Materials provided by Stanford Medicine. Note: Content may be edited for style and length.
Journal Reference:
- Rahul Thapa, Magnus Ruud Kjaer, Bryan He, Ian Covert, Hyatt Moore IV, Umaer Hanif, Gauri Ganjoo, M. Brandon Westover, Poul Jennum, Andreas Brink-Kjaer, Emmanuel Mignot, James Zou. A multimodal sleep foundation model for disease prediction. Nature Medicine, 2026; DOI: 10.1038/s41591-025-04133-4
Cite This Page: