Wake Word Detection
An always-on listener that wakes a device when it hears its name, without streaming the microphone anywhere. Our 5,121-parameter network listens for one word in every second of audio, and we trained and tested it on real recordings from Google’s Speech Commands dataset.
- parameters in the whole network
- 5,121
- median accuracy on 441 real recordings it never trained on
- 85%
- of weights, before quantizing to 8 bits
- ~20 KB
- its score for “marvin”, against 0.008 for “house” from the same speaker
- 0.989
Where it's used
Listening all the time, on almost no power
A doorbell, a smart speaker or a hearing aid that responds to its name needs something listening all the time. Streaming the microphone to a server costs bandwidth, power and privacy, and keeping a full speech recognizer awake drains the battery.
A wake-word detector gets around both. It’s a small model on a low-power processor that checks the last second of audio for one word, and wakes the rest of the system only when it hears it.
- A doorbell that answers to its name
- A smart speaker that wakes only when it’s called
- A hearing aid that responds when it hears its name
- No audio has to leave the device to listen for the word
The data
Real voices, real recordings
We used Google’s Speech Commands dataset: one-second clips of single spoken words from thousands of people, recorded on their own devices. The wake word is “marvin”, with 2,100 clips of it, set against 2,302 clips of other words and background noise, so the network learns to stay quiet through both.
The wake word is just a setting. Training for a different word is a rerun, not a rewrite.
- Training · 80%, 3,521 clips
- what the network learns from
- Validation · 10%, 440 clips
- checked after each round of training, so we keep the best model
- Test · 10%, 441 clips
- kept aside until the very end. The scores below come from these.
How we built it
Sound in, one decision out
Two pieces work together. The first turns each second of audio into 49 short frames of 20 sound-energy bands, the same first step full speech recognizers use, and it runs identically on the device against the live microphone. The second is a 32-unit GRU network that reads those frames one at a time and decides whether the clip was the wake word.
- 01
Frame
32 ms windows, every 20 ms: 49 per second
- 02
Transform
a 512-point FFT of each window
- 03
Bands
20 mel bands from 0 to 8 kHz, then the log of each
- 04
Normalize
every clip scaled the same way, whatever its volume
Loud or quiet, it hears the same thing. Real recordings vary enormously in volume and microphone quality. Each clip is normalized before the network sees it, which takes those differences out of the picture.
Results
85% on recordings it had never heard
We trained the network seven times and tested every run on the same 441 held-out clips, 217 of them “marvin”. The median run got 85.3% of them right, and the best got 89.1%.
Tuned to your product
Every listener balances two kinds of mistake: missing the wake word, and waking up when it shouldn’t. Across our runs, one almost never woke by mistake, on just 3.6% of other clips, while another caught all but 6% of the wake words.
Each product wants that balance somewhere different. A doorbell can afford the odd false wake-up, and a device that starts recording when it wakes can’t. In a product, we set the decision point deliberately on validation data, so it lands exactly where you need it.
On the device
An always-on listener on a microcontroller
On the device, the same feature code runs against the microphone buffer and our library runs the network. Each second of audio takes 49 small FFTs and 49 steps of the 32-unit network, and a live listener slides that one-second window along the stream.
The 5,121 weights come to about 20 KB, and our tools convert a trained model to 8-bit integers and to a format that runs straight out of flash.
- microphone audio, read a second at a time
- 16 kHz
- small FFTs and network steps per second of audio
- 49 + 49
- of weights, and smaller again as 8-bit integers
- ~20 KB
- to train a new model on a desktop
- Seconds
Ready to build your next intelligent device?
Let's discuss your project and how Cole Design & Development can bring your idea to life.
Founded in 2008 · Hudson, Ohio · info@coledd.com