BirdVoxDetect not recogizing SAVS or GCTH

19 views
Skip to first unread message

Kevin Tolan

unread,
Mar 9, 2021, 10:22:22 PM3/9/21
to birdvox
Hey everyone, I hope you all had a fruitful winter of finches!

I'm trying to run two NFC wav files through BirdVox, one of a Gray-cheeked Thrush and one of a Savannah Sparrow. Both wavs are text-book examples of their respective NFCs with very little/no background noise.

When I run them through BirdVoxDetect it appears to work correctly:
Screen Shot 2021-03-09 at 10.11.50 PM.png

however, it produces an empty csv file: 
Screen Shot 2021-03-09 at 10.07.20 PM.png


To my understanding, both of these species are currently recognizable by BirdVox so this is likely an error on my end, but I can't figure out what the problem is. Any insight would be greatly appreciated.

Best,

Kevin

Wim van Dam

unread,
Mar 10, 2021, 3:03:04 AM3/10/21
to Kevin Tolan, birdvox
Hi Kevin, 

What happens if you play around with the threshold value? It might get picked up if you use something like 

birdvoxdetect --threshold 20 savs2.1.wav

This parameter is somewhat explained at the bottom of https://github.com/BirdVox/birdvoxdetect

Wim


--
You received this message because you are subscribed to the Google Groups "birdvox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to birdvox+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/birdvox/1b49d972-f2c5-4512-bfba-259639f1f0aen%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vincent Lostanlen

unread,
Mar 10, 2021, 5:15:02 AM3/10/21
to bir...@googlegroups.com

Hello Kevin, Wim, and all,


I agree with Wim, the most probable cause is that the default value of the detection threshold (=50) is too high.

How long is the file savs2.1.wav ? BirdVoxDetect does not work well on very short files because it cannot estimate background noise properly.


I'd be curious to receive the file privately if you're OK with sharing it. This way i'll be able to investigate further.


Sincerely,

Vincent.

Kevin Tolan

unread,
Mar 12, 2021, 12:48:20 AM3/12/21
to Vincent Lostanlen, bir...@googlegroups.com
Hi Wim and Vincent,

Thanks for the advice. You're correct, it was an issue with the threshold; I had just chosen to leave it at default but need to play around with the parameters more. 

The GCTH works great, but the SAVS isn't being ID'd to either species or family, just to order. The SAVs recording is 8 seconds in length. This is again, likely an issue on my end with the parameters.

Vincent, I'll email you the SAVS file tomorrow. 

Best,

Kevin

You received this message because you are subscribed to a topic in the Google Groups "birdvox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/birdvox/DeqqYAZ-nhc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to birdvox+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/birdvox/f845f4fc-9d0f-aec0-50a0-64e2794dde59%40nyu.edu.

Vincent Lostanlen

unread,
Mar 15, 2021, 6:45:16 AM3/15/21
to birdvox

Hello everyone,

Following my earlier discussion with Kevin Tolan et al., here is a (hopefully) useful tip on how to query BirdVoxDetect not at the species level but at the family level (American sparrow / Cardinal / Thrush/ Warbler / other).


"Thank you for the file. I have re-run BVD (BirdVoxDetect) with a threshold of 30 and the flight call is correctly detected.

Furthermore, i passed --predict-proba as an optional argument to BVD in order to obtain a comprehensive output of the taxonomical neural network classifier in JSON format.

In Python:


filepath = "savs2.1.wav"
df = birdvoxdetect.process_file(
    filepath,
    output_dir="kevintolan",
    export_clips=True,
    export_confidence=True,
    export_logger=True,
    predict_proba=True,
    threshold=30.0)


And here are the species for the flight call you shared, listed by decreasing probability:


import json

with open("kevintolan/savs2.1_proba.json") as file:
    bvd_json = json.load(file)
bvd_proba = {
    species["common_name"]: species["probability"]
    for species in bvd_json["events"][0]["fine"].values()
}
print(sorted(bvd_proba.items(), key=lambda item: -item[1]))


[('other', 0.7988400459289551), ('American tree sparrow', 0.20115992426872253), ("Swainson's thrush", 0.11131554841995239), ('Chipping sparrow', 0.06161928176879883), ('White-throated sparrow', 0.012745797634124756), ('Savannah sparrow', 0.001010507345199585), ('Canada warbler', 0.00035244226455688477), ('Rose-breasted grosbeak', 0.0002599954605102539), ('Bay-breasted warbler', 0.00017392635345458984), ('Ovenbird', 8.269814134109765e-05), ('American redstart', 3.670400838018395e-05), ('Common yellowthroat', 4.883717792836251e-06), ('Mourning warbler', 2.8175763873150572e-06), ('Black-throated blue warbler', 2.785533979476895e-06), ('Gray-cheeked thrush', 1.163517822533322e-06)]


So, "other" is the most probable species, followed by "American Tree Sparrow". The correct species (SAVS) only ranks as #6 in the list. Clearly, the species classifier is not reliable here.


However, not all hope is lost. We can query the taxonomical neural network at a different level of taxonomical hierarchy than the species level: in particular, BirdVox now integrates a family classifier.

with open("kevintolan/savs2.1_proba.json") as file:
    bvd_json = json.load(file)
bvd_proba = {
    species["common_name"]: species["probability"]
    for species in bvd_json["events"][0]["medium"].values()
}
print(sorted(bvd_proba.items(), key=lambda item: -item[1]))


(note that i replaced "fine" by "medium" in the script above). Output:

[('American sparrow', 0.6484168767929077), ('other', 0.3515831232070923), ('Cardinal', 0.06819871068000793), ('Thrush', 0.05104416608810425), ('Warbler', 0.00031512975692749023)]


This time, the most probable result, "American sparrow", is indeed the correct answer."


I hope this helps!


Sincerely,

Vincent.

Reply all
Reply to author
Forward
0 new messages