poc:2025:ondevice-sleepstaging

This is an old revision of the document!


On-Device Prediction of Sleep Stages

  • Status: ❌ Abandoned
  • Duration: August 19 2025
  • Type: Hardware/Possible Product
  • Repository: N/A
  • Team: Fabricio

What we're exploring: The feasibility of on-device predictions of sleep stages. Important aspects are a.) realtime processing b.) feasibility on an ESP32 c.) expected performance regressions. This is relevant due to a.) limitations on the iPhone for compute b.) decisions on how to process sleep stages etc. on our devices, e.g. what hardware?, rather in the cloud?

The ESP32 S3 is optimized for neural networks. Documentation can be found here .

The main limitation is presumably the memory.

  • The ESP32 has a total of 512KB of SRAM. This has to be shared with other processes.
  • While there is an option to upgrade with external RAM up to an additional 4MB (i.e. 4MB accessed at once), this does not seem to be recommended due to a hard decrease in performance.
  • The main issue with Convolutional-Architectures would be the explosion in intermediate activations if many filters are used.
  • This is a bit difficult to manually tune and explore.
  • int8 is apparently the preferred format.. Not sure if convolutions work that well on that quantization
  • Unclear how the DSP interacts with the NN..
  • Dynamic USleep would be probably out of scope
  • It's barely deep learning anymore. Much more focus on DSP.
  • I have absolutely no idea what happens with the performance on such small models. One would need a full development cycle for a new sleep staging model, completely decoupled from recent advances in sleep staging.

Should we proceed?: No, currently out of scope.

  • poc/2025/ondevice-sleepstaging.1755608607.txt.gz
  • Last modified: 2025/08/19 13:03
  • by fabricio