On lightweight impurity detection of Baijiu for embedded platforms
摘要
Impurity detection plays a critical role in ensuring the quality of Baijiu during production. Currently, the relevant industry primarily relies on PC hosts and graphics card devices as tools for machine vision inspection. However, these systems are characterized by high equipment costs, large physical footprints, and substantial power consumption, making it difficult to meet the liquor industry’s demand for high-efficient and low-cost inspection solutions. In recent years, with the rapid development of the domestic semiconductor industry, many embedded chips have integrated NPU computing units, significantly enhancing their AI capabilities. This has facilitated the widespread application of machine vision in embedded systems. Among the commonly used machine vision algorithms in such systems, YOLO V8 remains predominant. Nevertheless, deploying PC-based models directly on embedded devices is facing challenge in that the post-training models are generally large in volume and computationally intensive, leading to low operational efficiency on resource-constrained embedded platforms. Meanwhile, existing lightweight models often struggle to balance detection speed and accuracy. To address these issues, this paper proposes a system for detecting impurities in liquor based on an improved YOLO V8 algorithm deployed on the RK3588 embedded platform. By modifying the base architecture of YOLO V8, we introduce a lightweight network named BiFPN-EfficientDetect. Redundant weights are pruned using the Layer-Adaptive Magnitude-based Pruning (LAMP) algorithm to reduce computational complexity, while knowledge distillation is applied to further enhance detection accuracy. Experimental results demonstrate that the optimized model achieves a 94.7% accuracy (compared to the baseline YOLOv8n’s 95.5%) with significantly reduced computational load (2.5 GFLOPs, down from 8.1 GFLOPs), parameter count (831,350, down from 3,007,013), and model size (1.85 MB, down from 5.94 MB). When deployed on the RK3588 platform, the system attains a real-time detection speed of 90–105 FPS, meeting industrial requirements for high-speed impurity screening. This research contributes an automated, precise, and computationally efficient solution for Baijiu quality control, as well as demonstrating practical applicability in real-world production environments.