Category: lucidcode INSPEC


Added a marker to the hypnogram in the INSPEC lucid dreaming device’s REM episode player that highlights when the clips with eye movements were captured.

Added face rotation to the INSPEC firmware in 1.3.9, so REM detection also works when your head lies sideways in the frame.

The Pixel Range used to set how many changed pixels in a row count as movement. It now counts changed pixels in connected groups in any direction, which detects more subtle eye movements in all directions. It also more sensitive now, so the Pixel Range needs be increased from 6 to 12 to filter out background noise.

A new eye bursts function now counts an eye movement only when another one occurred within the 2.5 seconds before it. This helps to keep the artifact filter from filtering out valid eye movements when too much of the body is in the frame and breathing patterns cause repetitive motion signals.

Added over-the-air firmware updates!

Upgraded the REM Episode Player in Lucid Scribe for the INSPEC. Here I am scrolling really fast through all the frames then moving back and forth between some frames…
This is the session where I recorded my sleep in parallel with the CGX Patch EEG and the sleep stage classification lined up surprisingly well with the INSPEC.

Added a new Capture Frames Without REM option that saves a frame from the INSPEC when no REM has been detected for a configurable interval between 15 and 90 minutes. This is to help new users debug the camera angle and positioning when no clips of REM episodes are captured on the first nights.

INSPEC - Capture Frames without REM

I ran the INSPEC session with the CGX Patch EEG recording through three sleep stage classifiers: two models from ezscore (ez6 and ez6moe), and Dreamento’s DreamentoScorer. All three classifiers are trained on the ZMax, so on the CGX they flipped between stages a little too often.

The REM marks fall at the same times the INSPEC detected REM across all three classifiers. Especially the long REM periods late in the night, around hours three, five, and seven, show up in every one of them. The results are better than I dreamed!

The full session along with the raw files (including EDF) is on LSDBase:

Lucid Scribe INSPEC vs Clinical EEG Sleep Stage Classifier Lucid Scribe INSPEC vs CGX Patch EEG DreamentoScorer Lucid Scribe INSPEC vs CGX Patch EEG ezscore ez6moe Lucid Scribe INSPEC vs CGX Patch EEG ezscore ez6

I recorded an INSPEC session while wearing a clinical-grade EEG device, a CGX Patch on loan from a sleep research lab after I gave presentation on “Contactless REM Detection in Natural Sleep” and the history of the INSPEC.

The INSPEC logged a 20-minute run of eye movements that line up where I can also see spikes in the EEG data. I still need to run the EEG data through a sleep stage classifier, but it looks like they align from what I can see.

The full session along with the raw files (including EDF) is on LSDBase:

REM Sleep - Lucid Scribe INSPEC with CGX Patch EEG

The latest INSPEC update adds BlazeFace, a lightweight convolutional network designed by Google for real-time face detection on mobile devices. It’s small and fast enough to run on the INSPEC’s onboard computer. And it handles the awkward inputs that overnight sleep produces… cropped faces, extreme angles, infrared illumination, and partial occlusion from blankets. The face is now detected through the kinds of angles that confused earlier versions.

The result in nightly use has been clean: detection happens every night and false positives under the current filter set have dropped to zero.

A recent recording from caught 80+ visually-confirmed REM events clustered into a 21-minute window during late-cycle sleep, lining up exactly with a 30-minute lucid dream:

Added a new Progressive Volume option that makes each successive audio cue play slightly louder than the last. You can configure the increase amount from 5% to 50% per cue, with the volume capping at 100%. The volume is relative to the system’s media channel volume.

And some new settings to trigger a “Face Lost” audio cue when your face is no longer visible to the camera. This is useful for maintaining optimal positioning throughout the night.

You can configure:

  • How long your face must be absent before the alert triggers (10 to 120 seconds)
  • A separate volume level for the face lost alert, also relative to the system’s media channel volume
  • A custom audio track for the alert
INSPEC Lucid Dreaming Device Progressive Audio Cues INSPEC Lucid Dreaming Device Face Lost Detection

This video shows how the INSPEC can be positioned on the bedside table to detect eye movements during REM sleep, with the Lucid Scribe app running in the background and the infrared spotlight in the frame. I usually have the infrared light on the floor, aimed at the wall so the reflected light has an even distribution.

The INSPEC detects the face and eye movements better if it looks up from chest height – instead of right next to your face, and aimed slight downwards with the help of some books so that it picks up more angles, like when you are lying on your back. The face should appear upright in the video feed.

INSEPC | Lucid Scribe Android​​ | Lucid Scribe iOS