A Method for Detecting Tomato Maturity Based on Deep Learning

In complex scenes, factors such as tree branches and leaves occlusion, dense distribution of tomato fruits, and similarity of fruit color to the background color make it difficult to correctly identify the ripeness of the tomato fruits when harvesting them. Therefore, in this study, an improved YOLO...

Full description

Saved in:
Bibliographic Details
Main Authors: Song Wang, Jianxia Xiang, Daqing Chen, Cong Zhang
Format: Article
Language:English
Published: MDPI AG 2024-11-01
Series:Applied Sciences
Subjects:
Online Access:https://www.mdpi.com/2076-3417/14/23/11111
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1850261063338033152
author Song Wang
Jianxia Xiang
Daqing Chen
Cong Zhang
author_facet Song Wang
Jianxia Xiang
Daqing Chen
Cong Zhang
author_sort Song Wang
collection DOAJ
description In complex scenes, factors such as tree branches and leaves occlusion, dense distribution of tomato fruits, and similarity of fruit color to the background color make it difficult to correctly identify the ripeness of the tomato fruits when harvesting them. Therefore, in this study, an improved YOLOv8 algorithm is proposed to address the problem of tomato fruit ripeness detection in complex scenarios, which is difficult to carry out accurately. The algorithm employs several technical means to improve detection accuracy and efficiency. First, Swin Transformer is used to replace the third C2f in the backbone part. The modeling of global and local information is realized through the self-attention mechanism, which improves the generalization ability and feature extraction ability of the model, thereby bringing higher detection accuracy. Secondly, the C2f convolution in the neck section is replaced with Distribution Shifting Convolution, so that the model can better process spatial information and further improve the object detection accuracy. In addition, by replacing the original CIOU loss function with the Focal–EIOU loss function, the problem of sample imbalance is solved and the detection performance of the model in complex scenarios is improved. After improvement, the mAP of the model increased by 2.3%, and the Recall increased by 6.8% on the basis of YOLOv8s, and the final mAP and Recall reached 86.9% and 82.0%, respectively. The detection speed of the improved model reaches 190.34 FPS, which meets the demand of real-time detection. The results show that the improved YOLOv8 algorithm proposed in this study exhibits excellent performance in the task of tomato ripeness detection in complex scenarios, providing important experience and guidance for tomato ripeness detection.
format Article
id doaj-art-4f7f9cd131d348cdb203cd808cf74cbd
institution OA Journals
issn 2076-3417
language English
publishDate 2024-11-01
publisher MDPI AG
record_format Article
series Applied Sciences
spelling doaj-art-4f7f9cd131d348cdb203cd808cf74cbd2025-08-20T01:55:31ZengMDPI AGApplied Sciences2076-34172024-11-0114231111110.3390/app142311111A Method for Detecting Tomato Maturity Based on Deep LearningSong Wang0Jianxia Xiang1Daqing Chen2Cong Zhang3School of Mathematics and Computer, Wuhan Polytechnic University, Wuhan 430048, ChinaSchool of Mathematics and Computer, Wuhan Polytechnic University, Wuhan 430048, ChinaSchool of Mathematics and Computer, Wuhan Polytechnic University, Wuhan 430048, ChinaSchool of Electrical Engineering, Wuhan Polytechnic University, Wuhan 430048, ChinaIn complex scenes, factors such as tree branches and leaves occlusion, dense distribution of tomato fruits, and similarity of fruit color to the background color make it difficult to correctly identify the ripeness of the tomato fruits when harvesting them. Therefore, in this study, an improved YOLOv8 algorithm is proposed to address the problem of tomato fruit ripeness detection in complex scenarios, which is difficult to carry out accurately. The algorithm employs several technical means to improve detection accuracy and efficiency. First, Swin Transformer is used to replace the third C2f in the backbone part. The modeling of global and local information is realized through the self-attention mechanism, which improves the generalization ability and feature extraction ability of the model, thereby bringing higher detection accuracy. Secondly, the C2f convolution in the neck section is replaced with Distribution Shifting Convolution, so that the model can better process spatial information and further improve the object detection accuracy. In addition, by replacing the original CIOU loss function with the Focal–EIOU loss function, the problem of sample imbalance is solved and the detection performance of the model in complex scenarios is improved. After improvement, the mAP of the model increased by 2.3%, and the Recall increased by 6.8% on the basis of YOLOv8s, and the final mAP and Recall reached 86.9% and 82.0%, respectively. The detection speed of the improved model reaches 190.34 FPS, which meets the demand of real-time detection. The results show that the improved YOLOv8 algorithm proposed in this study exhibits excellent performance in the task of tomato ripeness detection in complex scenarios, providing important experience and guidance for tomato ripeness detection.https://www.mdpi.com/2076-3417/14/23/11111Yolov8tomato maturity detectionswin transformerDSConvdeep learning
spellingShingle Song Wang
Jianxia Xiang
Daqing Chen
Cong Zhang
A Method for Detecting Tomato Maturity Based on Deep Learning
Applied Sciences
Yolov8
tomato maturity detection
swin transformer
DSConv
deep learning
title A Method for Detecting Tomato Maturity Based on Deep Learning
title_full A Method for Detecting Tomato Maturity Based on Deep Learning
title_fullStr A Method for Detecting Tomato Maturity Based on Deep Learning
title_full_unstemmed A Method for Detecting Tomato Maturity Based on Deep Learning
title_short A Method for Detecting Tomato Maturity Based on Deep Learning
title_sort method for detecting tomato maturity based on deep learning
topic Yolov8
tomato maturity detection
swin transformer
DSConv
deep learning
url https://www.mdpi.com/2076-3417/14/23/11111
work_keys_str_mv AT songwang amethodfordetectingtomatomaturitybasedondeeplearning
AT jianxiaxiang amethodfordetectingtomatomaturitybasedondeeplearning
AT daqingchen amethodfordetectingtomatomaturitybasedondeeplearning
AT congzhang amethodfordetectingtomatomaturitybasedondeeplearning
AT songwang methodfordetectingtomatomaturitybasedondeeplearning
AT jianxiaxiang methodfordetectingtomatomaturitybasedondeeplearning
AT daqingchen methodfordetectingtomatomaturitybasedondeeplearning
AT congzhang methodfordetectingtomatomaturitybasedondeeplearning