Abstract:To address the limited recognition capability of complex package types and fine-grained features in package defect detection, as well as the shortcomings in precision and real-time performance of existing models, this paper proposes an improved YOLOv8n-based algorithm for defect detection in express packages. First, the C2f module in the network is integrated with frequency-adaptive dilated convolution (FADC) to design the C2f-FADC module, which dynamically adjusts when handling multi-scale and multi-frequency defect detection tasks, optimizing the feature extraction process and improving the representational ability. Secondly, the SimSPPF module is introduced to replace the original SPPF module, simplifying the structure while enhancing multi-scale feature fusion capability and improving the perception of small-sized targets. Finally, the bounding box regression loss function is replaced with Shape-IoU to more accurately model the shape and scale differences between the predicted and ground-truth boxes, optimizing the detection localization performance. On a self-constructed package defect dataset, the improved algorithm achieved a detection accuracy of 96.3%, with a 4.4% in-crease in mAP50 compared to the original algorithm, and a detection speed of 98 FPS. Considering both precision and speed, the proposed method shows significant advantages over other algorithms, validating its effectiveness and superiority.