[Objective]Tomato ripeness directly determines harvest timing,storage and transportation cycle,and market pricing,while appearance defects not only reduce commercial value but also may cause cross-infection during storage,making them key indicators for automated equipment.Traditional manual detection suffers from low efficiency,strong subjectivity and high miss rate,while exist-ing deep learning models generally have shortcomings of insufficient grading granularity,incomplete functional coverage and poor de-ployment adaptability,hardly balancing accuracy and real-time performance on low-power edge devices.The aim of this study is to propose a lightweight high-precision integrated tomato detection model to provide reliable visual technical support for automated har-vesting and intelligent sorting.[Methods]An improved YOLOv10s tomato detection model named Tomato-YOLO was proposed,which simultaneously performed fine-grained grading of 4 ripeness categories and integrated identification of 4 appearance defect cat-egories.A tomato detection dataset containing 3 807 images was constructed for the study,integrating 2 221 public samples and 1 586 self-collected field samples and covering multiple complex field scenarios.The dataset was hierarchically and randomly split into training,validation and test sets at a 7:2:1 ratio,and five data augmentation strategies were adopted during training to improve general-ization,with a total of 8 detection labels(4 ripeness+4 appearance defects)set.Four improvements were implemented on the YO-LOv10s baseline:First,the scale-aware context module(SACM)was introduced to replace the C2f module in the backbone network,enhancing the feature capture capability for subtle ripeness differences and micro defects while suppressing field background interfer-ence.Second,a cross-layer multi-scale bidirectional feature fusion strategy was constructed and extended to a four-detection-head ar-chitecture,with a P2 ultra-small-target detection layer added to fill the scale-coverage gap of the native architecture and boost percep-tion robustness for small and occluded fruits in complex scenes.Third,the Shape Intersection over Union(SIoU)loss function was ad-opted to replace the native Complete Intersection over Union(CIoU)loss,paired with an adaptive weighting strategy for small targets,adding angle constraints to optimize bounding box regression accuracy for nearly circular tomatoes and raising the learning priority of hard samples.Fourth,layer-adaptive magnitude pruning(LAMP)technology was introduced to prune redundant convolutional layers,and the optimal pruning ratio was determined via gradient comparison to achieve lightweight performance with negligible accuracy loss.[Results and Discussions]Experiments were conducted on the RTX3070 platform,and the results showed that the precision,recall and mean average precision(mAP@0.5)of Tomato-YOLO reached 92.1%,92.0%and 95.0%respectively,6.9,11.6 and 6.8 percent-age points higher than those of the original YOLOv10s,with significant performance improvements for both defect and ripeness cate-gories.Compared with mainstream models including faster region-convolutional neural network(Faster R-CNN),single shot multi-box detector(SSD),YOLOv5s,YOLOv8s,YOLOv11s,YOLOv12s,Tomato-YOLO achieved significantly higher detection accuracy,while its model size and inference speed were comparable to those of native YOLOv10s,balancing accuracy and efficiency.Ablation experiments verified the independent effects and synergistic gains of the four improvements,and pruning experiments identified 15%as the optimal pruning ratio.At this ratio,the weight file size was reduced to 15.1 MB and computational load to 27.9 GFLOPs,and accuracy decreased by only 1.2 percentage points,achieving nearly lossless lightweighting.When the pruned model was deployed on the Jetson Nano edge platform,the inference speed reached 30.4 f/s,and the overall mAP@0.5 remained at 93.7%,far exceeding the≥20 f/s real-time detection threshold for agricultural scenarios,meeting the continuous operation requirements of harvesting equipment.[Conclusions]The Tomato-YOLO proposed in this study effectively addresses key limitations of existing tomato detection models,achieving a balance of high accuracy and real-time performance for fine-grained ripeness grading and integrated appearance defect identification.It provides reliable technical support for intelligent harvesting and refined sorting in the tomato industry.