metadata
title: CDIApp
emoji: π
colorFrom: red
colorTo: blue
sdk: gradio
sdk_version: 5.4.0
app_file: app.py
pinned: false
license: apache-2.0
Plant Disease Classification and Remedy System
This is a deep learning project for classifying plant diseases from images. It uses a convolutional neural network trained on a dataset of plant disease images.
A deep learning-based system that identifies plant diseases from images and provides remedies using AI.
Features
- πΏ Identifies 38 different plant diseases across various crops
- π Uses advanced deep learning models for accurate disease detection
- π€ Integrates with Gemini AI for providing detailed remedies
- π― Includes Out-of-Distribution detection for reliable predictions
- π₯οΈ User-friendly Gradio web interface
System Requirements
- Python 3.8+
- CUDA-compatible GPU (optional, for faster inference)
- 4GB+ RAM
Installation
Clone the repository:
Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
Create a
.env
file in the root directory and add:
GEMINI_API_KEY=your_gemini_api_key_here
Project Structure
βββ acfg/ # Application configuration
βββ ml/ # Machine learning modules
β βββ app/ # Core ML application code
β βββ input/ # Dataset directory
βββ service/ # Backend service
βββ static/ # Model checkpoints and static files
Usage
Running the Web Interface
python app.py
Access the interface at http://localhost:7860
Training Models
- Train the classification model:
python train_classifier.py
- Train the OOD detection model:
python train_ood.py
Model Architecture
- Classification: MobileNetV3 Small with custom MLP head
- OOD Detection: Custom Autoencoder architecture
- LLM Integration: Gemini 1.5 Flash for remedy generation
Dataset
The system is trained on a comprehensive dataset of plant disease images, covering:
- Multiple crop types (Apple, Corn, Tomato, etc.)
- Various disease conditions
- Healthy plant samples
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request