This project aims to classify images of potato plants into three categories: "Potato___Early_blight," "Potato___Late_blight," and "Potato___healthy" using convolutional neural networks (CNNs). The trained model can help in the early detection and diagnosis of potato plant diseases, enabling timely interventions for crop protection and improved yield.
The dataset used for training and evaluation consists of labeled images of potato plants collected from the "PlantVillage" directory. The dataset is divided into training, validation, and test sets, with a split of approximately 80%, 10%, and 10% respectively.
Make sure you have the following libraries installed before running the code:
- TensorFlow
- Keras
- Matplotlib
- Ensure that the dataset is stored in the "PlantVillage" directory.
- Run the code provided in the Jupyter Notebook or Python script to train the CNN model on the potato plant images.
- The model will be trained for the specified number of epochs, and the training and validation accuracy and loss curves will be displayed.
- After training, the model will be evaluated on the test set, and the test accuracy will be reported.
- Additional code snippets are provided to make predictions on individual images and visualize the results.
The trained model can be saved for future use by calling the model.save()
function. The saved model will be stored in the specified directory with
the name "potatoes.h5".
The trained model achieves high accuracy in classifying the potato plant images into the respective disease categories. The accuracy can be further improved by adjusting the hyperparameters, increasing the dataset size, or using more advanced network architectures.
Feel free to modify and use the code for your own purposes.
This project was inspired by the need for accurate and timely identification of potato plant diseases to prevent yield loss and support sustainable agriculture. The dataset used for training the model was sourced from the "PlantVillage" dataset, which provides valuable resources for plant disease research.
[1] PlantVillage Dataset: [link to dataset] https://www.kaggle.com/datasets/arjuntejaswi/plant-village [2] TensorFlow: link to TensorFlow website [3] Keras: link to Keras documentation [4] Matplotlib: link to Matplotlib documentation