Saturday 16 June 2018

BatGuru: a British bat ID helper

My BatGuru is a program written in Gambas which helps me identify British bat species based upon echolocation call data.


It simply saves me having to juggle the key parameters in my head as I scan the charts in my reference book.


But identifying bats from their calls is tricky due to the wide variability of their calls.

BatGuru includes a file which contains bat echolocation data published in "British Bat Call" by Jon Russ. You will need a copy of this excellent book in order to understand how to interpret the calls recorded via BatLogger, or via a range of bat detector types including; heterodyne, frequency divisions, time-expansion and full spectrum.

bat echolocation identification FmaxE FM qCF


The user interface of BatGuru permits the selection and entry of 6 key parameters that Jon uses in his book;

  1. Call Type; by selecting one of the 5 echolocation call types, a small graphic crudely illustrates the typical shape that you may see on a spectrogram. In addition, a list is displayed of the bat species that use this call type.
  2. FmaxE; echolocation calls generally contain a dominant frequency, a frequency that is more powerful than the others.
  3. F-start; echolocation calls may start at one frequency and vary during the call.
  4. F-end; this is the final frequency of the call.
  5. Duration; this is the length of time that the call occupies.
  6. Interval; this seems to be the time between the start of one call and the start of the next call.

So if I take a recent bat call and analyse it in Audacity...

Audacity bat call analysis spectrogram


...I can use this data to populate BatGuru, and when I press the "take a guess" button...

bat echolocation call FM qCF pipistrelle Gambas

...I get a list of 3 bat species, each with a score.

In the first version of this program, the score was derived by simply allocating 1 mark for each parameter that was within the range of possible values for a given bat species. The problem with this was that the program often gave similar scores for a number of bat species. This is because the possible range of (say) FmaxE can overlap between species.

The current software goes further, allocating additional marks where data is closer to ideal values. For example; within limits = 1, within 68% = 2, within 20% = 3. I probably need to give this more thought and maybe apply 'statistics' to this problem.

But even with this very simple approach, it may be possible to get better results simply by creating more classifications (e.g. 100%, 95%, 68%, 30% & so on). Also, I am aware that the frequency response of my logger is not 'flat' so higher frequencies may be under-valued (i.e. the true highest frequency in a call may actually be much higher than what I see on a spectrogram). So maybe the score based upon high frequencies should be down graded.

There may also be a problem with call duration and interval. Echos created by hard objects such as buildings, may appear to stretch the call duration (e.g. a delayed echo 'version' of the call may be added to the call, extending its apparent length).

FM bats


I'd say that this program is quite effective on qCF and FM-qCF echolocation calls. However, FM echolocation calls sometimes pose a bigger challenge.

Audacity spectrogram FM bat echolocation call


This spectrogram shows 2 FM echolocation calls from a sequence of calls. If I measure the frequency data from the call on the left I get;

bat echolocation call identification

...which is not a great result, as there is no clear winner. If I use frequency data from the call on the right I get a different result...

Gambas FM qFM bat call echolocation

...but still no clear winner. I'm not sure that the program is the problem, as if I consult the charts in Jon's book I still can't decide what kind of bat it is. I guess the best I could do would be to analyse all the calls in this particular sequence in the hope that I may see a popular result (e.g. say 6 out of 10 calls may indicate a particular bat species).

I'd love to see one of these iPad + dongle bat identifiers in operation (as seen on BBC Springwatch). There are a couple of videos near the bottom of the page at this link location where I managed to capture this screenshot;

Echo Meter Touch auto ID accuracy identification bat call echolocation
The Echo Meter Touch: Well this makes me feel so much better! 

They only claim 80% accuracy of identification for just over half of recordings, provided you (and the bats) are in an uncluttered area, and that there is only one bat producing echolocation calls, and not producing any social or alarm calls.

When bats fly within range of my logging system, if they are lower than roof level they are in a cluttered environment. But if they are above the roof, they may be producing more predictable calls.

In addition, all the scientific papers I've read on the net indicate that it is not possible to positively identify bats from bat calls. Although I can be very confident when I see a pipistrelle echolocation call, sometimes the call sequence includes FmaxE values both below and above 50kHz. In these cases I don't know whether I have a common pipistrelle or a soprano pipistrelle. Maybe only DNA analysis would answer that question.

However, I still think my BatGuru program has some value, and I plan to continue tweaking it.

You can find the code on Github: https://github.com/stevedee/Gambas-BatGuru


No comments:

Post a Comment