Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning

[Objective]Plug tray seedling cultivation is a contemporary method known for its high germination rates, uniform seedling growth, shortened transplant recovery period, diminished pest and disease incidence, and enhanced labor efficiency. Despite these advantages, challenges such as missing or underd...

Full description

Saved in:
Bibliographic Details
Main Authors: CHEN Junlin, ZHAO Peng, CAO Xianlin, NING Jifeng, YANG Shuqin
Format: Article
Language:English
Published: Editorial Office of Smart Agriculture 2024-11-01
Series:智慧农业
Subjects:
Online Access:https://www.smartag.net.cn/CN/rich_html/10.12133/j.smartag.SA202408001
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1841526575114223616
author CHEN Junlin
ZHAO Peng
CAO Xianlin
NING Jifeng
YANG Shuqin
author_facet CHEN Junlin
ZHAO Peng
CAO Xianlin
NING Jifeng
YANG Shuqin
author_sort CHEN Junlin
collection DOAJ
description [Objective]Plug tray seedling cultivation is a contemporary method known for its high germination rates, uniform seedling growth, shortened transplant recovery period, diminished pest and disease incidence, and enhanced labor efficiency. Despite these advantages, challenges such as missing or underdeveloped seedlings can arise due to seedling quality and environmental factors. To ensure uniformity and consistency of the seedlings, sorting is frequently necessary, and the adoption of automated seedling sorting technology can significantly reduce labor costs. Nevertheless, the overgrowth of seedlings within the plugs can effect the accuracy of detection algorithms. A method for grading and locating strawberry seedlings based on a lightweight YOLOv8s model was presented in this research to effectively mitigate the interference caused by overgrown seedlings.[Methods]The YOLOv8s model was selected as the baseline for detecting different categories of seedlings in the strawberry plug tray cultivation process, namely weak seedlings, normal seedlings, and plug holes. To improve the detection efficiency and reduce the model's computational cost, the layer-adaptive magnitude-based pruning(LAMP) score-based channel pruning algorithm was applied to compress the base YOLOv8s model. The pruning procedure involved using the dependency graph to derive the group matrices, followed by normalizing the group importance scores using the LAMP Score, and ultimately pruning the channels according to these processed scores. This pruning strategy effectively reduced the number of model parameters and the overall size of the model, thereby significantly enhancing its inference speed while maintaining the capability to accurately detect both seedlings and plug holes. Furthermore, a two-stage seedling-hole matching algorithm was introduced based on the pruned YOLOv8s model. In the first stage, seedling and plug hole bounding boxes were matched according to their the degree of overlap (Dp), resulting in an initial set of high-quality matches. This step helped minimize the number of potential matching holes for seedlings exhibiting overgrowth. Subsequently, before the second stage of matching, the remaining unmatched seedlings were ranked according to their potential matching hole scores (S), with higher scores indicating fewer potential matching holes. The seedlings were then prioritized during the second round of matching based on these scores, thus ensuring an accurate pairing of each seedling with its corresponding plug hole, even in cases where adjacent seedling leaves encroached into neighboring plug holes.[Results and Discussions]The pruning process inevitably resulted in the loss of some parameters that were originally beneficial for feature representation and model generalization. This led to a noticeable decline in model performance. However, through meticulous fine-tuning, the model's feature expression capabilities were restored, compensating for the information loss caused by pruning. Experimental results demonstrated that the fine-tuned model not only maintained high detection accuracy but also achieved significant reductions in FLOPs (86.3%) and parameter count (95.4%). The final model size was only 1.2 MB. Compared to the original YOLOv8s model, the pruned version showed improvements in several key performance metrics: precision increased by 0.4%, recall by 1.2%, mAP by 1%, and the F1-Score by 0.1%. The impact of the pruning rate on model performance was found to be non-linear. As the pruning rate increased, model performance dropped significantly after certain crucial channels were removed. However, further pruning led to a reallocation of the remaining channels' weights, which in some cases allowed the model to recover or even exceed its previous performance levels. Consequently, it was necessary to experiment extensively to identify the optimal pruning rate that balanced model accuracy and speed. The experiments indicated that when the pruning rate reached 85.7%, the mAP peaked at 96.4%. Beyond this point, performance began to decline, suggesting that this was the optimal pruning rate for achieving a balance between model efficiency and performance, resulting in a model size of 1.2 MB. To further validate the improved model's effectiveness, comparisons were conducted with different lightweight backbone networks, including MobileNetv3, ShuffleNetv2, EfficientViT, and FasterNet, while retaining the Neck and Head modules of the original YOLOv8s model. Results indicated that the modified model outperformed these alternatives, with mAP improvements of 1.3%, 1.8%, 1.5%, and 1.1%, respectively, and F1-Score increases of 1.5%, 1.8%, 1.1%, and 1%. Moreover, the pruned model showed substantial advantages in terms of floating-point operations, model size, and parameter count compared to these other lightweight networks. To verify the effectiveness of the proposed two-stage seedling-hole matching algorithm, tests were conducted using a variety of complex images from the test set. Results indicated that the proposed method achieved precise grading and localization of strawberry seedlings even under challenging overgrowth conditions. Specifically, the correct matching rate for normal seedlings reached 96.6%, for missing seedlings 84.5%, and for weak seedlings 82.9%, with an average matching accuracy of 88%, meeting the practical requirements of the strawberry plug tray cultivation process.[Conclusions]The pruned YOLOv8s model successfully maintained high detection accuracy while reducing computational costs and improving inference speed. The proposed two-stage seedling-hole matching algorithm effectively minimized the interference caused by overgrown seedlings, accurately locating and classifying seedlings of various growth stages within the plug tray. The research provides a robust and reliable technical solution for automated strawberry seedling sorting in practical plug tray cultivation scenarios, offering valuable insights and technical support for optimizing the efficiency and precision of automated seedling grading systems.
format Article
id doaj-art-715d0d6850e34802aea6c577ee5a5eb5
institution Kabale University
issn 2096-8094
language English
publishDate 2024-11-01
publisher Editorial Office of Smart Agriculture
record_format Article
series 智慧农业
spelling doaj-art-715d0d6850e34802aea6c577ee5a5eb52025-01-16T15:52:14ZengEditorial Office of Smart Agriculture智慧农业2096-80942024-11-016613214310.12133/j.smartag.SA202408001SA202408001Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel PruningCHEN Junlin0ZHAO Peng1CAO Xianlin2NING Jifeng3YANG Shuqin4College of Mechanical and Electronic Engineering, Northwest A&F University, Yangling712100, ChinaCollege of Mechanical and Electronic Engineering, Northwest A&F University, Yangling712100, ChinaCollege of Mechanical and Electronic Engineering, Northwest A&F University, Yangling712100, ChinaCollege of Information Engineering, Northwest A&F University, Yangling712100, ChinaCollege of Mechanical and Electronic Engineering, Northwest A&F University, Yangling712100, China[Objective]Plug tray seedling cultivation is a contemporary method known for its high germination rates, uniform seedling growth, shortened transplant recovery period, diminished pest and disease incidence, and enhanced labor efficiency. Despite these advantages, challenges such as missing or underdeveloped seedlings can arise due to seedling quality and environmental factors. To ensure uniformity and consistency of the seedlings, sorting is frequently necessary, and the adoption of automated seedling sorting technology can significantly reduce labor costs. Nevertheless, the overgrowth of seedlings within the plugs can effect the accuracy of detection algorithms. A method for grading and locating strawberry seedlings based on a lightweight YOLOv8s model was presented in this research to effectively mitigate the interference caused by overgrown seedlings.[Methods]The YOLOv8s model was selected as the baseline for detecting different categories of seedlings in the strawberry plug tray cultivation process, namely weak seedlings, normal seedlings, and plug holes. To improve the detection efficiency and reduce the model's computational cost, the layer-adaptive magnitude-based pruning(LAMP) score-based channel pruning algorithm was applied to compress the base YOLOv8s model. The pruning procedure involved using the dependency graph to derive the group matrices, followed by normalizing the group importance scores using the LAMP Score, and ultimately pruning the channels according to these processed scores. This pruning strategy effectively reduced the number of model parameters and the overall size of the model, thereby significantly enhancing its inference speed while maintaining the capability to accurately detect both seedlings and plug holes. Furthermore, a two-stage seedling-hole matching algorithm was introduced based on the pruned YOLOv8s model. In the first stage, seedling and plug hole bounding boxes were matched according to their the degree of overlap (Dp), resulting in an initial set of high-quality matches. This step helped minimize the number of potential matching holes for seedlings exhibiting overgrowth. Subsequently, before the second stage of matching, the remaining unmatched seedlings were ranked according to their potential matching hole scores (S), with higher scores indicating fewer potential matching holes. The seedlings were then prioritized during the second round of matching based on these scores, thus ensuring an accurate pairing of each seedling with its corresponding plug hole, even in cases where adjacent seedling leaves encroached into neighboring plug holes.[Results and Discussions]The pruning process inevitably resulted in the loss of some parameters that were originally beneficial for feature representation and model generalization. This led to a noticeable decline in model performance. However, through meticulous fine-tuning, the model's feature expression capabilities were restored, compensating for the information loss caused by pruning. Experimental results demonstrated that the fine-tuned model not only maintained high detection accuracy but also achieved significant reductions in FLOPs (86.3%) and parameter count (95.4%). The final model size was only 1.2 MB. Compared to the original YOLOv8s model, the pruned version showed improvements in several key performance metrics: precision increased by 0.4%, recall by 1.2%, mAP by 1%, and the F1-Score by 0.1%. The impact of the pruning rate on model performance was found to be non-linear. As the pruning rate increased, model performance dropped significantly after certain crucial channels were removed. However, further pruning led to a reallocation of the remaining channels' weights, which in some cases allowed the model to recover or even exceed its previous performance levels. Consequently, it was necessary to experiment extensively to identify the optimal pruning rate that balanced model accuracy and speed. The experiments indicated that when the pruning rate reached 85.7%, the mAP peaked at 96.4%. Beyond this point, performance began to decline, suggesting that this was the optimal pruning rate for achieving a balance between model efficiency and performance, resulting in a model size of 1.2 MB. To further validate the improved model's effectiveness, comparisons were conducted with different lightweight backbone networks, including MobileNetv3, ShuffleNetv2, EfficientViT, and FasterNet, while retaining the Neck and Head modules of the original YOLOv8s model. Results indicated that the modified model outperformed these alternatives, with mAP improvements of 1.3%, 1.8%, 1.5%, and 1.1%, respectively, and F1-Score increases of 1.5%, 1.8%, 1.1%, and 1%. Moreover, the pruned model showed substantial advantages in terms of floating-point operations, model size, and parameter count compared to these other lightweight networks. To verify the effectiveness of the proposed two-stage seedling-hole matching algorithm, tests were conducted using a variety of complex images from the test set. Results indicated that the proposed method achieved precise grading and localization of strawberry seedlings even under challenging overgrowth conditions. Specifically, the correct matching rate for normal seedlings reached 96.6%, for missing seedlings 84.5%, and for weak seedlings 82.9%, with an average matching accuracy of 88%, meeting the practical requirements of the strawberry plug tray cultivation process.[Conclusions]The pruned YOLOv8s model successfully maintained high detection accuracy while reducing computational costs and improving inference speed. The proposed two-stage seedling-hole matching algorithm effectively minimized the interference caused by overgrown seedlings, accurately locating and classifying seedlings of various growth stages within the plug tray. The research provides a robust and reliable technical solution for automated strawberry seedling sorting in practical plug tray cultivation scenarios, offering valuable insights and technical support for optimizing the efficiency and precision of automated seedling grading systems.https://www.smartag.net.cn/CN/rich_html/10.12133/j.smartag.SA202408001strawberry plug seedlingyolov8sstrawberry plug seedling-hole matchingchannel pruningtwo-stage matching and localization
spellingShingle CHEN Junlin
ZHAO Peng
CAO Xianlin
NING Jifeng
YANG Shuqin
Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning
智慧农业
strawberry plug seedling
yolov8s
strawberry plug seedling-hole matching
channel pruning
two-stage matching and localization
title Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning
title_full Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning
title_fullStr Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning
title_full_unstemmed Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning
title_short Lightweight YOLOv8s-Based Strawberry Plug Seedling Grading Detection and Localization via Channel Pruning
title_sort lightweight yolov8s based strawberry plug seedling grading detection and localization via channel pruning
topic strawberry plug seedling
yolov8s
strawberry plug seedling-hole matching
channel pruning
two-stage matching and localization
url https://www.smartag.net.cn/CN/rich_html/10.12133/j.smartag.SA202408001
work_keys_str_mv AT chenjunlin lightweightyolov8sbasedstrawberryplugseedlinggradingdetectionandlocalizationviachannelpruning
AT zhaopeng lightweightyolov8sbasedstrawberryplugseedlinggradingdetectionandlocalizationviachannelpruning
AT caoxianlin lightweightyolov8sbasedstrawberryplugseedlinggradingdetectionandlocalizationviachannelpruning
AT ningjifeng lightweightyolov8sbasedstrawberryplugseedlinggradingdetectionandlocalizationviachannelpruning
AT yangshuqin lightweightyolov8sbasedstrawberryplugseedlinggradingdetectionandlocalizationviachannelpruning