Upload a leaf photo → Get instant disease diagnosis + treatment advice
Upload a leaf photo and get instant diagnosis with treatment recommendations
| Metric | Value |
|---|---|
| Algorithm | EfficientNet-B0 (Transfer Learning) |
| Dataset | PlantVillage (20,638 images) |
| Classes | 15 disease classes |
| Validation Accuracy | 94.53% |
| Training Platform | Google Colab (T4 GPU) |
| Model Size | 15.65 MB |
User Browser
│
▼
Nginx (Port 80) ← Reverse Proxy
│
▼
Gunicorn + Flask ← WSGI Server (EC2 t3.small)
│
▼
EfficientNet-B0 ← ML Inference (CPU)
│
▼
AWS S3 ← Model Storage (IAM Role)
- EC2 t3.small — Ubuntu 24.04, serves the app 24/7
- S3 — stores model weights securely
- IAM Role — secure S3 access, zero credentials stored on server
- Nginx — reverse proxy on port 80
- Gunicorn — production WSGI server
- CloudWatch — monitoring and logs
| Crop | Diseases Detected |
|---|---|
| 🍅 Tomato | Early Blight, Late Blight, Leaf Mold, Bacterial Spot, Septoria Leaf Spot, Spider Mites, Target Spot, Yellow Leaf Curl Virus, Mosaic Virus, Healthy |
| 🥔 Potato | Early Blight, Late Blight, Healthy |
| 🫑 Bell Pepper | Bacterial Spot, Healthy |
# 1. Clone the repo
git clone https://github.com/Adarsh73111/cropguard-ai.git
cd cropguard-ai
# 2. Build and run
docker-compose up
# 3. Open browser
http://localhost:5000# 1. Clone the repo
git clone https://github.com/Adarsh73111/cropguard-ai.git
cd cropguard-ai
# 2. Install dependencies
pip install -r requirements.txt
# 3. Run the app
python app.py
# 4. Open browser
http://localhost:5000Prerequisites for Docker: Install Docker Desktop
| Category | Technology |
|---|---|
| ML Framework | PyTorch |
| Model | EfficientNet-B0 |
| Web Framework | Flask |
| WSGI Server | Gunicorn |
| Reverse Proxy | Nginx |
| Cloud | AWS EC2, S3, IAM |
| Demo Platform | Hugging Face Spaces + Gradio |
| Training | Google Colab (T4 GPU) |
cropguard-ai/
├── app.py ← Flask inference API + frontend
├── index.html ← Web UI
├── cropguard_model.pth ← Trained EfficientNet-B0 model
├── class_names.json ← Disease class labels
├── requirements.txt ← Python dependencies
├── Dockerfile ← Docker container setup
├── docker-compose.yml ← Docker compose config
└── README.md
Adarsh
- GitHub: @Adarsh73111
MIT License — feel free to use and modify!
Made with ❤️ using PyTorch and AWS