Offline Wake Words from Training to Deployment
Esta página aún no está disponible en tu idioma.
Offline Wake Words from Training to Deployment
Overview
Section titled “Overview”“Hearing a wake word without the internet” is a must for privacy-sensitive and weak-network settings. On AI-extended chips like the ESP32-S3 you can run keyword spotting locally: train a custom wake word, quantise it into a small model, deploy it for always-on listening, and trigger the follow-up on a hit. This section covers the whole chain — train a wake word, quantise, deploy, then trade off always-on power against false accepts. By the end you will be able to:
- Train a custom wake word (keyword-spotting model) with existing toolchains
- Quantise and deploy the model to ESP32 for resident listening
- Trade off accept rate, false accepts, latency, and power
- Design the post-hit action and fallback (local commands versus triggering online recognition)
Prerequisites
Section titled “Prerequisites”- Completed Chapter 25 Section 13 (actuators) and the display/audio basics
- A mic-equipped ESP32-S3 kit (analogue/digital mic, suitable gain)
- Wake-word recordings ready (multiple speakers, multiple noise conditions)
Key Concepts
Section titled “Key Concepts”The four-step wake chain
Section titled “The four-step wake chain”- Capture: microphone → I2S → windowed features (MFCC/mel-spectrogram), with gain and denoise in the front end
- Train: use a toolchain (open-source KWS projects or a “micro wake word”-style repo) to train the custom word, covering speakers and environments
- Quantise and deploy: int8 quantise plus convert to an on-device format, budgeting Flash/PSRAM and compute
- Always-on run: low-power listening that triggers the follow-up when the word is hit
Real constraints on training data
Section titled “Real constraints on training data”- Few samples overfit easily: a custom word needs enough speakers/distances/noise samples or it fails when the room changes
- Keep the vocabulary small: the device carries only your few words/commands; do not expect open vocabulary
- Negative samples matter: include non-wake speech and noise to suppress false accepts
The four metrics trade off
Section titled “The four metrics trade off”| Metric | To raise it | Cost |
|---|---|---|
| Accept rate | More sensitive/longer window | More false accepts |
| False accepts (lower) | Stricter threshold/more negatives | Lower accept rate |
| Response latency | Short window/bigger model | More power/compute |
| Always-on power | Small model/tiered listening | Lower sensitivity |
Engineering answer: tiered detection — a cheap low-power coarse check wakes first, then hands to the full KWS for confirmation.
After the hit
Section titled “After the hit”- Local commands: follow the wake word with a few fixed commands (on/off, level) all executed offline — best for privacy
- Trigger recognition: after wake, start a larger model or online ASR for free speech (see the next section on 16 MB offline transcription)
- Fail gracefully: on repeated false accepts or unclear speech, give feedback and a cooldown
[Photos pending] Training-flow screenshots, measured accept/false-accept statistics (across distance/noise/speaker), and always-on power measurement are needed.
Verification
Section titled “Verification”| Check | Expected result | Verified |
|---|---|---|
| Custom word trainable | Accept rate meets target on a held-out set | |
| False accepts controlled | Long always-on runs stay acceptable | |
| Works across environments | Still effective for different speakers/distances/noise | |
| Always-on power in budget | Listening-state current within the battery budget | |
| Post-hit action correct | Wake triggers the intended command/flow |
Troubleshooting
Section titled “Troubleshooting”Issue 1: wakes fine in the lab, fails in another room
Section titled “Issue 1: wakes fine in the lab, fails in another room”Cause: training environments too narrow, overfitting.
Action: add noise/distance/reverb samples and retrain; add front-end denoise and AGC gain.
Issue 2: it self-starts when nobody speaks
Section titled “Issue 2: it self-starts when nobody speaks”Cause: threshold too loose / too few negatives.
Action: add negatives, raise the threshold, use tiered detection to cut always-on false reports.
Best Practices
Section titled “Best Practices”- Do: pick a short, clearly-syllabled wake word unlike everyday speech to reduce false accepts
- Do: cover speakers/environments in training and treat negatives as first-class data
- Do: use tiered listening to balance power and sensitivity
- Don’t: expect open vocabulary; carry only the needed commands
- Don’t: ignore always-on power and drain the battery
Summary
Section titled “Summary”Key points of this section:
- KWS four steps: capture, train, quantise-deploy, always-on — front-end features and gain are critical
- Data decides success: speaker/environment coverage plus negatives, avoid overfitting
- Accept/false-accept/latency/power pull against each other, tiered detection reconciles them
- After wake, run local commands or trigger larger recognition — privacy versus capability by scenario
We provide ESP32 ODM design-to-manufacturing services. From prototype to production — the team behind this tutorial can build it with you.
💡 Mention tutorial.imagrove.com in your Alibaba chat with us — get 10% off your custom project quote.
Publicado por primera vez entutorial.imagrove.com/es/project-industrial-broadcast/15-offline-wake-words-from-training-to-deployment/Al citar o reproducir, indica la fuente Imagrove y enlaza a esta página.
¿Dudas o problemas con este tutorial?
Inicia sesión con GitHub para comentar. Si un paso te falla, avísanos: lo verificamos y actualizamos el tutorial.
© Imagrove · ESP32 IoT Tutorial