YOLOv7-CBAM and DeepSORT with pixel grid analysis for Real-Time weed localization and Intra-Row density estimation in apple orchards

Lawrence Arthur, Sadjad Mahnan, Long He, Magni Hussain, Paul Heinemann, Caio Brunharo

Research output: Contribution to journalArticlepeer-review

Abstract

In precision weed management, accurate detection, localization, and density estimation of weeds are crucial for effective decision-making. However, complex settings such as apple orchards, crop canopies, and low-hanging branches obstruct traditional top-view camera systems, requiring a side-view camera configuration that often leads to partial weed visibility and occlusion overlaps, resulting in misclassification or tracking loss of weeds. To address these challenges, this study enhances the YOLOv7 segmentation model with a Convolutional Block Attention Module (CBAM) for improved feature extraction and real-time detection of weed species. We integrated the DeepSORT algorithm, leveraging its robust tracking capabilities with a dynamic Kalman filtering cross-line mechanism to minimize detection loss from occlusions across frames. The enhanced model achieved a mean Average Precision (mAP) of 84.9% for segmentation and 83.6% for localization, while tracking performance showed a Multiple Object Tracking Accuracy (MOTA) of 0.82, Multiple Object Tracking Precision (MOTP) of 0.78, and an Identification F1-score (IDF1) of 0.88, with only six identity switches. Additionally, a novel pixel grid-based method estimates weed density at 75%, 50%, and 25% mask coverage thresholds, delivering a detailed and actionable assessment of the weed severity baseline. The effective quantification and enhanced detection and tracking capabilities of the model imply that precision weed management decisions in apple orchards can be significantly improved.

Original languageEnglish (US)
Article number111071
JournalComputers and Electronics in Agriculture
Volume239
DOIs
StatePublished - Dec 2025

All Science Journal Classification (ASJC) codes

  • Forestry
  • Agronomy and Crop Science
  • Computer Science Applications
  • Horticulture

Fingerprint

Dive into the research topics of 'YOLOv7-CBAM and DeepSORT with pixel grid analysis for Real-Time weed localization and Intra-Row density estimation in apple orchards'. Together they form a unique fingerprint.

Cite this