Advanced AI-powered plant health diagnosis using traditional machine learning
π Live Demo β’ π Documentation β’ π οΈ Installation β’ π€ Contributing
- π Overview
- β¨ Features
- π― Supported Diseases
- π§ AI Models
- π Live Demo
- π¦ Installation
- π οΈ Usage
- ποΈ Architecture
- π Performance
- π§ Configuration
- π€ Contributing
- π License
- π¨βπ» Author
Plant Disease AI Assistant is a comprehensive web application that leverages traditional machine learning algorithms to diagnose plant leaf diseases with high accuracy. Built with Streamlit and powered by multiple ML models, it provides real-time analysis, treatment recommendations, and detailed analytics for plant health management.
- π¬ Multi-Model AI: 6 different machine learning algorithms for robust predictions
- π¨ Modern UI: Beautiful, responsive interface with multiple themes
- π Secure Authentication: Role-based access control system
- π Advanced Analytics: Comprehensive tracking and visualization
- β‘ Real-time Processing: Instant disease detection and analysis
- π± User-Friendly: Intuitive interface for both experts and beginners
- πΌοΈ Image Upload: Support for JPG, PNG, JPEG formats
- π Feature Extraction: Advanced color and texture analysis (LBP)
- π― Multi-Model Prediction: 6 different ML algorithms
- π Confidence Scoring: Detailed probability analysis
- π Batch Processing: Process multiple images simultaneously
- π Multiple Themes: Light, Dark, and Colorful modes
- π± Responsive Design: Works on desktop and mobile devices
- π Smart Notifications: Real-time alerts and updates
- π Interactive Dashboards: Beautiful charts and visualizations
- πΎ Data Export: CSV and JSON export functionality
- π€ User Authentication: Secure login/registration system
- π₯ Role Management: Admin and user roles with different privileges
- π User Management: Admin panel for user administration
- π Session Management: Secure session handling
- π Usage Analytics: Track user activity and system performance
- π Prediction History: Complete tracking of all analyses
- π Performance Metrics: Model accuracy and confidence trends
- π― Health Distribution: Visual representation of plant health
- π Treatment Tracking: Monitor treatment effectiveness
- π₯ Data Export: Download reports in multiple formats
The application can classify plant leaves into 4 distinct categories:
| Disease Type | Severity | Description | Treatment |
|---|---|---|---|
| π’ Healthy | None | No disease detected | Continue regular care |
| π Rust | Medium | Fungal disease with orange spots | Apply copper-based fungicide |
| π€ Scab | Medium | Bacterial disease with dark lesions | Use sulfur-based fungicide |
| π΄ Multiple Diseases | High | Multiple disease symptoms | Consult plant specialist |
The application uses 6 different machine learning models for robust predictions:
| Model | Type | Accuracy | Speed | Use Case |
|---|---|---|---|---|
| π³ Random Forest | Ensemble | 94.2% | Fast | General accuracy |
| π― SVM (RBF) | Kernel Method | 91.8% | Medium | Complex patterns |
| π Gradient Boosting | Boosting | 93.5% | Slower | High accuracy |
| π³οΈ Voting Ensemble | Combined | 96.1% | Medium | Best overall |
| π₯ K-Nearest Neighbors | Lazy Learner | 89.3% | Fast | Simple patterns |
| π Logistic Regression | Linear | 87.6% | Very Fast | Baseline comparison |
The system extracts 16 features from each image:
- Color Features: RGB mean and standard deviation (6 features)
- Texture Features: Local Binary Pattern (LBP) histogram (10 features)
Experience the application live:
πΏ Try Plant Disease AI Assistant
Demo Credentials:
- π¨βπΌ Admin:
admin/admin123 - π€ User:
user/user123
- Python 3.8 or higher
- pip package manager
- Git
git clone https://github.com/Its-Kratik/Leafwise_Assistant.git
cd Leafwise_Assistant# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtstreamlit run app.pyThe application will be available at: http://localhost:8501
- Register/Login: Create an account or use demo credentials
- Choose Theme: Select your preferred interface theme
- Upload Image: Drag and drop or select a plant leaf image
- Analyze: Click "Analyze Now" for instant results
- Review Results: View prediction, confidence, and treatment recommendations
- Single image analysis
- Real-time processing
- Instant results with confidence scores
- Treatment recommendations
- Multiple model comparison
- Detailed probability analysis
- Feature extraction visualization
- Batch processing capability
- Disease-specific recommendations
- Treatment schedules
- Prevention tips
- Progress tracking
- Prediction History: Complete log of all analyses
- Performance Metrics: Model accuracy and trends
- Health Distribution: Visual representation of results
- Export Options: Download data in CSV/JSON format
Plant Disease AI Assistant/
βββ π app.py # Main Streamlit application
βββ π requirements.txt # Python dependencies
βββ π README.md # Project documentation
βββ π LICENSE # MIT License
βββ π .devcontainer/ # Development container config
β βββ π devcontainer.json
βββ π models/ # Trained ML models
βββ π³ plant_disease_rf_model.joblib
βββ π― plant_disease_svm_model.joblib
βββ π plant_disease_gb_model.joblib
βββ π³οΈ plant_disease_voting_model.joblib
βββ π₯ plant_disease_knn_model.joblib
βββ π plant_disease_logreg_model.joblib
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Streamlit | Web interface and user experience |
| ML Framework | Scikit-learn | Machine learning algorithms |
| Image Processing | OpenCV, PIL | Image analysis and feature extraction |
| Data Processing | Pandas, NumPy | Data manipulation and analysis |
| Visualization | Plotly, Matplotlib | Charts and graphs |
| Authentication | Custom implementation | User management and security |
- Overall Accuracy: 95%+ across all disease types
- Processing Speed: < 2 seconds per image
- Model Reliability: 6-model ensemble for robust predictions
- Feature Extraction: 16-dimensional feature vector
- Concurrent Users: Supports multiple simultaneous users
- Memory Usage: Optimized for efficient resource utilization
- Scalability: Modular architecture for easy scaling
- Reliability: Comprehensive error handling and validation
The application supports three themes:
- π Light: Clean, professional interface
- π Dark: Easy on the eyes, modern look
- π Colorful: Vibrant, engaging design
- Auto-analyze: Automatically process uploaded images
- Advanced Metrics: Show detailed feature analysis
- Notifications: Enable/disable system alerts
- Data Retention: Manage prediction history
- Password Requirements: Minimum 6 characters
- Session Management: Secure session handling
- Role-based Access: Different privileges for admin/user
- Data Privacy: User-specific data isolation
We welcome contributions! Here's how you can help:
- Check existing issues to avoid duplicates
- Create a new issue with detailed description
- Include steps to reproduce the problem
- Add screenshots if applicable
- Describe the feature you'd like to see
- Explain the use case and benefits
- Provide examples if possible
- Discuss implementation approach
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit with descriptive messages
- Push to your branch and create a pull request
# Clone and setup
git clone https://github.com/Its-Kratik/Leafwise_Assistant.git
cd Leafwise_Assistant
# Install development dependencies
pip install -r requirements.txt
# Run in development mode
streamlit run app.py --server.port 8501This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 Kratik Jain
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Kratik Jain
π LinkedIn β’ π§ Email β’ π GitHub
Plant Disease AI Assistant - Made with β€οΈ using Streamlit, OpenCV, and Scikit-learn