向 陽,林潔雯,李亞軍,胡正方,熊 瑛
芒果雙面成熟度在線檢測分級系統
向 陽,林潔雯,李亞軍,胡正方,熊 瑛
(湖南農業大學工學院,長沙 410128)
芒果屬于后熟水果,芒果成熟度分級可為芒果后熟、加工、包裝、運輸等工作提供便利條件。針對芒果形狀不規則,難以對整個外觀進行檢測的問題,該文提出了一種基于遷移學習的芒果雙面成熟度在線檢測分級系統。通過上、下層輸送帶將芒果運輸到圖像采集區域,分別獲取正、反面圖像;2層輸送帶之間利用柔性翻面機構實現芒果無損翻面,通過壓縮試驗及ANSYS軟件建模分析芒果承受擠壓力范圍。合并正、反2張圖像并進行預處理,將數據以8:1.5:1.5的比例拆分為訓練集、驗證集、測試集,并用遷移學習方法在卷積神經網絡模型進行芒果成熟度分級。使用卷積神經網絡模型對芒果成熟度分級平均準確率達到96.72%,系統測定單個樣品的平均耗時為0.16 s,研究結果為芒果成熟度在線分級提供參考。
機器視覺;分級;模型;芒果;雙面檢測;翻面機構;卷積神經網絡;成熟度
中國是芒果產量第二大國,面對巨大的芒果產量,現階段中國普遍采用人工或者人機結合進行芒果分級[1],且現有分級裝置多針對芒果尺寸、質量進行分級,難以實現芒果成熟度自動分級。將機器視覺技術應用于水果分級可有效避免水果損傷,更可以減輕勞動力,提高分級效率[2-4]。國內外應用機器視覺對球狀水果[5-9]的檢測及分級已經取得了較大的進展。趙娟等[10]通過帶有滾子輸送帶的裝置對蘋果多面圖像進行采集并輸送,挑選出含有缺陷的蘋果。王麗麗[11]使用不同大小網孔的分級機與機器視覺相結合,實現大棗的尺寸、紋理、品質等綜合信息的檢測。在芒果分級研究中,Nand等[12]通過高斯混合模型檢測芒果成熟度,并使用模糊邏輯技術對芒果大小、成熟度進行自動分級,5個品種芒果的不同等級分級成功率接近90%。Saad等[13]使用芒果分級裝置上的視覺系統獲取芒果圖像,并用圓柱近似分析方法估測芒果的質量及體積,該方法分級精度達到95%。Mohd等[14]使用傅里葉描述子和尺寸形狀參數描述芒果形狀,使用disk法估計芒果的質量,該試驗成功率為94%。國內也進行了一系列的理論研究,孫樹亮[15]使用C-均值法、最近鄰法、線性函數法分別對芒果顏色、大小進行分類,通過試驗對比,線性函數法在樣本數量較多時分類效果較好,準確率為95.31%。李國進等[16]提出了一種基于計算機視覺和極限學習機神經網絡模型的理論,對15個芒果進行了測試,準確率為100%,為芒果分級提供了一種新的方法。綜上所述,相對于球形水果,芒果形狀似橢球狀,質地較軟,現有的研究均通過提取芒果單面圖像實現檢測并分級,而芒果成熟度需要獲取芒果全面圖像才能反映。目前沒有針對芒果雙面信息進行分級的相關研究。
本文提出一種基于遷移學習的芒果雙面成熟度在線檢測分級系統,通過柔性翻面機構實現芒果雙面圖像采集。相機可以獲取最大橢圓截面視野的二維圖像,拍攝芒果正、反面圖像可充分表達芒果表皮信息。卷積神經網絡在遷移學習中的應用可有效解決農業領域問題[17-19],不需要人工提取特征,自動對樣本圖像進行分類[20-21]。本文運用卷積神經網絡模型自動提取芒果雙面表皮特征,將特征放入分類器中進行訓練與分級,有效解決芒果成熟度自動化分級問題。
本文參照芒果分級標準NY/T492-2002[22]與NY/ T3011-2016[23]的分級要求與感官檢驗規定,以芒果成熟度為首要特征[24],劃分芒果等級,如表1所示。
每級選用50個芒果樣品,進行去皮處理,采用GY-3水果硬度計(溫州一鼎儀器制造有限公司)分別對每個芒果正面、反面各取4個點進行硬度試驗,將同一芒果的正反面共8個點,取平均值作為該芒果的硬度值如圖1所示。由于芒果成熟度分布不規律,各級硬度值出現數據交叉現象,但同一芒果8個點求均值后,各級芒果具有明顯的硬度區間。采用p分位數法[25]劃分1級與2級、2級與3級的硬度值分別為8.77 kg/cm2、3.32 kg/cm2,因此,確定1級果肉硬度:>8.77 kg/cm2;2級果肉硬度:3.32~8.77 kg/cm2;3級果肉硬度:<3.32 kg/cm2,硬度試驗結果與感官檢驗相符。

