Abstract:Objective To improve the accuracy and efficiency of tomato quality inspection in automated production lines, and solve the problems of traditional inspection, such as reliance on manual labor, low precision, and poor efficiency.Methods Based on the quality inspection system of the tomato automated production line, an integrated internal and external quality inspection system is developed by combining hyperspectral imaging and machine vision technologies. After preprocessing the hyperspectral detection data, an improved least squares support vector machine (LSSVM) model is employed to detect the soluble solids content and hardness of tomatoes, thereby completing internal quality inspection. For external quality inspection, the collected machine vision data are preprocessed, and an improved YOLOv12 model is utilized to detect external defects. Additionally, the size and fruit shape index of tomatoes are calculated. The superiority of the method is validated through experimental testing.Results The internal quality inspection method demonstrates high predictive accuracy, with determination coefficients (R2) of 0.965 for total soluble solids and 0.975 for hardness, and root mean square errors (RMSE) of 0.082 °Bx and 0.061 N, respectively. The improved YOLOv12 model achieves an average defect detection accuracy of 99.20% and a detection speed exceeding 100 frames/s. The overall performance of this integrated system is superior to that of single-detection approaches and existing methods.Conclusion This integrated detection system enables synchronous, non-destructive, and efficient detection of both internal and external quality of tomatoes, effectively meeting the requirements of automated production lines.