Ben's Blog

agriculture, self sustainability ben September 12, 2026

Classifying Wildlife

We’ve been trying to keep wildlife away from crops and domesticated animals for years. These are several sad truths about the process:

  • the philosophy of letting nature take its share doesn’t work, nature will take it all and is indifferent to your survival
  • the most cost effective and sleep preserving way of dealing with “pests” it to kill them
  • the size of an animal is strongly correlated with the worth we give its life
  • if you remove an animal, another will take its place
  • nature is diverse and has a strategy to defeat every human counter measure other than gunpowder (high jump, force, stinky spray, needles, tunneling, flight).

And so for years we’ve tried everything, trapping, fencing, double fencing, electric fencing, netting, cattle panels + electric fencing, inviting different paths, hanging old CDroms for random shining, airsoft guns, UV lights, trail cameras, noise, ultrasounds, flashing LEDs. If it was on the internet, it was attempted on this homestead. And the results are mitigated at best.

The reality is that wildlife pushes, and it pushes hard. And if it can’t push when you’re around, it’ll push when you’re not, or when you sleep, or when you look away. I’ve been annoying many creatures to help them understand this wasn’t a welcoming place. They inevitably come right back a few minutes later

Could technology solve this? Could I trigger dynamic counter measures based on detection 24/7? Obviously, detection is the starting point of all this. After the first round of seeing Nicole’s gardening work ravaged by a couple of fat raccoons, I went after it with more gusto.

I figured if I could nail the detection this Summer, I could have it alert me and I’d go after them until next Summer when I could work on the triggered measures. And well, let’s just say the wildlife won this round. After many nightly outings on alert, I’ve at most bothered them into eating slightly less tomatoes.

But at least through many trials and much parameter tuning, I finally did get good detection. This means it’s accurate (no false positives), and timely.

I landed on a 3 filters approach, each less generous than the one before it.

Filter #1 the camera’s own motion trigger

This one is pretty straightforward, it’s generous in triggering, creating many images with nothing of interest.

Filter #2 OpenCV classification with MegaDetector

I created a container whose mission it is to receive images and run OpenCV on them. Once again, this would have been a tedious project a short time ago, but AI made this impossibly quick & easy. This is all hosted locally on the very Pi you’re reading these lines from. Most images do not make it through this and are immediately erased. But if an image is found to have animals detected with some confidence, then we run the last filter.

This filter processes ~13,000 images per day, or ~9 a minute. All free, local and sun powered. It is kind of mind twisting to think about extracting “intelligence” from light. Now OpenCV isn’t what we today call AI, but clearly the near future will have LLMs running on premises.

Filter #3 Hosted AI detection

Yes… I tried hard to avoid this one filter. I don’t like adding a cloud dependency with a credit card associated to it at that. But in reality it is so much more accurate than anything I could ever do with OpenCV. I’ve tried many strategies for building confidence with only OpenCV but could never get it right. False positives have a high cost, and so, AI gives the final verdict to the images which made it this far, tens of them in a day for a few pennies, sign me up!

This is essentially a trail camera system on steroids. Based on other state in the Homestead Dashboard, it will also send alerts when people are detected, might as well. Some of the shortcomings of OpenCV are made evident bellow.

And so without false positives, the trigger this year is human intervention. I guess I’m waking up at 6:25 today.

Please keep in mind there is 0 animal cruelty here, the same deer come back over and over again the same day, taking a nice hop over the electric fence which would give them more of a sting than some airsoft BBs on their thick skin. Oh, and the BBs I got are biodegradable.

I hope next year to be able to trigger something that is automated, and more efficient than anything I can do trying to be non-lethal. I think that the real test of this future solution will have to do with animals getting used to it or not. We shall see.

Leave a Comment

Cancel reply

This blog is solar powered

Interactive

Handwriting Capture
Mandalagaba
IPv6 link-local to MAC converter
IPv6 MAC to link-local converter
Markov Text Generation
Markov Word Generation
Markov Music Generation
Duplogrifier
Flood Fill Algorithms
Homestead Metrics
RGB Playground
Web Games

Categories

  • aesthetics112
    • plots54
    • specular holography6
  • Books4
  • I.T.207
    • 3D modeling / printing21
    • AI7
    • all out geekery38
    • electronics29
    • homestead automation7
    • maniacal paranoia27
    • plotters49
    • unix / linux29
    • video games4
    • web development30
    • web games3
  • Lego / Duplo67
  • life in the U.S.42
  • miscellaneous205
  • nature encounters116
  • old vinyls3
  • organs2
  • self sustainability566
    • agriculture110
    • apiculture38
    • apple20
    • building132
    • canning3
    • crochet6
    • foraging6
    • hunting10
    • maple syrup47
    • poultry39
    • preserving3
    • solar power28
    • water23
    • wood85
  • trip to a new life6
Theme by Bloompixel. Proudly Powered by WordPress