Suzhou Electric Appliance Research Institute
期刊號(hào): CN32-1800/TM| ISSN1007-3175

Article retrieval

文章檢索

首頁 >> 文章檢索 >> 往年索引

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

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

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

汪國平1,胡博2,陳仲生1,3,侯幸林3
(1 湖南工業(yè)大學(xué) 電氣與信息工程學(xué)院,湖南 株洲 412007;
2 南京理工大學(xué) 瞬態(tài)物理國家重點(diǎn)實(shí)驗(yàn)室,江蘇 南京 210094;
3 常州工學(xué)院 汽車工程學(xué)院, 江蘇 常州 213032)
 
    摘 要:表面缺陷檢測是產(chǎn)品質(zhì)檢的重要工序之一,現(xiàn)有深度學(xué)習(xí)視覺檢測大多基于云端服務(wù)器,存在模型大、算力需求高、成本高等不足。以 STM32 微控制器為核心,提出了一種基于輕量化網(wǎng)絡(luò)的表面缺陷視覺檢測方法,采用輕量級 SSD 作為缺陷檢測模型,利用 MobileNetV1 替換原有的骨干網(wǎng)絡(luò) VGG-16 以減小網(wǎng)絡(luò)規(guī)模;采用 INT8 量化的訓(xùn)練后量化方法對模型進(jìn)行計(jì)算加速,生成的 TFlite 模型僅有 578 KB,運(yùn)行占用 RAM 僅為 288.29 KB,并在 STM32 微控制器中實(shí)現(xiàn)了模型的移植和部署。實(shí)驗(yàn)測試結(jié)果表明,該方法能實(shí)現(xiàn)鋰電池表面劃痕和凹坑兩種缺陷的邊緣側(cè)準(zhǔn)確檢測。
    關(guān)鍵詞: 表面缺陷檢測;輕量化網(wǎng)絡(luò);視覺檢測;STM32 微控制器
    中圖分類號(hào):TM930.12+6 ;TM930.9     文獻(xiàn)標(biāo)識(shí)碼:A     文章編號(hào):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
 
參考文獻(xiàn)
[1] 段瑞玲,李慶祥,李玉和. 圖像邊緣檢測方法研究綜述[J]. 光學(xué)技術(shù),2005,31(3) :415-419.
[2] 陳凱,朱鈺. 機(jī)器學(xué)習(xí)及其相關(guān)算法綜述[J]. 統(tǒng)計(jì)與信息論壇,2007,22(5) :105-112.
[3] 張慧,王坤峰,王飛躍. 深度學(xué)習(xí)在目標(biāo)視覺檢測中的應(yīng)用進(jìn)展與展望[J] . 自動(dòng)化學(xué)報(bào),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] 曹義親,伍銘林,徐露. 基于改進(jìn) YOLOv5 算法的鋼材表面缺陷檢測[J]. 圖學(xué)學(xué)報(bào),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.