Offline multimodal AI that diagnoses crop diseases from photos
# 🌿 CropDoc Nigeria
### Offline Multimodal AI Crop Disease Detector — Powered by Gemma 4
> **Build with Gemma: GDGoc LASU Hackathon 2026**
> Track: Agriculture & Food Security
---
## The Problem
Nigeria's **37 million smallholder farmers** lose 30–40% of every harvest to crop diseases
they cannot identify. No internet. No nearby expert. Wrong treatment makes it worse.
## The Solution
**CropDoc Nigeria** — point your phone at any crop, get an instant AI diagnosis
in **English, Yoruba, or Nigerian Pidgin** — completely offline.
```
📸 Upload crop photo
↓
🤖 Gemma 4 Vision analyzes image
↓
🔬 Structured JSON diagnosis returned
↓
🌍 Report in English / Yoruba / Pidgin
↓
đź’Š Treatment plan with local products
```
---
## How Gemma 4 Powers Everything
| Gemma 4 Capability | How CropDoc Uses It |
|---|---|
| **Multimodal Vision** | Reads raw crop photo pixels → identifies disease from visual symptoms |
| **Structured Output** | Returns clean JSON diagnosis via prompt engineering |
| **Multilingual Gen.** | Generates Yoruba + Pidgin responses natively — zero hardcoding |
| **On-device Inference** | Runs on local GPU — no internet after model load |
> Remove Gemma 4 → app produces nothing. Gemma **is** the intelligence layer.
---
## Crops & Diseases Covered
| Crop | Diseases |
|---|---|
| 🌿 Cassava (Igi Kara) | Mosaic Disease (CMD), Brown Streak (CBSD), Bacterial Blight |
| 🍅 Tomato (Tomati) | Early Blight, Leaf Curl Virus, Late Blight |
| 🌽 Maize (Agbado) | Streak Virus (MSV), Northern Corn Leaf Blight |
| 🍠Yam (Isu) | Anthracnose |
| đź«‘ Pepper, Cowpea, Plantain | Common fungal + viral diseases |
---
## Quickstart
### Prerequisites
- Kaggle account with **T4 GPU** enabled
- Gemma 4 model attached from Kaggle Models hub
- Internet enabled (for first-time model download)
### 1. Clone this repo
```bash
git clone
github.com
cd cropdoc-nigeria
```
### 2. Install dependencies
```bash
pip install git+
github.com …