Machine Learning in Sleep Medicine: The AI Revolution

In today’s post, we will be diving into the future relationship of AI and sleep medicine, and how machine learning will lead to new opportunities in sleep.

Let’s dive into the thoughts on the future of machine learning in sleep medicine, as presented by Dr. Emmanuel Mignot.

A Lifetime of Studying Sleep

Dr. Mignot is the Director of the Stanford Center for Sleep Sciences and Medicine, and he’s spent his life trying to get to the bottom of sleep diseases. His stated goal is to find the causes, new diagnostic procedures and treatments for other sleep disorders and to understand the molecular basis of sleep.

To achieve these goals, he focuses mostly on sleep analytics in genetics, typically working with large data samples. An esteemed researcher, with renowned studies published in the field of narcolepsy, Dr. Mignot was excited to present as part of a webinar on the topic of machine learning in sleep medicine and beyond sleep in the greater world of proteomics.

“Artificial intelligence is going to be applied not only in the study of sleep, but to biological measures that will be important to sleep,” said Dr. Mignot, who kicked off his presentation by talking about the big picture role of machine learning in sleep medicine.

“What’s exciting about sleep that people may not realize is that we may be uniquely positioned to take advantage of advances in data and analytics.”


AI Can Utilize the Full Range of Data We’re Collecting

It’s clear we’re collecting more information than we’re using, and unfortunately, much of it is simply being thrown out. Or is it? Like an elephant, AI never forgets, and the machine learning in AI like our own

EnsoSleep is designed to find ways to use that data. Similarly, Dr. Mignot wants to specifically look at the PSG signals and figure out how to better use all the data that is collected, rather than just the nuggets we currently leverage in analysis.EnsoData Statistics _ 79 percent maintained HST volumes

Home testing is on the rise, and Dr. Mignot believes there will be a shift from traditional PSG testing to home testing as AI helps develop a better home test. AI is beginning to make scoring tests easier to manage in bulk, and home testing opportunities don’t come with the same social distancing and scalability constraints. Home testing has been especially important during the COVID-19 crisis, check out our research on that front.

This new testing process is still in development, but we agree with Dr. Mignot: the sleep centers adapting and evolving with technology will emerge from this situation the strongest. Our recent research data backs that up, with 79% of sleep centers maintaining their levels of HSTs despite the crisis.

On the contrary, just 28% of centers maintained full levels of in-clinic testing, with most of those coming from rural areas, including Wyoming and South Dakota.

Improving Analytics in PSGs with Machine Learning

Dr. Mignot believes the signals we are already recording in PSG tests are being underutilized, mostly because humans can only compute at certain levels. AI on the other hand, has the ability to crunch far greater quantities of data. In fact, waveforms provide us with billions of data points, both in the world of sleep (with EEGs) and beyond it. For Dr. Mignot, the primary focus is on sleep. “The most important signals we subject to machine learning or statistical analysis is the PSG,” said Dr. Mignot.

“The PSG is an incredibly rich signal, and I think we don’t fully utilize most of the information we collect in the PSG.”


He discusses how machine learning is bringing about this statistical revolution. Dr. Mignot has focused on deep learning for PSG analysis as the more recent promising methodology within machine learning. In deep learning, the AI’s architecture can include a computational system called a convolutional neural network. These neural networks extract valuable features from inputs such as images and signals. Our own AI & Machine Learning Engineer, Yoav Nygate, explains this in more detail.

“The main value of convolutional neural networks in deep learning is that models can learn to extract valuable features from the inputs based on the task at hand,” said Nygate. “For example, it allows an AI to detect a human face based on features (lines, curves, patterns, etc.) that it learned during the training process without explicitly defining and programming what these features actually are.” In other words, the AI is teaching itself the key traits to identify and then optimizes organically over time to improve.

How Deep Learning Technology Works

Another way to consider how it works is to picture a giant Yes/No decision tree, pictured to the right of the faces in the image below. These choices can be very simple or quite complex. The computer will slowly learn and progress as more data is funneled through the learning algorithm.
ensodata improved psg analytics

