Skip to content

naveedamar/leaf-scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaf Scan — Plant Disease Recognition Expert System

An expert system that diagnoses plant diseases from leaf images by combining a CNN deep learning model with a JSON knowledge base to provide symptoms and treatment recommendations.

Disclaimer

The model is trained on the PlantVillage dataset which consists of controlled lab images. It may perform differently on real-world field photographs with varying lighting or backgrounds.

How It Works

Provide a leaf image path to the CLI. The model predicts the disease and the knowledge base returns matching symptoms and recommended treatment.

Core Components

  • CNN Model — trained on the PlantVillage dataset to classify 38 plant disease classes
  • Knowledge Base — JSON file containing symptoms and treatments for each disease
  • CLI App — takes an image path, runs prediction, and displays diagnosis with treatment advice
  • Training Notebook — full training pipeline available on Kaggle

Tech Stack

  • Python
  • TensorFlow / Keras
  • NumPy
  • Kagglehub

Dataset

The model is trained on the PlantVillage dataset. Run the following to download it:

python dataset.py

Make sure your Kaggle API credentials are configured before running. See Kaggle API setup.

Model

The pre-trained model is not included in this repo due to file size (134MB). To get the model:

  • Option A — Run the training notebook on Kaggle: plant-disease-detector-ai-ccp
  • Option B — Download the dataset and retrain locally using the notebook

Place the generated plant_disease_model.keras file in the root project directory.

Setup

Install dependencies:

pip install tensorflow numpy kagglehub

Download the dataset:

python dataset.py

Run the chatbot:

python chatbot.py

Usage

  1. Run python chatbot.py
  2. Enter the file path of a leaf image when prompted
  3. The system will display the diagnosed disease, confidence score, symptoms and recommended treatment
  4. Type exit to quit

A few sample images are available in the test_images/ folder to try out immediately.

About

AI powered plant disease expert system combining a CNN model with a JSON knowledge base for diagnosis and treatment recommendations. Trained on PlantVillage dataset.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors