Close
0%
0%

Intelligent Wildlife Species Detector

Species are auto detected 'in the wild' using machine learning with results transmitted to the cloud

Similar projects worth following
Microphones are used to capture audio data which is then processed using machine learning to identify the animal species, whether it be bird, bat, rodent, whale, dolphin or anything that makes a distinct noise.

The key advantages over other existing technology is that: the audio data is filtered at source saving both disc space and human intervention. Previously recordings could easily generate many hours of footage per day, consuming up to 5 Gb per hour of disc space and adversely affecting the zoologist's golfing handicap and social life.

The core ingredients of this project are:

  • Nvidia Jetson Nano development board / Raspberry Pi 4 + 4 GB RAM.
  • Noctula fan nf a4x20 5v pwm (Nano only)
  • ADC Pi shield for sensing battery and supply voltages.
  • EVM3683-7-QN-01A  Evaluation Board for supplying a steady 5v to the Nano.
  • 5 Inch EDID Capacitive Touch Screen 800x480 HDMI Monitor TFT LCD Display.
  • Dragino LoRa/GPS HAT  for transmitting to the 'cloud' (Currently Pi 4 only)
  • 12 V rechargeable battery pack.
  • WavX bioacoustics R software package for wildlife acoustic feature extraction.
  • Random Forest R classification software.
  • In house developed deployment software.
  • Full spectrum (384 kb per second) audio data.
  • UltraMic 384 usb microphone.
  • Waterproof case Max 004.

What have been the key challenges so far?

  • Choosing the right software. Initially I started off using a package designed for music classification called ' PyAudioAnalysis' which gave options for both Random Forest and then human voice recognition Deep Learning using Tensorflow. Both systems worked ok, but the results were very poor. After some time chatting on this very friendly Facebook group:  Bat Call Sound Analysis Workshop , I found a software package written in the R language with a decent tutorial that worked well within a few hours of tweaking. As a rule, if the tutorial is crap, then the software should probably be avoided! The same was true when creating the app with the touchscreen - I found one really good tutorial for GTK 3 + python, with examples, which set me up for a relatively smooth ride.
  • After choosing to focus on detecting bats, finding quality bat data for my country. In theory, there should be numerous databases of full spectrum audio recordings in the UK and France, but when actually trying to download audio files, most of them seem to have been closed down or limited to the more obscure 'social calls'. The only option was to make my own recordings which entailed setting up the device overnight in my local nature reserves, by which I managed to find 7 species of bat. Undoubtedly, the data is the most important part of this project and I spent very many pleasant hours out in the wilderness with the detector and the sounds of these wonderful creatures.
  • Using GTK 3 to produce the app. Whilst python itself is very well documented on Stack exchange etc, solving more detailed problems with GTK 3 was hard going. One bug was completely undocumented and took me 3 days to remove! The software is also rather clunky and not particularly user friendly or intuitive. Compared to ordinary programming with Python, GTK was NOT an enjoyable experience, although it's very rewarding to see the app in action.
  • Designing the overall architecture of the app - GTK only covers a very small part of the app - the touch screen display. The rest of it relies on various Bash and Python scripts to interact with the main deployment script which is written in R. Learning the R language was really not a problem as it's a very generic languages and and only seems to differ in it's idiosyncratic use of syntax, just like any other language really. The 'stack' architecture initially started to evolve organically with a lot of trial and error. As a Hacker, I just put it together in a way that seemed logical and did not involve too much work. I'm far too lazy to learn how to build a stack properly or even learn any language properly, but, after giving a presentation to my local university computer department, everybody seemed to agree that that was perfectly ok for product development. Below is a quick sketch of the stack interactions, which will be pure nonsense to most people but is invaluable to remind myself of how it all works:
  • Creating a dynamic barchart - I really wanted to display the results of the bat detection system in the most easy and comprehensive way and the boring old barchart seemed like the way forwards. However, to make it a bit more exciting, I decided to have it update dynamically so that as soon as a bat...
Read more »

