Abstract:In end-side production line industrial quality inspection applications for large-scale manufacturing, tailoring and deploying deep learning models to edge devices with small arithmetic power becomes particularly important due to the limitations of arithmetic power, cost and power consumption. Based on the application scenario of complex defect detection of aluminum profile, the defect detection model is designed based on YOLOv8. First of all, through the lightweight structure design, combined with the partial self-attention mechanism to improve the ability of subtle defect extraction; the use of spatial channel downsample instead of the traditional downsampling convolution; and proposed a combination of mixed local channel attention mechanism of the C2f-M module. Then, SC-BiFPN neck network is designed based on bidirectional feature pyramid network, which enhances the multi-scale feature fusion capability. Then, the task dynamic align detection head is designed to make full use of multilevel features for more accurate target localisation and classification; the MPDIoU loss function is used to enhance the bounding box regression capability. Finally, YOLOv8 is trimmed by Taylor's method to significantly reduce the number of model parameters and computational cost. The experimental results show that the lightweight YOLOv8 model reduces the number of parameters to 36.7% of the original model on the aluminium surface defects dataset, reduces the computational effort by 40%, and reduces the model volume by 62%; at the same time, the detection accuracy, the recall rate and the mAP@50.95 are improved by 0.3%, 1.1%, and 4.8%, respectively. The method effectively solves the problem of balancing computational complexity and detection performance in end-side deployment, and provides a feasible solution for efficient defect detection on small arithmetic hardware.