PROJECT CASE STUDY // TECHNICAL NARRATIVE

PashuSwasthya

Offline-First Multilingual Mobile App for Cattle Breed & Disease Diagnosis

YOUR ROLE & SCOPEAI Model Engineer & Mobile App Developer
TIMELINE3 Months
CORE CONSTRAINTSZero internet connectivity in remote farmland; target budget Android devices (<2GB RAM).
error_outline

1. THE PROBLEM

Rural cattle farmers face severe economic losses due to delayed veterinary diagnosis for cattle diseases in remote zero-connectivity zones.

architecture

2. TECHNICAL APPROACH & DECISIONS

1On-Device Quantized TFLite Inference

✓ DECISION CHOSEN

Trained MobileNetV3 CNN in TensorFlow, then applied INT8 post-training quantization to export a 14MB TFLite model running 100% on-device.

✕ REJECTED ALTERNATIVE

Cloud-hosted Inference API

Cloud APIs fail in internet-dead zones. INT8 quantization reduced model size from 65MB to 14MB with sub-50ms inference latency.

code

CORE ARCHITECTURAL LOGIC

dartml/tflite_engine.dart

On-device INT8 quantized MobileNetV3 TFLite inference loop with sub-50ms latency.

ml/tflite_engine.dart
1Future<DiagnosisResult> runOnDeviceInference(File imageFile) async {
2 final inputBytes = await preprocessImage(imageFile, targetSize: 224);
3 final interpreter = await Interpreter.fromAsset('models/mobilenet_v3_quant.tflite');
4
5 var outputBuffer = List<int>.filled(numClasses, 0).reshape([1, numClasses]);
6 final stopwatch = Stopwatch()..start();
7
8 interpreter.run(inputBytes, outputBuffer);
9 stopwatch.stop(); // Guaranteed < 50ms latency on mobile CPUs
10
11 final topPrediction = parseTFLiteOutputs(outputBuffer);
12 return DiagnosisResult(disease: topPrediction.label, latencyMs: stopwatch.elapsedMilliseconds);
13}
balance

3. TRADE-OFFS & HONEST REFLECTION

Quantizing to INT8 dropped precision by 2.8% on rare edge cases, but enabled instant offline inference without device overheating.

task_alt

4. CONCRETE OUTCOME & METRICS

Shipped a 100% offline veterinary diagnostic tool operating with sub-50ms inference latency and localized regional voice output.

100% Offline FirstNetwork Dependency
14 MB Quantized TFLiteModel Size
< 50ms On-DeviceInference Latency
Explore Project Sources
Review live deployment or inspect codebase on GitHub.