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

• The first systematic and precise definition of various categories of cottonseed defects. • An innovative YOLOv5n-Swin Transformer model with a two-stage classification for cottonseed damage detection. • Our detection model is 30.11% smaller than YOLOv5n and classification network achieves 97.34% classification accuracy. 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 m A P 50 : 95 compared to YOLOv5n. For individual cottonseed image classification, the accuracy, precision, recall, and F 1 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.

Authors

Institutions

Publication Details

Journal
Computers and Electronics in Agriculture
Published
2025-02-07
DOI
https://doi.org/10.1016/j.compag.2025.110042
Citations
2
Primary Topic
Smart Agriculture and AI
Type
article
Field-Weighted Citation Impact
3.50

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

J. Jojo Cheng, Lori Unruh Snyder, Lirong Xiang, Tingshu He et al.
2 citations
Computers and Electronics in Agriculture
Smart Agriculture and AI
3.50
article

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

J. Jojo Cheng, Lori Unruh Snyder, Lirong Xiang, Tingshu He, Evelynn Wilcox, Fan Wu
article en
2 citations

Abstract

• The first systematic and precise definition of various categories of cottonseed defects. • An innovative YOLOv5n-Swin Transformer model with a two-stage classification for cottonseed damage detection. • Our detection model is 30.11% smaller than YOLOv5n and classification network achieves 97.34% classification accuracy. 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 m A P 50 : 95 compared to YOLOv5n. For individual cottonseed image classification, the accuracy, precision, recall, and F 1 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.

Computers and Electronics in AgricultureVol. 232
University of North Carolina at Chapel Hill (US), North Carolina State University (US)
Cotton Incorporated
Zero hunger
Openalex Percentile: Top 10%
Smart Agriculture and AI
3.50
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.