🌏
Global Academic Platform
Serving Researchers Since 2012

AI-Based Weed Detection with Herbicide Recommendation

DOI : 10.17577/IJERTCONV14IS110065
Download Full-Text PDF Cite this Publication

Text Only Version

AI-Based Weed Detection with Herbicide Recommendation

Abhitha K. Asharaf¹ and Shivanjali Kesharwani²

¹Student, Department of BCA, St. Francis College, Bengaluru, India

‌2Assistant Professor, Department of BCA, St Francis college, Bengaluru,India Email: abhitha2006abhin@gmail.com

Email: shivanjali.k@stfranciscollege.edu.in

ABSTRACT

Weeds are one of the most persistent problems farmers face they grow alongside crops, they compete for water and nutrients, and can significantly cut yield if left undetected and unchecked. Locating them manually across a large field takes considerable effort and is rarely precise, especially for someone without agricultural expertise. This paper explores how deep learning can make that process faster and more reliable. The paper proposed a system around the YOLOv8 object detection model that identifies weeds directly from crop-field images. The user uploads a photo through a web interface, and the model checks it for weeds. Unlike a typical detection tool, the system doesn't stop at flagging a weed's presence, it also names the species and suggests a suitable herbicide with dosage prescribed, giving farmers an output they can act on directly. The system is built in Python using the ultralytics YOLO framework for training, OpenCV for image handling, and Flask for the web application. It is trained on 320 labelled images covering 45 weed species, reaching 82% mAP on the validation set.

The goal is to bridge the gap between detection and action -offering a practical framework rather than raw output . Future work includes data expansion, aerial imagery and benchmarking against other detection architectures

