poc:2025:ondevice-sleepstaging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
poc:2025:ondevice-sleepstaging [2025/08/19 09:58] – created fabriciopoc:2025:ondevice-sleepstaging [2025/08/19 13:06] (current) fabricio
Line 1: Line 1:
-====== Template for Documenting Proof-of-Concept Projects ======+====== On-Device Prediction of Sleep Stages ======
  
-This is a guiding template for short-term exploratory projects. 
-Many sections are optional either in their presence or scope and can be excluded based on the project at hand. 
  
 ===== Quick Summary ===== ===== Quick Summary =====
  
  
-  * **Status**: 🟡 In Progress / ✅ Complete / ❌ Abandoned / ⏸️ On Hold +  * **Status**:  ❌ Abandoned   
-  * **Duration**: Start Date - End Date   +  * **Duration**: August 19 2025 
-  * **Type**: Data Analysis/Infrastructure/Hardware/Possible Product   +  * **Type**: Hardware/Possible Product   
-  * **Repository**: [[https://github.com/yourorg/repo-name|GitHub Repository]]   +  * **Repository**: N/A 
-  * **Team**: Person1, Person2+  * **Team**: Fabricio
  
-**What we're exploring**: 2-3 sentences on what this POC investigates and why it matters.+**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?
  
-===== Environment & Setup ===== 
  
-A description of the used hardware and software. +===== Key Findings =====
-The scope is up to the judgement of the team.+
  
-Suggestions for projects with hardware:+==== ESP Model: ESP32-S3 ==== 
 +The [[ https://www.espressif.com/en/products/socs/esp32-s3 | ESP32 S3 ]] is optimized for neural networks. 
 +Documentation can be found [[ https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf | here ]].
  
-  * List of hardware-parts (e.g. Raspberry Pi 3, ...) +==== Hardware Limitations ==== 
-  Version of the operating system and method of setup+The main limitation is presumably the memory. 
-  Additional notes on setup.+   * The ESP32 has a total of 512KB of SRAMThis has to be shared with other processes. 
 +   * While there is an option to upgrade with external RAM up to an additional 4MB (i.e4MB 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
  
-Suggestions for projects with software: +==== Possible Solution Approaches ==== 
- +   One would probably need a MLOps pipeline like [[ https://www.edgeimpulse.com/blog/ | https://www.edgeimpulse.com/blog/ ]] for getting solutions in any reasonable amount of time
-  Programming Language & Package Versions, Docker image, ... +   TensorFlow Lite has suport for Microcontrollers: [[ https://github.com/tensorflow/tflite-micro |TFLite Micro]]
-  * Notes on setup required steps to get things working+   * [[ https://github.com/espressif/esp-nn | Espressive-NN ]] provides optimized NN Kernels for their ESP32 devices.
-  Git Repo (Code, Dockerfiles, Configs, ...) +
- +
-Suggestions for projects with data: +
-  * Data source and when it was acquired/downloaded   +
-  * Description of changes to data, ideally with scripts + dependencies in git repo. +
- +
- +
-===== Key Findings ===== +
-==== What Worked ==== +
-  * Bullet points of successful approaches +
- +
-==== What Didn't Work ==== +
-  * Failed approaches (and why) +
-  * Performance bottlenecks discovered +
-  * Incompatibilities found+
  
 ==== Surprises & Insights ==== ==== Surprises & Insights ====
-  * Unexpected discoveries +  * It's barely deep learning anymore. Much more focus on DSP. 
-  * Hidden complexities +  * 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.
-  * Simpler alternatives found+
  
 ===== Recommendations ===== ===== Recommendations =====
-**Should we proceed?**: Yes/No/Maybe +**Should we proceed?**: No, currently out of scope.
- +
-**If yeswhat needs to happen?** +
  
 ===== External Resources ===== ===== External Resources =====
-  * [[https://docs.example.com|Official Documentation]] +  * [[https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf|ESP32 S3 Datasheet]] 
-  * [[https://stackoverflow.com/questions/xxx|Relevant SO Discussion]] +  * [[https://arxiv.org/abs/2212.03332|Edge Impulse MLOps Arxiv Article]]
-  * [[Internal:wiki:related-page|Related Internal Documentation]]+
  • poc/2025/ondevice-sleepstaging.1755597494.txt.gz
  • Last modified: 2025/08/19 09:58
  • by fabricio