← All blogs

Speech & audio

Speaker diarization threshold: tuning ECAPA clustering from 0.68 to 0.58

In a research experiment, we built a local pipeline that records a meeting, transcribes it and labels who said what. Our speech model, Qwen3-ASR, writes the words but not who spoke them. We skipped a dedicated diarization model and clustered voice embeddings instead, which put one similarity threshold in charge of telling people apart. At 0.68 it split a single voice into two speakers; at 0.58 it didn't. We tuned that on two synthetic text-to-speech voices and never measured a diarization error rate, so treat 0.58 as a starting point for your own test.

Rubix Labs6 min read
Our speaker-labelling pipeline: each source track stays separate, Silero VAD keeps speech, ECAPA turns each span into a voice embedding, and cosine similarity against the speakers seen so far picks a known voice or a new one. On the fixture, different voices scored below 0.29 and the same voice dipped to about 0.60. A threshold of 0.68 split one voice in two; 0.58 did not. The 42.146-second fixture of two Windows voices ran through the full local pipeline in 24.19 seconds with 2 speaker labels.
From our research experiment on one synthetic fixture voiced by Windows text-to-speech. The threshold was tuned on that fixture; no diarization error rate or word error rate was measured.

Why we skipped a diarization model

The obvious route was a model trained for diarization, and NVIDIA's streaming Sortformer 4spk v2.1 was the most relevant one we looked at. Its model card says use is governed by the NVIDIA Open Model License Agreement. It also says the model detects at most four speakers and that performance degrades on recordings with five or more. We wanted every model in the default setup under MIT or Apache 2.0, and four speakers is a tight ceiling for meetings. That's our reading of the published terms, not legal advice.

So we assembled the parts. Qwen3-ASR is Apache 2.0, and its model card doesn't list speaker labels among its features. Silero VAD, under MIT, marks where speech is. SpeechBrain's pretrained ECAPA-TDNN speaker model, Apache 2.0, turns a stretch of speech into an embedding, a vector that should land close to other vectors from the same voice. The card scores speaker verification with cosine similarity between embeddings, and that's the number our threshold works on.

Clustering embeddings this way is an experimental speaker pipeline. It isn't a trained diarization system, and it doesn't separate two people talking at once.

How a voice gets a label

Each recorded track is labelled on its own. The microphone and the shared system audio arrive separately, and the pipeline never merges a speaker across tracks or across recordings. While recording, the microphone track keeps a single label, because a microphone records whoever is near it and can't tell you how many people that is.

The system-audio track is clustered as it arrives. Each new utterance's embedding is compared with a running average embedding for every speaker heard so far. If the best score clears the threshold, the utterance joins that speaker and nudges the average. If it doesn't, the utterance starts a new speaker.

When the recording ends, a final pass relabels every track, microphone included. It embeds overlapping two-second windows, clusters them across the whole recording and assigns each window to its nearest cluster. Clustering compares every window with every other, so it uses at most 512 representative windows per track and assigns the rest against those cluster centres. A window has to clear the same 0.58 threshold and beat the runner-up clearly, or it stays unlabelled. Probable speakerphone echoes are left out of clustering, turns where the voice changes mid-sentence are marked for review, and any label a person has assigned or renamed is kept.

The fixture, and what 0.68 did

Our test conversation was 42.146 seconds long: four scripted turns read by two built-in Windows text-to-speech voices, with 38.146 seconds of speech and one-second gaps. We checked the words against the script by eye. That's all the checking the transcript got.

The threshold wasn't the first problem. Fixed 12-second cuts split words, and cutting at quiet points produced 11 intact utterances. With clean utterances, 0.68 still turned one of the two voices into two speakers. The similarity scores showed why. The same voice compared with itself dipped to about 0.60, while the two different voices stayed below 0.29 against each other.

We lowered the threshold to 0.58, just under the lowest same-voice score and a long way above the cross-voice ones, and the conversation came out as two consistent voices. Run end to end on one workstation, transcription, speaker clustering, word alignment and notes took 24.19 seconds for the 42.146 seconds of audio: 11 of 11 turns aligned, 91 words, 2 speaker labels and no failed jobs. A later regression run took 25.97 seconds with the same counts.

A fixture setting, not a calibration

Two synthetic voices make an easy test. A text-to-speech voice says every sentence in much the same way, and two built-in voices may sound further apart than two colleagues on a call. Real voices change with distance from the microphone and over a compressed call. We'd expect real same-voice scores to spread lower and different-voice scores to creep higher, shrinking the gap between 0.29 and 0.60 that we tuned into. We haven't measured that.

The two mistakes cost different amounts. Too high a threshold makes one person into two speakers, which is easy to see and fix: the review step lets someone merge duplicate labels or reassign a passage without touching the original transcript. Too low a threshold makes two people into one, which is harder to notice and puts words in the wrong mouth. With a gap as wide as this fixture's, sitting just under the same-voice scores was an easy call. With real voices, we'd want the numbers first.

Cosine similarity isn't a probability either. A score of 0.58 doesn't mean the pipeline is 58% sure, and we don't present it as a confidence.

What we'd measure before trusting it

Our written plan, not yet run, starts with a consented set of real recordings: roughly 30 to 60 minutes with two to six speakers, accents, short agreements, overlap and speakerphone echo. It's split by meeting and speaker so tuning never sees the test material. Diarization error rate would be scored with overlap included, using a scorer such as pyannote.metrics (MIT), with the collar reported. False merges get counted on their own, because an average hides them, and a speaker the pipeline isn't sure about should stay unknown.

If you need speaker labels on your own recordings, Rubix can run that comparison on your audio before you take on a model licence. Our pricing page lists on-device AI and custom model work. Once the labels existed, we used them for quote-checked meeting notes and for transcript search, both written up separately.