摘要: | 印刷電路板 (printed circuit boards, PCB) 是各類電子產品的基本零組 件,以絕緣材料輔以導體配線所形成的機構元件。主要用以承載電子元 件,利用電路板形成之電子線路將各項電子元件連接在一起,做為電路 間溝通的橋樑;廣泛應用於航太軍用、精密儀表、電腦、通訊、各項工 業用產品、及各種消費性電子產品。 印刷電路板的品質深深影響各種電子產品的性能,有良好品質的印 刷電路板才能保有優良的電子產品。任何產品的製造總難免會有小量的 異常;這些異常的瑕疵必須檢測出來,才能出廠良好品質的印刷電路板 給下游廠商繼續製造出優良的電子產品。傳統自動光學檢測 (automated optical inspection, AOI) 的瑕疵檢測易受光源及印刷電路板本身複雜度的 影響,而無法有效提升檢測的準確度。近些年深度學習 (deep learning) 技術崛起,在各行各業都有傑出的表現。自動光學檢測自然也不落人後, 積極引入深度學習技術,以期同時提升檢測的檢出率 (detection rate) 及 篩除率 (screening rate)。 在本論文中,我們提出了基於膠囊網路 (capsule network) 的印刷電 路板的瑕疵檢測系統,第一部份為原始純粹膠囊網路,我們對膠囊網路 的設計進行了探討,分析了其中的關鍵組件;例如,動態路由演算法 (dynamic routing algorithm) 、 擠 壓 函 數 (squash function) 、 初 級 膠 囊 (primary capsule)。以此方向去優化原始的網路架構,第二部份為卷積模 組修改,我們縮減了原始膠囊網路的卷積層,以此比較原始的網路架構, 第三部份為擴增模型,我們探討了卷積層 (convolution layer) 及膠囊層 (capsule layer) 的擴充對於模型性能的影響,第四部份為深度卷積結合 膠囊,我們探討了關於不同的深度卷積種類作為提取特徵的適用性;例 如,Inception、DenseNet、ResNet、VGGNet、及 MobileNet,以此依據 作為與膠囊層結合的架構,提出了最終的改進版本。 實驗方面,原始純粹膠囊網路的階段,我們調整擠壓函數、動態路由演算法、及初級膠囊 (primary capsule) 的維度,以驗證其修改對於原始膠囊網路的真實變化,測試結果與原始膠囊網路相比,準確度、精密度、及召回率分別提升了1.86%、1.87%、及1.86%,卷積模組修改的階段,我們以簡單的卷積層組合膠囊層,測試結果與原始膠囊網路相比,準確度、精密度、及召回率分別提升了8.15%、8.08%、及7.99%,擴增模型階段,我們加深了卷積層及膠囊層,測試結果與原始膠囊網路相比,準確度優於10.49%,精密度優於9.58%,召回率優於10.58%,深度卷積結合膠囊階段,經過比較不同深度卷積的性能,我們最終選擇了 DenseNet 作為深度卷積與膠囊層結合,最後一層膠囊層的路由次數 (routing number) 由3改為7,並將訓練回合 (epoch) 由100增加到350,將優化器 Adam 改為 AdamW,並以 ReduceLROnPlateau 作為學習率策略,最終準確度、精密度、召回率、及 F-score 都達到了99.22%。;Printed circuit board is a basic component of various electronic products, a structural component formed by insulating materials supplemented by conductor wiring. Mainly used to carry electronic components, using the electronic circuit formed by the circuit board to connect various electronic components together, as a bridge for communication between circuits; widely used in aerospace military, precision instruments, computers, communications, various industrial products , and different consumer electronics products. The quality of printed circuit boards deeply affects the performance of various electronic products. Only good quality printed circuit boards can maintain excellent electronic products. There will always be a small amount of abnormalities in the manufacture of any product; these abnormal flaws must be detected in order to deliver good-quality printed circuit boards to downstream manufacturers to continue to manufacture excellent electronic products. The defect detection of traditional automated optical inspection is easily affected by the complexity of the light source and the printed circuit board itself, and cannot effectively improve the detection accuracy. In recent years, deep learning technology has risen, and it has outstanding performance in all walks of life. Naturally, automatic optical inspection does not fall behind, and actively introduces deep learning technology in order to simultaneously improve the detection rate and screening rate of inspection. In this paper, we propose a defect detection system for printed circuit boards based on a capsule network. The first part is the original pure capsule network. We discuss the design of the capsule network and analyze the key components; for example, dynamic routing algorithm, squash function, primary capsule. In this direction to optimize the original network architecture, the second part is the modification of the convolution module. We reduced the convolution layer of the original capsule network to compare the original network architecture. The third part is the expansion model, we discuss the impact of the expansion of the convolution layer and capsule layer on the performance of the model, the fourth part is the combination of depth convolution and capsule, we discuss the different types of depth convolution as extraction features applicability; for example, Inception, DenseNet, ResNet, VGGNet, and MobileNet, based on this as an architecture combined with the capsule layer, the final improved version is proposed. In terms of experiments, in the stage of the original pure capsule network, we adjusted the squeeze function, dynamic routing algorithm, and the dimension of the primary capsule to verify the real changes of the modification to the original capsule network. The test results were consistent with the original capsule. Compared with the network, the accuracy, precision, and recall rate have increased by 1.86%, 1.87%, and 1.86% respectively. In the stage of modifying the convolution module, we combined the capsule layer with a simple convolution layer. The test results are consistent with the original capsule. Compared with the network, the accuracy, precision, and recall rate increased by 8.15%, 8.08%, and 7.99% respectively. In the expansion model stage, we deepened the convolution layer and capsule layer. The test results were compared with the original capsule network. The accuracy is better than 10.49%, the precision is better than 9.58%, and the recall rate is better than 10.58%. The depth convolution is combined with the capsule stage. After comparing the performance of different depth convolutions, we finally choose DenseNet as the depth convolution and capsule layer. In combination, the routing number of the last capsule layer was changed from 3 to 7, and the epoch was increased from 100 to 350, the optimizer Adam was changed to AdamW, and ReduceLROnPlateau was used as the learning rate strategy, and the final accuracy, precision, recall rate, and F-score all reached 99.22%. |