Welcome to Smart Agriculture 中文
Topic--Intelligent Identification and Diagnosis of Agricultural Diseases and Pests

Rice Disease Identification Method Based on Improved MobileViT Model and System Development

  • LIU Xiaojun , 1, 2, 3 ,
  • WU Qian 1, 2, 3 ,
  • SUN Chuanliang 2, 3 ,
  • QI Chao 2, 3 ,
  • ZHANG Gufeng 2 ,
  • LEI Tianjie 4 ,
  • LIANG Wanjie , 1, 2, 3
Expand
  • 1. School of Ecology and Applied Meteorology, Nanjing University of Information Science &Technology, Nanjing 210044, China
  • 2. Institute of Agricultural Information, Jiangsu Academy of Agricultural Sciences, Nanjing 210014, China
  • 3. Zhongshan Biological Breeding Laboratory, Nanjing 210014, China
  • 4. Institute of Environment and Sustainable Development in Agriculture, Chinese Academy of Agricultural Sciences, Beijing 100081, China
LIANG Wanjie, E-mail: wanjie.liang @163.com

LIU Xiaojun, E-mail:

Received date: 2025-07-30

  Online published: 2025-11-28

Supported by

National Key R&D Program(2023YFD2300300)

Jiangsu Agricultural Science and Technology Innovation Fund(ZSBBL-KY2023-01)

Copyright

copyright©2026 by the authors

Abstract

[Objective] Under abiotic stress conditions, rice plants become fragile and susceptible to disease infection. Accurate diagnosis and scientific prevention and control strategies for rice diseases are crucial for the prevention and control of rice diseases, even disasters such as blooding and high temperatures. However, under field natural environmental conditions, the identification of rice diseases is a challenging problem. There are various issues such as complex backgrounds, illumination changes, occlusion, which make it extremely difficult to comprehensively obtain disease information, thus significantly increasing the difficulty of disease identification. This study aims to develop an efficient rice disease recognition model by integrating the efficient channel attention (ECA) mechanism with the MobileViT model, enhancing the accuracy of rice disease identification in the field. Additionally, the rice disease knowledge graph was combined to achieve precise diagnosis and generate scientifically grounded control prescriptions for effective disease management. [Methods] A total of 1 304 raw images of rice diseases were collected from different rice disease investigation and long-term monitoring points in Jiangsu province, at different periods of time, using mobile phones and cameras. 167 disease images from the rice leaf disease image samples dataset were used to supplement the dataset. The raw images were accurately classified and preprocessed under the guidance of plant protection experts. A dataset containing 1 471 original images was constructed that includes seven types of rice diseases: bacterial leaf blight, false smut, leaf blast, bakanae disease, heart rot, grain discoloration, and panicle blast. The dataset was partitioned into training, validation, and test sets following a 7:1.5:1.5 ratio. Data augmentation techniques were applied exclusively to the training and validation sets to enhance sample diversity, while the test set remained unaugmented to preserve its independence for unbiased model evaluation. Post-augmentation, the total image count increased to 7 735. A novel rice disease recognition model was established by integrating the efficient channel attention (ECA) module into the MobileViT model. The recognition model architecture was optimized by improving convolutional structures, reconstructing Transformer encoding blocks, replacing activation function using SiLU. To verify the performance of the model, cross validation and ablation experiments were conducted. After establishing a highly accurate recognition model, the recognition model was combined with the rice disease knowledge graph to achieve accurate diagnosis of rice diseases and generate scientific prevention and control strategies. Finally, an intelligent rice disease diagnostic system was developed using the Flask framework and cloud computing technologies. [Results and Discussions] The results of the ablation study revealed that the model, which combined convolutional layer optimization, Transformer block reconstruction, and the integration of the ECA module, got outstanding performance.The overall precision, F1-Score and recall rate achieved 97.27%, 97.32%, and 97.46%, respectively. In terms of accuracy, the improved model increased to 97.25%, representing an improvement of 2.3% over the original model (94.95%). To further verify the effectiveness of the improved model, various mainstream models such as Swin Transformer, TinyVit, and ConvNeXt were compared with the proposed model.The experimental results showed that the improved model outperformed the suboptimal model (TinyVit) by 0.92, 1.43, 0.95, 1.32 percent points in overall accuracy, F1-Score and recall rate, respectively. Moreover, the improved model showed significant advantages in terms of floating-point operations, model size, and parameter count, with a parameter count of only 6.02 MB, making it more suitable for deployment on hardware-constrained devices. Analysis of the confusion matrix and heatmap visualizations revealed that the enhanced model achieved recognition accuracy improvements of 0.6, 0.3, 0.3, and 0.6 percentage points for bacterial leaf blight, heart rot, grain discoloration, and panicle blast, respectively. The integrated system, combining this model with the knowledge graph, demonstrated significantly enhanced accuracy in disease identification and diagnosis. Meanwhile, the disease prevention and control strategies were generated to guide rice disease prevention and control. During field deployment, the rice disease diagnosis system achieved an accuracy rate as high as 98%, with an average response time of 181 ms, demonstrating reliable real-time performance and stability. [Conclusions] By integrating ECA module and reconstructing Transformer encoding blocks, the MobileViT model achieved noticeable improvements in precision, recall and F1 score, while effectively reducing computational costs, leading to more efficient recognition capabilities of rice diseases in complex field environments. The application of the rice disease intelligent diagnosis system revealed that the system could achieve accurate rice disease diagnosis results, and generate disease prevention and control strategies for guide rice disease prevention and control. This method could effectively improve the prevention and control efficiency of rice diseases, providing technical support for improving the quality, efficiency, digitization and intelligence of rice production.

