基于卷積神經(jīng)網(wǎng)絡(luò)的印刷電路板色環(huán)電阻檢測(cè)與定位方法
doi: 10.11999/JEIT190608
-
1.
湖南大學(xué)電氣與信息工程學(xué)院 長(zhǎng)沙 410082
-
2.
電子制造業(yè)智能機(jī)器人技術(shù)湖南省重點(diǎn)實(shí)驗(yàn)室 長(zhǎng)沙 410082
-
3.
中國(guó)科學(xué)院空天信息創(chuàng)新研究院 北京 100094
Method for Color-ring Resistor Detection and Localization in Printed Circuit Board Based on Convolutional Neural Network
-
1.
College of Electrical and Information Engineering, Hunan University, Changsha 410082, China
-
2.
Hunan Key Laboratory of Intelligent Robot Technology in Electronic Manufacturing, Changsha 410082, China
-
3.
Areospace Information Research Institute, Chinese Academy of Sciences, Beijing 100094, China
-
摘要: 色環(huán)電阻是印刷電路板(PCB)中最常用的電子元器件之一,主要依靠色環(huán)的排列順序和顏色等視覺信息進(jìn)行區(qū)分,易發(fā)生裝配錯(cuò)誤。但是色環(huán)電阻裝配質(zhì)量的人工檢測(cè)方法效率低、誤檢率高,而傳統(tǒng)的基于圖像處理技術(shù)的自動(dòng)檢測(cè)方法魯棒性較差,難以解決不同拍攝角度、物距及光照條件下的PCB板色環(huán)電阻檢測(cè)問題。針對(duì)這一問題,該文提出一種基于卷積神經(jīng)網(wǎng)絡(luò)(CNN)的PCB板色環(huán)電阻自動(dòng)檢測(cè)與定位方法,首先采用編碼器-解碼器結(jié)構(gòu)的卷積神經(jīng)網(wǎng)絡(luò)模型及帶有權(quán)重的交叉熵?fù)p失函數(shù)的網(wǎng)絡(luò)訓(xùn)練方法,較好地解決了復(fù)雜光照及場(chǎng)景下PCB板色環(huán)電阻的圖像分割問題;然后采用最小面積外接矩形方法定位單個(gè)色環(huán)電阻,并通過仿射變換對(duì)色環(huán)電阻位置進(jìn)行垂直校正;最后通過高斯模板匹配方法實(shí)現(xiàn)了色環(huán)電阻的色環(huán)定位。采用1270幅PCB圖像對(duì)該文方法進(jìn)行了實(shí)驗(yàn)和驗(yàn)證,并與傳統(tǒng)的基于形態(tài)學(xué)和基于模板匹配的色環(huán)電阻檢測(cè)方法進(jìn)行了對(duì)比,結(jié)果表明,該文方法在召回率、準(zhǔn)確率及重疊度等性能指標(biāo)上具有明顯優(yōu)勢(shì),處理速度快,能滿足實(shí)際應(yīng)用要求。
-
關(guān)鍵詞:
- 圖像分割 /
- 色環(huán)電阻 /
- 卷積神經(jīng)網(wǎng)絡(luò) /
- 印刷電路板
Abstract: The color-ring resistor is one of the most commonly used electronic components in Printed Circuit Board (PCB). It is featured by sequential color rings, which often brings assembling errors, however. Manual detection of color-ring resistors has low efficiency and high false detection rate. Traditional image-based automatic detection methods have difficulties in dealing with PCB images under various illuminations, imaging distance and views. To solve this problem, an automatic detection and localization method for PCB color-ring resistor is proposed based on Convolution Neural Network (CNN). Firstly, the encoder-decoder CNN model is established and trained using weighted cross-entropy loss function. With CNN, color-ring resistors are segmented from PCB images with complex illumination and scenes. Secondly, each color-ring resistor is localized using minimum area bounding rectangle, and its position is adjusted to the vertical direction by affine transformation. Finally, the localization of color rings on the resistor is achieved by Gaussian template matching. The proposed method is tested and verified by 1270 PCB images, and the result is compared with that of the traditional method (method based on geometric contour, and method based on template matching). It is shown that the proposed method has obvious advantages in performance indices, including recall rate, precision, and intersection of unions, which can meet the requirements of practical applications. -
表 2 不同網(wǎng)絡(luò)層數(shù)時(shí)色環(huán)電阻的分割性能指標(biāo)對(duì)比
平均Acc 平均Recall 平均Precision 平均IoU 平均F1 W=3 0.985 0.970 0.887 0.870 0.925 W=4 0.991 0.959 0.953 0.924 0.995 W=5 0.985 0.883 0.965 0.865 0.921 W=6 0.979 0.837 0.936 0.805 0.881 下載: 導(dǎo)出CSV
表 3 CNN在測(cè)試集與驗(yàn)證集上的性能指標(biāo)對(duì)比
平均Acc 平均Recall 平均Precision 平均IoU 平均F1 驗(yàn)證集 0.991 0.959 0.953 0.924 0.995 測(cè)試集 0.982 0.979 0.851 0.834 0.899 下載: 導(dǎo)出CSV
-
熊光潔, 馬樹元, 聶學(xué)俊, 等. 基于機(jī)器視覺的高密度電路板缺陷檢測(cè)系統(tǒng)[J]. 計(jì)算機(jī)測(cè)量與控制, 2011, 19(8): 1824–1826.XIONG Guangjie, MA Shuyuan, NIE Xuejun, et al. Defects inspection system of HID PCB based on machine vision[J]. Computer Measurement &Control, 2011, 19(8): 1824–1826. 吳福培, 張憲民. 印刷電路板無鉛焊點(diǎn)假焊的檢測(cè)[J]. 光學(xué) 精密工程, 2011, 19(3): 697–702. doi: 10.3788/OPE.20111903.0697WU Fupei and ZHANG Xianmin. Inspection of pseudo solders for lead-free solder joints in PCBs[J]. Optics and Precision Engineering, 2011, 19(3): 697–702. doi: 10.3788/OPE.20111903.0697 CHEN Y S and WANG J Y. Reading resistor based on image processing[C]. 2015 IEEE International Conference on Machine Learning and Cybernetics, Guangzhou, China, 2015: 566–571. doi: 10.1109/ICMLC.2015.7340616. GAIDHANE V H, HOTE Y V, and SINGH V. An efficient similarity measure approach for PCB surface defect detection[J]. Pattern Analysis and Applications, 2018, 21(1): 277–289. doi: 10.1007/s10044-017-0640-9 倪堯, 鮑宇. 基于目標(biāo)輪廓幾何特征的電容元件定位方法[J]. 計(jì)算機(jī)工程與科學(xué), 2017, 39(8): 1476–1482. doi: 10.3969/j.issn.1007-130X.2017.08.014NI Yao and BAO Yu. A capacitor element localization method based on geometrical features of target contour[J]. Computer Engineering and Science, 2017, 39(8): 1476–1482. doi: 10.3969/j.issn.1007-130X.2017.08.014 DONG Na, WU C H, IP W H, et al. Chaotic species based particle swarm optimization algorithms and its application in PCB components detection[J]. Expert Systems with Applications, 2012, 39(16): 12501–12511. doi: 10.1016/j.eswa.2012.04.063 王耀南, 劉良江, 周博文, 等. 一種基于混沌優(yōu)化算法的PCB板元件檢測(cè)方法[J]. 儀器儀表學(xué)報(bào), 2010, 31(2): 410–415. doi: 10.19650/j.cnki.cjsi.2010.02.028WANG Yaonan, LIU Liangjiang, ZHOU Bowen, et al. Detection method of printed circuit board components based on chaotic optimization algorithm[J]. Chinese Journal of Scientific Instrument, 2010, 31(2): 410–415. doi: 10.19650/j.cnki.cjsi.2010.02.028 姜建國(guó), 王國(guó)林, 孟宏偉, 等. 一種電子元器件組裝結(jié)果檢測(cè)方法[J]. 西安電子科技大學(xué)學(xué)報(bào): 自然科學(xué)版, 2014, 41(3): 110–115, 173. doi: 10.3969/j.issn.1001-2400.2014.03.016JIANG Jianguo, WANG Guolin, MENG Hongwei, et al. Detection method for assembling results of electronic components[J]. Journal of Xidian University, 2014, 41(3): 110–115, 173. doi: 10.3969/j.issn.1001-2400.2014.03.016 毛林威. 軸向色環(huán)電阻質(zhì)量自動(dòng)檢測(cè)系統(tǒng)的設(shè)計(jì)[D]. [碩士論文], 北京理工大學(xué), 2015.MAO Linwei. The design of color-ring resistor quality automatic detection system[D]. [Master dissertation], Beijing Institute of Technology, 2015. CHEN Y S and WANG J Y. Computer vision on color-band resistor and its cost-effective diffuse light source design[J]. Journal of Electronic Imaging, 2016, 25(6): 061409. doi: 10.1117/1.JEI.25.6.061409 BADRINARAYANAN V, KENDALL A, and CIPOLLA R. SegNet: A deep convolutional encoder-decoder architecture for image segmentation[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(12): 2481–2495. doi: 10.1109/TPAMI.2016.2644615 王海, 蔡英鳳, 賈允毅, 等. 基于深度卷積神經(jīng)網(wǎng)絡(luò)的場(chǎng)景自適應(yīng)道路分割算法[J]. 電子與信息學(xué)報(bào), 2017, 39(2): 263–269. doi: 10.11999/JEIT160329WANG Hai, CAI Yingfeng, JIA Yunyi, et al. Scene adaptive road segmentation algorithm based on deep convolutional neural network[J]. Journal of Electronics &Information Technology, 2017, 39(2): 263–269. doi: 10.11999/JEIT160329 DUAN Jiaxu, LIU Xiaoyan, WU Xin, et al. Detection and segmentation of iron ore green pellets in images using lightweight U-net deep learning network[J]. Neural Computing and Applications, 2020, 32(10): 5775–5790. doi: 10.1007/s00521-019-04045-8 YE Ruifang, PAN C S, CHANG Ming, et al. Intelligent defect classification system based on deep learning[J]. Advances in Mechanical Engineering, 2018, 10(3): 1–7. doi: 10.1177/1687814018766682 ZHANG Shifeng, WEN Longyin, BIAN Xiao, et al. Single-shot refinement neural network for object detection[C]. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, USA, 2018: 18–23. doi: 10.1109/CVPR.2018.00442. REN Shaoqing, HE Kaiming, GIRSHICK R, et al. Faster RCNN: Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137–1149. doi: 10.1109/TPAMI.2016.2577031 張燁, 許艇, 馮定忠, 等. 基于難分樣本挖掘的快速區(qū)域卷積神經(jīng)網(wǎng)絡(luò)目標(biāo)檢測(cè)研究[J]. 電子與信息學(xué)報(bào), 2019, 41(6): 1496–1502. doi: 10.11999/JEIT180702ZHANG Ye, XU Ting, FENG Dingzhong, et al. Research on faster RCNN object detection based on hard example mining[J]. Journal of Electronics &Information Technology, 2019, 41(6): 1496–1502. doi: 10.11999/JEIT180702 IOFFE S and SZEGEDY C. Batch normalization: Accelerating deep network training by reducing internal covariate shift[C]. The 32nd International Conference on Machine Learning, Lille, France, 2015: 448–456. KINGMA D P and BA J. Adam: A method for stochastic optimization[C]. The 3rd International Conference on Learning Representations (ICLR), San Diego, USA, 2015: 1–13. 邸男, 李桂菊, 陳春寧, 等. 結(jié)合歸一化差分高斯特征的圖像匹配技術(shù)研究[J]. 電子測(cè)量與儀器學(xué)報(bào), 2014, 28(6): 585–590. doi: 10.13382/j.jemi.2014.06.002DI Nan, LI Guiju, CHEN Chunning, et al. Image matching technology research based on normalized DOG features[J]. Journal of Electronic Measurement and Instrumentation, 2014, 28(6): 585–590. doi: 10.13382/j.jemi.2014.06.002 盧倩雯, 陶青川, 趙婭琳, 等. 基于生成對(duì)抗網(wǎng)絡(luò)的漫畫草稿圖簡(jiǎn)化[J]. 自動(dòng)化學(xué)報(bào), 2018, 44(5): 75–89. doi: 10.16383/j.aas.2018.c170486LU Qianwen, TAO Qingchuan, ZHAO Yalin, et al. Sketch simplification using generative adversarial networks[J]. Acta Automatica Sinica, 2018, 44(5): 75–89. doi: 10.16383/j.aas.2018.c170486 -