Built for the 2.5 crore small farmers of Odisha — where internet is unreliable,
literacy rates are 60-65%, and one lost harvest can devastate a family.
Features · Architecture · Quick Start · Disease Database · ML Model · Contributing
| Reality | Impact |
|---|---|
| ₹18,000 avg. annual income of an Odisha small farmer | Zero margin for error |
| 60-65% rural literacy rate | Can't rely on text-heavy apps |
| Patchy or zero internet in rural areas | Cloud AI won't work |
| Wrong pesticide = wasted money + crop damage | Need reliable, expert-grade advice |
KisanDoc puts a crop doctor in every farmer's pocket — AI that works without internet, speaks their language, and tells them exactly what to spray, how much, and at what cost.
|
🧠 On-Device AI Diagnosis
📊 Severity Estimation
💊 Treatment Plans
|
🔊 Voice Readout (TTS)
📚 Diagnosis History
🗺️ Find Help Nearby
|
📸 Farmer takes a photo
│
├─────────────────────────────────────────┐
│ │
▼ ▼
🧠 ML Service (TFLite) 🎨 Severity Service (HSV)
───────────────────── ─────────────────────────
• Resize → 224×224 • Resize → 128×128
• Normalize to [0, 1] • RGB → HSV per pixel
• MobileNetV2 inference • Mask: background / healthy / diseased
• Top-1 (or Top-3 if < 75%) • Ratio → Mild / Moderate / Severe
│ │
└────────────────┬────────────────────────┘
│
▼
📖 Disease Database Lookup
(ICAR + NIPHM reviewed data)
│
▼
✅ Diagnosis Result Screen
├── Disease name (EN / HI / OR)
├── Confidence score
├── Severity level
├── Pesticide + dosage + cost (INR)
├── 🔊 Voice readout
└── 💾 Save to local history (Hive)
| Tool | Version |
|---|---|
| Flutter & Dart | 3.16+ / 3.0+ |
| IDE | Android Studio or VS Code + Flutter plugin |
| Python (for model) | 3.9+ |
| Device | Android 8.0+, 2 GB RAM minimum |
git clone https://github.com/YOUR_USERNAME/kisandoc.git
cd kisandocflutter pub getYou have two options depending on your goal:
Option A — Synthetic demo model (fast, tests the pipeline)
pip install tensorflow tensorflow-hub pillow numpy
python scripts/model_conversion.py
# Output: assets/model/kisandoc.tflite (~14 MB)Option B — Real PlantVillage model (recommended for production, ~92% accuracy)
# 1. Download the dataset from Kaggle:
# https://www.kaggle.com/datasets/vipoooool/new-plant-diseases-dataset
# 2. Extract to: scripts/plantvillage/
# 3. Train:
python scripts/model_conversion.py --use-real-data --data-path scripts/plantvillage/Why two options?
The synthetic model lets you verify the full Flutter pipeline (inference → UI → storage) instantly. The PlantVillage model gives real-world accuracy but requires the dataset download (~2 GB).
ls assets/model/ # ✅ kisandoc.tflite
ls assets/labels/ # ✅ labels.txt# List connected devices
flutter devices
# Run in debug mode (USB debugging must be enabled on your phone)
flutter run
# Build a release APK
flutter build apk --release
# → build/app/outputs/flutter-apk/app-release.apk15 diseases with complete, ICAR-reviewed treatment protocols.
| Crop | Disease | Type |
|---|---|---|
| 🌾 Rice | Blast | Fungal |
| 🌾 Rice | Brown Spot | Fungal |
| 🌾 Rice | Bacterial Leaf Blight | Bacterial |
| 🌿 Wheat | Stem Rust | Fungal |
| 🌿 Wheat | Powdery Mildew | Fungal |
| 🍅 Tomato | Early Blight | Fungal |
| 🍅 Tomato | Late Blight | Oomycete |
| 🍅 Tomato | Leaf Curl Virus | Viral |
| 🥔 Potato | Late Blight | Oomycete |
| 🥔 Potato | Black Scurf | Fungal |
| 🌽 Maize | Leaf Spot | Fungal |
| 🌽 Maize | Common Rust | Fungal |
| 🌱 Cotton | Bollworm | Insect Pest |
| 🌱 Cotton | Leaf Curl Virus | Viral |
| ✅ All Crops | Healthy Leaf | — |
Data sources: ICAR bulletins · NIPHM guidelines · CICR recommendations
| Property | Value |
|---|---|
| Architecture | MobileNetV2 (Transfer Learning + Fine-tuning) |
| Input | 224 × 224 × 3 (normalized to [0, 1]) |
| Output | 15-class softmax |
| Model size | ~14 MB |
| Inference time | < 200 ms (mid-range Android) |
| Training data | PlantVillage — 38,000 images |
| Top-1 accuracy | ~90% (validation set) |
Why MobileNetV2 and not a bigger model?
Our target is a ₹8,000–12,000 Android phone with 2 GB RAM. MobileNetV2 hits the sweet spot of accuracy, model size, and inference speed — and it ships inside the APK so there's no download required on first launch.
Image
→ Resize to 128×128
→ Per-pixel RGB → HSV conversion
→ Classify each pixel:
• Background : V > 0.95 AND S < 0.10 → Skip
• Healthy : H ∈ [60°, 140°] AND S > 0.15 → Healthy count
• Diseased : Everything else → Diseased count
→ Ratio = Diseased / (Diseased + Healthy)
→ Severity:
< 15% → 🟡 Mild
15–40% → 🟠 Moderate
> 40% → 🔴 Severe
kisandoc/
├── lib/
│ ├── main.dart # App entry point, Hive initialization
│ ├── app.dart # Theme & routing
│ ├── core/
│ │ ├── constants/app_strings.dart # All multilingual strings (EN/HI/OR)
│ │ ├── theme/app_theme.dart # Design system & tokens
│ │ └── providers/app_provider.dart # Language state management
│ ├── data/
│ │ ├── disease_database.dart # 15 diseases, ICAR treatment data
│ │ ├── kvk_data.dart # 32 KVK offices across Odisha
│ │ └── models/
│ │ └── diagnosis_record.dart # Hive-adapted data model
│ ├── services/
│ │ ├── ml_service.dart # TFLite inference engine
│ │ ├── severity_service.dart # HSV color analysis
│ │ ├── tts_service.dart # Text-to-speech (3 languages)
│ │ └── storage_service.dart # Hive CRUD operations
│ └── screens/
│ ├── onboarding/ # First-launch tutorial
│ ├── home/ # Camera / gallery entry
│ ├── diagnosis/ # Results + treatment plan
│ ├── history/ # Swipe-to-delete past records
│ ├── shop_locator/ # GPS + KVK directory
│ └── settings/ # Language selection
├── assets/
│ ├── model/kisandoc.tflite # On-device ML model
│ └── labels/labels.txt # Class labels
├── scripts/
│ ├── scraper.py # ICAR data collection
│ └── model_conversion.py # Training + TFLite export
└── README.md
| Language | Code | TTS | Notes |
|---|---|---|---|
| English | en |
✅ Full | Default fallback |
| Hindi | hi |
✅ Full | |
| Odia | or |
Requires Google TTS + Odia language pack (Android 9+); falls back to Hindi on older devices |
- 📵 Photos never uploaded — all AI inference runs locally
- 🔐 No accounts, no login, no tracking
- 📍 Location used only to open Google Maps — never stored
- 🗃️ Diagnosis history saved on-device only (Hive local DB)
- 📊 No analytics, no telemetry, no crash reporting
| Requirement | Minimum |
|---|---|
| Android version | 8.0 (API 26) |
| RAM | 2 GB |
| Free storage | 100 MB |
| Camera | Optional — gallery works without it |
| Internet | Optional — only needed for the Maps feature |
- Odia TTS — Requires the Google TTS app with the Odia language pack installed
- Cotton diseases — Limited training data; accuracy may be lower than other crops
- Lighting conditions — Works best in natural daylight; avoid flash photography
- Similar diseases — Some diseases look alike (e.g. late blight vs. early blight); always cross-check symptom descriptions
- AI is decision-support — Not a replacement for a trained agronomist or KVK officer
This is a community app built for the farmers of Odisha. All contributions are welcome:
- 🌾 Better training data — Odisha-specific crop disease photos
- 🗣️ Odia language improvements — translations, TTS testing
- 🦠 New disease classes — expand beyond the current 15
- 📋 Field testing reports — real-world accuracy feedback from farmers
Please open an issue before submitting a large PR so we can discuss the approach.
This project is licensed under the MIT License — free to use, modify, and distribute.
Data credits: ICAR · NIPHM · CICR · PlantVillage (Penn State University)
KisanDoc is a decision-support tool based on publicly available agricultural guidelines. AI predictions are not 100% accurate. For critical crop disease management, always verify physical symptoms and consult your local KVK officer or state agriculture department before applying any chemical treatment.
Made with ❤️ for the farmers of Odisha
If this project helps even one farmer save their harvest, it was worth building.