To solve key challenges in machine vision-driven online defect recognition of soft packaging, such as inadequate ability to capture defect deformation, difficulty in extracting defect features, and limited generalization performance of models, an online detection method for soft packaging defects is proposed by integrating edge computing and domain adaptation. By replacing the backbone network with GhostNet and optimizing feature fusion through an adaptive feature pyramid network (AFPN), the number of model parameters was significantly reduced by approximately 30%. A multi-scale domain adversarial neural network (DANN) was introduced to enable rapid adaptation to target domains by leveraging historical multi-category data. A three-tier edge computing architecture of “terminal–edge–cloud” was built, and the lightweight YOLOv8 model was deployed on edge nodes, significantly reducing detection latency. Experimental results demonstrated that the proposed method achieved an average detection accuracy of 97.5% across five types of soft packaging products, with an inference time of only 10.9 ms and an average system response time of 148 ms. This approach significantly enhances detection speed and accuracy for soft packaging defect recognition, effectively meeting the real-time requirements of industrial inspection.
Bao et al. (Mon,) studied this question.