楊蜀秦,王 帥,王鵬飛,寧紀鋒,奚亞軍
改進YOLOX檢測單位面積麥穗
楊蜀秦1,2,3,王 帥1,2,3,王鵬飛1,2,3,寧紀鋒3,4,奚亞軍5
(1. 西北農(nóng)林科技大學(xué)機械與電子工程學(xué)院,楊凌 712100;2. 農(nóng)業(yè)農(nóng)村部農(nóng)業(yè)物聯(lián)網(wǎng)重點實驗室,楊凌 712100;3. 陜西省農(nóng)業(yè)信息感知與智能服務(wù)重點實驗室,楊凌 712100;4. 西北農(nóng)林科技大學(xué)信息工程學(xué)院,楊凌 712100;5. 西北農(nóng)林科技大學(xué)農(nóng)學(xué)院,楊凌 712100)
單位面積麥穗數(shù)是估算小麥產(chǎn)量的重要指標,對于作物表型參數(shù)計算、產(chǎn)量預(yù)測和大田管理都具有重要的意義。目前的研究均未以單位面積麥穗圖像為研究對象,為準確獲取單位面積麥穗數(shù),該研究提出了基于改進YOLOX的單位面積麥穗檢測方法,利用采樣框直接實現(xiàn)單位面積麥穗計數(shù)。首先,設(shè)計了一種簡單的單位面積采樣框,通過訓(xùn)練角點檢測網(wǎng)絡(luò)識別采樣框,以提取單位面積小麥區(qū)域;其次,針對麥穗檢測中存在的目標密集和相互遮擋問題,在麥穗檢測網(wǎng)絡(luò)的特征融合層,采用上下文信息進行特征重組的上采樣方法(Content-Aware ReAssembly of Features,CARAFE)代替YOLOX-m模型中的上采樣算法,同時結(jié)合迭代注意力特征融合模塊(iterative Attentional Feature Fusion,iAFF),增加對麥穗空間信息和語義信息的提取。試驗結(jié)果表明,改進的YOLOX-m模型明顯改善了對密集麥穗和遮擋麥穗的檢測效果,其精確率、召回率、平均精確度和1值分別為96.83%、91.29%、92.29%和93.97%,與SSD、CenterNet和原YOLOX-m模型相比,平均精確度分別提升了10.26、8.2和1.14個百分點。該研究方法能夠直接對復(fù)雜大田場景下的單位面積麥穗進行準確檢測和計數(shù),為實際生產(chǎn)小麥產(chǎn)量預(yù)測中的麥穗智能化計數(shù)提供了一種方法參考。
模型;目標檢測;深度學(xué)習(xí);單位面積;麥穗
小麥產(chǎn)量關(guān)系到國家的糧食安全[1-2]。產(chǎn)量預(yù)測為農(nóng)業(yè)生產(chǎn)管理決策提供參考[3-4],為政府在農(nóng)村土地政策、糧食價格等方面的宏觀調(diào)控提供支撐[5-6]。田間測產(chǎn)時,小麥產(chǎn)量主要與單位面積麥穗數(shù)、千粒質(zhì)量和穗粒數(shù)[7]有關(guān)。其中,單位面積麥穗數(shù)是最重要的指標,直接反映小麥的生長狀況和品質(zhì)好壞[8-9]。
傳統(tǒng)的單位面積麥穗檢測計數(shù)主要依靠人工計數(shù)和傳統(tǒng)圖像處理的方法。人工計數(shù)方法繁瑣,對人力物力消耗較大且主觀性較強[10]。傳統(tǒng)圖像處理方法首先從RGB圖像中人工提取麥穗的形狀、紋理和顏色等特征,之后通過分類器進行模型構(gòu)建,實現(xiàn)對麥穗的自動識別計數(shù)[11]。李毅念等[12]將RGB轉(zhuǎn)換到HSI,提取色彩飽和度特征后,再利用基于凹點檢測匹配連線的方法實現(xiàn)粘連麥穗的分割,計算麥穗數(shù)量;Fernandez-Gallego等[13]利用濾波和尋找最大值的方法來檢測田間麥穗圖像中的麥穗數(shù),其識別精度達到90%。劉哲等[14]以顏色特征聚類為基礎(chǔ)改進k均值聚類算法,將聚類區(qū)域內(nèi)的子區(qū)域數(shù)作為麥穗數(shù)估計值,計數(shù)精度達到94.69%。以上方法由于人工提取特征需要依靠大量經(jīng)驗,對復(fù)雜大田場景下的光照、土壤等條件魯棒性表現(xiàn)不足[15-17],且均未以單位面積麥穗圖像為研究對象,故無法獲得泛化模型和直接實現(xiàn)單位面積麥穗計數(shù),檢測準確率仍有待提升。
近年來,隨著作物表型組學(xué)研究的快速發(fā)展,通過結(jié)合深度學(xué)習(xí)對單位面積麥穗檢測計數(shù)的研究也有了較大的進展[18-20]。深度學(xué)習(xí)從數(shù)據(jù)集中自動學(xué)習(xí)特征代替了傳統(tǒng)的人工提取特征。Lu等[21]提出深度卷積神經(jīng)網(wǎng)絡(luò)TasselNet建立麥穗計數(shù)回歸模型。Hasan等[22]使用相同的R-CNN結(jié)構(gòu)在4個不同生長階段捕獲的不同數(shù)據(jù)集上生成4個不同的模型,研究不同生長階段的麥穗計數(shù)。鮑文霞等[23]采集數(shù)據(jù)時制作40 cm×50 cm的紙盒,用以固定0.2 m2范圍內(nèi)的小麥,同時引入CSRNet網(wǎng)絡(luò)構(gòu)建麥穗密度圖估計模型,實現(xiàn)對復(fù)雜擁擠場景下的麥穗計數(shù)。章權(quán)兵等[24]采集數(shù)據(jù)時使用長寬高分別為0.5、0.5、1.2 m的硬紙板圍成一個長方體框,將目標區(qū)域與外界小麥隔離開,并在Faster R-CNN[25]中引入注意力機制和加權(quán)區(qū)域建議網(wǎng)絡(luò)對麥穗進行檢測。文獻[23]和文獻[24]為便于圖像獲取,采集時使用硬紙板圍成一個小面積長方體框,將目標區(qū)域與外界小麥隔離開,但均未利用固定面積計算單位面積麥穗數(shù),不能直接實現(xiàn)麥穗的實際測產(chǎn)計數(shù)。文獻[1]針對單位面積育種小區(qū)實現(xiàn)麥穗計數(shù),但不適用于大面積農(nóng)田場景下的測產(chǎn)。
綜上所述,前人針對大面積農(nóng)田場景下單位面積麥穗圖像的研究較少,且在復(fù)雜條件下,密集麥穗和遮擋麥穗仍存在識別精度低等問題。因此,本研究以智能手機拍攝含采樣框的小麥冠層圖像為研究對象,構(gòu)建一種基于改進YOLOX的單位面積麥穗檢測方法。采樣框角點特征明顯,因此利用模型深度和特征圖寬度較小的YOLOX-s訓(xùn)練采樣框角點檢測網(wǎng)絡(luò),獲取單位面積區(qū)域。改進深度和特征圖寬度進一步加深和加寬的YOLOX-m模型,在特征提取層采用上下文信息進行特征重組的上采樣方法(Content-Aware ReAssembly of Features,CARAFE)和迭代注意力特征融合模塊,有效減少了麥穗漏檢情況,提高密集麥穗和遮擋麥穗的檢測精度。最后,將其與SSD[26]、CenterNet[27]和原YOLOX-m模型進行對比,驗證了本文方法的有效性。
本文試驗區(qū)域位于陜西省楊凌農(nóng)業(yè)高新技術(shù)產(chǎn)業(yè)示范區(qū)(簡稱楊凌區(qū))曹新莊試驗基地,地理坐標介于東經(jīng)107°59′~108°08′,北緯34°14′~34°20′之間,如圖1所示,楊凌區(qū)平均海拔530 m,屬東亞暖溫帶半濕潤半干旱氣候區(qū)。試驗區(qū)域長約175 m,寬約98 m,面積約17 150 m2,種植的冬小麥為一年一熟制,試驗田為小麥育種區(qū),種植多種不同品種的小麥。
圖1 試驗區(qū)域圖
為了實現(xiàn)在自然環(huán)境下直接對單位面積麥穗進行檢測計數(shù),使用兩組數(shù)據(jù)集進行了訓(xùn)練和測試,一組是實地拍攝的不含采樣框的麥穗圖像,一組是含1 m×1 m采樣框的麥穗圖像。圖像數(shù)據(jù)是通過華為智能手機(honor V20)在小麥試驗田中收集,將智能手機固定在自拍桿上,藍牙控制手機后置攝像頭朝向下方采集圖像,試驗者手持自拍桿,保持在距離小麥冠層上方0.9~1.1 m處拍攝。數(shù)據(jù)采集時間為2021年5月21日-2022年6月3日,在晴、陰和多云3種天氣狀況下,分別對灌漿期和成熟期小麥圖像進行采集。共采集不含采樣框的麥穗圖像600張(圖像分辨率為4 000像素×3 000像素),原始圖像隨機裁剪為3 072張800像素×800像素的麥穗圖像。另外采用鏡像和旋轉(zhuǎn)對數(shù)據(jù)集進行增強,將訓(xùn)練集的圖像數(shù)據(jù)從3 072張擴增至9 216張。含采樣框的麥穗圖像共218張(圖像分辨率為4 000像素×3 000像素),2021年采集121張,2022年采集97張,采樣框內(nèi)包含350~520個目標小麥穗,如圖2所示。
注:矩形框為單位面積采樣框。
結(jié)合地面調(diào)查,采用開源標注軟件LabelImg對采樣框內(nèi)角點和麥穗進行人工標注,標注數(shù)據(jù)集以PASCAL VOC[28]數(shù)據(jù)集的格式存儲,包括:圖像尺寸(長寬以及通道數(shù))、檢測物體類別、檢測框坐標(對應(yīng)圖像中、軸坐標值)等。
采樣框角點的標注,以采樣框內(nèi)角點為中心點標注矩形框,用于訓(xùn)練采樣框角點檢測網(wǎng)絡(luò)。麥穗的標注分為含采樣框和不含采樣框的麥穗圖像標注,用矩形框標注不含采樣框的麥穗圖像中所有麥穗目標。對于含采樣框的麥穗圖像,只標注采樣框內(nèi)的麥穗,用于對單位面積麥穗檢測模型的評估。
YOLO[29-32]系列是目標檢測算法的代表性工作,其中的YOLO V3[32]在不同領(lǐng)域得到了廣泛的應(yīng)用。以YOLO V3-SPP作為基礎(chǔ),結(jié)合耦合檢測頭、Mosaic和MixUp數(shù)據(jù)增強策略、無錨框機制(Anchor-free)的YOLOX目標檢測模型,具有檢測精確度高和部署靈活的優(yōu)點[33]。
單位面積麥穗的計數(shù),需同時考慮檢測單位面積采樣框和麥穗數(shù)量兩個問題,即算法只需統(tǒng)計在單位面積框內(nèi)的小麥麥穗數(shù)量。因此,本文提出一個基于改進YOLOX的單位面積麥穗檢測方法。YOLOX-s是YOLOX系列中模型深度和特征圖寬度較小的網(wǎng)絡(luò),YOLOX-m是在其基礎(chǔ)上進行了加深和加寬。由于采樣框角點特征明顯,因此利用YOLOX-s模型訓(xùn)練采樣框角點檢測網(wǎng)絡(luò),實現(xiàn)對采樣區(qū)域的準確提取。同時,利用改進的YOLOX-m模型訓(xùn)練麥穗檢測網(wǎng)絡(luò),實現(xiàn)對麥穗的精準檢測。最后,基于提取的采樣區(qū)域,統(tǒng)計位于單位面積框內(nèi)部的麥穗,實現(xiàn)對單位面積麥穗檢測的目的。
2.1.1 基于YOLOX-s的采樣框角點檢測網(wǎng)絡(luò)
為了獲取單位面積麥穗數(shù),需要對采樣框進行檢測。傳統(tǒng)的基于顏色閾值的分割方法和角點檢測方法魯棒性不足,光照條件、天氣和地塊等因素都會影響模型的檢測效果,不適應(yīng)于復(fù)雜大田場景下采樣框的檢測。因此,針對采樣框角點目標小、數(shù)量少且沒有明顯邊界等問題,本文利用YOLOX-s模型,訓(xùn)練單位面積采樣框角點檢測網(wǎng)絡(luò),利用檢測到的采樣框的4個內(nèi)角點,連接4個角點形成采樣框的內(nèi)部區(qū)域,僅裁取位于采樣框區(qū)域內(nèi)部的麥穗,以實現(xiàn)單位面積麥穗檢測計數(shù)的目的。
2.1.2 基于改進YOLOX-m的麥穗檢測網(wǎng)絡(luò)
YOLOX-m模型中的最鄰近插值上采樣難以利用麥穗特征圖的語義信息且感知域較小,特征融合模塊僅是對特征圖的簡單拼接。因此,本文通過對YOLOX-m模型的上采樣和特征融合模塊進行改進,以提高密集麥穗和遮擋麥穗檢測精度。改進的YOLOX-m模型的主干分為Input、Backbone、Neck和Prediction 4個部分,每個框表示一個部分。在特征融合網(wǎng)絡(luò)中,首先采用特征圖上采樣(CARAFE)方法代替模型原始的上采樣方法,利用特征重組模塊完成上采樣,以保留更多麥穗細節(jié);其次,添加迭代注意力特征融合模塊(iAFF),增強對麥穗語義信息的提取。網(wǎng)絡(luò)結(jié)構(gòu)圖如圖3所示。
注:Focus為切片操作,CBS為CONV+BN+SiLU,CONV為卷積操作,BN為歸一化操作,SiLU為激活函數(shù),SPP為空間金字塔池化結(jié)構(gòu),CARAFE為特征圖上采樣操作,Concat為特征融合函數(shù),iAFF為迭代注意力特征融合模塊,slice為切片后的特征圖。
1)CARAFE特征圖上采樣
Wang等[34]在2019年提出了CARAFE上采樣算法,其主要分為上采樣預(yù)測模塊和特征重組模塊兩個模塊。在上采樣預(yù)測模塊中,先利用輸入的特征圖預(yù)測上采樣核,在特征重組模塊中基于上采樣核進行特征重組。與以前的上采樣方法相比,CARAFE可以在更大的感知鄰域內(nèi)聚合麥穗的上下文信息。每個位置都有相對應(yīng)的不同上采樣核,且僅帶來很小的參數(shù)量。本研究針對麥穗密集問題,在YOLOX-m算法網(wǎng)絡(luò)中的特征融合層使用CARAFE上采樣方式,更好地聚合了麥穗目標上下文信息,以有效提升對密集麥穗的檢測精度。
2)iAFF迭代注意力特征融合
特征融合是來自不同層或分支的特征組合,一般通過求和或拼接來實現(xiàn),但是均不能對麥穗特征達到最佳的融合效果。Dai等[35]提出了注意力特征融合,為了更好地融合語義和尺度不一致的特征,提出了多尺度通道注意力模塊,闡明了特征圖的初始集成可能會成為瓶頸,并且可以通過添加迭代注意力特征融合來緩解此問題。
注意力特征融合模塊(Attentional Feature Fusion,AFF)主要針對不同網(wǎng)絡(luò)結(jié)構(gòu)中,不同尺度特征融合時的注意力問題。iAFF針對初始特征集成對于注意力特征融合影響比較大的問題,使用額外一層AFF生成更好的初始特征。本研究針對麥穗相互遮擋的問題,在YOLOX-m算法網(wǎng)絡(luò)中下采樣后的特征融合層使用iAFF,使用了注意力進行特征融合以增加對麥穗空間信息和語義信息的提取,有效提升網(wǎng)絡(luò)對遮擋麥穗的檢測性能。
試驗環(huán)境操作系統(tǒng)為Ubuntu 16.04,深度學(xué)習(xí)框架為Pytorch 1.4,顯卡為NVIDIA Tesla P100,顯存16GB?;诟倪MYOLOX的單位面積麥穗檢測模型訓(xùn)練分為兩部分。第一部分為訓(xùn)練采樣框角點檢測網(wǎng)絡(luò),將2021年采集的121張包含采樣框的麥穗圖像,按8∶1∶1隨機劃分訓(xùn)練集、驗證集和測試集,模型訓(xùn)練50個周期,采用Adam優(yōu)化器。第二部分為訓(xùn)練麥穗檢測網(wǎng)絡(luò),9 216張800像素×800像素的麥穗圖像,按9∶1隨機劃分訓(xùn)練集和驗證集,121張包含采樣框的麥穗圖像作為測試集,模型訓(xùn)練100個周期,采用Adam優(yōu)化器。前50個周期凍結(jié)骨干網(wǎng)絡(luò)參數(shù),只訓(xùn)練模型分類器參數(shù),初始學(xué)習(xí)率為1×10-3,批處理尺寸為8,權(quán)重衰減為5×10-4;后50個周期解凍骨干網(wǎng)絡(luò)參數(shù),初始學(xué)習(xí)率為1×10-4,批處理尺寸為8,權(quán)重衰減為5×10-4,共迭代850 500次。
本研究采用精確率(Precision,)、召回率(Recall,)、平均精確度(Average Precision,AP)、1分數(shù)、交并比(Intersection over Union,IoU)和平均幀率(Frame per Second,F(xiàn)PS)來評估模型的性能。召回率被定義為所有正樣本被正確檢出的比例;精確率是預(yù)測結(jié)果中正確的比例;平均精確度和1分數(shù)綜合考慮精確率和召回率兩個指標;IoU用于測量真實框與檢測框之間的重疊度,重疊度越高該值越大,相關(guān)度越高;本研究對單位面積小麥麥穗進行檢測,選擇IoU大于50%作為判斷是否正確識別麥穗的閾值。在上述評價指標中,模型性能參數(shù)的重要性依次為平均精確度、召回率、精確率、1分數(shù)和平均幀率。
為了評估模型的計數(shù)性能,采用決定系數(shù)(2)和均方根誤差(Root Mean Square Error,RMSE)評價指標。2表示趨勢線擬合程度,它的數(shù)值大小可以反映麥穗計數(shù)的估計值與對應(yīng)的實際人工計數(shù)之間的擬合程度,數(shù)值越接近1,擬合程度越高,趨勢線的可靠性就越高;RMSE為預(yù)測值與真實值的偏差,表示算法的準確性,RMSE越小,算法準確度越高。
采用SSD、CenterNet和YOLOX-s模型進行采樣框內(nèi)角點的檢測,并對不同模型進行對比,檢測結(jié)果如表1所示,由于采樣框角點顏色特征明顯,YOLOX-s模型精確率、召回率、平均準確度和1分數(shù)都能達到100%,F(xiàn)PS為20幀/s,各項評價指標均高于SSD和CenterNet模型,能夠快速精確地對采樣框的內(nèi)角點進行檢測。
表1 不同模型對采樣框內(nèi)角點檢測試驗結(jié)果
注:為精確率;為召回率;AP為平均精確度;1為1分數(shù);FPS為平均幀率。下同。
Note:isprecision;is recall;AP is average precision;1 is1score; FPS is frame per second. Same below.
用9 216張不含采樣框的麥穗圖像分別在SSD、CenterNet和原始YOLOX模型的m、l和x版本以及基于YOLOX-m的改進模型進行同批次的訓(xùn)練。結(jié)合YOLOX-s模型對采樣框內(nèi)角點的檢測,對比不同模型對單位面積麥穗檢測效果,檢測結(jié)果如表2所示。
表2 不同模型對單位面積麥穗檢測試驗結(jié)果
綜合對比不同模型性能,由表2可以看出,改進的YOLOX-m模型在單位面積麥穗檢測上的效果優(yōu)于其他模型。本文使用CARAFE上采樣方式和iAFF特征融合方式的YOLOX-m模型,相較于原始YOLOX-m模型,雖然精確率稍有下降,但AP值提升了1.14個百分點;與SSD和CenterNet模型相比,雖然檢測效率下降,但AP值分別提升了10.26個百分點和8.2個百分點。總的來說,在特征融合網(wǎng)絡(luò)中改變上采樣方式和特征融合方式能夠有效提升單位面積麥穗檢測的精確度,從而驗證了本文提出方法的有效性和可行性。
圖4為檢測結(jié)果的部分細節(jié)展示圖。其中,CenterNet檢測結(jié)果最差,正確檢測40個,漏檢14個;SSD正確檢測42個,漏檢12個;YOLOX-m模型正確檢測50個,漏檢4個;改進后模型正確檢測53個,漏檢1個。
注:綠色框和紅色框分別代表正確檢測和漏檢。
本文進行消融試驗以驗證模塊混合使用對于模型性能的影響。結(jié)合YOLOX-s模型對采樣框內(nèi)角點的檢測,以含單位面積采樣框的圖像為測試集,驗證不同改進模型的有效性。表3列出了改進的YOLOX-m模型中各個部分的試驗結(jié)果。
表3 改進的YOLOX-m算法麥穗檢測消融試驗
以原始YOLOX-m為基礎(chǔ),只在特征融合層中用CARAFE算法代替原上采樣,AP值提升了0.75個百分點;只在特征融合層引入iAFF在AP值上提升0.46個百分點;綜合各項評價指標,將這兩種改進結(jié)合起來的YOLOX-m模型,雖然檢測效率稍有下降,但AP值提升了1.14個百分點,1值提升了0.46個百分點,驗證了本文方案的可行性。
將2022年采集的97張含采樣框的麥穗圖像進行單位面積麥穗檢測計數(shù),并與人工計數(shù)真實值進行比較,來驗證本文方法的泛化性能,結(jié)果如圖5所示。
圖5 麥穗預(yù)測值與真實值的擬合結(jié)果
從圖5可以看出,2為0.91, RMSE為29.61株/m2,線性擬合線可以有效反映預(yù)測值與真實值的關(guān)系,擬合程度較高,但是所有圖像預(yù)測麥穗數(shù)量小于真實數(shù)量,這是由于嚴重遮擋情況下依然存在漏檢情況導(dǎo)致的。因此,本文提出的基于改進YOLOX的單位面積麥穗檢測方法可以準確地對包含單位面積采樣框的圖像進行麥穗計數(shù),進而實現(xiàn)精準的小麥估產(chǎn)。
1)為準確預(yù)測小麥的單位面積麥穗數(shù),本文提出一種基于改進YOLOX的單位面積麥穗檢測方法。該方法同時檢測采樣框角點和小麥麥穗,可直接估計單位面積中的小麥麥穗數(shù)。在麥穗檢測網(wǎng)絡(luò)中,采用上下文信息進行特征重組的上采樣方法和迭代注意力特征融合模塊,增強對麥穗空間信息和語義信息的提取,有效地提升了對密集麥穗和遮擋麥穗的檢測性能。
2)試驗結(jié)果表明,基于YOLOX的模型在相同的數(shù)據(jù)集條件下,在采樣框角點檢測方面和麥穗檢測方面均優(yōu)于SSD、CenterNet模型。麥穗檢測方面,改進的YOLOX-m模型平均精確度分別高于SSD、CenterNet模型10.26個百分點和8.2個百分點,平均精確度較原始YOLOX-m模型也提升了1.14個百分點,其精確率、召回率、平均精確度和1分別達96.83%、91.29%、92.29%、93.97%,改善了對密集麥穗和遮擋麥穗的檢測效果。本文方法比其他麥穗檢測計數(shù)方法準確率更高,能夠在自然環(huán)境下直接對單位面積麥穗進行檢測計數(shù),為實際生產(chǎn)小麥產(chǎn)量預(yù)測中的麥穗計數(shù)提供了一種有效的方法。
3)改進的YOLOX-m模型對于輕微遮擋和密集情況下的麥穗檢測精度有所提高,但由于麥穗目標較小,對于嚴重遮擋情況下麥穗依然存在漏檢的情況而且精確率稍有下降。在麥穗計數(shù)中,在對單位面積采樣框內(nèi)小麥檢測應(yīng)用中,存在采樣框內(nèi)小麥越界到框外、框外小麥進入采樣框內(nèi)的情況,導(dǎo)致真實小麥麥穗數(shù)和預(yù)測小麥麥穗數(shù)有偏差。針對以上問題,擬在實際測產(chǎn)中根據(jù)種植密度不同進行微調(diào),更符合實際測產(chǎn)的需要。
[1] 陳佳瑋,李慶,譚巧行,等. 結(jié)合輕量級麥穗檢測模型和離線Android軟件開發(fā)的田間小麥測產(chǎn)[J]. 農(nóng)業(yè)工程學(xué)報,2021,37(19):156-164.
Chen Jiawei, Li Qing, Tan Qiaoxing, et al. Combining lightweight wheat spikes detecting model and offline Android software development for in-field wheat yield prediction[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(19): 156-164. (in Chinese with English abstract)
[2] Liu H, Wang Z, Yu R, et al. Optimal nitrogen input for higher efficiency and lower environmental impacts of winter wheat production in China[J]. Agriculture Ecosystems & Environment, 2016, 224: 1-11.
[3] Jin X, Liu S, Baret F, et al. Estimates of plant density of wheat crops at emergence from very low altitude UAV imagery[J]. Remote Sensing of Environment, 2017, 198: 105-114.
[4] 鮑烈,王曼韜,劉江川,等. 基于卷積神經(jīng)網(wǎng)絡(luò)的小麥產(chǎn)量預(yù)估方法[J]. 浙江農(nóng)業(yè)學(xué)報,2020,32(12):2244-2252.
Bao Lie, Wang Mantao, Liu Jiangchuan, et al. Estimation method of wheat yield based on convolution neural network[J]. Acta Agriculturae Zhejiangensis, 2020, 32(12): 2244-2252. (in Chinese with English abstract)
[5] 歐文浩,蘇偉,薛文振,等. 基于HJ-1衛(wèi)星影像的三大農(nóng)作物估產(chǎn)最佳時相選擇[J]. 農(nóng)業(yè)工程學(xué)報,2010,26(11):176-182.
Ou Wenhao, Su Wei, Xue Wenzhen, et al. Selection of optimum phase for yield estimation of three major crops based on HJ-1 satellite images[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2010, 26(11): 176-182. (in Chinese with English abstract)
[6] 郝王麗,尉培巖,韓猛,等. 基于YOLOv3網(wǎng)絡(luò)的小麥麥穗檢測及計數(shù)[J]. 湖北農(nóng)業(yè)科學(xué),2021,60(2):158-160.
Hao Wangli, Wei Peiyan, Han Meng, et al. Detection and counting of wheat ears based on YOLOv3 network[J]. Hubei Agricultural Sciences, 2021, 60(2): 158-160. (in Chinese with English abstract)
[7] Ghahremani M, Ghassemian H. Remote-sensing image fusion based on curvelets and ICA[J]. International Journal of Remote Sensing, 2015, 36(16): 4131-4143.
[8] 謝元澄,何超,于增源,等. 復(fù)雜大田場景中麥穗檢測級聯(lián)網(wǎng)絡(luò)優(yōu)化方法[J]. 農(nóng)業(yè)機械學(xué)報,2020,51(12):212-219.
Xie Yuancheng, He Chao, Yu Zengyuan, et al. Optimization method for cascade network of wheat ear detection in complex filed scene[J]. Transactions of the Chinese Society for Agricultural Machinery, 2020, 51(12): 212-219. (in Chinese with English abstract)
[9] 劉航,劉濤,李世娟,等. 基于深度殘差網(wǎng)絡(luò)的麥穗回歸計數(shù)方法[J]. 中國農(nóng)業(yè)大學(xué)學(xué)報,2021,26(6):170-179.
Liu Hang, Liu Tao, Li Shijuan, et al. Research on wheat ear regression counting based on deep residual network[J]. Journal of China Agricultural University, 2021, 26(6): 170-179. (in Chinese with English abstract)
[10] Xiong H, Cao Z, Lu H, et al. TasselNetv2: In-field counting of wheat spikes with context-augmented local regression networks[J]. Plant Methods, 2019, 15(2): 150.
[11] 趙鋒,王克儉,苑迎春. 基于顏色特征和AdaBoost算法的麥穗識別的研究[J]. 作物雜志,2014(1):141-144,161.
Zhao Feng, Wang Kejian, Yuan Yingchun. Study on wheat spike identification based on color features and AdaBoost algorithm[J]. Crops, 2014(1): 141-144, 161. (in Chinese with English abstract)
[12] 李毅念,杜世偉,姚敏,等. 基于小麥群體圖像的田間麥穗計數(shù)及產(chǎn)量預(yù)測方法[J]. 農(nóng)業(yè)工程學(xué)報,2018,34(21):185-194.
Li Yinian, Du Shiwei, Yao Min, et al. Method for wheatear counting and yield predicting based on image of wheatear population in field[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(21): 185-194. (in Chinese with English abstract)
[13] Fernandez-Gallego J A, Kefauver S C, Gutiérrez N, et al. Wheat ear counting in-field conditions: High throughput and low-cost approach using RGB images[J]. Plant Methods, 2018, 14(1): 22.
[14] 劉哲,黃文準,王利平. 基于改進K-means聚類算法的大田麥穗自動計數(shù)[J]. 農(nóng)業(yè)工程學(xué)報,2019,35(3):174-181.
Liu Zhe, Huang Wenzhun, Wang Liping. Field wheat ear counting automatically based on improved K-means clustering algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(3): 174-181. (in Chinese with English abstract)
[15] 劉濤,孫成明,王力堅,等. 基于圖像處理技術(shù)的大田麥穗計數(shù)[J]. 農(nóng)業(yè)機械學(xué)報,2014,45(2):282-290.
Liu Tao, Sun Chengming, Wang Lijian, et al. In-field wheatear counting based on image processing technology[J]. Transactions of the Chinese Society for Agricultural Machinery, 2014, 45(2): 282-290. (in Chinese with English abstract)
[16] 劉東,曹光喬,李亦白,等. 基于顏色特征的小麥抽穗揚花期麥穗識別計數(shù)[J]. 中國農(nóng)機化學(xué)報,2021,42(11):97-102.
Liu Dong, Cao Guangqiao, Li Yibai, et al. Recognition and counting of wheat ears at flowering stage of heading poplar based on color features[J]. Journal of Chinese Agricultural Mechanization, 2021, 42(11): 97-102. (in Chinese with English abstract)
[17] 孫俊,楊鍇鋒,羅元秋,等. 基于無人機圖像的多尺度感知麥穗計數(shù)方法[J]. 農(nóng)業(yè)工程學(xué)報,2021,37(23):136-144.
Sun Jun, Yang Kaifeng, Luo Yuanqiu, et al. Method for the multiscale perceptual counting of wheat ears based on UAV images[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(23): 136-144. (in Chinese with English abstract)
[18] 王宇歌,張涌,黃林雄,等. 基于卷積神經(jīng)網(wǎng)絡(luò)的麥穗目標檢測算法研究[J]. 軟件工程,2021,24(8):6-10.
Wang Yuge, Zhang Yong, Huang Linxiong, et al. Research of wheat ear target detection based on convolutional neural network[J]. Software Engineering, 2021, 24(8): 6-10. (in Chinese with English abstract)
[19] 魏超宇,韓文,劉輝軍. 基于深度學(xué)習(xí)的溫室大棚小番茄果實計數(shù)方法[J]. 中國計量大學(xué)學(xué)報,2021,32(1): 93-100.
Wei Chaoyu, Han Wen, Liu Huijun. Counting method of small tomato fruit in greenhouse based on deep learning[J]. Journal of China University of Metrology, 2021, 32(1): 93-100. (in Chinese with English abstract)
[20] Mohanty S P, Hughes D P, Salathe M. Using deep learning for image-based plant disease detection[J]. Frontiers in Plant Science, 2016, 7: 1419.
[21] Lu H, Cao Z, Xiao Y, et al. TasselNet: Counting maize tassels in the wild via local counts regression network[J]. Plant Methods, 2017, 13(1): 1-17.
[22] Hasan M M, Chopin J P, Laga H, et al. Detection and analysis of wheat spikes using convolutional neural networks[J]. Plant Methods, 2018, 14(1): 100.
[23] 鮑文霞,張鑫,胡根生,等. 基于深度卷積神經(jīng)網(wǎng)絡(luò)的田間麥穗密度估計及計數(shù)[J]. 農(nóng)業(yè)工程學(xué)報,2020,36(21),186-193.
Bao Wenxia, Zhang Xin, Hu Gensheng, et al. Estimation and counting of wheat ears density in field based on deep convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(21): 186-193. (in Chinese with English abstract)
[24] 章權(quán)兵,胡姍姍,舒文燦,等. 基于注意力機制金字塔網(wǎng)絡(luò)的麥穗檢測方法[J]. 農(nóng)業(yè)機械學(xué)報,2021,52(11):253-262.
Zhang Quanbing, Hu Shanshan, Shu Wencan, et al. Wheat spikes detection method based on pyramidal network of attention mechanism[J]. Transactions of the Chinese Society for Agricultural Machinery, 2021, 52(11): 253-262. (in Chinese with English abstract)
[25] Ren S, He K, Girshick R, et al. Faster R-CNN: Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149.
[26] Liu W, Anguelov D, Erhan D, et al. SSD: Single shot multiBox detector[C]// European Conference on Computer Vision.Amsterdam, the Netherlands: Springer: 2016: 21-37.
[27] Zhou X, Wang D, Krhenbühl P. Objects as points[EB/OL]. arXiv preprint arXiv: 1904.07850v2, 2019. (2022-03-10). https://arxiv.org/abs/1904.07850.
[28] Everingham M, Eslami S, Gool L V, et al. The pascal visual object classes challenge: A retrospective[J]. International Journal of Computer Vision, 2015, 111: 98-136.
[29] Bochkovskiy A, Wang C Y, Liao H Y M. YOLOv4: Optimal speed and accuracy of object detection[EB/OL]. arXiv preprint arXiv: 2004.10934,2020. (2022-03-10). https://arxiv.org/abs/2004.10934.
[30] Redmon J, Divvala S, Girshick R, et al. You only look once: Unified, real-time object detection[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE, 2016: 779-788.
[31] Redmon J, Farhadi A. YOLO9000: Better, faster, stronger[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, HI, USA: IEEE, 2017: 6517-6525.
[32] Redmon J, Farhadi A. Yolov3: An incremental improvement[EB/OL]. arXiv preprint arXiv: 1804.02767, 2018. (2022-03-10). https://arxiv.org/abs/1804.02767v1.
[33] 陳民,吳觀茂. 基于改進YOLOX的交通標志檢測與識別[J]. 現(xiàn)代信息科技,2022,6(2):101-103,106.
Chen Min, Wu Guanmao. Traffic sign detection and recognition based on improved YOLOX[J]. Modern Information Technology, 2022, 6(2): 101-103,106. (in Chinese with English abstract)
[34] Wang J, Chen K, Xu R, et al. CARAFE: Content-Aware ReAssembly of Features[C]// International Conference on Computer Vision. Seoul, Korea (South): IEEE, 2019: 3007-3016.
[35] Dai Y, Gieseke F, Oehmcke S, et al. Attentional feature fusion[EB/OL]. arXiv preprint arXiv: 2009.14082v2, 2020. (2022-03-10). https://arxiv.org/abs/2009.14082.
Detecting wheat ears per unit area using an improved YOLOX
Yang Shuqin1,2,3, Wang Shuai1,2,3, Wang Pengfei1,2,3, Ning Jifeng3,4, Xi Yajun5
(1.712100,; 2.712100,; 3.712100,; 4.712100,;5.712100)
Wheat production is closely related to the food security in world. The yield forecast of wheat can provide a strong reference for the agricultural production and management, particularly for the decision-making on the rural land policy and grain market. Among them, the number of wheat ears per unit area is one of the most important indicators to estimate the wheat yield, including the crop phenotypic parameters, yield prediction, and field management. However, the traditional image processing and manual counting of wheat ears cannot fully meet the large-scale production in recent years. Particularly, the manual counting is cumbersome, labor-intensive, and highly subjective. It is a high demand to improve the detection accuracy of the traditional image processing. A generalized model is also required for a lot of experience, the robustness to lighting, and sufficient soil conditions in complex scenes. Much effort has been made to combine the deep learning for the detection and counting of the wheat ears per unit area, particularly with the rapid development of crop phenotype research. It is still lacking on the recognition accuracy of dense and occluded wheat ears under complex conditions. Taking the image of wheat ears per unit area as the research object, this study aims to accurately obtain the number of wheat ears per unit area using the improved YOLOX. Firstly, a simple sampling frame was designed to directly realize the counting of wheat ears per unit area. The corner detection network was trained to identify the sampling frame, further to extract the unit area of wheat. The Content-Aware ReAssembly of Features (CARAFE) map was used in the feature fusion layer of the wheat ear detection network. Secondly, the sampling was replaced with the up-sampling in the YOLOX-m model. The iterative attention feature fusion module was also used to increase the extraction of spatial information and semantic information of wheat ears. Thirdly, the wheat canopy images captured by the smartphone were taken as the research object. The images were selected at the wheat grain filling and mature stages under three weather conditions of clear, overcast, and cloudy. A total of 600 images of wheat ears without the sampling frame (image resolution of 4 000 × 3 000 pixels) were collected, where the original images were randomly cropped into the 3 072 images of wheat ears of 800 × 800 pixels. Fourthly, the dataset was augmented after the mirroring and rotation operation, where the image data of the training set was expanded from 3 072 to 9 216 images. There were 218 wheat ears images with the sampling frame (image resolution was 4 000 × 3 000 pixels). Among them, the sampling frame was contained 350-520 target wheat ears. Finally, the performance of the model was evaluated using the precision, recall, Average Precision (AP),1 score, Frame per Second (FPS), determination coefficient(2) and Root Mean Square Error (RMSE). The experimental results show that the improved YOLOX-m model was significantly improved the detection performance of dense and occluded wheat ears. Specifically, the AP value was improved by 10.26, 8.2 and 1.14 percentage points, respectively, compared with the SSD, CenterNet, and original YOLOX-m model. Consequently, the wheat ears per unit area were accurately detected and counted in the natural environment. The finding can provide a strong reference for the intelligent counting of wheat ears in the actual production of wheat yield prediction.
models; target detection; deep learning; unit area; wheat ear
10.11975/j.issn.1002-6819.2022.15.015
TP391.41
A
1002-6819(2022)-15-0143-07
楊蜀秦,王帥,王鵬飛,等. 改進YOLOX檢測單位面積麥穗[J]. 農(nóng)業(yè)工程學(xué)報,2022,38(15):143-149.doi:10.11975/j.issn.1002-6819.2022.15.015 http://www.tcsae.org
Yang Shuqin, Wang Shuai, Wang Pengfei, et al. Detecting wheat ears per unit area using an improved YOLOX[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2022, 38(15): 143-149. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2022.15.015 http://www.tcsae.org
2022-04-30
2022-06-30
陜西省自然科學(xué)基礎(chǔ)研究計劃項目(2022JM-128)
楊蜀秦,博士,副教授,研究方向為計算機視覺在農(nóng)業(yè)信息領(lǐng)域中的應(yīng)用。Email:yangshuqin1978@163.com