INSPIRATION
Crop disease spreads fast — a leaf that looks fine on Monday can be visibly infected by Friday, and every day of delay narrows the treatment window and raises the cost of recovery. For most farmers in Vidarbha, an agricultural expert isn't a phone call away, and even when visible damage does appear, it's genuinely hard to tell from a leaf alone whether the cause is disease, pest damage, nutrient deficiency, or plain weather stress.
We kept coming back to one observation: almost every disease that eventually shows up on a leaf is preceded by a window of weather conditions that make it likely — sustained humidity, a temperature band, a rainfall pattern. That window is exactly when a farmer could still act preventively, if only they knew to look. KRISHI RAKSHA grew out of that observation — not just "diagnose the leaf faster," but "warn the farmer before there's a leaf to diagnose."
WHAT IT DOES
KRISHI RAKSHA lets a farmer capture or upload a photo of a plant leaf and receive an instant, explainable disease classification — powered by a PlantVillage-trained model covering 38 disease classes across 14 crop species. But diagnosis is only half the platform. The other half runs quietly in the background: a daily weather-risk sweep that checks live forecasts against known disease-triggering conditions for each farmer's registered crops, and pushes a warning before symptoms would typically appear.
Key capabilities:
- Image-based crop disease prediction using a TensorFlow Lite model, optimized for fast inference on modest server hardware — no GPU required at serving time
- 38-class disease classification based on PlantVillage data, with per-class performance reported honestly rather than a single flattering aggregate number
- Explainable predictions — a separately trained Keras model powers Grad-CAM visualization, showing farmers and reviewers exactly which region of the leaf drove the diagnosis, not just a bare label
- Farmer registration and profiles — location, crop selection, and language preference drive everything downstream
- Scan-history tracking so a farmer can see how a problem area on their land has evolved across a season, not just a single snapshot in time
- Weather-driven early warnings — a rule-based agronomy engine evaluates forecast humidity, temperature, and rainfall against known disease-trigger thresholds, firing alerts only at medium/high risk to avoid alert fatigue
- Forecast-derived crop advisory timelines — a farmer sees a forward-looking risk window, not just today's weather
- Multilingual guidance in Marathi, Hindi, and English
- Marathi voice support via ElevenLabs, so guidance can be heard, not just read — a meaningful accessibility choice for lower-literacy users
- Optional SMS/WhatsApp alert delivery through Twilio, so a farmer without a data connection still gets warned
- Cloud-ready storage with a DynamoDB single-table design for production, and a zero-config in-memory mode for local development — the app runs fully without a single cloud credential configured
HOW WE BUILT IT
The build follows the farmer's actual workflow, not the other way around:
- A farmer registers with location, crop selection, and language preference, or uses the platform directly to upload a crop image.
- The frontend sends the image to the backend prediction endpoint.
- The backend preprocesses the image to match the exact input shape and normalization the model was trained with, then runs inference via TensorFlow Lite.
- The application returns the predicted disease category, confidence score, and disease-specific guidance.
- The result is saved to the farmer's scan history for longitudinal tracking.
- Independently, live weather data is evaluated daily against a rule-based alert engine to generate advisory timelines and push risk notifications — this runs whether or not the farmer opens the app that day.
The machine-learning layer trains on PlantVillage in Google Colab (GPU-accelerated), exporting two artifacts from a single training run: a TensorFlow Lite model for fast production inference, and the original Keras model preserved separately for Grad-CAM explainability, since TFLite's optimized graph format doesn't expose the intermediate activations Grad-CAM needs. Class labels and preprocessing configuration are exported alongside the model as explicit JSON, not hardcoded — a deliberate choice to prevent the silent-failure class of bug where a model loads fine but predicts against the wrong label order.
The backend exposes clean, typed APIs for farmer registration, prediction, advisory generation, and scan-history retrieval, with DynamoDB backing production persistence through a single-table design (PK=farmerId, differentiated SK per entity type for chronological querying) and a matching in-memory implementation for zero-friction local development.
CHALLENGES WE RAN INTO
Building a crop-disease classifier turned out to be the easy 20% of the problem. The hard 80% was making a technical prediction into something a farmer could actually trust and act on.
- Model format vs. explainability tradeoff: TensorFlow Lite is exactly what you want for cheap, fast inference — but it strips away the intermediate layer activations Grad-CAM needs. Solving this meant deliberately keeping two model exports from one training run instead of optimizing away the "unused" Keras version.
- Guidance, not just labels: A raw class name like
Tomato___Late_blightmeans nothing to a farmer. Every prediction needed to resolve into concrete, localized next steps — organic and chemical options, urgency level — not a bare technical output. - Avoiding alert fatigue: Weather data is noisy. Early rule-threshold drafts fired too often, which would train farmers to ignore alerts entirely — the exact opposite of the goal. We tightened thresholds to fire only at medium/high risk, sourced from published agronomy guidance rather than arbitrary cutoffs.
- Multilingual accessibility as a first-class constraint, not a translation pass: Building language support into the data model and API responses from the start, rather than retrofitting a translation layer onto English-only strings later.
- Structured history at scale: Farmer profiles, scan records, and alert logs all needed chronological, per-farmer retrieval without the query complexity ballooning — the single-table DynamoDB design was chosen specifically to keep this simple as farmer count grows.
- Zero-friction local development despite cloud dependencies: DynamoDB, Twilio, and ElevenLabs are all genuinely optional at runtime — the app degrades gracefully to in-memory storage and text-only guidance rather than refusing to start without cloud credentials, which mattered enormously for our own iteration speed during the build.
ACCOMPLISHMENTS THAT WE'RE PROUD OF
KRISHI RAKSHA is more than a classifier wrapped in a UI — it's a complete, honestly-documented farmer workflow:
- A genuine end-to-end flow from crop-image upload through disease prediction to actionable, localized guidance
- A 38-class PlantVillage-based disease model with transparently reported per-class performance, not a single cherry-picked accuracy figure
- The combination of reactive diagnosis and proactive, weather-triggered early warning in one platform — most comparable projects stop at the photo classifier
- Multilingual guidance and Marathi voice support built in as core accessibility features, not afterthoughts
- Persistent scan history giving farmers continuity across a growing season, not just isolated one-off checks
- A cloud-ready architecture that never once made local development harder to unblock production readiness
- Optional SMS/WhatsApp alert delivery, reaching farmers who may not reliably use the app itself
- A dual-export model training pipeline (TFLite + Keras) that keeps explainability alive without sacrificing inference speed
WHAT WE LEARNED
- How to wire a trained ML model into a full-stack app cleanly — and specifically, why inference format and explainability format are not the same thing and sometimes need to be exported separately
- Why AI predictions are only as useful as the human-readable guidance wrapped around them
- How weather data, applied through simple, well-sourced rules, can turn a reactive tool into a proactive one
- How to design APIs and a single-table data model that stay simple even as farmer count and history depth grow
- That multilingual and voice-first design decisions made early are far cheaper than retrofitting them later
- How to architect optional third-party integrations so they enhance the product without ever gatekeeping local development
WHAT'S NEXT FOR KRISHI RAKSHA
- Expanding beyond PlantVillage's lab-condition images with real field photos to close the accuracy gap to actual farmer conditions
- Adding cotton and other Vidarbha-dominant crops not currently covered by PlantVillage — an explicit, acknowledged gap in the current dataset
- Stronger offline and low-connectivity support for genuinely remote areas
- Additional Indian regional languages beyond Marathi, Hindi, and English
- Deeper, more specific treatment and prevention recommendations per disease and severity level
- Location-aware weather rules and a personalized crop calendar per farmer
- A dedicated mobile-first build for real field use, not just a responsive web app
- An escalation path to real agricultural experts for cases the model is uncertain about
- Regional disease-trend analytics to help identify emerging crop-health risks across a district, useful to extension officers as well as individual farmers
- Direct connections from in-app guidance to trusted agricultural input suppliers and support networks
KRISHI RAKSHA aims to become a genuine digital companion for crop health — helping farmers catch problems earlier, understand what to do next, and know when it's time to bring in a human expert.
Built With
- amazon-dynamodb
- amazon-web-services
- codex
- elevenlabs-(marathi-voice)
- fastapi
- openweathermap-api
- react
- tensorflow-lite
- twilio

Log in or sign up for Devpost to join the conversation.