What an AI Model Found in the Raw Data of 65,000 Sleep Studies

In most sleep-apnea reports, the apnea-hypopnea index gets top billing. It records how many times per hour breathing stops or becomes shallow. Around it sit other familiar measurements: lowest oxygen saturation, sleep efficiency, minutes in REM and perhaps the number of limb movements.
The raw sleep study is much larger than the report. An overnight polysomnogram follows the electrical activity of the brain and heart alongside airflow, respiratory effort, oxygen, eye movement and muscle activity. These signals run together for hours, capturing the body as it moves through different stages of sleep. SleepFM was built to examine that complete record rather than another tidy row of summary statistics.
The result was published in Nature Medicine in January 2026. From one night of polysomnography, the artificial-intelligence model identified patterns associated with the later appearance of 130 conditions in patients’ medical records. Its strongest results included Parkinson’s disease, dementia, heart disease, breast and prostate cancer, and mortality.
Five Seconds at a Time
SleepFM came from a collaboration led by researchers at Stanford, the Technical University of Denmark and Copenhagen University Hospital. Its training material was unusually large: 585,000 hours of polysomnography from approximately 65,000 people.
The model divided each recording into five-second sections. Within every section were several simultaneous views of the same sleeping body: electroencephalography for brain activity, electrocardiography for the heart, electromyography for muscle activity, plus pulse and respiratory signals.
The researchers developed a method called leave-one-out contrastive learning. During training, one category of signal was withheld and the model learned to match it with information from the remaining categories. A heart-rate change, for example, might coincide with an alteration in breathing and a brief brain arousal. Repeating this exercise across hundreds of thousands of recorded hours taught SleepFM how the channels relate without requiring a human scorer to label every five-second segment.
That approach also addressed a stubborn practical problem. Polysomnography is not recorded identically everywhere. Sleep centers use different equipment and channel arrangements, known as montages. SleepFM was designed to learn across those variations rather than requiring one fixed sensor configuration.
Before testing disease prediction, the researchers gave the model conventional sleep-medicine work. It classified sleep stages with mean F1 scores between 0.70 and 0.78 and classified the presence of sleep apnea with 87% accuracy in three cohorts. Its performance was comparable to specialized models created for those individual tasks. The researchers have released the SleepFM code and trained models for noncommercial research.
The Medical Records Supplied the Long View
The disease-prediction work depended heavily on the history of Stanford’s sleep center. Approximately 35,000 patients, ranging from 2 to 96 years old, had undergone polysomnography there between 1999 and 2024. Their electronic health records provided as much as 25 years of subsequent clinical information.
The researchers examined more than 1,000 categories of disease. SleepFM met their statistical and performance criteria for 130. Its reported concordance index, or C-index, reached 0.89 for Parkinson’s disease, 0.85 for dementia, 0.84 for hypertensive heart disease, 0.81 for myocardial infarction and 0.84 for all-cause mortality. Prostate and breast cancer produced C-indices of 0.89 and 0.87, respectively.
A C-index measures ranking. If the model compares two suitable patients, it asks which one is likely to experience the outcome first. A score of 0.80 means its ordering agrees with what subsequently happened in 80 percent of those comparisons. It is not the percentage of people correctly diagnosed.
SleepFM also outperformed models based on basic demographic information and a neural network trained directly on the disease-prediction task without the same foundation-model pretraining. The broad training had apparently captured physiological features that proved useful when the model was later adapted to a specific clinical question.
The researchers did not rely entirely on the original Stanford population. They tested the model on Stanford recordings made from 2020 onward, which had been excluded from training. They also adapted it to the Sleep Heart Health Study, an outside dataset omitted from pretraining. In that cohort, it produced strong results for stroke, congestive heart failure and cardiovascular mortality.
What Did SleepFM Notice?
There is no single waveform labeled “future dementia.” SleepFM appears to draw information from relationships that are too numerous, subtle or prolonged to summarize comfortably by hand.
Cardiac channels contributed heavily to cardiovascular predictions, while brain signals were more informative for some mental and neurological conditions. The best performance generally came from combining modalities. Emmanuel Mignot, one of the study’s senior authors, offered a particularly interesting example in Stanford Medicine’s report on the research: a brain that appears asleep while the heart behaves as though it is awake. That mismatch may carry information lost when each signal is considered separately.
Exactly what every disease score represents remains unresolved. An abnormal pattern could be an early expression of disease, a consequence of an existing condition, an effect of medication or a marker associated with age, weight or another risk factor. Electronic records document when a diagnosis was entered, not when the underlying biology began. Some supposedly future diseases may already have been developing on the night of the study.
How AI Changes Sleep Studies
SleepFM remains a research model. No clinician can order a standard sleep study and receive validated forecasts for 130 diseases. The published investigation was retrospective, and the model has not yet been tested in a prospective trial showing that its scores improve care.
The work also used polysomnography. Most home sleep apnea tests record a smaller set of respiratory and cardiovascular signals, without the full brain, eye and muscle channels used in a laboratory study. SleepFM’s published performance therefore cannot simply be transferred to every home testing device.
What the research changes is the value assigned to the recording itself. A polysomnogram has traditionally been treated as evidence collected for a particular sleep complaint. SleepFM treated it as eight hours of coordinated human physiology—and found that the information left outside the conventional report may be as interesting as the information printed on it.