# π± AgriGuard Autonomous ML Service
**An End-to-End Autonomous Foliage Pathology Classification & Retraining Pipeline**
Live Demo Url
---
## π Project Overview
AgriGuard is an autonomous, production-grade computer vision service engineered to classify plant foliage diseases from non-tabular image data (PlantVillage dataset). The system transitions a static convolutional neural network into a resilient cloud architecture featuring:
* **Real-time Single Prediction API:** Sub-second diagnosis across *Healthy*, *Early Blight*, and *Late Blight* Tomato classes.
* **3-Biomarker Feature Storytelling Engine:** Automatically extracts and visualizes physical pathology ratios (HSV Chlorosis degradation, Canny edge structural fragmentation, and Otsu necrotic lesion surface area) to explain *why* the neural network made its decision.
* **Autonomous Background Retraining:** An interactive UI control where users stage bulk zip dataset uploads and trigger asynchronous fine-tuning cycles without causing server downtime or API blocking.
* **Horizontal Docker Scaling & Load Balancing:** Containerized with FastAPI, Uvicorn, and Nginx reverse-proxy load balancing to handle thousands of concurrent IoT field sensor requests.
---
## ποΈ Repository Directory Structure
Strictly structured according to production ML engineering standards:
```text
plantdisease/
βββ README.md # Comprehensive project documentation & results
βββ docker-compose.yml # Multi-container scaling & Nginx load balancer
βββ locustfile.py # High-concurrency IoT stress simulation script
βββ backend/
β βββ Dockerfile # Keras 3 / FastAPI container blueprint
β βββ requirements.txt # Pinned Python ML dependencies
β βββ main.py # Asynchronous API routes & background task handlers
β βββ src/
β β βββ preprocessing.py # Byte decoding & 3-biomarker feature extraction
β β βββ model.py # Keras 3 auto-discovery & fine-tuning engine
β β βββ pred β¦