At a glance
| Hugging Face model |
pipecat-ai/backchannel-detector
(revision 4896f477 · 734K params · causal 80-mel + dilated Conv1D encoder
[1, 2, 4, 8], d_model: 128 → 2-layer GRU hidden: 192 +
8-dim bot_state)
|
|---|---|
| Task & runtime |
audio-classification · onnxruntime-web via isolated
onnxruntime-web@1.21.0 worker · CPU wasm
|
| Browser artifact & dtype |
backchannel-fp32.onnx (fp32 · 3.87 MB = 3,869,783 B ·
catalogue 3.9 MB) · License: BSD-2-Clause (bsd-2-clause)
|
| Streaming I/O contract |
Inputs: chunk [1, 640] (40 ms @ 16 kHz mono), bot_state [1, 2, 8], + 7 causal
state caches · Outputs per 20 ms frame: intent [1, 2, 5] softmax
(continuer, assessment, negative, floor_take,
non_speech), auxiliary vad [1, 2], and 8-bin vap [1, 2, 8]
|
| Web APIs |
WebAssembly, Module Web Workers, Cache Storage, Web Audio / OfflineAudioContext,
MediaRecorder (optional mic), Canvas 2D — all Baseline widely available
|
Why backchannel-fp32.onnx (3.87 MB) instead of backchannel-int8.onnx (2.33 MB):
The Hub repo's INT8 graph emits a ConvInteger(10) node (/Conv_quant) that
onnxruntime-web@1.21.0 WASM EP does not implement. The full fp32 artifact is only
3.87 MB, initializes in milliseconds, and streams 40 ms chunks at ~80× real time on CPU WASM with zero quantization drift.
Honest model scope (from HF model card): Trained on English full-duplex human conversations
(Open Yap 1K + otoSpeech-full-duplex-280h). Decision grouping follows the model card directly:
p(backchannel) = continuer + assessment and p(floor) = negative + floor_take.
1 · Live Streaming Turn-Taking Classifier
Reuses ledgered repository fixtures only (zero duplicate binary audio committed): LibriSpeech
test-clean 61-70968-0000 (Paul-Gabriel Wiener,
CC BY 4.0 ·
credits) and JFK inaugural
address (20 Jan 1961, public domain, via models/whisper-speech-to-text/jfk.wav), plus deterministic
in-memory JS PCM probes, local file drop/upload, and optional user-initiated mic recording.
Initialise Pipecat Backchannel Detector (3.87 MB fp32 WASM) above to run local 40 ms turn-taking classification.
Turn-taking verdict
Awaiting inference
Initialise the model to classify Backchannel vs Floor Barge-In vs Silence/Pause.
Active window peaks
p(Backchannel) – · p(Floor) – · VAD –
Events detected: –
Window-level 20 ms probability timeline
5-Class Streaming Intent Distribution
Run classification above to inspect all 5 intent heads.
2 · See inside: 5-class temporal strip, raw head logits & VAP projection
Every 40 ms chunk (640 samples) advances seven causal cache tensors (audio_cache,
stem_cache, four dilated conv blocks, and a 2-layer 192-unit gru_state) to emit
two 20 ms frames across three heads: 5-way intent softmax, auxiliary user vad,
and 8-bin Voice Activity Projection (vap) forecasting user vs. bot speech up to 2.0 s ahead.
5-head temporal activation strip
Raw head probabilities & log-odds logits (0 NaN check)
| Intent head | Turn group | Peak prob | Peak log-odds (logit) | Active-mean log-odds |
|---|---|---|---|---|
| Run inference above to inspect raw head probabilities and log-odds logits. | ||||
Raw tensor audit: awaiting live ONNX run…
Auxiliary VAP future activity projection (0–2.0 s lookahead)
Why Pipecat Backchannel Detector matters
Naive voice-agent barge-in cuts off the assistant the moment VAD hears any sound — even a polite "mm-hmm" or "right" meant to keep the bot talking. Waiting for a full ASR transcript adds 400–800 ms of awkward collision. Running a 3.87 MB causal GRU directly in the browser classifies conversational intent in ~0.5 ms per 40 ms frame with zero server round-trip.
- Full-duplex voice agents — keep TTS flowing through user continuers while halting in ~280 ms on real floor interruptions.
- Edge-first privacy — evaluate user mic frames locally on CPU WASM before streaming audio to cloud endpoints.
- Composable VAD gating — pair with 2.24 MB Silero VAD so turn-taking classification runs only on voiced turns (6.1 MB total).
3 · Use-case ladder
Basics · Threshold & Slice Duration Tuner
Compare short 350 ms acknowledgments against 1.8 s sustained turn grabs across decision thresholds to locate your clean separation band.
Practical · Call-Turn Event Logger Batch Queue
Queue multi-turn call slices with Pause, Resume, and Cancel mid-batch controls and export OWASP formula-safe CSV / JSON turn-taking traces.
Wild · Noise, Speed & Clip-Overlap Stress Suite
Quantify Backchannel vs Floor Barge-In decision flip rate across 5 acoustic degradations (babble noise, 1.30×/0.78× speed, -3 dB overlap, phone bandpass).
Multi-model · 6.1 MB Silero VAD → Pipecat Pipeline
Chain Stage 1 Silero VAD v5 (2.24 MB, MIT) speech-segment triggers directly into Stage 2 Pipecat Backchannel Detector (3.87 MB, BSD-2-Clause).
4 · How the streaming ONNX API works
import * as ort from "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.21.0/dist/ort.wasm.min.mjs";
const session = await ort.InferenceSession.create(modelBytes, {
executionProviders: ["wasm"],
});
// Feed 40 ms (640 samples @ 16 kHz) + [1, 2, 8] bot_state + 7 causal state tensors
const out = await session.run({ chunk, bot_state, ...states });
// out.intent [1, 2, 5] => [continuer, assessment, negative, floor_take, non_speech]
// p(backchannel) = continuer + assessment; p(floor) = negative + floor_take
Show the code · worker.js — analyzeStream() (40 ms streaming loop + 7 causal states + NaN audit)
Show the code · bc-core.mjs — buildBotStateTensorData() ([1, 2, 8] bot_state framing)
Show the code · bc-core.mjs — classifyTurnFrames() (3-way Backchannel / Floor Barge-In / Silence policy)
References
- Hugging Face model card: pipecat-ai/backchannel-detector (BSD-2-Clause)
- Pipecat VAP & Backchannel Detector source repository (pipecat-ai/pipecat-vap)
- Ekstedt & Skantze (Interspeech 2022) — Voice Activity Projection: Self-supervised Learning of Turn-taking Events
- Related built model: Silero VAD v5 (onnx-community/silero-vad, MIT)