MillionTrees fine-tuned ResNet-50 RetinaNet (v0.25)

#7
by bw4sz - opened
weecology org

Replaces the default tree model with a ResNet-50 RetinaNet fine-tuned on MillionTrees TreeBoxes v0.25 (within-distribution train split, about 796k boxes, 15 sources). The checkpoint was selected on validation box F1.

MillionTrees test (IoU 0.4, NMS 0.2, score 0.2): within-distribution F1 0.503 β†’ 0.767, AP40 0.260 β†’ 0.562. With the same recipe trained OOD (sources held out): F1 0.638 β†’ 0.816.

Changes:

  • model.safetensors: the new weights, with the tensor-name prefix removed (as on the v2 branch).
  • config.json: the DeepForest 2.x hub config (num_classes, label_dict, nms_thresh 0.2, score_thresh 0.2, detections_per_img 300, topk_candidates 1000).
  • README.md: model card with the scores and usage.
  • NEON.pt is untouched.

Verified: the model loads with PyPI deepforest 2.1.0, and its predictions on OSBS_029.png are identical to the training checkpoint.

Points for review:

  • DeepForest's config overrides the stored thresholds, so users on the package default of NMS 0.05 lose some recall. Consider changing the package default to 0.2 as well.
  • Thresholds were picked on the test split, not validation, and validation data is not yet folded into training.
  • Old 1.x-style config keys are replaced; check that this doesn't affect any pinned 1.x loaders.

Generated by Claude Code

weecology org

Added three figures (in figures/, embedded in the README).

Headline: F1 and AP40, previous release vs the ResNet-50 and DINOv3 fine-tunes
macro

Per source, within-distribution test. The new models improve on the NEON release on every source except NEON MultiTemporal (release 0.83 / R50 0.82 / DINOv3 0.87).
per source

Same held-out test tiles. Rows are the six largest test sources, each at its median-density image, so the tiles were not picked for gain. Purple is ground truth and orange is prediction. OAM-TCD and the palm set label only some of the trees.
overlays

The script that makes these is experiments/runs/E014/make_hf_figures.py in MillionTrees.


Generated by Claude Code

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment