Detecting Tomato Fruit Ripeness and Appearance Quality Based on Improved YOLOv5s
The study was conducted on the detection of tomato fruit maturity and appearance quality based on deep learning methods using pink tomato as the experimental material.Two thousand and thirty-six tomato image data were collected and amplified to 5 316 through preprocessing.Then,the data was annotated and converted into files to construct an experimental dataset.The experiment improves the accuracy of SC-YOLOv5s by adding CA attention mechanism,replacing the Stem block structure,optimizing the detection layer scale based on recognition requirements,and replacing the K-means++clustering algorithm to improve the model's feature expression ability.By adding a fire module structure to SC-YOLOv5s for lightweight convolution and reducing the parameter count of the Bottleneck module,the SC-YOLOv5s-lite lightweight design is achieved,improving the detection speed of the model on hardware;Train and optimize the SC-YOLOv5s-lite model on the training set.The results showed that the memory usage of the SC-YOLOv5s-lite model was 7.73 M,with an accuracy rate of 89.04%,a recall rate of 83.35%,an average accuracy of 91.34%,and a detection time of 143 ms.Compared to YOLOv5s,the model parameter quantity is reduced by 54.57%,model size is compressed by 44.86%,with an average accuracy improvement of 3.98%,and the detection time is reduced by 20.99%.It has obvious advantages and is more suitable for hardware deployment.