Cite this article

LIU Xiaojun , WU Qian , SUN Chuanliang , QI Chao , ZHANG Gufeng , LEI Tianjie , LIANG Wanjie . Rice Disease Identification Method Based on Improved MobileViT Model and System Development[J]. Smart Agriculture, 2026 , 8(1) : 28 -39 . DOI: 10.12133/j.smartag.SA202507043

0 引 言

水稻是全球超半数人口的主要食物来源,为人类提供基本能量与营养,同时也是农民经济收入的重要组成部分。水稻是中国三大粮食作物之一,对保障国家粮食安全至关重要1。然而,水稻病害问题严重威胁水稻产量和品质,不仅阻碍农业经济的健康发展,更直接危及国家粮食安全2。当水稻受涝害、高温、干旱等胁迫时,植株抗性下降极易发生病害3。水稻病害的精准识别和诊断,既是水稻病害防治的关键,也是水稻涝害、高温等灾害防控的关键支撑,对灾害防控、减少经济损失、保障国家粮食安全具有重要意义。
传统水稻病害的识别防治主要依靠农技人员的经验,主观性强且效率较低。随着云计算、大数据、图像处理、模式识别及深度学习等人工智能技术的快速发展,深度学习在该领域的应用越来越广泛。利用深度学习模型学习和自动提取水稻病害图像特征,构建水稻病害识别和检测模型,可实现水稻病害精准监测、诊断和防控4。这对于有效防控灾害、提高水稻产量与质量,推动优质、高效、智慧农业发展具有重大意义。
深度学习具有自动学习特征的能力,泛化能力较强,在病斑识别方面具有显著优势5。卷积神经网络(Convolutional Neural Network, CNN)在农作物病害识别6, 7领域得到广泛应用。LIANG等8提出一种基于CNN的水稻稻瘟病识别模型,能自主学习提取病害特征,获得95.83%识别准确率。鲍文霞等9提出轻量型残差网络(Lightweight Residual Network, LW-ResNet),在自然场景水稻害虫识别中实现92.5%准确率。PURBASARI等10基于CNN架构优化,在4类水稻叶片病害数据集上实现91%的准确率,为印度尼西亚水稻病害自动化诊断提供可行方案。DANIYA和VIGNESHWARI11开发了一种基于马鹿狩猎游戏优化算法(Red Deer Hunting Game-Based Search Optimization, RHGSO)的深度学习模型,用于自动检测和分类水稻叶片病害,准确率达到93.04%。袁培森等12提出MobileNetV3Small-ECA模型,模型大小18.4 MB,通过融合高效通道注意力(Efficient Channel Attention, ECA)模块与迁移学习策略,在开源水稻病害数据集上实现99.92%识别准确率并部署到移动端。NARESH和SAKTHIVEL等13提出一种融合视觉增强分类器(Fused Visual Boosted Classifier, FVBC)的水稻病害检测方法,结合VGG19(Visual Geometry Group 19)特征提取与(Light Gradient Boosting Machine, LightGBM)分类算法,实现97.6%的病害识别准确率,为稻病早期非侵入式诊断提供高效解决方案。
针对大田水稻病害图像识别面临的复杂田间环境干扰及实时性需求等问题,本研究以水稻白叶枯病、稻曲病、叶瘟病、恶苗病、破口病、枯心病及穗瘟病为研究对象,通过数据预处理、数据增强构建水稻病害数据集。利用优化卷积层、重构Transformer编码、集成ECA改进MobileViT,构建水稻病害识别模型,利用数据集对模型进行训练、测试、交叉验证、优化等,并与ConvNeXt、GhostNetV2、TinyViT、Swin-Transformer、MobileViT模型进行性能对比分析。综合利用Flask框架、云平台、水稻病害防控知识图谱研发水稻病害智能识别诊断系统。水稻病害识别诊断模型和智能系统可有效提升水稻病害等灾害的防控效能,为推动水稻种植业向精准化、数字化转型提供创新技术手段。

