Automated quality control in industrial production has the potential to reduce errors and provide real-time information. However, the inspection of secondary packaging, such as counting boxes in crates, still represents a challenge, since manual methods are slow and error-prone, while automatic methods are limited by the scarcity of domain-specific datasets and the high cost of annotation. This paper proposes an efficient and low-cost two-stage object detection workflow for automatic box counting. The central novelty lies in the integration of the Segment Anything Model (SAM) to accelerate the creation of a high-quality dataset from production line videos, making model specialization economically feasible. Initially, a generalist model is trained on heterogeneous datasets to capture general visual features. Then, the model is fine-tuned with the domain-specific dataset of approximately 750 images. Experiments with YOLOv11x and Faster R-CNN achieved mAP@0.5 above 98%, with YOLOv11x showing higher accuracy and faster inference. These results demonstrate the efficiency of the proposed approach, establishing it as a replicable and low-cost solution for monitoring secondary packaging in industrial environments.
Moreira et al. (Tue,) studied this question.