Skip to content

Commit a5d7d86

Browse files
authored
Merge pull request #4 from microsoft/May26-Rain-MegaDetector-Launch
Integrate fine-tuning training module into MegaDetector
2 parents 46be44e + 3629619 commit a5d7d86

11 files changed

Lines changed: 723 additions & 45 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ htmlcov/
1818
*.log
1919
.DS_Store
2020
Thumbs.db
21+
.DS_Store

README.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# MegaDetector
22

3-
**MegaDetector** is an open-source AI model that detects **animals**, **people**, and **vehicles** in camera trap images. Developed by the [Microsoft AI for Good Lab](https://www.microsoft.com/en-us/ai/ai-for-good), MegaDetector is used by more than 80 conservation organizations worldwide to automate the review of camera trap imagery. It does not identify species — it locates animals so researchers can skip empty frames and focus on science.
3+
**MegaDetector is an open-source AI model from the [Microsoft AI for Good Lab](https://www.microsoft.com/en-us/ai/ai-for-good) that detects animals in camera-trap imagery.** Used by more than 80 conservation organizations worldwide, MegaDetector automates the review of camera-trap images so researchers can skip empty frames and focus on science. It does not identify species — it locates animals so they can be passed to a downstream classifier.
44

5-
MegaDetector is the flagship model in the [PyTorch Wildlife](https://github.com/microsoft/CameraTraps) framework and [SPARROW Studio](https://github.com/microsoft/CameraTraps) ecosystem. It is free, open-source, and available under permissive licenses.
5+
MegaDetector is one project in the [microsoft/Biodiversity](https://github.com/microsoft/Biodiversity) ecosystem and is invoked through the [PyTorch Wildlife](https://github.com/microsoft/PytorchWildlife) framework. It is free, open-source, and available under permissive licenses.
66

77
[![PyPI](https://img.shields.io/pypi/v/PytorchWildlife?color=limegreen)](https://pypi.org/project/PytorchWildlife)
88
[![Downloads](https://static.pepy.tech/badge/pytorchwildlife)](https://pypi.org/project/PytorchWildlife)
@@ -31,7 +31,7 @@ results = model.single_image_detection("path/to/camera_trap_image.jpg")
3131
results = model.batch_image_detection("path/to/image_folder/")
3232
```
3333

34-
That's it. Three lines to detect animals in your camera trap images.
34+
That's it. Three lines to detect animals in your camera-trap images.
3535

3636
**Try it without installing anything:**
3737
- [Hugging Face demo](https://huggingface.co/spaces/ai-for-good-lab/pytorch-wildlife) — upload images in your browser
@@ -42,28 +42,21 @@ That's it. Three lines to detect animals in your camera trap images.
4242

4343
Camera traps generate millions of images, and the vast majority are empty frames triggered by wind or vegetation. Manually reviewing them is one of the biggest bottlenecks in wildlife research.
4444

45-
MegaDetector solves this. It scans your images and draws bounding boxes around three categories:
46-
47-
| Class | What it detects |
48-
| --- | --- |
49-
| **animal** | Any animal — mammals, birds, reptiles, insects |
50-
| **person** | Humans |
51-
| **vehicle** | Cars, trucks, ATVs, boats |
52-
53-
Each detection has a confidence score between 0 and 1. You set a threshold (typically 0.15–0.3), and anything above it is flagged. The output lets you sort images, filter blanks, or feed detected animals into a species classifier.
45+
MegaDetector solves this. It scans your images and draws bounding boxes around any animal — mammals, birds, reptiles, insects, and more. Each detection has a confidence score between 0 and 1. You set a threshold (typically 0.15–0.3), and anything above it is flagged. The output lets you sort images, filter blanks, or feed detected animals into a species classifier.
5446

5547
MegaDetector is intentionally a **detector**, not a classifier. "Animal vs. background" generalizes across ecosystems far better than species identification. For species classification, pair MegaDetector with a downstream classifier — see [Species Classification](#species-classification) below.
5648

5749

5850
## MegaDetector V6
5951

60-
The latest release focuses on **efficiency**, **modern architectures**, and **licensing flexibility**.
52+
The latest release focuses on **efficiency**, **modern architectures**, and **licensing flexibility****SMALLER, FASTER, BETTER**.
6153

6254
### Highlights
6355

6456
- **50x smaller**: The compact YOLOv10 variant has **2.3M parameters** — 2% of MegaDetector V5's 139.9M — with comparable accuracy
6557
- **Multiple architectures**: YOLOv9, YOLOv10, RT-DETR — pick the one that fits your hardware
6658
- **Permissive licenses**: MIT and Apache-2.0 options alongside AGPL-3.0
59+
- **Ongoing fine-tuning**: V6 models are continuously fine-tuned on newly collected public and private data to further improve generalization
6760

6861
### Model Variants
6962

@@ -79,6 +72,8 @@ The latest release focuses on **efficiency**, **modern architectures**, and **li
7972
| MDV6-mit-yolov9-e | 51M | 76.1% | 71.5% | MIT |
8073
| MDV6-mit-yolov9-c | 9.7M | 74.8% | 87.6% | MIT |
8174

75+
Model names are standardized into **MDV6-Compact** and **MDV6-Extra** for the two model sizes within each architecture, reducing confusion across variants.
76+
8277
**Which should I use?**
8378
- **Best accuracy**: MDV6-apa-rtdetr-e (82.9% recall, Apache-2.0)
8479
- **Best for laptops/edge**: MDV6-yolov10-c (2.3M params, runs on CPU)
@@ -101,7 +96,7 @@ pip install PytorchWildlife
10196

10297
**Requirements:**
10398
- Python 3.8+ (3.10+ recommended)
104-
- Optional: NVIDIA GPU with CUDA for 10-50x speedup
99+
- Optional: NVIDIA GPU with CUDA for 1050x speedup
105100

106101
**Conda users:**
107102
```bash
@@ -115,7 +110,7 @@ pip install PytorchWildlife
115110
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
116111
```
117112

118-
Full installation guide: [microsoft.github.io/CameraTraps/installation/](https://microsoft.github.io/CameraTraps/installation/)
113+
Full installation guide: [microsoft.github.io/MegaDetector/installation/](https://microsoft.github.io/MegaDetector/installation/)
119114

120115

121116
## Species Classification
@@ -158,10 +153,10 @@ Google's [SpeciesNet](https://github.com/google/cameratrapai) is also designed t
158153

159154
### SPARROW Studio
160155

161-
[SPARROW Studio](https://github.com/microsoft/CameraTraps) is a unified desktop application by Microsoft AI for Good built on PyTorch Wildlife:
156+
[SPARROW Studio](https://github.com/microsoft/Biodiversity/tree/main/SPARROW-Studio) is a unified desktop application by the AI for Good Lab built on PyTorch Wildlife:
162157

163158
- Run MegaDetector and species classifiers through a graphical interface
164-
- Manage camera trap data locally or in the cloud
159+
- Manage camera-trap data locally or in the cloud
165160
- Annotate, analyze, and visualize detection results
166161
- Supports bioacoustics and overhead wildlife imagery
167162

@@ -176,22 +171,20 @@ Windows installer: [Download from Zenodo](https://zenodo.org/records/19687738/fi
176171
[Upload images and run MegaDetector in your browser](https://huggingface.co/spaces/ai-for-good-lab/pytorch-wildlife) — no installation required.
177172

178173

179-
## Part of SPARROW Studio and PyTorch Wildlife
174+
## Part of the Biodiversity Ecosystem
180175

181-
MegaDetector is one model in a larger ecosystem:
176+
MegaDetector is one model in a larger open-source ecosystem from the AI for Good Lab. Each project lives in its own repository, with the [microsoft/Biodiversity](https://github.com/microsoft/Biodiversity) umbrella tying them together.
182177

183-
**[PyTorch Wildlife](https://github.com/microsoft/CameraTraps)** is the open-source framework that powers MegaDetector. It also includes:
184-
- **Species classifiers** — AI4G Amazon Rainforest, AI4G Snapshot Serengeti, DeepFaune, and more
185-
- **Bioacoustics models** — audio-based wildlife monitoring (MD AudioBirds V1)
186-
- **OWL** (Overhead Wildlife Locator) — point-based detection for aerial/drone imagery
187-
- **HerdNet** — animal detection in overhead imagery
188-
- **PW-Engine** — a Rust-based inference core for high-throughput processing
189-
190-
**[SPARROW Studio](https://github.com/microsoft/CameraTraps)** is the desktop application that wraps it all in a clean UI.
191-
192-
MegaDetector is the entry point. SPARROW Studio is the full platform.
178+
| Repo | Purpose |
179+
| --- | --- |
180+
| [microsoft/Biodiversity](https://github.com/microsoft/Biodiversity) | The umbrella repository — documentation hub for the AI for Good Lab's biodiversity work |
181+
| [microsoft/PytorchWildlife](https://github.com/microsoft/PytorchWildlife) | The collaborative deep learning framework that hosts MegaDetector, species classifiers (AI4G Amazon Rainforest, AI4G Snapshot Serengeti, DeepFaune), HerdNet, PW-Engine (a Rust-based inference core), and demo notebooks |
182+
| [microsoft/SPARROW](https://github.com/microsoft/SPARROW) | Solar-Powered Acoustic and Remote Recording Observation Watch — the AI-enabled edge device that runs MegaDetector in remote field locations |
183+
| [microsoft/MegaDetector-Acoustics](https://github.com/microsoft/MegaDetector-Acoustics) | Bioacoustic models for audio-based wildlife monitoring |
184+
| [microsoft/MegaDetector-Overhead](https://github.com/microsoft/MegaDetector-Overhead) | Point-based detection models for overhead and aerial imagery |
185+
| [/SPARROW-Studio](https://github.com/microsoft/Biodiversity/tree/main/SPARROW-Studio) | The desktop application that wraps it all in a graphical interface |
193186

194-
Source code, framework, and all models live in the [`microsoft/CameraTraps`](https://github.com/microsoft/CameraTraps) repository.
187+
MegaDetector is the entry point for most users. SPARROW Studio is the full platform. SPARROW is the field-hardened edge device.
195188

196189

197190
## Organizations Using MegaDetector
@@ -208,17 +201,17 @@ MegaDetector is used by 80+ organizations across government agencies, universiti
208201

209202
**Platforms**: TrapTagger, WildTrax, Camelot, Animl, Wildlife Observer Network, OCAPI, WildePod
210203

211-
See the [full list](https://github.com/microsoft/CameraTraps#who-uses-megadetector) in the PyTorch Wildlife repository.
204+
See the [full list](https://github.com/microsoft/PytorchWildlife#who-uses-megadetector) in the PyTorch Wildlife repository.
212205

213206

214207
## Performance
215208

216209
| Hardware | Model | Approximate Speed |
217210
| --- | --- | --- |
218-
| NVIDIA RTX 3090 | MDV6-yolov10-c (2.3M) | ~100-200 images/sec |
219-
| NVIDIA RTX 3090 | MDV6-yolov10-e (29.5M) | ~30-60 images/sec |
220-
| Modern CPU (no GPU) | MDV6-yolov10-c (2.3M) | ~2-5 images/sec |
221-
| Google Colab (free GPU) | Any V6 variant | ~10-50 images/sec |
211+
| NVIDIA RTX 3090 | MDV6-yolov10-c (2.3M) | ~100200 images/sec |
212+
| NVIDIA RTX 3090 | MDV6-yolov10-e (29.5M) | ~3060 images/sec |
213+
| Modern CPU (no GPU) | MDV6-yolov10-c (2.3M) | ~25 images/sec |
214+
| Google Colab (free GPU) | Any V6 variant | ~1050 images/sec |
222215

223216
At 50 images/sec on a GPU, **one million images takes about 5.5 hours**. On CPU with the compact model, about 3.9 days.
224217

@@ -235,7 +228,17 @@ Every V6 variant is faster than V5 (139.9M params). The compact V6 is 2% the siz
235228
| V3 | 2019 | Faster R-CNN || Added human class |
236229
| V2 | 2018 | Faster R-CNN || First public release |
237230

238-
For V5 and earlier, see the [archive branch](https://github.com/microsoft/CameraTraps/tree/archive) of the CameraTraps repository.
231+
232+
## MegaDetector V5 and Earlier
233+
234+
For MegaDetectorV5 model weights and earlier versions, see the [archive branch](https://github.com/microsoft/Biodiversity/tree/archive) of the Biodiversity repository (formerly `microsoft/CameraTraps`).
235+
236+
The original MegaDetector repository was primarily developed by **Dan Morris** during his time at Microsoft. Dan continues to actively maintain a forked version at [agentmorris/MegaDetector](https://github.com/agentmorris/MegaDetector), which remains a valuable resource for the community.
237+
238+
239+
## Our Commitment
240+
241+
At the core of our mission is the desire to create a harmonious space where conservation scientists from all over the globe can unite — to share, grow, and use datasets and deep learning architectures for wildlife conservation. We've been inspired by the potential and capabilities of MegaDetector, and we deeply value its contributions to the community. We remain committed to supporting, maintaining, and developing MegaDetector — ensuring its continued relevance, expansion, and utility.
239242

240243

241244
## Citing MegaDetector
@@ -267,14 +270,16 @@ You can also use GitHub's "Cite this repository" button in the sidebar.
267270

268271
## Contributing
269272

270-
MegaDetector's source code and the full PyTorch Wildlife framework live in [`microsoft/CameraTraps`](https://github.com/microsoft/CameraTraps). To contribute code, file issues, or submit pull requests, head there.
273+
MegaDetector's source code lives in this repository. To contribute code, file issues, or submit pull requests, head to [microsoft/MegaDetector/issues](https://github.com/microsoft/MegaDetector/issues).
274+
275+
For framework-level changes (PyTorch Wildlife API, classifiers, demo notebooks), see [microsoft/PytorchWildlife](https://github.com/microsoft/PytorchWildlife). For ecosystem-wide questions, see the [microsoft/Biodiversity](https://github.com/microsoft/Biodiversity) umbrella.
271276

272277
For questions, feature requests, or to report how MegaDetector worked on your data:
273278
- **Email**: [zhongqimiao@microsoft.com](mailto:zhongqimiao@microsoft.com)
274279
- **Discord**: [![Discord](https://img.shields.io/badge/any_text-Join_us!-blue?logo=discord&label=Discord)](https://discord.gg/TeEVxzaYtm)
275-
- **GitHub Discussions**: [microsoft/CameraTraps/discussions](https://github.com/microsoft/CameraTraps/discussions)
280+
- **GitHub Discussions**: [microsoft/Biodiversity/discussions](https://github.com/microsoft/Biodiversity/discussions)
276281

277282

278283
## License
279284

280-
[MIT](LICENSE)
285+
The MegaDetector code is released under the [MIT License](LICENSE). Individual model weights are released under MIT, Apache-2.0, or AGPL-3.0 — see the [Model Variants](#model-variants) table for per-variant licensing.

SECURITY.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
1-
<!-- BEGIN MICROSOFT SECURITY.MD V1.0.0 BLOCK -->
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
22

33
## Security
44

5-
Microsoft takes the security of our software products and services seriously, which
6-
includes all source code repositories in our GitHub organizations.
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8+
9+
## Reporting Security Issues
710

811
**Please do not report security vulnerabilities through public GitHub issues.**
912

10-
For security reporting information, locations, contact information, and policies,
11-
please review the latest guidance for Microsoft repositories at
12-
[https://aka.ms/SECURITY.md](https://aka.ms/SECURITY.md).
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14+
15+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
1340

1441
<!-- END MICROSOFT SECURITY.MD BLOCK -->

0 commit comments

Comments
 (0)