This repository contains code and data for a pest and disease prediction project using transfer learning. The project aims to classify images into 38 different classes representing various pests and diseases affecting plants. By leveraging transfer learning, we can utilize the knowledge learned from pre-trained models on a large dataset and adapt it to our specific task with a relatively smaller dataset, thereby achieving higher accuracy and efficiency.
The dataset used for this project consists of labeled images of plants affected by different pests and diseases. It comprises 38 classes, each representing a specific pest or disease category. The images are collected from diverse sources and preprocessed to ensure consistency and data quality.
Before running the code, ensure you have the following dependencies installed: Python 3.10+ TensorFlow Keras NumPy Pandas Matplotlib Scikit-learn Jupyter Notebook (optional, for running the provided notebook) You can install the required packages using pip:
The transfer learning approach utilizes a pre-trained deep learning model as the backbone and adds a few layers on top to adapt it to the specific classification task. For this project, we have chosen the ResNet-50 architecture as our pre-trained model due to its proven effectiveness in image recognition tasks.
Clone the repository to your local machine: git clone https://github.com/your-username/pest-disease-prediction.git Acquire the dataset and place it in the appropriate folder:
Place the images in the 'data' folder with the following directory structure:
Adjust hyperparameters (e.g., learning rate, batch size, etc.) in the configuration file if needed. Train the model Evaluate the model on the validation dataset: Make predictions on new images:
After training the model, the evaluation metrics, such as accuracy, precision, recall, and F1 score, will be displayed. Additionally, you can visualize the training and validation loss and accuracy curves in the provided Jupyter Notebook.
This project demonstrates how to employ transfer learning to build an accurate pest and disease prediction model, even with limited data. By utilizing a pre-trained model like ResNet-50V2, we can efficiently learn and classify various plant health issues. Researchers and enthusiasts can further extend this work with larger datasets, different pre-trained models, or explore fine-tuning options to improve the model's performance.
Kindly contact [email protected]