The Plant Disease Detection System is an AI-powered web application built with Streamlit that helps farmers and gardeners identify diseases in tomato and watermelon plants. By simply uploading a photo of a plant leaf, users can receive instant disease diagnosis along with specific treatment recommendations and prevention measures.
- Real-time Disease Detection: Upload leaf images and get immediate analysis
- Multi-crop Support: Currently supports tomatoes (10 classes) and watermelons (4 classes)
- Treatment Recommendations: Provides specific product recommendations and application instructions
- Prevention Tips: Offers guidance on preventing future disease occurrences
- Interactive UI: User-friendly interface with intuitive navigation and visualization
- Visual Analysis: Displays probability distribution of detected diseases
The system utilizes two deep learning models:
- Architecture: EfficientNetB0 (fine-tuned)
- Classes: 10 classes (9 diseases + healthy)
- Accuracy: ~97% on test set
- Disease Categories:
- Tomato Mosaic Virus
- Target Spot
- Bacterial Spot
- Tomato Yellow Leaf Curl Virus
- Late Blight
- Leaf Mold
- Early Blight
- Spider Mites
- Septoria Leaf Spot
- Healthy
- Architecture: MobileNetV2
- Classes: 4 classes (3 diseases + healthy)
- Accuracy: ~95% on test set
- Disease Categories:
- Anthracnose
- Downy Mildew
- Mosaic Virus
- Healthy
- Python 3.7+
- TensorFlow 2.x
- OpenCV
- Streamlit
- NumPy
- Matplotlib
- Pillow
-
Clone the repository:
git clone https://github.com/yourusername/plant-disease-detection.git cd plant-disease-detection
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Download the pre-trained models and place them in the
models
directory:models/Tomato_EfficientNetB0_finetuned_final.h5
models/Watermelon_MobileNetV2_final.h5
models/confusion_matrix.png
models/Watermelon_MobileNetV2_training_history.png
models/Tomato_EfficientNetB0_finetuned_training_history.png
models/Head image.jpg
-
Run the application:
streamlit run app.py
-
Access the application in your web browser at
http://localhost:8501
- Navigate to the "Disease Detection" page using the sidebar menu
- Select the crop type (tomato or watermelon)
- Upload a clear image of your plant leaf
- Review the detection results and treatment recommendations
- Take photos in good natural light
- Make sure the leaf is in focus and clearly visible
- Include the entire leaf in the frame
- Avoid shadows or glare on the leaf surface
The system provides Rallis product recommendations based on the detected disease, including:
- Specific product name and formulation
- Application instructions with dosage and frequency
- Prevention measures to avoid recurrence
The application is built using:
- Streamlit: For the web interface
- TensorFlow/Keras: For loading and running the disease detection models
- OpenCV: For image preprocessing
- Matplotlib: For visualization of prediction probabilities
- NumPy: For numerical operations
- Add support for additional crops (e.g., cucumbers, peppers)
- Implement multiple disease detection in a single image
- Add severity estimation for detected diseases
- Integrate with weather data for risk prediction
- Add multi-language support
For support, feature requests, or collaboration:
- Developer: Aditya Gupta
- LinkedIn: Aditya Gupta
This project is licensed under the MIT License - see the LICENSE file for details.