相关文章推荐
贪玩的西瓜  ·  我的水彩工具汇总·  1 年前    · 
愉快的双杠  ·  ORACLE 11G 禁用 SQL ...·  2 年前    · 
小胡子的大葱  ·  InputStream.Available ...·  2 年前    · 
:
twitter line
研究生: 陳俊延
研究生(外文): Chen, Jun-Yan
論文名稱: 結合深度學習與機器視覺於螺帽缺陷自動檢測及分類之機械手臂系統開發
論文名稱(外文): Combining Deep Learning and Machine Vision in the Development of a Manipulator System for Automatic Detection and Classification of Screw Slots
指導教授: 許伯堅 黃培興
指導教授(外文): Hsu, Po-Chien Huang, Pei-Hsing
口試委員: 許伯堅 黃培興 郭振坤 蔡鈺鼎
口試委員(外文): Hsu, Po-Chien Huang, Pei-Hsing Kuo, Jenn-Kun Tsai, Yu-Ting
口試日期: 2023-07-24
學位類別: 碩士
校院名稱: 國立雲林科技大學
系所名稱: 機械工程系
學門: 工程學門
學類: 機械工程學類
論文種類: 學術論文
論文出版年: 2023
畢業學年度: 111
語文別: 中文
論文頁數: 146
中文關鍵詞: 機器視覺 深度學習 四軸機械手臂 自動化光學檢測 目標檢測 電鍍螺帽
外文關鍵詞: machine vision Deep learning four-axis robotic arm automated optical inspection object detection electroplated nuts
相關次數:
  • 被引用 被引用: 1
  • 點閱 點閱:341
  • 評分 評分:
  • 下載 下載:106
  • 收藏至我的研究室書目清單 書目收藏:0
在傳統工業中,電鍍零件的製程必須依賴於人力操作,包括將物件掛到掛架上,再送入電鍍池進行處理。完成電鍍後,人員還需逐一檢查電鍍件的完成度,這樣的作業需要耗費大量人力,長期下來成本相當可觀。此外人員容易感到疲勞,且檢測標準不一致時,容易造成品保工作誤差值相差甚大,進而導致人為失誤的發生,使得錯誤的情況時有所聞。因此本研究採用傳統機器視覺技術結合深度學習演算法整合四軸機械手臂,開發出一套自動化瑕疵檢測的分類系統,期望能改善手動檢測所面臨的問題。
本研究利用由日本Toshiba Corporation公司生產的四軸機械手臂(THL700),透過以LabVIEW為主控的自動化設備,其中LabVIEW作為主要腦部負責整合各項功能,而機械手臂則只是單純的執行動作流程,即作為手部。Vision Assistant則負責傳統的自動化光學檢測(AOI)為此系統的眼部,Python則使用深度學習(deep learning)的技術來建構神經網路模型,模擬人類的大腦神經元系統,進可完成目標檢測(object detection),以YOLOv5(You Only Look Once)的演算法進行訓練,並與LabVIEW進行連結,完成程式開發與UI人機介面的設計。此程式架構透過將腦、眼、手,三部分程式的分開,大大的提升了程式除錯和修改的便利性,在訊號傳輸方面則採用硬I/O的方式,透過繼電器連接機械手臂和LabVIEW的I/O卡,此方式不僅效率和穩定性更高,且相較於一般設備而言也更容易進行維護和更新。
本研究利用Python開源機器學習庫的PyTorch,運用YOLOv5深度學習演算法來進行目標檢測。在模型訓練方面,利用了900張電鍍螺帽影像,進行模型的訓練;而在模型測試方面,則使用了90張影像進行評估。結果顯示每一類別的平均準確度(MAP)達到93%。
關鍵字:機器視覺、深度學習、四軸機械手臂、自動化光學檢測、目標檢測、電鍍螺帽

