Crop Weed Classifier

A YOLOv8n detector that finds and labels plants in field photos as Crop or Weed. Fine-tuned from yolov8n.pt with Ultralytics 8.0.196 on the Crop Weed Classifier dataset (402 images, 640ร—640).

Usage

from huggingface_hub import hf_hub_download
from ultralytics import YOLO

model = YOLO(hf_hub_download("Skriller0208/Crop-Weed-Classifier", "best.pt"))
results = model("field.jpg")
results[0].show()

Classes: 0 = Crop, 1 = Weed.

Files

Path What it is
best.pt Checkpoint trained 3 March 2024. No metrics were saved for this run.
runs/detect/train/weights/best.pt, last.pt Checkpoints from the 19 May 2024 run, same data and settings. The metrics below are for this run.
runs/detect/train/ args.yaml, results.csv, loss/metric curves, confusion matrices, sample batches
runs/detect/val/ Validation curves and prediction samples
runs/detect/predict/, predict2/ Example predictions
data.yaml Dataset config used for training

Training

Setting Value
Base model yolov8n.pt
Epochs 20
Image size 640
Batch size 16
Optimizer auto (lr0 0.01)
Augmentation Ultralytics defaults (mosaic, horizontal flip, HSV)

Full arguments are in runs/detect/train/args.yaml.

Results (19 May 2024 run, validation split, 81 images)

Epoch Precision Recall mAP@0.5 mAP@0.5:0.95
10 0.542 0.631 0.561 0.333
20 0.935 0.821 0.931 0.720

Training curves Confusion matrix

Limitations

Trained on about 280 images for 20 epochs, and validated on 81 images from the same source, so the numbers say little about other crops, growth stages, cameras or lighting. Weed boxes outnumber Crop boxes roughly 3 to 1 in the training data.

Licence

Weights derive from Ultralytics YOLOv8 and are released under AGPL-3.0. The training data is CC BY 4.0.

Downloads last month
49
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train Skriller0208/Crop-Weed-Classifier

Evaluation results

  • precision on Crop Weed Classifier (Auto_Label, validation split)
    self-reported
    0.935
  • recall on Crop Weed Classifier (Auto_Label, validation split)
    self-reported
    0.821
  • mAP@0.5 on Crop Weed Classifier (Auto_Label, validation split)
    self-reported
    0.931
  • mAP@0.5:0.95 on Crop Weed Classifier (Auto_Label, validation split)
    self-reported
    0.720