Quality inspection of stamping products in the manufacturing industry is generally performed manually, which may lead to errors caused by operator fatigue, inconsistent observations, and low inspection efficiency. This study aims to implement the You Only Look Once version 8 (YOLOv8) algorithm to automatically detect and classify stamping products into Good and Not Good (NG) categories. The research stages included dataset collection, data preprocessing, model training, validation, and real-time testing. To analyze the effect of dataset size on model performance, three training scenarios were conducted using 100, 1,134, and 1,552 images with identical training parameters. Model performance was evaluated using Precision, Recall, mean Average Precision at 50% Intersection over Union (mAP50), mean Average Precision at 50%–95% Intersection over Union (mAP50–95), and a confusion matrix. The results indicate that increasing the number of datasets improves the performance of the YOLOv8 model. The model trained using 1,552 images achieved the best performance, with a Precision of 99.8%, Recall of 100%, mAP50 of 99.5%, and mAP50–95 of 96.6%, representing an improvement of 11.7 percentage points in mAP50–95 compared with the model trained using 100 images, which achieved an mAP50–95 of 84.9%. These findings indicate that increasing the dataset size enhances the model's generalization capability in recognizing variations in stamping quality. The best-performing model was subsequently implemented in real-time testing using a laptop camera and was able to consistently detect and classify stamping products under various lighting conditions, achieving a testing accuracy of 90%.
Copyrights © 2026