Keywords : Computer Vision, Weed Detection, YOLO, Precision Agriculture, Deep Learning

  1. ‌Introduction :

    Crop farming is a fundamental part of agriculture, and contributes significantly to the economy Increased crop production provides food, income and employment to thousands and millions of people. As the basis of global food security, crops depend on effective field management throughout their growth period maintain quality. Agriculture is therefore essential for both food production and crop cultivation .

    Crops are the foundation of global food security; the quality depends on how well the field is managed during the growth. However, crops face several challenges including climate changes, pollution, waste generation, food wastage and also forming environmental problems. Among these challenges ,weed growth in the agricultural farms is one of the most serious problems affecting crop production.

    Weeds are unwanted plants that grow along with the crops .Weeds compete with the crops for getting useful resources like water, minerals, nutrients, space and sunlight. This can

    negatively affect the crop development and lead to a reduction in overall crop yield. Thus, farmers have been using different techniques to detect and control the weeds in the agricultural fields. However , manually identifying and removing the weeds can be very time- consuming and requires effort, especially when huge agricultural field has to be inspected. The biggest problem is the similarity between the crops and weeds in terms of colour, shape and other morphological characteristics. Traditionally, the weed removal ad the crop growth were manually observed by the farmers , so the farmers used hands and some equipment tools for the removal.

    To overcome these problems , deep learning and computer vision have been widely adopted for automatic weed detection. Various frameworks have been proposed, including object- detection models like YOLO, Faster R-CNN and Centernet which deliver promising results in differentiating crops from weeds agricultural imagery

    A recent study explored real-time weed detection using cameras and edge devices, making automated weed detection more practical for field applications.

    Although these systems can detect the weed and classify the weeds, detection the weed alon doesnt provides sufficient support for the effective field management. Farmers also need to know the specific weed species to determine tailored management strategies and evaluate the subsequent success of those interventions. This creates a need for an intelligent system that can provide actionable insights far beyond basic identification.

    To address this gap,this paper proposes the use of YOLO- based deep learning framework that not only detects weeds and identifies their precise locations in real time via camera feeds but also generated relevant herbicide recommendations. This approach offers a more practical, efficient and scalable solution for optimising crop production and quality yield.

  2. Literature Review

    ‌Automated weed detection has progressed a lot in recent time. Earlier systems relied on basic image processing and simple machine learning techniques ,but recent work entirely shifted towards deep learning and real-time object detection. These advanced models allow vision systems to identify and locate the weeds accurately in field imagery, opening the doors for site-specific weed management.‌

    1. Existing Research

      Current literature in this field falls into three categories : Core detection frameworks ,

      ‌Purpose-driven agricultural datasets ,Task-specific model improvements

    2. Object Detection architecture and Field Application

      ‌The real-time field systems took momentum when Redmon et al. [1] introduced You Only Look Once (YOLO). This is a combination of bounding box prediction and class identification to form a single neural network pass, YOLO drastically cut processing time compared to the two -stage detectors , making real-time detection possible-even though early versions found difficulty in detecting smaller weeds [1] . At present, frameworks like Ultralytics YOLOv8[2] serve as standard benchmark for computer vision in agriculture due to their balance in speed and accuracy, though their success still heavily relies on diversity of the underlying training data [2].

      Rai et al.[4] and Shen et. Al [9] discuss the broader aspect that promises practical hurdles for bringing these models into the fields. Where Rai et al. [2] highlights how computer vision can reduce herbicide overuse and save manual labour, Shen at al. [9] points out that running heavy detection or segmentation models on lower-end farm hardware remains a major bottleneck. A comparative analysis by Zhao and Wang[8] carries it further , highlighting that while object detectors strike a good balance between speed and precision, getting them to bring on field consistently and along with varying weather conditions is still a challenge.

    3. ‌Datasets and Model Adaptations

      A major hurdle in training reliable models is having enough data. Olsen et al. [3] helped address this by creating DeepWeeds , a large multiclass dataset designed specifically for weed identification in practical field environments with real conditions. However, they noted that changes in lighting,soil conditions and crop appearences across different regions can still degrade the model accuracy when applied to new fields[3]. To handle these variant factors and conditions several researchers have tailored network architectures for specific crops. For example, Chen et al.[5] modified a YOLO model with attention mechanisms and feature fusion for sesame fields,which significantly reduced missed detections in dense crop rows. Similarly the YOLOWeeds project evaluated 18 different variatios of YOLO on a 12-class weed dataset in cotton fields, showing that targeted data augmentation noticeably improves multi-class accuracy[6] .

      Apart from bounding boxes, researchers have also tested semantic segmentation for fine-grained pixel separation. Hashemi-Beni et al. [7] evaluated architectures like U-Net, SegNet and DeepLabv3+ using drone footage to distinguish weeds from crops,though at a later stage they found that visually similar early0stage crops and weeds often led to misclassifications[7] . A very recent development proposed by WeedNet , using a foundation model with global-to-local feature extraction to boost species identification. Though it is accurate,its high computing requirements makes it difficult to deploy on standard farm equipments.[10]

    4. Common Challenges in Field Detection

      ‌Across different literature and research several recurring isssues makes vision-based detection challenging in real -world environments :

      Messy Field Composition- Varying soil colour,texture, shadows,crop residue and changing daylight makes it hard to distinguish weeds from the background.[9]

      Visual Similarities : During early growth stages, many weed varieties look similar in colour, texture and leaf shapes .

      Overlapping leaves and small plants: young weeds are often buried under crop leaves or overlapped by other plants ,hiding key features from the camera[5][9].

      Changing appearance: Weeds change dramatically in shape and size as they grow , meaning models trained on mature plants often miss younger ones[3][8].

      Data scarcity: Rare or regional weed species often lack sufficient labelled imagery, limiting how well models perform in different geographical areas.[2][3]

    5. Research Gap and Proposed Contribution

      While existing deep learning models are doing great job of finding and classifying weeds , most existing work stops at detection stage. Current systems usually produce a bounding box or label, but fail to provide clear next steps or giving practical implementation to manage what

      was detected.[4][8]

      To bridge this gap between raw model prediction and practica farm management, we propose an integrated web application based on YOLO that goes beyond basic detection :

      Herbicide guided species identification: The proposed suggests effective recommendations and dosage specific herbicide options instead of just flagging the weeds. Before and After removal tracking and report: Using a camera-based image comparison tool, the application compares the before-and-after images and does a comparative percentage calculation of weeds successfully removed and gives a confidence score for the treatment. Actionable Prioritization and Image Checks: The system scores weed patchers based on urgency and hence users know where the act first. It also checks the image quality in real time , alerting users to re-capture for accurate results.

      By unifying real-time detection with species-specific decision support and automated efficacy tracking ,this research aims to advance computer vision models from simple detection tools towards complete precision agriculture framworks.

  3. ‌Methodology:

    The following research proposes unified approach to using YOLO based object detection for identifying the weed from the given dataset or agricultural images, along with herbicide recommendation for the weed removal and also shows the confidence level of the weed present

    1. ‌Data Collection

      The first step for is to collecting the images which contains the different type weeds and crops. The dataset used in the project contain 320 labelled images covering 45 weed species . In this dataset different types of weed has been added so that the model can identify and learn the different types of weed.

    2. ‌Image Labelling

      Each weed present in the agricultural images is annotated using bounding boxes and it will be respectively assigned to its classes. This provides the model with information about both the location and class of each weed.

    3. Data Pre-processing

      ‌After the annotation is done, the images are pre-processed by re-sizing them to a standard size and dividing them into training, validation and testing sets. This provides uniform inputs for the YOLO model and supports effective training and performance evaluation.

    4. Model Training

      ‌A YOLO-based object detection model is trained using the agricultural dataset. During the training model learns the visual features to different weed species and uses them to detect and classify weeds in agricultural images.

    5. ‌Model Evaluation

      The developed model has been tested on the unseen images to determine how accurate the model works by detecting and identifying the weed species. Precision , recall, and mAP are used as the evaluation measures

      Precision=TP/(TP+FP) Recall=TP(TP+FN) F1=2PR/(P+R)

      Training curves, the confusion matrix and the PR curves generated by ultralytics were used to inspect crop-versus-weed confusion.

    6. ‌Weed Detection and Identification

      The trained model has been deployed to a web application to process uploaded agricultural images. It analyses user-uploads and images and locates the weeds present and using the bounded boxes with corresponding names.

    7. ‌Herbicides Information

      After detecting the weed species, the system will display the relevant herbicides based on the weed species, allowing the users to understand the possible chemicals to control for managing the weed detection.

    8. ‌Real time Camera Detection

      The system is equipped with the Real time Camera Detection. This will repeatedly monitor the agricultural scene. The YOLO model analyses the captured frames and detects the presence of weeds, classifies its species and its location.

    9. ‌Weed Removal Analysis:

      The proposed system performs a before and after weed removal analysis for calculating the approximate percentage of weed detection with the confidence level. This feature helps to evaluate the effectiveness of the implemented weed detection management.

      start

      Image annotation Data Training/validation/

      preprocessing testing split

      YOLO model

      selection

      Image upload/Camera

      input

      Weed

      detection

      Display result

      Herbicides

      information

      Camera based real-

      time detection

      Before and after

      comparison

      System integration

      Data collection

