--- license: cc-by-nc-4.0 language: - en pipeline_tag: audio-classification tags: - audio - telephony - answering-machine-detection - voicemail-detection - yamnet - gru - 8khz - vicidial - asterisk --- # AMD — Answering Machine Detection for telephony (YAMNet + GRU) Real-time answering-machine detection for 8 kHz US-English telephony (VICIdial / Asterisk outbound campaigns). A pure-PyTorch YAMNet backbone (fine-tuned, top-2 blocks) feeds a bidirectional GRU head; output is `p_machine ∈ [0,1]`. **~16 ms inference per 4 s of audio on a single CPU thread** — fast enough to decide inside the first ring seconds. Two checkpoints: | checkpoint | training pool | how it was measured | |---|---|---| | **`v5b_full` (root)** | 50,876 clips — the full max-data pool (incl. real carrier voicemail, IVR, network intercepts, robocalls, call-center + conversational telephone speech) | validation (4,949 held-out clips) | | `benchmarked_v4a/` | 31,947 clips (frozen-eval-disjoint) | two frozen external test sets | ## Results `v5b_full` (validation, threshold 0.5): **97.7% accuracy**, machine recall **97.0%** under a ≤3% false-machine-on-humans cap, fmh 1.56%. On held-out clips of the hardest class — real carrier voicemail greetings — error is **13%**, versus 91% for a naive-composition baseline. `benchmarked_v4a` (frozen external sets, never trained on, one pass): 79.8% accuracy / balanced-acc .845 / AUC .935 on a 796-clip external set; 92.5% / .928 / .979 on a 1,429-clip balanced set; machine recall at the FTC-style ≤3% abandonment cap: 0.56–0.91. ## Usage ```bash pip install torch numpy soundfile scipy python code/predict_example.py your_call.wav ``` ```python import sys; sys.path.insert(0, "code") from predict_example import load, predict yamnet, head = load() p_machine = predict(yamnet, head, "call.wav") # 0..1 ``` Audio: any wav (resampled to 16 kHz mono internally; trained domain is 8 kHz G.711 telephony, first ≤10 s of the call). ## Intended use & limitations - **Research / evaluation only (CC BY-NC 4.0).** Trained on a mixed-license research pool; not cleared for commercial deployment. - US-English telephony. Non-English and non-telephone audio are out of domain. - Decision thresholds must be **calibrated on your own audio** — false-machine rates measured on any fixed test set do not transfer exactly to live traffic. - `v5b_full` has no fully-external benchmark (its pool absorbed the project's test sources — by design, for maximum coverage); `benchmarked_v4a` is the checkpoint with honest external numbers. Known weak spots: robocall recall (v5 val slice: 26% miss), heavily accented/studio-recorded humans. ## Architecture - Backbone: YAMNet (AudioSet), pure-PyTorch port, custom `torch.stft` mel frontend — no TensorFlow; top-2 blocks fine-tuned (BN frozen), bf16. - Head: bidirectional GRU over 1024-d patch embeddings (0.96 s window / 0.48 s hop), ~350k params, label smoothing 0.1. - Files: `*.yamnet.pth` (backbone, 15 MB) + `*.head.pt` (head + config, 1 MB) + `*.json` (export manifest with round-trip verification).