1 材料与方法

1.1 数据集

水稻病害图像数据主要来源于水稻病害实地调查采集,部分由安装在田间的病害自动采集终端获取。采集的水稻病害图像数据主要来自江苏省兴化市、南京市、海安等病害调查和监测点。所使用的采集设备包括摄像头、智能手机、单反相机及无人机等。图像采集涵盖全天不同时段的光照变化,包括晴天和阴天等多种天气条件,同时覆盖俯视、侧视等多角度成像视角,完整呈现田间实际复杂环境。在植保专家指导下对收集的图像进行分类整理,共整理出7类病害,1 304张图像。利用公开数据集Rice Leaf Disease Image Samples补充167张水稻病害图像。整合两个数据集,构建了1个包含水稻白叶枯病、稻曲病、叶瘟病、恶苗病、枯心病、破口病及穗瘟病7类水稻病害的基础数据集,共包含1 471张图像,部分图像如图1所示。为保证样本分布的均衡性,采用分层采样策略14,先按病害种类划分,每类病害按7∶1.5∶1.5的比例随机划分为训练集、验证集与测试集,再采用数据增强技术扩充数据集,为保证测试集独立性,测试集不采用数据增强技术。图像均分割为224×224像素大小。
图1 水稻病害图像样例

Fig. 1 Sample images of rice diseases

数据增强技术通过引入对抗性样本或噪声提高样本多样性,避免模型学习到偶然特征陷入局部最优,从而有效提升模型的鲁棒性和泛化能力15。常见的数据增强方法有几何变换16、噪声模糊与颜色变换17等。本研究采用水平、垂直翻转和±30°随机旋转(配合裁剪填充)模拟朝向变化;通过中等强度的随机色彩抖动(包括亮度、对比度等)模拟光照变化;注入明显噪声(标准差30)提升抗噪性;并应用双重随机化的高斯模糊(内核5×5~11×11,标准差1~5)模拟失焦或动态场景,增强模型对不同视角、光照、噪声和模糊的适应性。不同数据增强技术处理后图像与原图像如图2所示。增强后数据集共含7 735张图像,其中训练集6 180张,验证集1 335张,测试集220张。数据集基本信息如表1所示。
图2 数据增强图像示例

Fig. 2 Sample of data enhancement images

表1 水稻病害数据集基本信息

Table 1 Basic information of the rice disease dataset

水稻病害类别 类别标签 增强前图像/张 增强后图像/张
合计 1 471 7 735
水稻白叶枯病 sdbyk 122 1 075
水稻稻曲病 sddqb 165 1 100
水稻叶瘟病 sddwby 347 1 154
水稻恶苗病 sdemby 154 1 089
水稻枯心病 sdkx 197 1 089
水稻破口病 sdpk 250 1 100
水稻穗瘟病 sdsw 236 1 128

1.2 模型构建

1.2.1 MobileViT模型

MobileViT18是一种轻量级视觉识别模型,巧妙融合CNN的局部特征提取与Transformer的全局建模能力。其结构如图3所示,首先输入图像经3×3卷积初步下采样,通过4个MobileNetV2倒置残差块(MV2)逐步提升通道数(16→64)并降低分辨率(至28×28),强化局部语义。其次通过3个核心MobileViT块:每个块前通过MV2调整分辨率,块内先用卷积提取局部细节,再展平特征图为序列输入轻量级Transformer编码器,捕获长序列依赖特征;最后将Transformer输出重构为2D特征图,兼具局部精度与全局视野。输出经1×1卷积调整通道,再通过全局平均池化和分类层得到分类结果。该设计继承了MobileNet的轻量化优势,并通过Transformer解决了CNN全局建模的不足。
图3 MobileViT模型结构

Fig. 3 Structure of MobileViT model

1.2.2 注意力机制

注意力机制通过动态聚焦关键特征,显著提升模型判别力与鲁棒性。ECA19在SE20(Squeeze-and-excitation)基础上进行轻量化改进(图4),通过全局平均池化(Global Average Pooling, GAP)压缩空间信息得到通道描述符;采用1个自适应核大小的一维卷积层(1×1 Conv)直接作用于该描述符,高效捕获局部跨通道交互关系;通过Sigmoid激活函数生成通道注意力权重,与原特征进行通道级加权。
图4 ECA模块结构

Fig. 4 Structure of ECA

1.2.3 改进MobileVIT模型

