How metrics penalise mistakes¶
The same mistake can cost everything under one metric and nothing under another. Each row below is one detector output, scored by the library against the same three reference events. Deeper red means more of the score is lost. Select a row to see the events.
| Mistake | Event F1 | Segment F1 | Segment ER | Frame F1 | PSDS1 | PSDS2 |
|---|---|---|---|---|---|---|
| Exact | 1.00 | 1.00 | 0.00 | 1.00 | 1.00 | 1.00 |
| Onsets 0.15 s late | 1.00 | 1.00 | 0.00 | 0.97 | 1.00 | 1.00 |
| Onsets 0.4 s late | 0.00 | 1.00 | 0.00 | 0.92 | 1.00 | 1.00 |
| One offset 1.5 s long | 0.67 | 0.89 | 0.25 | 0.91 | 1.00 | 1.00 |
| One event split | 0.57 | 1.00 | 0.00 | 0.97 | 1.00 | 1.00 |
| Two events merged | 0.40 | 0.94 | 0.12 | 0.94 | 1.00 | 1.00 |
| One false alarm | 0.86 | 0.94 | 0.12 | 0.97 | 0.94 | 0.94 |
| One event missed | 0.80 | 0.86 | 0.25 | 0.86 | 0.50 | 0.50 |
| Wrong class | 0.67 | 0.50 | 0.50 | 0.50 | 0.00 | 0.00 |
What the table shows¶
- Onsets 0.4 s late take event F1 to zero. Segment F1, the segment error rate and both PSDS profiles do not move.
- Splitting one event costs event F1 heavily. Segment metrics do not see the 0.5 s hole, because every 1 s segment it touches still holds some detection.
- Merging two events costs event F1 more than any other metric here. Both PSDS profiles accept the merged detection, since 80% of it lies on the references.
- A missed event halves PSDS1 and PSDS2. One class drops to half its recall, and the spread between classes is subtracted from the mean.
- A wrong class takes both PSDS profiles to zero. PSDS2 also charges a cross-trigger on top of the false positive.
These results hold for this example only. Collars, segment length, thresholds and the amount of audio all move the numbers.
Setup¶
| Setting | Value |
|---|---|
| References | Two siren events (2 to 4 s, 5 to 7 s) and one speech event (10 to 14 s) |
| Clip | 20 s, within 600 s of audio split into 20 s recordings |
| Event F1 | 0.2 s collars, offset ratio 0.2, micro average |
| Segment metrics | 1 s segments, micro average |
| Frame F1 | 0.05 s frames, scores of 0 or 1, threshold 0.5, micro average |
| PSDS | PSDS1 and PSDS2 profiles on the same binary scores |
Binary scores give PSDS only one operating point besides the trivial ones. With real score curves it integrates over many; see PSDS.
Per-metric detail¶
| Metric | Page |
|---|---|
| Collars and matching | Event F1 |
| Segments and S/D/I | Segment metrics |
| Thresholds and ranking | Frame labels |
| Late score curves | Frame events |
| Intersection criteria | PSDS |
| Choice of post-processing | piPSDS |
| Confidence | Brier score |
| Alert delay | Streaming protocol |
Common questions¶
Which metric is strictest about timing?¶
In this comparison, event F1. Onsets 0.4 s late take it to zero while segment F1 and both PSDS profiles stay at 1.
Why can PSDS ignore a late onset?¶
PSDS asks how much of a detection and a reference overlap. A short delay leaves the overlap above its threshold.