The quality of the powder bed is critical in the laser powder bed fusion (LPBF) process, and defects in the powder bed likely affect the quality of the final part. With the development of artificial intelligence technology, machine learning methods have been widely applied in powder-bed defect detection. However, to achieve high-precision defect detection, it is often necessary to construct complex network models and use high-resolution powder bed image data. To address these issues, this study used an off-axis industrial camera to capture layer-wise powder bed image data and proposed a defect detection model based on YOLOv7x and channel pruning to achieve defect identification and localization of powder bed patch images. Furthermore, an end-to-end defect detection pipeline based on image processing methods was proposed to detect defects in layer-wise powder bed images. Finally, the gradient-based class activation map technique (Grad CAM++) was used to analyze the interpretability of the detection results of the model. The results indicated that the proposed model was more lightweight than other models (YOLOv7x, Faster R-CNN, and SSD), with a model size of only 12.4MB. The average time for detecting powder bed image patches was significantly reduced to only 3.4 ms, and the average detection accuracy was as high as 97.4%. This demonstrates that the proposed detection method has the advantages of faster detection speed, higher detection accuracy, and simpler models, providing a reference for the real-time online detection of powder bed defects.