Skip to content

Latest commit

 

History

History

README.md

🌿 PlantVillage: CNN-Based Plant Disease Detection

image

A deep learning project designed to detect and classify plant leaf diseases using a custom Convolutional Neural Network (CNN) trained on the PlantVillage Dataset.


📌 Project Overview

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.


🎯 Objectives

  • 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).

🗃️ Dataset

  • Source: Kaggle - PlantVillage Dataset
  • Images: 50,000+ leaf images
  • Categories: 38 (various diseases + healthy conditions)
  • Formats: Color, grayscale, and segmented versions

⚙️ Methodology

  1. Data Preprocessing

    • Image resizing and normalization
    • Training-validation split (80-20)
  2. Model Architecture

    • Custom CNN with Conv2D, MaxPooling, and Dense layers
    • Output layer with Softmax activation for multiclass classification
  3. Training

    • Optimizer: Adam
    • Loss: Categorical Crossentropy
    • Metrics: Accuracy, Precision, Recall
  4. Evaluation

    • Plotted learning curves
    • Assessed overfitting using validation metrics
  5. Deployment

    • Developed a simple Gradio interface for real-time predictions
    plant_disea_output plant_disea_output

🧪 Results

  • Training Accuracy: ~98%
  • Validation Accuracy: ~96%
  • Model Generalization: Good performance with minimal overfitting
  • Deployment: Successfully deployed with Gradio for demo/testing

🛠️ Tools & Technologies

  • Python (TensorFlow, Keras, NumPy, Matplotlib)
  • Jupyter Notebook / Google Colab
  • Gradio (for interactive deployment)
  • Kaggle API (for dataset download)

🚀 How to Use

  1. Clone the repository
  2. Install required packages:
    pip install -r requirements.txt
  3. Run the notebook or Python script
  4. Launch the Gradio interface to make predictions with your own leaf images

📚 References


👤 Author

  • Mubarak Adisa
  • AI & Deep Learning Enthusiast | Civil & Environmental Engineer
  • 🔗 GitHub: AdMub

⭐️ Show your support

If you found this helpful, please ⭐️ the repo and share your thoughts!