Problem
The problem
Cloud-based crop disease detection is impractical in rural farms with unreliable connectivity. Agriguard runs entirely at the edge — on a Raspberry Pi + Coral TPU — to give farmers real-time disease detection with no data ever leaving the device.
System Design
How it's built
Architecture
Edge Inference Pipeline
01
Camera Feed
Raspberry Pi camera
step
02
Preprocessing
OpenCV normalize + crop
step
03
CNN Model
Trained on leaf dataset
step
04
Coral TPU Inference
Quantized edge inference
step
05
Disease Classification
Multi-class softmax
step
06
Real-time Alert
On-device dashboard
step
Tech Stack
What powers it
TensorFlowOpenCVRaspberry PiCoral TPUPython
Challenges
What was hard
- Compressing and quantizing a CNN to fit Coral TPU constraints without accuracy collapse
- Handling variable lighting and field conditions in preprocessing
- Balancing frame rate with model complexity on constrained hardware
- Making the classification confidence legible to non-technical users
Design Decisions
Why it's built this way
Edge over cloud
Farmers need answers offline. Edge inference removes connectivity as a dependency.
Coral TPU
Purpose-built for quantized CNN inference at low power — a natural fit for a Pi form factor.
OpenCV preprocessing
Normalization, cropping, and augmentation done in OpenCV keep the pipeline fast and portable.
Simple UI
Big color-coded verdicts (Healthy / Diseased) beat probability bars for the target user.
Lessons Learned
What I'd tell my past self
- Deployment constraints (power, connectivity, hardware) shape ML architecture more than accuracy targets.
- Quantization-aware training is worth the effort when targeting edge accelerators.
- The last-mile UX matters as much as the model — a great model with a confusing UI helps no one.