AgriSmart is a precision-agriculture decision-support project for farmers in Tunisia
# 🌱 AgriSmart
AI-powered smart agriculture suite combining **Flutter** + **FastAPI** + **10 ML models** to help farmers make better decisions across plant disease detection, cattle health, irrigation, climate risk, soil health, finance, and crop quality.
---
## ✨ Features
| Module | Description | ML Model |
|--------|-------------|----------|
| 🌿 **Plant Disease** | Scan a leaf → diagnose 38 diseases | EfficientNet V2-S |
| 🫒 **Olive Leaf** | On-device detection (3 classes) | TFLite MobileNetV2 |
| 🐄 **Cattle Health** | Vital signs → sickness probability + 35-disease KNN match | XGBoost + KNN |
| 💧 **Irrigation** | ET₀ next-day forecast + watering plan (5 zones) | XGBoost regressor |
| ☁️ **Climate Risk** | Disease pressure forecast from weather | XGBoost classifier |
| 🌱 **Soil Health** | 10-parameter analysis → score + advice | RandomForest + IsolationForest |
| 📊 **Finance** | 15-year crop forecast (Citrus, Wheat, Olive, Dates) | Prophet |
| 🌾 **Crop Suitability** | Best crop given climate/economic conditions | RandomForest |
| ⭐ **Crop Quality** | Photo → quality grade (Low/Medium/High) | XGBoost on embeddings |
| 🤖 **Aria Chatbot** | Conversational assistant for app help & farming Q&A | Rule-based intent classifier |
---
## 🏗️ Architecture
```
agrismart/ Flutter app (iOS / Android / Web)
agrismart_api/ FastAPI backend (Python)
artifacts/ ML model weights & metadata
```
**Frontend:** Hub-and-spoke navigation. Animated mesh-gradient backgrounds, glassmorphic cards, fl_chart line charts with confidence bands, hero transitions.
**Backend:** Loads 10 models on startup, exposes typed REST endpoints with Pydantic validation. Graceful fallbacks if a model fails to load.
---
## 🚀 Quick Start
### 1. Backend
```bash
cd agrismart_api
pip install fastapi "uvicorn[standard]" torch torchvision pillow numpy pandas \
scikit-learn xgboost statsmodels prophet tensorflow joblib
uvicorn main:app --host 0.0.0.0 --port 8000 --reload
```
Open `
0.0.0.127 …