用知识蒸馏让轻量模型在手机上实现顶级植物病害识别
Hybrid Knowledge Transfer through Attention and Logit Distillation for On-Device Vision Systems in Agricultural IoT
- 将ViT的注意力与分类信息同时迁移到MobileNet,提升小模型表现
- 在番茄数据集上达92.4%准确率,推理延迟降低至86毫秒/图
- 专为物联网设备设计,内存仅13MB,适合农田实时监测
将深度学习应用于农业物联网系统面临高精度视觉变换器(ViTs)与资源受限边缘设备效率之间的矛盾。大型Transformer模型如Swin Transformer虽能捕捉全局-局部依赖,实现95.9%准确率,但计算量高达34.1 GFLOPs,难以实现实时端侧推理。轻量级模型如MobileNetV3和TinyML虽适合端侧部署,却缺乏细粒度疾病检测所需的空间推理能力。为此,本文提出一种融合注意力与输出概率的知识蒸馏框架,将Swin Transformer教师模型的知识迁移至MobileNetV3学生模型。引入自适应注意力对齐机制以解决跨架构差异(分辨率、通道数),并采用双损失函数同时优化类别概率与空间关注区域。在lantVillage-Tomato数据集(18,160张图像)上,蒸馏后的MobileNetV3达到92.4%准确率,相比原模型降低95%的计算量(PC端),在物联网设备上推理延迟低于82%,仅需23ms(PC CPU)和86ms/图像(智能手机CPU)。关键创新包括面向物联网的验证指标(13 MB内存,0.22 GFLOPs)与动态分辨率匹配的注意力图。对比实验表明,显著优于传统CNN及现有蒸馏方法,在准确率上比MobileNetV3基线提升3.5%。该工作推动了精准农业中实时、低功耗作物监测的发展,证明了在边缘设备上实现ViT级诊断精度的可行性。代码与模型将在录用后公开。
原文摘要 · Abstract (English)
Integrating deep learning applications into agricultural IoT systems faces a serious challenge of balancing the high accuracy of Vision Transformers (ViTs) with the efficiency demands of resource-constrained edge devices. Large transformer models like the Swin Transformers excel in plant disease classification by capturing global-local dependencies. However, their computational complexity (34.1 GFLOPs) limits applications and renders them impractical for real-time on-device inference. Lightweight models such as MobileNetV3 and TinyML would be suitable for on-device inference but lack the required spatial reasoning for fine-grained disease detection. To bridge this gap, we propose a hybrid knowledge distillation framework that synergistically transfers logit and attention knowledge from a Swin Transformer teacher to a MobileNetV3 student model. Our method includes the introduction of adaptive attention alignment to resolve cross-architecture mismatch (resolution, channels) and a dual-loss function optimizing both class probabilities and spatial focus. On the lantVillage-Tomato dataset (18,160 images), the distilled MobileNetV3 attains 92.4% accuracy relative to 95.9% for Swin-L but at an 95% reduction on PC and < 82% in inference latency on IoT devices. (23ms on PC CPU and 86ms/image on smartphone CPUs). Key innovations include IoT-centric validation metrics (13 MB memory, 0.22 GFLOPs) and dynamic resolution-matching attention maps. Comparative experiments show significant improvements over standalone CNNs and prior distillation methods, with a 3.5% accuracy gain over MobileNetV3 baselines. Significantly, this work advances real-time, energy-efficient crop monitoring in precision agriculture and demonstrates how we can attain ViT-level diagnostic precision on edge devices. Code and models will be made available for replication after acceptance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。