A deep learning project designed to detect and classify plant leaf diseases using a custom Convolutional Neural Network (CNN) trained on the PlantVillage Dataset.
Agricultural crop diseases significantly impact food security and farmer livelihoods. This project aims to automate the identification of plant diseases using computer vision, enabling fast and accurate diagnosis through images of plant leaves.
Using the publicly available PlantVillage dataset, the model classifies leaves into 38 classes, including both healthy and diseased categories.
- Build a Convolutional Neural Network to classify plant diseases from leaf images.
- Evaluate model performance on unseen data.
- Deploy the model with an interactive web interface for real-time predictions (Gradio).
- Source: Kaggle - PlantVillage Dataset
- Images: 50,000+ leaf images
- Categories: 38 (various diseases + healthy conditions)
- Formats: Color, grayscale, and segmented versions
-
Data Preprocessing
- Image resizing and normalization
- Training-validation split (80-20)
-
Model Architecture
- Custom CNN with Conv2D, MaxPooling, and Dense layers
- Output layer with Softmax activation for multiclass classification
-
Training
- Optimizer: Adam
- Loss: Categorical Crossentropy
- Metrics: Accuracy, Precision, Recall
-
Evaluation
- Plotted learning curves
- Assessed overfitting using validation metrics
-
Deployment
- Developed a simple Gradio interface for real-time predictions
- Training Accuracy: ~98%
- Validation Accuracy: ~96%
- Model Generalization: Good performance with minimal overfitting
- Deployment: Successfully deployed with Gradio for demo/testing
- Python (TensorFlow, Keras, NumPy, Matplotlib)
- Jupyter Notebook / Google Colab
- Gradio (for interactive deployment)
- Kaggle API (for dataset download)
- Clone the repository
- Install required packages:
pip install -r requirements.txt
- Run the notebook or Python script
- Launch the Gradio interface to make predictions with your own leaf images
- Mohanty, S. P., Hughes, D. P., & Salathé, M. (2016). Using Deep Learning for Image-Based Plant Disease Detection. Frontiers in Plant Science, 7, 1419.
- PlantVillage on Kaggle
- Gradio Documentation
- Mubarak Adisa
- AI & Deep Learning Enthusiast | Civil & Environmental Engineer
- 🔗 GitHub: AdMub
If you found this helpful, please ⭐️ the repo and share your thoughts!
