November 11, 2024
MegaDetector (Part 1 of 2) – Pros & Cons + Use Cases
Hugo Markoff
Robots, Wildlife, AI and more!
3 min read
Welcome to this week's 'Tech for Wildlife' series! In this part, I will be discussing MegaDetector its pros and cons, as well as various use cases (including results from our own tests).
For those working in the field of AI in wildlife, has most likely stumbled across MegaDetector at least once. It's hard to mention MegaDetector without acknowledging Dan Morris; together with a strong team, the #1 open-source tool for “...helping conservation biologists spend less time doing boring things with camera trap images.” has been made.
📌 Check out the GitHub repositories:
Introduction
At its core, MegaDetector is an AI model specialized in recognizing three classes: Animals, Humans, and Vehicles. Trained on millions of trail camera images across diverse environments, it excels in detecting wildlife—from mammals to birds, even small mice from a distance! With a benchmark precision of 0.96 and recall of 0.73 (MegaDetector V5), this tool competes with humans in finding animals—but does it much faster 😊. The models are made for the YOLO - You Only Look Once - object detection system which is doing an amazing job at quickly detecting objects it has been trained on, both on images and videos.
It's also no secret that we'll be using MegaDetector as one of our detection algorithms for Animal Detect.
Pros ✅
Open-source tool for finding animals in wildlife images 🦌
Faster than manual human processing ⚡
Extremely accurate animal detection with typical trail camera setups
Assists in poacher detection (humans and vehicles) 🛡️
High precision and recall for animal detection 📈
Actively maintained 👥
Cons ❌
Less effective for top-view animal detection 📸
Possible strong - false positives for vehicles 🚗❌ (From own experience)
Challenges with amphibian detection 🐸
Requires computational resources (Can work on CPUs but will be faster on GPUs)💻
Restricted to three classes—no species-specific recognition 🐾
With the cons listed I also know that there will be limitations, as nothing in this world is perfect but the MegaDetector comes close, and may be the tool you have been looking for!
Use Cases
GIF - Using MegaDetector for finding Animals
Pre-step for Classification: Many projects use MegaDetector to locate animals, crop them, and then classify them. I’ll cover classifiers in a future post.
Filtering Out Empty Images: With MegaDetector’s reliability, you can often trust that an image with no detections is empty. I typically use a threshold of 0.2 to reduce false positives, though this depends on your data.
Real-time Detection with Online Cameras: MegaDetector can work with cloud-based or GSM/2G/3G/4G/5G-connected cameras for real-time applications:
a) Detecting Poachers in Real-Time MegaDetector processes each camera image, alerting rangers to suspicious activities quickly.
b) Filtering Empty Images Before Sending to Users This is a feature we implemented at AnimalDetect. We ignore the vehicle class and set low confidence thresholds—0.01 for animals, 0.03 for humans. Detections below these levels are filtered out to reduce unnecessary alerts.
Results:
Reduced empty images by ~82%
Retained 99.2% of images with animals
With this said, 99.2% did not always mean that the detector correctly found an animal or human, but still flagged the image as one with detection. Similarly, we also “still” got 18% of empty images still sent to the user.
Question: Do you think reducing empty images by 82% while only missing 0.8% of animal pictures is a worthwhile tradeoff?
Finally: The GIF was generated using MegaDetector, showing only the Human and Animal classes with a threshold > 0.25. Apologies if some labels are hard to read due to scaling for GIF format. It includes both a personal image and images from LILA BC, a valuable resource for conservation and biology datasets. Specifically, I used images from the North American Camera Trap Images (NACTI) dataset. Check out LILA BC if you're interested in using ML for conservation!
👉 Learn more about the NACTI dataset: https://lila.science/datasets/nacti
Special thanks to LILA BC and the NACTI dataset creators: Tabak MA, Norouzzadeh MS, et al. (2019) Machine learning to classify animal species in camera trap images. Methods in Ecology and Evolution, 10(4):585-90.
Other Articles
Scaling Your Site
Learn about hosting built for scale and reliability.
Optimize for SEO
Learn how Framer can optimize your site for search engines.
CMS Examples
Get inspired by blogs, job openings, events and more.