5 Steps to Phasing Sleep

by Ben@Zeo on December 8, 2009 · 9 comments

At last night’s Quantified Self meet-up, a rather well known Zeo user presented our very own Personal Sleep Coach. Naturally, with the #QS audience, everyone was curious: “How does Zeo actually work?”

We heard you, and we want to share (and show) the 5 steps that Zeo takes to phase sleep…

Step 1 - Collect Signals

The Zeo headband uses 3 silverized, conductive, fabric sensors to collect the tiny electrical signals naturally produced by your brain, muscle tone and eye movement.

Zeo Headband Sensors

Zeo Headband Sensors

Step 2 - Amplify Signals

The electrical signals collected from Step 1 are very small - typically 5-100 microvolts (which is about 1/100,000 the voltage of a AAA 1.5 V battery). The next step is to amplify these signals using specialized circuitry.

Amplified Signal from Zeo

Amplified Signal from Zeo

Step 3 - Extract Features

From the ’squiggly line’ of Step 2, we need to extract specific ‘features’ (e.g. low frequency, high amplitude delta waves that are indicative of deep sleep) using signal processing techniques like a Fast Fourier Transform (FFT). We end up with a bunch of individual ‘features’ that are associated with different phases of sleep.

Sample Features From Amplified Signals

Sample Features From Amplified Signals

Step 4 - Add Artificial Intelligence (the secret ingredient)

By comparing the signal ‘features’ from Step 3 to the desired output from our sleep expert, Walter K. (a.k.a. Wally) using a PSG, we end up with a Neural Network which accurately estimates the probability that you are in a certain phase of sleep.

Zeo Neural Network - Probabilities of Wake, REM, Light or Deep Phases

Zeo Neural Network - Probabilities of Wake, REM, Light or Deep Phases

Step 5 - Convert Into Sleep Phases

The Neural Network actually decides what phase of sleep you are in every second of the night, but we smooth out the sleep phases and report the results for every 30 second and 5 minute interval.

Sleep Phases for 30 Second (Blue) & 5 Minute Intervals (Green)

Sleep Phases for 30 Second (Blue) & 5 Minute Intervals (Green)

Questions?

Now that you know what we’ve spent the last 6 years developing, refining, then refining some more (along with a website and coaching program)… we’d love to hear your thoughts, questions and comments…

Bookmark and Share

{ 2 trackbacks }

O'Reilly Radar
December 22, 2009 at 6:20 pm
Link roundup « Follow the Data
December 23, 2009 at 8:40 am

{ 7 comments… read them below or add one }

1 Derek@Zeo December 8, 2009 at 5:42 pm

Also - check out the Scientific Validations on our website for more information about Zeo’s accuracy compared to PSG and Actigraphy.

Reply

2 John@Zeo December 21, 2009 at 2:16 pm

