The latest INSPEC update introduces hypnograms and computed sleep quality metrics. The implementation estimates AWAKE, REM, Light Sleep (NREM1 and NREM2), and Deep Sleep (NREM3 and NREM4) phases using a combination of stillness scoring and detected rapid eye movement patterns from the video stream. Stillness is inferred from frame-to-frame pixel variance, while REM is detected through bursts of eye movement activity from the REM-detection engine.
The hypnogram output aligns well with typical sleep architecture and already offers valuable insight into session dynamics. This lays the groundwork for real-time sleep staging and deeper analysis to optimize cue timing relative to vivid dreams during REM sleep.
There is still lots planed, like adding indicators for when the REM-detection algorithm triggered the audio cues and caching for faster load times, but it is already yielding valuable insights and fun to play with.
The top frame is animated and replays highlights from the session where rapid eye movement patterns were detected. The rest of the frames are stills that can be removed – for when you want to export to an LSD file and share the session, but were caught sleep-talking or at an awkward angle.😅
INSEPC Details | GitHub | Google Play