表1 芒果等級劃分

圖1 芒果硬度試驗結果
基于遷移學習的芒果雙面成熟度在線檢測分級裝置示意圖如圖2a所示,裝置實物圖如圖2b所示。芒果從上層輸送帶上的入料斗喂入,通過人字擋板排列依次進入圖像采集區域。為實現雙面圖像獲取,在上層輸送帶結束端設置柔性翻面機構,保證芒果柔性翻面并只翻面一次。芒果經過柔性翻面機構進入下層輸送帶并完成反面圖像采集。系統結合芒果雙面圖像進行成熟度分析,并控制分級推板根據分級結果對芒果進行分級輸出。
2.2.1 柔性翻面機構原理
為了能夠實現雙面圖像獲取,設計一種柔性翻面機構如圖3所示,動力滾筒A帶動輸送帶a順時針轉動,動力滾筒B帶動輸送帶b逆時針轉動。輸送帶為PVC材料,a、b的周長分別為895、1 436 mm,寬100 mm,厚2 mm。動力滾筒為不銹鋼材料,A與B的轉速相同,轉速在0~167.5 r/min范圍可調,相應輸送帶速度可調范圍為0~0.5 m/s。芒果在運動方向相反的兩輸送帶的夾持下進入柔性翻面機構,輸送過程中保持相對靜止狀態,與輸送帶間沒有相對運動,實現只翻面一次。隨著芒果輸送位置的改變,外側輸送帶對芒果的夾持力先增大后減小,為使芒果不受擠壓,在裝置尾部設置彈簧調整滾筒C的位置,保持翻面運動過程中對芒果合適的夾持力。如圖3b所示,1、2為不同輸送狀態下的彈簧長度,芒果輸送過程中,彈簧不斷伸縮從而調整滾筒C的橫向位移,實現無損翻面。

1. 入料斗2.上層輸送帶3.擋板4.上層輸送帶相機5.上層光源6. 柔性翻面機構7. 彈簧8. 滾筒9. 下層輸送帶10. 下層輸送帶相機11. 下層光源12. 控制系統13.分級推板
2.2.2 芒果擠壓力測試及彈簧選型
如圖4所示,芒果位于豎直狀態時,承受垂直兩側輸送帶法線方向的擠壓力,此時彈簧壓縮量最大,故確定合適的擠壓力并選擇合適的彈簧可有效避免芒果輸送損傷。柔性翻面機構穩定輸送芒果的最小擠壓力為:
F ≥(1)
2(2)
式中是輸送帶與芒果的摩擦系數,為0.4;表示芒果承受的擠壓力,N;是芒果與輸送帶的摩擦力,N;表示芒果重力,N。芒果質量范圍為70~120 g,則輸送帶該處提供芒果的最小夾持力為0.86~1.47 N。
芒果果肉相較于果皮更易損壞[26],為保證輸送過程中果肉不受損傷,需確定芒果果肉能夠承受的擠壓力范圍。采用英國SMS公司TA.XT Plus質構儀測試芒果力學參數。質構儀感應元件大小300 N,試驗選用壓頭型號P0.5,最小起始量20 g,分別設定試驗檢測速度與壓模下壓深度為1 mm/s、10 mm。選取10個質量相近的芒果進行去皮處理,然后依次置于壓頭下方測定果肉破壞力,通過式(3)、(4)計算芒果果肉的破壞應力及彈性模量。