改进MobileViT模型在继承MobileViT原始分层编码架构的基础上,通过3项关键技术优化实现特征表达能力与模型效率的协同提升,结构如图5所示。首先,在5阶段层级架构中,ECA21模块被双重嵌入MobileViT块,一方面在局部表征分支的3×3卷积后执行通道重校准,通过自适应核大小(由通道数经γ=2、b=1参数动态计算)的1D卷积实现特征通道的动态加权;另一方面在Transformer编码器的前馈网络(Feed Forward Network, FFN)输出端增设ECA模块,形成“局部特征增强-全局特征优化”的级联注意力机制。其次,卷积层的模块化重构与优化:对全网络卷积操作(含初始3×3卷积层、MobileNet倒残差块及MobileViT块内卷积)进行标准化设计,激活函数SiLU平滑非线性,梯度更稳定,在深度网络中表现更好,替代原ReLU622,并通过强制通道数为8的整数倍(如Stage 2输出通道32→48)及整数除法计算padding(padding=kernel_size//2),确保特征尺寸对齐与通道配置合理性。最后,Transformer编码器的性能增强:将原编码器升级为分离式结构,使用SiLU激活函数替换FFN层中传统GELU、引入ECA通道增强子层,并采用Xavier均匀初始化(多头注意力)与Kaiming正态初始化(线性层),提升特征变换效率与训练稳定性。模型以3×3卷积层(输出通道16,步长2)启动特征提取,经Stage 2的2层MobileNet倒残差块完成局部特征抽象后,从Stage 3(28×28分辨率)启用集成ECA的MobileViT块,并延续至14×14、7×7分辨率阶段,构建3层渐进式全局-局部特征融合架构,最终通过通道扩展层(通道数增加到4倍)与全局平均池化实现分类输出,在保持轻量化特性的同时显著提升细粒度特征建模能力。
图5 改进MobileViT网络结构

Fig. 5 Network architecture of improved MobileViT

1.3 评价指标

本研究选取的模型性能评价指标包括准确率(Accuracy, ACC)、精度(Precision)、召回率(Recall)、F 1、模型体积与推理速度。准确率表示正确分类样本数占样本总数的比例,准确率越高,说明模型性能越好;精度表示被分为正例的样本中实际为正样本的比例,值越高说明分类错误越少;召回率是覆盖面的度量,衡量分类器对正样本的识别能力;综合指标F 1值,是精度和召回率的调和平均值;模型体积反映模型复杂度及占用资源量,推理速度表示模型每秒能处理的图像帧数,反映模型推理效率。相关计算如公式(1)~公式(5)所示。
A C C = T P + T N T P + F P + F N + T N   
P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N
F 1 = 2 1 P r e c i s i o n + 1 R e c a l l
F P S = B × N j = 1 M T j   
式中:TP为正样本被分为正样本的个数;FP为负样本被分为正样本的个数;TN为负样本分为负样本的个数;FN为正样本分为负样本的个数;B为批处理大小;N为迭代次数;Tj 为第j个批次的延迟。

2 结果与分析

2.1 实验平台

数据预处理、模型训练、系统研发编程语言为Python 3.10.1,深度学习框架为Pytorch 2.5.0,CUDA版本为11.0。服务器CPU型号为Intel(R) Xeon(R)Gold 5218R,GPU型号为NVIDIA A100-PCIE-40 GB,操作系统为Ubuntu 18.04。使用微信web开发工具设计系统前端UI,后端通过Flask框架实现。

2.2 试验结果

2.2.1 消融实验

为系统评估不同优化方法及组合对模型性能的影响,在相同环境和超参条件下完成模型训练和测试:训练100轮,batch-size为32,优化器AdamW,学习率采用余弦退火策略,推理速度计算批次为5。对比了原MobileViT、优化卷积层、重构Transformer编码块、集成ECA模块的模型变体,具体性能对比见表2
表2 不同优化策略对MobileViT模型性能影响对比

Table 2 Performance comparison of different optimization strategies on the MobileViT model

优化卷积层 重构Transformer编码块 ECA机制 准确率/% 精度/% 召回率/% F 1分数/% 推理速度/(f/s) 模型大小/MB
× × × 94.95 94.61 95.22 94.89 170.80 6.02
× × 96.56 96.72 96.52 96.53 141.04 6.02
× × 95.87 95.50 95.56 95.47 137.74 6.02
× × 96.79 96.40 96.98 96.60 144.32 6.02
× 96.33 95.97 96.83 96.26 139.61 6.02
× 96.79 96.63 97.41 96.95 128.22 6.02
× 94.50 93.59 94.63 94.01 120.34 6.02
97.25 97.27 97.46 97.32 139.17 6.02
试验结果表明,同时优化卷积层、重构Transformer编码块并集成ECA模块的模型综合性能最优,准确率达到97.25%,精度97.27%,F 1分数为97.32%、召回率达97.46%,其准确率比基础模型(94.95%)提升2.3个百分点。这验证了多模块协同优化策略的有效性,尤其在特征提取方面展现出显著优势。在推理速度方面,139.17 f/s的处理速度虽低于原MobileViT(170.80 f/s),但仍满足快速识别需求,在精度与速度间实现了更好平衡。三种模块协同优化策略相较于单个或两模块组合优化方法具有明显优势。所有优化方案的模型体积均稳定控制在6.02 MB,优化卷积层与重构Transformer编码、集成轻量级ECA对模型大小几乎没有影响。3种模块协同优化策略满足轻量化与高精度的双重需求。

2.2.2 不同模型性能对比分析

为全面评估改进MobileViT模型的性能,本研究选取主流的识别模型(MobileViT、Swin-Transformer23、GhostNetV224、TinyViT25、ConvNeXt26)进行性能对比分析。基于自建数据集,在相同参数设置条件下,通过交叉验证,统计各模型性能评价指标,从准确率、精度、效率及资源消耗多个维度进行性能对比分析。各模型在测试集上的正确率和损失值对比结果如图6所示。对比结果表明改进MobileViT模型性能最好,准确率最高,收敛速度最快,损失值最小。
图6 改进MobileViT、MobileViT、Swin-Transformer、GhostNetV2、TinyViT、ConvNeXt模型性能对比图

Fig. 6 Comparison of improved MobileViT, MobileViT, Swin-Transformer, GhostNetV2, TinyViT, and ConvNeXt

各模型性能指标统计值如表3所示。本研究提出的模型分类性能最优,其准确率(97.25%)、精度(97.27%)、召回率(97.46%)和F 1分数(97.32%)均高于其他模型,较次优模型(TinyVit)高出0.92、1.43、0.95、1.32个百分点,准确率较ConvNeXt、TinyVit、Swin Transformer分别提高6.88、8.72、0.92、2.3个百分点。在效率方面,改进MobileViT的推理速度(139 f/s)低于MobileViT、(170 f/s,298.09 f/s),远高于其他模型。在资源消耗方面,其模型大小为6.02 MB,不足ConvNeXt的2%。综上所述,改进MobileViT模型在精度、速度与轻量化上实现最佳平衡,既能获得较高的水稻病害识别精度,又能满足实时性和轻量化的应用需求。
表3 改进MobileViT、MobileViT、Swin-Transformer、GhostNetV2、TinyViT、ConvNeXt模型综合性能对比

Table 3 Comparative analysis of comprehensive performance across different models: improved MobileViT, MobileViT, Swin-Transformer, GhostNetV2, TinyViT, and ConvNeXt

网络模型 准确率/% 精度/% 召回率/% F 1分数/% 推理速度/fps 模型体积/MB
ConvNeXt 90.37 89.56 91.17 89.86 100.37 334.07
GhostNetV2 88.53 88.09 88.64 88.24 298.09 18.87
TinyViT 96.33 95.84 96.51 96.00 128.02 21.23
Swin-Transformer 94.95 94.30 95.68 94.84 96.59 331.37
MobileViT 94.95 94.61 95.22 94.89 170.80 6.02
改进MobileViT 97.25 97.27 97.46 97.32 139.17 6.02

2.2.3 模型性能综合评价

改进MobileViT模型与原模型在测试集上的归一化混淆矩阵对比结果如图7所示。混淆矩阵分析表明:原模型中白叶枯病(0.06,误判为叶瘟病)、枯心病(0.03,误判为恶苗病)、破口病(0.03,误判为枯心病)、穗瘟病(0.06,误判为稻曲病)等病害存在显著的类别混淆问题;改进后,模型的分类性能得到明显提升。由于Transformer模块对细粒度特征学习不足,ECA模块更依赖通道统计信息,导致稻曲病和叶瘟病没有明显提升。
图7 MobileViT和改进MobileViT模型混淆矩阵图

Fig. 7 Confusion matrix of the MobileViT and improved MobileViT model

改进MobileViT模型对各病害的识别性能指标见表4。模型对恶苗病的综合识别能力较好(精度为98.64%,召回率为99.35%,F 1为98.99%),展现出极强的判别能力。白叶枯病、恶苗病、枯心病、破口病和穗瘟病的召回率均超过98%(分别为98.80%、99.35%、98.37%、98.97%和98.82%),表明模型能够精准识别出这些病害样本。稻曲病与叶瘟病的识别精度均超过98%(分别为98.58%、98.28%),但召回率相对略低(分别为93.52%、94.42%),说明模型在识别这两类病害时虽能有效避免误判,但存在少量漏检情况。所有病害类别的F 1分数均超过95%,反映出模型整体具有较高的识别稳定性和泛化能力。
表4 改进MobileViT模型对水稻病害识别结果

Table 4 Recognition results of the improved MobileViT model for rice disease

病害类别 精度/% 召回率/% F 1分数/%
白叶枯病 95.97 98.80 97.35
稻曲病 98.58 93.52 95.95
叶瘟病 98.28 94.42 96.27
恶苗病 98.64 99.35 98.99
枯心病 97.88 98.37 98.10
破口病 96.20 98.97 97.56
穗瘟病 95.35 98.82 97.03
选取正确率提升较大的白叶枯病与穗瘟病两类样本,对比模型前后Conv1至Stage4层特征热力图(暖色调为高贡献区)。如图8所示,改进MobileViT从Conv1层即强化病斑响应(白叶枯病叶脉黄化区、穗瘟病穗红点),且特征聚焦度随网络深度持续提升。其热力图高亮区域(红黄)与病斑位置、形态高度吻合,背景干扰(蓝紫色)显著减少;尤其在穗瘟病识别时,病穗激活更集中、边缘轮廓更清晰。通过病害区域标注,改进后模型热力图交并比(Intersection over Union, IoU):白叶枯病0.566 1、穗瘟病0.594 9,均高过原模型热力图IoU(白叶枯病0.047 1、穗瘟病0.150 0),可见改进后模型提取特征能力更强。改进模型通过增强早期特征筛选与深层语义对齐,实现病害定位精度与区域完整性双重优化,验证了结构改进对水稻病害细粒度特征提取的有效性。
图8 不同热力特征层在改进MobileViT和MobileViT可视化方面的比较

Fig. 8 Comparison of different thermal feature layers in improved MobileViT and MobileViT visualization

MobileViT模型识别白叶枯病
改进MobileViT模型识别白叶枯病
MobileViT模型识别穗瘟病
改进MobileViT模型识别穗瘟病
a. 原图 b. Conv1层 c. Maxpool层 d. Stage2 e. Stage3 f. Stage4

3 基于病害识别模型的水稻病害智能识别诊断系统设计与实现

3.1 系统总体设计

水稻病害智能识别诊断系统采用B/S架构,实现前后端分离设计(图9),主要功能模块包括:用户注册、用户登录、信息采集、服务端、知识库管理与结果展示等。前端基于微信小程序实现用户交互,主要实现知识查询、病害图像及相关信息采集、上传、结果展示等功能;后端通过Flask架构加载病害识别模型,融合识别结果、生育期、知识图谱等生成病害诊断结果和防治措施。
图9 水稻病害智能识别诊断系统工作流程图

Fig. 9 Work flowchart of rice disease intelligent recognition and diagnosis system

3.2 系统实现

3.2.1 手机端实现

手机端基于微信小程序双线程架构(视图层/逻辑层分离),采用Model View ViewModel(MVVM)模式实现数据驱动视图。用户注册登录后,通过设备硬件API完成图像采集,结合HTTP请求实现上传。利用setData实现识别结果动态绑定。设置网络请求超时熔断与缓存策略控制内存消耗,构建高效交互系统,实现流畅交互操作。登录界面及功能界面如图10所示。
图10 水稻病害智能识别诊断系统手机登录与功能界面

a. 登录界面 b. 识别功能界面 c. 识别结果

Fig. 10 Mobile interface for the smart rice disease identification and diagnosis system: login and features

3.2.2 服务端实现

服务端采用Flask框架构建轻量化RESTful API,通过严格复现训练阶段预处理流水线(Resize→CenterCrop→标准化)保障输入数据分布一致性。基于PyTorch加载病害识别模型,依托CUDA设备自动检测机制实现GPU透明化推理加速,结合CORS跨域支持与JSON结构化响应(含置信度及语义标签)构建端到端服务。通过模型识别病害类别标签,匹配水稻病害知识图谱信息,将结果返回至系统前端。

3.2.3 基于水稻病害知识图谱的病害诊断

识别结果(Label)匹配病害知识图谱中对应的病害(名称、致病机理)、病理特征(病发部位、病斑形状、颜色)及防治建议(药剂、措施),再通过规则引擎映射至生育期(病发阶段)特异性防治策略。知识图谱整合了《2025年粮食作物重大病虫害防控技术方案》的病理特征与防控阈值,其中水稻白叶枯病害知识图谱实例如图11所示。系统结合识别结果和水稻病害知识图谱,动态匹配病害发展阶段与农事操作窗口期,实现精准的病害诊断,最终生成包含病原鉴定、化学防治及生态调控的水稻病害综合防治措施。
图11 水稻白叶枯病害图谱实例

Fig. 11 Example of rice leaf blight disease knowledge graph

3.3 系统测试

在水稻大田病害调查过程中,用智能手机采集病害图像,并对病害进行诊断,如图12所示,测试结果如图13所示。实际应用结果表明,与植保专家辨别结果对比,识别准确率可达98%,系统平均响应时间181 ms,推理速度较快。结合病害知识图谱生成防治建议科学可靠。该系统可满足田间水稻病害诊断对准确性、实时性和轻量化的应用需求。
图12 系统在水稻大田病害调查中的应用

Fig. 12 Application of the system in the rice diseases investigation

图13 水稻大田病害识别结果

Fig. 13 Identification results of rice field disease

4 结 论

本研究通过优化卷积层、重构Transformer编码器、集成ECA机制构建了1个水稻病害识别模型,识别准确率达97.25%,较原MobileViT模型提升2.3%,同时保持轻量化(6.02 MB)和快速推理速度(139.17 f/s)。结合改进MobileViT模型与水稻病害知识图谱实现了水稻病害智能诊断,并生成科学的防控措施,并基于Flask架构、云计算等技术,研发1个水稻病害智能识别诊断系统。主要结论如下:
(1)卷积层优化、集成ECA模块与Transformer编码器重构明显提高了病害关键特征的通道筛选能力,增强了MobileViT模型提取特征的能力,识别准确率显著提高,并保持较小的模型大小,实现精度与轻量化的平衡。
(2)病害智能识别系统在大田水稻病害调查应用结果表明,基于改进MobileViT识别模型和水稻病害知识图谱构建的水稻病害智能识别诊断系统可以实现对病害的准确诊断并给出科学合理的防治策略,能满足田间水稻病害识别诊断对准确性、实时性和轻量化的应用需求。
本研究通过“数据-模型-系统”的全链条优化,为水稻病害的快速、精准识别诊断及防控提供了科学、可行的轻量化解决方案。但水稻病害类型还不够丰富,模型的泛化能力还需进一步加强。下一步要结合生产实践和水稻病害田间调查,采集更多水稻病害图像,进一步增强数据集的丰富度和多样性;同时优化模型,提高模型鲁棒性和泛化能力。

本研究不存在研究者以及与公开研究成果有关的利益冲突。

[1]
张方潇, 陈翛, 黄娜, 等. 长江流域单季稻关键生育期高温、干旱及其复合事件时空分布特征[J]. 中国农业大学学报, 2025, 30(4): 1-14.

ZHANG F X, CHEN X, HUANG N, et al. Spatio-temporal distribution of high-temperature, drought and their compound events during the critical fertility stages of single-season rice in the Yangtze River Basin[J]. Journal of China Agricultural University, 2025, 30(4): 1-14.

[2]
RAHMAN C R, ARKO P S, ALI M E, et al. Identification and recognition of rice diseases and pests using convolutional neural networks[J]. Biosystems Engineering, 2020, 194: 112-120.

[3]
ASHIKARI M, NAGAI K, BAILEY-SERRES J. Surviving floods: Escape and quiescence strategies of rice coping with submergence[J]. Plant Physiology, 2025, 197(2): kiaf029.

[4]
周成, 陈章彬, 杜雅刚, 等. 面向边缘计算的水稻病害检测方法与装置研究[J]. 农业机械学报, 2025, 56(4): 353-362.

ZHOU C, CHEN Z B, DU Y G, et al. Development of rice disease detection methods and devices for edge computing[J]. Transactions of the Chinese Society for Agricultural Machinery, 2025, 56(4): 353-362.

[5]
冀常鹏, 佐永吉, 代巍. 基于CMS-YOLOv8n的葡萄叶片病害检测[J]. 沈阳农业大学学报, 2025, 56(3): 95-105.

JI C P, ZUO Y J, DAI W. Detection of grape leaf diseases based on CMS-YOLOv8n[J]. Journal of Shenyang Agricultural University, 2025, 56(3): 95-105.

[6]
李晓辉, 刘星呈, 李静, 等. 水稻叶部病害轻量化检测方法研究[J]. 沈阳农业大学学报, 2025, 56(6): 68-82.

LI X H, LIU X C, LI J, et al. Research on lightweight detection method of rice leaf diseases[J]. Journal of Shenyang Agricultural University, 2025, 56(6): 68-82.

[7]
THAI H T, LE K H. MobileH-Transformer: Enabling real-time leaf disease detection using hybrid deep learning approach for smart agriculture[J]. Crop Protection, 2025, 189: 107002.

[8]
LIANG W J, ZHANG H, ZHANG G F, et al. Rice blast disease recognition using a deep convolutional neural network[J]. Scientific Reports, 2019, 9: 2869.

[9]
鲍文霞, 吴德钊, 胡根生, 等. 基于轻量型残差网络的自然场景水稻害虫识别[J]. 农业工程学报, 2021, 37(16): 145-152.

BAO W X, WU D Z, HU G S, et al. Rice pest identification in natural scene based on lightweight residual network[J]. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(16): 145-152.

[10]
PURBASARI I Y, RAHMAT B, PUTRA PN C S. Detection of rice plant diseases using convolutional neural network[J]. IOP Conference Series: Materials Science and Engineering, 2021, 1125(1): 012021.

[11]
DANIYA T, VIGNESHWARI S. Rice plant leaf disease detection and classification using optimization enabled deep learning[J]. Journal of Environmental Informatics, 2023,42(1): 25-38.

[12]
袁培森, 欧阳柳江, 翟肇裕, 等. 基于MobileNetV3Small-ECA的水稻病害轻量级识别研究[J]. 农业机械学报, 2024, 55(1): 253-262.

YUAN P S, OUYANG L J, ZHAI Z Y, et al. Lightweight identification of rice diseases based on improved ECA and MobileNetV3Small[J]. Transactions of the Chinese Society for Agricultural Machinery, 2024, 55(1): 253-262.

[13]
NARESH KUMAR B, SAKTHIVEL S. Rice leaf disease classification using a fusion vision approach[J]. Scientific Reports, 2025, 15: 8692.

[14]
MIAO N, YANG M K, HAN P P, et al. A new ensemble learning method stratified sampling blending optimizes conventional blending and improves prediction performance[J]. Bioinformatics Advances, 2024, 5(1): vbaf002.

[15]
严从宽, 朱德泉, 孟凡凯, 等. 基于改进CycleGAN的水稻叶片病害图像增强方法[J]. 智慧农业(中英文), 2024, 6(6): 96-108.

YAN C K, ZHU D Q, MENG F K, et al. Rice leaf disease image enhancement based on improved CycleGAN[J]. Smart Agriculture, 2024, 6(6): 96-108.

[16]
TURKOGLU M, ASLAN M, ARI A, et al. A multi-division convolutional neural network-based plant identification system[J]. PeerJ Computer Science, 2021, 7: e572.

[17]
LIU B, DING Z F, TIAN L L, et al. Grape leaf disease identification using improved deep convolutional neural networks[J]. Frontiers in Plant Science, 2020, 11: 1082.

[18]
MEHTA S, RASTEGARI M. MobileViT: Light-weight, general-purpose, and mobile-friendly vision transformer[EB/OL]. arXiv: 2110.02178, 2021.

[19]
潘晨露, 张正华, 桂文豪, 等. 融合ECA机制与DenseNet201的水稻病虫害识别方法[J]. 智慧农业(中英文), 2023, 5(2): 45-55.

PAN C L, ZHANG Z H, GUI W H, et al. Rice disease and pest recognition method integrating ECA mechanism and DenseNet201[J]. Smart Agriculture, 2023, 5(2): 45-55.

[20]
MASFEQUIER RAHMAN SWAPNO S M, NURUZZAMAN NOBEL S M, ISLAM M B, et al. ViT-SENet-Tom: Machine learning-based novel hybrid squeeze-excitation network and vision transformer framework for tomato fruits classification[J]. Neural Computing and Applications, 2025, 37(9): 6583-6600.

[21]
LI Y Y, YUAN G, WEN Y, et al. EfficientFormer: Vision transformers at MobileNet speed[EB/OL]. arXiv: 2206.01191, 2022.

[22]
TAN M X, LE Q V. EfficientNet: Rethinking model scaling for convolutional neural networks[EB/OL]. arXiv: 1905.11946, 2019.

[23]
GUO Q W, WANG C T, XIAO D Q, et al. A novel multi-label pest image classifier using the modified swin transformer and soft binary cross entropy loss[J]. Engineering Applications of Artificial Intelligence, 2023, 126: 107060.

[24]
LI Z H, FANG X, ZHEN T, et al. Detection of wheat yellow rust disease severity based on improved GhostNetV2[J]. Applied Sciences, 2023, 13(17): 9987.

[25]
WU K, ZHANG J N, PENG H W, et al. TinyViT: Fast pretraining distillation for small vision transformers[M]// Computer Vision-ECCV 2022. Cham: Springer Nature Switzerland, 2022: 68-85.

[26]
P T, XU H L, ZHANG Q H, et al. An improved lightweight ConvNeXt for rice classification[J]. Alexandria Engineering Journal, 2025, 112: 84-97.

Outlines

/