View all 12 components

  • Secret Project Partner Now Revealed - Hydrophone development

    Tegwyn☠Twmffata day ago 0 comments

    I want to mention Ivano Pelicella of Dodotronics who has helped develop this project in secret over the last few months by supplying components etc. such as the Nvidia Jetson Nano. Ivano is a specialist microphone developer in Italy and the project currently uses his Ultramic-384k-ble USB mic. Obviously, to monitor aquatic mammals, a waterproof mic is required and Ivano is developing this very thing, literally, as we speak. Here are the moulds for the prototype:

    Hydrophones are extremely hard to find / expensive, but essential to this project for the future.

  • Commercialisation of this Project is Approaching

    Tegwyn☠Twmffata day ago 0 comments

    Just come back from a meeting with some local UK Welsh Government agents who have contacted me via social media. They are very keen to get local tech businesses up and running in the local economy and have made strong indications that this Wildlife Detector will be supported. The plan is primarily to deploy the device on local rivers as part of their Menai Rivers Project to monitor the rodent and otter population and then take it out to sea and monitor aquatic mammals in conjunction with a massive tidal energy project.

  • The Official Hackaday Prize Video

    Tegwyn☠Twmffat09/16/2020 at 07:06 0 comments

    Since this project is now one of the 34 finalists, I thought I should produce a video update on the project. Nothing much has changed with the hardware over the last couple of months but I have done quite a few re-training sessions with the addition of new data to improve accuracy. I have used the detector every night, weather permitting, for last 6 months or so and the results can be seen live on this web page: LIIVE FEED between about 19:00 and 08:00 hours local time. I am in the UK and my time zone is BST or GMT or somewhere near 0 (it changes in October!)

    It's actually very satisfying to have a project at some kind of 'finished' stage although it would be really great to have a custom PCB built for the power supply with some kind of scheduling chip on it so that the Nano / RPi 4 can be fired up at a pre-determined time of day and then shut off again later, thus saving battery power.


    Talking about power, it's astonishing that there is no 'consumer' solution for providing adequate battery orientated 5V power for these power hungry devices. At the time of building the system, there was no plug and play shield available for the high currents required and nothing for taking power from a lead acid battery at charging voltages of, for example, 15 volts.

  • Thumbs up from Jensen Huang CEO of Nvidia !

    Tegwyn☠Twmffat09/15/2020 at 07:40 0 comments

    Just heard that Jensen Huang has chosen to feature this project in his keynote speech at Nvidia's GPU Technology Conference (GTC) on October 5th 2020. Jensen is the top Honcho of Nvidia who most of us have never heard of before - the Elon Musk of SpaceX. So, for anybody developing Ai projects like myself, this is totally awesome!

    Somebody recently suggested that he might want to send it off into outer space to detect species of Aliens. I never thought of that, but sounds like a great idea!

  • Web Page for Live Updates

    Tegwyn☠Twmffat03/31/2020 at 13:12 0 comments

    Most evenings, currently at about 20.00 UTC, this gadget will be deployed in the wild for rigorous testing and debugging. The barchart updates itself every 3 minutes or so and it's quite fun to see the animals appear during the evening / night.
    http://www.goatindustries.co.uk/bat_detector/showdata.php

  • Is it a Bat?

    Tegwyn☠Twmffat03/21/2020 at 14:57 0 comments

    After data augmentation, we get a whole load more spectograph images, but a lot of them are blank so it's a really good idea to auto delete all the blank ones. This is done through a function called 'Morphology', which basically counts discrete shapes in an image. Very useful !!!

    The image is firstly inverted, then converted to grey scale, then blurred, then a threshold is applied to create a mask, then blended back with the original and finally, the discrete objects are counted. Anything over 1 is kept and anything of value zero is deleted.

  • Testing Deep Learning

    Tegwyn☠Twmffat03/13/2020 at 10:03 0 comments

    So, about 17,300 spectographs were trainin on the Xavier for about 10 hours. I then fed 177 'unseen' spectographs into the network with the saved model and each result looked pretty much as above. There were 7 false positives, which was expected, and no obvious signs of over fitting.

  • 17,300 Spectograms cant be Wrong !

    Tegwyn☠Twmffat03/09/2020 at 09:17 0 comments

    Although the current software stack can automatically generate thousands of spectographs from almost nothing, each one of them has to be manually checked by eye of human. I tried to train my dog to do this for me, but it just cost me a whole load of German sausage for nothing.

    Here's few example of auto generated spectographs for Daubenton's bat ready for training. Each one takes about 0.5 seconds to check by eye:

  • 4G LTE modem Enabled !!

    Tegwyn☠Twmffat03/08/2020 at 12:00 0 comments

    The Sierra Wireless EM7455 is a high end cat 6 4G LTE modem that has a whole load of yummy features such as 300 mb per sec download and 50 mb per sec upload speeds .... Here's the FULL SPEC. In the past I have used some 3G and 2G modems, but only every got them to work in GPRS mode, which is fine for sending lots of text via some rather insecure methods such as 'get' or 'post' but not good for uploading spectograph image files to an Amazon server, for example. Another great feature of this device is that's it's extremely compact and slots nicely into a M.2 key B connector.

    The device requires a USB carrier board to connect to the Raspberry Pi or Jetson Nano and there's a few possibilities here although we opted for the Linkwave version and bought a high quality antenna on a 10 metre cable at the same time. Ok, it was expensive, but eventually, the results are worth it as being able to send images quickly means less battery juice being consumed.

    Connecting to the Raspberry Pi was just a matter of installing 'network manager' and creating a modem connection with the correct APN settings. For my network Three in the UK, the APN was '3Internet' with no password or username. Simple! Getting functionality with the Jetson Nano was a different matter and required doing a live probe on the system drivers being used in the Raspberry pi using:

    tail -f /var/log/syslog

     .. run in command line. Eventually i worked out that the most essential driver was qcserial, which is short for 'Qualcomm serial modem', which then had to be enabled in the Jetson Nano kernel .... So with a fresh 128 Gb SD card I flashed the Nano from a host computer using the latest Nvidia SDK Manager package, expanded the file system form 16 Gb to 128 Gb and started messing with the drivers using these these SCRIPTS.

  • View the Bat Detector LIVE in Action

    Tegwyn☠Twmffat03/04/2020 at 13:16 0 comments

    https://thingspeak.com/channels/991218

    Click for live bat detection results

