DeepForest: A Toolkit of Models for Tree and Wildlife Detection in Aerial Imagery

Models
Object detection
Remote sensing
Ecology
Forest monitoring
Geospatial data
Computer vision
Author

Chris Endemann

Published

April 4, 2025

About this resource

DeepForest is an open-source Python library for object detection in aerial RGB imagery, designed for ecological applications such as identifying tree crowns (the visible upper portion of trees), tracking wildlife, and monitoring habitat. Rather than a single model, DeepForest provides a toolkit of pretrained deep learning models and utilities for training, evaluation, and geospatial integration.

Developed by Ben Weinstein, Sergio Marconi, Mélaine Aubry-Kientz, and Ethan White, DeepForest is maintained by the Weecology Lab. It supports multiple object types, including trees, birds, and livestock, and is built on top of RetinaNet and PyTorch Lightning.

Key features

  • Pretrained (CNN) models for tree crowns, birds, livestock, and alive/dead tree detection
  • Supports bounding boxes, polygons, and point annotations
  • Reads common geospatial formats: CSV, shapefiles, GeoPackages, COCO, VOC
  • Compatible with tile-based prediction and raster workflows
  • Built on RetinaNet with PyTorch Lightning for scalable training

Timeline context

DeepForest builds on progress in object detection and remote sensing for ecological applications:

Model playground

All pretrained models are currently based on RetinaNet and convolutional neural networks (CNNs); no ViTs or transformer-based models (yet). Pretrained models are available via Hugging Face & GitHub: huggingface.co/weecology

  • weecology/deepforest-tree: General tree crown detection
  • weecology/deepforest-bird: Aerial bird detection
  • weecology/deepforest-livestock: Detects large mammals in farmland
  • Alive/dead classifier: Distinguishes dead trees based on RGB appearance

To use these models, you must install the DeepForest Python package:

pip install deepforest

The models are downloaded from Hugging Face but are loaded and run using DeepForest’s own API—not through Hugging Face’s transformers or pipeline tools. Data can be loaded from shapefiles, CSVs, GeoPackages, and other formats using DeepForest’s read_file utility, which standardizes annotations. The package supports both full-image and tile-based inference.

Try the DeepForest demo on Hugging Face to test the model in your browser using single-image uploads.

Transfer learning and fine-tuning

DeepForest supports fine-tuning and transfer learning through its PyTorch Lightning backbone. You can:

  • Fine-tune pretrained models using your own labeled data
  • Customize training behavior by subclassing the DeepForest module
  • Use custom PyTorch dataloaders for advanced workflows (e.g., WILDS-style datasets)
  • Extend the package with new architectures if needed

This makes it easy to adapt DeepForest to new regions, forest types, or species with relatively small amounts of local data.

Performance expectations

Performance varies by imagery quality, tree species, and geographic region. Fine-tuning is recommended for most new applications.

Questions?

If you have any lingering questions about this resource, please feel free to post to the Nexus Q&A on GitHub. We will improve materials on this website as additional questions come in.

See also