Defect detection is crucial for quality control in industrial products. The defects in industrial products are typically subtle, leading to reduced accuracy in detection. Furthermore, industrial defect detection often necessitates high efficiency in order to meet operational demands. Deep learning-based algorithms for surface defect detection have been increasingly applied to industrial production processes. Among them, Swin-Transformer achieves remarkable success in many visual tasks. However, the computational burden imposed by numerous image tokens limits the application of Swin-Transformer. To enhance both the detection accuracy and efficiency, this paper proposes a linear attention mechanism based on pyramid pooling. It utilizes a more concise linear attention mechanism to reduce the computational load, thereby improving detection efficiency. Furthermore, it enhances global feature extraction capabilities through pyramid pooling, which improves the detection accuracy. Additionally, the incorporation of partial convolution into the model improves local feature extraction, further enhancing detection precision. Our model demonstrates satisfactory performance with minimal computational cost. It outperforms Swin-Transformer by 1.2% mAP and 52 FPS on the self-constructed SIM card slot defect dataset. When compared to the Swin-Transformer model on the public PKU-Market-PCB dataset, our model achieves an improvement of 1.7% mAP and 51 FPS. These results validate the universality of the proposed approach.