espnet/frontia_vad_v2_3: voice activity detection, dual-mode
A single dual-mode TCN that serves both modes, unlike frontia_vad_v1_*, which
shipped one model per mode:
| mode | look-ahead | use |
|---|---|---|
| online | 0 — every frame is decided from the audio up to it | live streams and the microphone |
| offline | 124 frames (0.99 s) | whole recordings, cleaning a corpus |
Each 8 ms frame (16 kHz, 512-point STFT without centring, 128-sample hop, 40 mel
channels) gets the probability that someone is speaking. Trained as one-speaker
diarization (diar1, num_spk 1): every speaker of a recording merged into one
"speech" label.
Encoder: TCN, 5 blocks x 2 repeats, bottleneck 64, hidden 128, output 128, kernel 3,
cumulative layer normalisation, future_taps 2, trained at look_aheads: [0, 124].
Global MVN, linear decoder.
Use
from espnet2.bin.diar_inference import DiarizeSpeech
vad = DiarizeSpeech.from_pretrained(
model_tag="espnet/frontia_vad_v2_3", num_spk=1,
)
DiarizeSpeech returns the per-frame speech probability; apply the decision rule below
yourself. Once espnet/espnet#7041 is
merged (master first, then the next release), VoiceActivityDetector.for_mode, the
espnet detect CLI and the MCP tool detect load this model for both modes and
apply the rule; detect then runs at look-ahead 0 for for_mode("online") and 124
for for_mode("offline"):
from espnet2.bin.diar_inference import VoiceActivityDetector
vad = VoiceActivityDetector.for_mode("offline") # or "online"
for seg in vad.detect_file("meeting.wav"):
print(f"{seg.start:.2f}\t{seg.end:.2f}")
Decision rule
A frame is speech when its probability exceeds the threshold; a centred median
filter then smooths the 0/1 sequence. The threshold was tuned on ami_mh_dev_v1.
| mode | threshold | median filter |
|---|---|---|
| online | 0.6 | centred, 25 frames |
| offline | 0.6 | centred, 25 frames |
Both values can be changed (threshold=, median=; espnet detect --threshold --median). Offline, median 25 replaces the median 1 this card gave before: on the
23 sets below it scores better (macro DetER 9.79 against 9.90) and leaves no
one-frame segments at speech edges.
The default online decision is not strictly causal. The model reads no future
audio, but the centred median waits for the 12 frames after each frame. With
median 1 the online decision reads no future frame.
Latency, online: frame i covers samples [128 i, 128 i + 512), so its probability is
ready 32 ms after the frame starts; a centred median of 25 frames then needs the 12
frames after it, i.e. a further 96 ms. About 128 ms in total, of which the smoothing
rule is three quarters — with median 1 the decision is final as soon as the
probability is. Offline adds the look-ahead: 124 frames (992 ms) + 96 ms.
Results
Macro averages over 23 sets (the 21 sets frontia_vad_v1 was evaluated on, LibriCSS
and AISHELL-5 eval), each set counted once: detection error rate (DetER, md-eval
over whole recordings, collar 0) and frame equal error rate (EER). Frame i is dated
at the end of its window. The DetER threshold of each row is the one with the
lowest error on ami_mh_dev_v1; EER needs no threshold.
| mode | median | threshold | macro DetER (%) | macro frame EER (%) |
|---|---|---|---|---|
| online (look-ahead 0) | 1 | 0.5 | 11.77 | 14.84 |
| online (look-ahead 0) | 25 | 0.6 | 11.57 | 14.29 |
| offline (look-ahead 124) | 1 | 0.6 | 9.90 | 12.49 |
| offline (look-ahead 124) | 25 | 0.6 | 9.79 | 12.37 |
For comparison, espnet/frontia_vad_v1_offline (look-ahead 124, threshold 0.8)
scores macro DetER 11.02 and EER 12.99 at median 1, and 10.97 and 12.94 at its own
median 11, on the same sets with the same scorer.
Training
ESPnet 202609.post1, PyTorch 2.11.0, config train_dualmode_v2_3_lr1e-3.yaml,
valid.acc average of the 2 best checkpoints.