Train an ONNX Keyword Spotting Model Online in 2026
Keyword spotting (KWS) detects a small, predefined command set directly from audio. If an app only needs “start,” “stop,” “next,” or a few device actions, a compact offline model can be simpler than continuous speech-to-text.
Why train one multi-keyword model?
Running a separate model for every command repeats feature extraction and complicates threshold management. A shared multi-keyword model processes the audio once and returns the scores for the configured command set. It is useful for smart-home controls, accessibility tools, kiosks, games, robots, industrial panels, and hands-free application shortcuts.
Example command set
start recording
stop recording
next page
previous page
cancelChoose phrases that are acoustically distinct from one another. Avoid putting a short word and a longer phrase containing the same word into the same set unless you have tested their separation carefully.
Online training steps
- Sign in to Voicute and select the target language.
- Choose the multi-keyword model type.
- Add two or more commands and confirm their spelling and pronunciation.
- Optionally add real recordings for commands with unusual pronunciation.
- Submit the task and wait for generation, augmentation, training, and export.
- Test each command plus ordinary speech before downloading the model package.
Use the result in an application
The runtime callback returns the detected label, so the application can use a small command map:
ACTIONS = {
"start recording": start_recording,
"stop recording": stop_recording,
"next page": next_page,
"previous page": previous_page,
"cancel": cancel_action,
}
def on_detected(word, probability, info):
action = ACTIONS.get(word)
if action:
action()Inference runs locally through ONNX Runtime on desktop and mobile targets, ONNX Runtime Web in a browser, or a compatible embedded runtime. No speech transcript is generated, and live audio does not need to leave the device.
KWS or ASR?
| Requirement | Better starting point |
|---|---|
| A few fixed commands | Keyword spotting |
| Always-listening activation phrase | Single wake-word model |
| Free-form dictation or conversation | ASR |
| Wake first, then understand a request | Wake word followed by ASR |
Validate the command set
Test every command with unseen speakers and the final microphone. Also play ordinary speech and phrases that sound similar to the commands. Tune the threshold against both missed commands and unintended activations; optimizing only recall is not enough for a control interface.