End

Results/

‌Flowchart of the Methodology

  1. ‌Results and Discussion:

    The developed AI based weed detection was evaluated using the prepared agricultural image dataset. The YOLO-based model is trained to detect and used to identify different types of weed species from the agricultural images. The model achieved approximately 82% mAP on the validation dataset, indicating that it was able to detect the target weed class with satisfactory performance.

    The system will successfully identifies the weed using the bounding boxes around objects and displaying their weed names. Instead of classifying the whole image as a single category, the proposed system will identify individual weeds and their positions. By providing both the location and identify weeds, the system offers a bigger and greater practical value for agricultural weed-management applications.

    The trained model was incorporated into a flask web application for the practical weed detection. Users can upload the images of an agricultural fields, and then the system will automatically detect the weed present in the image. The detected weed are marked with the bounding boxes and their names displaying alone with the detected results. This system will also provide relevant herbicides information according to the weed present in the image. By combining weed detection, species identification, and herbicides information in one application, the proposed system provides a more solution than a system that only detect or classifies weed.

    1. ‌Performance and functional results of the proposed system

      Parameter

      Results/observation

      Dataset size

      320 labelled images

      Number of weed species

      45 weed species

      Detection model

      YOLO-based deep learning model

      Validation performance

      82% mAC

      Input

      Agricultural field images

      Detection output

      Weed location and bounding boxes

      Identification output

      Weed species names

      Additional information

      Relevant herbicides information

      Web framework

      Flask

      Image processing

      OpenCV

      Camera support

      Real-time camera based detection

  2. ‌Comparative Analysis:

    Comparative analysis: Various techniques have been investigated for weed detection, such as conventional image-processing techniques, machine-learning techniques, and deep learning techniques.The proposed system is therefore evaluated comparatively with the existing approaches by considering their detection methods, features-learning capabilities, practical applications and limitations

    1. ‌Comparison of basic weed detection and proposed system

      System features

      Basic weed detection system

      Proposed system

      Weed

      Detection

      Available

      Available

      Weed species identification

      May be limited

      supported

      Weed location detection

      Basic/varies

      Supported using YOLO

      Herbicides information

      Generally not provided

      Provided

      Real time camera detection

      May not be available

      Supported

      Wed based interface

      Varies depending on the system

      Flask based application

      Practical weed- management support

      Limited

      enhanced

  3. ‌Conclusion:

    The study presented an AI based weed detection framework that offers an efficient method for weed detection and identification. A YOLO-based model is trained to locate and classify different weed species from the agricultural images. The model achieved approximately 82% mAP (Average Precision) onto the validated dataset.This clearly shows that it can effectively work on selected classes of species

    To bridge the gap between the theoretical modelling and real time field application ,the framework was integrated into a Flask-drive web platform.The system supports both static images and real time image capturing which can effectively help detect the weeds .The detected weeds are then identified according to their respective species and additionally provide herbicide recommendation for same.

    In addition to this , a comparative image-analysis before and after weed removal helps in estimating the percentage of weed elimination. Overall, this integrated system provides a robust foundation for precision and smarter data-driven agriculture management.

  4. ‌Future work:

    Future development will focus on strengthening the model by using a large and move by using a large and more diverse collection of agricultural images. Images containing different weed species, crops, growth stages, backgrounds, and lighting conditions can be included to make the model more effective in the practical agricultural environment

    Future development focuses on strengthening the model by taking a expanded dataset with diverse collection of agricultural images .

    • Drone-based images to identify and monitor weeds across larger farming areas that provides larger coverage and hence large-scale weed assessment.

    • Improved precision in real time camera to enhance the detection speed and stability under different outdoor and environment conditions.

    • Multiple YOLO variants and other object-detection techniques can be used to identify an appropriate model in terms of detection accuracy,computational efficiency and processing time.

    • The weed-removal component can be improved by applying more precise image- comparison techniques to obtain reliable estimates of weed reduction before and after removal.

    • Accurate Crop and weed detection model to classify them appropriately for more precise field analysis

  5. ‌References:

  1. J.Redmon, S. Divvala, R. Girshick, and A. Farhadi, you only look once: unified, real- time object detection,in proceesings of the IEEE conference on computer vision and pattern recognition(CVPR), 2016, pp. 779-788.

  2. G. Jocher, A. Chaurasia, and J. Qiu, Ultralytics YOLOv8, Ultralytics, 2023. [Online].

    Available: https://github.com/ultralytics/ultralytics

  3. A. Olsen, D. A. Konovalov, B. Philippa, P. Ridd, J. C. Wood, J. Johns, W. Banks, B. Girgenti, O. Kenny, J. Whinney, B. Calvert, M. Rahimi Azghadi, and R. D. White,

    DeepWeeds: A Multiclass Weed Species Image Dataset for Deep Learning, scientific reports, vol. 9, Art. no. 2058, 2019.

  4. N. Rai, Y. Zhang, B. G. Ram, L. Schumacher, R. K. Yellavajjala, S. Bajwa, and X. Sun, Applications of deep learning in precision weed management: A review, computer and electronics in agriculture, vol. 206, Art. no. 107698, 2023

  5. J. Chen, H. Wang, H. Zhang, T. Luo, D. Wei, T. Long, and Z. Wang, Weed detection in sesame fields using a YOLO model with an enhanced attention mechanism and feature fusion, computer and electronics in agriculture, vol. 202, Art. no. 107412, 2022.

  6. F. Dang, D. Chen, Y. Lu, and Z. Li, YOLOWeeds: A novel benchmark of YOLO object detectors for multi-class weed detection in cotton production systems, computer and electronics in agriculture,, vol. 205, Art. no. 107655, 2023.

  7. L. Hashemi-Beni, A. Gebrehiwot, A. Karimoddini, A. Shahbazi, and F. Dorbu, Deep Convolutional Neural Networks for Weeds and Crops Discrimination From UAS Imagery, frontiers in remote sensin, vol. 3, Art. no. 755939, 2022.

  8. H. Zhao and Y. Wang, Deep learningbased approaches for weed detection in crops,

    frontiers in the plant science, vol. 16, Art. no. 1746406, 2026.

  9. P. Shen, T. Li, Y. Sun, H. Cui, and G. Zhang, A Review of Deep Learning-Based Precision Weed Detection in Farmland Environments, Computer materials and continua, vol. 89, no. 2, 2026.

  10. Y. Shen, T. T. Ayanlade, V. N. Boddepalli, M. Saadati, A. Rairdin, Z. K. Deng, M. A. Arshad, and S. Chiranjeevi, WeedNet: A foundation model-based global-to-local AI approach for weed species identification and classification, natural communication, 2026.

****