Skip to content

Thistle Weed Detection Using Bounding Boxes (Case Study)

Location: (agricultural land)

Project Overview

Nazru’s AI platform was deployed to automatically detect and localise thistle weeds in agricultural fields using standard bounding box (bbox) object detection. The system identifies individual thistle plants and outputs rectangular boxes tightly enclosing each detected weed.

The Challenge

Thistle detection in crop fields (e.g., wheat) faces several difficulties:

  • Visual similarity between thistle and the main crop (wheat) in terms of colour and morphology.

  • Occlusion where wheat plants partially hide thistles.

  • Scale variation from small seedlings to mature plants.

  • Complex field backgrounds with mixed vegetation, soil, and shadows.

  • The need for real-time or near-real-time detection to enable timely weed management (spot spraying, mechanical removal).

The Nazru Solution

Nazru’s platform integrated high-resolution field imagery (from drones, ground vehicles, or fixed cameras) with a state-of-the-art object detection deep learning model (e.g., YOLOv7, YOLOv8, or Faster R-CNN). Based on recent research, an improved YOLOv7 architecture (CSCW-YOLOv7) has demonstrated excellent performance for thistle detection in complex wheat fields, achieving a mean Average Precision (mAP) of 94.4%. Our algorithms automatically:

  • Detect thistle weeds across the entire field of view.

  • Output axis-aligned bounding boxes defined by top-left corner (x1, y1) and bottom-right corner (x2, y2) (or centre, width, height).

  • Classify each detection as thistle (single class, or potentially multi-class if other weeds are included).

  • Handle overlapping and occluded thistles using advanced loss functions like Wise Intersection over Union (WIoU).

  • Detect small-scale thistles using techniques like CARAFE up-sampling operators.

Key Results & Benefits

  • Accurate thistle localisation – bounding boxes provide precise location for targeted intervention.

  • High detection performance – based on recent research, precision of 97.7%, recall of 98%, and mAP of 94.4% for thistle detection in wheat fields.

  • Handling of complex field conditions – robust to occlusion, scale variation, and visual similarity with crops.

  • Real-time capability – optimised lightweight models (e.g., CSCW-YOLOv7 compresses parameters by 10.7% and reduces FLOPs by 10%).

  • Supports precision agriculture – enables spot spraying, reduced herbicide use, lower costs, and environmental benefits.

  • Seamless integration – bounding box outputs can be directly fed to robotic sprayers, drones, or GIS platforms for field scouting.

Key Technologies Used

  • Object detection with deep learning – YOLOv7, YOLOv8, or Faster R-CNN architectures.

  • Improved up-sampling – CARAFE operator for small target detection.

  • Feature enhancement – SE (Squeeze-and-Excitation) networks and CoT (Contextual Transformer) modules.

  • Occlusion-aware loss – Wise Intersection over Union (WIoU) for overlapping weeds.

  • Model compression – reduced parameters and FLOPs for edge deployment.

  • Data augmentation – to handle lighting, scale, and background variations.

Output Format (Bounding Boxes)

  • Primary output: Bounding boxes in standard formats:

    • bbox: [x1, y1, x2, y2] or [cx, cy, width, height] (normalised or pixel coordinates)

    • Formats: COCO JSON, YOLO .txt, PASCAL VOC XML, CSV, or GeoJSON.

Sample image from fixed gate camera – AI‑based vehicle damage detection using oriented bounding boxes (rotating rectangles)