Researchers at Stanford Medicine and collaborating institutions have developed a new AI model that treats sleep as a rich, full-body health signal—one that could help spot disease risk years before symptoms appear. The system, called SleepFM, analyzes complete polysomnography (PSG) recordings to uncover subtle physiological patterns that traditional sleep scoring may miss.
PSG is the gold-standard sleep study used in clinics because it captures far more than just how long someone sleeps. It tracks brain waves, breathing, eye movements, muscle activity, heart rhythms, and blood oxygen levels, creating a detailed picture of how the body behaves overnight. Instead of examining each signal in isolation, SleepFM approaches PSG as a single, interconnected dataset—almost like a “language of sleep” that can be decoded for health insights.
To train SleepFM, the team analyzed what may be the largest sleep dataset of its kind: 585,000 hours of recorded sleep from 65,000 people. The model breaks each PSG recording into five-second segments, helping it identify recurring micro-patterns the way modern AI systems learn structure from sequences, such as words in sentences. This short-interval approach helps the model capture fleeting physiological changes that could be meaningful but easy to overlook.
One reason SleepFM stands out is its ability to learn from multiple body systems at once. During sleep, the brain, heart, lungs, muscles, and oxygen regulation don’t operate independently—they constantly influence one another. SleepFM is designed to process these streams simultaneously, making it better suited to detect moments when different physiological signals drift out of sync. Those subtle timing shifts may be early clues that the body is under stress or beginning to change in ways associated with disease.
The researchers trained this “cross-signal understanding” using a method known as leave-one-out contrastive learning. In simple terms, the model is taught to remove one signal and reconstruct it using the others. By repeatedly practicing this, SleepFM learns how the signals are normally connected—and becomes more sensitive to unusual relationships that could indicate underlying health issues.
To evaluate whether sleep data could predict future illness, the team combined PSG records with medical records from a single clinic. SleepFM was able to predict risk for 130 conditions based on sleep alone, including dementia, cancer, Parkinson’s disease, and heart attack. The model reportedly achieved C-index scores above 0.8, meaning its predictions were accurate more than eight out of ten times—a strong result for forecasting health outcomes.
The next step is making the system even more practical for real-world use. The researchers are now working to improve SleepFM further and explore integration with wearable-device data, which could eventually help bring advanced sleep-based health screening beyond specialized sleep labs and into everyday health monitoring.
With its ability to analyze full polysomnography recordings and connect patterns across the brain, heart, breathing, and more, SleepFM highlights a growing idea in medicine: sleep isn’t just rest—it’s a powerful biological dashboard that may reveal early warning signs long before disease becomes obvious.






