Grassland Weeds models
YOLO models that find four common grassland weeds in photos: dock, cow parsley, stinging nettle and thistle. All models are fine-tuned from Ultralytics YOLO with the same dataset and the same training script, so they can be compared side by side. Detection models return a class, confidence and bounding box per plant; segmentation models also return a pixel mask.
Models
| Model | Task | Architecture | Params | Val set | Best / run epochs | Box mAP@50 | Box mAP@50-95 | Mask mAP@50 | Mask mAP@50-95 | Inference | Trained |
|---|---|---|---|---|---|---|---|---|---|---|---|
grassland_weedsV1.pt | detect | YOLO26m | 21.78 M | 81be1793 | 24 / 44 | 0.760 | 0.532 | – | – | 5.6 ms | 2026-09-17 |
grassland_weedsV1-seg.pt | segment | YOLO26m-seg | 26.98 M | unknown | 52 / 72 | 0.825 | 0.531 | 0.830 | 0.583 | 7.4 ms | 2026-09-15 |
Newest model first. Scores are on the validation split of each model. Val set is a fingerprint of the validation images: models with the same fingerprint were evaluated on exactly the same images and can be compared directly. With different fingerprints, differences of a few points can come from the split alone. Read the limitations before you rely on these numbers.
Per class (mAP@50-95, number of validation instances in brackets)
| Model | Metric | Dockweed | Cow Parsley | Nettle | Thistle |
|---|---|---|---|---|---|
grassland_weedsV1 | Box mAP@50-95 | 0.560 (128) | 0.445 (4) | 0.846 (2) | 0.275 (19) |
grassland_weedsV1-seg | Box mAP@50-95 | 0.720 (113) | 0.244 (7) | 0.701 (13) | 0.459 (15) |
grassland_weedsV1-seg | Mask mAP@50-95 | 0.728 (113) | 0.344 (7) | 0.769 (13) | 0.491 (15) |
Classes
| ID | Class name | Species | Dutch name |
|---|---|---|---|
| 0 | Dockweed | Dock, Rumex spp. (e.g. broad-leaved dock, R. obtusifolius) | Ridderzuring |
| 1 | Cow Parsley | Cow parsley, Anthriscus sylvestris | Fluitenkruid |
| 2 | Nettle | Stinging nettle, Urtica dioica | Grote brandnetel |
| 3 | Thistle | Thistle, Cirsium spp. (e.g. creeping thistle, C. arvense) | Distel |
Usage
pip install "ultralytics>=8.4.48" huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
# Pick any weights file from the table above
weights = hf_hub_download(repo_id="YOUR_USERNAME/grassland_weeds", filename="grassland_weedsV1.pt")
model = YOLO(weights)
results = model.predict("field_photo.jpg", imgsz=640, conf=0.25)
for r in results:
for cls_id, conf, box in zip(r.boxes.cls, r.boxes.conf, r.boxes.xyxy):
print(model.names[int(cls_id)], f"{float(conf):.2f}", [round(v) for v in box.tolist()])
# segmentation models only: r.masks.xy contains one polygon per detected plant
r.save("field_photo_pred.jpg")
From the command line, after downloading the weights:
yolo predict model=grassland_weedsV1.pt source=path/to/images imgsz=640 conf=0.25
Training data
The dataset is a custom set of smartphone photos of weeds, labeled with polygons in YOLO segmentation format. Detection models use the enclosing bounding box of each polygon.
- Labeling: each species was annotated as its own single-class dataset. The four sets were merged into one 4-class dataset and split randomly per image into 75% training and 25% validation. The split is made again before a training run, so the exact split can differ per model (see the data split table of each model).
- Images: full-resolution smartphone photos (Google Pixel, 4080 × 3072, landscape and portrait), plus 237 dock images that were exported from Roboflow at 640 × 640. Some of those are crops of larger photos.
- Photographed: dock in July 2025, May and September 2026; cow parsley in September 2026; nettle in May and September 2026; thistle in May, June and September 2026.
- Preprocessing: during training, images are resized to 640 px on the long side.
Training setup
All models are trained with the same script and settings. Anything a model does differently is listed in its own section below.
| Setting | Value |
|---|---|
| Epochs | Maximum 100, early stopping with patience 20 |
| Selected checkpoint | Epoch with the highest validation fitness (mAP@50-95; box + mask for segmentation) |
| Batch size | 8 |
| Image size | 640 |
| Optimizer | AdamW(lr=0.00125, momentum=0.9) (picked by optimizer=auto), weight decay 0.0005 |
| Learning rate schedule | 3 warm-up epochs, then linear decay (lrf = 0.01) |
| Mixed precision | AMP |
| Seed | 0, deterministic |
| Augmentation | Setting |
|---|---|
| Mosaic | 1.0 |
| Rotation | ±10° |
| Translation | ±10% |
| Scaling | ±50% |
| Horizontal flip | p = 0.5 |
| HSV hue / saturation / value | 0.015 / 0.7 / 0.4 |
| Albumentations | Blur (p = 0.01), MedianBlur (p = 0.01), ToGray (p = 0.01), CLAHE (p = 0.01) |
| Not used | vertical flip, shear, perspective, mixup, cutmix, copy-paste |
Model details
grassland_weedsV1
| Weights file | grassland_weedsV1.pt (best epoch, FP16, 44.0 MB) |
| Task | Object detection (bounding boxes) |
| Architecture | YOLO26m, fine-tuned from yolo26m.pt (COCO-pretrained) |
| Parameters | 21.78 M (20.35 M after layer fusion) |
| Compute | 74.7 GFLOPs (67.9 fused) |
| Input size | 640 × 640 |
| Epochs | stopped after 44 of max. 100 (patience 20), best epoch 24 |
| Training time | about 29 minutes |
| Software | Ultralytics 8.4.48, PyTorch 2.8.0+cu128, Python 3.12.7 |
| Hardware | NVIDIA GeForce RTX 5060 Ti (16 GB) |
| Training date | 2026-09-17 |
| Validation set | 81be1793 |
Data split
| Class | Train images | Train instances | Val images | Val instances |
|---|---|---|---|---|
| Dockweed | 269 | 364 | 93 | 128 |
| Cow Parsley | 5 | 10 | 3 | 4 |
| Nettle | 16 | 38 | 2 | 2 |
| Thistle | 32 | 46 | 10 | 19 |
| Total | 322 | 458 | 108 | 153 |
Training progress (validation after each epoch, all epochs in results/grassland_weedsV1.csv)
| Epoch | Box mAP@50 | Box mAP@50-95 |
|---|---|---|
| 1 | 0.047 | 0.017 |
| 10 | 0.375 | 0.247 |
| 20 | 0.493 | 0.319 |
| 24 (best) | 0.760 | 0.533 |
| 30 | 0.686 | 0.518 |
| 40 | 0.655 | 0.522 |
| 44 (last) | 0.656 | 0.514 |
Evaluation (final validation of the selected checkpoint, fused, 640 px)
Box
| Class | Images | Instances | Precision | Recall | mAP@50 | mAP@50-95 |
|---|---|---|---|---|---|---|
| all | 108 | 153 | 0.543 | 0.823 | 0.760 | 0.532 |
| Dockweed | 93 | 128 | 0.648 | 0.828 | 0.806 | 0.560 |
| Cow Parsley | 3 | 4 | 0.622 | 0.832 | 0.725 | 0.445 |
| Nettle | 2 | 2 | 0.337 | 1.000 | 0.995 | 0.846 |
| Thistle | 10 | 19 | 0.566 | 0.632 | 0.513 | 0.275 |
Speed: 0.3 ms preprocess, 5.6 ms inference, 0.3 ms postprocess per image.
Notes
- Low precision (0.54) with high recall (0.82) at the default threshold: expect false positives. A higher
confthreshold can reduce them. - Validation scores went up and down strongly between epochs and the best score came from a single epoch (24), so the reported numbers may be partly luck.
- Only 2 nettle and 4 cow parsley validation instances; the nettle mAP@50 of 0.995 says very little.
grassland_weedsV1-seg
| Weights file | grassland_weedsV1-seg.pt (best epoch, FP16, 54.5 MB) |
| Task | Instance segmentation (boxes + masks) |
| Architecture | YOLO26m-seg, fine-tuned from yolo26m-seg.pt (COCO-pretrained) |
| Parameters | 26.98 M (23.51 M after layer fusion) |
| Compute | 131.9 GFLOPs (121.2 fused) |
| Input size | 640 × 640 |
| Epochs | stopped after 72 of max. 100 (patience 20), best epoch 52 |
| Training time | about 53 minutes |
| Software | Ultralytics 8.4.48, PyTorch 2.8.0+cu128, Python 3.12.7 |
| Hardware | NVIDIA GeForce RTX 5060 Ti (16 GB) |
| Training date | 2026-09-15 |
| Validation set | unknown |
Data split
| Class | Train images | Train instances | Val images | Val instances |
|---|---|---|---|---|
| Dockweed | 273 | 379 | 89 | 113 |
| Cow Parsley | 6 | 7 | 2 | 7 |
| Nettle | 12 | 27 | 6 | 13 |
| Thistle | 31 | 50 | 11 | 15 |
| Total | 323 | 463 | 108 | 148 |
Background images without objects: 1 in train.
Training progress (validation after each epoch, all epochs in results/grassland_weedsV1-seg.csv)
| Epoch | Box mAP@50 | Box mAP@50-95 | Mask mAP@50 | Mask mAP@50-95 |
|---|---|---|---|---|
| 1 | 0.122 | 0.079 | 0.122 | 0.083 |
| 10 | 0.448 | 0.294 | 0.465 | 0.277 |
| 20 | 0.542 | 0.304 | 0.527 | 0.347 |
| 30 | 0.616 | 0.437 | 0.628 | 0.444 |
| 40 | 0.662 | 0.390 | 0.707 | 0.443 |
| 50 | 0.805 | 0.525 | 0.814 | 0.548 |
| 52 (best) | 0.826 | 0.532 | 0.831 | 0.584 |
| 60 | 0.852 | 0.522 | 0.866 | 0.538 |
| 70 | 0.810 | 0.520 | 0.831 | 0.546 |
| 72 (last) | 0.833 | 0.542 | 0.866 | 0.572 |
Evaluation (final validation of the selected checkpoint, fused, 640 px)
Mask
| Class | Images | Instances | Precision | Recall | mAP@50 | mAP@50-95 |
|---|---|---|---|---|---|---|
| all | 108 | 148 | 0.827 | 0.708 | 0.830 | 0.583 |
| Dockweed | 89 | 113 | 0.856 | 0.814 | 0.903 | 0.728 |
| Cow Parsley | 2 | 7 | 1.000 | 0.350 | 0.699 | 0.344 |
| Nettle | 6 | 13 | 0.616 | 0.866 | 0.918 | 0.769 |
| Thistle | 11 | 15 | 0.836 | 0.800 | 0.798 | 0.491 |
Box
| Class | Images | Instances | Precision | Recall | mAP@50 | mAP@50-95 |
|---|---|---|---|---|---|---|
| all | 108 | 148 | 0.825 | 0.707 | 0.825 | 0.531 |
| Dockweed | 89 | 113 | 0.845 | 0.805 | 0.896 | 0.720 |
| Cow Parsley | 2 | 7 | 1.000 | 0.350 | 0.699 | 0.244 |
| Nettle | 6 | 13 | 0.618 | 0.874 | 0.918 | 0.701 |
| Thistle | 11 | 15 | 0.835 | 0.800 | 0.785 | 0.459 |
Speed: 0.3 ms preprocess, 7.4 ms inference, 0.9 ms postprocess per image.
Notes
- Validation split made before the bbox model's split, so its validation images differ from
grassland_weedsV1(fingerprint unknown). - Cow parsley has only 2 validation images (7 instances); its recall of 0.35 rests on very little data.
Intended use
- Detecting (and, with the segmentation models, outlining) dock, cow parsley, nettle and thistle in grassland photos. Examples are weed mapping, counting plants, or the vision part of a field robot for targeted weed control.
- Research and prototyping, or as a starting point for further fine-tuning.
Out of scope: other plant species, and fully automatic weed control without human checks. The models only know these four classes and may label similar-looking plants as one of them.
Limitations
These apply to all models. Model-specific points are in the notes of each model.
- The dataset is small and imbalanced. About 430 images, of which 84% are dock. Cow parsley has only 8 images, and nettle and thistle are also under-represented.
- Per-class scores are unreliable. The minority classes have only a handful of validation instances (see the numbers in brackets), so a few images can change their scores a lot.
- There is no separate test set. The validation split is also used for early stopping and for picking the checkpoint, so the reported metrics are optimistic.
- Train and validation may overlap. The split is random per image. Photos taken seconds apart of the same spot, and several crops of one original photo, can end up in both splits.
- Each image was labeled for one species. Plants of another class that are visible in the same image may be unlabeled and treated as background.
- Conditions are limited. The photos are from July 2025 and May–September 2026, and most are 4080 × 3072 smartphone photos. Other growth stages, seasons, regions, camera heights (for example drones) or lighting may give worse results.
- Small plants are hard to detect. The models work at 640 px, so small plants in large photos shrink to a few pixels. A larger
imgszor tiled inference can help.
License
The weights are released under AGPL-3.0, the license of Ultralytics YOLO, which these models are based on. Using them outside the AGPL terms (for example in closed-source commercial products) requires an Ultralytics Enterprise License. The training images are not part of this repository.
Files
| File | Description |
|---|---|
grassland_weedsV1.pt | YOLO26m weights (epoch 24, FP16) |
grassland_weedsV1-seg.pt | YOLO26m-seg weights (epoch 52, FP16) |
results/grassland_weedsV1.csv | Losses, metrics and learning rates per epoch for grassland_weedsV1 |
results/grassland_weedsV1-seg.csv | Losses, metrics and learning rates per epoch for grassland_weedsV1-seg |
models/*.json | Metadata per model, used to generate this card |
card_tool.py | Script that adds models and regenerates this card |
README.md | This model card |
Acknowledgements
Built with Ultralytics YOLO (documentation).