An Android-Based Expert-in-the-Loop System for Date Palm Disease Diagnosis Using Calibrated Confidence Routing and Active Dataset Enrichment
الكلمات المفتاحية:
date palm disease، expert-in-the-loop، confidence calibration، temperature scaling، knowledge distillation، TensorFlow Lite، edge–cloud routing، Firebase، Android، smart agricultureالملخص
Date palm disease diagnosis in the field remains dependent on expert availability and subjective visual assessment. This paper presents an Android-based diagnostic system that integrates on-device deep learning inference with selective cloud escalation and structured expert feedback. A ShuffleNetV2 ×1.0 student model (~5 MB), trained through knowledge distillation from an optimized ConvNeXt-Tiny teacher (T = 2, α = 0.7), performs nine-class leaf disease classification directly on the mobile device via TensorFlow Lite. To address the overconfidence problem inherent in compact neural networks, post-hoc temperature scaling ( = 1.3976) is applied to calibrate the softmax outputs before routing. A systematically optimized threshold (τ = 0.93), selected through a 50-point sweep on calibrated confidence scores, governs whether each prediction is accepted locally or forwarded to the cloud-hosted teacher model on Google Cloud Run. The application provides two role-based interfaces: a Viewer interface for field workers offering GPS-tagged diagnosis, analytics, and data export; and an Expert interface enabling agricultural specialists to review uncertain cases and contribute validated labels to a structured Firebase dataset for future retraining. A three-tier caching mechanism ensures offline operability. Evaluation on 464 held-out test images yielded 99.14% system accuracy (Macro F1 = 0.9789, Balanced Accuracy = 0.9733), with 93.75% of cases resolved at the edge. The calibrated routing intercepted 8 of the 9 edge-model errors and corrected 6 through cloud re-inference, reducing total misclassifications from 9 to 4.
Date palm disease diagnosis in the field remains dependent on expert availability and subjective visual assessment. This paper presents an Android-based diagnostic system that integrates on-device deep learning inference with selective cloud escalation and structured expert feedback. A ShuffleNetV2 ×1.0 student model (~5 MB), trained through knowledge distillation from an optimized ConvNeXt-Tiny teacher (T = 2, α = 0.7), performs nine-class leaf disease classification directly on the mobile device via TensorFlow Lite. To address the overconfidence problem inherent in compact neural networks, post-hoc temperature scaling ( = 1.3976) is applied to calibrate the softmax outputs before routing. A systematically optimized threshold (τ = 0.93), selected through a 50-point sweep on calibrated confidence scores, governs whether each prediction is accepted locally or forwarded to the cloud-hosted teacher model on Google Cloud Run. The application provides two role-based interfaces: a Viewer interface for field workers offering GPS-tagged diagnosis, analytics, and data export; and an Expert interface enabling agricultural specialists to review uncertain cases and contribute validated labels to a structured Firebase dataset for future retraining. A three-tier caching mechanism ensures offline operability. Evaluation on 464 held-out test images yielded 99.14% system accuracy (Macro F1 = 0.9789, Balanced Accuracy = 0.9733), with 93.75% of cases resolved at the edge. The calibrated routing intercepted 8 of the 9 edge-model errors and corrected 6 through cloud re-inference, reducing total misclassifications from 9 to 4.