Built to order

Weed Detection from Field Images using YOLO

This project trains a YOLOv8 object detector that finds weeds in crop-field photographs and labels each detection with its species and confidence — the core perception step of precision spraying. It is built on the real DeepWeeds dataset (17,509 field images across 8 weed species), and ships with a complete training notebook, detection metrics, the trained weights, and an interactive web demo that draws predicted bounding boxes on sample field photos. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning and Agriculture-related engineering.

Weed Detection from Field Images using YOLO — project thumbnail preview
More project photos (2)

The problem

Blanket herbicide spraying wastes chemical, harms soil and costs farmers money; precision spraying applies herbicide only where weeds are. That needs a vision system that can tell weeds from crops in real field photographs, under real lighting, at camera-trap scale. This project trains YOLOv8s on DeepWeeds — a published dataset of 17,509 rangeland images across 8 weed species plus a negative class — to draw bounding boxes around weeds with species labels and confidence scores. Students learn object detection end to end: annotation formats, anchor-free detection, mosaic augmentation, NMS, and the mAP metrics that actually matter for detectors. The demo overlays representative detections on sample field photos so the pipeline is tangible.

How it works

  1. DeepWeeds images are converted to YOLO annotation format with bounding boxes per weed instance.
  2. Images are resized to 640×640; mosaic and HSV augmentation simulate field lighting variation.
  3. YOLOv8s, pre-trained on COCO, is fine-tuned for 120 epochs with early stopping.
  4. Non-maximum suppression filters overlapping boxes at inference time.
  5. The validation split is evaluated with mAP@0.5 and mAP@0.5:0.95 plus per-species precision-recall.
  6. In the web demo, a sample field photo is shown with representative predicted boxes, labels and confidences.
  7. Trained weights are exported to ONNX with notes on TensorRT conversion for edge deployment.

Tech stack:

  • Python 3, PyTorch
  • YOLOv8 (Ultralytics)
  • DeepWeeds dataset
  • OpenCV (preprocessing)
  • NumPy, Matplotlib
  • HTML/CSS/JS detection demo
  • ONNX export

Dataset & model details

  • Dataset: DeepWeeds — 17,509 field images of 8 weed species (Chinee apple, Lantana, Parkinsonia, Parthenium, Prickly acacia, Rubber vine, Siam weed, Snake weed) plus a negative class, collected in northern Australian rangelands (Olsen et al., 2019); bounding-box annotations in YOLO format for the detection task.
  • Task: Object detection; input = 640×640×3 field photo, output = bounding boxes with species class + confidence per weed instance.
  • Model: YOLOv8s (11.2M parameters): CSPDarknet backbone → PAN-FPN neck → anchor-free decoupled detection head; COCO pre-trained, fine-tuned.
  • Metrics: mAP@0.5 ~0.88 (design target), mAP@0.5:0.95 ~0.71 (design target), precision ~0.90 / recall ~0.86 (design targets). No metric is claimed as measured until the training run is executed for the order.
Parameter Value
Input format 640 × 640 RGB
Classes 8 weed species + background
Dataset size 17,509 images (DeepWeeds)
Model parameters Approximately 11,200,000
mAP@0.5 ~0.88 (design target, not a measured claim)
Training time Approximately 4–6 h on a T4 GPU (expected)
Inference Approximately 22 ms per image on GPU (expected)
Model file Approximately 22 MB (.pt)
Demo Single-file web app with detection overlays

Project features

  • YOLOv8s weed detector Anchor-free detection head trained to localize and classify weeds in field photos, with per-box species label and confidence.
  • Real DeepWeeds dataset 17,509 field images, 8 weed species plus negative class (Olsen et al., 2019) — a published benchmark, not a toy set.
  • Full training notebook Data preparation, YOLO-format labels, mosaic augmentation, training loop and validation in one reproducible notebook.
  • Detection metrics mAP@0.5, mAP@0.5:0.95, precision-recall curves per species — the standard detector evaluation, documented honestly.
  • Interactive detection demo Single-file web app: pick a sample field photo and watch predicted bounding boxes with labels drawn over it.
  • Export-ready weights Trained .pt weights plus ONNX export notes for running on a field edge device.
  • Viva kit Report PDF, presentation PPT and Q&A covering how YOLO works, NMS, anchors vs anchor-free, and mAP.

What is included

  • DeepWeeds preparation scripts + YOLO-format labels
  • Complete training & evaluation Jupyter notebook
  • Trained YOLOv8s weights (.pt) with ONNX export notes
  • Interactive detection web demo with sample field photos
  • mAP tables, PR curves and sample detection sheets
  • Project report PDF (background, YOLO theory, methodology, results)
  • PPT presentation for final review
  • Viva Q&A preparation document

Limitations & prerequisites

  • DeepWeeds covers 8 rangeland species — Indian crop weeds outside these species need additional data.
  • Dense overlapping canopies and heavy occlusion reduce detection quality; stated in the report.
  • mAP figures are design targets, stated honestly — the report documents the actual achieved metrics.
  • The demo shows representative detections on samples; it does not run live YOLO inference in the browser.
  • Sprayer actuation hardware is out of scope — this project is the perception module only.

Frequently Asked Questions

Which dataset is used and why?

DeepWeeds by Olsen et al. (2019): 17,509 field images across 8 weed species plus a negative class. It is a published, peer-reviewed benchmark for exactly this task, so results are comparable and the data story is viva-solid.

Why YOLOv8 and not a classifier?

Spraying needs positions, not just presence — a classifier says 'weed somewhere', YOLO says 'weed here'. The report explains the anchor-free head, the PAN-FPN neck and NMS in viva-ready depth.

How does the demo work?

You pick a sample field photograph and press run; the app draws representative predicted bounding boxes with species labels and confidence scores over the image, matching what the trained detector outputs.

What mAP should I expect?

The design target is mAP@0.5 around 0.88. The report documents the actually achieved mAP@0.5 and mAP@0.5:0.95 on the validation split after the training run — never pre-claimed.

Can it control a sprayer?

Not as shipped — this project delivers the perception module (detections + confidences). Actuation is listed as future scope with interface notes.

Is this project suitable for a final-year project?

Yes — for AI & Machine Learning and agriculture/electronics programs. It demonstrates object detection, a real benchmark dataset, detector metrics and an edge-deployment path. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Electronics and Agriculture-related engineering.

Components & software requirements
  • Python 3, PyTorch
  • YOLOv8 (Ultralytics)
  • DeepWeeds dataset
  • OpenCV (preprocessing)
  • NumPy, Matplotlib
  • HTML/CSS/JS detection demo
  • ONNX export

Dataset & model details

  • Dataset: DeepWeeds — 17,509 field images of 8 weed species (Chinee apple, Lantana, Parkinsonia, Parthenium, Prickly acacia, Rubber vine, Siam weed, Snake weed) plus a negative class, collected in northern Australian rangelands (Olsen et al., 2019); bounding-box annotations in YOLO format for the detection task.
  • Task: Object detection; input = 640×640×3 field photo, output = bounding boxes with species class + confidence per weed instance.
  • Model: YOLOv8s (11.2M parameters): CSPDarknet backbone → PAN-FPN neck → anchor-free decoupled detection head; COCO pre-trained, fine-tuned.
  • Metrics: mAP@0.5 ~0.88 (design target), mAP@0.5:0.95 ~0.71 (design target), precision ~0.90 / recall ~0.86 (design targets). No metric is claimed as measured until the training run is executed for the order.
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation