English keyword-spotting model for vrc-WiredExpressions: wav2vec2 CTC with two heads on one encoder, one over letters and one over phonemes, 20 ms frames, 16 transformer layers, int8 ONNX (254 MB).
| File | Content |
|---|---|
model.onnx |
Input input_values: float32 [batch, samples], 16 kHz mono, zero mean, unit variance. Outputs logits: [batch, frames, 33] (letters) and phoneme_logits: [batch, frames, 43] (phonemes). int8 dynamic quantization of the MatMuls. |
fx.onnx |
The convolutional feature encoder of model.onnx: input input_values as above, output /wav2vec2/Transpose_output_0: float32 [batch, frames, 512]. Identical in every vrc-we-voice model, so it is published only here. |
enc.onnx |
The rest of model.onnx: input /wav2vec2/Transpose_output_0 from fx.onnx, outputs logits and phoneme_logits. enc.onnx(fx.onnx(x)) equals model.onnx(x). |
vocab.json |
Letter token ids; <pad> (0) is the CTC blank, ` |
phonemes.json |
Phoneme token ids: <pad> (0) is the CTC blank, ` |
config.json |
Wav2Vec2Config of the pruned network. |
voice.json |
Language, units, firing threshold (-0.6), and fusion: how the two heads decide a phrase together. |
lexicon.tsv |
Word pronunciations for the phoneme head, 126,052 words: one line per word, tab-separated: the word (lowercase), its phonemes, space-separated. CMUdict's first pronunciation of each word in the symbols of phonemes.json. |
pron.tsv |
Pronunciation table, 30,000 words: one line per word, tab-separated: the word (lowercase), its sound (CharsiuG2P IPA without stress, syllable or linking marks, g as ɡ, ɫ as l), and the other spellings of that sound, space-separated (may be empty). |
g2p-encoder.onnx |
CharsiuG2P's multilingual byT5 tiny encoder, int8: inputs input_ids, attention_mask (int64 [1, n], the UTF-8 bytes of <tag>: word plus 3), output last_hidden_state. Shared by every vrc-we-voice letter model's table, so it is published only here. |
g2p-decoder.onnx |
Its decoder, int8: inputs input_ids (start 0), encoder_attention_mask, encoder_hidden_states, output logits; greedy decoding to the end token (1), bytes are ids minus 3. |
fx.onnx and enc.onnx are model.onnx cut in two at the end of the convolutional feature encoder, which fine-tuning left frozen, so every vrc-we-voice model shares it: a client listening in several languages runs it once per audio window instead of once per language. model.onnx stays for clients that load the whole network.
The letter head spells what it hears; the phoneme head writes the sounds. A phrase is registered as its spelling and, through lexicon.tsv, as its pronunciation; vrc-WiredExpressions scores both every frame and decides them together (voice.json, fusion):
A phrase with a word the lexicon lacks, and a phrase shorter than five letters, is decided by the letter head alone. The phoneme head is one linear layer on the same encoder: the model costs what a letter model costs.
pron.tsv lets a phrase be heard by its sound, not only its spelling. It lists the 30,000 most frequent words of the Common Voice 19.0 and Multilingual Spoken Words Corpus transcripts this model was trained on. Each word's sound comes from CharsiuG2P; its spellings (6,685 in all) from a character transformer (3 + 3 layers, width 256) trained on this table from sound to spelling, with the evaluation word sets left out, beam 8, every spelling within 2 nats of the best but the word itself.
vrc-WiredExpressions registers, for a phrase of one word, the table's words with the same sound and the word's own spellings, under the phrase's text; a word the table lacks takes its sound from the int8 CharsiuG2P in this repository and gets the table's words with that sound. One occurrence fires the phrase once, whichever spelling heard it.
Fine-tuned from jonatasgrosman/wav2vec2-large-xlsr-53-english (Apache 2.0), pruned to its lower 16 of 24 layers, with CTC on letters; then a phoneme head added and both heads trained with the encoder.
| Dataset | Licence | Utterances |
|---|---|---|
| Common Voice 19.0 | CC0 1.0 | 1,063,238 |
| Multilingual Spoken Words Corpus | CC BY 4.0 | 1,629,270 |
| FLEURS, train split | CC BY 4.0 | 2,038 |
| LibriSpeech | CC BY 4.0 | 281,240 |
| AMI Meeting Corpus, IHM and SDM | CC BY 4.0 | 137,497 |
| VoxPopuli, transcribed | CC0 1.0 | 60,825 |
Phoneme labels: each transcript's words through the CMU Pronouncing Dictionary (BSD-style licence, below), first pronunciation, | between words; 2,783,931 utterances have one, the rest train the letter head alone.
Noise and rooms: MUSAN (CC BY 4.0); the FSD50K development set (CC BY 4.0, Fonseca, Favory, Pons, Font and Serra) without its speech-labelled clips, each clip licensed CC0 1.0 or CC BY 3.0 by its Freesound uploader and credited in FSD50K's metadata (32,626 clips; the NC and Sampling+ clips left out); the simulated room impulse responses of RIRS_NOISES (Apache 2.0, Ko, Peddinti, Povey, Seltzer and Khudanpur) and its point-source noises, public-domain Freesound recordings from MUSAN.
Augmentation: noise in half the utterances at 5 to 20 dB SNR; a simulated room in 20%; speed 0.88 to 1.12 (pitch and formants move with it) in 30%; a random low-pass (2.5 to 7 kHz) or high-pass (100 to 500 Hz) in 20%; driven 1.5 to 8 times past full scale and clipped in 10%; 5% non-speech items with empty targets for both heads.
Local tests, not a standard benchmark. Phrases are registered as text and spotted in continuous audio through vrc-WiredExpressions at its Balanced hop.
| Unit error, greedy CTC | Previous version (letters) | This model, letters | This model, phonemes |
|---|---|---|---|
| Accented English (VoxPopuli accented test, 898 clips, 15 accents, never trained on) | 15.4% | 13.9% | 14.3% |
| Native read English (FLEURS test) | 6.6% | 6.4% | 3.9% |
| Spotting | Letter head alone | Both heads |
|---|---|---|
| Hits, FLEURS four ways, AMI and MSWC, at 0.032% false positives (the letter head's thresholds) | 85.6% | 86.8% |
| Hits at 0.02% / 0.05% / 0.1% false positives, one cut fitted per budget | 74.4 / 86.1 / 87.4 | 80.1 / 87.1 / 88.8 |
| Unseen synthetic voices through a headset: hits / near-miss false fires | 85.7% / 5.8% | 87.5% / 5.2% |
| Non-speech: music, noise and vocal sounds (434 phrases registered), FSD50K evaluation human and other sounds (138), 6.1 h: false fires | 1 | 1 |
The previous version also fired once on the non-speech streams, on the same vocal sound. The fused gains at every budget are significant in a paired bootstrap over clips (+5.3, +1.1, +1.5 points; 95% intervals above zero).
| Stage | Outcome |
|---|---|
| Full depth, 30,000 steps, 1e-5 and lower | kept |
| Pruned to 16 layers, 15,000 steps, 3e-5 | kept: previous version |
| Continued on Common Voice with non-native speakers weighted 1× and 3×, 4,000 steps, 1e-5 | rejected: accented English 18.6% and 17.9% |
| Phoneme head added, all 16 layers, 10,000 steps, 3e-5, the full mix with FSD50K and rooms | kept |
| 24 layers from the base, a new letter head, 15,000 + 15,000 steps | rejected: held-out letter error 17.1%, did not converge |
| Speed, clipping and filter augmentation, 10,000 steps, 3e-5 | kept: this model |
| The same with the phoneme loss taking the best of each word's CMUdict variants | rejected: accented English +0.33 letters, +0.73 phonemes |
model.onnx, fx.onnx, enc.onnx, vocab.json, phonemes.json, config.json and voice.json: Apache 2.0, as the base models. Dataset licences are listed above.
lexicon.tsv: derived from the CMU Pronouncing Dictionary, under its licence, reproduced in lexicon-LICENSE.txt: Copyright (C) 1993-2015 Carnegie Mellon University. All rights reserved. Changed: ARPAbet written as IPA, stress removed, only each word's first pronunciation.
pron.tsv: CC BY 4.0. Its words come from Common Voice 19.0 (CC0 1.0) and the Multilingual Spoken Words Corpus (CC BY 4.0); its sounds from CharsiuG2P (MIT, Zhu, Zhang and Jurgens 2022) through klebster's ONNX export (CC BY 4.0).
g2p-encoder.onnx, g2p-decoder.onnx: CC BY 4.0, as klebster's ONNX export of CharsiuG2P (MIT, Copyright (c) 2022 jzhu), which they are; changed: int8 dynamic quantization of the weights.
model.onnx 254 MBenc.onnx 237 MBfx.onnx 17 MBg2p-encoder.onnx 15 MBg2p-decoder.onnx 7 MBjonatasgrosman/wav2vec2-large-xlsr-53-english