注:a、b分別表示柔性翻面機構內、外側輸送帶;A、B分別表示柔性翻面機構內、外側輸送動力滾筒;C表示隨彈簧伸縮移動的滾筒;L1表示柔性翻面機構無芒果通過時彈簧總長,mm;L2表示柔性翻面機構有芒果通過時彈簧總長,mm。

注:F表示芒果承受的擠壓力,N;G表示芒果重力,N。
運用ANSYS Workbench 有限元分析軟件測試芒果果肉承受的擠壓力。芒果平均長80 mm,寬56 mm,厚43 mm,水平放置時與平面接觸形成最小橢圓,其平均長軸為20 mm,短軸為14 mm。為還原芒果豎直位置的受力情況,本文以芒果平均尺寸構建橢球體作為輸入模型,以最小橢圓為芒果與內側輸送帶的接觸面積,對模型施加沿橢球面的擠壓力。
采用四面體網格的Patch Conforming劃分法,并設置單元邊長為2 mm。當施加5、10、15、20 N的擠壓力時受到的最大應力分別為0.04、0.08、1.22、1.63 MPa,當擠壓力為20 N時最大應力超過芒果果肉的破壞應力。因此,芒果能夠承受的擠壓力的范圍約為1.47~15 N,選用10 N作為芒果在豎直位置受到的擠壓力,其應力分布如圖5所示。

圖5 加載力10 N的芒果等效應力圖

上層及下層輸送帶設置兩套完全相同的圖像采集裝置,分別采集芒果正、反面圖像。圖像采集裝置主要由工業相機、鏡頭及光源組成。根據芒果尺寸,將圖像采集視野大小設置為200 mm×150 mm。工業相機采用映美精DFK 41BU02彩色相機,外觀尺寸50.6 mm×50.6 mm×56 mm,CCD靶面尺寸為寬6.4 mm,高4.8 mm。鏡頭采用computar 8.5 mm工業鏡頭,相應的物距為266 mm。光源采用4根呈正方形排布的LED條形光源,并采用低角度照明方式。圖像處理及訓練硬件環境:Intel Core i7 8750H CPU,Nvidia GPU,16GB內存。
控制系統原理如圖6a所示,系統工作流程如圖6b所示,上層、下層、分級傳感器均工作在中斷模式。系統通過上層、下層傳感器對芒果計數并觸發相機采集圖像,系統結合雙面圖像分析得到分級結果,并通過3塊電磁鐵控制分級推板實現芒果分級。裝置全程通過電機帶動輸送帶實現芒果輸送,3個分級推板與下層輸送帶相機的距離分別為0.196、0.346、0.497 m,定時器1、2、3的時間隨速度變化相應調整。

圖6 控制系統
卷積神經網絡是一種適用于深度學習的圖像處理方法,能夠輸入具有三維特征的圖像數據,自動學習含有標簽的圖像特征從而實現分類[29]。卷積神經網絡包含輸入層、卷積層、激活層、池化層、全連接層及輸出層,結構上由卷積層、激活層、池化層交替出現,最后為全連接層。
卷積層的輸入為前一層網絡的多個二維特征圖,卷積層將它們與多個可學習的卷積核進行卷積,將卷積結果通過神經元計算節點得到卷積層的輸出二維特征圖,卷積層原理[30]為

卷積神經網絡的激活函數必須使用非線性函數,常用激活函數為sigmoid函數、ReLU函數,本文使用ReLU函數如下式:

