Instructions to use aidansbrown/coastaltreemodels with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- DeepForest
How to use aidansbrown/coastaltreemodels with DeepForest:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Treedetect β Coastal Forest Tree-Detection Models
Fine-tuned model weights for Treedetect, a pipeline that turns overhead drone imagery of coastal forest into individual, georeferenced trees labeled alive or standing-dead and tracked across years. Built for the Gedan Lab (George Washington University) to study coastal tree mortality and the forest-to-marsh transition along the Mid-Atlantic United States.
These are the weights only. The full detection β attribute β tracking pipeline, and the code that loads them, live in the Treedetect GitHub repository.
Models in this repository
Treedetect detects with two single-class DeepForest
crown detectors (living crowns and standing-dead snags are split because a combined
model under-recalled dead trees), then a crop classifier re-examines each crown and
assigns a stable Alive / Dead label.
Two detector generations are hosted so every result is reproducible: v1
(oldmodels/) processed the 2019β2025 imagery, and the retrained, higher-precision
v2 (currentmodels/) processed the 2026 imagery. The crop classifier is shared.
| Path | Model | Used on |
|---|---|---|
oldmodels/livemodel2.pth |
Live crown detector β v1 | 2019β2025 |
oldmodels/deadmodel9.pth |
Dead / snag detector β v1 | 2019β2025 |
currentmodels/2026_livemodel.pth |
Live crown detector β v2 | 2026 |
currentmodels/2026_deadmodel.pth |
Dead / snag detector β v2 | 2026 |
crop/cropmodel.ckpt |
CropModel Alive/Dead classifier | both |
Segment Anything (SAM) is used for optional crown-area delineation but is not hosted here β download the official
sam_vit_hcheckpoint from Meta / the SAM repo.
Evaluation
The current models come from a hyperparameter sweep (batch size Γ epochs Γ train/val
split); bs16_ep40_split2 was the best configuration. Recall/precision/ F1 are for
crown detection, IoU-matched against held-out annotations, at an operating score
threshold of 0.3.
| Model | Version | Recall | Precision | F1 |
|---|---|---|---|---|
| Live crown detector | livemodel2 β v1 (2019β2025) |
69.6% | 70.7% | 0.702 |
| Live crown detector | live_bs16_ep40_split2 β v2 (2026) |
70.3% | 74.5% | 0.723 |
| Dead / snag detector | deadmodel9 β v1 (2019β2025) |
72.4% | 58.0% | 0.644 |
| Dead / snag detector | dead_bs16_ep40_split2 β v2 (2026) |
74.7% | 69.9% | 0.723 |
The v2 models improve F1 for both classes. The largest gain is in dead-tree
precision (58.0% β 69.9%) β far fewer false snags β alongside higher dead-tree recall
(72.4% β 74.7%). The live detector also improves on both axes (precision 70.7% β 74.5%).
Recall stays comparable across generations, so switching detectors between the 2019β2025
and 2026 epochs does not bias detection rates in the time series. v2 is hosted as
currentmodels/2026_livemodel.pth / 2026_deadmodel.pth, v1 as oldmodels/livemodel2.pth
/ deadmodel9.pth.
Usage
huggingface_hub is already a Treedetect dependency, so downloading is one line per file
β hf_hub_download returns a local path you hand straight to MortalityPrediction.
(Tag a release and add revision="<tag>" to pin an exact, reproducible set.)
from huggingface_hub import hf_hub_download
REPO = "gedanlab/treedetect" # β replace with your HF repo id
# v2 detectors β used on the 2026 imagery
live = hf_hub_download(REPO, "currentmodels/2026_livemodel.pth")
dead = hf_hub_download(REPO, "currentmodels/2026_deadmodel.pth")
crop = hf_hub_download(REPO, "crop/cropmodel.ckpt")
# v1 detectors β used on 2019β2025 imagery (swap in to reproduce those results)
# live = hf_hub_download(REPO, "oldmodels/livemodel2.pth")
# dead = hf_hub_download(REPO, "oldmodels/deadmodel9.pth")
from Treedetect.liveanddeadmodels import MortalityPrediction
predictor = MortalityPrediction(livemodel=live, deadmodel=dead, cropmodel=crop)
trees = predictor.predict(tile_path="path/to/orthomosaic.tif")
Training
- Backbone: DeepForest (RetinaNet) single-class crown detectors, fine-tuned per class.
- Best config:
bs16_ep40_split2β batch size 16, up to 40 epochs (early-stopped on mAP@50), training split 2 of a multi-split sweep. - Operating threshold: score threshold 0.3 at inference/evaluation.
- Classifier: a ResNet-based CropModel trained on Alive/Dead crops to confirm each detection's state.
Training data & scope
Fine-tuned on manually annotated drone orthomosaics of Mid-Atlantic (Delmarva / Chesapeake) maritime forests spanning a salinity/elevation gradient (Gedan Lab sites, multiple years). The models target loblolly-pine-dominated coastal forest and its forest-to-marsh ecotone.
Intended use & limitations
- Intended use: research detection and mortality monitoring of coastal forest crowns from RGB drone orthomosaics at comparable ground sample distance.
- Out of scope/caveats: performance depends on imagery matching training GSD and radiometry β Treedetect normalizes GSD before inference for this reason. Overhead detection is blind to understory shrubs beneath a living canopy. Standing-dead crown height degrades as snags decay and is hard for ODM to detect, so canopy-height on dead stems is unreliable. Trained on Mid-Atlantic coastal forest; transfer to other forest types is unvalidated.
License & citation
Released under CC-BY-4.0. If you use these models, please cite the Treedetect repository and the associated Gedan Lab publication.
@software{treedetect,
author = {Brown, Aidan and {Gedan Lab}},
title = {Treedetect: coastal forest tree detection and mortality tracking},
url = {https://github.com/AidanSBrown/Treedetect},
year = {2026}
}