AI Can Detect Up to 130 Diseases from Your Sleep, Stanford Scientists Find

AI Can Detect Up to 130 Diseases from Your Sleep, Stanford Scientists Find

Ondřej Barták
Ondřej Barták
Entrepreneur and Programmer
8. 1. 2026
3 minutes reading · 7 views
AI Can Detect Up to 130 Diseases from Your Sleep, Stanford Scientists Find

Scientists set out to investigate how sleep is related to various diseases. They focused on polysomnography (PSG), a standard method that records signals from the brain, heart, muscles, and breathing during the night. The goal was to create a model called SleepFM that could predict future diseases from these data. They used an enormous amount of data—more than 585,000 hours of recordings from roughly 65,000 people at research centers such as the Stanford Sleep Clinic (SSC), BioSerenity, and others. These data covered people ranging in age from 1 to 100 years.

To investigate this, they collected PSG recordings from various centers. Each recording contained signals such as electroencephalogram (EEG), electrocardiogram (ECG), electromyogram (EMG), and respiratory signals. They preprocessed the data by converting all signals to a frequency of 128 Hz for consistency. They then divided them into 5-second windows, which served as the basic units for the model.

They trained the SleepFM model using a method called leave-one-out contrastive learning (LOO-CL). This technique compares signals from different modalities (brain, heart, or breathing) and teaches the model to identify shared patterns even when some channels are missing. The architecture included one-dimensional convolutional layers for feature extraction, followed by attention pooling, which processes varying numbers of channels, and a transformer block to capture temporal dependencies within 5-minute windows. They pretrained it on data from SSC, BioSerenity, MESA, and MrOS, while setting aside the Sleep Heart Health Study (SHHS) to test generalization.

To predict diseases, they linked PSG data with electronic health records (EHR) from SSC. They mapped diagnoses to 1,868 phecode categories and selected those with a prevalence above 1.5%. Positive cases were defined as those in which the disease occurred more than 7 days after the PSG study. They fine-tuned the model with a two-layer LSTM (long short-term memory) network on frozen embeddings, added age and sex, and used a multilabel Cox proportional hazards loss for prediction.

Diagram of the SleepFM model using polysomnography: EEG, ECG, EMG, and breathing predict diseases
Diagram of the SleepFM model using polysomnography: EEG, ECG, EMG, and breathing predict diseases.

Results

The results showed that the SleepFM model can predict 130 different diseases with high accuracy—at least 75% performance on a scale from 0 to 100%, where 50% would mean a random guess and 100% perfection (and these results are statistically reliable, with a very low probability of occurring by chance). For example, it predicts the risk of all-cause mortality with 84% accuracy, dementia with 85%, myocardial infarction with 81%, heart failure with 80%, chronic kidney disease with 79%, stroke with 78%, and atrial fibrillation with 78%. And all of this is based solely on data from a single night of sleep. The model also performed extremely well on data from another study called SHHS, where it predicted stroke with 82% accuracy, heart failure with 85%, and death from cardiovascular disease with 88%

This model outperforms baseline models, such as one based only on demographic data (age, sex, BMI, race) or an end-to-end model using raw PSG data. For example, in predicting mortality, the model achieved 85% accuracy, while the baseline comparison model achieved only 78%. The improvement in this metric ranged from 5% to 17% across various disease categories, such as neurological, cardiovascular, or endocrine diseases. 

Modality analysis showed that brain signals (BAS) are best for mental and neurological diseases, respiratory signals for respiratory and metabolic diseases, and ECG for cardiac diseases. However, combining all modalities produced the best results. The model also generalized to data collected after 2020 and to SHHS, on which it had not been trained.

SleepFM paves the way for better use of sleep data in disease prediction, emphasizing scalability and accuracy without the need for manual data annotations.

Advertisement

Content created with help from UpTier.

SEO and GEO on autopilot. UpTier’s multi-agent systems write and optimize content for search engines and AI answers.

Discover UpTier ↗

Category:AI
Did you enjoy this article?
Discover more interesting posts on our blog
Back to blog

Related posts

OpenAI cracks down on child abuse. ChatGPT will block accounts for a full dayOpenAI cracks down on child abuse. ChatGPT will block accounts for a full day
OpenAI is strengthening child protection: a new system can detect previously unknown AI-generated images, and ChatGPT will block accounts for 24 hours if users try to obtain them.
4 min read
18. 11. 2026
Google makes Tasks free for Gemini 4 Hydrogen usersGoogle makes Tasks free for Gemini 4 Hydrogen users
Tasks is becoming available for free to hundreds of millions of Gemini 4 Hydrogen users. Google says it can call businesses, book appointments and complete purchases on their behalf.
1 min read
18. 11. 2026
OpenAI introduces GPT-6.2 Astra and Sol for professional and everyday workOpenAI introduces GPT-6.2 Astra and Sol for professional and everyday work
OpenAI has introduced two models: Astra for complex professional tasks and Sol for everyday work. Both are available in ChatGPT Work, Codex and through the API.
3 min read
17. 11. 2026
Přihlaste se k odběru našeho newsletteru
Zůstaňte informováni o nejnovějších příspěvcích, exkluzivních nabídkách, a aktualizacích.
CodedTrip

Operated by CodedTrip LLC, USA.

YouTube
TikTok