Digital recognition method of methane sensor based on improved CNN-SVM
-
摘要: 甲烷传感器材质存在光反射,显示面板上有附着物,造成甲烷传感器自动检定系统采集的传感器数值图像质量较差,对字符识别困难。而现有的基于机器学习的仪表字符识别方法识别率较低、算法运行速度较慢。针对上述问题,提出了一种基于改进卷积神经网络(CNN)−支持向量机(SVM)的甲烷传感器数显识别方法。通过图像增强、数值区域图像提取、图像分割、小数点定位等4个步骤对甲烷传感器数值图像进行预处理,并将处理后的数字图像作为自定义数据集。针对CNN−SVM模型运行时间较长的问题,使用PCA算法对CNN全连接层提取的图像特征进行降维处理,用最主要数据特征代替原始数据作为SVM分类器的样本进行分类识别。在自建数据集上的验证结果表明,与传统CNN模型和CNN−SVM模型相比,改进CNN−SVM模型的准确率更高,运行时间更短。在经典MNIST数据集上的验证结果表明,综合考虑精度和实时性要求,改进CNN−SVM模型的综合性能优于CRNN,SSD,YOLOv3,Faster R−CNN等模型。采用微型高清USB摄像头采集甲烷传感器数值图像,将训练好的改进CNN−SVM模型移植到树莓派中进行图像处理和识别,结果表明,基于改进CNN−SVM的甲烷传感器数显识别方法的识别成功率为99%,与仿真分析结果一致。Abstract: The methane sensor material has light reflection, and there are attachments on the display panel, which causes the poor quality of the sensor numerical image collected by the automatic verification system of methane sensor, and the difficulty of character recognition. However, the existing instrument character recognition methods based on machine learning have low recognition rate and slow algorithm running speed. In order to solve the above problems, a digital recognition method of methane sensor based on improved convolutional neural network (CNN) and support vector machine (SVM) is proposed. The numerical image of methane sensor is preprocessed by four steps, including image enhancement, numerical region image extraction, image segmentation and decimal point positioning. And the processed digital images are taken as a custom data set. In order to solve the problem of long running time of the CNN-SVM model, PCA algorithm is used to reduce the dimension of the image characteristics extracted from the CNN fully connected layer, and the most important data characteristics are used to replace the original data as the samples of the SVM classifier for classification and recognition. The verification results on the custom dataset show that the improved CNN-SVM model has higher accuracy and shorter running time than the traditional CNN model and CNN-SVM model. The verification results on the classical MNIST dataset show that considering the precision and real-time requirements, the improved CNN-SVM model has better comprehensive performance than CRNN, SSD, YOLOv3 and Faster R-CNN. A micro high-definition USB camera is used to collect the numerical images of methane sensor. The trained improved CNN-SVM model is transplanted to raspberry pi for image processing and recognition. The results show that the recognition success rate of methane sensor digital recognition method based on improved CNN-SVM is 99%, which is consistent with the simulation analysis results.
-
表 1 3种模型识别结果对比
Table 1. Comparison of recognition results of three models
模型 准确率/% 时间/s 传统CNN 96.5 134.56 CNN−SVM 98.2 120.92 改进CNN−SVM 99.1 108.34 表 2 主流深度学习模型训练参数
Table 2. Training parameters of mainstream deep learning models
模型 初始学习率 优化器 学习动量 权重衰减 批量大小 CRNN 0.0003 Adam 0.9 0.00050 64 SSD 0.0003 SGD 0.9 0.00050 16 YOLOv3 0.0010 Adam 0.9 0.00045 8 Faster R−CNN 0.0010 SGD 0.9 0.00050 4 表 3 实验结果对比
Table 3. Comparison of experimental results
模型 准确率/% 帧率/(帧·s−1) CRNN 94.9 75 SSD 95.4 59 YOLOv3 95.7 85 Faster R−CNN 97.4 60 改进CNN−SVM 99.0 80 -
[1] 陈英, 李磊, 汪文源, 等. 家用水表字符的识别算法研究[J]. 现代电子技术,2018,41(18):99-103.CHEN Ying, LI Lei, WANG Wenyuan, et al. Research on character recognition algorithm for domestic water meter[J]. Modern Electronics Technique,2018,41(18):99-103. [2] 潘帅成, 韩磊, 陶毅, 等. 基于卷积神经网络的水表字符识别方法研究[J]. 计算机时代,2020(2):25-28.PAN Shuaicheng, HAN Lei, TAO Yi, et al. Research on character recognition technology for watermeter based on deep convolution neural network[J]. Computer Era,2020(2):25-28. [3] 肖佳. 基于机器视觉的数字仪表自动读数方法研究[D]. 重庆: 重庆大学, 2017.XIAO Jia. Study on automatic reading method of digital instrument based on machine vision[D]. Chongqing: Chongqing University, 2017. [4] CALEFATI A, GALLO I, NAWAZ S. Reading meter numbers in the wild[C]//Digital Image Computing: Techniques and Applications, Perth, 2019: 1-6. [5] 高晓利, 李捷, 王维, 等. 基于CRNN的汽车发动机声纹个体识别方法[J]. 火力与指挥控制,2021,46(3):150-153. doi: 10.3969/j.issn.1002-0640.2021.03.025GAO Xiaoli, LI Jie, WANG Wei, et al. Individual identification method of automobile engine voiceprint based on CRNN[J]. Fire Control & Command Control,2021,46(3):150-153. doi: 10.3969/j.issn.1002-0640.2021.03.025 [6] SAI K M, CHANDRIKA P H, BEBE K, et al. Optical character recognition using CRNN[J]. International Journal of Innovative Technology and Exploring Engineering,2020,9(8):115-120. doi: 10.35940/ijitee.H6264.069820 [7] LIU W, ANGUELOV D, ERHAN D, et al. SSD: Single shot multibox detector[C]//European Conference on Computer Vision, 2016: 21-37. [8] REN S, HE K, GIRSHICK R, et al. Faster R-CNN: Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis & Machine Intelligence,2017,39(6):1137-1149. [9] LIN Xiaoping, DUAN Peiyong, ZHENG Yuanjie, et al. Posting techniques in indoor environments based on deep learning for intelligent building lighting system[J]. IEEE Access,2020,8:13674-13682. doi: 10.1109/ACCESS.2019.2959667 [10] 孟彩茹, 宋京, 孙明扬. 基于改进CNN与SVM的手势识别研究[J]. 现代电子技术,2020,43(22):128-131.MENG Cairu, SONG Jing, SUN Mingyang. Research on gesture recognition based on improved CNN and SVM[J]. Modern Electronics Technique,2020,43(22):128-131. [11] 黄洁. 非色散红外甲烷传感器自动检定系统研究[D]. 徐州: 中国矿业大学, 2020.HUANG Jie. Research on automatic verification system of non-dispersive infrared methane sensor[D]. Xuzhou: China University of Mining and Technology, 2020. [12] 林仁耀, 邓浩伟, 兰红. 卷积神经网络结合SVM的手写数字识别算法[J]. 通信技术,2019,52(10):2389-2394. doi: 10.3969/j.issn.1002-0802.2019.10.012LIN Renyao, DENG Haowei, LAN Hong. Handwritten digits recognition algorithm based on convolutional neural network and SVM[J]. Communications Technology,2019,52(10):2389-2394. doi: 10.3969/j.issn.1002-0802.2019.10.012 [13] 刘昶, 徐超远, 张鑫, 等. 液晶字符识别的CNN和SVM组合分类器[J]. 图学学报,2021,42(1):15-22.LIU Chang, XU Chaoyuan, ZHANG Xin, et al. A combined classifier based on CNN and SVM for LCD character recognition[J]. Journal of Graphics,2021,42(1):15-22.