AI Logic

Evaluation Metrics

Diarization Error Rate (DER)

Updated:

Computation of DER. The top shows the reference (speakers A and B) and the prediction (Speaker 1 and Speaker 2) for a 20-second two-person conversation as bands along a time axis, along with the per-second judgment (correct, false alarm, confusion, miss). The bottom left shows a table of the seconds in which each reference and predicted speaker spoke simultaneously, and the mapping that maximizes the total (A with Speaker 1, B with Speaker 2). The bottom right shows DER 29.4%: 1 second of false alarm, 2 seconds of miss, and 2 seconds of confusion divided by 17 seconds of reference speech

Background and Overview

DER (diarization error rate) is an evaluation metric for the task of estimating who spoke where in a recording (speaker diarization). After optimally mapping reference speakers to predicted speakers, it sums the durations of false alarms, missed speech, and speaker confusion and divides by the total reference speech time. Values closer to 0 are better, and it is usually written as a percentage.

DER=FA+MISS+CONFTOTAL\mathrm{DER} = \frac{\mathrm{FA} + \mathrm{MISS} + \mathrm{CONF}}{\mathrm{TOTAL}}
  • False alarm (FA): time during which the system outputs speech although no one is speaking
  • Missed speech (MISS): time during which the system outputs no speech although someone is speaking
  • Speaker confusion (CONF): time during which the system correctly detects speech but attributes it to the wrong speaker
  • TOTAL: the sum of the reference speech time of each speaker

In speaker diarization, the system does not know the speakers' names and assigns placeholder labels such as "Speaker 1" and "Speaker 2". DER therefore first maps reference speakers to predicted speakers one-to-one so as to maximize the total time they speak simultaneously, and only then counts errors.

DER was not proposed in a particular paper. It was introduced for the US NIST evaluation of speech transcription (Rich Transcription, RT-03S, 2003), and has since served as the main metric in later RT evaluations and in the DIHARD challenges.

Definition and Computation

In the NIST RT-09 evaluation plan (Section 6.1), DER is computed as follows.

  1. Split the recording at every point where a reference or predicted speaker starts or stops speaking, giving segments seg\mathrm{seg}. Within each segment, the set of active speakers does not change.
  2. Map reference speakers to predicted speakers one-to-one. The mapping chosen is the one that maximizes the total, over all speakers, of the time each reference speaker and its mapped predicted speaker speak simultaneously. Mapping is done per recording file. pyannote.metrics finds it with the Hungarian algorithm.
  3. For each segment, count the number of speakers active in the reference NRefN_{\mathrm{Ref}}, the number active in the prediction NSysN_{\mathrm{Sys}}, and the number of those for which mapped speakers agree NCorrectN_{\mathrm{Correct}}.
  4. Sum the error time, weighted by the segment duration dur\mathrm{dur}, and divide by the reference speech time.
DER=βˆ‘segdur(seg)(max⁑(NRef,NSys)βˆ’NCorrect)βˆ‘segdur(seg) NRef\mathrm{DER} = \frac{\sum_{\mathrm{seg}} \mathrm{dur}(\mathrm{seg}) \left( \max(N_{\mathrm{Ref}}, N_{\mathrm{Sys}}) - N_{\mathrm{Correct}} \right)}{\sum_{\mathrm{seg}} \mathrm{dur}(\mathrm{seg}) \, N_{\mathrm{Ref}}}

The numerator splits into three kinds of error. Confusion is durβ‹…(min⁑(NRef,NSys)βˆ’NCorrect)\mathrm{dur} \cdot (\min(N_{\mathrm{Ref}}, N_{\mathrm{Sys}}) - N_{\mathrm{Correct}}), missed speech is durβ‹…(NRefβˆ’NSys)\mathrm{dur} \cdot (N_{\mathrm{Ref}} - N_{\mathrm{Sys}}) in segments where NRef>NSysN_{\mathrm{Ref}} > N_{\mathrm{Sys}}, and false alarm is durβ‹…(NSysβˆ’NRef)\mathrm{dur} \cdot (N_{\mathrm{Sys}} - N_{\mathrm{Ref}}) in segments where NSys>NRefN_{\mathrm{Sys}} > N_{\mathrm{Ref}}. A single segment is never both a miss and a false alarm.

In the example in the figure at the top, reference speaker A and predicted Speaker 1 speak simultaneously for 9 seconds, and B and Speaker 2 for 4 seconds, so this pairing (13 seconds in total) is chosen. From 6 to 7 seconds, Speaker 1 is output although no one is speaking, giving 1 second of false alarm. From 12 to 14 seconds, B is speaking but the output is Speaker 1, which is mapped to A, giving 2 seconds of confusion. From 18 to 20 seconds, B's speech is not output, giving 2 seconds of miss. The reference speech totals 17 seconds (9 for A and 8 for B), so DER is (1+2+2)/17β‰ˆ29.4%(1 + 2 + 2) / 17 \approx 29.4\%.

