--- 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 ![](assets/ss.png) 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 1. Clone the repository: 2. Install dependencies: ```bash pip install -r requirements.txt ``` 3. 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 ```bash python app.py ``` Access the interface at `http://localhost:7860` ### Training Models 1. Train the classification model: ```bash python train_classifier.py ``` 2. Train the OOD detection model: ```bash 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 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Commit your changes (`git commit -m 'Add some amazing feature'`) 4. Push to the branch (`git push origin feature/amazing-feature`) 5. Open a Pull Request