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 β¦