池化是縮小長、高方向上的空間運算,池化層只是從目標區域中取最大值或平均值,與上一層連接的所有權重都為固定值,在網絡訓練過程中不再改變,池化層[31]可以描述為

全連接層可對特征進行進一步降維。最后一層為輸出層,輸出層采用softmax函數,具體方法如下式:

基于遷移學習的芒果雙面成熟度在線檢測分類模型如圖7所示,本文使用的是hdevelop預訓練的pretrained_dl_classifier_compact.hdl模型,卷積神經網絡以RGB圖像作為輸入層,輸入圖像尺寸為224′224像素。

注:CNN為卷積神經網絡模型。
為實現芒果雙面成熟度分級,將裝置上、下層輸送帶相機獲取的每只芒果的正、反面圖像進行合并操作,合并結果如圖8a所示。使用預訓練的分類模型需輸入統一大小、灰度范圍的三通道圖像,因此將合并圖像進行如下預處理:1)對圖像進行縮放操作,將圖像大小為640′960像素的三通道圖像縮放至224′224 像素。2)對縮放圖像進行灰度拉伸操作,提高圖像對比度,使單通道的灰度范圍為0~255。由于分類器中單通道的灰度范圍需滿足-127~128,因此,將灰度拉伸操作后的圖像進行灰度轉換,具體方法如下式:

式中為輸出圖像;為最大灰度值,值為128;為最小灰度值,值為-127;為輸入圖像;x、 y分別表示圖像寬、高,像素,圖像預處理效果如圖8b所示。
卷積神經網絡學習的目的是找到使損失函數的值盡可能小的參數,本文采用含動量的小批量隨機梯度下降算法[32],損失函數為交叉熵誤差與正則化項相結合的多項式,如下所示:



根據隨機梯度下降法原理設定卷積神經網絡的超參數,為避免過擬合,設定正則化參數為0.000 5,將每小批量樣本數量設定為64。
為檢驗算法可行性,選用1 100個不同成熟度芒果作為試驗樣品。隨機分配訓練樣品數為800個,驗證樣品數為150個,測試樣品數為150個。試驗前,將800個訓練樣品和150個驗證樣品放入裝置中獲取正、反面合并圖像,結合本文芒果等級劃分,測量芒果的正反面共8個點硬度值的平均值,標定芒果成熟度等級,并對圖像進行標簽,用于訓練卷積神經網絡分類器,訓練時間為143 s,平均每個芒果訓練時間為0.15 s。
Top1err是評價CNN訓練的常用指標,可輸出測試圖像不屬于CNN識別結果可能性最高類別的錯誤率[33]。學習率和動量是卷積神經網絡訓練過程中的重要參數。本文以學習率0.010、0.005、0.001為備選值,以動量0.4、0.5、0.8、0.9為備選值,選擇分類器最優參數。迭代次數為460次時,訓練集與驗證集的誤差如表2所示。當初始學習率設定為0.010與0.005時,訓練集與驗證集均有較大的錯誤率。初始學習率為0.001對于分類器的訓練精度有較好的體現,且隨著動量的增加,訓練集與驗證集的誤差先減小后增大,動量為0.5時,訓練集與驗證集的誤差最小。最終確定初始學習速率為0.001,每3個時期將學習率降低1/10,動量為0.5。

表2 不同參數對訓練集與驗證集的影響
表3為驗證集150個樣品的混淆矩陣,誤判級別主要分布在第2級與第3級,總體訓練結果較為理想。

表3 驗證集混淆矩陣
將150個測試樣品放入分級裝置,通過預先訓練的卷積神經網絡分類器分級,并將芒果輸送至不同果箱中,系統測定單個樣品的平均耗時0.16 s。分別測量芒果硬度,獲得芒果成熟度等級,將自動分級結果與芒果成熟度等級對比,如表4所示。

