lm3_specimen_detector__yolo26n_det_640
YOLO26n object detector for the Specimen box: the region of a herbarium sheet that holds the plant material. We trained this model to place bounding boxes around plant material, and it was used in the preprocessing step for training the LeafMachine3 specimen segmentation models, but it is not used directly in LeafMachine3.
LM3 metadata
| Field | Value |
|---|---|
| LM3 action | specimen_detector (not a LeafMachine3 stage) |
| LM3_default_model | false |
| LM3_version | none (no LeafMachine3 release loads this model) |
| Model key | yolo26n_det_640 (training run yolo26n-det-640, checkpoint last.pt, epoch 300) |
| Architecture | YOLO26n detect, end-to-end (NMS-free) |
| Base weights | yolo26n.pt (Ultralytics, AGPL-3.0) |
| Input size | 640 letterbox, RGB |
| Classes (1) | Specimen |
| Trained | 2026-10-20 |
| Iteration | 2 |
Files
| Folder | File | Use |
|---|---|---|
pytorch/ | last.pt | Ultralytics, retraining |
onnx/ | model.onnx | onnxruntime |
torchscript/ | model.torchscript | libtorch |
openvino/ | model_openvino_model/ | Intel CPU/iGPU |
coreml/ | model.mlpackage/ | Apple devices |
docs/ | overlay_*.jpg | examples (see Examples) |
SHA-256 of every file is in manifest.json.
Training data
Dataset LM3_Plant_Specimen, built 2026-07-23 from LM3_Plant (83 Labelbox projects, built 2026-06-26, frozen 80/10/10 split, salt lm3, class hash 79dc7b10a5c4): the Specimen class only, with LM3_Plant's images and splits; sheets without a Specimen box are left out. 23,034 images. Images and labels are not distributed.
| Split | Images | Specimen boxes | Sheets left out (no Specimen box) |
|---|---|---|---|
| train | 18,444 | 26,631 | 553 |
| val | 2,332 | 3,407 | 70 |
| test | 2,258 | 3,297 | 69 |
Training
300 epochs, no early stopping, cosine LR, batch 76 (auto), close_mosaic=150. Augmentation: hsv 0.015/0.7/0.4, degrees 15, translate 0.1, scale 0.5, shear 2, perspective 0.0005, flipud 0.5, fliplr 0.5, mosaic 1.0, mixup 0.15, erasing 0.4, randaugment. Published checkpoint: the final epoch (last.pt), the one the weak-label build used; the best-mAP checkpoint (epoch 136, val mAP50-95 0.789 vs 0.776) is not published.
Evaluation
| Split | mAP50 | mAP50-95 | Precision | Recall |
|---|---|---|---|---|
| val | 0.913 | 0.775 | 0.946 | 0.853 |
| test | 0.918 | 0.785 | 0.937 | 0.862 |
At the confidence the weak-label build used (0.35), exported ONNX, each predicted box matched one-to-one to a hand-drawn box at IoU >= 0.5:
| Split | Hand-drawn boxes | Predicted boxes | Precision | Recall | F1 | Mean IoU of matches |
|---|---|---|---|---|---|---|
| val | 3,407 | 3,163 | 0.933 | 0.866 | 0.899 | 0.919 |
| test | 3,297 | 3,129 | 0.922 | 0.875 | 0.898 | 0.919 |
Examples
Test-split sheets, one per institution, picked at random. Cyan: this model at confidence 0.35, labeled with its confidence; white dashed: the hand-drawn Specimen box. Hand-drawn boxes follow each labeler's convention: on sheet 4 one box was drawn around several plants, which the model boxes one by one. Full-size images are in docs/.
Use in LeafMachine3
Not used by LeafMachine3. In the LeafMachine3 training workspace the exported ONNX (onnx/model.onnx) ran through LeafMachine3's own YOLO detector backend at confidence 0.35 on 27,772 herbarium images (the deduplicated union of the plant and archival detector training images). Each predicted box became a Specimen region (weak plant evidence) in a dense weak-label dataset, from which the masks for training the specimen segmentation models are derived.
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
path = hf_hub_download("phyloforfun/lm3_specimen_detector__yolo26n_det_640", "onnx/model.onnx")
boxes = YOLO(path, task="detect").predict("sheet.jpg", imgsz=640, conf=0.35)[0].boxes
Citation
Weaver, W. N. (2026) LeafMachine3. https://leafmachine.org