File size: 2,507 Bytes
32cc554
 
 
 
437e936
32cc554
 
 
 
 
 
 
3c7a58d
d272e53
32cc554
3c7a58d
 
 
32cc554
3c7a58d
 
 
 
 
 
 
 
 
 
 
 
 
32cc554
3c7a58d
32cc554
3c7a58d
32cc554
3c7a58d
32cc554
 
3c7a58d
 
 
32cc554
3c7a58d
32cc554
3c7a58d
 
 
32cc554
3c7a58d
 
 
 
 
 
32cc554
3c7a58d
 
 
 
 
 
 
32cc554
3c7a58d
 
 
 
 
 
 
32cc554
3c7a58d
 
 
 
32cc554
3c7a58d
 
 
 
 
 
 
 
 
 
 
 
 
 
32cc554
3c7a58d
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
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