r/AskStatistics • • 12d ago

The correct methods for combining model confidence scores?

Post image

I have a few thousand audio fragments with bird songs I'm analyzing with a model and Python package called BirdNET. The output is model confidence scores per species and per 3-second window in the recording. A list of different confidence scores is too abstract to analyze directly, so I would like to summarize the scores per species per recording. I'm having trouble picking out a correct method or algorithm, since I'm not that good in statistics.

I added an image of what the data looks like for a single recording. As you can see, BirdNET analyses audio in fragments of three seconds. I use a one-second overlap to not miss any sounds made at the beginning or end of a window. I'm looking for a method that takes into account the following:

  • The warbler should have a poor overall score. One good confidence score doesn't mean much when the rest is low.

  • The wren should have a good overall score. One poor confidence score should not affect all of the average.

  • The buzzard should also have a good overall score. It doesn't call much, but its scores are good. The number of detections should not be a deciding factor in calculating scores, because this will favor birds that have songs of longer duration.

Please note that my goal is not to calculate a probability of presence but recognition strength per recording.

I was told that Bayesian statistics might be a good candidate, but I'm not sure. Some also told me that the overlap will be an issue since part of the same sound is scored twice. So I'm very interested in your assessments and suggestions.

3 Upvotes

3 comments sorted by

1

u/SPSSMadeSimple 12d ago

You're right to distrust both the mean and the max here. The max would crown the warbler on the strength of one 0.89 window, and the plain mean lets the wren's single 0.32 window drag it down even though the other four windows are all around 0.85.

The summary that matches all three of your bullet points is a robust one across the windows, for example the median. On your chart: the warbler's median is 0.32, so one good window can't rescue it; the wren's is 0.86, so one bad window can't sink it; and the buzzard's is about 0.76 even though it only called in two windows, because the median doesn't care how many windows there are. A close cousin that behaves the same way is the share of windows above a sensible threshold, say 0.5: 1 out of 5 for the warbler, 4 out of 5 for the wren, 2 out of 2 for the buzzard.

Two practical notes. First, with very few windows, like the buzzard's two, any summary is noisy, so report the window count alongside the score rather than letting a 2-window species and a 20-window species look equally certain. Second, your overlap point is real: the same second of audio is scored in two windows, so collapse the overlapping pairs first (take the max or the mean of each pair) or just use the non-overlapping windows, and then take the median. Otherwise one loud call gets counted twice.

You could do a Bayesian version of this, but you'd need a proper likelihood for the scores rather than treating them as probabilities, and for what you're describing the median plus the above-threshold share gives you the behaviour you want with a lot less machinery.

1

u/IvanIvanicIvanovski 11d ago

Does the median + above the threshold have a particular name?

1

u/SPSSMadeSimple 8d ago

Not really — there's no single standard name for that exact combination, so you can describe it plainly and people will know what you mean.

The two parts do each have names, though:

  • The median is a robust measure of central tendency (a robust location estimate). That's the part that ignores the one very good or very bad window.

  • The share of windows above the threshold is often called the detection rate or hit rate — the proportion of windows where the model was confident enough to count as a detection.

So you could call the pair "median confidence plus detection rate" and that is clear. In your case: the wren's median is 0.86 with a detection rate of 4 out of 5, while the warbler's median is 0.32 with 1 out of 5 — that says in plain numbers what your chart shows. There's no textbook term that means exactly that combination, so don't worry about using the "wrong" label.