Suzhou Electric Appliance Research Institute
期刊號: CN32-1800/TM| ISSN1007-3175

SUBSCRIPTION MANAGEMENT

發(fā)行征訂

首頁 >> 發(fā)行征訂 >> 征訂方式

基于STM32微控制器的表面缺陷視覺檢測方法

來源:電工電氣發(fā)布時間:2024-03-11 08:11瀏覽次數:204

基于STM32微控制器的表面缺陷視覺檢測方法

汪國平1,胡博2,陳仲生1,3,侯幸林3
(1 湖南工業(yè)大學 電氣與信息工程學院,湖南 株洲 412007;
2 南京理工大學 瞬態(tài)物理國家重點實驗室,江蘇 南京 210094;
3 常州工學院 汽車工程學院, 江蘇 常州 213032)
 
    摘 要:表面缺陷檢測是產品質檢的重要工序之一,現有深度學習視覺檢測大多基于云端服務器,存在模型大、算力需求高、成本高等不足。以 STM32 微控制器為核心,提出了一種基于輕量化網絡的表面缺陷視覺檢測方法,采用輕量級 SSD 作為缺陷檢測模型,利用 MobileNetV1 替換原有的骨干網絡 VGG-16 以減小網絡規(guī)模;采用 INT8 量化的訓練后量化方法對模型進行計算加速,生成的 TFlite 模型僅有 578 KB,運行占用 RAM 僅為 288.29 KB,并在 STM32 微控制器中實現了模型的移植和部署。實驗測試結果表明,該方法能實現鋰電池表面劃痕和凹坑兩種缺陷的邊緣側準確檢測。
    關鍵詞: 表面缺陷檢測;輕量化網絡;視覺檢測;STM32 微控制器
    中圖分類號:TM930.12+6 ;TM930.9     文獻標識碼:A     文章編號:1007-3175(2024)02-0047-06
 
Visual Detection Method of Surface Defects Based on STM32 Microcontroller
 
WANG Guo-ping1, HU Bo2, CHEN Zhong-sheng1,3, HOU Xing-lin3
(1 College of Electrical and Information Engineering, Hunan University of Technology, Zhuzhou 412007, China;
2 National Key Laboratory of Transient Physics, Nanjing University of Science and Technology, Nanjing 210094, China;
3 College of Automotive Engineering, Changzhou Institute of Technology, Changzhou 213032, China)
 
    Abstract: Surface defect detection is one of important processes of product quality inspection, most of existing deep learning visual inspection is based on cloud servers, which has disadvantages of large models, high requirements of computing power and high costs. To this end, this paper uses the STM32 microcontroller as the core and proposes an light-weight network-based visual detection method of surface defects. Firstly, the lightweight SSD is used as the defect detection model, where the original backbone network VGG-16 is replaced by the MobileNetv1 to reduce the network scale. Then, the post-training quantization method based on the INT8 quantization is used to accelerate the model calculation, and the generated TFlite model was only 578 KB, and the RAM occupied by operation was only 288.29 KB, and the model was ported and deployed in the STM32 microcontroller. Finally, the experimental test results show that the proposed method can accurately detect the edge side of scratches and pits on the surface of lithium batteries.
    Key words: surface defect detection; light-weight network; visual detection; STM32 microcontroller
 
參考文獻
[1] 段瑞玲,李慶祥,李玉和. 圖像邊緣檢測方法研究綜述[J]. 光學技術,2005,31(3) :415-419.
[2] 陳凱,朱鈺. 機器學習及其相關算法綜述[J]. 統計與信息論壇,2007,22(5) :105-112.
[3] 張慧,王坤峰,王飛躍. 深度學習在目標視覺檢測中的應用進展與展望[J] . 自動化學報,2017,43(8) :1289-1305.
[4] REN Shaoqing, HE Kaiming, GIRSHICK R, et al.Faster r-cnn:Towards real-time object detection with region proposal networks[J].Advances in Neural Information Processing Systems,2015,28 :91-99
[5] RANI S, GHAI D, KUMAR S.Object detection and recognition using contour based edge detection and fast R-CNN [J].Multimedia Tools and Applications,2022,81(29) :847-871.
[6] HU Bing, WANG Jianhui.Detection of PCB surface defects with improved faster-RCNN and feature pyramid network [J].IEEE Access,2020,8:108335-108345.
[7] JIANG Peiyuan, ERGU D, LIU Fangyao, et al.A Review of Yolo Algorithm Developments[J].Procedia Computer Science,2022,199 :1066-1073.
[8] ROGELIO J, DADIOS E, BANDALA A, et al. Alignment control using visual servoing and mobilenet single-shot multi-box detection (SSD) : A review[J].International Journal of Advances in Intelligent Informatics,2022,8(1) :97-114.
[9] 曹義親,伍銘林,徐露. 基于改進 YOLOv5 算法的鋼材表面缺陷檢測[J]. 圖學學報,2023,44(2) :335-345.
[10] LI Yiting, HUANG Haisong, XIE Qingsheng, et al.Research on a surface defect detection algorithm based on MobileNet-SSD[J].Applied Sciences,2018,8(9) :1-17.
[11] CHEN Jiasi, RAN Xukan.Deep learning with edge computing:A review[J].Proceedings of the IEEE,2019,107(8) :1655-1674.
[12] WANG X, HAN Y, LEUNG V C M, et al.Convergence of edge computing and deep learning : A comprehensive survey[J].IEEE Communications Surveys & Tutorials,2020,22(2) :869-904.
[13] LU Xiaocong, JI Jian, XING Zhiqi, et al.Attention and feature fusion SSD for remote sensing object detection[J].IEEE Transactions on Instrumentation and Measurement,2021,70 :1-9.
[14] ABDAR M, POURPANAH F, HUSSAIN S, et al.A review of uncertainty quantification in deep learning:Techniques,applications and challenges[J].Information Fusion,2021,76 :243-297.