In traditional industry, the process of electroplating parts relies on manual labor, including hanging objects on racks and sending them into the electroplating tank for treatment. After electroplating, personnel need to check the completeness of each electroplated piece one by one. Such operations require a large amount of manpower, resulting in significant costs in the long run. In addition, personnel easily feel fatigued, and when inspection standards are inconsistent, significant variations in quality control may occur, which can lead to human errors and frequent mistakes. Therefore, this study uses traditional machine vision technology combined with deep learning algorithms to integrate a four-axis robotic arm and develop an automated defect detection and classification system, hoping to improve the problems faced by manual inspection.
This study utilized a four-axis robotic arm (THL700) manufactured by Toshiba Corporation in Japan, and an automated equipment controlled by LabVIEW. LabVIEW acted as the main control center to integrate various functions, while the robotic arm served as the hand to execute motion sequences. Vision Assistant was responsible for traditional automated optical inspection (AOI) and acted as the "eyes" of the system. Python was used to construct a neural network model with deep learning techniques, simulating the human brain's neuron system, to achieve object detection using the YOLOv5 (You Only Look Once version 5) algorithm for training. The program development and UI design were completed by linking with LabVIEW. The program architecture separated the brain, eyes, and hand into three separate programs, significantly enhancing the convenience of debugging and modification. For signal transmission, the system utilized hard I/O, connecting the robotic arm and LabVIEW I/O card through relays. This approach not only improved efficiency and stability but also facilitated maintenance and updates compared to conventional devices.
This study utilized PyTorch, an open-source machine learning library in Python, to apply YOLOv5 deep learning algorithm for object detection. For model training, 990 images of electroplated nuts were used, and 90 images were used for evaluation during model testing. The results showed an average precision (MAP) of 93% for each category.
Keywords: machine vision, Deep learning, four-axis robotic arm, automated optical inspection, object detection, electroplated nuts.

摘要............................................i
ABSTRACT.......................................ii
誌謝............................................iv
目錄.............................................v
表目錄..........................................ix
圖目錄...........................................x
符號說明 ......................................xvii
第1章 緒論........................................1
1.1 前言..........................................1
1.2 研究動機與目的.................................1
1.3 研究方法......................................2
1.4 文獻回顧......................................3
1.4.1機器視覺應用.................................3
1.4.2影像辨識之深度學習............................5
1.5論文架構.......................................7
第2章 機械手臂基礎運動學原理........................8
2.1機械手臂各軸關節與坐標系.........................8
2.1.1 機械手臂之運動學概論.........................11
2.1.2 機械手臂之運動學.............................12
第3章 深度學習基礎理論..............................16
3.1 深度學習概論...................................16
3.1.1 深度學習簡介.................................17
3.1.2 機器學習之分類...............................18
3.1.3 權重與偏差(Weight and Bias)................20
3.1.4 激活函數(Activation Function)..............21
3.1.5 損失函數(Loss Function)....................25
3.1.6優化器(Optimizer)...........................26
3.2卷積神經網路(Convolutional Neural Network, CNN)28
3.2.1卷積層(Convolutional Layer).................29
3.2.2池化層(Pooling Layer).......................33
3.2.3全連接層(Fully Connected Layer).............33
3.3 YOLOv5模型介紹.................................35
3.4模型評估........................................39
第4章 機器視覺基礎理論與方法.........................42
4.1 機器視覺簡介....................................42
4.2機器視覺基礎演算法................................42
4.2.1 色彩平面提取(Color Plane Extraction).........42
4.2.2 模板匹配(Pattern Matching)...................43
4.2.3 遮罩(Mask)...................................45
4.2.4 二值化(Binarization).........................46
4.2.5 形態學(Morphology)...........................49
第5章 實驗架構與機電整合技術...........................52
5.1 伺服馬達硬體架構與軟體架構.........................52
5.1.1 MELSEC可程式控制器..............................53
5.1.2 PRO-FACE人機...................................55
5.1.3 伺服驅動器......................................56
5.1.4 伺服馬達........................................57
5.1.5 氣壓缸..........................................58
5.2 電鍍螺帽掛架機台之機構設計..........................59
5.3 機械手臂硬體架構與軟體架構..........................61
5.3.1 四軸機械手臂.....................................63
5.3.2 控制器...........................................65
5.3.3 工業相機.........................................66
5.3.4 工業鏡頭.........................................67
5.3.5 氣立夾爪.........................................69
5.3.6 結合LED光源、相機和鏡頭之治具式夾爪機構設計.........70
5.4拍攝焦距測試之系統架構...............................71
5.5 LabVIEW I/O卡應用..................................73
第6章 實驗結果與討論....................................74
6.1 伺服馬達電控系統整合................................74
6.2 PLC程序處理作業....................................78
6.2.1 程式架構之設計...................................80
6.2.2 PLC I/O表規劃....................................84
6.2.3 HMI與PLC的通訊連結...............................85
6.3 伺服馬達與移送平台控制流程..........................88
6.4 機械手臂電控系統整合................................91
6.5深度學習之資料庫建立.................................94
6.6模型訓練............................................97
6.6.1 模型訓練情況與評估................................99
6.6.2 模型測試.........................................101
6.7影像處理作業........................................101
6.7.1 機器視覺檢測.....................................102
6.7.2 色彩平面提取(Color Plane Extraction)...........103
6.7.3 模板匹配(Pattern Matching)....................104
6.7.4 遮罩(Mask)....................................105
6.7.5 二值化(Binarization)..........................106
6.7.6 形態學(Morphology)............................106
6.7.7 粒子濾波(Particle Filter).....................107
6.7.8 粒子分析(Particle Analysis)...................108
6.8動作流程處理作業....................................111
6.8.1 SCARA手臂程式架構之設計..........................112
6.8.2 機械手臂 I/O表規劃...............................114
6.8.3 機械手臂程式編寫軟體..............................115
6.9邏輯判斷處理作業.....................................115
6.9.1 LabVIEW I/O表規劃................................117
6.9.2 LabVIEW程式架構之設計.............................118
6.9.3 LabVIEW影像辨識之程式.............................122
第7章 結論.............................................124
參考文獻...............................................125


