The timely and accurate identification of syringe defects plays a key role in effectively improving product quality in production lines of syringes. In this article, we collected a dataset of image samples representing five common types of syringe defects found on the production line. The dataset comprises over 5000 images, with an average of 3 different syringe defects per image. Based on this dataset, we designed a syringe defect detection model based on an improved YOLOv7-Tiny proposed in this paper. The model combines the Res-PAN structure, the ACmix mixed attention mechanism, the FReLU activation function, and the SIoU loss function. The comparative experiments are conducted on the self-built dataset SYR-Dat to evaluate the performance of the proposed syringe defect detection model. The average precision of the model reaches 94.1%. To ensure the effectiveness of the model, it is compared with other models, including SSD300, Faster R-CNN, EfficientDet, RetinaNet, YOLOv5s, YOLOv6, and YOLOv7. The results demonstrate that the proposed improved YOLOv7-Tiny model can better capture the features of syringe defects. Furthermore, the generalization of the improved YOLOv7-Tiny model is validated on the VOC2012 dataset. The results indicate that the improved model continues to outperform the baseline models. The proposed syringe defect detection model shows promising application prospects, as it can ?weduce the rate of defective products and improve product quality.