In segments where two people speak at once (overlapping speech), time is counted once per speaker. For example, a segment where two people speak simultaneously for 1 second enters TOTAL as 2 seconds. If the system outputs only one speaker in this segment, at least 1 second becomes a miss. As a result, systems that cannot detect overlapping speech struggle to reduce DER on recordings with heavy overlap.

What It Measures and Its Limitations

DER measures the fraction of reference speech time that was not assigned to the correct speaker. False alarms and misses correspond to errors in deciding whether someone is speaking (speech activity detection), and confusion corresponds to errors in deciding who is speaking (how speakers are grouped), so the breakdown shows which part is weak.

It has the following limitations.

  • Speakers who talk longer dominate the score: because errors are weighted by time, merging a speaker who barely talks entirely into another speaker hardly increases DER. The DIHARD III evaluation plan also uses JER (Jaccard error rate), which averages per-speaker errors so that every speaker counts equally regardless of how much they talk.
  • It can exceed 100%: the denominator is only the reference speech time, and false alarms have no upper bound. The pyannote.metrics documentation notes that DER can easily exceed 500%.
  • Scores change greatly with evaluation conditions: whether time around boundaries is excluded from scoring (the collar) and whether overlapping speech is scored change DER for the same output.
  • The score over a whole test set is time-weighted: pyannote.metrics sums the error time and reference time over files before dividing. Longer recordings have a larger influence on the overall score.

Tools specify the collar differently. In NIST's scoring tool md-eval, -c 0.25 excludes 0.25 seconds before and after each reference segment boundary (0.5 seconds in total). In pyannote.metrics, collar is the total length centered on the boundary, so collar=0.5 gives the same condition. When reporting DER, always state the collar length and whether overlapping speech was scored, and compare only scores computed under the same conditions.

Evaluation Rules (NIST RT and DIHARD)

DER has no original paper, and it is computed under conditions fixed by each evaluation campaign. The table compares representative conditions from the same perspectives.

ItemNIST RT-09DIHARD IIIpyannote.metrics default
Boundary collarExcludes 0.25 s on each sideNoneNone (collar=0.0)
Overlapping speechScored (primary metric)ScoredScored (skip_overlap=False)
Speaker mappingOne-to-one, maximizing total simultaneous speech timeSame (uses md-eval)Optimal, via the Hungarian algorithm
Speech segmentationPauses shorter than 0.3 s are bridged into one segment――
Additional metrics―JERJER, purity, coverage, etc.
Scoring toolmd-eval (version 18)md-eval (version 22)Python library

The RT-09 evaluation plan gives two reasons for the collar: variation in how humans mark segment times, and cases where the onset of speech is ambiguous, such as word-initial plosives. The DIHARD III evaluation plan explicitly states that, contrary to RT practice, it uses no collar and also scores overlapping speech, which makes its scores harsher than those under RT conditions.

Where It Is Used

DER is mainly used in the following settings.

  • Comparing speaker diarization systems: on recordings of meetings, phone calls, interviews, and the like, it compares pipelines that combine speech activity detection, speaker embedding extraction, and clustering with approaches that train the whole system as a single neural network, on the same scale.
  • Analyzing weaknesses of each processing stage: many false alarms and misses point to speech activity detection, and much confusion points to how speakers are grouped. pyannote.metrics returns the DER breakdown component by component.
  • Producing meeting minutes and subtitles: when transcribing "who said what" by combining speech recognition such as Whisper, the quality of the speaker segmentation is measured with DER and the quality of the transcription with WER.

Comparison with Similar Metrics

The table compares DER with other metrics for evaluating speaker segmentation and time segments from the same perspectives.

MetricHow it countsWeight per speakerRangeTypical task
DERError time Γ· reference speech timeProportional to speech time0 and up (no upper bound)Speaker diarization
JERAverage over speakers of 1 βˆ’ (intersection Γ· union)Equal0–100%Speaker diarization (DIHARD)
Purity / coverageHow much each predicted cluster contains only one speaker / how much each speaker falls into one clusterProportional to time0–1Clustering analysis
WERWord errors Γ· reference words―0 and up (no upper bound)Speech recognition
F1@kF1 after matching segments by IoUProportional to number of segments0–100Temporal action segmentation in video

JER divides each speaker's error by the time of the union of reference and prediction, so it never exceeds 100%. According to the DIHARD III evaluation plan, DER and JER are strongly correlated, and JER tends to be higher on recordings where one person talks much longer than the others. Purity and coverage trade off against each other: splitting speakers too finely gives high purity and low coverage, and merging too much gives the opposite.