[1]H.-D. Lin and S. W. Chiu, Flaw detection of domed surfaces in LED packages by machine vision system, Expert Systems with Applications, Vol. 38, No. 12, pp. 15208-15216, 2011.
[2]R. Manish, A. Venkatesh, and S. Denis Ashok, Machine vision based image processing techniques for surface finish and defect inspection in a grinding process, Materials Today: Proceedings, Vol. 5, No. 5, Part 2, pp. 12792-12802, 2018.
[3]Y.-C. Chiou and W.-C. Li, Flaw detection of cylindrical surfaces in PU-packing by using machine vision technique, Measurement, Vol. 42, No. 7, pp. 989-1000, 2009.
[4]W. Liu et al., Binocular-vision-based error detection system and identification method for PIGEs of rotary axis in five-axis machine tool, Precision Engineering, Vol. 51, pp. 208-222, 2018.
[5]M. Dowlati, M. de la Guardia, M. Dowlati, and S. S. Mohtasebi, Application of machine-vision techniques to fish-quality assessment, TrAC Trends in Analytical Chemistry, Vol. 40, pp. 168-179, 2012.
[6]L. Panahi and V. Ghods, Human fall detection using machine vision techniques on RGB–D images, Biomedical Signal Processing and Control, Vol. 44, pp. 146-153, 2018.
[7]L. Ying-Jie and Y. Fu-Cheng, Postmark date recognition based on machine vision, physics procedia, Vol. 33, pp. 819-826, 2012.
[8]J. Zheng, Y. Zhao, M. Ge, W. Bi, and P. Ge, Machine vision-based transverse vibration measurement of diamond wire, Precision Engineering, Vol. 80, pp. 115-126, 2023.
[9]Y. D. Chethan, H. V. Ravindra, and Y. T. Krishne gowda, Machined surface monitoring in turning using histogram analysis by machine vision, Materials Today: Proceedings, Vol. 5, No. 2, Part 2, pp. 7775-7781, 2018.
[10]T. Yuan-yuan, L. Si-yang, and T. Qing-chang, Application of detecting part's size online based on machine vision, Energy Procedia, Vol. 16, pp. 1948-1956, 2012.
[11]S. Palei, S. K. Behera, and P. K. Sethy, A systematic review of citrus disease perceptions and fruit grading using machine vision, Procedia Computer Science, Vol. 218, pp. 2504-2519, 2023.
[12]W. He et al., A review: The detection of cancer cells in histopathology based on machine vision, Computers in Biology and Medicine, Vol. 146, p. 105636, 2022.
[13]S. Kaushik, A. Jain, T. Chaudhary, and N. R. Chauhan, Machine vision based automated inspection approach for clutch friction disc (CFD), Materials Today: Proceedings, Vol. 62, pp. 151-157, 2022.
[14]Z. Yan et al., Machine vision-based tomato plug tray missed seeding detection and empty cell replanting, Computers and Electronics in Agriculture, Vol. 208, p. 107800, 2023.
[15]S. Jin, Z. Yang, G. Królczykg, X. Liu, P. Gardoni, and Z. Li, Garbage detection and classification using a new deep learning-based machine vision system as a tool for sustainable waste recycling, Waste Management, Vol. 162, pp. 123-130, 2023.
[16]R. Azadnia, A. Jahanbakhshi, S. Rashidi, M. khajehzadeh, and P. Bazyar, Developing an automated monitoring system for fast and accurate prediction of soil texture using an image-based deep learning network and machine vision system, Measurement, Vol. 190, p. 110669, 2022.
[17]D. Rong, H. Wang, L. Xie, Y. Ying, and Y. Zhang, Impurity detection of juglans using deep learning and machine vision, Computers and Electronics in Agriculture, Vol. 178, p. 105764, 2020.
[18]R. Hadipour-Rokni, E. Askari Asli-Ardeh, A. Jahanbakhshi, I. Esmaili paeen-Afrakoti, and S. Sabzi, Intelligent detection of citrus fruit pests using machine vision system and convolutional neural network through transfer learning technique, Computers in Biology and Medicine, Vol. 155, p. 106611, 2023.
[19]B. Xiao, Q. Lin, and Y. Chen, A vision-based method for automatic tracking of construction machines at nighttime based on deep learning illumination enhancement, Automation in Construction, Vol. 127, p. 103721, 2021.
[20]B. Jiang et al., Fusion of machine vision technology and AlexNet-CNNs deep learning network for the detection of postharvest apple pesticide residues, Artificial Intelligence in Agriculture, Vol. 1, pp. 1-8, 2019.
[21]譚孟桓,機械視覺應用於四軸機械手臂之定向夾取,龍華科技大學 機械工程系,碩士論文,2014年。
[22]蔡浚騰,五軸機械手臂機構設計,吳鳳科技大學 光機電暨材料研究所,碩士論文,2012年。
[23]陳漢雄,機械手臂混合位置/阻抗控制之研究,國立臺灣科技大學 自動化及控制研究所,碩士論文,2010年。
[24]簡經倫,開發新型移動式輪胎文字動態辨識系統,國立雲林科技大學 機械工程系,碩士論文,2022年。
[25]S.-C. Wang, "Artificial Neural Network," in Interdisciplinary Computing in Java Programming, S.-C. Wang, Ed. Boston, MA: Springer US, 2003, pp. 81-100.
[26]伍俊嘉,基於深度卷積神經網路於熔模鑄件噴砂缺陷檢測之研究,國立雲林科技大學 機械工程系,碩士論文,2021年。
[27]曾書瀚,基於YoLoV5即時行人交通號誌燈識別,元智大學 電機工程學系,碩士倫文,2022年
[28]梁家瑋,結合深度學習與機器視覺於口罩缺陷檢測之研究,國立雲林科技大學 機械工程系,碩士論文,2022年。
[29]葉家瑋,結合深度學習與機器視覺於巨量電鍍組件之自動掛載系統開發,國立雲林科技大學 機械工程系,碩士論文,2022年。
[30]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.
[31]Medium. Available: https://chih-sheng-huang821.medium.com/
[32]Roboflow. Available: https://blog.roboflow.com/yolov5-is-here/
[33]P. Luo, X. Zhang, and Y. Wan, Lightweight YOLOv5 model based small target detection in power engineering, Cognitive Robotics, Vol. 3, pp. 45-53, 2023.
[34]J. Yuan et al., Identification method of typical defects in transmission lines based on YOLOv5 object detection algorithm, Energy Reports, Vol. 9, pp. 323-332, 2023.
[35]GitHub. Available: https://github.com/ultralytics/yolov5
[36]泰利達貿易有限公司, CYRUS. Available: https://www.cyrus-linear.com/product-detail.php?id=511&lang=tw
[37]羅博特科技有限公司, Robotech. Available: https://www.robot-tech.com.tw/product.php?MT_id=site2018042710124056
[38]寶視納公司, Basler. Available: https://www.baslerweb.com/zh-tw/products/cameras/area-scan-cameras/ace/aca2500-14uc/
[39]中和碁電股份有限公司, JIDIEN. Available: https://www.jidien.com/zh_tw/product/ins.php?index_m1_id=0&index_id=143
[40]台灣氣立, CHELIC. Available: https://www.chelic.com.tw/products_Info/ProductGripperList/4/HDQ3/1/40