A bad night’s rest It ruins the next day, but it could also anticipate illnesses that will appear years later. A new model of artificial intelligence (AI)developed by researchers from Stanford Medicineanalyzes the physiological records of a single night of sleep and estimates a person’s risk of developing more than 100 health conditions. The study was published in the journal Nature Medicine.
The system is called SleepFM and was trained with almost 600,000 hours of sleep data collected from 65,000 participants. This information comes from the polysomnographya comprehensive study that records brain activity, heart activity, respiratory signals, leg movements, eye movements and much more through different sensors, as explained by Stanford University in a statement.
Polysomnography is the gold standard in sleep studies: patients spend the night in a laboratory connected to multiple devices. But, according to researchers, it is also a untapped physiological gold mine. Only a fraction of this data is used in current medicine.
«We record an astonishing number of signals when we study sleep,» he said. Emmanuel Mignotphysician and lead co-author of the study. «It’s a kind of general physiology that we study for eight hours in a completely captive subject. It’s very rich in data,» he added.

With the advancement of AI, today it is possible to extract meaning from this enormous volume of information. This study is the first to apply this technology to sleep data analysis on such a large scale.
«From an AI perspective, sleep is a relatively understudied area. There is a lot of work in pathology or cardiology, but relatively little in sleep, even though it is a fundamental part of life,» he explained. James Zouassociate professor of biomedical data science at Stanford and co-senior author of the study.
Dream as language
To take advantage of that wealth of data, the researchers built a foundation modela type of AI capable of training with enormous volumes of information and applying what it learns to a wide variety of tasks. Language models like ChatGPT They are examples of this architecture, but trained with text.
In the case of SleepFMthe polysomnography data—585,000 hours in total—was divided into five-second chunks, analogous to the “words” that language models use to learn. «SleepFM essentially learns the language of sleep,» Zou said.
The model integrated multiple data streams—electroencephalography, electrocardiography, electromyography, pulse reading, and respiratory airflow, among others—to identify how they relate to each other. To achieve this, researchers developed a training technique called «contrastive learning by exclusion»: The system hid one data modality and challenged the model to reconstruct the missing piece from the other signals.

«One of the technical advances of this work was discovering how to harmonize all these data modalities so that they learn the same language,» Zou said.
130 diseases on the horizon
After the training phase, the researchers evaluated the model on standard sleep analysissuch as classifying the stages of rest and diagnosing the severity of sleep apnea. SleepFM achieved results equal to or better than the most advanced models available today.
Next, the researchers aimed higher: predicting the onset of diseases from sleep data. For that, they crossed the polysomnography records with the medical records of the same participants over time.
The Stanford Sleep Medicine Center was founded in 1970 and preserves decades of data: the largest cohort used to train SleepFM—about 35,000 patients ages 2 to 96—had its studies collected between 1999 and 2024with up to 25 years of subsequent follow-up for some patients.
SleepFM analyzed more than 1,000 disease categories in the medical records and found 130 that could be predicted with reasonable precision. The model was especially effective for cancers, pregnancy complications, circulatory diseases and mental disorders, with a C-index greater than 0.8.

He index Cor concordance index, measures a model’s ability to predict which of two individuals will experience an event first. «For all possible pairs of individuals, the model generates a ranking of who is most likely to suffer an event—a heart attack, for example—earlier. A C-index of 0.8 means that 80 percent of the time, the model’s prediction matches what actually happened,» Zou explained.
The system demonstrated an outstanding ability to anticipate the disease of Parkinson (C-index: 0.89), dementia (0,85), hypertensive heart disease (0,84), myocardial infarction (0,81), prostate cancer (0,89), breast cancer (0,87) y death (0,84).
«It was a pleasant surprise that, for a fairly diverse set of conditions, the model can make informative predictions,» Zou noted. Models with C indices around 0.7—such as those that predict a patient’s response to different oncological treatments—already demonstrated clinical utilityadded the researcher.
Bodies out of sync
Researchers work on the prediction improvement of SleepFM, with the possibility of incorporating data from wearable devices, and in understanding what exactly the model observes when making its decisions.
«He doesn’t explain it to us in English. But we develop different interpretation techniques to find out what the model looks at when it makes a specific prediction about a disease,» Zou said.

A key finding: Although heart signals weigh more in predicting heart disease and brain signals in mental health, it was combination of all data modalities which yielded the most accurate results.
«We obtained the greatest information to predict diseases by contrasting the different channels,» he noted. Mignot. Components of the body that were out of sync—a brain that appears to sleep while the heart appears to be awake, for example—appeared to be a sign of future problems.



