Skip to content
ModelListedExternal
Download

Bargein Classifier

Open-source barge-in detection for voice agents. Classifies whether a user is interrupting (barge-in) or just backchanneling ("uh-huh", "yeah") during an agent's turn.

KindOtherVersionRevision c9a3422Cgrade

Model source

Kind
Other
File size
365 KB
Version
vRevision c9a3422
Updated
Sep 26, 2026
Downloads
0
Source
Hugging Face

Source description

bargein-classifier

Open-source barge-in detection for voice agents. Classifies whether a user is interrupting (barge-in) or just backchanneling ("uh-huh", "yeah") during an agent's turn.

Designed as a self-hosted alternative to proprietary adaptive interruption handling.

Overview

Architecture2D CNN on log-mel spectrograms
Model size373 KB (ONNX)
Input2s window, 16 kHz mono PCM
Inference~5 ms CPU (ONNX Runtime)
Streaming100 ms hop, sliding window
Training dataAMI + ICSI meeting corpora (CC BY 4.0)

How It Works

Place downstream of VAD in a voice pipeline. When the user speaks while the agent is talking:

  1. VAD detects speech overlap
  2. This model scores the user's audio
  3. High probability = barge-in, agent should yield
  4. Low probability = backchannel or noise, agent keeps speaking

The model expects the user's audio in isolation (after echo cancellation), not a mixed signal.

Performance

Detection accuracy

MetricValue
PR-AUC0.912
Precision @ 95% recall0.772
Majority baseline0.709

Hard negative rejection

SoundFalse positive rate
Laugh13%
Cough22%
Throat clear18%
Breath-laugh8%

Cross-corpus generalization (AMI-only variant)

Eval setPR-AUCPrecision @ 95% recall
AMI (same-corpus)0.9720.909
ICSI (cross-corpus)0.9790.894

Quickstart

ONNX Runtime

import numpy as np
import onnxruntime as ort

session = ort.InferenceSession("bargein.onnx", providers=["CPUExecutionProvider"])
meta = np.load("bargein.onnx.meta.npz", allow_pickle=True)
threshold = float(meta["threshold"][0])

# features: (1, 1, 64, 200) log-mel spectrogram from 2s of 16kHz audio
logits = session.run(None, {"input": features})[0]
prob = 1.0 / (1.0 + np.exp(-logits[0]))
is_bargein = prob >= threshold

HTTP Server

BARGEIN_MODEL_PATH=bargein.onnx uvicorn server.app:app --host 0.0.0.0 --port 8080
curl -X POST http://localhost:8080/bargein --data-binary @audio.raw
# {"is_bargein": true, "probability": 0.87, "threshold": 0.339, "prediction_duration_ms": 4.8}

Deployment

RequirementSpecification
RuntimeCPU-only (ONNX Runtime)
RAM< 100 MB
GPUNot required
Dependenciesonnxruntime, numpy

Training Data

~55K labeled events from two meeting corpora:

  • AMI (138 meetings, ~29K events) — dialog-act annotations as weak supervision
  • ICSI (75 meetings, ~26K events) — MRDA dialog-act tags
  • Hard negatives (~5K) — laugh, cough, throat clear, breath sounds

Audio source: individual per-speaker headset channels, analogous to a user's microphone with echo cancellation.

Labels are weak supervision from dialog-act ontologies, not human-audited barge-in judgments.

Limitations

  • English only — trained on English meeting corpora
  • Domain gap — trained on meeting audio, not voice agent audio. Deploy in shadow mode first to validate on your traffic.
  • Single-speaker input — expects isolated user audio (with echo cancellation). Performance degrades on mixed/summed channels.
  • Weak labels — there is a label noise ceiling from the dialog-act proxy. Human-audited fine-tuning would improve quality.

Training Configuration

ParameterValue
FrameworkPyTorch, exported to ONNX
OptimizerAdam, lr=0.003
Batch size32
Epochs20 (early stopping, patience=5)
Features64-band log-mel, 512 FFT, 160 hop
ThresholdRecall-constrained sweep (recall >= 95%)

Author

Borislav Novikov (bnovkov012@gmail.com)

Citation

