

Corrugated cardboard is a crucial component of packaging materials, and its surface defects directly affect the quality and aesthetics of the products. To address the challenges posed by the diverse and uneven distribution of defects on cardboard surfaces, we propose the YOLOv8-GSP, a detection algorithm based on attention mechanisms and lightweight improvements in YOLOv8 for surface defects of corrugated cardboard. Firstly, to tackle the insufficient size of the cardboard defect dataset, Projected GAN was employed to augment the dataset, thereby enhancing the training effectiveness of the detection model. Then, Ghost convolution was introduced to reduce the computational complexity and improve the operational speed. Additionally, an SE attention module was incorporated into the Neck network to emphasize the feature information of the corrugated cardboard surface, thereby enriching feature fusion. We improved YOLOv8 by incorporating Ghost convolution and attention mechanisms to enhance the efficiency and accuracy of the detection model. These improvements not only reduce the computational complexity of the model but also enhance detection performance by better focusing on target features. Our method is experimentally validated on a self-constructed dataset, providing a more efficient and accurate solution for the automatic detection of corrugated cardboard surface defects. Indeed, the proposed method’s mean Average Precision (mAP) increased by 1.6% compared to the standard YOLOv8.