Skip to content

shraddhagreddy/Plant_disease_prediction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python TensorFlow Streamlit License: MIT

๐ŸŒฑ Plant Disease Prediction

Plant Disease Prediction is a deep learning project designed to classify plant diseases from leaf images using Convolutional Neural Networks (CNNs). It provides a simple Streamlit web app where users can upload an image of a leaf and instantly get a prediction about the plantโ€™s health.

This project aims to assist farmers, researchers, and agricultural experts in early disease detection to improve crop yield and reduce losses.

โœจ Features

๐Ÿง  CNN-based model trained on the PlantVillage Dataset

๐Ÿ“‚ Supports multiple plant types and disease categories

๐Ÿ“ธ Image upload & classification via Streamlit

โšก Real-time prediction with accuracy & confidence scores

๐Ÿ“Š Training history visualization (accuracy & loss plots)

๐Ÿ’พ Model + class mapping saved for easy deployment

๐Ÿ“‚ Project Structure Plant_disease_prediction/ โ”‚โ”€โ”€ app/ # Streamlit app files โ”‚โ”€โ”€ model_training_notebook/ # Jupyter notebooks for training โ”‚โ”€โ”€ test_images/ # Sample test images โ”‚โ”€โ”€ Plant-Model/ # Trained models & class indices โ”‚ โ”œโ”€โ”€ plant_disease_prediction_model.h5 โ”‚ โ”œโ”€โ”€ class_indices.json โ”‚ โ”œโ”€โ”€ model-training.py โ”‚โ”€โ”€ README.md โ”‚โ”€โ”€ LICENSE

๐Ÿš€ Getting Started โœ… Prerequisites

Python 3.7+

TensorFlow / Keras

NumPy, Pandas

Matplotlib, Pillow

Streamlit

โš™๏ธ Setup Instructions

Clone the repository:

git clone https://github.com/shraddhagreddy/Plant_disease_prediction.git cd Plant_disease_prediction

Install dependencies:

pip install -r requirements.txt

Download the PlantVillage Dataset and place it inside your working directory.

๐Ÿ‹๏ธ Model Training

Run the training script:

python Plant-Model/model-training.py

This will:

Train the CNN on the dataset

Save the trained model as plant_disease_prediction_model.h5

Generate class_indices.json for mapping predictions

๐ŸŒ Running the Streamlit App

Run the web app with:

streamlit run app/app.py

Upload a leaf image (.jpg, .jpeg, .png)

Get instant disease predictions ๐ŸŽ‰

๐Ÿ“Š Example Results Training Performance

Model achieves ~92% validation accuracy (update after training).

Sample Prediction

Upload a leaf image โ†’ Prediction: Apple Scab ๐Ÿ๐Ÿ‚

๐Ÿ”ฎ Future Improvements

Add Grad-CAM visualizations for explainable AI

Deploy model to cloud (AWS/GCP/Heroku)

Improve accuracy with transfer learning (ResNet, EfficientNet)

Add mobile app integration for farmers

๐Ÿ›  Tech Stack

Language: Python

Frameworks: TensorFlow, Keras, Streamlit

Data: PlantVillage Dataset

Libraries: NumPy, Pandas, Matplotlib, Pillow

๐Ÿ‘ฉโ€๐Ÿ’ป Author

Shraddha Reddy ๐Ÿ“ง [email protected]

๐Ÿ’ก Always open to collaboration & feedback!

๐Ÿ“œ License

This project is licensed under the MIT License ยฉ 2025 Shraddha Reddy. See the LICENSE file for details.

About

Deep learning model for detecting plant diseases using CNN and Streamlit.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published