Sound event detection metrics

Score event, segment, frame, PSDS, piPSDS, Brier and streaming metrics from Python or Rust. Delay a detector below and watch them disagree.

One mistake, six scores

Pick a mistake to see its event F1, segment, frame and PSDS scores against the same three events. Red marks the share of a score that was lost. Compare all nine

One event split

Speech arrives as two pieces with a 0.5 s hole.

Metrics for every output

Metric formulas

Red terms lower the score. Each metric page gives the full definition, and the PSDS formulas are checked against the library for every PSDS figure.

from sedmetrics import SEDMetrics

result = SEDMetrics.eval(
    references=[(0, 0, 0.0, 1.0)],
    predictions=[(0, 0, 0.05, 1.0)],
)
print(result.f1, result.n_correct)

Read the PSDS definition

Event and segment F1
\[F_1 = \frac{2\,TP}{2\,TP + \cost{FP + FN}}\]
Segment error rate
\[ER = \frac{\cost{S + D + I}}{N_{\text{ref}}}\]
PSDS, per false-positive rate
\[\tilde{r} = \max(0,\, \mu - \cost{\alpha_{\text{ST}}\,\sigma})\]
Area under deadline recall
\[\frac{1}{N} \sum_{i=1}^{N} \max\Bigl(0,\, 1 - \cost{\frac{d_i}{H}}\Bigr)\]
Brier score, lower is better
\[\frac{\sum_i w_i\,\cost{(p_i - y_i)^2}}{\sum_i w_i}\]

Questions about scope

Read the guide to choosing metrics

Does SEDMetrics train or run a model?

No. It scores outputs you already have: events, score tracks, probabilities or alert logs.

Which reference implementations is it tested against?

Selected fixtures match sed_eval 0.2.1, sed_scores_eval 0.0.4 and scikit-learn. There is no parity evidence for psds_eval.

Are the streaming metrics stable?

No. They are experimental, accept CREATE alerts only and have not been validated on real detector traces.

What happens to undefined values?

An undefined ratio is returned as None, never as NaN or a silent zero.

Which platforms are tested?

macOS arm64 and Linux x86_64 are the first tier. CI also runs a Windows job. Python 3.10 to 3.13 are supported.