Downloads · 30 days
0
Teensy/teensy-vad-1
teensy-vad-1 is a voice activity detection model from Teensy. Use it for the voice activity detection task on the model card, and read the license before you ship it in a product. It is set up for teensyvad. The card lists the license as cc-by-nc-sa-4.0.
The first model of the teensyvad family: a complete voice activity detector in 20,449 parameters (87 KB), written in pure numpy with hand-written backprop — built to learn how VAD works and to run in an Asterisk telep…
Downloads · 30 days
0
Access
Public
Updated Aug 28, 2026
Repo size
1.1 MB
Likes
0
Public
Click a slice to open those files.
.npz988 KB · 82%
From the Hugging Face model README
The first model of the teensyvad family: a complete voice activity detector in 20,449 parameters (87 KB), written in pure numpy with hand-written backprop — built to learn how VAD works and to run in an Asterisk telephony stack.
Telephony-native: 8 kHz, 16-bit mono — exactly what a phone call is.
No resampling anywhere (PSTN / G.711 / Asterisk slin are all 8 kHz).
from teensyvad import OfflineVAD
# Standalone VAD — auto-downloads from the Hub (pip install huggingface_hub)
model = OfflineVAD("Teensy/teensy-vad-1")
result = model.segments("long_audio.wav")
# Returns speech segments: [[start_ms, end_ms], [start_ms, end_ms], ...]
print(result) # e.g. [[90, 5150]] — the fsmn-vad convention
Variant selection: OfflineVAD("Teensy/teensy-vad-1", model_file="teensy-v1-80k.npz")
(see the variant table below). Local use without the hub: pass a
.npz path. teensyvad is pure numpy (single package dir in the
project repo) — the only dependency.
from teensyvad import OfflineVAD
from teensyvad.audio import write_wav
vad = OfflineVAD("Teensy/teensy-vad-1")
segments = vad.segments("meeting_2hours.wav") # [[start_ms, end_ms], ...]
for i, (start_ms, end_ms) in enumerate(segments):
seg = vad.slice("meeting_2hours.wav", start_ms, end_ms) # float32 @ 8 kHz
write_wav(f"speech_{i}.wav", seg, 8000)
# text = my_asr.transcribe(f"speech_{i}.wav") # <- your ASR here
Streaming / telephony (Asterisk AudioSocket): from teensyvad import StreamingVAD — feed 20 ms PCM16LE frames, get speech_start /
speech_end events, vad.speech_seconds for talk time; a working
server ships as scripts/audiosocket_server.py in the project repo.
| Model | 3-layer MLP, 400 → 48 → 24 → 1 (ReLU, sigmoid head) |
| Parameters | 20,449 (87 KB float32) |
| Input | 10 frames × (20 log-mel + 20 Δ) = 400 dims (100 ms context) |
| Output | P(speech) per 10 ms frame |
| Framing | 25 ms window / 10 ms hop @ 8 kHz |
| Speed | ~14 µs/frame numpy single, 0.27 µs batched; 6.6 µs ONNX single |
log(mel + 1e-10), then subtract per-frame mean over bands
(gain invariance — the model sees spectral shape, not level).in_mean / in_std vectors stored in the .npz.| file | what |
|---|---|
teensy-v1.npz | float32 weights + norm stats + JSON metadata (thresholds, feature config) |
teensy-v1.onnx | same model as ONNX (input normalisation folded in; raw 400-d features in, logit out) |
teensy-v1-int8.onnx | dynamic int8 ONNX (22 KB) |
Minimal numpy inference:
import numpy as np, json
z = np.load("teensy-v1.npz")
meta = json.loads(str(z["meta"])) # thresholds + feature config
def score(x): # x: standardised 400-dim window
h1 = np.maximum(x @ z["p/W1"] + z["p/b1"], 0)
h2 = np.maximum(h1 @ z["p/W2"] + z["p/b2"], 0)
return 1 / (1 + np.exp(-(h2 @ z["p/W3"] + z["p/b3"]))) # P(speech)
For streaming (chunk-in → speech_start/speech_end events out, with
hysteresis + hangover) use the teensyvad source that accompanies this
model family.
dev-clean (1,200 utterances, speaker-disjoint splits)| benchmark | frame F1 | AUC |
|---|---|---|
| synthetic test (unseen speakers, unseen noise) | 0.903 | 0.889 |
| event-level streaming (120 clips) | 0.976 | — |
| TEN VAD public set (real recordings) | 0.850 | 0.848 |
| AMI SDM meetings (real rooms, manual labels) | 0.743 | 0.835 |
The energy-baseline comparison that motivated this model: on the same streamed clips an adaptive energy VAD reaches event F1 0.535 (2.5× over-triggering) vs 0.976 here.
teensy-vad-3 for those).teensy-vad-2 fixes
this via distillation.All variants share the architecture and training recipe of this card — they differ only in hidden-layer size (88/48, 164/88, 200/96) and were trained to map the capacity/accuracy trade-off:
| name | file | params | KB | role |
|---|---|---|---|---|
| teensy-v1 | teensy-v1.npz | 20,449 | 87 | the original — family sweet spot |
| teensy-v1-40k | teensy-v1-40k.npz | 39,609 | 162 | capacity probe |
| teensy-v1-80k | teensy-v1-80k.npz | 80,373 | 321 | capacity probe (family's best AUCs) |
| teensy-v1-100k | teensy-v1-100k.npz | 99,593 | 396 | capacity probe |
ONNX exports (float32 + dynamic int8) are provided for the 20k model.

(Measured on the shared protocol — TEN VAD public set + AMI SDM meetings, human labels, AMI-dev-calibrated operating points, AUC on raw probabilities; see BENCHMARKS.md. Note accuracy is flat across sizes: the 1M-frame training set saturates first — scaling capacity without scaling data buys nothing here.)
Same protocol for every system, human-labelled real audio, operating points calibrated on held-out AMI dev meetings (full appendix with charts and per-size results: teensy-vad-3/BENCHMARKS.md):
| teensy-v1 | Silero VAD | WebRTC VAD | Energy VAD | |
|---|---|---|---|---|
| params | 20,449 | 1,774,000 | ~6k (C) | — |
| TEN VAD set — AUC | 0.848 | 0.952 | n/a | 0.670 |
| AMI SDM — F1 (calibrated) | 0.887 | 0.714 | 0.842 | 0.592 |
| AMI SDM — AUC | 0.835 | 0.894 | 0.760 | 0.658 |
| µs / 20 ms chunk | 63 | 89 | 2 | 7 |
Capacity note: this family was also trained at 40k/80k/100k params
(files teensy-v1-{40k,80k,100k}.npz) — accuracy is flat across
sizes because the 1M-frame training set saturates first; more parameters
need more data (demonstrated by the v3 family). Silero ranks best by AUC
(87× larger); its stock threshold misses 44 % of room speech — every
calibrated teensy model beats it on AMI F1.
Code: MIT. Weights: CC BY-NC-SA 4.0 (training noise ESC-50 is CC BY-NC-SA 3.0; speech LibriSpeech CC BY 4.0). Not for commercial deployment without replacing the ESC-50-derived training data.