This comment is in response to a very insightful Zeo user who commented on our Facebook wall (http://bit.ly/88jQDo) and asked: “If someone is awake for 1.5 minutes but then falls back asleep before the 2 minute threshold what state does zeo record for those three 30 second epochs?”

The answer is a bit complicated. As you probably know the brain transitions from state to state rather quickly. In a sleep lab they score little awakenings (micro-arousals) lasting only three seconds! That would be way too much information for Zeo users, as Zeo is designed to give you an overview of your whole night. In addition to these little transitions Zeo has to deal with the noisy bits of signal from its sensors due to movement and other things.

Here’s how it works:

1. Zeo calculates a sleep phase every two seconds.

2. Those two second answers are averaged to create a more stable answer every thirty seconds. This interval still has a lot of phase transitions which are unhelpful to Zeo users.

3. So Zeo uses information from the surrounding minutes to make the call. These thirty second intervals were validated in our scientific studies.

4. Now Zeo has to decide what to tell you at the bedside, which displays five minute intervals. The thirty second intervals vote, winner take all.

5. There are exceptions to these rules, for example if one of the intervals was Wake, it trumps the rest.

To answer your question more specifically - what would a 1.5 minute awakening report on the 30 second resolution sleep graph? - It depends…

If we assume a perfect on/off signal for wake (which is not real life - but for this example) we would get something like this (each letter is a 30 second period):
Your Brain : SSSSSSSSWWWSSSSSSSSSS
Zeo Reports: SSSSSSSSSSWWWSSSSSSSS

But a 30 second wake period would get completely smoothed over.
Your Brain : SSSSSSSSWSSSSSSSSSSSS
Zeo Reports: SSSSSSSSSSSSSSSSSSSSS

Now lets consider a more real life situation. You wake up for 1.5 minutes, with some motion artifact mixed in, and some drowsiness falling asleep again, etc. etc.
Your Brain : SSSSSSSSWWWSSSSSSSSSS
Zeo Actually Sees: SSSSSSUUWSUWWSSSSSSSS (U is for unknown when there is too much artifact to report on that period)
Zeo Reports : SSSSSSSSSSSSSSSSSSSSS

So to be completely honest - depending on the exact situation a 1.5 minute awakening could be reported perfectly, strangely (a bit of W here and there in the 30 second sleep graph), or not at all.

The ‘two minute rule’ is not a rule at all, it’s just a generality.

So that brings us back to our answer that Zeo algorithms aren’t designed to measure and do not report awakenings under 2 minutes. In reality its more nuanced. The reason that it generally takes two minutes of Wake to be noticed lies in the way step 3 is computed, though we may sometimes report awakenings that are a bit shorter than 2 minutes. It was designed to optimize accuracy in our studies.

Reply

3 Ed January 21, 2010 at 11:19 pm

Is there a way to find out how frequently Zeo sees artifacts or is in range but not detecting, e.g., poor contact with head (don’t know if you can determine that from the data), or number of times the sensor is out of range of the clock? These would be useful to me because it would help me know if I have the band too lose or for some reason am getting unusually high artifact rates. The number of times out-of-range would indicate trips to the bathroom.

Reply

4 Ben Rubin January 22, 2010 at 1:21 pm

Ed,
Thanks for the comment - interesting ideas.

1. Artifact
Right now there are two ways to look at the level of artifact - and neither is as accurate as what you are looking for. The first is through gaps in the 5 minute or 30 second (.cvs download from the website) sleep graphs. Those gaps can indicate either artifact or wireless loss (or off the head completely). The second way is to look in real-time at the JEB icon on the Bedside Display. If the head disappears there is artifact. Kind of hard to do while sleeping… but it’s interesting to play around with while awake.

2. Wireless
Gaps in the 30 second or 5 minute sleep graph would be the only way to see wireless dropouts over time. The Wireless icon on the Bedside Display would also show you - but you would have to be looking at it (in which case the wireless should work!). Wireless drops may not be an entirely reliable was of determining bathroom trips either - the wireless is often good enough to work through walls - but it wouldn’t travel to the other side of the house. So it would depend on how far away your bathroom is…

Best, Ben

Reply

5 Ed January 28, 2010 at 8:15 am

Thanks for the reply. To see the gap you mention in the 30 second data because of artifacts, would it require a substantial portion (or all?) of the 30 seconds to be noisy or do you mask out a band around around artifacts so that a few moments of disturbing the headband, e.g., rolling over with a loose band, will likely lead to a 30 second gap?

I’ve done the stare at the clock thing… problem is, I start laughing every time my head disappears!

Reply

6 Ben Rubin January 28, 2010 at 10:46 am

We try to phase sleep whenever we meaningfully can. For each 30 second phase we report on we are looking a bit forward and a bit back for enough information. SO a few seconds rolling around will not lead to gaps in data - but a few minutes likely will.

Reply

7 Bob Ferguson February 2, 2010 at 2:15 pm

I’m teaching an introductory undergrad course on Sleep & Dreams and my students will be using the ZEO for some simple research projects. First, I’d like to confirm my understanding of how the ZEO works so I can discuss it with the class. Here’s my understanding: The headband picks up EEG, EOG and EMG activity and sends it to the bedside unit, which then does a Fast Fourier transform to separate the three components of the signal. The output of the transform is then fed into a neural net which has been trained by an expert to identify the 4 stages (W, L, D, R) that you report. Is that generally correct?

A second question…I understand how to export data from your website to a .csv file, and now I’m wondering if I can access something closer to the raw output of either the Fourier Transform or the neural net. I assume something like that is in the .dat file on the memory card.

Any help you can give me on these questions will be greatly appreciated.

Thanks.

Bob F

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: A Strange Sleep Phenomenon At 10,000+ ft

Next post: Personal Data Privacy and Zeo