表4 芒果分級結果
通過對試驗數據的分析,造成誤判的原因在于:當芒果處于第2級與第1、3級臨界處容易造成分級出錯。
現有芒果成熟度分級方法通常使用閾值分割法[34]、支持向量機[35]、BP神經網絡[16,36]、最近鄰法[15]、線性函數法[15]等,但使用此類方法需要對圖像進行復雜的預處理并不斷優化參數,從而實現分級。本文使用的卷積神經網絡只需對圖像進行合并與縮放操作,將二維圖像輸入分類器中進行分級,避免了復雜的圖像預處理過程。本文算法相比支持向量機[35]分級準確率96%提高0.72%。李國進等[16]使用SVM、BP神經網絡、PSOELM對芒果特征參數測試的平均耗時分別為0.084、0.098、0.120 s,本文分類測試平均耗時0.028 s。同時,辛華健[36]使用的BP神經網絡方法獲取芒果圖像并測定單個樣品平均耗時0.8 s,本文方法低于該方法0.64 s。此外,現有芒果圖像采集裝置[12-14]僅能夠獲取芒果單面信息,對芒果表皮信息采集不全面。本文提出的柔性翻面機構實現芒果無損翻面,然后合并正、反面芒果圖像后進行成熟度分級,更適合實際生產中的分級要求。
1)本文設計了一種芒果雙面成熟度在線檢測裝置,通過上下兩層輸送帶和上下兩臺相機,配合兩層之間的柔性翻面機構,實現芒果正反兩面圖像的采集和雙面綜合成熟度檢測。
2)在對正、反兩面圖像合并的基礎上,將圖像進行縮放及灰度拉伸操作,運用遷移學習方法在卷積神經網絡模型上進行訓練,每個芒果的訓練時間為0.15 s,訓練效果較好。
3)以芒果果肉硬度為分級依據,使用卷積神經網絡算法分級的平均準確率為96.72%,系統測定單個樣品的平均耗時為0.16 s,可代替人工分級,滿足實際應用的要求。
芒果表面存在的輕微瑕疵點或色斑,對芒果等級判別具有一定影響。降低瑕疵點及色斑對于芒果成熟度分級的影響是該算法中有待優化的部分。另外,后期還需進一步增加訓練樣本以提升系統應用價值。分類器訓練速度及芒果分級速度也需要進一步提高。
[1] 李日旺,黃國弟,蘇美花,等. 我國芒果產業現狀與發展策略[J]. 南方農業學報,2013,44(5):875-878. Li Riwang, Huang Guodi, Su Meihua, et al. Status and developmental strategies of mango industry in China[J]. Journal of Southern Agriculture, 2013, 44(5): 875-878. (in Chinese with English abstract)
[2] 黃辰,費繼友. 基于圖像特征融合的蘋果在線分級方法[J].農業工程學報,2017,33(1):285-291. Huang Chen, Fei Jiyou. Online apple grading based on decision fusion of image features[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(1): 285-291. (in Chinese with English abstract)
[3] 張慶怡,顧寶興,姬長英,等. 蘋果在線分級系統設計與試驗[J]. 華南農業大學學報,2017,38(4):117-124. Zhang Qingyi, Gu Baoxing, Ji Changying, et al. Design and experiment of an online grading system for apple[J]. Journal of South China Agricultural University, 2017, 38(4): 117-124. (in Chinese with English abstract)
[4] Cuber S, Aleixos N, Moltó E, et al. Advances in machine vision applications for automatic inspection and quality evaluation of fruits and vegetables[J].Food and Bioprocess Technology, 2011, 4(4): 487-504.
[5] 蔣煥煜,應義斌,王劍平,等. 水果品質智能化實時檢測分級生產線的研究[J]. 農業工程學報,2002,18(6):158-160. Jiang Huanyu, Ying Yibin, Wang Jianping, et al. Real time intelligent inspecting and grading line of fruits[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2002, 18(6): 158-160. (in Chinese with English abstract)
[6] 溫芝元,曹樂平. 基于補償模糊神經網絡的臍橙不同病蟲害圖像識別[J]. 農業工程學報,2012,28(11):152-157. Wen Zhiyuan, Cao Leping.Image recognition of navel orange diseases and insect pests based on compensatory fuzzy neural networks[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2012, 28(11): 152-157. (in Chinese with English abstract)
[7] 黃文倩,李江波,張馳,等. 基于類球形亮度變換的水果表面缺陷提取[J]. 農業機械學報,2012,43(12):187-191. Huang Wenqian, Li Jiangbo, Zhang Chi, et al. Detection of surface defects on fruits using spherical intensity transformation[J]. Transactions of the Chinese Society for Agricultural Machinery, 2012, 43(12): 187-191. (in Chinese with English abstract)
[8] 李江波,彭彥昆,黃文倩,等. 桃子表面缺陷分水嶺分割方法研究[J]. 農業機械學報,2014,45(8):288-293. Li Jiangbo, Peng Yankun, Huang Wenqian, et al. Watershed segmentation method for segmenting defects on peach fruit surface[J]. Transactions of the Chinese Society for Agricultural Machinery, 2014, 45(8): 288-293. (in Chinese with English abstract)
[9] 葉晉濤,王運祥,楊杰,等. 哈密瓜顏色特征提取及成熟度分級的研究[J]. 石河子大學學報:自然科學版,2016,34(1):106-111. Ye Jintao, Wang Yunxiang, Yang Jie, et al. Research on maturity and classification of Hami melon based on color space feature extraction[J]. Journal of Shihezi University: Natural Science, 2016, 34(1): 106-111. (in Chinese with English abstract)
[10] 趙娟,彭彥昆,Sagar Dhakal,等. 基于機器視覺的蘋果外觀缺陷在線檢測[J]. 農業機械學報,2013,44(1),260-263. Zhao Juan, Peng Yankun, Sagar Dhakal, et al. On-line detection of apple surface defect based on image processing method[J]. Transactions of the Chinese Society for Agricultural Machinery, 2013, 44(1): 260-263. (in Chinese with English abstract)
[11] 王麗麗. 基于計算機視覺的哈密大棗無損檢測分級技術及分級裝置研究[D]. 石河子:石河子大學,2013. Wang Lili. Research of Non-destructive Grading Technology and Detection Equipment for Hami Big Jujubes Based on Computer Vision[D]. Shhezi: Shihezi University, 2013. (in Chinese with English abstract)
[12] Nand C S, Tudu B, Koley C. Machine vision based techniques for automatic mango fruit sorting and grading based on maturity level and size[M]. Springer International publishing, 2014.
[13] Saad F S A, Ibrahim M F, Shakaff A Y Md, et al. Shape and weight grading of mangoes using visible imaging[J]. Computers and Electronics in Agriculture, 2015, 5(6): 51-56.
[14] Mohd I, Ahmad Sa’ad Fathinut, Ammar Z. In-line sorting of harumanis mango based on external quality using visible imaging [J]. Sensors, 2016, 16(11): 1753. doi:10.3390/S161-11-753.
[15] 孫樹亮. 基于計算機視覺的芒果分類[D]. 南寧:廣西大學,2006.Sun Shuliang. Mango Classification Based on Computer Vision [D]. Nanning: Guangxi University, 2006. (in Chinese with English abstract)
[16] 李國進,董第永,陳雙. 基于計算機視覺的芒果檢測與的分級研究[J]. 農機化研究,2015,10(10):13-18,23. Li Guojin, Dong Diyong, Chen Shuang. Research on mango detection and classification by computer vision[J]. Agricultural Mechanization Research, 2015, 10(10): 13-18,23. (in Chinese with English abstract)
[17] 熊俊濤,劉振,湯林越,等. 自然環境下綠色柑橘視覺檢測技術研究[J]. 農業機械學報,2018,49(4):45-52. Xiong Juntao, Liu Zhen, Tang Linyue, et al. Visual detection technology of green citrus under natural environment[J]. Transactions of the Chinese Society for Agricultural Machinery, 2018, 49(4): 45-52. (in Chinese with English abstract)
[18] 鄭一力,張露. 基于遷移學習的卷積神經網絡植物葉片圖像識別方法[J]. 農業機械學報,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)
[19] 龍滿生,歐陽春娟,劉歡,等. 基于卷積神經網絡與遷移學習的油茶病害圖像識別[J]. 農業工程學報,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]. Transac-tions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(18): 194-201. (in Chinese with English abstract)
[20] 馬浚誠,杜克明,鄭飛翔,等. 基于卷積神經網絡的溫室黃瓜病害識別系統[J]. 農業工程學報,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)
[21] 周云成,許童羽,鄭偉,等. 基于深度卷積神經網絡的番茄主要器官分類識別方法[J]. 農業工程學報,2017,33(15):219-226.Zhou Yuncheng, Xu Tongyu, Zheng Wei, et al. Classification and recognition approaches of tomato main organs based on DCNN[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(15): 219-226. (in Chinese with English abstract)
[22] NY/T492-2002,中華人民共和國農業行業標準-芒果[S].北京:中國標準出版社,2002.
[23] NY/T3011-2016,中華人民共和國農業行業標準-芒果等級規格[S]. 北京:中國標準出版社,2016.
[24] 楊志偉,覃倢,李秋庭. 計算機視覺在芒果品質評價中的應用[J]. 食品科技,2009,34(7):232-236. Yang Zhiwei, Qin Jie, Li Qiuting. Application of computer vision in the quality evaluation for mango[J].Food Science and Technology, 2009, 34(7): 232-236. (in Chinese with English abstract)
[25] 盛驟,謝式千,潘承毅,等. 概率論與數理統計(第四版)[M]. 北京:高等教育出版社,2001.
[26] 姬偉,李俊樂,楊俊,等. 機器手采摘蘋果抓取損傷機理有限元分析及驗證[J]. 農業工程學報,2015,31(5):17-22. Ji Wei, Li Junle, Yang Jun, et al. Analysis and validation for mechanical damage of apple by gripper in harvesting robot based on finite element method[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(5): 17-22. (in Chinese with English abstract)
[27] 周祖鍔. 農業物料學[M]. 北京:農業出版社,1994.
[28] 邱宣懷. 機械設計[M]. 北京:高等教育出版社,1997.
[29] 李彥冬,郝宗波,雷航. 卷積神經網絡研究綜述[J].計算機應用,2016,36(9):2508-2515,2565. Li Yandong, Hao Zongbo, Lei Hang. Survey of convolutional neural network[J]. Journal of Computer Applications, 2016, 36(9): 2508-2515,2565. (in Chinese with English abstract)
[30] Zhong Zhuoyao,Jin Lianwen,Xie Zecheng.High perfor-mance offline handwritten Chinese character recognition using googlenet and directional feature maps[C]//Tunisia 13th Interna-tional Conference on Document Analysis and Recognition ( ICDAR), 2015: 846-850.
[31] 謝劍斌. 視覺機器學習20講[M]. 北京:清華大學出版社,2015.
[32] Lécun Y, Bottou L, Bengio Y, et al. Gradient-based learning applied to document recognition [J]. Proceedings of the IEEE, 1998, 86(11): 2278-2324.
[33] Krizhevsky A, Sutskever I, Hinton G E. Image net classification with deep convolutional neural networks [C]//International Conference on Neural Information Processing Systems. Curran Associates Inc. 2012.
[34] Yoshio Makino, Kenjiro Goto, Seiichi Oshita, et al. A grading method for mangoes on the basis of peel color measurement using a computer vision system[J]. Agricultural Sciences. 2016, 7(6), 327-334.
[35] Chandra Sekhar Nandi. Computer vision based mango fruit grading system[C]// International Conference on Innovative Engineering Technologies (ICIET’2014, Thailand), 2014.
[36] 辛華健. 計算機視覺在芒果品質檢測中的應用研究[J]. 農機化研究,2019,41(9):190-193.Xin Huajia. Application of computer vision in mango quality testing[J]. Agricultural Mechanization Research, 2019, 41(9): 190-193. (in Chinese with English abstract)
Mango double-sided maturity online detection and classification system
Xiang Yang, Lin Jiewen, Li Yajun, Hu Zhengfang, Xiong Ying
(,410128,)
Mangoes are ripe fruits. The maturity classification of mangoes can provide convenience for mango ripening, processing, packaging and transportation. Compared with spherical fruit, mango is special shape and soft texture, and its multi-side images are difficult to acquire. Aiming at the irregular shape of mango and the difficulty of detecting the entire appearance, a mango double-sided maturity online detection and classification system based on transfer learning was proposed. The system is mainly composed of conveying device, flexible turning-over mechanism, image acquisition device, grading device and control system. According to the maturity grading standard, the mango is divided into three levels: green ripe, mature and overripe. Then, the mangoes are transported to the image acquisition area through the upper and lower conveyor belts, and image acquisition device obtain images from opposite sides. The control system combines the two-sided image of mango for maturity analysis, and the control grading device classifies mango according to the grading results. A flexible turning-over mechanism is arranged between the two conveyor belts, and the mango is clamped by two flexible belts with the same moving speed and opposite direction, which can ensure that a mango is only turned over once. The mechanical parameters of mango were measured by texture analyzer, and the maximum extrusion force of mango was 1.47-15N through ANSYS analysis. Then, the spring is adaptively adjusted to maintain the proper clamping force for the mango.The whole process of the device is carried out by the motor to drive the conveyor belt to achieve mango transportation. Conveying speed can be adjusted from 0 to 0.5m/s.The upper conveyor belt camera and the lower conveyor belt camera of the device respectively acquire the front and back images of each mango into one image, and the combined image size is 640′960pixels. The image is preprocessed, and the size of the image is scaled to 224′224pixels. At the same time, the gray value of each channel is determined in the range of-127-128. In order to acquire the mango classification results, we use the pretrained_dl_classifier_ compact.hdl model pre-trained by hdevelop. 1100 mango samples were used to test. The data were divided into training set, validation set and test set in the ratio of 8:1.5:1.5. SGD method was used to train and validate convolutional neural network. Making tuning of hyper-parameters and setting the appropriate learning rate to 0.001, batch processing to 64, momentum to 0.5. TOP1 error was used as the evaluation standard. When the number of iterations is 460, the Top1 error value of the training set is 3.6%, and the Top1 error value of the validation set is 2.0%. The training model is ideal. The trained convolution neural network model was used to classify 150 mango test sets. The average time consumed for systematic determination of single sample was 0.16 s. The average accuracy of mango maturity classification using convolution neural network model was 96.72%, Among them, the grading effect of maturity of green ripe mango was better, and its accuracy was 97.67%. The accuracy rates of mature and over-ripening were 96.00% and 96.49% respectively. This paper presents an on-line double-sided mango maturity detection and classification device based on transfer learning, and trains the model, which can provide reference for mango maturity automatic classification.
computer vision; classification; models; mango; double-sided detection; turning-over mechanism; convolutional neural network; maturity
10.11975/j.issn.1002-6819.2019.10.033
TP391.41; S24
A
1002-6819(2019)-10-0259-08
2019-01-31
2019-05-01
湖南省重點研發計劃(2017NK2131)
向 陽,博士,副教授,主要從事農業自動化及智能農業裝備研究。Email:xy1608@126.com
向 陽,林潔雯,李亞軍,胡正方,熊 瑛. 芒果雙面成熟度在線檢測分級系統[J]. 農業工程學報,2019,35(10):259-266. doi:10.11975/j.issn.1002-6819.2019.10.033 http://www.tcsae.org
Xiang Yang, Lin Jiewen, Li Yajun, Hu Zhengfang, Xiong Ying.Mango double-sided maturity online detection and classification system [J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(10): 259-266. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2019.10.033 http://www.tcsae.org