Skip to content

microsoft/Pytorch-Wildlife

Repository files navigation

PyTorch-Wildlife — open-source AI framework for wildlife monitoring from the Microsoft AI for Good Lab

PyTorch-Wildlife

Unified open-source AI framework for wildlife monitoring and conservation.
Microsoft AI for Good Lab — camera-trap detection, species classification, bioacoustic analysis, and more.




PyTorch-Wildlife is the collaborative deep learning framework that powers the Microsoft AI for Good Lab's biodiversity work. It hosts detection models, species classifiers, and the tools needed to run them — from single-image inference to large-scale batch processing.

MegaDetector, the most widely used camera-trap detection model in conservation, is invoked through PyTorch-Wildlife. So are the species classifiers for Amazon Rainforest, Snapshot Serengeti, and European ecosystems.

Quick Start

pip install PytorchWildlife
import numpy as np
from PytorchWildlife.models import detection as pw_detection
from PytorchWildlife.models import classification as pw_classification

# Detection — weights download automatically
detection_model = pw_detection.MegaDetectorV6()
detection_result = detection_model.single_image_detection("path/to/image.jpg")

# Classification
classification_model = pw_classification.AI4GAmazonRainforest()
classification_result = classification_model.single_image_classification("path/to/image.jpg")

Try without installing anything:

Available Models

Detection

Model Architecture Description
MegaDetectorV6 YOLOv10 / YOLOv9 / RT-DETR Animal detection in camera-trap images
MegaDetectorV5 YOLOv5 Previous generation, widely deployed
DeepfauneDetector YOLOv8 European ecosystem detection
HerdNet CNN localization Point-based detection for aerial imagery

Classification

Model Description
AI4GAmazonRainforest Species classification for Amazon Rainforest
AI4GSnapshotSerengeti Species classification for African savanna
AI4GOpossum Opossum vs. non-opossum classifier
DeepfauneClassifier European ecosystem species classifier
DFNE Deepfaune fine-tuned for Northeastern North America

See the Model Zoo for full details, performance benchmarks, and version history.

Part of the Biodiversity Ecosystem

PyTorch-Wildlife is part of the larger open-source ecosystem from the Microsoft AI for Good Lab:

Repo Purpose
microsoft/Biodiversity The umbrella repository — documentation hub for the AI for Good Lab's biodiversity work
microsoft/Pytorch-Wildlife This repo — the unified deep learning framework
microsoft/MegaDetector Animal detection in camera-trap imagery
microsoft/SPARROW Solar-Powered Acoustic and Remote Recording Observation Watch — AI-enabled edge device
microsoft/MegaDetector-Acoustic Bioacoustic models for audio-based wildlife monitoring
microsoft/MegaDetector-Classifier Camera-trap species classification fine-tuning — adapt classifiers to your own datasets and geographic regions
microsoft/MegaDetector-Overhead Point-based detection for overhead and aerial imagery
SPARROW Studio Desktop application for running all models with a graphical interface

Questions? Email us or join the Discord

About

PyTorch-Wildlife — Microsoft's collaborative deep learning framework for conservation. Multi-task computer vision and bioacoustic models for camera-trap detection, species classification, and biodiversity monitoring. Maintained by Microsoft AI for Good Lab.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages