Downloads · 30 days
0
bnovikov/bargein-classifier
bargein-classifier is a audio classification model from bnovikov. Use it for the audio classification task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as cc-by-4.0.
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.
Downloads · 30 days
0
Access
Public
Updated Apr 11, 2026
Repo size
920 KB
Likes
5
Public
Click a slice to open those files.
.onnx373 KB · 80%
From the Hugging Face model README
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.
| 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) |
Place downstream of VAD in a voice pipeline. When the user speaks while the agent is talking:
The model expects the user's audio in isolation (after echo cancellation), not a mixed signal.
| Metric | Value |
|---|---|
| PR-AUC | 0.912 |
| Precision @ 95% recall | 0.772 |
| Majority baseline | 0.709 |
| Sound | False positive rate |
|---|---|
| Laugh | 13% |
| Cough | 22% |
| Throat clear | 18% |
| Breath-laugh | 8% |
| Eval set | PR-AUC | Precision @ 95% recall |
|---|---|---|
| AMI (same-corpus) | 0.972 | 0.909 |
| ICSI (cross-corpus) | 0.979 | 0.894 |
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
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}
| Requirement | Specification |
|---|---|
| Runtime | CPU-only (ONNX Runtime) |
| RAM | < 100 MB |
| GPU | Not required |
| Dependencies | onnxruntime, numpy |
~55K labeled events from two meeting corpora:
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.
| Parameter | Value |
|---|---|
| Framework | PyTorch, exported to ONNX |
| Optimizer | Adam, lr=0.003 |
| Batch size | 32 |
| Epochs | 20 (early stopping, patience=5) |
| Features | 64-band log-mel, 512 FFT, 160 hop |
| Threshold | Recall-constrained sweep (recall >= 95%) |
Borislav Novikov ([email protected])
@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}
}
@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}
}
Model weights: CC BY 4.0 (same as training data).