A lightweight crop pest identification method based on multi-head attention
-
摘要:目的
解决当前病虫害识别方法参数多、计算量大、难以在边缘嵌入式设备部署的问题,实现农作物病虫害精准识别,提高农作物产量和品质。
方法提出一种融合多头注意力的轻量级卷积网络(Multi-head attention to convolutional neural network,M2CNet)。M2CNet采用层级金字塔结构,首先,结合深度可分离残差和循环全连接残差构建局部捕获块,用来捕捉短距离信息;其次,结合全局子采样注意力和轻量级前馈网络构建轻量级全局捕获块,用来捕捉长距离信息。提出M2CNet-S/B/L 3个变体以满足不同的边缘部署需求。
结果M2CNet-S/B/L参数量分别为1.8M、3.5M和5.8M,计算量(Floating point operations,FLOPs)分别为0.23G、0.39G和0.60G。M2CNet-S/B/L对PlantVillage病害数据集取得了大于99.7%的Top5准确率和大于95.9%的Top1准确率,对IP102虫害数据集取得了大于88.4%的Top5准确率和大于67.0%的Top1准确率,且比同级别的模型表现优异。
结论该方法能够对作物病虫害进行有效识别,且可为边缘侧工程部署提供有益参考。
Abstract:ObjectiveTo solve the problems that the current pest identification method has many parameters, a large amount of calculation and is difficult to deploy embedded devices at the edge, so as to realize accurate identification of crop pests and diseases, and improve crop yield and quality.
MethodA lightweight convolutional neural network called multi-head attention to convolutional neural network (M2CNet) was proposed. M2CNet adopted hierarchical pyramid structure. Firstly, a local capture block was constructed by combining depth separable residual and cyclic fully connected residual to capture short-range information. Secondly, a lightweight global capture block was constructed by combining global subsampling attention and lightweight feedforward network to capture long-distance information. Three variants, namely M2CNet-S, M2CNet-B, and M2CNet-L, were proposed by M2CNet to meet different edge deployment requirements.
ResultM2CNet-S/B/L had parameter sizes of 1.8M, 3.5M and 5.8M, and floating point operations of 0.23G, 0.39G, and 0.60G, respectively. M2CNet-S/B/L achieved top5 accuracy greater than 99.7% and top1 accuracy greater than 95.9% in PlantVillage disease dataset, and top5 accuracy greater than 88.4% and top1 accuracy greater than 67.0% in IP102 pest dataset, outperforming models of the same level in comparison.
ConclusionEffective identification of crop diseases and pests can be achieved by this method, and it provides valuable references for edge engineering deployment.
-
奶牛养殖业在畜牧业发展中具有极其重要的地位[1]。集成化、智能化和标准化养殖已成为保证奶牛进食量、提高牛奶产量及保障乳制品品质的必然选择[2]。对于奶牛饲养,自由采食能提高饲料摄入量和牛奶产量,但奶牛进食时易将饲料拱出饲喂区,造成饲料的分散,不利于奶牛的进食。这样不仅浪费饲料,最重要的是影响奶牛的营养摄入量,最终影响产奶量和产奶质量[3-4]。目前,国外很多牛场采用以Lely、Valmetal公司的PRO-FEED为代表的推料机器人,Lely推料机器人[5]通过旋转的圆柱形外壳将饲料推回到栏杆下,PRO-FEED推料机器人[6]是螺旋式结构,通过滚动的螺旋式叶片将饲料推回到栏杆下。这两种机器人在推进过程中能对饲料进行一定的搅拌,推料效果较好,但结构复杂、加工难度大。现如今国内牛场养殖的推料方式有三种,一是人工扫料,二是人工驾驶的刮板式推料车,三是自走式推料机器人[7]。3种推料工作中,传统的人工扫料方式劳动强度大,需要投入大量的人力[8]。张勤等[9]研发的基于信息融合的智能推料机器人是采用刮板的推料方式,虽然刮板式推料车刮板小、结构简单、便于操作,但推料效果一般,且在纵向方向上有推料现象,影响奶牛采食。现有的自旋式推料机器人[5]推料效果较好,没有漏料情况,但推料效率较低;螺旋式推料机器人推料效率较高,但推料效果不好,有漏料现象。
对于皮带式推料机,具有代表性的是德国RMH-futterschieber皮带式推料机,针对含水率高、撒料量和撒料面积大的青饲料的推料效果较好。因此,本文对皮带式推料机结构进行设计,并对其推料过程进行仿真试验,为自动推料机实际推料作业参数提供参考。该研究利用离散元软件EDEM创建颗粒实体的参数化模型,此外,将材料力学特性和其他物理特性添加到EDEM中,形成颗粒模型和力学分析过程;基于Design-Expert软件进行正交试验设计,运用EDEM在不同试验条件下对皮带式推料机进行虚拟试验仿真和分析,探究推料机推料过程中物料颗粒群的运动规律,分析推料机不同推料角度、皮带速度、前进速度3个试验因素对推送率和推送效率的影响,以期为寻求推料机推料最优参数组合提供一定的指导。
1. 推料机器人结构及工作原理
1.1 整机结构
可变角度皮带式推料机器人主要由大容量锂电池、机器人主体部分、控制系统、精料抛撒装置、TMR搅拌撒料装置、激光雷达、RGB相机和IMU以及皮带式推料机组成,整机结构如图1所示。
工作时,首先,推料机器人融合RGB和雷达信息智能识别牛舍饲料带,控制机器人沿着饲料带自主行走;其次,根据饲料带是否存在饲料,机器人控制推料电机带动推料皮带转动,皮带上的推板将草料推回饲料带,从而完成推料作业。
1.2 皮带式推料机结构
皮带式推料机采用的是立式结构,外形尺寸长×宽×高为1 000 mm × 460 mm × 550 mm。如图2所示,皮带式推料机主要由1个伺服电机、2个滚筒、软质PVC带、推料机支撑架和可变角度连接架组成。
其中,滚筒的尺寸直接影响其与皮带的接触面积与摩擦力,这将影响皮带推料效率。滚筒的直径越大,皮带与滚筒的接触面积越大,两者之间的摩擦力越大,皮带运动越稳定。然而,滚筒直径过大会导致设备整机尺寸增大,增大能量消耗。因此,本设计选用的滚筒直径为155 mm、高度为450 mm、材质为碳钢、壁厚为2.5 mm,滚筒表面采用车床粗加工,以增加表面的摩擦力,满足推料作业的实际需求,三维模型如图3所示。
2. TMR饲料特性参数测量与接触参数仿真标定
2.1 试验材料
TMR饲料于2024年4月取自山东省泰安市岱岳区满庄镇泥沟村的金兰奶牛养殖牧场,分别在撒料1、2、3 h后进行取料,含水率(w)为55%~70%。
2.2 饲料特性参数测量
2.2.1 TMR饲料休止角测量
利用TMR饲料休止角对饲料间的恢复系数进行仿真标定试验,间接得出饲料间的恢复系数。采用排出法对TMR饲料的休止角进行测定,如图4所示。将一定量的饲料装入无底圆筒中,向上提升圆筒使饲料缓慢排出,待料堆稳定后,测量料堆竖直高度(h)与底面直径(d)的尺寸大小,通过公式(1)计算其休止角[10],试验重复3次取平均值,测得休止角为45°~47°,平均46.75°。为降低摩擦因数对测量结果的影响,圆筒材质选用钢制。
休止角计算公式:
$$ \varphi = {\tan ^{ - 1}}\dfrac{{2h}}{d} 。 $$ (1) 2.2.2 滑动摩擦角测量
通过饲料与皮带、饲料与地面间的滑动摩擦角,可以仿真标定饲料与皮带、饲料与瓷砖地面间的恢复系数。饲料滑动摩擦角测量所用仪器为斜面仪,摩擦面材料为PVC皮带和瓷砖。将所取饲料样本放置在水平摩擦面上,缓慢匀速转动手柄,使摩擦面一端缓慢上升,避免振动。如图5所示,当饲料试样开始向下滑动时,记录此时的摩擦面倾角,即为饲料滑动摩擦角(θ)。测得饲料与皮带间的滑动摩擦角平均值为37°,饲料与瓷砖间的滑动摩擦角平均值为42°。
2.2.3 摩擦系数测定
使用MXD-2型摩擦因数试验仪,测定饲料之间、饲料与皮带之间以及饲料与瓷砖地面之间的动、静摩擦系数,如图6所示。测定饲料之间的动、静摩擦系数时,将饲料用胶水平整均匀地固定在水平试验台上,并在试验仪滑块底面也均匀粘固一层饲料,使2个面上的饲料平整接触,启动试验仪后2个接触面上的饲料产生相对移动,滑块产生一定距离的相对移动后,仪器根据摩擦力的大小自动计算摩擦系数。试验重复5次取平均值,结果如表1所示。
表 1 试验测定摩擦系数Table 1. Determination of friction coefficient by tests参数
Parameter饲料与饲料
Feed and
feed饲料与皮带
Feed and
belt饲料与地面
Feed and
ground静摩擦系数
Static friction
coefficient0.54 0.75 0.80 滚动摩擦系数
Rolling friction
coefficient0.85 0.40 0.48 2.3 TMR饲料接触参数仿真标定
采用试验测试与离散元仿真相结合的方法对饲料进行仿真参数标定及优化。试验时,以实测的休止角、滑动摩擦角为响应值设计中心组合试验方案,利用Design-Expert软件分析各因素的编码值和数据,对各项进行方差分析和回归系数显著性检验,分析仿真参数对仿真结果的影响,确定饲料EDEM的最优参数。TMR饲料仿真离散元模型建立方法如下。
1)TMR饲料模型。由作物秸秆、球形米粒和青贮块组成奶牛饲料,并进行仿真建模。采用理想球形颗粒组合法对实际物料进行替代。对混合物料几何尺寸进行实测并取平均值[11],3种球形填充物料颗粒的直径分别设为12、10和8 mm。物料离散元模型如图7a~7c所示。
2)接触模型。利用EDEM软件对推料作业进行仿真。由于不考虑传热及磨损等问题,选用Hertz Mindlin(no slip)模型作为离散元仿真中饲料颗粒与皮带的接触模型[12]。
3)碰撞恢复系数仿真标定试验。利用EDEM离散元参数标定对饲料堆积过程进行仿真,如图8所示;对饲料滑动摩擦角测定过程进行仿真,如图9所示。通过优化碰撞恢复系数,使饲料仿真堆积过程的休止角与实际休止角一致,以及饲料仿真过程的滑动摩擦角与实际滑动摩擦角一致,从而预测碰撞恢复系数,为推料仿真分析提供基础数据[13]。
4)仿真参数。TMR饲料模型参数包括材料参数和接触参数。其中,材料参数包括TMR饲料、皮带、地面的密度、泊松比、剪切模量等[5, 10, 14-15],具体数值如表2所示。
表 2 物料特性参数Table 2. Property parameters of materials材料
Material密度/(kg·m−3)
Density泊松比
Poisson’s ratio剪切模量/Pa
Shear modulus饲料 Feed 700 0.30 2.30×107 皮带 Belt 1 380 0.45 2.40×108 地面 Ground 1 500 0.20 1.25×1010 通过以上测量试验、仿真测定及查阅相关文献,得到饲料与饲料之间、饲料与推料皮带装置之间、饲料与瓷砖地面之间的碰撞恢复系数均为0.30。
3. EDEM推料仿真试验
3.1 EDEM推料仿真模型及参数设置
为便于推料仿真的计算,本研究去除了与物料运动无接触关系的部件。推料机的皮带与饲料直接接触,其材质为软质PVC材料,将其导入EDEM中,如图10所示。
根据表1、2和标定的碰撞恢复系数设置仿真参数,通过动态生成的方式在颗粒工厂中生成物料颗粒,设定颗粒总质量为180 kg,作物秸秆、球形米粒、青贮块的质量比为35∶10∶55。
根据相关文献[14]可知,推送率随着饲料含水率的增加而增大。本研究推料机皮带速度、推料角度以及前进速度的定义图如图11所示。
在推料机构作用下,饲料颗粒间相互作用,饲料颗粒沿着皮带表面速度方向运动。如图12所示,当推料角度为0°时,饲料运动轨迹垂直运动方向,若运动速度增大会将未及时推送到饲喂区的饲料向斜前方推送,出现饲料分布不均匀现象;随着推送角度增大,饲料运动轨迹开始向斜后方运动,在一定前进速度下,饲料可以更好地被推到原位置;但当推料角度超过30°时,会出现将已推过去的饲料带到皮带后面的现象。
选取推送率(Y1)和推送效率(Y2)作为推料效果的评价指标,计算方式如公式(2)和(3)。设置图13中阴影区域的颗粒质量为150 kg,仿真完成后对未被推到撒料带的饲料进行统计。
$$ {Y}_{1}=\dfrac{m-{m}_{_{{0}}}}{m}\times 100{\text{%}} \text{,} $$ (2) $$ {Y}_{2}=\dfrac{m-{m}_{_{{0}}}}{{t}} \text{,} $$ (3) 式中,m:推送前阴影区域饲料的质量,kg;
$m_{_{{0}}} $ :推送后未推到撒料带饲料的质量,kg;t:推料时间,min。3.2 推料试验仿真分析
以推料机推料角度(x1)、皮带速度(x2)和前进速度(x3)为研究因素,设计三因素三水平试验表,如表3所示。
表 3 试验因素水平表1)Table 3. Table of test factor and level水平
Levelx1/(°) x2/(m·s−1) x3/(m·s−1) −1 0 1 0.5 0 15 2 1.0 1 30 3 1.5 1)x1:推料角度,x2:皮带速度,x3:前进速度
1) x1: Pushing angle, x2: Belt speed, x3: Forward speed以各因素编码值x1、x2、x3为自变量,Y1和Y2为目标值,试验设计与结果如表4所示。
表 4 推料仿真试验设计与结果1)Table 4. Design and results of pushing simulation experiment序号
Serial numberx1 x2 x3 Y1/% Y2/(kg·min−1) 1 0 1 1 92.6 833.4 2 1 1 0 96.5 579.0 3 −1 0 1 91.8 826.2 4 1 −1 0 93.3 559.8 5 1 0 1 92.0 828.0 6 −1 1 0 94.8 568.8 7 0 0 0 93.5 561.0 8 0 −1 −1 93.9 281.7 9 −1 −1 0 91.1 546.6 10 1 0 −1 95.8 287.4 11 0 0 0 94.0 564.0 12 −1 0 −1 95.1 285.3 13 0 −1 1 89.7 807.3 14 0 0 0 93.9 563.4 15 0 0 0 94.3 565.8 16 0 1 −1 98.1 294.3 17 0 0 0 95.0 570.0 1) x1:推料角度,x2:皮带速度,x3:前进速度,Y1:推送率,Y2:推送效率
1) x1: Pushing angle, x2: Belt speed, x3: Forward speed, Y1: Pushing rate, Y2: Pushing efficiency对各因素与推送率和推送效率的关系进行方差分析和回归系数显著性检验,结果如表5、6所示。依据表5,利用响应面法建立推送率与试验因素编码值的关系模型为
表 5 推料仿真试验推送率响应面方差分析Table 5. Variance analysis of response surface of pushing rate in material pushing simulation test来源
Source平方和
Square
sum自由度
Freedom
degree均方
Mean
squareF P1) 模型
Model64.08 9 7.12 15.44 0.000 8** x1 2.88 1 2.88 6.25 0.042 0* x2 24.50 1 24.50 53.15 0.000 2** x3 35.28 1 35.28 76.53 <0.000 1** x1x2 0.06 1 0.06 0.14 0.723 6 x1x3 0.06 1 0.06 0.14 0.723 6 x2x3 0.42 1 0.42 0.92 0.370 3 x12 0.01 1 0.01 0.03 0.867 0 x22 0.10 1 0.10 0.23 0.648 6 x32 0.70 1 0.70 1.52 0.257 9 残差
Residual error3.23 7 0.46 失拟项
Misfit term1.98 3 0.66 2.10 0.240 0 纯误差
Pure error1.30 4 0.31 总和
Sum67.30 16 1)“*”“**”分别表示在P<0.05和P<0.01水平影响显著(方差分析)
1) “*” and “**” indicate significant effects at P<0.05 and P<0.01 levels, respectively (Analysis of variance)Y1=94.140 0+0.600 0x1+1.750.0 x2−2.100 0x3−0.125 0x1x2−0.125 0x1x3+0.325 0x2x3−0.057 5x12−0.157 5x22−0.408 0x32。
由表5可知,推送率与试验因素编码值之间的关系是极显著的(P<0.01),失拟项影响不显著(P>0.05),表示模型合理。其中x1对推料率影响显著,x2和x3对推送率影响极显著,其余各项都影响不显著。从单因素分析来看,各因素对推送率的影响由大到小为x3>x2>x1。从各因素交互作用来看,交互作用项对推送率的影响由大到小为x2x3>x1x3>x1x2。
各因素的交互作用对推送率的响应面如图14。当推料角度在中间水平时,推送率随皮带速度增加而增大;当皮带速度在中间水平时,推送率随推料角度增加而增大。当推料角度在中间水平时,推送率随前进速度增加而明显降低;当前进速度在中间水平时,推送率随推送角度增加而增加。当前进速度在中间水平时,推送率随皮带速度增加而明显增高。
依据表6,利用响应面法建立推送效率与试验因素编码值之间的关系模型为
表 6 推料仿真试验推送效率响应面方差分析Table 6. Variance analysis of response surface of pushing efficiency in material pushing simulation test来源
Source平方和
Square
sum自由度
Freedom
degree均方
Mean
squareF P1) 模型
Model5.77×105 9 64 117 3 484 <0.000 1** x1 93.16 1 93.16 5.06 0.060 0 x2 802.00 1 802.00 43.60 0.000 3** x3 5.76×105 1 5.76×105 31 293 <0.000 1** x1x2 2.25 1 2.25 0.12 0.736 9 x1x3 0.02 1 0.02 0.00 0.973 1 x2x3 45.56 1 45.56 2.48 0.159 6 x12 1.67 1 1.67 0.09 0.771 9 x22 15.52 1 15.52 0.84 0.388 9 x32 322.00 1 322.00 17.50 0.004 1** 残差
Residual error128.79 7 18.40 失拟项
Misfit term83.72 3 27.91 2.48 0.200 8 纯误差
Pure error45.07 4 11.27 总和
Sum5.77×105 16 1)“**”表示在P<0.01水平影响显著(方差分析)
1) “**” indicates significant effect at P<0.01 level (Analysis of variance)Y2=564.840+3.410x1+10.010x2+268.280x3−0.750x1x2−0.075x1x3+3.380x2x3+0.630x12−1.920x22−8.740x32。
由表6可知,推送效率与试验因素编码值之间的关系是极显著的(P<0.01),失拟项影响不显著(P>0.05);这表明模型合理,可以用来预测推料机推送效率。其中,x2、x3和x32对推料机推送效率影响极显著,其余各项均不显著。从单因素分析来看,各因素对推送效率的影响由大到小为x3>x2>x1。从各因素交互作用来看,交互作用项对推送效率的影响由大到小为x2x3>x1x2>x1x3。
各因素的交互作用对推送效率的响应面如图15。推料角度和皮带速度对推料效率的影响不明显。当推料角度和皮带速度分别在中间水平时,推料效率都会随着前进速度增加而明显增高。
以推料机的推送率和推料效率最大为目标值,通过响应面法进行优化求解,得到推料机理论最优作业参数水平组合:推料角度30°、皮带速度2.99 m/s、前进速度0.83 m/s。在此作业参数下,推送率和推送效率分别为94.6%、724.5 kg/min。
4. 样机的推料试验
4.1 试验方案
如图16所示,在泰安市金兰奶牛场进行试验,选取推料机理论最优作业参数水平组合和仿真结果较好的2组试验参数进行试验。每次推料前对图13阴影区域TMR饲料的质量进行记录,推料作业完成后收集未推到撒料区的TMR饲料并称质量,推料过程中TMR饲料水分损失忽略不计,每组试验重复3次。选取推送率和推送效率作为推料效果的评价指标,将结果与EDEM仿真试验结果做对比,测试皮带式推料机器人在真实工作情况下的推料效果。
4.2 试验结果与分析
利用TMR饲料进行试验,推料机器人3次推料试验推送率为91%~96%,推送效率为720~820 kg/min。当推料前进速度为1.5 m/s时,机器人推料效率最高;但是当皮带速度低于2 m/s时,皮带无法及时完成推料作业,导致大量饲料堆积在皮带前方。当推料机器人推送到位的饲料较少,剩余饲料会导致饲料流反向运动,造成饲料分布不均匀。前进速度和皮带速度一定时,当推料角度为0°时,饲料运动轨迹是斜前方,当推送角度逐渐增大时,饲料运动轨迹逐渐向斜后方运动,但是推送角度过大会导致出现将已推过去的饲料带到皮带后面的现象,即漏料现象。当皮带速度为3 m/s时,无论推料机器人的前进速度是高速还是低速,在3个工作角度下的推料效果都是良好的;在皮带高速转动的情况下,皮带通过摩擦力和皮带表面凸起将饲料从一侧带动到另一侧,高速转动的皮带能快速地将饲料推送到指定位置,从而验证了本文的推料机推料效果可以满足牧场需求。实际试验结果与仿真结果基本一致,验证了推料机结构和作业参数的合理性。
5. 结论
针对目前国内采用螺旋式推料机器人对含水率高、撒料量多的TMR饲料推料效果不好等问题,研制了一种皮带式推料机,采用旋转的皮带将饲料推回到奶牛采食区域。皮带式推料机试验表明,推送效率达到牧场的要求,仿真模拟结果为皮带式推料机的动力学分析和参数优化提供了参考。
-
图 1 M2CNet网络总体组成
LCB:局部捕获块;LGCB:轻量级全局捕获块;H和W分别代表输入图片的高度和宽度;$ {C}_{i} $:指用于阶段i的通道数;$ {L}_{i} $:阶段i的局部捕获块和轻量级全局捕获块数量
Figure 1. Overall structure of the M2CNet network
LCB: Local capture block; LGCB: Lightweight global capture block; H and W represent the height and width of the input image, respectively; $ {C}_{i}: $ Number of channels used for stage i; $ {L}_{i} $ represents the number of local capture blocks and lightweight global capture blocks in stage i
图 3 标准多头注意力(a)与全局子采样注意力(b)的对比
Q、K、V分别表示查询、键和值,H、W分别表示输入图片的高度和宽度,s表示子窗口大小,C表示通道数
Figure 3. Comparison of standard multi-head attention and global subsampling attention
Q, K, V represent query, key and value respectively, H and W represent the height and width of the input picture respectively, s represents size of the subwindow, C represents number of channels
图 4 轻量级全局捕获块
a:条件位置编码;b:全局子采样注意力;c:轻量级前馈网络;di:通道维数;s:子窗口的大小;h:多头注意力头的数量;H和W分别代表输入特征的高度和宽度
Figure 4. Lightweight global capture block
a: Conditional position encoding; b: Global subsampling attention; c: Lightweight feedforward network; di: Channel dimension; s: Size of the sub window; h: Number of attention heads with multiple heads; H and W represent the height and width of the input features, respectively
图 6 病虫害数据集识别结果
柱状图的宽度与模型参数呈线性关系,参数量越大柱状图越宽;同一色系代表同一对照,同一色系中颜色最深的柱子对应M2CNet变体
Figure 6. Identification results of pest data sets
The width of the bar chart is linearly related to the model parameters, the larger the number of parameters, the wider the bar chart; The same color system represents the same control, and the darkest column in the same color system corresponds to the M2CNet variant
表 1 IP102 数据集害虫分级分类体系
Table 1 Taxonomy of the IP102 dataset on different class levels
作物
Crop害虫类别
Pest class训练集
Training set测试集
Test set水稻 Rice 14 6734 1683 玉米 Corn 13 11212 2803 小麦 Wheat 9 2734 684 甜菜 Sugarbeet 8 3536 884 苜蓿 Alfalfa 13 8312 2078 葡萄 Grape 16 14041 3510 柑橘 Orange 19 5818 1455 芒果 Mango 10 7790 1948 总计 Total 102 60177 15045 表 2 M2CNet-S/B/L的网络架构 1)
Table 2 M2CNet-S/B/L network architecture
阶段
Stage输出尺寸
Output size层名称
Name of layerM2CNet-S M2CNet-B M2CNet-L 1 $ 56\times 56 $ Conv.下采样 $ 4\times \mathrm{4,36},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\;4 $ $ 4\times \mathrm{4,48},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\;4 $ $ 56\times 56 $ 深度可分离卷积 $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,36}\\ 3\times \mathrm{1,1}\times \mathrm{3,36}\\ \begin{array}{c}{H}_{1}=1,{s}_{1}=4\\ {R}_{1}=4\end{array}\end{array} \right]\times 1 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,48}\\ 3\times \mathrm{1,1}\times \mathrm{3,48}\\ \begin{array}{c}{H}_{1}=1,{s}_{1}=4\\ {R}_{1}=4\end{array}\end{array} \right]\times 1 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,48}\\ 3\times \mathrm{1,1}\times \mathrm{3,48}\\ \begin{array}{c}{H}_{1}=1,{s}_{1}=4\\ {R}_{1}=4\end{array}\end{array} \right]\times 1 $ 多层循环全连接 全局子采样注意力 轻量级前馈网络 2 $ 28\times 28 $ Conv.下采样 $ 2\times \mathrm{2,72},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\; 2 $ $ 2\times \mathrm{2,96},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\; 2 $ $ 28\times 28 $ 深度可分离卷积 $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,72}\\ 3\times \mathrm{1,1}\times \mathrm{3,72}\\ \begin{array}{c}{H}_{1}=2,{s}_{1}=2\\ {R}_{1}=4\end{array}\end{array} \right]\times 2 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,96}\\ 3\times \mathrm{1,1}\times \mathrm{3,96}\\ \begin{array}{c}{H}_{1}=2,{s}_{1}=2\\ {R}_{1}=4\end{array}\end{array} \right]\times 1 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,96}\\ 3\times \mathrm{1,1}\times \mathrm{3,96}\\ \begin{array}{c}{H}_{1}=2,{s}_{1}=2\\ {R}_{1}=4\end{array}\end{array} \right]\times 2 $ 多层循环全连接 全局子采样注意力 轻量级前馈网络 3 $ 14\times 14 $ Conv.下采样 $ 2\times \mathrm{2,144},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\; 2 $ $ 2\times \mathrm{2,192},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\; 2 $ $ 14\times 14 $ 深度可分离卷积 $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,144}\\ 3\times \mathrm{1,1}\times \mathrm{3,144}\\ \begin{array}{c}{H}_{1}=4,{s}_{1}=2\\ {R}_{1}=4\end{array}\end{array} \right]\times 3 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,192}\\ 3\times \mathrm{1,1}\times \mathrm{3,192}\\ \begin{array}{c}{H}_{1}=4,{s}_{1}=2\\ {R}_{1}=4\end{array}\end{array} \right]\times 4 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,192}\\ 3\times \mathrm{1,1}\times \mathrm{3,192}\\ \begin{array}{c}{H}_{1}=4,{s}_{1}=2\\ {R}_{1}=4\end{array}\end{array} \right]\times 6 $ 多层循环全连接 全局子采样注意力 轻量级前馈网络 4 $ 7\times 7 $ Conv.下采样 $ 2\times \mathrm{2,288},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e}\; 2 $ $ 2\times \mathrm{2,384},\mathrm{s}\mathrm{t}\mathrm{r}\mathrm{i}\mathrm{d}\mathrm{e} \;2 $ $ 7\times 7 $ 深度可分离卷积 $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,288}\\ 3\times \mathrm{1,1}\times \mathrm{3,288}\\ \begin{array}{c}{H}_{1}=8,{s}_{1}=1\\ {R}_{1}=4\end{array}\end{array} \right]\times 2 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,384}\\ 3\times \mathrm{1,1}\times \mathrm{3,384}\\ \begin{array}{c}{H}_{1}=8,{s}_{1}=1\\ {R}_{1}=4\end{array}\end{array} \right]\times 2 $ $ \left[ \begin{array}{c}3\times \mathrm{3,1}\times \mathrm{1,384}\\ 3\times \mathrm{1,1}\times \mathrm{3,384}\\ \begin{array}{c}{H}_{1}=8,{s}_{1}=1\\ {R}_{1}=4\end{array}\end{array} \right]\times 4 $ 多层循环全连接 全局子采样注意力 轻量级前馈网络 输出 Output $ 1\times 1 $ 全连接 100 参数量(M) No. of parameters 1.83 3.52 5.76 计算量(G) Floating point operations 0.23 0.39 0.60 1)输入图像大小默认为224像素×224像素,Conv.代表卷积操作,stride表示卷积的步幅,Hi和Si是第i个全局子采样注意力的头数和次采样大小,Ri是第i个轻量级前馈网络的特征尺寸缩放比
1) The input image size is 224×224 by default, Conv. stands for convolution operation, stride stands for convolution step, Hi and Si are the number of heads and subsampling size of the ith global subsampling, and Ri is the scaling ratio of the feature size of the ith lightweight feedforward network表 3 CIFAR100数据集模型对比结果
Table 3 Comparison results of CIFAR100 dataset model
模型
Model参数量 (M)
No. of
parameters计算量 (G)
Floating
point
operations准确率/%
AccuracyTop5 Top1 ShuffleNet-V2 0.5 0.4 0.04 72.74 41.83 ShuffleNet-V2 1.0 1.4 0.15 86.21 59.65 ShuffleNet-V2 1.5 2.6 0.30 90.08 66.56 ShuffleNet-V2 2.0 5.6 0.56 93.06 72.79 SqueezeNet 1.0 0.8 0.75 78.48 49.68 SqueezeNet 1.1 0.8 0.30 78.12 50.14 MobileNet-V3-Small 1.6 0.06 87.90 61.74 MobileNet-V2 2.4 0.31 91.69 69.16 MobileNet-V3-Large 4.3 0.23 93.57 73.27 MnasNet 0.5 1.1 0.11 88.13 62.60 MnasNet 0.75 2.0 0.22 91.44 69.20 MnasNet 1.0 3.2 0.32 92.81 72.70 MnasNet 1.3 5.1 0.54 94.41 76.64 EfficientNet B0 4.1 0.40 94.63 76.00 EfficientNet B1 6.6 0.60 94.95 77.96 ResNet 18 11.2 1.80 94.66 76.85 VGG 11 129.2 7.60 94.25 75.82 VGG 13 129.4 11.30 94.38 76.46 VGG 16 134.7 15.50 94.63 78.19 VGG 19 140.0 19.60 95.25 78.19 MobileViT-XXS 1.0 0.33 84.98 55.96 MobileViT-XS 2.0 0.90 89.55 64.34 MobileViT-S 5.1 1.75 93.64 72.93 M2CNet-S 1.8 0.23 92.46 71.09 M2CNet-B 3.5 0.39 94.16 75.32 M2CNet-L 5.8 0.60 95.31 78.39 -
[1] SIMONYAN K, ZISSERMAN A. Very deep convolutional networks for large-scale image recognition[EB/OL]. arXiv: 1409.1556. https://arxiv.org/abs/1409.1556.
[2] HE K, ZHANG X, REN S, et al. Deep residual learning for image recognition[C]//2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE, 2016: 770-778.
[3] 李静, 陈桂芬, 安宇. 基于优化卷积神经网络的玉米螟虫害图像识别[J]. 华南农业大学学报, 2020, 41(3): 110-116. doi: 10.7671/j.issn.1001-411X.201907017 [4] 刘洋, 冯全, 王书志. 基于轻量级CNN的植物病害识别方法及移动端应用[J]. 农业工程学报, 2019, 35(17): 194-204. doi: 10.11975/j.issn.1002-6819.2019.17.024 [5] 陆健强, 林佳翰, 黄仲强, 等. 基于Mixup算法和卷积神经网络的柑橘黄龙病果实识别研究[J]. 华南农业大学学报, 2021, 42(3): 94-101. doi: 10.7671/j.issn.1001-411X.202008041 [6] 邱文杰, 叶进, 胡亮青, 等. 面向植物病害识别的卷积神经网络精简结构Distilled-MobileNet模型[J]. 智慧农业(中英文), 2021(1): 109-117. [7] DOSOVITSKIY A, BEYER L, KOLESNIKOV A, et al. An image is worth 16×16 words: Transformers for image recognition at scale[EB/OL]. arXiv: 2010.11929. https://arxiv.org/abs/2010.11929.
[8] KRIZHEVSKY A, HINTON G. Learning multiple layers of features from tiny images[R/OL]. Technical report: University of Toronto, https://www.cs.toronto.edu~kriz/learning-features-2009-TR.pdf.
[9] HUGHES D P, SALATHE M. An open access repository of images on plant health to enable the development of mobile disease diagnostics[EB/OL]. arXiv: 1511.08060. https://arxiv. org/abs/1511.08060.
[10] WU X P, ZHAN C, LAI Y K, et al. IP102: A large-scale benchmark dataset for insect pest recognition[C]//2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Long Beach, USA: IEEE, 2020: 8779-8788.
[11] HE K M, ZHANG X Y, REN S Q, et al. Deep residual learning for image recognition[C]//2016 Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE, 2016: 770-778.
[12] HOWARD A G, ZHU M L, CHEN B, et al. MobileNets: Efficient convolutional neural networks for mobile vision applications[EB/OL]. arXiv: 1704.04861. https://arxiv.org/abs/1704.0486.
[13] CHEN S, XIE E, GE C, et al. CycleMLP: A MLP-like architecture for dense prediction[C]//International Conference on Learning Representations. OpenRe view. net, 2022: 1-21.
[14] IOFFE S, SZEGEDY C. Batch normalization: Accelerating deep network training by reducing internal covariate shift[C]// Proceedings of the 32nd International Conference on Machine Learning. New York: ACM, 2015: 448-456.
[15] LIU Z, MAO H, WU C Y, et al. A convnet for the 2020s[C]//2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, USA: IEEE, 2022: 11966-11976.
[16] CHU X, TIAN Z, WANG Y, et al. Twins: Revisiting the design of spatial attention in vision transformers[C]//Advances in Neural Information Processing Systems(NIPS). 2021, 34: 9355-9366.
[17] CHU X X, TIAN Z, ZHANG B, et al. Conditional positional encodings for vision transformers[EB/OL]. arXiv: 2102.10882. https://arxiv.org/abs/2102.10882.
[18] VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need[C]//Proceedings of the 31st International Conference on Neural Information Processing Systems. Long Beach, USA: ACM, 2017: 6000-6010.
[19] LOSHCHILOV I, HUTTER F. SGDR: Stochastic gradient descent with restarts[C]//International Conference on Learning Representations. Toulon: OpenReview. net, 2017: 1-16.
[20] LOSHCHILOY I, HUTTER F. Decoupled weight decay regularization[C]//International Conference on Learning Representations. New Orleans: OpenReview. net, 2019: 1-19.
[21] MULLER R, KORNBLITH S, HINTON G E. When does label smoothing help? [EB/OL]. arXiv: 1906.02629. https://arxiv.org/abs/1906.02629.
[22] ZHANG H Y, CISSE M, DAUPHIN Y N, et al. Mixup: Beyond empirical risk minimization[EB/OL]. arXiv: 1710.09412. https://arxiv.org/abs/1710.09412.
[23] ZHANG X Y, ZHOU X Y, LIN M X, et al. ShuffleNet: An extremely efficient convolutional neural network for mobile devices[C]//2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City, UT, USA: IEEE, 2018: 6848-6856.
[24] MA N N, ZHANG X Y, ZHENG H T, et al. ShuffleNet V2: Practical guidelines for efficient cnn architecture design[C]//Proceedings of the European Conference on Computer Vision (ECCV). New York: ACM, 2018: 122-138.
[25] IANDOLA F N, HAN S, MOSKEWICZ M W, et al. SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5 MB model size[EB/OL]//arXiv: 1602.07360. https://arxiv.org/abs/1602.07360.
[26] SANDLER M, HOWARD A, ZHU M, et al. MobileNetV2: Inverted residuals and linear bottlenecks [C]//2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City, USA: IEEE, 2018: 4510-4520.
[27] HOWARD A, SANDLER M, CHEN B, et al. Searching for MobileNetV3[C]//2019 IEEE/CVF International Conference on Computer Vision. Seoul, Korea: IEEE, 2020: 1314-1324.
[28] TAN M X, CHEN B, PANG R M, et al. Mnasnet: Platform-aware neural architecture search for mobile[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach, USA: IEEE, 2020: 2815-2823.
[29] TAN M, LE Q. Efficientnet: Rethinking model scaling for convolutional neural networks[C]//International Conference on Machine Learning. Long Beach, CA, USA: LR, 2019: 6105-6114.
[30] MEHTA S, RASTEGARI M. MobileViT: Light-weight, general-purpose, and mobile-friendly vision transformer[EB/OL]. arXiv: 2110.02178. https://arxiv.org/abs/2110.02178.
[31] SELVARAJU R, COGSWELL M, DAS A, et al. Grad-CAM: Visual explanations from deep networks via gradient-based localization[J]. International Journal of Computer Vision, 2020, 128(2): 336-359. doi: 10.1007/s11263-019-01228-7