Hsiao Chao-Hsiang, Su Huan-Che, Wang Yin-Tien, Hsu Min-Jie, Hsu Chen-Chien
Department of Computer Science and Information Engineering, Tamkang University, New Taipei City 251301, Taiwan.
Department of Mechanical and Electro-Mechanical Engineering, Tamkang University, New Taipei City 251301, Taiwan.
Sensors (Basel). 2025 Jul 7;25(13):4233. doi: 10.3390/s25134233.
Defect detection in mass production lines often involves small and imbalanced datasets, necessitating the use of few-shot learning methods. Traditional deep learning-based approaches typically rely on large datasets, limiting their applicability in real-world scenarios. This study explores few-shot learning models for detecting product defects using limited data, enhancing model generalization and stability. Unlike previous deep learning models that require extensive datasets, our approach effectively performs defect detection with minimal data. We propose a Siamese network that integrates Residual blocks, Squeeze and Excitation blocks, and Convolution Block Attention Modules (ResNet-SE-CBAM Siamese network) for feature extraction, optimized through triplet loss for embedding learning. The ResNet-SE-CBAM Siamese network incorporates two primary features: attention mechanisms and metric learning. The recently developed attention mechanisms enhance the convolutional neural network operations and significantly improve feature extraction performance. Meanwhile, metric learning allows for the addition or removal of feature classes without the need to retrain the model, improving its applicability in industrial production lines with limited defect samples. To further improve training efficiency with imbalanced datasets, we introduce a sample selection method based on the Structural Similarity Index Measure (SSIM). Additionally, a high defect rate training strategy is utilized to reduce the False Negative Rate (FNR) and ensure no missed defect detections. At the classification stage, a K-Nearest Neighbor (KNN) classifier is employed to mitigate overfitting risks and enhance stability in few-shot conditions. The experimental results demonstrate that with a good-to-defect ratio of 20:40, the proposed system achieves a classification accuracy of 94% and an FNR of 2%. Furthermore, when the number of defective samples increases to 80, the system achieves zero false negatives (FNR = 0%). The proposed metric learning approach outperforms traditional deep learning models, such as parametric-based YOLO series models in defect detection, achieving higher accuracy and lower miss rates, highlighting its potential for high-reliability industrial deployment.
大规模生产线中的缺陷检测通常涉及小的且不平衡的数据集,因此需要使用少样本学习方法。传统的基于深度学习的方法通常依赖于大型数据集,这限制了它们在实际场景中的适用性。本研究探索了使用有限数据检测产品缺陷的少样本学习模型,以提高模型的泛化能力和稳定性。与之前需要大量数据集的深度学习模型不同,我们的方法能够以最少的数据有效地进行缺陷检测。我们提出了一种集成了残差块、挤压与激励块以及卷积块注意力模块的孪生网络(ResNet-SE-CBAM孪生网络)用于特征提取,并通过三元组损失进行优化以进行嵌入学习。ResNet-SE-CBAM孪生网络包含两个主要特征:注意力机制和度量学习。最近开发的注意力机制增强了卷积神经网络操作,并显著提高了特征提取性能。同时,度量学习允许在无需重新训练模型的情况下添加或删除特征类别,提高了其在缺陷样本有限的工业生产线中的适用性。为了在不平衡数据集上进一步提高训练效率,我们引入了一种基于结构相似性指数测量(SSIM)的样本选择方法。此外,还采用了高缺陷率训练策略来降低误报率(FNR)并确保不会漏检缺陷。在分类阶段,采用K近邻(KNN)分类器来减轻过拟合风险并增强少样本条件下的稳定性。实验结果表明,在良品与缺陷品比例为20:40时,所提出的系统实现了94%的分类准确率和2%的误报率。此外,当缺陷样本数量增加到80时,系统实现了零误报(FNR = 0%)。所提出的度量学习方法在缺陷检测方面优于传统的深度学习模型,如基于参数的YOLO系列模型,实现了更高的准确率和更低的漏检率,突出了其在高可靠性工业部署中的潜力。