How will AI and machine learning change how sleep medicine providers treat their patients?

Right now it’s typical for sleep technologists to mull over pages of polysomnography (PSG) data related to eye movements, respiration, brain activity, and more, to look for indicators of sleep disorders, such as sleep apnea or narcolepsy. Machine learning could revolutionize sleep medicine by taking over the diagnostic process, identifying gaps in care, and helping predict CPAP adherence even before therapy begins.

“I think [sleep medicine] is a field that is ripe for disruption in really being able to apply big data and big data tools to our field and perhaps even be a leading force in terms of how machine learning and artificial intelligence can really impact patients in the way that we deliver care,” says sleep specialist Dennis Hwang, MD, director of Kaiser Permanente’s San Bernardino County Sleep Center.

This is why sleep technology companies across the globe are taking the initiative to develop new programs that will one day make artificial intelligence (AI) a mainstay in sleep clinics. One Iceland-based sleep technology company, Nox Medical, created a branch in 2015 called Nox Research, which focuses on developing AI tools to automate sleep study scoring and extract new insights from sleep study data. Since the program began, Nox has released an AI-powered automatic sleep detector as part of the company’s sleep analysis software Noxturnal.

“We see this as an opportunity to empower the sleep techs and doctors to improve diagnosis or serve larger patient populations without adding to their workload,” says Jon S. Agustsson, co-director of Nox Research.

The Nox researchers are also working on AI tools to detect arousals during sleep. “The identification of arousals is important for the diagnosis of sleep disorders, but manual scoring is time consuming and requires expertise,” says Halla Helgadottir, co-director of Nox Research.

Agustsson adds,A very difficult project to apply AI to is detecting rare events, which either are not well defined, where humans do not agree well on the scoring, or the scored labels do not overlap exactly over the periods where the event occurs. An example of this is AI to detect arousals in EEG. Arousals are only a small part of EEG signals.

“To further complicate things, when arousals are typically scored there is usually not concern with [their] exact timing….The timing of the manually scored event may vary by multiple seconds from the actual timing of the event. In this case it is difficult for the AI tool to learn what is an arousal (since it learns from the data it sees), and it is difficult to measure the performance of the AI tool since it will not always agree with the human-scored labels. To make things even worse is that arousals can occur at any time and can last for various amounts of time. This is much more difficult to deal with than classifying each 30-second epoch.”

Nox researchers are making progress on automated scoring of arousals, and their results from the latest version of the arousal scorer will be presented as an abstract at SLEEP 2019.1

Another healthcare tech company, Somnoware, has deployed a cloud-based platform that uses machine learning to help physicians estimate the likelihood of 90-day CPAP therapy compliance. The software works by mining patient data from electronic medical records, patient questionnaires, and lab visits. This data includes demographic information and comorbidities, which all help to build a machine learning model to predict short- and long-term CPAP compliance even before the patient is put on therapy, according to a release.

As more data comes into the program, the model automatically updates its predictions. This way, clinicians can track trends in compliance and determine the likely impact of certain interventions on patient outcomes.

“Our goal is to bring valuable information to physicians early, so it can be used for proactive patient care management,” says Raj Misra, PhD, chief data scientist and vice president of marketing at Somnoware.

AI could also change the diagnostic process. For instance, researchers from the Stanford Center for Sleep Sciences and Medicine developed an AI system to analyze sleep stages to diagnose narcolepsy, finding that AI could use datasets to pinpoint unusual sleep staging more accurately than a human sleep tech. Results were published in a 2018 paper in Nature Communications.2

“Right now [sleep test scoring] is done by technicians, and clearly, there is no reason why it couldn’t be done by a computer,” says sleep specialist Emmanuel Mignot, MD, PhD, an author of the study and the director of the Stanford Center for Sleep Sciences and Medicine.

The Stanford researchers first told six techs to analyze and score sleep data, looking for changes in sleep staging that could indicate narcolepsy. After the researchers averaged those scores, they then trained an AI program to “learn” specific data trends. They did this by providing it with 3,000 sleep study recordings. The results demonstrated that the AI system could actually score sleep tests more accurately than its human counterparts.

“Sleep studies are quite complicated, a bit subjective, so artificial intelligence is really ideal,” says Mignot.

AI-powered sleep test autoscoring software is a tool that could one day be a common way to save time and resources in sleep clinics. Madison, Wis-based tech company EnsoData has moved in this direction, creating the software EnsoSleep, which combines American Academy of Sleep Medicine (AASM) scoring recommendations with algorithms that analyze sleep data; the company says this can help diagnose sleep disorders like sleep apnea, according to a Wisconsin State Journal article written by EnsoData co-founder and CEO Chris Fernandez.3

“Our mission at EnsoData is to create more time for direct patient care and the cultivation of meaningful patient relationships, the aspect of medicine that the majority of clinicians report as the most satisfying part of the practice, by automating these heavily manual data tasks with powerful artificial intelligence software,” Fernandez wrote.

EnsoSleep received FDA 510(k) clearance in 2017 to automate PSG and home sleep tests. According to the article, since the FDA clearance, EnsoSleep has been used by dozens of clinics across the country to improve patient access to care and preserve sleep clinic resources.

“As growth of the patient population increasingly outpaces the size of our clinical workforce, artificial intelligence will play a critical role in empowering clinicians with tools that scale and amplify their ability to provide care for a far greater number of patients,” Fernandez says in the article.

Other technologies are also on the horizon. Morpheo, an open-source initiative to help develop machine learning models for automatic and predictive diagnosis of sleep disorders, is a project based in Paris, France. “The idea was to develop algorithms that would help and assist doctors with clinical sleep work,” explains Marco Brigham, PhD, a postdoctoral researcher in machine learning at École Polytechnique.

“Basically we are working on the AI aspect of the project to assist physicians in sleep medicine,” says Brigham. Since the funding for this project is wrapping up in June, it is unclear if clinicians will ever get to use it, but Brigham says there is still plenty of potential for AI to impact patient care.

At Kaiser Permanente in California, sleep researchers have been having discussions to brainstorm the concept of an “AI bot.” It’s not going to be the cyborg one might envision but would likely be a downloadable smartphone app, according to Hwang.

The AI bot would be a companion to help troubleshoot problems with sleep apnea care. If a patient is struggling to adjust to the air pressure of their CPAP, they might first chat with the AI bot before consulting a physician. The AI bot would then be able to check in on the patient to ask them how they are and inquire about their sleep quality or daytime sleepiness. “It would utilize true intelligence to provide an interactive process,” says Hwang.

“Part of our vision is developing an AI bot that would be able to interact with a patient frequently in an intelligent way. It would ask the patient how they are doing, how they are feeling, and be able to provide some mechanism to improve some cognitive behavioral aspects of care,” says Hwang. “There may be some issues that can be dealt with by the AI bot that may not involve a sleep provider.”

Lisa Spear is associate editor of Sleep Review.

This article was updated on May 21 with additional information about Nox Medical’s AI research.


1. Ragnarsdottir H, Thrainsson HM, Finnsson E, et al. 0316 Automatic detection of cortical arousals using recurrent neural networks. Sleep. 42;Issue Suppl_1, April 2019:A129–30.

2. Stephansen JB, Olesen AN, Olsen M, et al. Neural network analysis of sleep stages enables efficient diagnosis of narcolepsy. Nat Commun. 2018 Dec 6;9(1):5229.

3. Fernandez C. EnsoData uses AI to help improve health care. Wisconsin State Journal. 23 Sept 2018.