cs-kws-eval
An Anchor-Free Detector for Continuous Speech Keyword Spotting — Zhao et al. (2022) (arXiv:2208.04622, 2022)
What this evaluates
Evaluates a model's ability to detect and localize multiple spoken keywords within continuous, untrimmed audio streams, distinguishing target keywords from background speech and silence.
Datasets
- LibriTop-20 — total ?; splits: train (-1), test (-1)
- CMAK-7 — total ?; splits: train (-1), test (-1)
Metrics
1D AP — range: [0, 1]
- Average precision computed over the recall-precision curve using 1D Intersection over Union (IoU) between predicted and ground-truth keyword time intervals.
mAP (primary) — range: [0, 1]
- Mean average precision computed by averaging AP across all keyword classes, evaluated over IoU thresholds from 0.05 to 0.95 in steps of 0.05.
FRR — range: [0, 1]
- False Rejection Rate, measuring the proportion of ground-truth keywords that are missed by the detector at specified IoU thresholds (e.g., FRR@5, FRR@25).
Input / output format
Input: Fixed-length 1D audio segments or spectrograms (STFT). Shorter inputs are repeatedly padded; longer inputs are randomly cropped during training.
Output: Predicted keyword class, center location, and length (or start/end time) for each detected keyword instance.
Scoring recipe
def compute_mAP(preds, golds, iou_range=np.arange(0.05, 0.96, 0.05)):
aps = []
for cls in classes:
cls_preds = [p for p in preds if p['class'] == cls]
cls_golds = [g for g in golds if g['class'] == cls]
tp, fp = [], []
for pred in cls_preds:
best_iou = max(iou_1d(pred, g) for g in cls_golds)
if best_iou >= 0.05:
tp.append(best_iou)
else:
fp.append(0)
ap = compute_ap_from_tp_fp(tp, fp)
aps.append(ap)
return np.mean(aps)
def iou_1d(pred, gt):
inter = max(0, min(pred.end, gt.end) - max(pred.start, gt.start))
union = (pred.end - pred.start) + (gt.end - gt.start) - inter
return inter / union if union > 0 else 0
Common pitfalls
- Uses IoU range [0.05, 0.95] instead of the standard [0.5, 0.95] used in visual detection, reflecting higher temporal tolerance in speech.
- Requires an auxiliary 'unknown' class to filter out interfering words and silence; omitting it significantly degrades performance.
- Sliding-window classifiers adapted for this task suffer from low temporal resolution compared to anchor-free regression, leading to artificially low AP scores.
Evidence (verbatim from paper)
CSKWS can borrow the evaluation metrics from these related tasks. However, there are more keywords in CSKWS and they appear more frequently than in trigger words detection. Besides, CSKWS is essentially a detection task instead of classification task, so we propose to evaluate its solutions with object detection metrics known as 1D AP(average precision) and mAP (mean average precision). 1D IoU (Intersection over Union) is computed for each detection result with respect to the groundtruth, and mAP is computed in an IoU range of (0.05,0.95) by step 0.05.
Citation
@misc{zhao2022anchorfree,
title={An Anchor-Free Detector for Continuous Speech Keyword Spotting},
author={Zhao et al. (2022)},
year={2022},
note={arXiv:2208.04622}
}
1---2name: cs-kws-eval3description: Evaluates a model's ability to detect and localize multiple spoken keywords within continuous, untrimmed audio streams, distinguishing target keywords from background speech and silence. Use when the user wants to benchmark on LibriTop-20, CMAK-7, or asks about evaluating this task. Reports mAP.4metadata:5 source: https://skillmd.com/skills/qhjqhj00/cs-kws-eval6 skill_kind: dataset_eval7 source_arxiv: 2208.046228 bibtex_key: zhao2022anchorfree9 confidence: high10---1112# cs-kws-eval1314> An Anchor-Free Detector for Continuous Speech Keyword Spotting — Zhao et al. (2022) (arXiv:2208.04622, 2022)1516## What this evaluates1718Evaluates a model's ability to detect and localize multiple spoken keywords within continuous, untrimmed audio streams, distinguishing target keywords from background speech and silence.1920## Datasets2122- **LibriTop-20** — total ?; splits: train (-1), test (-1)23- **CMAK-7** — total ?; splits: train (-1), test (-1)2425## Metrics2627- `1D AP` — range: [0, 1]28 - Average precision computed over the recall-precision curve using 1D Intersection over Union (IoU) between predicted and ground-truth keyword time intervals.29- `mAP` **(primary)** — range: [0, 1]30 - Mean average precision computed by averaging AP across all keyword classes, evaluated over IoU thresholds from 0.05 to 0.95 in steps of 0.05.31- `FRR` — range: [0, 1]32 - False Rejection Rate, measuring the proportion of ground-truth keywords that are missed by the detector at specified IoU thresholds (e.g., FRR@5, FRR@25).3334## Input / output format3536**Input**: Fixed-length 1D audio segments or spectrograms (STFT). Shorter inputs are repeatedly padded; longer inputs are randomly cropped during training.3738**Output**: Predicted keyword class, center location, and length (or start/end time) for each detected keyword instance.3940## Scoring recipe4142```python43def compute_mAP(preds, golds, iou_range=np.arange(0.05, 0.96, 0.05)):44 aps = []45 for cls in classes:46 cls_preds = [p for p in preds if p['class'] == cls]47 cls_golds = [g for g in golds if g['class'] == cls]48 tp, fp = [], []49 for pred in cls_preds:50 best_iou = max(iou_1d(pred, g) for g in cls_golds)51 if best_iou >= 0.05:52 tp.append(best_iou)53 else:54 fp.append(0)55 ap = compute_ap_from_tp_fp(tp, fp)56 aps.append(ap)57 return np.mean(aps)5859def iou_1d(pred, gt):60 inter = max(0, min(pred.end, gt.end) - max(pred.start, gt.start))61 union = (pred.end - pred.start) + (gt.end - gt.start) - inter62 return inter / union if union > 0 else 063```6465## Common pitfalls6667- Uses IoU range [0.05, 0.95] instead of the standard [0.5, 0.95] used in visual detection, reflecting higher temporal tolerance in speech.68- Requires an auxiliary 'unknown' class to filter out interfering words and silence; omitting it significantly degrades performance.69- Sliding-window classifiers adapted for this task suffer from low temporal resolution compared to anchor-free regression, leading to artificially low AP scores.7071## Evidence (verbatim from paper)7273> CSKWS can borrow the evaluation metrics from these related tasks. However, there are more keywords in CSKWS and they appear more frequently than in trigger words detection. Besides, CSKWS is essentially a detection task instead of classification task, so we propose to evaluate its solutions with object detection metrics known as 1D AP(average precision) and mAP (mean average precision). 1D IoU (Intersection over Union) is computed for each detection result with respect to the groundtruth, and mAP is computed in an IoU range of (0.05,0.95) by step 0.05.7475## Citation7677```bibtex78@misc{zhao2022anchorfree,79 title={An Anchor-Free Detector for Continuous Speech Keyword Spotting},80 author={Zhao et al. (2022)},81 year={2022},82 note={arXiv:2208.04622}83}84```8586- arXiv: 2208.04622