Hummingbirds, 3D Printing, And Deep Learning

Setting camera traps in your garden to see what local wildlife is around is quite popular. But [Chris Lam] has just one subject in mind: the hummingbird. He devised a custom setup to capture the footage he wanted using some neat tech.

To attract the hummingbirds, [Chris] used an off-the-shelf feeder — no need to re-invent the wheel there. To obtain the closeup footage required, a 4K action cam was used. This was attached to the feeder with a 3D-printed mount that [Chris] designed.

When it came to detecting the presence of a hummingbird in the video, there were various approaches that could have been considered. On the hardware side, PIR and ultrasonic distance sensors are popular for projects of this kind, but [Chris] wanted a pure software solution. The commonly used motion detection libraries for this type of project might have fallen over here, since the whole feeder was swinging in the air on a string, so [Chris] opted for machine learning.

A RESNET architecture was used to run a classification on each frame, to determine if the image contained a hummingbird or not. The initial attempt was not greatly successful, but after cropping the image to a smaller area around the feeder, classification accuracy greatly increased. After a bit of FFmpeg magic, the selected snippets were concatenated to make one video containing all the interesting parts; you can see the result in the clip after the break.

It seems that machine learning and wildlife cams are a match made in heaven. We’ve already written about a proof-of-concept project which identifies different animals in the footage when motion is detected.

15 thoughts on “Hummingbirds, 3D Printing, And Deep Learning

  1. Instead of looking at the image, it sure sounds like he could have simply monitored the audio. The computational complexity is low enough that you might even be able to replace the camera firmware and turn it into a start/stop trigger for video recording.

    Just a thought.

          1. Wingbeat frequency is very approximately a function of size; US hummingbirds are mostly in the 20-70Hz range.

            Dragonflies are too (apparently), but smaller insects are higher. (One paper concerning a bumblebee found mostly around 200Hz.)

            But dragonflies have no reason to come to a hummingbird feeder.

    1. I’ve thought about focusing a parabolic mic on a humming feeder and feeding the audio into GNU Radio to look for a signal in specific frequency bands that would indicate that a hummer was there. So far nothing more than idea, though.

  2. I used pikrell cam, and a tripod to monitor my feeder. It worked perfectly. 1080p, 30fps video, with audio, and a web-server with updated images to boot!

    Raspi: $10.00 – Raspi W
    Camera Module: $30
    Tripod: $13 “Walmart Special”
    Microphone: $5 usb el-cheapo USB sound adapter
    USB Hub: $5.00 el-cheapo USB hub with power
    4.99 32Gb usb 2.0 key, Walmart Special
    4.99 8gb SD Card

    A bit of tweaking with Pikrellcam, and I get 99.9% humming birds, with the occasional very frustrated wasp.

    No “AI” required.

  3. Nice! I had been thinking about doing something similar. Good to see how can be done.
    Do you think the image interpretation system can distinguish different hummingbirds? My feeder has been taken over by a “bully” hummingbird and it would be great to see know how often different individuals are visiting.

Leave a Reply to Deep learningCancel 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.