A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model

With the rapid development of agriculture, tomatoes, as an important economic crop, require accurate ripeness recognition technology to enable selective harvesting. Therefore, intelligent tomato ripeness recognition plays a crucial role in agricultural production. However, factors such as lighting c...

Full description

Saved in:
Bibliographic Details
Main Authors: Zhanshuo Yang, Yaxian Li, Qiyu Han, Haoming Wang, Chunjiang Li, Zhandong Wu
Format: Article
Language:English
Published: MDPI AG 2024-12-01
Series:Horticulturae
Subjects:
Online Access:https://www.mdpi.com/2311-7524/11/1/15
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1832588360645869568
author Zhanshuo Yang
Yaxian Li
Qiyu Han
Haoming Wang
Chunjiang Li
Zhandong Wu
author_facet Zhanshuo Yang
Yaxian Li
Qiyu Han
Haoming Wang
Chunjiang Li
Zhandong Wu
author_sort Zhanshuo Yang
collection DOAJ
description With the rapid development of agriculture, tomatoes, as an important economic crop, require accurate ripeness recognition technology to enable selective harvesting. Therefore, intelligent tomato ripeness recognition plays a crucial role in agricultural production. However, factors such as lighting conditions and occlusion lead to issues such as low detection accuracy, false detections, and missed detections. Thus, a deep learning algorithm for tomato ripeness detection based on an improved YOLOv8n is proposed in this study. First, the improved YOLOv8 model is used for tomato target detection and ripeness classification. The RCA-CBAM (Region and Color Attention Convolutional Block Attention Module) module is introduced into the YOLOv8 backbone network to enhance the model’s focus on key features. By incorporating attention mechanisms across three dimensions—color, channel, and spatial attention—the model’s ability to recognize changes in tomato color and spatial positioning is improved. Additionally, the BiFPN (Bidirectional Feature Pyramid Network) module is introduced to replace the traditional PANet connection, which achieves efficient feature fusion across different scales of tomato skin color, size, and surrounding environment and optimizes the expression ability of the feature map. Finally, an Inner-FocalerIoU loss function is designed and integrated to address the difficulty of ripeness classification caused by class imbalance in the samples. The results show that the improved YOLOv8+ model is capable of accurately recognizing the ripeness level of tomatoes, achieving relatively high values of 95.8% precision value and 91.7% accuracy on the test dataset. It is concluded that the new model has strong detection performance and real-time detection.
format Article
id doaj-art-9d6c550ca5054b1baa79551b7a358217
institution Kabale University
issn 2311-7524
language English
publishDate 2024-12-01
publisher MDPI AG
record_format Article
series Horticulturae
spelling doaj-art-9d6c550ca5054b1baa79551b7a3582172025-01-24T13:34:28ZengMDPI AGHorticulturae2311-75242024-12-011111510.3390/horticulturae11010015A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 ModelZhanshuo Yang0Yaxian Li1Qiyu Han2Haoming Wang3Chunjiang Li4Zhandong Wu5Faculty of Mechanical and Electrical Engineering, Kunming University of Science and Technology, Kunming 650504, ChinaFaculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650504, ChinaFaculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650504, ChinaFaculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650504, ChinaFaculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650504, ChinaFaculty of Modern Agricultural Engineering, Kunming University of Science and Technology, Kunming 650504, ChinaWith the rapid development of agriculture, tomatoes, as an important economic crop, require accurate ripeness recognition technology to enable selective harvesting. Therefore, intelligent tomato ripeness recognition plays a crucial role in agricultural production. However, factors such as lighting conditions and occlusion lead to issues such as low detection accuracy, false detections, and missed detections. Thus, a deep learning algorithm for tomato ripeness detection based on an improved YOLOv8n is proposed in this study. First, the improved YOLOv8 model is used for tomato target detection and ripeness classification. The RCA-CBAM (Region and Color Attention Convolutional Block Attention Module) module is introduced into the YOLOv8 backbone network to enhance the model’s focus on key features. By incorporating attention mechanisms across three dimensions—color, channel, and spatial attention—the model’s ability to recognize changes in tomato color and spatial positioning is improved. Additionally, the BiFPN (Bidirectional Feature Pyramid Network) module is introduced to replace the traditional PANet connection, which achieves efficient feature fusion across different scales of tomato skin color, size, and surrounding environment and optimizes the expression ability of the feature map. Finally, an Inner-FocalerIoU loss function is designed and integrated to address the difficulty of ripeness classification caused by class imbalance in the samples. The results show that the improved YOLOv8+ model is capable of accurately recognizing the ripeness level of tomatoes, achieving relatively high values of 95.8% precision value and 91.7% accuracy on the test dataset. It is concluded that the new model has strong detection performance and real-time detection.https://www.mdpi.com/2311-7524/11/1/15YOLOv8 modeltomato detectionripeness recognitiondeep learning
spellingShingle Zhanshuo Yang
Yaxian Li
Qiyu Han
Haoming Wang
Chunjiang Li
Zhandong Wu
A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model
Horticulturae
YOLOv8 model
tomato detection
ripeness recognition
deep learning
title A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model
title_full A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model
title_fullStr A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model
title_full_unstemmed A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model
title_short A Method for Tomato Ripeness Recognition and Detection Based on an Improved YOLOv8 Model
title_sort method for tomato ripeness recognition and detection based on an improved yolov8 model
topic YOLOv8 model
tomato detection
ripeness recognition
deep learning
url https://www.mdpi.com/2311-7524/11/1/15
work_keys_str_mv AT zhanshuoyang amethodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT yaxianli amethodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT qiyuhan amethodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT haomingwang amethodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT chunjiangli amethodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT zhandongwu amethodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT zhanshuoyang methodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT yaxianli methodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT qiyuhan methodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT haomingwang methodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT chunjiangli methodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model
AT zhandongwu methodfortomatoripenessrecognitionanddetectionbasedonanimprovedyolov8model