We Should Stop Here, It’s Bat Country!

[Roland Meertens] has a bat detector, or rather, he has a device that can record ultrasound – the type of sound that bats use to echolocate. What he wants is a bat detector. When he discovered bats living behind his house, he set to work creating a program that would use his recorder to detect when bats were around.

[Roland]’s workflow consists of breaking up a recording from his backyard into one second clips, loading them in to a Python program and running some machine learning code to determine whether the clip is a recording of a bat or not and using this to determine the number of bats flying around. He uses several Python libraries to do this including Tensorflow and LibROSA.

The Python code breaks each one second clip into twenty-two parts. For each part, he determines the max, min, mean, standard deviation, and max-min of the sample – if multiple parts of the signal have certain features (such as a high standard deviation), then the software has detected a bat call. Armed with this, [Roland] turned his head to the machine learning so that he could offload the work of detecting the bats. Again, he turned to Python and the Keras library.

With a 95% success rate, [Roland] now has a bat detector! One that works pretty well, too. For more on detecting bats and machine learning, check out the bat detector in this list of ultrasonic projects and check out this IDE for working with Tensorflow and machine learning.

12 thoughts on “We Should Stop Here, It’s Bat Country!

  1. the problem with some “bat-detectors” you can buy for cheap is that they don’t cover the whole frequency range needed to find the various bat types (that also have different flight heights and times-of-start). Around here we have at least 3-4 different types that signal at frequencies quite distant to one another – at least 2 kinds are flying at roughly the same time, so the freq range has to be quite wide to get both kinds captured.
    Also, when you HEAR the knack-knack, you usually have about 1 second until you SEE the bat that sent it. Not much time to do sound conversion/neural networking, considering that you, the human delay factor, need some time to switch from hearing to seeing.

    1. One day I plan to buy some land and when I do one of the first things I’ll do is build some bat boxes to help reduce insect population.

      Establishing a bat colony in an area can be a bit of a challenge as they are very selective in where they roost and having a detector that can count the population would be handy for tracking your progress and if any recent changes have affected that population.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.