By Ryan Neely, Ph.D.
Today we are providing a sneak peek into the development of our sleep tracking feature and some of the design choices we made along the way as we prepare to launch data in our app, and raise the bar on sleep insight with Elemind. Building this feature has been an interesting journey into the world of neuroscience, artificial intelligence, and understanding our users and their preferences. As a scientific team, we are interested in elevating sleep performance, improving sleep efficiency, and of course, reducing sleep latency (the time it takes to fall asleep or fall back to sleep). Our choices in how we track and present sleep data, are all oriented towards these goals.
Tracking Sleep with Brainwaves
The Elemind headband measures sleep differently from the majority of sleep tracking devices. Most devices use some combination of movement and heart rate patterns to estimate sleep and wake cycles. While they generally do a good job of distinguishing wake from sleep, sleep stages (such as light sleep, deep sleep, and REM sleep) can be difficult to estimate correctly without a direct measurement of brain activity (see this blog post for more details). In contrast, Elemind uses electroencephalography (EEG) to estimate sleep, meaning that we are detecting the signals produced by the brain as you cycle from wake into the various stages of sleep. Technically, the gold standard for measuring sleep stages is a polysomnogram, which in addition to brain activity also includes measurements of eye movement, muscle tone, breathing parameters, and electrical activity of the heart (ECG). However, in recent years deep learning models have been able to approximate and even match the performance of polysomnography using data from only one channel of EEG. Elemind leverages deep learning neural networks to estimate sleep stage using the EEG electrodes built into the headband.
Visualizing Sleep
There are a number of ways to display data collected over the course of the night. When collecting training data for our neural network model, we worked with registered polysomnographic technicians (RPSGTs), who are experts in interpreting sleep data. They have the ability to determine sleep stages by looking at the raw traces of brain activity; the display they use when scoring sleep looks like this:
An example of sleep scoring software used by an RPSGT. The raw traces of eye movements, brain activity, muscle activity, and heart activity are shown.
For those of us without RPSGT training, some additional preprocessing and interpretation is needed before we can make sense of these data. One of the ways that our team prefers to visualize data collected from the headband is to generate a time-frequency plot known as a spectrogram. As a person moves through the various stages of sleep, the frequency (or “speed”) of brainwaves slows down or speeds up. Because of this, it can be useful to look at how the frequency of brain activity changes over time. A spectrogram shows the distribution of power across different frequencies of brain activity over time. With some practice, it becomes possible to get a rough idea of a person’s sleep stage just by looking at these graphs. For example, higher power in the lower frequency bands tends to correspond to deep sleep, whereas bursts of activity in higher frequency bands can be associated with REM sleep.
Spectrograms captured from all 3 channels of an Elemind headband during a night of sleep (mine, actually). The color intensity indicates the power of brain activity across different frequencies over the course of the night. The blue band near the top of the plot is an artifact of a filtering process.
However, spectrograms aren’t particularly quantitative when trying to estimate the various metrics most people associate with sleep tracking. For this purpose, a hypnogram plot can be more informative. Hypnograms simply plot sleep (and wake) stages against time, allowing the reader to easily visualize how the sleeper progressed through sleep stages throughout the night. In our app, we visualize hypnograms like this:
A hypnogram displayed in the Elemind app.
Hypnograms give a succinct picture of sleep patterns throughout the night in a way that is easily interpreted by most people. For the curious, overlaying hypnograms on top of spectrograms can be a helpful way to learn to read time-frequency plots:
A spectrogram overlaid with hypnogram sleep stage estimates
To Score or Not to Score
Some sleep tracking apps will display a “Sleep Score,” generally a number between 1 to 100 that purports to quantify sleep quality in a holistic way. How these numbers are calculated is a black box - it appears that each company calculates them differently, and I’m not aware of any company that has made their computation algorithm public. Sleep scientists don’t utilize these one-dimensional scores when measuring sleep, as generally there are too many independent factors at play when considering sleep quality. Additionally, there isn’t a strong scientific consensus on what the optimal values for each metric should be. For example, Ohayon et al. (2017) report the National Sleep Foundation’s recommendations for various factors like time to fall asleep, time spent in deep and REM sleep, and more. If you look at the charts for each parameter, it’s apparent that experts aren’t totally certain where most people should fall.
Expert consensus regarding the total fraction of time people should spend in deep sleep.
Given the ambiguity in the field, we didn’t feel it was appropriate to reduce sleep quality to a 1-dimensional value and make definitive claims about what it represents. Instead, we’ve chosen to present our users with all the sleep metrics we calculate so they are empowered to draw conclusions based on what aspects of sleep matter to them. Additionally, there’s good evidence that “gamifying” sleep with sleep scores can actually induce anxiety to the point of being counterproductive. A report in the Journal of Clinical Sleep Medicine coined the term “Orthosomnia” to describe an unhealthy obsession with sleep scoring that can actually induce feelings of daytime sleepiness (Baron et al. 2017). In designing our sleep metrics, we tried to strike a balance between presenting users with as much data as possible without overanalyzing. Finally, we recognize that the Elemind headband is more than just a sleep tracker, and that people will use it in ways that differ from many other devices. For example, some users may prefer to use the device’s stimulation feature at the beginning of the night, but choose not to wear the band all night. In cases like this, we didn’t think it would be meaningful to “score” an hour or two of data as if it were a full night's sleep.
An example of some sleep metrics displayed in the Elemind app
Sleep Tracking and Beyond
While we’re excited to release our sleep tracking functionalities in the coming weeks, we’re also looking forward to providing even more detailed metrics in the future to give unique insights into brain activity during sleep. Sleep research is an active area of scientific investigation, and we do our best to stay informed of all of the latest discoveries. We hope to build upon our initial analytics to provide new analyses that let our users get a better picture of their sleeping brain. We are eager to hear how users like the new features and would be interested to know what they’d like to see next, so feel free to reach out with any feedback or suggestions!
References Cited
Ohayon, M., Wickwire, E.M., Hirshkowitz, M., Albert, S.M., Avidan, A., Daly, F.J., Dauvilliers, Y., Ferri, R., Fung, C., Gozal, D. and Hazen, N., 2017. National Sleep Foundation's sleep quality recommendations: first report. Sleep health, 3(1), pp.6-19.
Baron, K.G., Abbott, S., Jao, N., Manalo, N. and Mullen, R., 2017. Orthosomnia: are some patients taking the quantified self too far?. Journal of Clinical Sleep Medicine, 13(2), pp.351-354.