Professional Documents
Culture Documents
赵立新 et al - 2020 - 基于迁移学习的棉花叶部病虫害图像识别
赵立新 et al - 2020 - 基于迁移学习的棉花叶部病虫害图像识别
赵立新 et al - 2020 - 基于迁移学习的棉花叶部病虫害图像识别
7
184 2020 年 4月 Transactions of the Chinese Society of Agricultural Engineering Apr. 2020
·农业信息与电气技术·
基于迁移学习的棉花叶部病虫害图像识别
※
赵立新,侯发东,吕正超,朱慧超,丁筱玲
(1. 山东农业大学机械与电子工程学院,泰安 271018;2. 山东省园艺机械与装备重点实验室,泰安 271018)
摘 要:针对传统图像识别方法准确率低、手工提取特征等问题,该研究以棉花叶部病虫害图像为研究对象,利用迁移
学习算法并辅以数据增强技术,实现棉花叶部病虫害图像准确分类。首先改进 AlexNet 模型,利用 PlantVillage 大数据集
训练取得预训练模型,在预训练模型上使用棉花病虫害数据微调参数,得到平均测试准确率为 93.50%;然后使用数据增强
技术扩充原始数据集,在预训练模型上再训练,得到最终平均测试准确率为 97.16%。相同试验条件下,该研究方法较支持
向量机(Support Vector Machine,SVM)和 BP(Back Propagation,BP)神经网络以及深度卷积模型(VGG-19 和 GoogLeNet
Inception v2)分类效果更好。试验结果表明,通过迁移学习能把从源领域(PlantVillage 数据集)学习到的知识迁移到目标
领域(棉花病虫害数据集),数据增强技术能有效缓解过拟合。该研究为农作物病虫害识别技术的发展提供了参考。
关键词:卷积神经网络;图像识别;病害;图像增强;迁移学习;棉花
doi:10.11975/j.issn.1002-6819.2020.07.021
中图分类号:S24;TP2 文献标志码:A 文章编号:1002-6819(2020)-07-0184-08
本研究采用的研究方法即为卷积神经网络。
0 引 言
近年来,智能识别技术逐渐开始用于农业领域。
棉花是世界上最主要的农作物之一,与民生息息相 Barbedo[3] 提 出 一 种 算 法 结 合 HSV 颜 色 空 间 ( Hue
关。棉花的整个生长周期受到 40 多种病虫害的侵袭,严 Saturation Value,HSV)的 H 通道和 Lab 颜色空间(Lab
重影响其产量[1]。因此能快速准确的识别出棉花病害的种 Color Space,Lab)的 a 通道以区分植物叶片无症状组织
类并给予及时准确防治对于避免病害进一步扩散进而提 和病害体征。王春雷等[4]提出一种基于遗传算法和阈值滤
高棉花产量至关重要。 噪的玉米根茬行图像分割方法,准确分割出玉米根茬行。
随着计算机视觉以及人工智能的发展,特别是海量 吴露露等[5]利用传统图像处理方法,对水稻图像进行阈值
数据、计算机运算能力和算法等加速了深度学习技术的 分割等步骤,对叶片特征进行提取。李文勇等[6]提出一种
发展,深度学习技术在图像识别领域开始占据越来越重 基于颜色、纹理与形态无关特征结合并利用多类支持向
要 的 地 位 。 而 卷 积 神 经 网 络 ( Convolutional Neural 量机分类器的多姿态害虫分类方法。张善文和张传雷[7]
Network,CNN)作为深度学习技术的一种具有很强的自 采用区域增长分割算法分割病害叶片病斑图像,然后把
学习能力,通过对数据的抽象分析学到大量知识,从而 病斑图像重组为一维向量,利用局部判别映射算法对玉
快速准确实现分类,CNN 具有很强的适应能力和泛化能 米病害进行识别。毛罕平等[8]提出基于模糊 C 均值聚类的
力,相比较全连接的传统神经网络,卷积神经网络采用权 作物病害叶片图像分割方法,能较好将病斑部分和正常
值共享的方式减少了参数量,从而极大降低了计算量[2]。 部分分开,平均误差小于 5%。Li 等[9]利用半监督学习算
传统图像识别方法依赖先验知识,需要对特征手工提取, 法对蔬菜病害进行预测,取得了支持向量机方法更好的
然后进行分类,而卷积神经网络只需要把图片数据输入 效果。田有文等[10]利用计算机图像处理技术和支持向量
到网络,网络通过对卷积核的自学习就能达到分类效果。 机识别方法研究了葡萄叶部病害的识别,试验结果表明
支持向量机识别方法比神经网络方法获得了更好的识别
收稿日期:2020-01-01 修订日期:2020-03-10 效果。张建华等[11]提出一种基于粗糙集和 BP 神经网络的
基金项目:山东省农机装备研发创新计划项目(2015YZ103);山东省农业 棉花病害识别方法,粗糙集减少特征维数,使 BP 神经网
重大应用技术创新项目(SNZY31955);山东农业大学现代农业智能化装备 络训练时间缩短,达到 92.72%的平均识别正确率。早期
研发项目(SDAU24131)
的识别分类方法识别率很低,需要对农作物病害图像进
作者简介:赵立新,教授,主要从事传感器技术、机电装备智能化设计、机
电一体化技术等教学研究工作。Email:xlding103@163.com
行分割、边缘检测等预处理,然后手工特征提取,最后
※通信作者:丁筱玲,博士,教授,主要从事智能识别与导航、特种机器人、 分类,费时费力,得到的分类准确率却不高。
物联网大数据与深度学习、图像信息与传感技术、农业电气化与自动化等领 随着人工智能时代的到来,深度学习技术的发展,
域科研工作。Email:xiaoling@sdau.edu.cn
第7期 赵立新等:基于迁移学习的棉花叶部病虫害图像识别 185
1 材料与方法
d. 草莓蕉叶病 e. 马铃薯晚疫病 f. 苹果黑腐病
1.1 试验数据准备与数据集构建 d. Strawberry banana leaf e. Potato late blight f. Apple black rot
disease
本研究以棉花枯萎病、黄萎病、棉铃疫病、褐斑病、
图 2 公共数据集 PlantVillage 的样本图像
角斑病、棉叶螨这 6 种常见病虫害为研究对象。因农业 Fig. 2 Sample image of PlantVillage public dataset
领域数据图片较少不好获取,各种病害发病与生态、气
候和棉花品种等诸多因素有关[23],因此试验在山东农业 棉花病虫害数据集划分为训练数据集、验证集与测
大学试验棉田近年采集的基础上还通过网络渠道获取了 试数据集,比例为 6∶2∶2,而本研究从公共数据集
部分数据,图片类别由相关专家确认。本试验共采集原 PlantVillage 获得的图片采用 8∶2 的比例来分割训练数据
始图像 1 186 张,其中棉花枯萎病 210 张,黄萎病 190 张, 集和测试数据集。
棉铃疫病 183 张,褐斑病 196 张,角斑病 187 张,棉叶 1.2 模型结构设计
螨 220 张。这 6 类图片被放在 6 个不同的文件夹中,每 CNN 相比较全连接层(Fully-Connected Layer,F)的
个文件夹代表一个类别标签。标签 0 为枯萎病,标签 1 神经网络新出现了卷积层(Convolution Layer,C)、激励
为黄萎病,标签 2 为棉铃疫病,标签 3 为褐斑病,标签 4 层(Relu Layer,R)、池化层(Pooling Layer,P),CNN
为角斑病,标签 5 棉叶螨。本研究还从 PlantVillage 大数 的层一般连接顺序是“Convolution-Relu-Pooling”,池化
据集获取了一些图片,用于迁移学习获得预训练模型, 层有时会被省略,本试验采用最大池化。总体结构包括输
玉米灰斑病 1 642 张,葡萄叶枯病 1 722 张,南瓜白粉病 入层、卷积层、池化层、全连接层和输出层,其中除输出
1 736 张,草莓蕉叶病 1 774 张,马铃薯晚疫病 1 939 张, 层其他层的激活函数都是线性整流单元(Rectified Linear
苹果黑腐病 1 987 张,总共 6 类 10 800 张。采集的原始 Units,ReLU)即 relu 函数,输出 Softmax 层实现分类。
图像以及 PlantVillage 数据集图像的分辨率大小不等,而 图 3 为仿照 AlexNet 模型设计的 CNN 网络结构。由于经
本模型要求输入固定维度,图像的像素过多,包含过多 典的 AlexNet 模型用于识别 1 000 种分类,本试验是 6 分
的冗余信息,本试验将图片的的尺寸统一转换为 类问题,故采用 Softmax 分类层有 6 个神经元,卷积核是
224×224×3 像素,然后才能输入网络进行训练。图 1 为采 4 维的( n1 n2 n3 n4 /S ),其中 n1 n2 n3 表示卷积核尺
集的棉花病虫害图像集,图 2 是来自公共数据集 寸, n4 表示卷积核个数, S 为步长(Stride),全连接 n
186 农业工程学报(http://www.tcsae.org) 2020 年
= x (1)
1.4 基于迁移学习的试验方法 n i 1
i
xi
深度学习模型可以划分为训练和预测 2 个阶段,训 1 n 2
(2)
练分为 2 种策略,一种是在搭建的模型上从头开始训练, n i 1
据集来获得预训练模型,然后用棉花病虫害数据集基于
2
i
预训练模型进行迁移学习。
式中 xi 表示该样本第 i 个像素点归一化后的像素值; 为
1.4.1 数据预处理
一个大于 0 的微小值,以保证式分母大于 0。
对试验图片预处理包括对图片尺寸重定义、对样本
1.4.2 识别模型中的优化算法
每个批次(使用训练集中的一部分样本对模型权重进行
一次反向传播的参数更新,这部分样本称为一批次,即 1.2 节设计的网络结构包括 2 个全连接层,网络结构
的参数数量很大,相对比较小的数据集而言该网络结构
batch)进行归一化处理、图片去均值化等。本试验把图
较复杂容易出现过拟合问题,因此加入 L2 正则化和
片重定义为 224×224×3,减少了像素值,去除了大量冗余
Dropout 优化算法以避免过拟合。L2 正则化是由代价函
信息,从而减少计算量。
对图片进行去均值化是为了对图像进行标准化,可 数与正则化项相加来实现的。原始代价函数 J 0 由式(4)
以移除图像的平均亮度值,具体操作为:对于给定的进 表示
L y , y
行了尺寸重定义后的图像,每个样本的各像素值上减去 1 m
i i
J 0 w, b (4)
整个训练样本的像素值平均值。在很多情况下对图像的 m i 1
L y , y 2m W
1 m
i i l 2
型参数的方式,冻结该层即该层参数不参与训练,则分
J w, b (5)
m i 1 i 1 别冻结①卷积层 C1、C2、C3、C4、C5②卷积层 C1、C2、
k
C3、C4、C5 和全连接层 F6,③卷积层 C1、C2、C3、
w
2
2
W j
(6)
C4、C5 和全连接层 F6、F7。图 4 为迁移学习训练机制,
j 1
经元权值的平方。权值更新过程由式(7)所示
J
J 0
w (7)
w w m
由式(7)看出,只对权值 w 进行了衰减,没有偏置
b 进行衰减,因为参数 b 的数量相对于 w 而言太少了,对
整个网络的影响很小,一般不对 b 进行衰减。L2 正则化
降低了网络模型的复杂度,因此在一定程度上改善了模
型的过拟合问题。2012 年由 Ashiquzzaman 等 [27] 提出
Dropout 优化算法的基本原理,即在前向传播中随机失活
一些神经元,为每层设置一个概率数用以控制每层有多
少神经元应该被保留。如 0.6 意味着该层神经元有 60%被 图 4 迁移学习训练机制
保留,其余的 40%神经元失活不再发挥作用,概率为 1.0 Fig. 4 Transfer learning training mechanism
则全部保留。值得注意的是,在反向传播时必须失活和
1.5 基于数据增强的迁移学习试验方法
前向传播相同的神经元。
针对试验搜集的原始图片数据集小而仿照 AleNet 的网
根据上述说明试验在模型的全连接层 F6 和全连接层
络结构复杂容易产生过拟合问题,采用数据增强技术扩充
F7 后都加了 L2 正则化和 Dropout 优化算法以避免过拟
数据集,数据增强让有限的数据产生更多的数据,增加样
合,分类层则只使用 L2 正则化。
本的数量以及多样性,提升模型鲁棒性,随机改变样本可
1.4.3 超参数的设计
以降低对某些属性的依赖,从而提高模型的泛化能力[29-30]。
为了使网络训练更好,本试验的超参数根据参考文
数据增强分为 2 类:离线增强和在线增强。离线增
献和在本研究数据集上进行的一系列试验对超参数进行
强即直接对原始数据集进行处理,新数据数目会变成原
了统一化。一般来说按照首先对学习率,每个 batch 中训
始数据的 n 倍( n 为增强因子),此方法适用于数据集较
练样本的数量(batch size),然后是其他参数的调参顺
小的情况;在线增强即获 batch 数据之后,然后对这个
序进行调参。对于学习率采用指数标尺选取 0.001、0.01、
batch 的数据进行增强,如旋转、平移、翻折等变化,此
0.1 和 1 几组学习率做试验,最终学习率设置为 0.001 最
方法更适应于较大数据集,许多机器学习框架支持在线
为合适。学习率是一个很重要的超参数,它表示模型权
数据增强,并且可以使用 GPU 优化计算。
重更新的速度,学习率设置太大代价函数波动太大,训
本研究采用离线增强的方式(图 5),对图片执行色
练结果不精确,太小则网络收敛很慢,训练时间会很长。
彩调整、随机裁剪、旋转、加噪的操作,得到新的训练
每次试验运行 50 epochs,1 次 epochs 即一个完整的数据
集图片为原来训练集的 6 倍。然后把得到的新数据集按
集通过了神经网络一次且返回一次,在每个 epochs 中所
6∶2∶2 的比例划分为训练集、验证集和测试集。用新得
有训练集图片都被输入到网络一次,习惯上选择 batch
到的数据集代替 1.4 节的原始数据集重新按 1.4.1 节至
size 为 2 的次幂可以加快二进制的计算,试验选择 batch
1.4.3 节的试验步骤进行基于数据增强试验部分。
size 为 16、 32、
64、128 和 256 分别做了比较发现 batch size
太小收敛太慢,太大则也容易使其泛化能力变差,最终
batch size 设置为 128。模型训练中使用了 Adam 优化算法,
该算法应用在非凸优化问题中有计算高效、所需内存少、
适应于非稳态目标以及适合解决大规模数据和参数优化
问题等诸多优势,Adam 优化算法超参数采用框架默认参
图 5 数据增强操作
数[28]。经过交叉验证,隐含节点 Dropout 率等于 0.5,L2
Fig. 5 Data enhancement operations
正则化参数设置为 0.000 5 的时候效果最好。
1.4.4 迁移学习训练机制 1.5.1 基于数据增强的迁移学习训练机制
首先使用 PlantVillage 数据集加载进构建的网络中, 把通过数据增强的新数据集加载进网络,通过微调
来获得预训练模型并保存模型,然后把原始棉花病虫害 迁移学习的方式以适应我们的数据集,具体做法:在保
数据集加载进网络,微调以适应原始棉花病虫害数据集, 存模型的基础上,分别冻结①卷积层 C1、C2、C3、C4、
具体方法是:在保存的模型基础上,采用冻结预训练模 C5,②卷积层 C1、C2、C3、C4、C5 和全连接层 F6。
188 农业工程学报(http://www.tcsae.org) 2020 年
2 试验结果与分析 方式②的验证集准确率和测试集准确率都比在较小数据
集上进行迁移学习的准确率大幅提高,降低了可避免误
2.1 基于迁移学习的训练结果及分析
差,使得在验证集和测试集的准确率相比较只有迁移学
表 1 展示了迁移学习不同训练机制下,对于原始数
习的方式提高了 4%,有效缓解了过拟合。
据集进行训练,得到的训练集、验证集、测试集的准确率,
可以看出在 3 种不同的训练机制下所得到的验证准确率与 表 2 基于数据增强的迁移学习不同训练机制的结果
Table 2 Results of different training mechanisms based on
测试准确率相符,但是 3 种训练机制下,训练集准确率都
data-enhanced transfer learning
大于验证准确率,表明出现了过拟合,对于①②2 种情况 训练集准确率 验证集准确率 测试集准确率
冻结参数层
应着重解决过拟合问题;同时看到方式③情况下,在训 Frozen parameter layer
Training set Validation set Test set
accuracy/% accuracy/% Accuracy/%
练集、验证集、以及测试集下的错误率是 12.00%、13.35%
①卷积层 C1、C2、C3、C4、C5 100.00 97.85 97.16
和 14.62%。既存在欠拟合也存在过拟合,正常情况下, ②卷积层 C1、C2、C3、C4、C5
100.00 96.20 96.32
植物保护专家能达到 1%以内的识别错误率。对于训练集 和全连接层 F6
machine[J]. Transactions of the Chinese Society of Engineering (Transaction of the CSAE), 2019, 35(3):
Agricultural Engineering (Transaction of the CSAE), 2007, 164-173. (in Chinese with English abstract)
23(6): 175-180. (in Chinese with English abstract) [19] Oppenheim D, Shani G, Erlich O, et al. Using deep learning
[11] 张建华,祁力钧,冀荣华,等. 基于粗糙集和 BP 神经网络 for image-based potato tuber disease detection[J].
的棉花病害识别[J]. 农业工程学报,2012,28(7):161-167. Phytopathology, 2019, 109(6): 807-822.
Zhang Jianhua, Qi Lijun, Ji Ronghua, et al. Cotton diseases [20] 黄双萍,孙超,齐龙,等. 基于深度卷积神经网络的水稻
identification based on rough sets and BP neural network[J]. 穗瘟病检测方法[J]. 农业工程学报,2017,33(20):169-176.
Transactions of the Chinese Society of Agricultural Huang Shuangping, Sun Chao, Qi Long, et al. Rice panicle
Engineering (Transaction of the CSAE), 2012, 28(7): blast identification method based on deep convolution neural
161-167. (in Chinese with English abstract) network[J]. Transactions of the Chinese Society of
[12] Kunihiko Fukushima. A neural network model for selective Agricultural Engineering (Transaction of the CSAE), 2017,
attention in visual pattern recognition[J]. Biological 33(20): 169-176. (in Chinese with English abstract)
Cybernetics, 1986, 3(1): 5-16. [21] 傅隆生,冯亚利,Elkamil T,等. 基于卷积神经网络的田
[13] Simard P, Steinkraus D, Platt J C. Best practices for
间多簇猕猴桃图像识别方法[J]. 农业工程学报,2018,
convolutional neural networks applied to visual document
34(2):205-211.
analysis[C]//12th International Conference on Document
Analysis and Recognition. Edinburgh, UK. 2013: 958-962. Fu Longsheng, Feng Yali, Elkamil T, et al. Image recognition
[14] 张继威,牛少彰,曹志义,等. 基于深度学习和约束稀疏 method of multi-cluster kiwifruit in field based on
convolutional neural networks[J]. Transactions of the
表达的人脸识别算法[J]. 北京理工大学学报,2019,39(3):
Chinese Society of Agricultural Engineering (Transaction of
255-261.
the CSAE), 2018, 34(2): 205-211. (in Chinese with English
Zhang Jiwei, Niu Shaozhang, Cao Zhiyi, et al. Face
abstract)
recognition via deep learning and constraint sparse
representation[J]. Transactions of Beijing Institule of [22] 张建华,孔繁涛,吴建寨,等. 基于改进 VGG 卷积神经
Technology, 2019, 39(3): 255-261. (in Chinese with English 网络的棉花病害识别模型[J]. 中国农业大学学报,2018,
abstract) 23(11):161-171.
[15] 卢伟,胡海阳,王家鹏,等. 基于卷积神经网络面部图像 Zhang Jianhua, Kong Fantao, Wu Jianzhai, et al. Cotton
识别的拖拉机驾驶员疲劳检测[J]. 农业工程学报,2018, disease recognition model based on improved VGG
34(7):192-199. convolutional neural network[J]. Journal of China
Lu Wei, Hu Haiyang, Wang Jiapeng, et al. Tractor driver Agricultural University, 2018, 23(11): 167-177. (in Chinese
fatigue detection based on convolution neural network and with English abstract)
facial image recognition[J]. Transactions of the Chinese [23] 王献锋,张传雷,张善文,等. 基于自适应判别深度置信
Society of Agricultural Engineering (Transaction of the 网络的棉花病虫害预测[J]. 农业工程学报,2018,34(14):
CSAE), 2018, 34(7): 192-199. (in Chinese with English 157-164.
abstract) Wang Xianfeng, Zhang Chuanlei, Zhang Shanwen, et al.
[16] 甄斌,吴玺宏,刘志敏,等. 语音识别和说话人识别中各 Forecasting of cotton diseases and pests based on adaptive
倒谱分量的相对重要性[J]. 北京大学学报:自然科学版, discriminant deep belief network[J]. Transactions of the
2001,37(3):371-378. Chinese Society of Agricultural Engineering (Transaction of
Zhen Bin, Wu Xihong, Liu Zhimin, et al. On the importance the CSAE), 2018, 34(14): 157-164. (in Chinese with English
of components of the MFCC in speech and speaker abstract)
recognition[J]. Acta Scientiarum Naturalium Universitatis [24] 宋光慧. 基于迁移学习与深度卷积特征的图像标注方法研
Pekinensis, 2001, 37(3): 371-378. (in Chinese with English 究[D]. 杭州:浙江大学,2017.
abstract) Song Guanghui. Research on Image Labeling Method Based
[17] 岳颀,马彩文. 指数弹性动量卷积神经网络及其在行人 on Transfer learning and Deep Convolution Features[D].
检测中的应用[J]. 哈尔滨工业大学学报,2017,49(5): Hangzhou: Zhejiang University, 2017. (in Chinese with
159-164. English abstract)
Yue Qi, Ma Caiwen. A deep convolution neural network for [25] Wang Yufei, Cottrell G. Bikers are like tobacco shops,
object detection based[J]. Journal of Harbin Institute of formal dressers are like suits: Recognizing urban tribes with
Technology, 2017, 49(5): 159-164. (in Chinese with English caffe-eScholarship[C]// Applications of Computer Vision.
abstract) IEEE. 2015.
[18] 赵德安,吴任迪,刘晓洋,等. 基于 YOLO 深度卷积神经 [26] 孙俊,谭文军,毛罕平,等. 基于改进卷积神经网络的多
网络的复杂背景下机器人采摘苹果定位[J]. 农业工程学 种植物叶片病害识别[J]. 农业工程学报,2017,33(19):
报,2019,35(3):164-173. 209-215.
Zhao De’an, Wu Rendi, Liu Xiaoyang, et al. Apple Sun Jun, Tan Wenjun, Mao Hanping, et al. Recognition of
positioning based on YOLO deep convolutional neural multiple plant leaf diseases based on improved convolutional
network for picking robot in complex background[J]. neural network[J]. Transactions of the Chinese Society of
Transactions of the Chinese Society of Agricultural Agricultural Engineering (Transaction of the CSAE), 2017,
第7期 赵立新等:基于迁移学习的棉花叶部病虫害图像识别 191
33(19): 209-215. (in Chinese with English abstract) algorithm based on Dropout and ADAM optimizer[J].
[27] Ashiquzzaman A, Tushar A K, Dutta S, et al. An efficient Journal of Huazhong University of Science and Technology:
method for improving classification accuracy of handwritten Natural Science Edition, 2018, 46(7): 122-127. (in Chinese
Bangla compound characters using DCNN with dropout and with English abstract)
ELU[C]// 2017 Third International Conference on Research [29] Jia Shijie, Wang Ping, Jia Peiyi, et al. Research on data
in Computational Intelligence and Communication Networks augmentation for image classification based on convolution
(ICRCICN). IEEE, 2017. neural networks[C]// 2017 Chinese Automation Congress
[28] 杨观赐,杨静,李少波,等. 基于 Dropout 与 ADAM 优化 (CAC). IEEE, 2017.
器的改进 CNN 算法[J]. 华中科技大学学报:自然科学版, [30] Roth H R, Lee T Y, Shin H C, et al. Anatomy-specific
2018,46(7):122-127. classification of medical images using deep convolutional
Yang Guanci, Yang Jing, Li Shaobo, et al. Improved CNN nets[C]// IEEE ISBI. IEEE, 2015.
(1. Mechanical & Electronic Engineering College, Shandong Agricultural University, Taian 271018, China; 2. Shandong Provincial Key
Laboratory of Horticultural Machineries and Equipments, Taian 271018, China)
Abstract: The whole growth cycle of cotton is attacked by more 40 kinds of diseases and insect pests, which seriously affect
its yield. Therefore, it is very important to identify the types of cotton diseases quickly and accurately and to control them
timely and accurately to avoid the further spread of the disease and improve the yield of cotton. In view of the low accuracy of
traditional cotton pest identification and the need for manual image feature extraction, a convolution neural network method is
proposed to classify cotton leaf pests. Because it is difficult to obtain large data sets in the field of agriculture. Transfer
learning and data enhancement are used to deal with small data sets. The network structure of 5 convolution layers, 2 full
connection layers, and 1 Softmax classification layer were built based on the AlexNet model. The model was used to classify
six diseases and insect pests in cotton leaves. The experiment was divided into 2 parts. The first part used to a PlantVillage big
data set to learn the pre-training model on the build model as the feature extractor to save the model. Then, we used the transfer
learning method of model transfer and fine-tuning parameters to train our model on the original cotton pest data set. The
original cotton pest data set collected in the experiment was divided into training according to the proportion of 6:2:2 training
set, verification set, and test set. The average test accuracy was 93.50% through 3 transfer learning training mechanisms
(Freezing C1, C2, C3, C4, C5; freeze C1, C2, C3, C4, C5, and F6; freeze C1, C2, C3, C4, C5, and F6, F7). The second part
used data enhancement technology to expand the original cotton pest data set to get a new set and then repeated the first part of
the experiment with the new data set instead of the original data set. The cotton pest data was still divided in the proportion of
6:2:2, and then used two kinds of training mechanisms to transfer and learn (freeze C1, C2, C3, C4, C5; freeze C1, C2, C3, C4,
C5, and F6), and the final average test set accuracy was 97.16%. Under the same experimental conditions, the accuracy of this
model was much higher than that of traditional image classification methods, such as SVM and BP neural network. The
experimental results of the deep convolution model VGG-19 and the GoogLeNet Inception v2 model showed that the
improved model could converge faster and higher classification accuracy. The experimental results showed that the knowledge
learned from the big data set of PlantVillage could be transferred to the target area (cotton pests data set) through the transfer
learning, and the solution the problem of small data set could also make the model converge quickly. The method of data
enhancement method could effectively alleviate the overfitting problem. This study had a good recognition rate for the pests of
cotton leaves and provides a reference for the development of crop pest identification technology.
Keywords: convolutional neural network; image recognition; disease; image enhancement; transfer learning; cotton