Strawberry ripeness detection based on YOLOv8 algorithm fused with LW-Swin Transformer

IF 8.9 1区 农林科学 Q1 AGRICULTURE, MULTIDISCIPLINARY
Shizhong Yang, Wei Wang, Sheng Gao, Zhaopeng Deng
{"title":"Strawberry ripeness detection based on YOLOv8 algorithm fused with LW-Swin Transformer","authors":"Shizhong Yang,&nbsp;Wei Wang,&nbsp;Sheng Gao,&nbsp;Zhaopeng Deng","doi":"10.1016/j.compag.2023.108360","DOIUrl":null,"url":null,"abstract":"<div><p>Identifying the ripeness of strawberries can be challenging due to their complex growth environment, interference from light intensity, and shading caused by strawberry aggregation. To address these issues, this study aims to develop an algorithm for accurately detecting and classifying ripe strawberries. This study proposed a novel LS-YOLOv8s model for detecting and grading the ripeness of strawberries, which is based on the YOLOv8s deep learning algorithm and incorporates the LW-Swin Transformer module. To improve the performance of the model, two new random variables were introduced in the contrast enhancement process to control the enhancement effect. The dataset was expanded from 1089 to 7515 images, which increased the diversity of the data and reduced the risk of over fitting the model. Additionally, the Swin Transformer module was added to the TopDown Layer2 during the feature fusion stage to capture long distance dependencies in the input data and improve the generalization capability of the model with the use of a multi-headed self-attention mechanism. Finally, a more efficient feature fusion network was achieved by introducing a residual network with learnable parameters and scaled normalization into the original residual structure of the Swin Transformer. To evaluate the effectiveness of LS-YOLOv8s for strawberry ripeness detection, we collected a dataset of strawberry images from a strawberry planting base. The dataset was split using the 5-fold cross-validation approach, which improved the model evaluation process. Experimental results showed that LS-YOLOv8s better than other models, with a 1.6 %, 33.5 %, and 3.4 % improvement in mAP0.5 on the validation set compared to YOLOv5s, CenterNet, and SSD, respectively. Moreover, LS-YOLOv8s achieved better detection precision and speed than YOLOv8m with only approximately 51.93 % of the number of parameters used, achieving 94.4 % detection precision and 19.23fps detection speed, improving by 0.5 % and 6.56fps, respectively. The LS-YOLOv8s model can provide reliable theoretical support for detecting strawberry targets, evaluating their ripeness, and automating the strawberry picking process for orchard management.</p></div>","PeriodicalId":50627,"journal":{"name":"Computers and Electronics in Agriculture","volume":"215 ","pages":"Article 108360"},"PeriodicalIF":8.9000,"publicationDate":"2023-11-04","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/S0168169923007482","RegionNum":1,"RegionCategory":"农林科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"AGRICULTURE, MULTIDISCIPLINARY","Score":null,"Total":0}
引用次数: 0

Abstract

Identifying the ripeness of strawberries can be challenging due to their complex growth environment, interference from light intensity, and shading caused by strawberry aggregation. To address these issues, this study aims to develop an algorithm for accurately detecting and classifying ripe strawberries. This study proposed a novel LS-YOLOv8s model for detecting and grading the ripeness of strawberries, which is based on the YOLOv8s deep learning algorithm and incorporates the LW-Swin Transformer module. To improve the performance of the model, two new random variables were introduced in the contrast enhancement process to control the enhancement effect. The dataset was expanded from 1089 to 7515 images, which increased the diversity of the data and reduced the risk of over fitting the model. Additionally, the Swin Transformer module was added to the TopDown Layer2 during the feature fusion stage to capture long distance dependencies in the input data and improve the generalization capability of the model with the use of a multi-headed self-attention mechanism. Finally, a more efficient feature fusion network was achieved by introducing a residual network with learnable parameters and scaled normalization into the original residual structure of the Swin Transformer. To evaluate the effectiveness of LS-YOLOv8s for strawberry ripeness detection, we collected a dataset of strawberry images from a strawberry planting base. The dataset was split using the 5-fold cross-validation approach, which improved the model evaluation process. Experimental results showed that LS-YOLOv8s better than other models, with a 1.6 %, 33.5 %, and 3.4 % improvement in mAP0.5 on the validation set compared to YOLOv5s, CenterNet, and SSD, respectively. Moreover, LS-YOLOv8s achieved better detection precision and speed than YOLOv8m with only approximately 51.93 % of the number of parameters used, achieving 94.4 % detection precision and 19.23fps detection speed, improving by 0.5 % and 6.56fps, respectively. The LS-YOLOv8s model can provide reliable theoretical support for detecting strawberry targets, evaluating their ripeness, and automating the strawberry picking process for orchard management.

Abstract Image

基于YOLOv8算法融合LW-Swin变压器的草莓成熟度检测
由于草莓复杂的生长环境、光强的干扰以及草莓聚集造成的阴影,鉴定草莓的成熟度可能具有挑战性。为了解决这些问题,本研究旨在开发一种准确检测和分类成熟草莓的算法。本研究基于YOLOv8s深度学习算法,结合LW-Swin Transformer模块,提出了一种新颖的LS-YOLOv8s草莓成熟度检测与分级模型。为了提高模型的性能,在对比度增强过程中引入两个新的随机变量来控制增强效果。数据集从1089张扩展到7515张,增加了数据的多样性,降低了模型过度拟合的风险。此外,在特征融合阶段,在TopDown Layer2中加入Swin Transformer模块,捕获输入数据中的长距离依赖关系,并利用多头自关注机制提高模型的泛化能力。最后,在Swin变压器原有残差结构中引入具有可学习参数和尺度归一化的残差网络,实现了更高效的特征融合网络。为了评估LS-YOLOv8s在草莓成熟度检测中的有效性,我们收集了一个草莓种植基地的草莓图像数据集。使用5重交叉验证方法对数据集进行分割,改进了模型评估过程。实验结果表明,LS-YOLOv8s优于其他模型,在mAP0.5的验证集上,与YOLOv5s、CenterNet和SSD相比,分别提高了1.6%、33.5%和3.4%。LS-YOLOv8s仅使用约51.93%的参数,检测精度达到94.4%,检测速度为19.23fps,分别提高0.5%和6.56fps,检测精度和速度均优于YOLOv8m。LS-YOLOv8s模型可以为草莓目标的检测、成熟度的评估以及草莓采摘过程的自动化提供可靠的理论支持。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:604180095
Book学术官方微信