πΏ Crop Doctor
AI-powered crop disease detection platform for Indian farmers β a 3-model system combining leaf image diagnosis, weather-based disease risk prediction, and ICAR-aligned treatment advisory.
π± App Screens Home Dashboard (crop selection + live weather) Scan Leaf (camera / gallery upload) Disease Result (confidence + severity + treatment + risk)
π Table of Contents Overview The Problem What It Does Architecture Models Datasets Project Structure Setup & Installation Running the Backend Running the Flutter App API Reference Model Performance What Makes This Different Roadmap Team
π Overview
Crop Doctor is an end-to-end AI platform that helps Indian farmers detect crop diseases early and take action before yield is lost.
It combines three AI models into a single mobile app:
Model 1 β Diagnoses disease from a leaf image Model 2 β Provides ICAR-aligned treatment recommendations Model 3 β Predicts disease risk using live weather data
β Fully working Android APK β Tested on real device β Real-time image + weather predictions
India loses ~35% of annual crop yield due to plant diseases (~βΉ2,400 crore/year).
Key challenges:
58% farmers lack timely expert advice 2β3 day detection delay β disease spreads to 40β60% of field Existing apps fail in real-world conditions (trained on lab images) No preventive, weather-based prediction tools No ICAR-aligned localized treatment guidance πΎ What It Does Farmer Workflow Select crop (Rice, Tomato, Wheat, etc.) View live weather + disease risk Upload leaf image Get diagnosis + severity + treatment View upcoming disease risks Output per Scan Disease name (86 classes) Confidence score Severity: Low / Moderate / High Affected area % Chemical treatment + dosage Organic alternative Prevention steps Weather-based risk forecast
ποΈ Architecture
Flutter App (Home Β· Scan Β· Result Screens) β βΌ FastAPI Backend βββ /predict/image βββ /predict/weather-risk βββ /advisory β βββ Model 1 β Image Classifier (ONNX) βββ Model 2 β Advisory Engine (ICAR KB) βββ Model 3 β Weather Risk (XGBoost)
π€ Models Model 1 β Leaf Image Classifier Architecture: MobileNetV3 (supports EfficientNet-B3, ResNet-50) Format: ONNX Runtime Classes: 86 Input: 224Γ224 Inference: Test-Time Augmentation (TTA) Model 2 β Treatment Advisory JSON-based ICAR knowledge base Provides: Chemical treatment Organic alternatives Dosage & frequency Prevention steps Optional LLM fallback Model 3 β Weather Risk Predictor Algorithm: XGBoost Accuracy: 96.53% Data: NASA POWER (historical) OpenWeatherMap (live) Predicts disease risk before symptoms appear
π Datasets Dataset Images Role PlantVillage 54,306 Base training PlantDoc 2,598 Field realism MultiCrop Tamil Nadu 23,000+ Local ground truth NASA POWER β Weather training
Final dataset: 35,275 images Β· 86 classes
π Supported Crops Tomato Rice Wheat Cotton Maize Groundnut Potato Chilli Sugarcane Soybean
ποΈ Cities Covered
Chennai Β· Bengaluru Β· Hyderabad Β· Mumbai Β· Pune Β· Ahmedabad Β· Jaipur Β· Lucknow Β· Bhopal Β· Kolkata
π Project Structure crop_disease_platform/
backend/ βββ models/ βββ src/ β βββ model1/ β βββ model2/ β βββ model3/ β βββ advisory/ β βββ api/ βββ data/
flutter_app/ βββ lib/ βββ screens/ βββ services/
βοΈ Setup & Installation Prerequisites Python 3.10+ Flutter 3.x OpenWeatherMap API key
- Clone Repo git clone https://github.com/YOUR_USERNAME/crop-doctor.git cd crop-doctor
- Backend Setup cd backend python -m venv venv
venv\Scripts\activate # Windows source venv/bin/activate # Mac/Linux
pip install -r requirements.txt 3. Environment Variables
Create .env:
OPENWEATHER_API_KEY=your_key MODEL2_ENDPOINT=
Swagger Docs: π http://localhost:8000/docs
π± Running Flutter App cd flutter_app flutter pub get flutter run
Update API URL:
static const String _baseUrl = 'http://192.168.1.XXX:8000';
π API Reference POST /predict/image
Returns:
Disease Confidence Severity Treatment Top predictions POST /predict/weather-risk
Returns:
Weather summary Disease risk Prevention tips POST /advisory
Returns:
ICAR-based treatment plan
π Model Performance Model 1 Accuracy: 48.4% (baseline) Macro F1: 41.8% Model 3 Accuracy: 96.53% Precision: 94.42% Recall: 97.33% ROC AUC: 0.9952
π What Makes This Different Feature Crop Doctor Typical Apps Data Real + Indian Lab only Prediction β Weather-based β No Treatment β ICAR aligned β Generic Deployment β Mobile app β Demo only Models 3 combined 1
π£οΈ Roadmap EfficientNet-B3 upgrade Field evaluation improvements Multi-language (Tamil, Hindi) Cloud deployment (AWS / Railway) Offline inference (ONNX mobile) UAV / drone integration
π₯ Team
Model Evaluation & Optimization Ensemble Learning Architect Data Science & Feature Engineering
π Summary
Crop Doctor is not just a detection app β it is a complete AI-driven decision support system for farmers, combining:
Diagnosis Treatment Prediction into one unified platform.