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

Article retrieval

文章检索

首页 >> 文章检索 >> 最新索引

基于STM32微控制器的表面缺陷视觉检测方法

来源:电工电气发布时间:2024-03-11 08:11 浏览次数:58

基于STM32微控制器的表面缺陷视觉检测方法

汪国平1,胡博2,陈仲生1,3,侯幸林3
(1 湖南工业大学 电气与信息工程学院,湖南 株洲 412007;
2 南京理工大学 瞬态物理国家重点实验室,江苏 南京 210094;
3 常州工学院 汽车工程学院, 江苏 常州 213032)
 
    摘 要:表面缺陷检测是产品质检的重要工序之一,现有深度学习视觉检测大多基于云端服务器,存在模型大、算力需求高、成本高等不足。以 STM32 微控制器为核心,提出了一种基于轻量化网络的表面缺陷视觉检测方法,采用轻量级 SSD 作为缺陷检测模型,利用 MobileNetV1 替换原有的骨干网络 VGG-16 以减小网络规模;采用 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.