/project-shiva-46

project-shiva-46 created by GitHub Classroom

Primary LanguageJupyter Notebook

🌱 AI Image Recognition - Weed Detection 🌿

Dinesh Etukuru 20200242 || Shivaamruth Uppala 22201745

πŸ“– Introduction

In modern agriculture, optimizing crop yield is vital amidst weed-related challenges. We tackle this by innovatively employing 🧠 CNNs and 🌌 Darknet to distinguish crops from weeds


Weed Detection


🎯 Goal:

Develop and optimize a tailored object detection model by seamlessly integrating πŸ” YOLO architecture into πŸŒ‘ Darknet. Leveraging 🧠 CNNs enhances accuracy and efficiency, enabling precise crop and weed differentiation in agricultural images. This project aims to establish a foundation for effective weed management and cultivation strategies.


πŸ“Š Dataset

We have collected 2000 images containing a diverse representation of both weed and crop. This dataset includes prior information regarding bounding boxes and class labels, recorded within a dedicated text file. This text file provides essential information, including class labels, Normalized coordinates (X and Y), as well as dimensions (Width and Length).


βš™οΈ Setup:

This Repository is divided into two parts:

1. Training 
2. Performig detection 
    - Using jupyter and openCV 

πŸš€ 1) Training:

  • First, πŸš€ git clone and upload the WeedDetection folder into Google Drive.
  • Now, in Google Drive, open the main.ipynb file, under WeedDetection->WeedDetectionSystem, where you will find comprehensive documentation regarding training the model.
  • Note : The image dataset is placed in the following link. Copy the file and place it in the following path WeedDetection->WeedDetectionSystem in google drive.
  • (DO NOT UNZIP AFTER PLACING IT)
  • Images-with-bounding-boxes

πŸ› οΈ Setting up the Environment:

  • First of all you need anaconda, if you don't have click here for the installation. Anaconda here

  • Next download and save the testing_and_detection folder to your local system from google drive located under the folder WeedDetection.

  • Open Anaconda launcher and upload the folder testing_and_detection.

    How?

    • Select the "file option" --> Open from path --> provide path --> Open.
    • path example: C:\Users\SHIVAAMRUTH UPPALA\OneDrive\Desktop\WeedDetectionSystem\testing_and_detection.


πŸ”Ž 2) Performing Detection :

  • For detection, you need weights for 🧠 CNN.
  • These weights file must be placed in the below mentioned path in your local system once the model is trained:
  • WeedDetection-->testing_and_detection-->data-->weights.
  • Now, open Weed_Image_Recognition.ipynb under WeedDetection-->testing_and_detection-->detection and run each cell for results.

πŸ“œ Note:

Important: We have already generated the weight file and placed it in the designated Google Drive link. This step was taken to minimize the training time required. If you decide not to conduct the training, you can utilize this file. Please be aware that training this model typically takes 6-7 hours.


‡️ Results:

  • LOSS CURVE:

Weed Detection


  • Weed Detection:

Weed Detection


  • Metrics for trained Weights:

Weed Detection

  • Average IOU (Intersection Over Union): 71%
  • Mean Average Precision: 77%

πŸ”— References:

  1. Redmon, J. (2015, June 8). You Only Look Once: Unified, Real-Time Object Detection. arXiv:1506.02640.
  2. Wang, C. Y. (2022, July 6). YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. arXiv:2207.02696.
  3. Alexey. β€œAlexeyAB/Darknet.” GitHub, 21 Aug. 2020, DARKNET