@software{novikov2026bargein,
  title={bargein-classifier: Open-source barge-in detection for voice agents},
  author={Novikov, Borislav},
  year={2026},
  url={https://huggingface.co/bnovikov/bargein-classifier}
}

Training data

@article{carletta2005ami,
  title={The AMI meeting corpus: A pre-announcement},
  author={Carletta, Jean},
  journal={Machine Learning for Multimodal Interaction},
  year={2005}
}

@inproceedings{janin2003icsi,
  title={The ICSI meeting corpus},
  author={Janin, Adam and Baron, Don and Edwards, Jane and Ellis, Dan and Gelbart, David and Morgan, Nelson and Peskin, Barbara and Pfau, Thilo and Shriberg, Elizabeth and Stolcke, Andreas and Wooters, Chuck},
  booktitle={ICASSP},
  year={2003}
}

License

Model weights: CC BY 4.0 (same as training data).

Sources

1 source
Hugging FacePrimaryVersion c9a3422bdca205d0e49a9d1b3faf0ef9dd80b0b7
huggingface.co/bnovikov/bargein-classifier/tree/c9a3422bdca205d0e49a9d1b3faf0ef9dd80b0b7

Verified Aug 29

Model artifacts

1 artifact

bargein.onnx

onnx · 365 KB · SHA-256 67fb7241ff62…b920 · Hugging Face

Download file

Source excerpts

2 excerpts

--- library_name: onnxruntime pipeline_tag: audio-classification tags: - voice-agents - barge-in - backchannel - turn-taking - onnx - real-time language: - en license: cc-by-4.0 --- # bargein-classifier Open-source barge-in detection for voice agents. Classifies whether a user is **interrupting** (barge-in) or just **backchanneling** ("uh-huh", "yeah") during an agent's turn. Designed as a self-hosted alternative to proprietary adaptive interruption handling. ## Overview | | | |---|---| | Architecture | 2D CNN on log-mel spectrograms | | Model size | 373 KB (ONNX) | | Input | 2s window, 16 kHz mono PCM | | Inference | ~5 ms CPU (ONNX Runtime) | | Streaming | 100 ms hop, sliding window | | Training data | AMI + ICSI meeting corpora (CC BY 4.0) | ## How It Works Place downstream of VAD in a voice pipeline. When the user speaks while the agent is talking: 1. VAD detects speech overlap 2. This model scores the user's audio 3. **High probability** = barge-in, agent should yield 4. **Low probability** = backchannel or noise, agent keeps speaking The model expects the **user's audio in isolation** (after echo cancellation), not a mixed signal. ## Performance ### Detection accuracy | Metric | Value | |---|---| | PR-AUC | 0.912 | | Precision @ 95% recall | 0.772 | | Majority baseline | 0.709 | ### Hard negative rejection | Sound | False positive rate | |---|---| | Laugh | 13% | | Cough | 22% | | Throat clear | 18% | | Breath-laugh | 8% | ### Cross-corpus generalization (AMI-only variant) | Eval set | PR-AUC | Precision @ 95% recall | |---|---|---| | AMI (same-corpus) | 0.972 | 0.909 | | ICSI (cross-corpus) | 0.979 | 0.894 | ## Quickstart ### ONNX Runtime ```python import numpy as np import onnxruntime as ort session = ort.InferenceSession("bargein.onnx", providers=["CPUExecutionProvider"]) meta = np.load("bargein.onnx.meta.npz", allow_pickle=True) threshold = float(meta["threshold"][0]) # features: (1, 1, 64, 200) log-mel spectrogram from 2s of 16kHz audio logits = session.run(None, {"input": features})[0] prob = 1.0 / (1.0 + np.exp(-logits[0])) is_bargein = prob >= threshold ``` ### HTTP Server ```bash BARGEIN_MODEL_PATH=bargein.onnx uvicorn server.app:app --host 0.0.0.0 --port 8080 ``` ```bash curl -X POST http://localhost:8080/bargein --data-binary @audio.raw # {"is_bargein": true, "probability": 0.87, "threshold": 0.339, "predict...

Source context: 0 downloads · 4 likes · Pipeline audio-classification · Library onnxruntime · Repo bnovikov/bargein-classifier