| 系統識別號 | U0002-1106202511445700 |
|---|---|
| DOI | 10.6846/tku202500227 |
| 論文名稱(中文) | 應用孿生網路於印刷電路板不平衡瑕疵資料之檢測 |
| 論文名稱(英文) | Unbalanced-data Defect Detection Using Siamese Networks for Printed Circuit Board |
| 第三語言論文名稱 | |
| 校院名稱 | 淡江大學 |
| 系所名稱(中文) | 機械與機電工程學系碩士班 |
| 系所名稱(英文) | Department of Mechanical and Electro-Mechanical Engineering |
| 外國學位學校名稱 | |
| 外國學位學院名稱 | |
| 外國學位研究所名稱 | |
| 學年度 | 113 |
| 學期 | 2 |
| 出版年 | 114 |
| 研究生(中文) | 邱浩哲 |
| 研究生(英文) | Hao-Che Chiu |
| 學號 | 612370121 |
| 學位類別 | 碩士 |
| 語言別 | 繁體中文 |
| 第二語言別 | |
| 口試日期 | 2025-05-22 |
| 論文頁數 | 51頁 |
| 口試委員 |
指導教授
-
王銀添(ytwang@mail.tku.edu.tw)
口試委員 - 邱銘杰(mcchiu@gm.ttu.edu.tw) 口試委員 - 許閔傑 |
| 關鍵字(中) |
瑕疵檢測 不平衡資料集 少樣本資料集 三胞胎孿生網路 |
| 關鍵字(英) |
defect detection imbalanced datasets few-shot datasets triplet Siamese network |
| 第三語言關鍵字 | |
| 學科別分類 | |
| 中文摘要 |
針對生產線產品瑕疵檢測的不平衡資料與少樣本等問題,本論文提出將卷積神經網路型式的孿生網路(Siamese Networks)與深度學習的分類器結合,成為產品瑕疵檢測演算法。研究議題包括資料集的處理、卷積神經網路型式孿生網路的設計、機器學習分類器的規劃等。資料集處理方面,使用結構相似性指數(SSIM)欠採樣與最佳分佈欠採樣的方法,提升資料多樣性與代表性。孿生網路設計方面,本論文設計三種型式的卷積神經網路,第一種型式是特徵偵測卷積神經網路;第二種增加了強度與輪廓增強的卷積神經網路;第三種設計更深層的特徵偵測卷積神經網路。機器學習分類器方面,規劃使用MLP、SVM、KNN等分類器,進行瑕疵與正常產品的二元分類。本論文使用基於三元損失(triplet loss)的孿生網路,進行嵌入特徵學習。透過對手寫數字資料集與PCB資料集的實驗,驗證方法的有效性。實驗結果顯示,在卷積神經網路型式的孿生網路方面,更深層卷積神經網路能顯著降低驗證損失波動性,並提升模型的泛化能力。針對多種分類器的效能分析方面,SVM(poly)在不良品比例較高的情境下,能實現零漏檢,而KNN和SVM(rbf)則在準確率與漏檢率之間表現出良好平衡。在模型超參數的調整方面,本論文在訓練過程中加入丟棄(dropout)權重之功能以進行正則化,結果顯示適當比例的丟棄參數(例如dropout=0.4),能在準確率與穩定性之間取得最佳平衡。另外,樣品採樣程序也透過調整不良品樣本的比例,進一步驗證了模型的穩健性。本論文為PCB瑕疵檢測提供了一套針對性解決方案,不僅有效提升了分類準確率與穩定性,還為處理不平衡資料與少樣本學習問題提供了重要的實踐依據,對製造業生產線的自動化檢測系統具有重要應用價值。 |
| 英文摘要 |
To address issues such as imbalanced datasets and few-shot problems in defect detection for production line products, this paper proposes a defect detection algorithm that combines convolutional neural network-based Siamese Networks with machine learning classifiers. The research topics include dataset processing, the design of convolutional neural network-based Siamese Networks, and the planning of machine learning classifiers. In dataset processing, the methods of Structural Similarity Index Measure (SSIM) under-sampling and optimal distribution under-sampling are employed to enhance dataset diversity and representativeness. For the design of Siamese Networks, three types of convolutional neural networks are proposed. The first type is a feature detection convolutional neural network; the second incorporates intensity and contour enhancement; and the third involves a deeper feature detection convolutional neural network. Regarding machine learning classifiers, classifiers such as MLP, SVM, and KNN are employed for binary classification of defective and normal products. This paper utilizes a Siamese Network based on triplet loss for embedded feature learning. Experiments conducted on handwritten digit datasets and PCB datasets validate the effectiveness of the proposed methods. The experimental results show that deeper convolutional neural networks in the Siamese Network architecture significantly reduce the volatility of validation loss and enhance the model's generalization ability. For performance analysis of various classifiers, SVM (poly) achieves zero false negatives in scenarios with higher defect ratios, while KNN and SVM (rbf) demonstrate a good balance between accuracy and false-negative rates. In terms of hyperparameter tuning, dropout regularization was incorporated during training. Results indicate that an appropriate dropout rate (e.g., dropout=0.4) achieves an optimal balance between accuracy and stability. Additionally, the sample sampling procedure was adjusted by varying the ratio of defective samples, further validating the model's robustness. This paper provides a targeted solution for PCB defect detection, significantly improving classification accuracy and stability. It also offers practical insights for addressing imbalanced datasets and few-shot learning problems, contributing valuable applications to automated defect detection systems in manufacturing production lines. |
| 第三語言摘要 | |
| 論文目次 |
目錄 致謝 III 目錄 V 圖目錄 VII 表目錄 VIII 第1章 序論 1 1.1 研究動機 1 1.2 研究目的 1 1.3 文獻探討 1 1.3.1 瑕疵檢測的相關文獻 1 1.3.2 不平衡資料集處理的相關文獻 2 1.3.3 孿生網路的相關文獻 3 1.3.4 資料預處理的相關文獻 4 1.3.5 分類器相關文獻 4 1.4 研究範圍 5 1.5 瑕疵檢測流程說明 5 1.6 論文章節架構 5 第2章 孿生網路架構 6 2.1 孿生網路 6 2.2 三胞胎孿生網路 6 2.3 最佳化演算法 7 2.4 孿生網路模型測試與分析 9 2.5 資料標記規劃 10 2.6 特徵萃取之卷積神經網路 11 2.7 強度與輪廓增強之卷積神經網路 12 2.8 更深層之卷積神經網路 12 2.9 卷積神經網路形式孿生網路 13 第3章 資料集處理與分析 15 3.1 手寫數字資料集 15 3.2 主成份分析 16 3.3 多層感知器(MLP) 19 3.4 K 最近鄰演算法(KNN) 19 3.5 支持向量機( SVM) 20 3.6 兩種數字資料集測試結果 20 3.7 多種數字資料集測試結果 26 3.8 手寫數字集測試結果與討論 29 第4章 PCB資料集處理與分析 31 4.1 PCB資料集 31 4.2 主成份分析 32 4.2.1 SSIM欠採樣資料集 33 4.2.2 最佳分佈欠採樣資料集 35 4.6 相似區域分佈範例(Case 1) 36 4.7 最大區域分佈範例(Case 2) 37 4.7 不良品比例提高範例(Case 3) 42 4.8 PCB瑕疵檢測結果與討論 43 第5章 結論 45 5.1 研究成果 45 5.2 未來研究方向 46 參考文獻 47 附錄 A 系統開發環境與程式摘要 50 A.1 軟體開發環境 50 A.2 程式摘要 50 圖目錄 圖1. 1系統圖 5 圖2. 1三胞胎(a,p,n)樣本的挑選(左圖);三胞胎孿生網路(a,p,n)樣本的學習結果(右圖) 7 圖2. 2三胞胎孿生網路模型設計 7 圖2. 3孿生網路模型測試 9 圖2. 4測試資料分群分析 9 圖2. 5多個種類的Negative資料的分析 10 圖2. 6卷積神經網路設計 11 圖2. 7卷積神經網路設計 12 圖2. 8卷積神經網路設計 13 圖3. 1 MNIST數字 15 圖3. 2圖片尺寸縮放處理 15 圖3. 3 MNIST資料集進行PCA的2維分析 19 圖3. 4 2種數字資料集train loss(左圖)與val loss(右圖) 22 圖3. 5 2種數字資料集train loss(左圖)與val loss(右圖) 23 圖3. 6 3種數字資料集train loss(左圖)與val loss(右圖) 27 圖3. 7 3種數字資料集train loss(左圖)與val loss(右圖) 28 圖4. 1 PCB板的電路與電子元件,良品(左圖)與不良品(右圖) 31 圖4. 2圖片轉向處理,直放(左圖)與橫放(右圖) 32 圖4. 3圖片尺寸縮放處理,原圖(左圖)與調整後的圖(右圖) 32 圖4. 4全部資料進行PCA的2維分析 33 圖4. 5使用SSIM欠採樣良品與不良品各20筆資料,良品(左圖)與不良品(右圖) 35 圖4. 6使用SSIM欠採樣良品與不良品各20筆資料,進行PCA的2維分析 35 圖4. 7人工挑選最佳分佈的良品與不良品各20筆資料,進行PCA的2維分析 36 圖4. 8 SSIM欠採樣資料集train loss(左圖)與val loss(右圖) 37 圖4. 9最佳分佈欠採樣資料集訓練的train loss(左圖)與val loss(右圖) 38 圖4. 10 Dropout = 0.2訓練的train loss(左圖)與val loss(右圖) 39 圖4. 11 Dropout = 0.4訓練的train loss(左圖)與val loss(右圖) 40 圖4. 12 Dropout = 0.6訓練的train loss(左圖)與val loss(右圖) 41 圖4. 13最佳分佈欠採樣資料集不同Dropout的準確率與標準差 42 表目錄 表3. 12種數字資料集訓練超參數 21 表3. 22種數字資料集訓練超參數 22 表3. 3MLP分類器參數設定 23 表3. 4SVM分類器參數設定 24 表3. 5KNN分類器參數設定 25 表3. 6數字資料集分類器及準確率 26 表3. 73種數字資料集訓練超參數 27 表3. 83種數字資料集訓練超參數 28 表3. 9數字資料集分類器及準確率 29 表4. 1訓練超參數 37 表4. 2最佳分佈欠採樣訓練超參數 38 表4. 3 Dropout = 0.2訓練超參數 39 表4. 4Dropout = 0.4訓練超參數 40 表4. 5Dropout = 0.6訓練超參數 41 表4. 6不良品比例提高訓練超參數 43 表4. 7不良品比例提高之各模型準確率、過篩、漏檢 43 |
| 參考文獻 |
參考文獻 [1] A. Fernández, S. García, M. Galar, R. C. Prati, B. Krawczyk, and F. Herrera, Learning from imbalanced data sets: Springer, 2018. [2] H. He and E. A. Garcia, "Learning from imbalanced data," IEEE Transactions on knowledge and data engineering, vol. 21, no. 9, pp. 1263-1284, 2009. [3] X. Zhou, W. Liang, S. Shimizu, J. Ma, and Q. Jin, "Siamese neural network based few-shot learning for anomaly detection in industrial cyber-physical systems," IEEE Transactions on Industrial Informatics, vol. 17, no. 8, pp. 5790-5798, 2020. [4] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, "Gradient-based learning applied to document recognition," Proceedings of the IEEE, vol. 86, no. 11, pp. 2278-2324, 1998. [5] A. Krizhevsky, I. Sutskever, and G. E. Hinton, "Imagenet classification with deep convolutional neural networks," Advances in neural information processing systems, vol. 25, 2012. [6] K. Simonyan and A. Zisserman, "Very deep convolutional networks for large-scale image recognition," arXiv preprint arXiv:1409.1556, 2014. [7] C. Szegedy et al., "Going deeper with convolutions," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 1-9. [8] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770-778. [9] R. Mohammed, J. Rawashdeh, and M. Abdullah, "Machine learning with oversampling and undersampling techniques: overview study and experimental results," in 2020 11th international conference on information and communication systems (ICICS), 2020: IEEE, pp. 243-248. [10] X.-Y. Liu, J. Wu, and Z.-H. Zhou, "Exploratory undersampling for class-imbalance learning," IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), vol. 39, no. 2, pp. 539-550, 2008. [11] I. Melekhov, J. Kannala, and E. Rahtu, "Siamese network features for image matching," in 2016 23rd international conference on pattern recognition (ICPR), 2016: IEEE, pp. 378-383. [12] A. He, C. Luo, X. Tian, and W. Zeng, "A twofold siamese network for real-time object tracking," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2018, pp. 4834-4843. [13] F. Schroff, D. Kalenichenko, and J. Philbin, "Facenet: A unified embedding for face recognition and clustering," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2015, pp. 815-823. [14] E. Hoffer and N. Ailon, "Deep metric learning using triplet network," in Similarity-based pattern recognition: third international workshop, SIMBAD 2015, Copenhagen, Denmark, October 12-14, 2015. Proceedings 3, 2015: Springer, pp. 84-92. [15] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, "Image quality assessment: from error visibility to structural similarity," IEEE transactions on image processing, vol. 13, no. 4, pp. 600-612, 2004. [16] R. Kruse, S. Mostaghim, C. Borgelt, C. Braune, and M. Steinbrecher, "Multi-layer perceptrons," in Computational intelligence: a methodological introduction: Springer, 2022, pp. 53-124. [17] M. A. Hearst, S. T. Dumais, E. Osuna, J. Platt, and B. Scholkopf, "Support vector machines," IEEE Intelligent Systems and their applications, vol. 13, no. 4, pp. 18-28, 1998. [18] G. Guo, H. Wang, D. Bell, Y. Bi, and K. Greer, "KNN model-based approach in classification," in On The Move to Meaningful Internet Systems 2003: CoopIS, DOA, and ODBASE: OTM Confederated International Conferences, CoopIS, DOA, and ODBASE 2003, Catania, Sicily, Italy, November 3-7, 2003. Proceedings, 2003: Springer, pp. 986-996. [19] D. P. Kingma, "Adam: A method for stochastic optimization," arXiv preprint arXiv:1412.6980, 2014. [20] G. Cohen, S. Afshar, J. Tapson, and A. Van Schaik, "EMNIST: Extending MNIST to handwritten letters," in 2017 international joint conference on neural networks (IJCNN), 2017: IEEE, pp. 2921-2926. [21] S. Wold, K. Esbensen, and P. Geladi, “Principal component analysis,” Chemometrics and intelligent laboratory systems, vol. 2, no. 1-3, pp. 37-52, 1987. [22] J. Shlens, “A tutorial on principal component analysis,” arXiv preprint arXiv:1404.1100, 2014. [23] O. Rodionova, S. Kucheryavskiy, and A. Pomerantsev, “Efficient tools for principal component analysis of complex data—A tutorial,” Chemometrics and Intelligent Laboratory Systems, vol. 213, pp. 104304, 2021. [24] M. Greenacre, P. J. F. Groenen, T. Hastie, A. I. D’Enza, A. Markos, and E. Tuzhilina, "Principal component analysis," Nature Reviews Methods Primers, vol. 2, no. 1, 2022 |
| 論文全文使用權限 |
如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信