πΏ Plant Disease Classifier
AI-Powered Plant Disease Detection System
A production-ready deep learning web application that diagnoses diseases in plant leaves using advanced convolutional neural networks (CNNs).

π₯ Video Demonstration
β¨ Features
- π¬ Instant Disease Detection: Upload an image of a plant leaf and get immediate AI-powered diagnosis results
- π Comprehensive Analysis: Provides detailed information on detected diseases, including causes, treatments, and prevention strategies
- π¨ Professional Interface: Clean, intuitive UI with modern styling, image previews, and interactive visualization
- π± Multi-Plant Support: Currently supports tomatoes, potatoes, and bell peppers with 15+ disease classifications
- β‘ High Accuracy: Achieves 96.5% accuracy on test datasets with production-grade performance
- π± Responsive Design: Works seamlessly across desktop and mobile devices
- πΌοΈ Example Gallery: Try the application instantly with pre-loaded example images
π§ͺ Supported Plant Diseases
The model can accurately identify the following plants and diseases:
π
Tomato
- β
Healthy
- π¦ Bacterial Spot
- π Early Blight
- π Late Blight
- π Leaf Mold
- π Septoria Leaf Spot
- π·οΈ Spider Mites
- π― Target Spot
- π Yellow Leaf Curl Virus
- π¦ Mosaic Virus
π₯ Potato
- β
Healthy
- π Early Blight
- π Late Blight
πΆοΈ Bell Pepper
- β
Healthy
- π¦ Bacterial Spot
π§ Model Architecture
The application uses a sophisticated custom CNN architecture with the following components:
- 5 Convolutional Blocks: Advanced feature extraction with batch normalization and ReLU activation
- Global Average Pooling: Reduces overfitting and improves generalization
- Fully Connected Layers: Dense layers with dropout regularization for robust classification
- Data Augmentation: Extensive preprocessing pipeline with rotation, scaling, and color adjustments
- Transfer Learning: Trained on the comprehensive PlantVillage dataset
- Production Optimization: ONNX export for deployment efficiency
- Test Accuracy: 96.5%
- Training Dataset: 54,000+ images
- Validation Split: Stratified 70/15/15 split
- Model Size: Optimized for production deployment
- Inference Time: < 2 seconds per image
π οΈ Technology Stack
Backend & AI
- PyTorch 2.0+: Deep learning framework
- torchvision: Computer vision utilities
- scikit-learn: Data preprocessing and evaluation
- NumPy & Pandas: Data manipulation
- PIL/Pillow: Image processing
Frontend & Deployment
- Streamlit: Interactive web application framework
- Matplotlib & Plotly: Data visualization
- CSS3: Custom styling and responsive design
- HTML5: Semantic markup
Development & Production
- Python 3.8+: Core programming language
- Git: Version control
- Streamlit Cloud: Deployment platform
- ONNX: Model optimization and export
π Quick Start
Prerequisites
- Python 3.8 or higher
- pip package manager
- 4GB+ RAM recommended
Installation
- Clone the repository
git clone https://github.com/Subrata3841/Plant-Disease-Classifier.git
cd Plant-Disease-Classifier
- Install dependencies
pip install -r requirements.txt
- Run the application
- Access the application
- Open your browser and navigate to
http://localhost:8501
- Upload a plant leaf image or try the example images
- Get instant AI-powered disease diagnosis
π Project Structure
Plant-Disease-Classifier/
βββ app.py # Main Streamlit application
βββ plant_disease_classifier.py # Core ML model and training logic
βββ notebook.ipynb # Jupyter notebook for experimentation
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ models/ # Trained model files
β βββ best_model.pth # PyTorch model weights
β βββ class_names.json # Disease class mappings
β βββ inference_transform.pkl # Image preprocessing pipeline
β βββ label_encoder.pkl # Label encoding utilities
β βββ model_config.json # Model configuration
β βββ plant_disease_model.onnx # ONNX optimized model
βββ images/ # Assets and examples
βββ logo.png # Application logo
βββ examples/ # Sample test images
βββ tomato_healthy.jpg
βββ Potato_Late_blight.jpeg
βββ Pepper_bell_Bacterial_spot.jpeg
π₯ Development Team
Devansh Sengar
ML Engineer & Backend Developer
|
Udit Jain
AI Researcher & Model Architect
|
Subrata Mondal
ML Engineer & Backend Developer
|
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
For questions, issues, or suggestions:
π Acknowledgments
- PlantVillage Dataset: For providing the comprehensive plant disease dataset
- PyTorch Community: For the excellent deep learning framework
- Streamlit Team: For the intuitive web application framework
- Open Source Community: For the amazing tools and libraries that made this project possible
πΏ Plant Disease Classifier - Protecting Agriculture with AI πΏ
Β© 2025 All Rights Reserved