PlantGuard is an intelligent deep learning-based plant disease detection system designed to help farmers and gardeners identify and manage crop diseases effectively. Using convolutional neural networks (CNNs), the system classifies images of plant leaves into different disease categories across 9 different plant types, enabling early detection and timely intervention.
Deployed Version: Access the live application on the Streamlit platform here.
The system can detect 26+ different conditions across 9 plant types:
- Apple Scab
- Black Rot
- Cedar Apple Rust
- Healthy
- Powdery Mildew
- Healthy
- Common Rust
- Gray Leaf Spot
- Northern Leaf Blight
- Healthy
- Black Rot
- Esca (Black Measles)
- Leaf Blight
- Healthy
- Bacterial Spot
- Healthy
- Bacterial Spot
- Healthy
- Early Blight
- Late Blight
- Healthy
- Leaf Scorch
- Healthy
- Bacterial Spot
- Early Blight
- Late Blight
- Healthy
The project employs DenseNet, a state-of-the-art deep learning architecture known for its dense connectivity pattern, which enhances feature propagation and encourages feature reuse. Each plant type has a dedicated fine-tuned model trained on the PlantVillage dataset, ensuring specialized and accurate disease classification.
Model Architecture:
- Base: DenseNet (pre-trained on ImageNet)
- Input Size: 256x256 pixels
- Output: Multi-class classification (plant-specific diseases)
- Total Models: 9 specialized models (one per plant type)
β
Detection of 26+ plant diseases across 9 crop types
β
User-friendly web interface with real-time predictions
β
Comprehensive disease information including:
- Detailed descriptions
- Symptoms identification
- Treatment recommendations
- Preventive measures
β Plant type selection for targeted disease detection
β Image upload support (JPEG, PNG, JPG)
β Visual feedback with prediction confidence
β Dockerized deployment for easy setup
- Python 3.9+
- TensorFlow 2.15.0 - Deep learning framework
- Keras - Neural network API
- Streamlit 1.30.0 - Web application framework
- NumPy 1.24.4 - Numerical computing
- Pandas 2.2.0 - Data manipulation
- Matplotlib 3.8.4 - Visualization
- Docker - Containerization
PlantGuard/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker configuration
βββ LICENSE.txt # License information
βββ README.md # Project documentation
βββ Dataset/
β βββ train/ # Training images (organized by plant/disease)
β βββ valid/ # Validation images
β βββ test/ # Test images
βββ models/
β βββ apple_model.h5 # Apple disease detection model
β βββ cherry_model.h5 # Cherry disease detection model
β βββ corn_model.h5 # Corn disease detection model
β βββ grape_model.h5 # Grape disease detection model
β βββ peach_model.h5 # Peach disease detection model
β βββ pepper_model.h5 # Pepper disease detection model
β βββ potato_model.h5 # Potato disease detection model
β βββ strawberry_model.h5 # Strawberry disease detection model
β βββ tomato_model.h5 # Tomato disease detection model
βββ src/
β βββ disease_information.py # Disease descriptions and treatments
βββ notebooks/
β βββ *.ipynb # Model training notebooks
βββ test/
βββ Model Testing.ipynb # Model evaluation notebook
The project uses the PlantVillage Dataset with the following structure:
- Training Set: Images organized by plant type and disease category
- Validation Set: Separate validation images for model tuning
- Test Set: Hold-out test set for final evaluation
Images are RGB, resized to 256x256 pixels for model input.
- Python 3.9 or higher
- pip (Python package manager)
- Virtual environment (recommended)
- Docker (optional, for containerized deployment)
- Clone the repository:
git clone https://github.com/miteshgupta07/PlantGuard.git
cd PlantGuard- Create and activate a virtual environment:
# Windows
python -m venv venv
venv\Scripts\activate
# macOS/Linux
python3 -m venv venv
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the Streamlit application:
streamlit run app.py- Access the application:
- Open your browser and navigate to
http://localhost:8501
- Open your browser and navigate to
- Build the Docker image:
docker build -t plantguard:latest .- Run the container:
docker run -p 8501:8501 plantguard:latest- Access the application:
- Open your browser and navigate to
http://localhost:8501
- Open your browser and navigate to
- Select the plant type from the dropdown menu (Apple, Cherry, Corn, Grape, Peach, Pepper, Potato, Strawberry, or Tomato)
- Upload an image of a plant leaf (supported formats: JPEG, PNG, JPG)
- Click the "Predict Disease" button
- View the prediction results with:
- Disease name or healthy status
- Disease description
- Symptoms to look for
- Treatment recommendations
Individual Jupyter notebooks for each plant type are available in the notebooks/ directory. These notebooks contain:
- Data preprocessing steps
- Model architecture definition
- Training and validation procedures
- Performance evaluation metrics
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For bug reports or feature requests, please open an issue with detailed information.
This project is licensed under the terms specified in the LICENSE.txt file.
- Dataset: PlantVillage Dataset from Kaggle
- Framework: TensorFlow and Keras teams
- Inspiration: Agricultural technology and deep learning research community
- Special Thanks: To all contributors and users of this project
- Add more plant species and disease types
- Implement mobile application
- Include severity assessment for detected diseases
- Multi-language support for global accessibility
- Integration with weather data for preventive alerts
- Batch processing for multiple images
For inquiries, collaborations, or support:
- Email: miteshgupta2711@gmail.com
Made with β€οΈ for farmers and gardeners worldwide