PashuSwasthya
Offline-First Multilingual Mobile App for Cattle Breed & Disease Diagnosis
// 01. THE PROBLEM
Rural cattle farmers face severe economic losses due to delayed veterinary diagnosis for cattle diseases in remote zero-connectivity zones.
// 02. SYSTEM ARCHITECTURE & PIPELINE FLOW
Camera & Image Preprocessing
Captures cattle image and resizes/normalizes array to 224x224 tensor format on device.
On-Device Quantized TFLite Engine
Executes INT8 MobileNetV3 model completely offline with sub-50ms CPU inference time.
Disease & Confidence Parser
Maps output vector to class labels with confidence score and immediate treatment advisory.
Localized Voice Advisory Output
Synthesizes regional dialect audio advisory so illiterate farmers can act immediately.
// 03. TECHNICAL APPROACH & DECISION MATRIX
01On-Device Quantized TFLite Inference
INT8 Post-Training Quantization (14MB TFLite Model)
Cloud APIs fail in internet-dead zones. INT8 quantization reduced model size from 65MB to 14MB with sub-50ms inference latency.
Cloud-Hosted Inference API
Requires continuous 4G/5G data connections which are unavailable in remote Indian farm fields.
// 04. CORE ARCHITECTURAL LOGIC
On-device INT8 quantized MobileNetV3 TFLite inference loop with sub-50ms latency.
12345678910111213Future<DiagnosisResult> runOnDeviceInference(File imageFile) async { final inputBytes = await preprocessImage(imageFile, targetSize: 224); final interpreter = await Interpreter.fromAsset('models/mobilenet_v3_quant.tflite'); var outputBuffer = List<int>.filled(numClasses, 0).reshape([1, numClasses]); final stopwatch = Stopwatch()..start(); interpreter.run(inputBytes, outputBuffer); stopwatch.stop(); // Guaranteed < 50ms latency on mobile CPUs final topPrediction = parseTFLiteOutputs(outputBuffer); return DiagnosisResult(disease: topPrediction.label, latencyMs: stopwatch.elapsedMilliseconds); }
// 05. TRADE-OFFS & HONEST REFLECTION
Quantizing to INT8 dropped precision by 2.8% on rare edge cases, but enabled instant offline inference without device overheating.