Training these algorithms often requires a lot of up-front data. One way to train a system on this data is to have humans look at photos and input responses: Is this a man’s face? A woman’s? A child’s? Is this person wearing glasses? Is it a cat? A dog? Is this an elderly face? And so on and so forth. Each human response helps train the computer program to ask another Yes/No question or perhaps a different series of questions based on responses. The machine slowly builds its own algorithm, with the goal of eventually matching or surpassing human speed and accuracy in the objective task.

Another example to include is CAPTCHA tests. Humans have been training AI in CAPTCHA tests for years, with major focuses on improving AI driving. Why do you think you have so many CAPTCHAs that require you to identify buses, stop signs, traffic lights, crosswalks, taxis, and other images related to driving? With human input, AI continues to evolve – as machine learning makes connections between the characteristics that may not have been intended. It’s clear that human input is helping driverless car development, but this Machine Design post dives into our role in AI vehicles for those who are interested.

“Amazingly, after a while, the program will be able to learn each filter that is going to be most predictive of a specific image or action,” adds Dr. Mignot, who references deep learning’s impact on facial recognition and speech recognition AI technologies. He posits sleep medicine is soon to jump on the bandwagon.

Deep Learning Models in Sleep

One of the strongest reasons to believe in the relationship between machine learning and sleep medicine is the value of stored and iterable data. In short, this means the AI can analyze data points one at a time, allowing it to iterate over in a loop, improving its own capabilities over time. In other words, each time deep learning technology makes a decision, it stores that decision. “This is especially important in sleep,” said Dr. Mignot, as he talks through sleep data.

He describes the process elaborately, and we’ll paraphrase here. Take the EEG. When you look at it, you don’t look at just one snapshot. You look at it over time. If it’s a stage one snapshot, you know it will either remain there or progress to stage two. It’s not random. So, as the machine learning program reads EEGs, it will take into account what it has seen before when it makes a determination in the next sleep stage. This is the iterative process in action.

We agree, this is crucial. This type of training will help the computer process tests faster. It will improve the accuracy of scored studies. And hopefully, these “filters” will begin to spot the initial stages of sleep disorders from the onset, far faster than current processes allow.

AI Reveals Insights and Probabilities

Per Dr. Mignot, the next largest reason for the rise of deep learning technology in sleep is the value in probabilities. He dives into a very interesting sleep study example at the 1:01:10 mark in the webinar, but we’ll give you the quick takeaway: humans don’t always agree on scores, but an AI trained on thousands of human scores will be able to identify the areas where consensus is least likely, and then give probabilities for sleep staging based on learned responses.

Even while it’s still mastering the algorithm to accurately predict responses, machine learning AI can start diving into the data in the background. AI is moving toward providing the probabilities of each response, rather than simply outputting the likeliest response. Because humans differ in responding to data, the AI provides a holistic view of the situation, rather than providing basic binary responses.

In other words, in the places where sleep clinicians are most likely to disagree, machine learning programs will be able to estimate the probabilities for the next stage in a study. For example, a patient is currently in stage 2 sleep, and the study includes a change in the PSG data. Based on that change, the AI might predict that there is a 65% chance to stay in stage 2, a 25% chance of shifting back to stage 1, and only a 10% chance of a shift into stage 3 sleep. In this hypothetical example, you not only have the best guess, but also how confident the AI is in the score.

Having these probabilities in place gives clinicians more confidence in results, especially over time as deep learning allows for further updates and advancements with the input of more data. Because the data has also been reviewed, validated, and confirmed by licensed sleep technicians, there is additional learning opportunity on the back end to “fix” the potential AI errors and further improve the algorithm. This latter half is how we’re working with expert frontline clinicians to improve our own scoring process.

In this way, we can demonstrate how the machine learning program can do better than a single scorer. In Dr. Mignot’s opinion, doctors will eventually be able to ask the AI not only the stage and probabilities, but how it came up with specific analysis, and what specific signals generated that response.

Where does Machine Learning Thrive in Sleep Medicine?

