๐ฑ Plant Disease Prediction A deep learning web app to classify plant diseases from leaf images
Plant Disease Prediction is a deep learning project that classifies plant diseases from leaf images, using convolutional neural networks and a deployable web interface.
Early detection of plant diseases is vital in agriculture โ farmers worldwide lose significant yield each year due to disease spread. With this tool, users (farmers, agronomists, researchers) can upload a leaf image and instantly obtain a diagnosis, helping mitigate losses.
The model is trained on the PlantVillage dataset and wrapped in a Streamlit app for ease of use.
- Upload a leaf image (JPG/PNG) via web app โ get disease prediction + confidence score
- Visualize training history (accuracy & loss plots)
- CNN-based model trained on the PlantVillage dataset (38 classes)
- Saved model (
.h5) +class_indices.jsonfor mapping - Support for retraining / extending to new classes
๐ 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 ๐ง shraddhagreddy@gmail.com
๐ก Always open to collaboration & feedback!
๐ License
This project is licensed under the MIT License ยฉ 2025 Shraddha Reddy. See the LICENSE file for details.