Abstract:The lightweight filling product defect detection method based on YOLOv4 object detection algorithm was proposed aimed at the issue of difficulty in detecting multiple targets at the same time in the automatic filling of viscous liquid food with the traditional filling product defect detection method. The lightweight feature extraction was performed on the input samples through the MobileNetV3 backbone feature extraction network, and the depthwise separable convolution strategy was used to reduce the computational cost of the enhance feature extraction network. Then, the full path aggregation network (FPANet) was designed and efficient channel attention (ECA) mechanism was introduced to improve the target feature expression of the enhance feature extraction network. The model training and precision testing were carried out on the designed lightweight network, and the performance of other object detection algorithms was compared in the same dataset to reveal the superiority and disadvantages of the proposed method. The experimental results showed that the proposed method could improve the detection speed while maintaining the accuracy, and the multi-objective high-speed detection of the filling product defects of viscous food was realized.