Abstract With the growing adoption of deep learning in AI, flaw detection in bottled liquor production has become crucial to ensure product quality and consumer satisfaction. However, existing flaw detection models often face issues of low efficiency, particularly in multi-category and multi-target scenarios, and struggle with integration into resource-constrained devices. To solve these challenges, this study proposes ESW-YOLO, a lightweight model optimized to detect diverse flaws in bottled liquor production. This model is designed as follows: firstly, the Efficient Multi-Branch \& Scale FPN (EMBSFPN) is developed to reduce model size while increasing the detection accuracy of small flaws. Secondly, the SE attention mechanism is incorporated to emphasize critical features, which strengthens the model’s robustness in complex scenarios. Thirdly, the Wise-IoU loss function is used to optimize localization accuracy, particularly for irregular defects. Finally, a lightweight shared convolutional detection head (ESCD) is proposed to further decrease model size and improve detection efficiency. Experimental results on a bottled liquor flaw detection dataset demonstrate that ESW-YOLO achieves a mean average precision (mAP) of 94.7% and a recall of 91.8%. Additionally, the proposed model reduces computational cost by 30.8%, decreases parameter count by 45.1%, and maintains a compact model size of only 3.6 M. This method can provide a reference for the development of defect detection methods in bottled liquor.