AgriGuard AI is a smart farming assistant that detects crop disease, forecasts harvest yield and recommends fertilizer using artificial intelligence. Farmers enter basic farm conditions and get instant, accurate answers. Built for smallholder farmers across Africa. Powered by Clevatec.
# 🌿 AgriGuard AI
> AI-powered crop disease detection, yield forecasting and fertilizer recommendation for smallholder farmers across Africa.
---
## What Is AgriGuard AI?
AgriGuard AI is a smart farming assistant that puts the knowledge of an agricultural expert in the hands of any farmer with a phone.
A farmer enters basic information about their farm — temperature, humidity, soil condition and crop type — and AgriGuard AI instantly answers three critical questions:
| Question | Endpoint |
|---|---|
| 🦠 Is my crop at risk of disease? | `POST /predict_disease` |
| 🌾 How much will I harvest this season? | `POST /predict_yield` |
| 💊 What fertilizer should I apply? | `POST /recommend_fertilizer` |
No agricultural degree needed. No expensive equipment. Just fast, accurate, actionable answers.
---
## The Problem It Solves
Every year across Africa, smallholder farmers lose 20–40% of their harvest to crop disease and poor soil management. Most cannot afford agronomists. Most live hours from the nearest agricultural office. AgriGuard AI bridges that gap — instantly, affordably, at scale.
---
## Project Structure
```
agriguard-ai/
├── frontend/
│ ├── app.html # Industrial dashboard UI
│ ├── app.js # Frontend logic & AI API calls
│ └── style.css # Custom styles
├── backend/
│ ├── server.js # Node.js entry point
│ ├── routes/ # API route definitions
│ ├── controllers/ # Business logic
│ └── middleware/ # JWT auth & error handling
├── ai-module/
│ ├── model_engine.py # Flask API — 3 ML inference endpoints
│ ├── train_model.py # Scikit-Learn model training scripts
│ ├── crop_model.pkl # Trained disease classifier
│ ├── yield_model.pkl # Trained yield regressor
│ ├── fertilizer_model.pkl # Trained fertilizer classifier
│ └── *.json # Model metadata files
├── database/
│ └── schema.sql # PostgreSQL table …