劉 洋,馮 全,王書志
基于輕量級(jí)CNN的植物病害識(shí)別方法及移動(dòng)端應(yīng)用
劉 洋1,馮 全1※,王書志2
(1. 甘肅農(nóng)業(yè)大學(xué)機(jī)電工程學(xué)院,蘭州 730070;2. 西北民族大學(xué)電氣工程學(xué)院,蘭州 730030)
為了實(shí)現(xiàn)在手機(jī)端植物病害葉片檢測,對(duì)MobileNet和Inception V3 2種輕量級(jí)卷積神經(jīng)網(wǎng)絡(luò)進(jìn)行遷移學(xué)習(xí),得到2種作物病害分類模型,將2種分類模型分別移植到Android手機(jī)端,在識(shí)別精度、運(yùn)算速度和網(wǎng)絡(luò)尺寸之間進(jìn)行平衡,選擇最優(yōu)模型。試驗(yàn)表明,MobileNet和Inception V3在PlantVillage數(shù)據(jù)集(共38類26種病害)上平均識(shí)別率分別是95.02%和95.62%。在自建圖像集葡萄病害葉片的識(shí)別中MobileNet和Inception V3平均識(shí)別率分別是87.50%、88.06%,Inception V3的整體識(shí)別精度略高,但MobileNet在所有類別的識(shí)別上均衡性更好;在模型尺寸方面Inception V3的模型尺寸大小為87.5 MB,MobileNet的模型尺寸為17.1 MB,大約是后者5倍;2種模型移植到手機(jī)端時(shí),MobileNet和Inception V3的APP所占內(nèi)存分別是21.5 和125 MB;在手機(jī)端單張圖片的識(shí)別時(shí)間方面,Inception V3平均計(jì)算時(shí)間約是174 ms,MobileNet的平均計(jì)算時(shí)間約是134 ms,后者的平均計(jì)算時(shí)間比前者快40 ms;在手機(jī)端MobileNet相比于Inception V3占用內(nèi)存更小,運(yùn)算時(shí)間更快。說明MobileNet更適合在手機(jī)端進(jìn)行植物病害識(shí)別應(yīng)用。
植物;病害;圖像識(shí)別;MobileNet;Inception V3;Android
植物病害種類繁多,傳統(tǒng)的識(shí)別方式是專家依靠肉眼和經(jīng)驗(yàn)來判別這些病癥信息,速度慢、強(qiáng)度大、主觀性強(qiáng)[1-3]。為了解決這個(gè)問題,國內(nèi)外研究者采用圖像處理和機(jī)器視覺等技術(shù)對(duì)植物病害進(jìn)行識(shí)別研究,例如油茶[4]、棉花[5]、玉米[6]、黃瓜[7]等。目前大部分識(shí)別過程是在個(gè)人電腦(personal computer,PC)上完成的,對(duì)農(nóng)民來說,PC機(jī)在農(nóng)業(yè)現(xiàn)場使用非常不方便。目前智能手機(jī)已經(jīng)非常普遍,一些研究者開始嘗試采用手機(jī)進(jìn)行病害識(shí)別。如楊林楠等[8]提出了一種基于手機(jī)端的玉米病害檢測系統(tǒng),但該系統(tǒng)需要人工選擇植物莖、葉上的病害特征,并將這些病害特征上傳到服務(wù)器端的專家系統(tǒng)完成識(shí)別后,再將結(jié)果回傳至手機(jī)端。Prasad等[9]提出了一種基于Gabor小波變換與灰度共生矩陣相結(jié)合的移動(dòng)端葉片病害診斷系統(tǒng),該系統(tǒng)將現(xiàn)場拍攝的病害圖像上傳到服務(wù)器端,由服務(wù)器中分類器完成識(shí)別并將結(jié)果返回給手機(jī)。以上這些基于手機(jī)的病害識(shí)別APP的核心程序都運(yùn)行在服務(wù)器端,對(duì)網(wǎng)絡(luò)的依賴性較強(qiáng),手機(jī)只起到信息采集和顯示結(jié)果的作用,這種方式在很多情況下使用不方便。本文開發(fā)了一種操作方便、全自動(dòng)、完全運(yùn)行在手機(jī)端的病害識(shí)別APP,方便農(nóng)民在現(xiàn)場使用。
自2012年以來,研究者提出了多種性能優(yōu)秀的卷積神經(jīng)網(wǎng)絡(luò)(convolutional neural network,CNN),如AlexNet[10]、VGG[11]、GoogleNet[12]、ResNet[13]等,CNN在圖像分類、圖像分割、目標(biāo)檢測等方面全面超越傳統(tǒng)機(jī)器視覺的方法,在各種視覺任務(wù)中得到廣泛使用。CNN在農(nóng)業(yè)領(lǐng)域也得到了應(yīng)用[14-16],Lu等[17]提出了一種基于弱超視覺的小麥病害診斷系統(tǒng),對(duì)小麥的識(shí)別精度達(dá)到97.95%。張建華等[18]在原有VGG-16網(wǎng)絡(luò)模型基礎(chǔ)上通過優(yōu)化全連接層數(shù)提出了一種改進(jìn)VGG卷積神經(jīng)網(wǎng)絡(luò)的棉花病害識(shí)別模型,識(shí)別效果達(dá)到89.51%。鄭一力等[19]提出一種基于遷移學(xué)習(xí)的卷積神經(jīng)網(wǎng)絡(luò)植物葉片圖像識(shí)別方法,使用AlexNet和InceptionV3模型得到的識(shí)別準(zhǔn)確率分別達(dá)到95.31%、95.40%。Grinblat等[20]開發(fā)一種基于CNN的葉片葉脈模式識(shí)別方法,成功地識(shí)別了3種不同的豆科植物。
通常CNN的性能隨著網(wǎng)絡(luò)層數(shù)的加深會(huì)更加出色,如從16層VGG到GoogLeNet的22層,再到152層的ResNet,隨著網(wǎng)絡(luò)層數(shù)的增加,對(duì)設(shè)備的內(nèi)存需求和計(jì)算負(fù)擔(dān)也隨之增加。這些經(jīng)典CNN網(wǎng)絡(luò)由于參數(shù)太多,只能在PC上運(yùn)行,無法在移動(dòng)手機(jī)上直接使用。為了在手機(jī)端直接使用CNN實(shí)現(xiàn)作物病害識(shí)別,就必須解決數(shù)百層網(wǎng)絡(luò)中大量的權(quán)值參數(shù)存儲(chǔ)問題和網(wǎng)絡(luò)計(jì)算量大的問題。Google公司研發(fā)了2種輕量化卷積神經(jīng)網(wǎng)絡(luò),分別是MobileNet[21]和Inception V3[22]。在保證這些網(wǎng)絡(luò)高準(zhǔn)確性前提下,主要通過以下措施減小網(wǎng)絡(luò)的復(fù)雜度:減少鏈接或非全連接的層,減少通道數(shù)量、卷積核大小和磁盤使用量,剔除一些特征圖,修剪和離散化一些不重要的權(quán)重等。
本文為了研究手機(jī)端植物病害識(shí)別的方法,首先在PC端使用上述2種輕量化卷積網(wǎng)絡(luò)模型,采用遷移學(xué)習(xí)的方法,利用PlantVillage數(shù)據(jù)集和自建葡萄病害數(shù)據(jù)集分別對(duì)2種網(wǎng)絡(luò)進(jìn)行遷移訓(xùn)練;綜合比較2種網(wǎng)絡(luò)的病害識(shí)別精度、模型尺寸和運(yùn)算速度,選擇綜合性能更適合在手機(jī)端使用的網(wǎng)絡(luò),利用智能手機(jī)開發(fā)平臺(tái)Android Studio軟件對(duì)優(yōu)選模型做了移植,開發(fā)了相應(yīng)網(wǎng)絡(luò)的植物病害識(shí)別APP。
MobileNet v1是Google于2017年發(fā)布的網(wǎng)絡(luò)架構(gòu),旨在移動(dòng)設(shè)備和嵌入式端應(yīng)用。MobileNet v1也可以像其他流行模型(如VGG,ResNet)一樣用于分類、檢測、嵌入和分割等任務(wù)提取圖像卷積特征。
MobileNet的核心單元是深度可分離卷積(depth-wise separable convolution),深度可分離卷積是1種將標(biāo)準(zhǔn)卷積分解成2部分的操作:深度卷積(depth-wise convolution)和逐點(diǎn)卷積(point-wise convolution),如表1所示。傳統(tǒng)的標(biāo)準(zhǔn)卷積運(yùn)算在一步中就包含了濾波和合并計(jì)算,然后直接將輸入變成一個(gè)新的尺寸的輸出。而深度可分離卷積將其分成了2步,首先是深度卷積利用濾波器對(duì)輸入的每一個(gè)通道進(jìn)行卷積,然后采用逐點(diǎn)卷積是利用深度卷積計(jì)算出來的結(jié)果進(jìn)行了一個(gè)1×1的卷積核運(yùn)算,進(jìn)而得到輸出結(jié)果。這種運(yùn)算方式與傳統(tǒng)的標(biāo)準(zhǔn)卷積相比能夠有效地減少計(jì)算量以及模型參數(shù)量。
注:DF是輸入的長和寬;M是輸入的通道數(shù)和卷積核數(shù);輸出的尺寸長寬與輸入相同。1′1是卷積核大小,N是輸出的通道數(shù)。
深度可分離的卷積方式相比于傳統(tǒng)的卷積計(jì)算量為
如果采用3x3(D=3)卷積核的話,由于很大,MobileNet中深度可分離卷積(depth-wise separable convolution)的計(jì)算量大約只有標(biāo)準(zhǔn)卷積的1/9。
表1 MobilNet的網(wǎng)絡(luò)結(jié)構(gòu)
注:Conv表示標(biāo)準(zhǔn)卷積,Conv dw表示深度卷積,Avg Pool表示平均池化,F(xiàn)C表示全連接層。普通卷積層的尺寸如3′3′3′32,其中3′3表示卷積核的長和寬,3是輸入通道數(shù),32是輸出通道數(shù),其他普通卷積層尺寸表示與之一樣。深度卷積層的尺寸如3′3′32,其中3′3表示卷積核的長和寬,32是輸入通道數(shù),其他深度卷積層尺寸表示與之一樣。
Note: Conv, Conv dw, FC and Avg Pool denote standard convolution, deep convolution, full connection layer and average pooling, respectively. If the size of Conv is 3′3′3′32, its filter size is 3′3 and 3 is number of input channels and 32 is the number of output channels. If the size of Conv dw is 3′3′32, its filter size is 3′3 and 32 is the number of output channels.
Inception V3是2015年由Google公司提出的一種網(wǎng)絡(luò)結(jié)構(gòu),Inception V3整體上采用了Inception V2[23]的網(wǎng)絡(luò)結(jié)構(gòu),但是在優(yōu)化算法、正則化等方面做了改進(jìn),在優(yōu)化算法方面使用均方根算法(root mean square,RMS)替代隨機(jī)梯度下降算法(stochastic gradient descent,SGD),使用標(biāo)簽平滑正則化(label smoothing regularization,LSR)損失方法。Inception V3網(wǎng)絡(luò)主要有兩大方面的優(yōu)勢,一方面是將1個(gè)較大的2維卷積拆成2個(gè)較小的1維卷積,比如將7′7卷積拆成1′7卷積和7′1卷積,或?qū)?′3卷積拆成1′3卷積和3′1卷積,這不僅節(jié)約了網(wǎng)絡(luò)參數(shù)還增加了一層非線性擴(kuò)展模型的能力,可以處理更多、更豐富的空間特征,增加特征的多樣性。另一方面,Inception V3優(yōu)化了Inception module結(jié)構(gòu),分別包含有3種不同的結(jié)構(gòu)35′35、17′17、8′8,并且在Inception module中使用分支,這也極大地減少網(wǎng)絡(luò)參數(shù),Inception V3的網(wǎng)絡(luò)結(jié)構(gòu)如表 2所示。
該網(wǎng)絡(luò)大致分為3部分,首先是幾個(gè)3′3的卷積層和池化層組成,完成圖像特征的提取。接下來是3個(gè)連續(xù)的Inception模塊組,每個(gè)模塊組由多個(gè)Inception module組成,分別自動(dòng)學(xué)習(xí)濾波器的內(nèi)容。最后的部分是輔助Logits、全局平均池化、Softmax分類。首先輔助Logits,作為輔助分類的節(jié)點(diǎn),先得到特征張量,之后連接1個(gè)平均池化層,最后將輔助分類節(jié)點(diǎn)(logits)的輸出存儲(chǔ)到字典表中。對(duì)最后1個(gè)卷積層的輸出進(jìn)行1個(gè)8×8的全局平均池化,輸出張量變?yōu)? 048維,繼續(xù)連接1個(gè)Dropout層,隨著連接1個(gè)輸出通道數(shù)為1 000維的1×1卷積,最后通過Softmax分類層得到一個(gè){0,1}的分類結(jié)果。
表2 Inception V3網(wǎng)絡(luò)結(jié)構(gòu)
注:輸入的圖像尺寸為229′229像素;卷積層1~6的卷積核大小均為3′3,滑動(dòng)步長分別為2、1、1、1、2、1。池化層1~2的卷積核大小均為3′3,滑動(dòng)步長均為2。
Note: Image size of input layer is 229′229 pixels. For covn1, covn2, covn3, covn4, covn5, and covn6 layers, the filter size are 3′3, strides are 2, 1, 1, 1, 2 and 1, respectively. For pool1 and pool2 layers, kernel size are 3′3, strides are 2.
本文在PlantVillage和自建葡萄病害數(shù)據(jù)集上對(duì)MobileNet和Inception V3的識(shí)別效果進(jìn)行了測試,優(yōu)選出最佳的網(wǎng)絡(luò)模型以開發(fā)Android系統(tǒng)下的植物病害識(shí)別APP。
Android系統(tǒng)主要包括應(yīng)用程序?qū)?、?yīng)用框架層、系統(tǒng)運(yùn)行層和Linux內(nèi)核層等幾個(gè)部分。其中應(yīng)用程序?qū)拥牟捎肑AVA語言編寫,為用戶構(gòu)建應(yīng)用時(shí)提供API接口,開發(fā)者可以通過使用這些API構(gòu)建自己的應(yīng)用程序。系統(tǒng)運(yùn)行層是通過一些C/C++庫來為Android系統(tǒng)提供主要的特性支持。Android核心的系統(tǒng)服務(wù)依賴于Linux2.6內(nèi)核,Linux內(nèi)核也是作為硬件與軟件的抽象層,這一層為Android設(shè)備的各種硬件提供了底層驅(qū)動(dòng),如顯示驅(qū)動(dòng)、音頻驅(qū)動(dòng)、照相機(jī)驅(qū)動(dòng)、電源管理等[24-26]。
Android操作系統(tǒng)支持觸屏、視頻等功能,本文采用的深度學(xué)習(xí)框架Tensorflow亦為Google開發(fā),能與Android系統(tǒng)無縫結(jié)合,Android系統(tǒng)同時(shí)也支持圖像識(shí)別技術(shù),為本文APP開發(fā)提供方便。
本文的開發(fā)環(huán)境是在Linux操作系統(tǒng)下進(jìn)行,Android系統(tǒng)的開發(fā)環(huán)境主要包括JDK(Java development kit)、Android Studio軟件和Android SDK(Software development kit)3個(gè)部分,JDK是整個(gè)JAVA開發(fā)的核心,包含了JAVA的運(yùn)行環(huán)境(JVM+JAVA系統(tǒng)類庫)和JAVA工具;Android Studio是作為Android應(yīng)用程序開發(fā)IDE(integrated development environment);Android SDK是Google公司為開發(fā)者提供的免費(fèi)Android軟件開發(fā)工具包,該開發(fā)工具包包括開發(fā)代碼示例、接口文件(API)、開發(fā)文檔和開發(fā)工具4個(gè)部分[27-32]。
PlantVillage是一個(gè)植物病害圖像數(shù)據(jù)庫[33],該數(shù)據(jù)庫的圖像都是在實(shí)驗(yàn)室中拍攝,背景非常干凈。本文采用了PlantVillage所收集的54 306張植物病害葉片圖像,其中包含13種植物共26類病害葉片。表3給出了該數(shù)據(jù)集中38個(gè)類別的樣本圖像。根據(jù)MobileNet和Inception V3的輸入尺寸,分別將圖像大小尺寸調(diào)整到224×224像素和299×299像素進(jìn)行訓(xùn)練和測試。通過統(tǒng)計(jì)樣本總數(shù)以及類別樣本分布情況,隨機(jī)抽取數(shù)據(jù)集中的80%張圖片作為訓(xùn)練集,剩余的20%圖片作為測試集。對(duì)于原始訓(xùn)練集按C1~C38的編號(hào)將各種葉片歸類并制作成訓(xùn)練標(biāo)簽。
表3 PlantVillage數(shù)據(jù)庫圖像信息
本文采集了6種葡萄病害葉片作為自建圖像集,包括炭疽病、灰霉病、褐斑病、霜霉病、白粉病和黑痘病,共2 100張葡萄病害葉片;與PlantVillag數(shù)據(jù)集不同,該數(shù)據(jù)集中所有病害葉片圖像均為自然光照下拍攝。圖 2給出了自建圖像集中6種葡萄病害葉片的例子。訓(xùn)練方式同上訓(xùn)練集和測試集分別占總數(shù)據(jù)集的80%和20%。
圖2 自建葡萄病害集中6種葡萄病害樣本
遷移學(xué)習(xí)(transfer learning)[34-36]根據(jù)任務(wù)、領(lǐng)域、數(shù)據(jù)可用性,大致分為3大類:歸納遷移學(xué)習(xí)、無監(jiān)督遷移學(xué)習(xí)和直推式遷移學(xué)習(xí)。當(dāng)前幾乎所有的卷積神經(jīng)網(wǎng)絡(luò)都需要在大型圖像數(shù)據(jù)集上進(jìn)行充分訓(xùn)練,學(xué)習(xí)圖像分類識(shí)別所需的大量特征、權(quán)重等。本文利用MobileNet、Inception V3預(yù)訓(xùn)練模型在ImageNet數(shù)據(jù)集[37]上學(xué)到的大量知識(shí),然后在本文的數(shù)據(jù)庫上進(jìn)行遷移學(xué)習(xí),實(shí)現(xiàn)植物葉片病害的識(shí)別。常用的遷移方法有2種,一種是特征遷移,該方法移除最后幾層(一般是最后分類器),將特征向量送入向量機(jī)等分類器進(jìn)行分類訓(xùn)練,另一種是模型遷移,只需重新初始化網(wǎng)絡(luò)的少數(shù)幾層(如最后一層),其余層直接采用預(yù)訓(xùn)練網(wǎng)絡(luò)的權(quán)重參數(shù),再利用新的數(shù)據(jù)集對(duì)網(wǎng)絡(luò)參數(shù)進(jìn)行精調(diào)。本文采用模型遷移的方式,將MobileNet和Inception V3在ImageNet數(shù)據(jù)集上的訓(xùn)練模型,使用本文數(shù)據(jù)庫進(jìn)行2次訓(xùn)練,可節(jié)約大量時(shí)間并且有利于網(wǎng)絡(luò)快速收斂。
試驗(yàn)軟件環(huán)境為Ubuntu 16.04 LTS 64位系統(tǒng),采用Tensorflow深度學(xué)習(xí)開源框架,選用Python作為編程語言,硬件環(huán)境:計(jì)算機(jī)內(nèi)存64 GB,搭載Intel? Xeon(R)CPU E5-2683V3@ 2.00GHz x56處理器,GPU是英偉達(dá)TESLA K20。軟件環(huán)境:CUDA Toolkit 9.0,CUDNN V7.0;Python 2.7,Tensorflow-GPU 1.8.0。
將PlantVillage數(shù)據(jù)集和自建數(shù)據(jù)集按照4∶1的比例分成訓(xùn)練集和測試集。利用訓(xùn)練集對(duì)MobileNet和Inception V3網(wǎng)絡(luò)分別進(jìn)行遷移訓(xùn)練,獲得2種分類模型。訓(xùn)練中2種網(wǎng)絡(luò)參數(shù)均設(shè)置為:學(xué)習(xí)率為0.01,迭代次數(shù)為4 000,采用批量訓(xùn)練的方法將訓(xùn)練集與測試集分為多個(gè)批次,每個(gè)批次訓(xùn)練100張圖片,即train batch設(shè)置為100。
MobileNet和Inception V3網(wǎng)絡(luò)訓(xùn)練過程中的訓(xùn)練精確度(accuracy)和交叉熵(cross entropy)的曲線變化分別如圖3所示。從曲線可以看出MobileNet訓(xùn)練過程中,精度上升與交叉熵的下降較快,曲線波動(dòng)不大,迭代到2 000次左右曲線就趨于穩(wěn)定,而Inception V3精度的上升和交叉熵的下降相對(duì)較慢,達(dá)到穩(wěn)定所需時(shí)間較前者多,訓(xùn)練曲線的波動(dòng)也比前者大。
圖3 MobileNet 和Inception V3網(wǎng)絡(luò)訓(xùn)練過程的精確度和交叉熵
單個(gè)類別識(shí)別的準(zhǔn)確率(accuracy,Acc,%)計(jì)算如下
式中N是單個(gè)類別正確的預(yù)測數(shù);T表示單個(gè)類別樣本總數(shù)。
模型識(shí)別的平均準(zhǔn)確率(average accuracy,AA,%)計(jì)算如下
式中為樣本類別總數(shù),38。
2種網(wǎng)絡(luò)識(shí)別模型MobileNet和Inception V3檢測器和分類器對(duì)54 306張圖像(38個(gè)對(duì)象類別用C1~C38標(biāo)號(hào)表示)的數(shù)據(jù)集進(jìn)行預(yù)處理。采用遷移學(xué)習(xí)來調(diào)節(jié)訓(xùn)練參數(shù),訓(xùn)練完成后,分別得到訓(xùn)練模型。
4.4.1 PlantVillage數(shù)據(jù)集測試結(jié)果
利用MobileNet、Inception V3在ImageNet數(shù)據(jù)集上進(jìn)行了預(yù)訓(xùn)練,獲得了預(yù)訓(xùn)練模型,之后在PlantVillage數(shù)據(jù)集進(jìn)行遷移學(xué)習(xí),實(shí)現(xiàn)植物葉片病害的識(shí)別,試驗(yàn)結(jié)果如表4所示。從表4可以分別計(jì)算出MobileNet和Inception V3網(wǎng)絡(luò)在PlantVillage數(shù)據(jù)集下預(yù)測的平均準(zhǔn)確率(AA)為95.02%、95.62%,2種網(wǎng)絡(luò)都具有很高的病害識(shí)別率。
MobileNet對(duì)38個(gè)類別中的蘋果銹?。–3)、健康藍(lán)莓葉(C5)、辣椒細(xì)菌斑點(diǎn)?。–19)、健康覆盆子葉(C24)、南瓜白粉?。–26)和草莓葉焦?。–28)等6種類別病害的識(shí)別Acc是100%;而對(duì)玉米灰斑?。–8)、健康土豆葉(C22)、番茄早疫?。–30)、番茄晚疫病(C32)、番茄斑枯?。–34)和番茄輪斑?。–36)的識(shí)別Acc均低于90.00%,分別是83.5%、83.83%、70.00%、84.25%、83.9%和81.14%。Inception V3網(wǎng)絡(luò)對(duì)38個(gè)類中的蘋果銹?。–3)、無病藍(lán)莓葉(C5)、玉米銹病(C9)、健康玉米葉(C10)、健康葡萄葉(C14)、健康覆盆子葉(C24)和番茄花葉?。–37)等7種類型的識(shí)別Acc達(dá)到了100%;而對(duì)番茄早疫?。–30)和健康番茄葉(C31)的單個(gè)類別識(shí)別Acc在90%以下,分別是68.00%和89.31%。
表4 PlantVillage測試集分類結(jié)果
Mohanty等[38]在PC上使用AlexNet和GoogleNet 2種卷積網(wǎng)絡(luò)分別對(duì)PlantVillage數(shù)據(jù)集進(jìn)行病害識(shí)別,AA分別為99.27%、99.34%,而本文中MobileNet和 Inception V3平均準(zhǔn)確率僅下降4個(gè)百分點(diǎn)左右,說明與PC端的常規(guī)深度神經(jīng)網(wǎng)絡(luò)相比,手機(jī)端使用輕型網(wǎng)絡(luò)進(jìn)行病害識(shí)別時(shí)準(zhǔn)確率下降幅度很小。
4.4.2 2種網(wǎng)絡(luò)的誤識(shí)別分析
為了區(qū)分病害錯(cuò)誤分類的分布情況,對(duì)于識(shí)別Acc低于90.00%,即誤識(shí)別率高于10.00%的6種病害類型,圖4給出了它們被誤識(shí)別為其他病害種類的情況,圖中一個(gè)柱子總高度對(duì)應(yīng)一種病害葉片總的誤識(shí)別率,不同顏色矩形代表被誤分類為其他病害的概率,圖中僅對(duì)誤分類率高于2.00%的類型給出了獨(dú)立的矩形,低于2%的則合計(jì)在一起用矩形表示。
從圖4可以看出番茄病害是引起誤識(shí)別率高的主要的因素:1)番茄早疫病(C30)很容易被誤識(shí)別為番茄細(xì)菌性斑點(diǎn)?。–29)、番茄斑枯?。–34)、番茄晚疫病(C32)、番茄葉霉病(C33),這幾種病害分別占前者整體誤識(shí)別率的36.67%、18.33、15.00%、13.30%;2)番茄晚疫病(C32)容易被誤識(shí)別為番茄葉霉?。–33)和番茄早疫病(C30),后兩者分別占前者整體誤識(shí)別率的55.60%、24.20%;番茄斑枯病(C34)最容易被誤識(shí)別為番茄葉霉?。–33)和番茄細(xì)菌性斑點(diǎn)?。–29),后兩者分別占前者整體誤識(shí)別率的43.90%、29.80%;3)番茄輪斑?。–36)最容易被誤識(shí)別為番茄二斑葉螨病(C35)、番茄細(xì)菌性斑點(diǎn)?。–29)和番茄葉霉?。–33),后3種植物病害分別占前者整體誤識(shí)別率的43.00%、22.60%和18.50%。此外,玉米灰斑病(C8)很容易與玉米枯葉?。–11)混淆,后者占前者整體誤識(shí)別率的94.10%;健康土豆葉(C22)最容易被誤識(shí)別為健康黃豆葉(C25)和土豆晚疫?。–23)后兩者分別占前者整體誤識(shí)別率的61.80%、20.60%。
圖5給出了MobileNet中識(shí)別率最低的5種類型以及相應(yīng)最容易被誤判成的類型的比較圖像例子,圖中第1行為識(shí)別率最低的5種類型的例子,第2行是對(duì)應(yīng)的最容易誤判成的類型的例子。
圖4 MobilNet下6種誤識(shí)別率最高類型分布
圖5 MobileNet中容易混淆的病害葉片的例子
從圖5看出,玉米灰斑?。–8)與玉米枯葉?。–11)2種病害葉片病斑均是沿葉脈方向擴(kuò)展成長條斑或呈現(xiàn)矩形狀,病斑顏色為灰褐色,2種病害葉片病斑癥狀相似度很高,造成了模型的誤識(shí)別。健康土豆葉(C22)和健康黃豆葉(C25)在葉片形狀和紋理上很相像,從而造成了模型的誤識(shí)別。番茄早疫?。–30)和番茄細(xì)菌性斑點(diǎn)病(C29)均是在葉尖處顏色開始泛黃,斑點(diǎn)呈黑褐色并開始腐爛,2種病斑癥狀相似。番茄晚疫?。–32)和番茄葉霉?。–33)葉面出現(xiàn)大面積不規(guī)則的褐色斑塊,葉片開始萎蔫,2種病害引起的葉片癥狀相似。番茄輪斑?。–36)葉片處于發(fā)病的早期,葉面有紅褐色斑點(diǎn),但并不明顯,番茄二斑葉螨病(C35)主要是二斑葉螨寄生在葉片的背面取食造成的,二斑葉螨會(huì)釋放毒素使葉片變成暗褐色,2種病害葉片在病害特征上相近,葉片紋理相似,從而造成模型的誤識(shí)別。
Inception V3網(wǎng)絡(luò)中單個(gè)類別識(shí)別Acc在90.00%以下的有番茄早疫?。–30)和健康番茄葉(C31),分別是68.00%和89.31%,其中番茄早疫?。–30)識(shí)別率遠(yuǎn)低于AA。2種病害葉片的誤識(shí)別率分別如圖6所示。
番茄早疫?。–30)最容易被誤識(shí)別為番茄斑枯?。–34)、番茄晚疫?。–32)、番茄輪斑?。–36)和番茄細(xì)菌性斑點(diǎn)病(C29),后幾種植物病害葉片分別占前者整體誤識(shí)別率的39.10%、20.30%、15.60%和14.10%。健康番茄葉(C31)最容易被誤識(shí)別為番茄輪斑?。–36),后者占前者整體誤識(shí)別率的70.60%。Inception V3網(wǎng)絡(luò)對(duì)病害誤識(shí)別原因同MobileNet類似,都是不同病害之間在葉片紋理和癥狀等方面非常接近。
自建數(shù)據(jù)集也采用與PlantVillage數(shù)據(jù)集相同的訓(xùn)練方法,表5是2種模型在自建數(shù)據(jù)庫的測試結(jié)果。
表5 葡萄病害分類結(jié)果
由表5可知,自選數(shù)據(jù)集中6種病害樣本在MobileNet、Inception V3模型下識(shí)別的平均準(zhǔn)確率(AA)分別是87.50%、88.06%。MobileNet模型下灰霉病識(shí)別效果最為顯著,Acc為96.67%,其次是白粉病,其Acc為90.00%;霜霉病的識(shí)別效果最差,Acc僅為76.67%,誤識(shí)別率達(dá)到了23.33%,霜霉病最容易被誤判為白粉病,占到了其誤識(shí)別率的78.61%。Inception V3模型下白粉病識(shí)別效果最為顯著,Acc為96.67%,黑痘病、炭疽病、灰霉病的Acc均在90.00%以上;霜霉病病的識(shí)別效果最差,其誤識(shí)別率高達(dá)31.67%,最易被誤識(shí)別為白粉病,占霜霉病整體誤識(shí)別率的68.40%。在2種網(wǎng)絡(luò)中霜霉病的Acc均為最低,圖7給出了霜霉病和白粉病圖例,可以看出2種病害葉片的病害癥狀相似,均呈現(xiàn)白色粉末狀,造成霜霉病很容易被誤識(shí)別為白粉病。
圖6 Inception V3中2種誤識(shí)別率最高的類型圖例
圖7 葡萄霜霉病和白粉病
綜合2種輕量型卷積神經(jīng)網(wǎng)絡(luò)(MobileNet和Inception V3)在2個(gè)數(shù)據(jù)集的識(shí)別結(jié)果,圖像識(shí)別精度方面MobileNet在單個(gè)類別的識(shí)別效果不如Inception V3,但MobileNet和Inception V3在PlantVillage數(shù)據(jù)集上最低的病害識(shí)別Acc分別是70%(番茄葉早疫病,C30)、68%(番茄葉早疫病,C30),在自建葡萄病害數(shù)據(jù)集上最低的病害(葡萄霜霉?。┳R(shí)別Acc分別是76.67%、68.33%,可以看出MobileNet最低的病害識(shí)別率比Inception V3要高,這說明前者比后者在多類別病害識(shí)別的準(zhǔn)確率方面更為均衡,適合在實(shí)際中使用。2種輕量卷積神經(jīng)網(wǎng)絡(luò)在計(jì)算機(jī)端訓(xùn)練后,MobileNet訓(xùn)練完成后的模型尺寸是17.1 MB,Inception V3訓(xùn)練完成后的模型尺寸是87.5 MB。遷移到手機(jī)端后MobileNet的運(yùn)行內(nèi)存是21.5 MB,而Inception V3的運(yùn)行內(nèi)存是125 MB。Inception V3手機(jī)端平均運(yùn)算時(shí)間約是174 ms,MobileNet手機(jī)端的平均計(jì)算時(shí)間約是134 ms,后者的計(jì)算時(shí)間比前者少40 ms,綜合考慮2種網(wǎng)絡(luò)的識(shí)別精度、模型尺寸和運(yùn)算時(shí)間,MobileNet以犧牲微小精確度為代價(jià),模型尺寸小,運(yùn)行時(shí)間短,因此本文認(rèn)為MobileNet在手機(jī)端應(yīng)用時(shí)比Inception V3更加有優(yōu)越性,故本文在手機(jī)端APP開發(fā)時(shí)采用MobileNet。
APP的開發(fā)軟件是Android Studio,前期在計(jì)算機(jī)端使用得到的MobileNet模型,與Android Studio同屬于Google公司,減少諸多限制因素。前面的分類模型導(dǎo)入流程包括:1)模型準(zhǔn)備,2)軟件安裝和配置,3)模型導(dǎo)入和參數(shù)修改,4)測試與驗(yàn)證。模型準(zhǔn)備主要是得到模型.pb文件和標(biāo)簽文件.txt文件,這2個(gè)文件是前期在計(jì)算機(jī)端訓(xùn)練結(jié)束后生成的。軟件安裝和配置主要是開發(fā)工具的安裝和相對(duì)應(yīng)的SDK的安裝。模型導(dǎo)入和參數(shù)修改是在Android Studio中打開Project view,把.pb文件和.txt文件放在app/src/main/assets下,定義變量和Tensorflow接口初始化,配置文件對(duì)應(yīng)的(build gradle)的版本,在APP頁面添加3個(gè)標(biāo)簽按鈕,分別是照片、相機(jī)、識(shí)別圖像,之后配置按鈕對(duì)TF模型的調(diào)用,執(zhí)行“Build APK(S)”,即可生成可安裝文件包(APK文件)。然后,通過4G/無線網(wǎng)絡(luò)傳輸?shù)紸ndroid手機(jī),也可以通過有線方式把安裝包移至Android手機(jī),即完成了基于Android的植物病害葉片APP的移植。APP的測試機(jī)型是榮耀V10,Android手機(jī)端點(diǎn)擊安裝APP,安裝成功后選擇植物病害圖像進(jìn)行測試和驗(yàn)證。
手機(jī)端圖像識(shí)別例子如圖8所示,分別有相機(jī)、照片、識(shí)別3個(gè)按鈕。點(diǎn)擊相機(jī)按鈕可以打開手機(jī)攝像頭選擇拍攝圖片,點(diǎn)擊照片按鈕可在本地內(nèi)存選擇照片,選好照片后點(diǎn)擊識(shí)別按鈕,在照片下部將會(huì)顯示分類概率最高的3種,通??烧J(rèn)為分類概率最高的即為本張植物病害葉片的最終識(shí)別結(jié)果,這種方法為用戶提供了一種自行判斷植物病害的選擇。圖中顯示該圖像被分類為葡萄葉枯?。–15)的概率是0.87。
圖8 手機(jī)端識(shí)別的例子
基于圖像處理與深度學(xué)習(xí)技術(shù),本文采用2種輕量化卷積神經(jīng)網(wǎng)絡(luò)MobileNet和Inception V3在公開的作物病害圖像集PlantVillage和自建葡萄病害葉片圖像集上進(jìn)行遷移學(xué)習(xí),得到2種植物病害分類模型。對(duì)2種模型在識(shí)別準(zhǔn)確率、模型尺寸、運(yùn)算速度等方面進(jìn)行了對(duì)比分析,得到如下結(jié)論:
1)PlantVillage測試集上MobileNet和Inception V3的平均準(zhǔn)確率值分別達(dá)到95.02%和95.62%,在自建圖像集上2種網(wǎng)絡(luò)的平均準(zhǔn)確率是87.50%、88.06%,2種網(wǎng)絡(luò)的識(shí)別精度非常接近。
2)MobileNet和Inception V3在PlantVillage圖像集上最高的誤識(shí)別率分別為30.00%和32.00%,前者的識(shí)別率比后者高2個(gè)百分點(diǎn);在自建圖像集上最高的誤識(shí)別率分別是23.33%和31.67%,前者的識(shí)別率比后者高8個(gè)百分點(diǎn)左右,MobileNet的誤識(shí)別率低于Inception V3。
3)手機(jī)端模型尺寸方面MobileNet僅為Inception V3的1/5左右,前者能極大地節(jié)省手機(jī)的運(yùn)行內(nèi)存。
4)手機(jī)端的平均識(shí)別時(shí)間MobileNet比Inception V3少40 ms,MobileNet在很大程度上節(jié)省用戶時(shí)間,提高使用效率。
上述結(jié)果說明MobileNet更適合在手機(jī)端使用。本文開發(fā)的手機(jī)端的植物葉片病害APP簡單易用,對(duì)多種植物病害識(shí)別精度較高,在實(shí)際應(yīng)用過程中可對(duì)農(nóng)戶科學(xué)、合理、有效地防治植物病蟲害起到積極的作用。
目前的模型局限在背景單一的PlantVillage數(shù)據(jù)庫葉片圖像,PlantVillage數(shù)據(jù)庫的圖像均在室內(nèi)拍攝,在自然條件中采集的自建圖像集上則識(shí)別精度有所下降,說明本模型會(huì)受到光照變化等外部壞境的影響。在后續(xù)研究中我們將采集更多自然條件下拍攝的植物病害葉片加入到訓(xùn)練集中,選擇和設(shè)計(jì)更適合自然條件下進(jìn)行分類的深度網(wǎng)絡(luò),提高網(wǎng)絡(luò)的分類精度,開發(fā)更加實(shí)用的手機(jī)端植物病害識(shí)別軟件。
[1] 賈建楠,吉海彥,基于病斑形狀和神經(jīng)網(wǎng)絡(luò)的黃瓜病害識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2013,29(25):115-121. Jia Jiannan, Ji Haiyan. Recognition for cucumber disease based on leaf spot shape and neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2013, 29(25): 115-121. (in Chinese with English abstract)
[2] 孫俊,譚文軍,毛罕平. 基于改進(jìn)卷積神經(jīng)網(wǎng)絡(luò)的多種植物葉片病害識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2017,33(19):209-215. Sun Jun, Tan Wenjun, Mao Hanping. Recognition of multiple plant leaf diseases based on improved convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(19): 209-215. (in Chinese with English abstract)
[3] 魏麗冉,岳峻,李振波,等. 基于核函數(shù)支持向量機(jī)的植物葉部病害多分類檢測方法[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2017,48(S1):166-171. Wei Liran, Yue Jun, Li Zhenbo, et al. Multi-classification detection method of plant leaf disease based on kernel function SVM[J]. Transactions of the Chinese Society for Agricultural Machinery, 2017, 48(S1): 167-171. (in Chinese with English abstract)
[4] 龍滿生,歐陽春娟,劉歡,等. 基于卷積神經(jīng)網(wǎng)絡(luò)與遷移學(xué)習(xí)的油茶病害圖像識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2018,34(18):194-201. Long Mansheng, Ouyang Chunjuan, Liu Huan, et al. Image recognition of Camellia oleifera diseases based on convolutional neural network & transfer learning[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(18): 194-201. (in Chinese with English abstract)
[5] 張建華,祁力鈞,冀榮華. 基于粗糙集和BP神經(jīng)網(wǎng)絡(luò)的棉花病害識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2012,28(7):161-167. Zhang Jianhua, Qi Lijun, Ji Ronghua. Cotton diseases identification based on rough setsand BP neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2012, 28(7): 161-167. (in Chinese with English abstract)
[6] 許良鳳,徐小兵,胡敏. 基于多分類器融合的玉米葉部病害識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2015,31(14):194-201. Xu Liangfeng, Xu Xiaobing, Hu Min. Corn leaf disease identification based on multiple classifiers fusion[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(14): 194-201. (in Chinese with English abstract)
[7] 馬浚誠,杜克明,鄭飛翔,等. 基于卷積神經(jīng)網(wǎng)絡(luò)的溫室黃瓜病害識(shí)別系統(tǒng)[J]. 農(nóng)業(yè)工程學(xué)報(bào),2018,34(12):186-192. Ma Juncheng, Du Keming, Zheng Feixiang, et al. Disease recognition system for greenhouse cucumbers based on deep convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(12): 186-192. (in Chinese with English abstract)
[8] 楊林楠,郜魯濤,林爾升. 基于Android系統(tǒng)手機(jī)的甜玉米病蟲害智能診斷系統(tǒng)[J]. 農(nóng)業(yè)工程學(xué)報(bào),2012,28(18):163-168. Yang Linnan, Gao Lutao, Lin Ersheng. Intelligent diagnose system of diseases and insect pests in sweet corn based on mobile terminal with Android system[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2012, 28(18): 161-167. (in Chinese with English abstract)
[9] Prasad S, Peddoju S K, Ghosh D. Multi-resolution mobile vision system for plant leaf disease diagnosis[J]. Signal, Image and Video Processing, 2016, 10(2): 379-388.
[10] 焦計(jì)晗,張帆,張良. 基于改進(jìn)AlexNet模型的油菜種植面積遙感估測[J]. 計(jì)算機(jī)測量與控制,2018,26(2):186-189. Jiao Jihao, Zhang Fan, Zhang Liang. Remote sensing estimation of rape planting area based on improved AlexNet model[J]. Computer Measurement & Control, 2018, 26(2): 186-189. (in Chinese with English abstract)
[11] Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition[EB/OL]. [2017-09-04]. https://arxiv.org/abs/1409.1556v6.
[12] Ballester P L, Araujo R M. On the performance of GoogLeNet and AlexNet applied to sketches[C]// AAAI. AAAI Press, 2016.
[13] 尼加提·卡斯木,師慶東,劉素紅,等. 基于卷積網(wǎng)絡(luò)的沙漠腹地綠洲植物群落自動(dòng)分類方法[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2019,50(1):217-225. Nijiat Kasim, Shi Qingdong, Liu Suhong, et al. Automatic classification method of oasis plant community in desert hinterland based on VggNet and ResNet models[J]. Transactions of the Chinese Society for Agricultural Machinery, 2019, 50(1): 217-225. (in Chinese with English abstract)
[14] 趙志衡,宋歡,朱江波,等. 基于卷積神經(jīng)網(wǎng)絡(luò)的花生籽粒完整性識(shí)別算法及應(yīng)用[J]. 農(nóng)業(yè)工程學(xué)報(bào),2018,34(21):195-201. Zhao Zhiheng, Song Huan, Zhu Jiangbo, et al. Peanut grain integrity recognition algorithm based on convolution neural network and its application[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(21): 195-201. (in Chinese with English abstract)
[15] 王丹丹,何東健. 基于R-FCN深度卷積神經(jīng)網(wǎng)絡(luò)的機(jī)器人疏果前蘋果目標(biāo)的識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2019,35(3):164-171. Wang Dandan, He Dongjian. Recognition of apple target before fruit thinning by robot based on R-FCN deep convolution neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(3): 164-171. (in Chinese with English abstract)
[16] 李云伍,徐俊杰,劉得雄,等. 基于改進(jìn)空洞卷積神經(jīng)網(wǎng)絡(luò)的丘陵山區(qū)田間道路場景識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2019,35(7):150-159. Li Yunwu, Xu Junjie, Liu Dexiong, et al. Field road scene recognition in Hilly and mountainous areas based on improved void convolution neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(7): 150-159. (in Chinese with English abstract)
[17] Lu Jiang, Hu Jie, Zhao Guannan, et al. An in-field automatic wheat disease diagnosis system[J]. Computers and Electronics in Agriculture, 2017, 142: 369-379.
[18] 張建華,孔繁濤,吳建寨,等. 基于改進(jìn)VGG卷積神經(jīng)網(wǎng)絡(luò)的棉花病害識(shí)別模型[J]. 中國農(nóng)業(yè)大學(xué)學(xué)報(bào),2018,23(11):167-177. Zhang Jianhua, Kong Fantao, Wu Jianzhai, et al. Cotton disease identification model based on improved VGG convolution neural network[J]. Journal of China Agricultural University, 2018, 23(11): 167-177. (in Chinese with English abstract)
[19] 鄭一力,張露. 基于遷移學(xué)習(xí)的卷積神經(jīng)網(wǎng)絡(luò)植物葉片圖像識(shí)別方法[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2018,49(S1):354-359. Zheng Yili, Zhang Lu. Plant leaf image recognition method based on transfer learning with convolutional neural networks[J]. Transactions of the Chinese Society for Agricultural Machinery, 2018, 49(S1): 354-359. (in Chinese with English abstract)
[20] Grinblat G L, Uzal L C, Larese, et al. Deep learning for plant identification using vein morphological patterns[J]. Computers and Electronics in Agriculture, 2016, 127: 418-424.
[21] Howard A G, Zhu M, Chen B, et al. MobileNets: efficient convolutional neural networks for mobile vision applications[EB/OL]. [2017-04-17]. https: //arxiv. org/abs/1704. 04861.
[22] Szegedy C, Vanhoucke V, Ioffe S, et al. Rethinking the inception architecture for computer vision [EB/OL]. [2015-12-02]. https://arxiv.org/abs/1512.00567
[23] Loffe S, Szegedy C. Batch normalization: accelerating deep network training by reducing internal covariate Shift[EB/OL]. [2015-02-11]. https: //arxiv. org/abs/1502. 03167.
[24] 宋小倩,周東升. 基于Android平臺(tái)的應(yīng)用開發(fā)研究[J]. 軟件導(dǎo)刊,2011,10(2):104-106. Song Xiaoqian, Zhou Dongsheng. Development and research of application based on android platform[J]. Software Tribune, 2011, 10(2): 104-106. (in Chinese with English abstract)
[25] 尚明華,秦磊磊,王風(fēng)云,等. 基于Android智能手機(jī)的小麥生產(chǎn)風(fēng)險(xiǎn)信息采集系統(tǒng)[J]. 農(nóng)業(yè)工程學(xué)報(bào),2011,27(5):178-182. Shang Minghua, Qin Leilei, Wang Fengyun, et al. Information collection system of wheat production risk based on Android smartphone[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2011, 27(5): 178-182. (in Chinese with English abstract)
[26] 楊莉. 基于Android的移動(dòng)學(xué)習(xí)平臺(tái)的設(shè)計(jì)[J]. 計(jì)算機(jī)光盤軟件與應(yīng)用,2014(6):79-80. Yang Li. Design on mobile learning platform based on Android[J]. Computer CD Software and Application, 2014(6): 79-80. (in Chinese with English abstract)
[27] 戴建國,王守會(huì),賴軍臣,等. 基于智能手機(jī)的棉花苗情調(diào)查與決策支持系統(tǒng)[J]. 農(nóng)業(yè)工程學(xué)報(bào),2017,33(21):200-206. Dai Jianguo, Wang Shouhui, Lai Junchen, et al. Cotton growth statuses investigation and decision support system based on smart phone[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(21): 200-206. (in Chinese with English abstract)
[28] 路文超,趙勇,羅斌,等. 基于android手機(jī)的水稻劍葉角測量系統(tǒng)[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2015,46(11):296-301. Lu Wenchao, Zhao Yong, Luo Bin, et al. Measurement system of rice flag leaf angle based on android smart phone[J]. Transactions of the Chinese Society for Agricultural Machinery, 2015, 46(11): 296-301. (in Chinese with English abstract)
[29] 馬艷娜,唐華,柯紅軍. 基于移動(dòng)終端的遙感監(jiān)測數(shù)據(jù)采集系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)[J]. 測繪與空間地理信息,2017,40(4):120-122. Ma Yanna, Tang Hua, Ke Hongjun. The System design and implementation of remote sensing data acquisition based on mobile terminal[J]. Geometrics & Spatial Information Technology, 2017, 40(4): 120-122. (in Chinese with English abstract)
[30] 戴建國,賴軍臣. 基于圖像規(guī)則與Android手機(jī)的棉花病蟲害診斷系統(tǒng)[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2015,46(1):35-44. Dai Jianguo, Lai Junchen. Image-rule-based diagnostic expert system for cotton diseases and pests based on mobile terminal with android system[J]. Transactions of the Chinese Society for Agricultural Machinery, 2015, 46 (1): 35-44. (in Chinese with English abstract)
[31] Prasad S, Peddoju S K, Ghosh D. Multi-resolution mobile vision system for plant leaf disease diagnosis[J]. Signal, Image and Video Processing, 2016, 10(2): 379-388.
[32] He Kaiming, Zhang Xiangyu, Ren Shaoqing, et al. Deep residual learning for image recognition[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016: 27-30
[33] Hughes D P, Salathe M. An open access repository of images on plant health to enable the development of mobile disease diagnostics[EB/OL]. [2015-11-25]. https: //arxiv. org/abs/1511. 08060.
[34] Pan S J, Yang Q. A survey on transfer learning[J]. IEEE Transactions on Knowledge and Data Engineering, 2010, 22(10): 1345-1359.
[35] 楊國國,鮑一丹,劉子毅. 基于圖像顯著性分析與卷積神經(jīng)網(wǎng)絡(luò)的茶園害蟲定位與識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2017,33(6):156-162. Yang Guoguo, Bao Yidan, Liu Ziyi. Localization and recognition of pests in tea plantation based on image saliency analysis and convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(6): 156-162. (in Chinese with English abstract)
[36] 葉海建, 郎睿. 基于Android的自然背景下黃瓜霜霉病定量診斷系統(tǒng)[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2017,48(3):24-29. Ye Haijian, Lang Rui. Cucumber downy mildew severity quantifying diagnosis system suitable for natural backgrounds based on Android[J]. Transactions of the Chinese Society for Agricultural Machinery, 2017, 48(3): 24-29. (in Chinese with English abstract)
[37] 葛蕓,江順亮,葉發(fā)茂,等. 基于ImageNet預(yù)訓(xùn)練卷積神經(jīng)網(wǎng)絡(luò)的遙感圖像檢索[J]. 武漢大學(xué)學(xué)報(bào):信息科學(xué)版,2018,43(1):67-73. Ge Yun, Jiang Shunliang, Ye Famao, et al. Remote sensing image retrieval using pre-trained convolutional neural networks based on ImageNet[J]. Geometrics and Information Science of Wuhan University, 2018, 43(1): 67-73. (in Chinese with English abstract)
[38] Mohanty S P, Hughes D P, Marcel S. Using deep learning for image-based plant disease detection[J]. Frontiers in Plant Science, 2016, 7: 14-19
Plant disease identification method based on lightweight CNN and mobile application
Liu Yang1, Feng Quan1※, Wang Shuzhi2
(1.,,730070,; 2.,,730030,)
Because of the cultivation environment, management level, climate and other conditions, there are a variety of different types of diseases over the plant growth period. The problem of plant diseases in agricultural production has become one of the important factors that restrict crop growth. Timely and accurate identification of disease types is of great significance for effective disease control. The disease identification methods based on deep neural network have achieved very high recognition accuracy. However, the ordinary deep neural networks are too large in size and mainly running on computers. At present, smart phones are more and more popular, and a disease recognition system is very meaningful if it can be run on the phones directly. In this paper, the lightweight convolutional neural network (CNN) was employed to design a mobile APP for plant disease identification, which could be easily used in the field. The lightweight networks used in this paper included MobileNet and Inception V3. We had compared the performance of the 2 methods in several aspects in order to get the best model and transplant to the mobile phone. We pre-trained the 2 network models on the ImageNet dataset and then migrated on the PlantVillage dataset and the self-built grape disease dataset. Disease classification test experiments were performed on the 2 sets using the 2 training models obtained. The experimental results showed that MobileNet and Inception V3 had an average recognition accuracy of 95.02% and 95.62% over the PlantVillage dataset (a total of 38 species), and 87.50%, 88.06% respectively over the grape disease dataset. The recognition accuracy of the 2 networks was generally consistent. For the PlantVillage dataset, the recognition rates of tomato leaf early blight were the lowest in the 2 databases, 70% and 68%, respectively for MobileNet and Inception V3. For the grape downy mildew on the dataset, the 2 networks also showed the lowest recognition rates, which were 76.67% and 68.33%, respectively. MobileNet's lowest disease recognition rate was higher than that of Inception V3, which meant that MobileNet was more balanced than Inception V3 in the accuracy of multiple species of disease identification and was more suitable for practical use. In terms of model size, Inception V3 was 87.5 MB, and MobileNet was 17.1 MB. The former was about 5 times larger than the latter. The APP with Inception V3 and MobileNet occupied 125 and 21.5 MB of mobile phone memory respectively. To identify a single picture on the phone, APP with Inception V3 took 174 ms while APP with MobileNet took only 134, 40 ms faster. In summary, the classification accuracy of the 2 network was very close, but MobileNet required less memory and ran faster than Inception V3, indicating that the former was more suitable for mobile phone applications. The images in the PlantVillage dataset were taken indoors and the background image was simple, thus the recognition accuracy over it was high. However, the accuracy decreased over the grape disease dataset in which the images were collected in natural conditions, indicating that the network was significantly affected by external environment such as illumination changes and background. In the follow-up study, we will collect more plant disease leaves taken under natural conditions for training to develop a more robust APP for plant disease identification.
plant; diseases; image recognition; MobileNet; Inception V3; Android
2019-05-18
2019-08-26
甘肅農(nóng)業(yè)大學(xué)學(xué)科建設(shè)專項(xiàng)基金(GAU-XKJS-2018-188);國家自然基金(61461005)
劉 洋,主要從事圖像處理、模式識(shí)別。Email:842491107@qq.com
馮 全,教授,博士,博士生導(dǎo)師,主要從事圖像處理、農(nóng)業(yè)信息化。Email:fquan@sina.com
10.11975/j.issn.1002-6819.2019.17.024
S43; TP391.41
A
1002-6819(2019)-17-0194-11
劉 洋,馮 全,王書志. 基于輕量級(jí)CNN的植物病害識(shí)別方法及移動(dòng)端應(yīng)用[J]. 農(nóng)業(yè)工程學(xué)報(bào),2019,35(17):194-204. doi:10.11975/j.issn.1002-6819.2019.17.024 http://www.tcsae.org
Liu Yang, Feng Quan, Wang Shuzhi. Plant disease identification method based on lightweight CNN and mobile application[J].Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(17): 194-204. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2019.17.024 http://www.tcsae.org