Fasal Watch: Building an AI Crop Disease Detector on AWS EC2 & S3
A behind-the-scenes look at building a lightweight, AI-assisted platform that helps farmers identify crop diseases from leaf photos and get actionable treatment advice — deployed on AWS EC2 and S3.
Building Fasal Watch: An AI-Powered Crop Disease Detector on AWS
By Mohammad Anouf & the Fasal Watch Team
The Problem
Crop disease spreads fast, and early identification can be the difference between a manageable issue and a lost harvest. Conditions like Early Blight, Rice Blast, Yellow Rust, and others can significantly reduce yield if caught too late.
While researching existing agri-tech tools, we noticed three recurring gaps:
- Connectivity dependence — Many solutions rely entirely on cloud-based AI inference, which breaks down in low-connectivity rural areas.
- Over-complexity — Farmers don't need a data dashboard. They need three answers, fast: What's wrong? What do I do? How do I do it?
- Accessibility — Advisory content locked behind English-only text isn't useful to the people who need it most.
Fasal Watch was built to close these gaps: a lightweight crop disease detection and advisory platform designed for real field conditions, not just a lab demo.
What Fasal Watch Does
Fasal Watch lets a user upload or capture a photo of a crop leaf and receive:
- A disease classification with a confidence score
- A description of observed symptoms
- Organic and chemical treatment recommendations, including dilution ratios and pre-harvest intervals (PHI)
- A simple two-column action plan
- Kisan Vani (किसान वाणी) — voice-based guidance for farmers working in the field, not at a screen
The platform currently supports four disease categories:
- Tomato Early Blight
- Rice Blast
- Potato Late Blight
- Wheat Yellow Rust
A reference library of verified specimen images is also included, so users can visually compare their crop against known cases before trusting the automated result.
Architecture: Deploying on AWS
We kept the infrastructure intentionally minimal — two AWS services doing exactly what they're good at.
Farmer's Browser │ ┌───┴────┐ │ │ HTTP HTTPS │ │ ▼ ▼ EC2 S3(App + (Reference API) Images)EC2 — Application Hosting
Fasal Watch runs on an Amazon Linux 2023 EC2 instance in
eu-north-1 , hosting a lightweight web interface and a Python backend that processes uploaded images.To avoid manual restarts after reboots or crashes, we registered the app as a
systemd service:ini
[Unit]Description=Fasal Watch Web AppAfter=network.target
[Service]Type=simpleUser=ec2-userWorkingDirectory=/home/ec2-user/fasal-watchExecStart=/usr/bin/python3 /home/ec2-user/fasal-watch/backend/local_server.pyRestart=alwaysRestartSec=3
[Install]WantedBy=multi-user.targetThis small change was the difference between "it works on our laptop" and "it stays online."
S3 — Static Asset Storage
Reference leaf images are stored in a dedicated bucket,
fasal-watch-samples , rather than being served directly from EC2. This keeps compute resources focused on request processing rather than static file delivery.json
{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::fasal-watch-samples/*" } ]}
The Computer Vision Approach
Rather than routing every image through a third-party AI API, we built a lightweight classifier using Python and Pillow, working in the HSV color space.
HSV was the right choice because RGB doesn't map cleanly to the visual cues we care about — yellowing, browning, rust spotting. HSV separates:
- Hue — the underlying color
- Saturation — color intensity
- Value — brightness
We use these channels to detect four visual patterns:
Symptom | Detection signal |
|---|---|
Chlorosis | Hue/saturation ranges matching yellowing |
Necrosis / Blight | Brown, darker regions by hue and brightness |
Rust | Orange-brown regions with elevated saturation |
Blast / Mildew | Low-saturation, bright gray/white regions |
These extracted features are matched against predefined disease signatures.
Why not a full deep-learning model? Speed, cost, and control. A rule-based classifier means faster processing, no external inference dependency, lower infrastructure cost, and full visibility into why a classification was made. The trade-off is accuracy: lighting, camera quality, background, and disease similarity can all throw off results. We position Fasal Watch as an early-stage screening tool, not a replacement for professional diagnosis.
Kisan Vani: Voice-First Guidance
Reading a diagnosis on a screen isn't always practical for someone standing in a field. Kisan Vani translates the technical output into conversational, audio-friendly guidance — turning "diagnosis" into something a farmer can act on without needing to read anything at all.
What We Learned
1. More information isn't better information.
Early versions of the interface tried to show everything at once and ended up feeling like a technical dashboard. Simplifying to Symptoms → Diagnosis → Action made it dramatically more usable.
2. Deployment is its own discipline.
Getting the app running locally was the easy part. Security groups, SSH access, environment setup, service management, and static asset handling all required a different skill set than development itself.
3. Simple architecture is often the right architecture.
We didn't need a sprawling AWS stack. EC2 for compute, S3 for storage — that was enough, and keeping it minimal made every part of the system easier to reason about.
What's Next
- Replace the rule-based classifier with a trained computer vision model
- Expand disease and crop coverage
- Improve robustness across lighting conditions
- Add more Indian regional languages
- Strengthen offline and low-connectivity support
- Improve confidence calibration
- Validate against larger real-world datasets
The long-term goal is to evolve Fasal Watch from a disease detector into a more complete crop-health assistance system.
Try It Yourself
Building Fasal Watch touched computer vision, backend development, cloud infrastructure, and UX design — but the real lesson was that none of that matters if the final product isn't usable by the person standing in a field with a phone and a sick crop. That's the standard we built toward.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article