The areas where machine learning is set to take the sleep world by storm are numerous, but for Dr. Mignot, arousals are an excellent place to put AI to work.

“Machine learning is very good at detecting arousals,” commented Dr. Mignot. “Arousals are often a score where manual scorers disagree, but with machine learning, we can detect signals better than individual scorers. You can say that with conviction by showing that the accuracy of single scorers is below that of machine learning compared to a consensus of scores.”

At Stanford Medicine and here at EnsoData, we’ve been able to apply machine learning to most aspects of the PSG, from classic and novel sleep stage identification to detecting micro and macro-arousal signals. AI has the ability to detect breathing abnormalities and periodic leg movements during sleep, including subtypes of sleep apnea.

This doesn’t apply to all sleep apnea disorders, as the consensus among clinicians still isn’t agreed upon in that regard. If the humans can’t agree, then the machine learning model is also hindered. But that’s not the only barrier for AI. One problem for software developers to consider is the data used to build the model.

Dr. Mignot highlighted a few questions for AI experts to consider when developing software:

  • When you are using machine learning algorithms, how do you validate your data?
  • Are you using the right validation metrics?
  • And can you verify the output of this analysis?

Dr. Mignot poses these questions to his team daily, and we believe they must be considered, as well.

Understanding Sleep Disorders: Why Use Genetic Analysis?

Dr. Mignot’s team is really focusing on the ability of AI to support his genetics research. He’s striving to find the genes that may be associated with sleep disorders.

large samples gwa

If they can find these genes, he believes they can find the pathways that cause problems, not just the consequences. This is changing the way we’re looking at some sleep disorders. As you can see from one of his slides above, the analysis provided by deep learning technologies is redefining how we look at certain sleep disorders.

“It appears insomnia and restless leg syndrome share a lot of genes. That was a surprise. It also looks like Long sleep (or hypersomnia) shares a lot of genetic information with schizophrenia and bipolar disorder. We knew that bipolar disorder patients often complained of hypersomnia, but this seems to be evident in high population studies,” said Dr. Mignot, citing the Jansen et al. 2019 study, among others.

Ultimately, these connections may be predictable: not in our hands, but in the hands of AI. And, when we can identify diseases more swiftly, we can hope to provide far greater treatment options.

How to Best Leverage Machine Learning

For Dr. Mignot, the path to a breakthrough is simple. If we can find genes associated with sleep disorders, we can get to the causes, not the effects of sleep disorders. His team is looking at proteins to solve this problem, and while proteomics have long claimed to be a “genome” level innovation, work still needs to be done on that front. Machine learning will expedite their process, and for the betterment of all people, we hope the proteomic breakthrough is here sooner rather than later.

That said, machine learning is here. Our own AI software, EnsoSleep, measures the waveforms recorded in PSGs and HSTs and accurately and quickly scores them for a clinician’s review.

“To date, no other available sleep scoring solution is interoperable with your IT team, powered by AI, and fully automated in its process.”

Using advanced machine learning concepts and sourcing from over 400,000 sleep studies, our product is scoring studies with an outstanding accuracy rate when reviewed by licensed clinicians. And, we’re built to help you scale your sleep operation, either in terms of locations, number of patients, or simply chipping away at your piling backlog of studies to score.

EnsoData simplifies the process for analyzing the human body to accurately diagnose health conditions. Using artificial intelligence, EnsoData’s technology transforms billions of waveform data points collected from sensors in medical devices and wearables into an easy-to-read report, so clinicians can make faster, more accurate diagnoses. Waveforms are used in healthcare to diagnose, monitor, and treat patients. Heartbeats on an EKG, eye movements through an EOG, and brain waves through an EEG all output as waveform data, with over 1.5 billion waveforms run per year globally across specialties. EnsoData leads the world in reading and understanding these waveforms, starting with sleep disorders and the flagship product, EnsoSleep.

Source: Republished with permission from EnsoData

1 Trackback / Pingback

  1. The Next Horizon: The Application of AI and ML in the Delivery of Sleep Health Care - RTSleepWorld

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.