Abstract:Objective To improve the detection accuracy and efficiency of non-destructive testing methods for tomatoes in food production.Methods Based on an automatic tomato sorting system, a comprehensive quality detection method for tomatoes was proposed, integrating machine vision, a multi-scale residual attention U-Net model, an improved whale optimization algorithm (IWOA), and a least squares support vector machine (LSSVM). Tomato image information was collected using machine vision. Tomato images were segmented using the multi-scale residual attention U-Net model to measure fruit diameter parameters. The parameters of the LSSVM model were optimized using an IWOA with chaotic mapping and an adaptive convergence factor to detect tomato firmness and lycopene content. Verification experiments were conducted.Results The proposed method achieved accurate, rapid, and non-destructive detection of comprehensive tomato quality. For fruit diameter, firmness, and lycopene content detection, the results showed a coefficient of determination (R2)>0.960 0, root mean square error (RMSE)<0.012 5, and average detection time <0.032 s.Conclusion Combining machine vision, deep learning, and intelligent algorithms can achieve accurate, rapid, and non-destructive detection of comprehensive tomato quality.