MSNet: an enhanced YOLOv8-based approach to detect defects in vial body
摘要
Precise defect detection is crucial to ensure the quality and safety of pharmaceuticals. The subtle and diverse defects on the pharmaceutical vial body pose challenges for inspection. This paper establishes a multi-station vision inspection system to capture multi-perspective imaging of the vials, develops an image processing method that combines detection area positioning and sample image segmentation, and create a custom vial body defect dataset, VBD-DET, including stain, scratch, and filling variation. We propose a Multi-scale Separable Network (MSNet) based on YOLOv8-n by introducing the module Spatially Separable Pooling Attention (SSPA) and the module Multi-scale Depthwise Feature Fusion (MDFF). The former aggregates feature information across spatial domains and improves the perception of subtle defects, the latter extracts multi-scale defects and enhances feature representation. Experiments on the VBD-DET dataset demonstrate that the proposed MSNet increases the mean Average Precision (mAP) by 11% and 15.2% compared to YOLOv11-n and YOLOv12-n, respectively. Our proposed MSNet keeps a good trade-off between detection precision and computational efficiency.