In rural farming regions of Punjab, 4G/5G internet connectivity is highly unreliable. If a farmer detects a crop disease, they cannot wait for cloud APIs to return a diagnosis. Latency and bandwidth costs are major barriers.
To solve this, I engineered Fasal Doctor, an offline-first agricultural mobile app built in Flutter that scans infected leaves and detects crop diseases in under 2 seconds.
Technical Architecture
- On-Device Inference: I fine-tuned a MobileNetV2 model on PlantVillage datasets and local Punjab crop disease patterns using PyTorch, converting it to a compact TensorFlow Lite (.tflite) format.
-
Flutter Integration: The model runs locally on the smartphone CPU using the
tflite_flutterbinding. Camera frames are processed directly on-device with zero external API calls. - Localized Advisory: Once diagnosed, the app fetches treatment plans and pesticides aligned with Punjab Agricultural University (PAU) guidelines from a local SQLite database.
By running everything on-device, we eliminated API costs entirely, making it 100% free and reliable for rural farming cooperatives.
To see the full case study and code breakdowns, check out my portfolio at gurdharam.com.
Top comments (0)