Guidelines for choosing:

  • Comparing with prior work: compute DER with the same collar and overlap handling.
  • Correctly separating participants who speak little: look at JER in addition to DER.
  • Checking whether clustering splits or merges too much: look at purity and coverage.

PyTorch example

Show code
python
import torch
from scipy.optimize import linear_sum_assignment


def der(ref, hyp):
  """Compute DER from per-frame speaker matrices (formula of the RT-09 evaluation plan).
  ref: (T, R), hyp: (T, H) 0/1 tensors. ref[t, i] = 1 means reference speaker i is speaking at frame t.
  Overlapping speech (several speakers in one frame) is handled as is. No collar."""
  ref, hyp = ref.float(), hyp.float()
  # 1. Build the (R, H) table of frames in which reference and predicted speakers speak simultaneously, and find the one-to-one mapping with the largest total
  co = ref.T @ hyp
  rows, cols = linear_sum_assignment(co.numpy(), maximize=True)
  # 2. Per-frame N_Ref, N_Sys, N_Correct
  n_ref, n_sys = ref.sum(1), hyp.sum(1)
  n_correct = sum(ref[:, i] * hyp[:, j] for i, j in zip(rows, cols)) if len(rows) else torch.zeros_like(n_ref)
  # 3. Breakdown and DER
  fa = (n_sys - n_ref).clamp(min=0).sum()
  miss = (n_ref - n_sys).clamp(min=0).sum()
  conf = (torch.minimum(n_ref, n_sys) - n_correct).sum()
  total = n_ref.sum()
  return ((fa + miss + conf) / total).item(), dict(fa=fa.item(), miss=miss.item(), conf=conf.item(), total=total.item())


# Example from the figure at the top: 20 seconds in 1-second steps (column 0 is A / Speaker 1, column 1 is B / Speaker 2)
ref_lab = ["A"] * 6 + [None] * 2 + ["B"] * 6 + ["A"] * 3 + [None] + ["B"] * 2
hyp_lab = ["1"] * 7 + [None] + ["2"] * 4 + ["1"] * 5 + [None] * 3
ref = torch.tensor([[x == "A", x == "B"] for x in ref_lab])
hyp = torch.tensor([[x == "1", x == "2"] for x in hyp_lab])
print(der(ref, hyp))  # (0.294..., {'fa': 1.0, 'miss': 2.0, 'conf': 2.0, 'total': 17.0})

# pyannote.metrics: pass segments (in seconds). The collar is the total length centered on the boundary
from pyannote.core import Annotation, Segment
from pyannote.metrics.diarization import DiarizationErrorRate

reference, hypothesis = Annotation(), Annotation()
for s, e, spk in [(0, 6, "A"), (8, 14, "B"), (14, 17, "A"), (18, 20, "B")]:
  reference[Segment(s, e)] = spk
for s, e, spk in [(0, 7, "Speaker 1"), (8, 12, "Speaker 2"), (12, 17, "Speaker 1")]:
  hypothesis[Segment(s, e)] = spk

metric = DiarizationErrorRate()  # collar=0.5 for the same condition as NIST md-eval -c 0.25
print(metric(reference, hypothesis, detailed=True))  # breakdown (false alarm, missed detection, confusion, total)
print(abs(metric))  # DER over all files passed so far (time-weighted)

FAQ

Q. Can DER exceed 100%?
A.

Yes. The denominator is only the reference speech time, and false alarm time has no upper bound. If the system keeps outputting speakers in segments where no one is speaking, DER exceeds 100%. If you need a metric bounded to 0–100%, use JER, which divides by the union per speaker.

Q. Why do papers report very different DER on the same data?
A.

Usually because the evaluation conditions differ. The collar that excludes time around boundaries (0.25 seconds on each side in NIST RT, none in DIHARD) and whether overlapping speech is scored change the score greatly. When comparing reported DER, check these conditions.

Q. Can DER be computed if speaker names differ from the reference?
A.

Yes. DER maps reference speakers to predicted speakers one-to-one so as to maximize the total time they speak simultaneously before counting errors, so predicted speakers can have placeholder names such as "Speaker 1" and "Speaker 2". Speech from predicted speakers that are not mapped is counted as confusion or false alarm.

References

  1. NIST. The 2009 (RT-09) Rich Transcription Meeting Recognition Evaluation Plan (Section 6, Diarization – β€œWho Spoke When”). 2009 (version archived on the Internet Archive).
  2. Ryant, N., Church, K., Cieri, C., Du, J., Ganapathy, S., & Liberman, M. (2020). Third DIHARD Challenge Evaluation Plan. arXiv:2006.05815.
  3. pyannote.metrics. Reference (documentation for DiarizationErrorRate and others).
  4. pyannote/pyannote-metrics (GitHub repository; diarization.py and utils.py).