Weeds to increase crop yields Weeds are an unwanted intruder in the agricultural business. They steal nutrients, water, land, and other critical resources to grow healthy crops. These intruders can lead to lower yields and inefficient deployment of resources by farmers. One known approach is to use pesticides to remove weeds, but aggressive pesticides create health risks for humans. Computer vision technology can automatically detect the presence of weeds and use targeted remediation techniques to remove them from fields with minimal environmental impact.
In this hackathon track, you will be tasked with training and deploying a model into a simulated production environment - where your binary-classification accuracy (F1 score) and inference time will be used to rank you against other teams competing for this track's top spot.
The objective of this project is to develop a computer vision model that can accurately detect and remove weeds in agricultural fields with minimal environmental impact. The proposed approach uses a Residual Network (ResNet) architecture with Auto Mixed Precision (AMP) to classify images of crops and weeds. The use of AMP allows for dynamic adjustment of the precision of computations during training and inference, which can improve the performance of the model. The use of oneAPI Analytical Toolkit will enhance the performance and efficiency of the model, leading to improved crop yields and more efficient use of resources.
The implementation of this project will involve the following steps:
- Collect and label a dataset of images of crops and weeds from real-world environments.
- Use the oneAPI Data Analytics Library (DAL) to preprocess the dataset and prepare it for training.
- Train a ResNet with AMP to classify images as either crops or weeds.
- Optimize the model's performance using the oneAPI Math Kernel Library (MKL) and oneAPI Graph Analytics Library (GAL)
- Use the oneAPI Model Analyzer and Debugger (MAD) to analyze the model's performance and identify any areas for improvement.
- Deploy the trained model to a simulated production environment using the oneAPI Deployment Manager.
- Use the oneAPI Performance Profiler to monitor the model's runtime performance and identify any bottlenecks that may be impacting its performance.
- Continuously monitor the model's performance and make updates as needed to improve its accuracy.
• Intel TensorFlow 2.9 - 2.11
• oneAPI Analyticals toolkit
• OpenCV
• Python >= 3.7
• NumPy
• Pandas
• Matplotlib
-
Install the deep learning framework by following the instructions on the official website (TensorFlow)
-
Install oneAPI toolkit by following the instructions on the official website
-
Install OpenCV and other required python libraries using pip:
Copy the code
pip install opencv-python pip install numpy pip install pandas pip install matplotlib
To install the repositories.intel.com/graphics package repository, you can follow these steps:
- Open your WSL 2 console.
- Execute the following command to install the necessary dependencies:
sudo apt-get install -y gpg-agent wget
- Execute the following command to download and install the GPG key:
wget -qO - https://repositories.intel.com/graphics/intel-graphics.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
- Execute the following command to add the repository to your system:
echo 'deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc' | sudo tee /etc/apt/sources.list.d/intel.gpu.jammy.list
Follow the link for the installation instructions.
Setup environment variables
source /opt/intel/oneapi/setvars.sh
Install the latest Tensorflow and Intel Extension
pip install tensorflow==2.10.0
pip install --upgrade intel-extension-for-tensorflow[gpu]
- Clone the repository:
git clone https://github.com/Nitin-Mane/Automated-Weed-Detection.git
- Download the dataset and place it in the project folder.
!wget <Dataset link>
follow the Baseline notebook file for the download and data processing method.
- Use the oneAPI DAL to preprocess the dataset
Initialize - C:/Program Files (x86)/Intel/oneAPI/setvars.bat | Visual Studio 2022 Community
-
Train the model using the deep learning framework with AMP and oneAPI DNNL. The model trained are available in the following link
-
Optimize the model's performance using oneAPI MKL and GAL
-
Analyze the model's performance using oneAPI MAD
-
Deploy the model to the simulated production environment using oneAPI Deployment Manager
-
Monitor the model's performance using oneAPI Performance Profiler
This project is licensed under the MIT License - see the LICENSE file for details.