Improved two-stage deep learning algorithm and lightweight YOLOv5n for classifying cottonseed damage

IF 7.7 1区 农林科学 Q1 AGRICULTURE, MULTIDISCIPLINARY
Weilong He , Fan Wu , Lori Unruh Snyder , Jean Cheng , Evelynn Wilcox , Lirong Xiang
{"title":"Improved two-stage deep learning algorithm and lightweight YOLOv5n for classifying cottonseed damage","authors":"Weilong He ,&nbsp;Fan Wu ,&nbsp;Lori Unruh Snyder ,&nbsp;Jean Cheng ,&nbsp;Evelynn Wilcox ,&nbsp;Lirong Xiang","doi":"10.1016/j.compag.2025.110042","DOIUrl":null,"url":null,"abstract":"<div><div>With a rich historical background, the US cotton industry consistently maintains its position as one of the leading global producers. Due to the direct correlation between cottonseed quality and germination rate, conducting non-destructive testing to identify defects in cottonseeds becomes important to optimize yield performance. In this study, we propose an objective method for detecting cottonseed defects which classifies cottonseeds into four categories (Normal, Pinhole, Damage, and Very Damaged) and fourteen subcategories (N, R, C, RH, EH, CH, R Cut, C Cut, RV, CV, RH Expose, EH Expose, CH Expose, and V). Leveraging our customized cottonseed image dataset, we introduce a cottonseed defect detection and classification method based on a lightweight YOLOv5n model enhanced with Swin Transformer and an improved two-stage deep learning classification model. For cottonseed detection, our method achieves a 30.11 % reduction in model size and a 7.7 % increase in <span><math><mrow><msub><mrow><mi>m</mi><mi>A</mi><mi>P</mi></mrow><mrow><mn>50</mn><mo>:</mo><mn>95</mn></mrow></msub></mrow></math></span> compared to YOLOv5n. For individual cottonseed image classification, the accuracy, precision, recall, and <span><math><mrow><msub><mi>F</mi><mn>1</mn></msub></mrow></math></span> scores of our two-stage deep learning model are 97.34 %, 97.7 %, 97.3 %, and 97.3 %, respectively. The gradient-weighted class activation mapping (Grad-CAM) algorithm was then used to visually explain the model’s classification mechanism. Moreover, our algorithm demonstrates superior performance compared to six commonly used classification algorithms, including ResNet-18, ResNet-50, AlexNet, GoogleNet, VGG-16, and VGG-19, achieving a notable 1.65 % increase in accuracy over the best-performing algorithm among them. We then compared its performance with four state-of-the-art (SOTA) cottonseed damage classification methods. The findings demonstrate the potential for this design to advance the development of non-destructive seed damage detection.</div></div>","PeriodicalId":50627,"journal":{"name":"Computers and Electronics in Agriculture","volume":"232 ","pages":"Article 110042"},"PeriodicalIF":7.7000,"publicationDate":"2025-02-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computers and Electronics in Agriculture","FirstCategoryId":"97","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0168169925001486","RegionNum":1,"RegionCategory":"农林科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"AGRICULTURE, MULTIDISCIPLINARY","Score":null,"Total":0}
引用次数: 0

Abstract

With a rich historical background, the US cotton industry consistently maintains its position as one of the leading global producers. Due to the direct correlation between cottonseed quality and germination rate, conducting non-destructive testing to identify defects in cottonseeds becomes important to optimize yield performance. In this study, we propose an objective method for detecting cottonseed defects which classifies cottonseeds into four categories (Normal, Pinhole, Damage, and Very Damaged) and fourteen subcategories (N, R, C, RH, EH, CH, R Cut, C Cut, RV, CV, RH Expose, EH Expose, CH Expose, and V). Leveraging our customized cottonseed image dataset, we introduce a cottonseed defect detection and classification method based on a lightweight YOLOv5n model enhanced with Swin Transformer and an improved two-stage deep learning classification model. For cottonseed detection, our method achieves a 30.11 % reduction in model size and a 7.7 % increase in mAP50:95 compared to YOLOv5n. For individual cottonseed image classification, the accuracy, precision, recall, and F1 scores of our two-stage deep learning model are 97.34 %, 97.7 %, 97.3 %, and 97.3 %, respectively. The gradient-weighted class activation mapping (Grad-CAM) algorithm was then used to visually explain the model’s classification mechanism. Moreover, our algorithm demonstrates superior performance compared to six commonly used classification algorithms, including ResNet-18, ResNet-50, AlexNet, GoogleNet, VGG-16, and VGG-19, achieving a notable 1.65 % increase in accuracy over the best-performing algorithm among them. We then compared its performance with four state-of-the-art (SOTA) cottonseed damage classification methods. The findings demonstrate the potential for this design to advance the development of non-destructive seed damage detection.
求助全文
约1分钟内获得全文 求助全文
来源期刊
Computers and Electronics in Agriculture
Computers and Electronics in Agriculture 工程技术-计算机:跨学科应用
CiteScore
15.30
自引率
14.50%
发文量
800
审稿时长
62 days
期刊介绍: Computers and Electronics in Agriculture provides international coverage of advancements in computer hardware, software, electronic instrumentation, and control systems applied to agricultural challenges. Encompassing agronomy, horticulture, forestry, aquaculture, and animal farming, the journal publishes original papers, reviews, and applications notes. It explores the use of computers and electronics in plant or animal agricultural production, covering topics like agricultural soils, water, pests, controlled environments, and waste. The scope extends to on-farm post-harvest operations and relevant technologies, including artificial intelligence, sensors, machine vision, robotics, networking, and simulation modeling. Its companion journal, Smart Agricultural Technology, continues the focus on smart applications in production agriculture.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信