View all 14 project logs

  • 1
    Install the software
    1. Flash a 128 Gb SD card with the latest Jetson Nano image using Balena Etcher or such like.
    2. Boot up the Nano and create a new user called tegwyn.
    3. Open a terminal and run: git clone https://github.com/paddygoat/ultrasonic_classifier.git
    4. Find the file: ultrasonic_classifier_dependancies_install.sh in ultrasonic_classifier and open it in a text editor.
    5. Follow the instructions within. The whole script could be run from a terminal using:
    6. cd /home/tegwyn/ultrasonic_classifier/ && chmod 775 ultrasonic_classifier_dependancies_install_nano.sh && bash ultrasonic_classifier_dependancies_install_nano.sh

      .... Or install each line one by one for better certainty of success.

    7. Find the file: run.sh in the ultrasonic_classifier directory and edit the password at line 6 accordingly.
    8. Find the bat icon on the desktop and double click to run the app.
  • 2
    Wire up the Nano
    1. Plug the AB electronics ADC hat onto the Nano, green terminals facing away from the large black heat sink.
    2. Screw the fan onto the heat exchanger and plug it into the 'fan' socket.
    3. Find R10 on the Monolithic eval board and replace it with a high tolerance 270 ohm 0806 resistor. Check that this now outputs 5.0 V with a volt meter.
    4. Wire in the power supply with a 48.7 K resistor from the 12 V battery pack to analog pin 1 on the ADC hat.
    5. Wire the 5 V out to ADC pin 2 via a 3.3 K resistor.
    6. Find J48 on the Nano and attach a jumper.
    7. Connect eval board to Nano via the DC 2.1 mm socket.
    8. Connect USB and  HDMI cable touchscreen.
    9. Set the enable switch on the eval board to 'on'.

View all instructions

Enjoy this project?

Share

Discussions

Bram Peirs @ fWtW wrote 09/09/2020 at 11:03 point

Can it be made cheaper? Eg with cheaper microphone and less computing force? It's not important to know right away what kind of bat it is right? Maybe data could be sent to the cloud to analyze?

There is a market for your product at the big windturbineproducers. In EU there are regulations on bats, and as we speak experiments are being done with bat detectors in windturbines to stall them when bats are flying out. You are always welcome to text us if you need more info.

  Are you sure? yes | no

Tegwyn☠Twmffat wrote 09/15/2020 at 07:44 point

Thanks for comment Bram. This is already the cheapest microphone :( It's not possible to compromise on the quality.

  Are you sure? yes | no

Ken Yap wrote 09/15/2020 at 08:58 point

I read the other day that scientists found a cheap way to reduce bird fatalities with wind turbines, just paint one blade black. Who would have guessed? Perhaps they could investigate modifying blades to generate sounds to warn bats.

  Are you sure? yes | no

jibril wrote 02/28/2020 at 14:33 point

nice project

  Are you sure? yes | no

Tegwyn☠Twmffat wrote 09/15/2020 at 07:44 point

Thanks!

  Are you sure? yes | no

Ken Yap wrote 02/08/2020 at 00:03 point

Hmm, is your instrument intelligent or does it detect intelligent bats? Or both? I wouldn't be surprised if they are intelligent too.

  Are you sure? yes | no

Tegwyn☠Twmffat wrote 02/08/2020 at 09:36 point

The bats are definitely intelligent, so yes the gadget does both. However, bats can not talk to each other beyond a basic level so can not debate the meaning of life, for example ...... Unless I'm missing something?

  Are you sure? yes | no

Tegwyn☠Twmffat wrote 02/08/2020 at 09:38 point

..... Of course, the bats are a lot more intelligent than this gadget :)

  Are you sure? yes | no

Ken Yap wrote 02/08/2020 at 09:50 point

👍

  Are you sure? yes | no

Dan Maloney wrote 02/07/2020 at 16:46 point

It's interesting that bats have social calls distinct from their echolocation sounds - didn't know that, but probably should have guessed. Curious how you found out which six bat species you have if you couldn't find a decent database of bat sounds - or did you just determine from the calls that there are six different species yet-to-be-identified?

Interesting work. We used to have bats come out every night around our house, and I loved watching them maneuver about. Always wondered what they were doing up high when the mosquitoes I was told makes up most of their diet would seem to need to stay close to the ground to feast on us mammals.

  Are you sure? yes | no

Tegwyn☠Twmffat wrote 02/07/2020 at 17:38 point

Hello Dan - Great to hear from you! I bought a couple of books on  analysing British and European bats and quizzed the guys on Facebook on some of the more tricky species. Some people are incredibly helpful! As for your bats, different species have different feeding habits - some will feed up high and some even specialise in swooping down over areas of water. I dont know much about USA bats so could not say what they might be :( Generally, as you indicated, insects are attracted to mammals such as cows and their dung so the bats will be associated with cows etc grazing in pastures.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates