Abstract:The broken rate and impurity rate of corn kernels are key indicators for evaluating the quality of corn harvest. Aiming at the demand for online detection of corn harvest quality in complex agricultural environments, a lightweight detection method for corn kernel broken rate and impurity rate suitable for small and large detection targets was proposed. Firstly, a quantity and quality regression model was established for complete kernels, broken kernels, corn cobs, and corn bracts, and an evaluation method for kernel broken rate and impurity rate was proposed. Secondly, an improved FSLYOLO v8n algorithm was proposed to address the characteristics of similar grain and impurity sizes, large number of detection objects, and small detection area. The algorithm improved the backbone network structure through FasterBlock module and small detection area and parameter free attention mechanism SimAM, and improved detection head by using shared convolution combined with scale module. In addition, the SlidLoss function was used to replace the original category classification loss function of YOLO v8n. The average accuracy of the improved FSLYOLO v8n model mAP@50 was 97.46%, FPS was 186.4f/s, which was 6.35% and 45f/s higher than that of YOLO v8n. The network parameters and floating-point operations were compressed to 66.50% and 64.63% of YOLO v8n, respectively. The model size was only 4.0MB, and its performance was better than the commonly used lightweight models. The bench experiment showed that the proposed model can accurately detect the broken and impurity rate of corn kernels. The accuracy of the detection results was as high as 95.33% and 96.15%. The improved model was deployed on the Jetson TX2 development board and the device was installed on a corn combine harvester for field experiments.