Abstract: Tomatoes are an important economic crop in China’s protected agriculture, and their harvesting time and graded marketing depend heavily on accurate assessment of fruit ripeness. Traditional manual sorting methods suffer from strong subjectivity, low efficiency, and inconsistent standards, making it difficult to meet the requirements of large-scale and intelligent production. In response to this situation, this paper designs and implements an intelligent tomato ripeness detection system based on the YOLOv8 deep-learning object detection algorithm, aiming to achieve automated, fine-grained, and visual recognition of tomato ripeness.

Content Summary

As an economically important horticultural crop cultivated worldwide, the tomato demands accurate maturity assessment at the moment of harvest, because ripeness directly determines flavour, nutritional value, transport tolerance and ultimately market price. In conventional production the grading task is still performed manually by experienced workers, an approach that is subjective, labour-intensive, inconsistent between operators and impossible to scale to the throughput required by modern greenhouses and automated picking robots. To address these limitations, this thesis designs and implements an intelligent tomato ripeness detection system built upon the YOLOv8 single-stage object-detection framework, and packages the trained model inside a complete, user-friendly desktop application.

A dedicated image dataset containing 1,420 greenhouse and field photographs was constructed and partitioned into 993 training, 284 validation and 143 test images. Every tomato instance was annotated with a bounding box and assigned to one of four ripeness categories—unripe, turning, semi-ripe and ripe—that follow the physiological colouring sequence of the fruit. Using the lightweight YOLOv8n backbone initialised from pre-trained weights, the model was trained for 150 epochs with the Adam optimiser, an adaptive learning-rate schedule and an online data-augmentation pipeline. On the held-out evaluation set the final model attains a precision of 81.05%, a recall of 70.65%, a mean Average Precision (mAP@0.5) of 76.84% and a stricter mAP@0.5:0.95 of 61.15%. The per-class analysis shows that the visually distinct ripe and unripe categories are recognised with Average Precision values of 0.926 and 0.844 respectively, while the transitional turning class remains the most challenging at 0.514, a finding that is consistent across the precision–recall curve, the F1–confidence curve and the confusion matrix.

Around this model a graphical detection platform was developed in Python with the PyQt framework. The software provides account-based login and registration, one-click model loading, and four complementary inference modes—single-image detection, video-file detection, real-time camera detection and folder-level batch detection—together with rich result visualisation in the form of statistic cards, a colour-coded ripeness proportion chart and a detailed per-target table. On an NVIDIA GeForce RTX 3070 Ti laptop GPU the system reaches a steady-state inference latency of approximately 6–8 ms per frame, comfortably satisfying real-time requirements. Functional and performance testing confirms that the platform is stable, responsive and accurate, demonstrating that a carefully trained YOLOv8 detector embedded in an accessible interface can provide practical decision support for intelligent harvesting and post-harvest grading in smart agriculture.

Document Overview

Document Information

Version: Draft
Total pages: 59
Word count: 15,526 words
File format: Editable Word document
Figures and tables: 17 figures and 6 tables

Table of Contents

Chapter 1 Introduction 1
1.1 Research Background and Significance 1
1.2 Research Status at Home and Abroad 3
1.2.1 Traditional Image-Processing Approaches 3
1.2.2 Deep-Learning-Based Detection Approaches 4
1.3 Main Research Content 5
1.4 Organisation of the Thesis 6
Chapter 2 Related Theories and Technologies 7
2.1 Overview of Object Detection 7
2.2 Convolutional Neural Network Fundamentals 8
2.3 Evolution of the YOLO Family 9
2.4 YOLOv8 Network Architecture 10
2.4.1 Backbone 10
2.4.2 Neck 11
2.4.3 Detection Head 12
2.5 Loss Functions 12
2.6 Evaluation Metrics 13
2.7 Development Environment and Tools 14
2.8 Non-Maximum Suppression and Post-processing 15
2.9 Transfer Learning 15
Chapter 3 Dataset Construction and Preprocessing 17
3.1 Data Acquisition 17
3.2 Definition of Ripeness Categories 18
3.3 Data Annotation 18
3.4 Dataset Partition 19
3.5 Data Augmentation and Preprocessing 20
Chapter 4 Model Training and Result Analysis 21
4.1 Experimental Environment and Hyper-parameters 21
4.2 Training Procedure 22
4.3 Analysis of the Training Curves 24
4.4 Overall Evaluation Results 25
4.5 Precision–Recall Curve Analysis 26
4.6 F1–Confidence Curve Analysis 28
4.7 Confusion Matrix Analysis 29
4.8 Discussion 30
4.9 Practical Implications of the Results 31
Chapter 5 System Design and Implementation 33
5.1 Requirement Analysis 33
5.2 Overall System Architecture 34
5.3 Development Environment 36
5.4 User Management Module 36
5.5 Main Interface Design 38
5.6 Image Detection Module 39
5.7 Video Detection Module 41
5.8 Real-time Camera Detection Module 42
5.9 Batch Detection Module 43
5.10 Result Visualisation and Storage 44
Chapter 6 System Testing 46
6.1 Testing Environment and Method 46
6.2 Functional Testing 46
6.3 Performance Testing 47
6.4 Detection Case Analysis 48
6.5 Testing Summary 48
Chapter 7 Conclusion and Future Work 50
7.1 Summary of Work 50
7.2 Limitations 51
7.3 Future Work 51
References 52
Acknowledgments 54

Related Project

Figure 1 Intelligent Tomato Ripeness Detection System Based on YOLOv8 Deep Learning

Project Information

Author Information

Author: Bob (Zhang Jialiang)
Project ID: AI-EN-1-Doc
Originality Statement: This project is an original work.

Contact Information

Email: wesharecode2023@gmail.com
GitHub:https://github.com/7zcode
YouTube:https://www.youtube.com/@7zcode

Open Source License

This project is licensed under the AGPL-3.0 License. You may use, modify, and distribute the code, but derivative works must also remain open source under the same license. If the project is used to provide network services, the complete source code must be made available to users.

This project is for learning and research purposes only. Users are responsible for complying with local laws and regulations. If this project is helpful, citation and attribution are appreciated.

声明:本站所有项目资源都可以正常运行,亲测无错!而且我们录制了演示视频,在我们注明的环境版本下,项目运行效果完全和演示视频一致。客服QQ:下载须知