Researchers at Stanford Medicine have developed an artificial intelligence (AI) model that can predict a person’s risk of developing dozens of diseases using data from a single night of sleep. The model, called SleepFM, analyzes polysomnography recordings and forecasts the likelihood of future conditions ranging from cardiovascular disease and cancer to neurodegenerative and mental disorders. The research, published in Nature Medicine, shows that sleep data could do more than simply diagnose sleep disorder and may one day be used to assess long-term health risks.
“We record an amazing number of signals when we study sleep,” said co-senior author Emmanuel Mignot, MD, PhD, professor of sleep medicine at Stanford. “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.”
SleepFM is a foundation model, a type of AI system trained on large volumes of unlabeled data to learn general patterns that can later be adapted for a variety of uses. The Stanford team trained their model using more than 585,000 hours of polysomnography data from roughly 65,000 participants who underwent overnight sleep studies at multiple sleep clinics.
Polysomnography, considered the gold standard for sleep studies, captures synchronized physiological signals, including brain activity measured by electroencephalography and electrooculography, heart rhythms from electrocardiography, muscle activity from electromyography, respiratory airflow, oxygen levels, eye movements, and leg movements.
“Sleep is a complex process characterized by intricate interactions across physiological systems, including brain, heart, respiratory and muscle activity,” the researchers wrote. Although polysomnography captures these interactions, much of the information has been unused due to the difficulty of integrating and interpreting multiple data streams, as well as its reliance on manual scoring.
However, advances in AI have made it possible to use the breadth of data generated from a single night of sleep. SleepFM was trained using a self-supervised approach that does not rely on manual scoring. It analyzes the data by dividing it into five-second segments and derives relationships across multiple physiological channels. A new training method called leave-one-out contrastive learning, which withholds one data modality at a time, challenges the model to reconstruct that modality from the other data signals. This allows the SleepFM to harmonize heterogeneous recordings and manage missing data channels.
“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,” said James Zou, PhD, associate professor of biomedical data science and co-senior author. “SleepFM is essentially learning the language of sleep.”
After pretraining, the researchers fine-tuned the model for specific tasks. SleepFM matched or exceeded current models for standard assessments in sleep studies such as sleep staging and severity of sleep apnea. To extend its potential beyond sleep analysis, the researchers then paired the sleep data with electronic health records from the Stanford Sleep Medicine Center, which has followed some sleep study patients for as long as 25 years. This allowed the researchers to assess the model’s ability to uncover disease risk and tested it across more than 1,000 different diseases.
“Sleep disorders affect millions of people and are increasingly recognized as indicators of, and contributors to, various health conditions,” the researchers wrote. Prior research has linked sleep disturbances to psychiatric, cardiovascular, and neurodegenerative diseases, but these studies use small data sets and were focused on individual outcomes.
Using the a large data set, SleepFM identified 130 conditions that could be predicted with reasonable accuracy from a single night of sleep data. These included all-cause mortality, dementia, myocardial infarction, heart failure, stroke, chronic kidney disease, and atrial fibrillation. For many outcomes, the model achieved concordance indices above 0.8, indicating strong ability to rank individuals by risk. SleepFM also performed well when applied to an external dataset, the Sleep Heart Health Study, a long-running multicenter epidemiological research initiative designed to discover how sleep-disordered breathing and other sleep characteristics are related to cardiovascular disease and other health outcomes.
“For all possible pairs of individuals, the model gives a ranking of who’s more likely to experience an event earlier,” Zou said. “A C-index of 0.8 means that 80% of the time, the model’s prediction is concordant with what actually happened.”
Analysis of how the model used the data showed that different signal types were more heavily weighted for some risk predictions than others. For example, brain activity was particularly informative for neurological and mental disorders, while heart and respiratory signals were important for cardiovascular conditions. The researchers noted, however, that “the most information we got for predicting disease was by contrasting the different channels,” Mignot said.
The findings build on earlier research suggesting that sleep abnormalities often precede disease development. “Sleep disturbances often precede the clinical onset of numerous conditions, such as psychiatric disorders, neurodegenerative diseases, and cardiovascular disorders,” the researchers wrote.
The researchers noted some limitation of their study, particularly selection bias toward patients referred for sleep studies and challenges in interpreting complex AI models. Next steps will include working to improve the interpretation of the AI model, while also looking to add wearable data for interpretation. The team will also look at how to best integrate their model with health records, along with imaging and molecular data.
