-
摘要:
氨气是重要的基础工业原材料,实现其非接触探测对于及时发现氨气泄漏,避免重大安全事故发生具有重要意义。针对常规氨气泄漏检测装置需等到氨气扩散到一定范围并与传感器接触时才能响应的不足,提出一种混洗自注意力网络(SSANet)模型实现氨气泄漏红外非接触检测。因红外热像仪获取的氨气泄漏图像含噪高、对比度低,故通过非局部均值去噪、限制对比度的自适应直方图均衡化预处理建立氨气泄漏红外检测数据集。SSANet模型在YOLOv5s基础上通过K-means算法聚类分析出适用于氨气泄漏红外检测的候选框以预置模型参数;采用轻量级ShuffleNetv2网络,将其Shuffle Block中的3×3的深度可分离卷积核替换为5×5,采用含有新卷积模块的SK5 Block对特征提取网络进行重构,使模型大小、计算量和参数量实现轻量化的同时提高检测精度;采用Transformer模块代替原网络瓶颈模块中的C3模块实现泄漏区域多头注意力自底向上融合,实现检测精度的再次提升。实验结果表明,SSANet模型较YOLOv5s基础模型大小和参数量分别减少76.40%、78.30%,降为3.40 M、1.53 M;单张图像平均检测速度提升1.10%,达到3.20 ms;平均检测精度提升3.50%,达到96.30%。本文为开发氨气泄漏非接触探测装置以保障涉氨企业的安全生产和稳定运行提供了一种有效的检测算法。
-
关键词:
- 氨气泄漏检测 /
- 红外图像 /
- 聚类分析 /
- 轻量化结构 /
- Transformer模块
Abstract:Ammonia gas is an important basic industrial raw material, and realizing its non-contact detection is of great significance for the timely detection of ammonia gas leaks to avoid major safety incidents. Aiming at the shortcoming of conventional ammonia leak detection devices that can only respond when ammonia diffuses to a certain range and makes contact with a sensor, a Shuffling Self-Attention Network (SSANet) model is proposed to realize the infrared non-contact detection of ammonia leaks. Due to the high noise and low contrast of ammonia leakage images obtained by infrared cameras, an infrared detection dataset of ammonia leakage was established through non-local mean denoising and contrast-limited adaptive histogram equalization preprocessing. On the basis of YOLOv5s, the SSANet model uses the K-means algorithm to cluster and analyze the candidate frame suitable for the infrared detection of ammonia gas leakage to preset the model’s parameters. Using the lightweight ShuffleNetv2 network, the depth of 3×3 in the Shuffle Block can be adjusted. The separate convolution kernel is replaced with a 5×5 depth, and the feature extraction network is reconstructed with an SK5 Block containing a new convolution module, which makes the model size, calculation and parameters non-intensive while improving the detection accuracy. The Transformer module is used instead of its original version. The C3 module in the network bottleneck module is replaced by Transformer module to realize the bottom-up fusion of multi-head attention in the leake area, and further improves the detection accuracy. The experimental results show that the size and parameter requirements of the SSANet model are reduced by 76.40% and 78.30%, respectively, to 3.40 M and 1.53 M compared with the basic model of YOLOv5s; the average detection speed of a single image is increased by 1.10% to 3.20 ms; and the average detection accuracy is increased by 3.50% , reaching 96.30%. We provide an effective detection algorithm for the development of a non-contact detection device for ammonia leakage to ensure the safe production and stable operation of ammonia-related enterprises.
-
Key words:
- ammonia leak detection /
- infrared image /
- cluster analysis /
- lightweight structure /
- transformer module
-
表 1 聚类前后3个检测层初始候选框尺寸情况
Table 1. Initial candidate frame sizes of the three detection layers before and after clustering
检测层 聚类前 聚类后 检测层1 (10,13)、(16,30)、(33,23) (11,10)、(29,12)、(34,29) 检测层2 (30,61)、(62,45)、(59,119) (52,61)、(62,18)、(64,38) 检测层3 (116,90)、(156,198)、(373,326) (91,38)、(115,22)、(201,45) 表 2 超参数配置
Table 2. Hyperparameter configuration
超参数名称 超参数值 批大小 16 初始学习率 0.01 迭代次数 400 动量 0.937 学习率衰减策略 余弦退火策略 权重衰减 0.0005 表 3 图像预处理的定量评价指标
Table 3. Objective evaluation indicators of image preprocessing algorithms
图像 PSNR/dB AG IE 原图像 23.40 1.90 7.06 预处理图像 2.17 7.53 表 4 图像预处理前后网络性能对比
Table 4. Comparison of network performances before and after image preprocessing
模型 Params/M Model size/M Speed/ms mAP/% YOLOv5s 7.05 14.40 3.60 92.80 Prep-YOLOv5s 7.05 14.40 3.60 93.80 表 5 聚类前后网络性能对比
Table 5. Comparison of network performance before and after clustering
模型 Params/M Model size/M Speed/ms mAP/% YOLOv5s 7.05 14.40 3.60 92.80 Kms-YOLOv5s 7.05 14.40 3.60 93.70 Kms-Prep-YOLOv5s 7.05 14.40 3.60 94.30 表 6 不同特征提取网络评估指标对比
Table 6. Comparison of evaluation indicators for different backbone networks
模型 GFLOPs Model
size/MParams
/MSpeed
/msmAP
/%GhostNet-YOLOv5s 10.60 10.50 5.08 3.00 93.90 MobileNetv3-YOLOv5s 6.30 7.40 3.54 2.80 93.50 ShuffleNetv2-YOLOv5s 4.60 3.40 1.53 2.70 93.80 SK5-YOLOv5s 4.80 3.40 1.57 2.70 94.40 表 7 不同BottleNeck结构网络性能对比
Table 7. Comparison of network performance of different BottleNeck structures
模型 Model
size/MParams
/MSpeed
/msmAP
/%SK5-YOLOv5s 3.40 1.57 2.70 94.40 SK5-YOLOv5s-CSPBottleNeck 3.40 1.54 2.70 93.70 SK5-YOLOv5s-GhostBottleNeck 3.30 1.50 2.60 94.20 SK5-YOLOv5s-CbamBottleNeck 3.20 1.47 2.50 92.90 SSANet 3.40 1.53 3.20 96.30 表 8 不同模型精度对比
Table 8. Accuracy comparison of different models
Model GFLOPs Params/M Model size/M Speed/ms mAP/% YOLOv3 154.7 61.50 123.40 11.70 92.70 YOLOv3-tiny 12.90 8.70 17.40 3.40 37.40 YOLOv5s 16.30 7.05 14.40 3.60 92.80 YOLOx 26.64 8.94 71.90 8.43 89.78 SSANet 4.60 1.53 3.40 3.20 96.30 -
[1] 杜晓燕, 程五一, 闫瑞青, 等. 我国涉氨制冷企业氨泄漏事故规律性研究[J]. 消防科学与技术,2017,36(6):857-860. doi: 10.3969/j.issn.1009-0029.2017.06.045DU X Y, CHENG W Y, YAN R Q, et al. Study on regularity of ammonia leakage accident of ammonia refrigeration enterprises in China[J]. Fire Science and Technology, 2017, 36(6): 857-860. (in Chinese) doi: 10.3969/j.issn.1009-0029.2017.06.045 [2] 胡继粗, 陈明鹏, 荣茜, 等. 氨气传感材料及器件的研究进展[J]. 功能材料,2019,50(4):4030-4037+4048. doi: 10.3969/j.issn.1001-9731.2019.04.006HU J C, CHEN M P, RONG Q, et al. Research progress of ammonia gas sensing materials and devices[J]. Journal of Functional Materials, 2019, 50(4): 4030-4037+4048. (in Chinese) doi: 10.3969/j.issn.1001-9731.2019.04.006 [3] 克迪里亚·吾麦尔, 姑丽各娜·买买提依明, 买买提艾沙·苏莱曼, 等. 高灵敏复合光波导硫化氢气体传感器的研究[J]. 光学学报,2020,40(24):2428001.WUMAIER K, MAMTIMIN G, SULAIMAN M, et al. Highly-sensitive hydrogen-sulfide gas sensor based on composite optical waveguide[J]. Acta Optica Sinica, 2020, 40(24): 2428001. (in Chinese) [4] 丁一, 刁泉, 刘东, 等. 石墨烯量子点的合成及其在气体传感中的应用进展[J]. 分析化学,2022,50(4):495-505. doi: 10.19756/j.issn.0253-3820.210843DING Y, DIAO Q, LIU D, et al. Synthesis of graphene quantum dots and application in gas sensing[J]. Chinese Journal of Analytical Chemistry, 2022, 50(4): 495-505. (in Chinese) doi: 10.19756/j.issn.0253-3820.210843 [5] 刘金正, 张立学. 原子层沉积技术在电分析化学中的应用研究进展[J]. 分析化学,2021,49(11):1767-1778. doi: 10.19756/j.issn.0253-3820.210481LIU J ZH, ZHANG L X. Progress in application of atomic layer deposition technique in electroanalytical chemistry[J]. Chinese Journal of Analytical Chemistry, 2021, 49(11): 1767-1778. (in Chinese) doi: 10.19756/j.issn.0253-3820.210481 [6] 唐连波, 付大友, 陈琦, 等. 碳量子点增强气液相化学发光检测二氧化碳[J]. 应用化学,2022,39(8):1294-1302. doi: 10.19894/j.issn.1000-0518.210465TANG L B, FU D Y, CHEN Q, et al. Enhanced gas-liquid chemiluminescence by carbon dots for determination of carbon dioxide[J]. Chinese Journal of Applied Chemistry, 2022, 39(8): 1294-1302. (in Chinese) doi: 10.19894/j.issn.1000-0518.210465 [7] 赵鹏鹏, 李庶中, 李迅, 等. 融合视觉显著性和局部熵的红外弱小目标检测[J]. 中国光学,2022,15(2):267-275. doi: 10.37188/CO.2021-0170ZHAO P P, LI SH ZH, LI X, et al. Infrared dim small target detection based on visual saliency and local entropy[J]. Chinese Optics, 2022, 15(2): 267-275. (in Chinese) doi: 10.37188/CO.2021-0170 [8] 张旭, 金伟其, 李力, 等. 天然气泄漏被动式红外成像检测技术及系统性能评价研究进展[J]. 红外与激光工程,2019,48(S2):53-65.ZHANG X, JIN W Q, LI L, et al. Research progress on passive infrared imaging detection technology and system performance evaluation of natural gas leakage[J]. Infrared and Laser Engineering, 2019, 48(S2): 53-65. (in Chinese) [9] 王建平, 李俊山, 杨亚威, 等. 基于红外成像的乙烯气体泄漏检测[J]. 液晶与显示,2014,29(4):623-628. doi: 10.3788/YJYXS20142904.0623WANG J P, LI J SH, YANG Y W, et al. Ethylene leaking detection based on infrared imaging[J]. Chinese Journal of Liquid Crystal and Display, 2014, 29(4): 623-628. (in Chinese) doi: 10.3788/YJYXS20142904.0623 [10] 隋中山, 李俊山, 张姣, 等. 基于张量低秩分解和稀疏表示的红外微小气体释放检测[J]. 光学精密工程,2016,24(11):2855-2862.SUI ZH SH, LI J SH, ZHANG J, et al. Micro gas leakage detection based on tensor low rank decomposition and sparse representation from infrared images[J]. Optics and Precision Engineering, 2016, 24(11): 2855-2862. (in Chinese) [11] 林云. 基于深度学习的有害气体红外图像处理研究[D]. 杭州: 浙江工商大学, 2018.LIN Y. Research on infrared image processing of toxic gases based on deep learning algorithm[D]. Hangzhou: Zhejiang Gongshang University, 2018. (in Chinese) [12] 翁静, 袁盼, 王铭赫, 等. 基于支持向量机的泄漏气体云团热成像检测方法[J]. 光学学报,2022,42(9):0911002. doi: 10.3788/AOS202242.0911002WENG J, YUAN P, WANG M H, et al. Thermal imaging detection method of leak gas clouds based on support vector machine[J]. Acta Optica Sinica, 2022, 42(9): 0911002. (in Chinese) doi: 10.3788/AOS202242.0911002 [13] KASTEK M, PIATKOWSKI T, TRZASKAWKA P. Infrared imaging fourier transform spectrometer as the stand-off gas detection system[J]. Metrology &Measurement Systems, 2011, 18(4): 607-620. [14] BARBER R, RODRIGUEZ-CONEJO M A, MELENDEZ J, et al. Design of an infrared imaging system for robotic inspection of gas leaks in industrial environments[J]. International Journal of Advanced Robotic Systems, 2015, 12(3): 23. [15] SHI J H, CHANG Y J, XU CH H, et al. Real-time leak detection using an infrared camera and faster R-CNN technique[J]. Computers &Chemical Engineering, 2020, 135: 106780. [16] REDMON J, FARHADI A. YOLO9000: Better, Faster, Stronger[C]. IEEE Conference on Computer Vision and Pattern Recognition, IEEE, 2017: 7263-7271. [17] REDMON J, FARHADI A. YOLOv3: an incremental improvement[C]. Computer Vision and Pattern Recognition, Springer, 2018: 1804-2767. [18] BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection[J/OL]. arXiv: 2004.10934, 2020(2020-04-23). https://arxiv.org/abs/2004.10934 [19] JUBAYER F, SOEB J A, MOJUMDER A N, et al.. Detection of mold on the food surface using YOLOv5[J]. Current Research in Food Science, 2021, 4: 724-728. [20] LU Y H, ZHANG L W, XIE W. YOLO-compact: an efficient YOLO network for single category real-time object detection[C]//2020 Chinese Control And Decision Conference (CCDC). IEEE, 2020: 1931-1936. [21] KANUNGO T, MOUNT D M, NETANYAHU N S, et al. An efficient k-means clustering algorithm: analysis and implementation[J]. IEEE Transactions on Pattern Analysis &Machine Intelligence, 2002, 24(7): 881-892. [22] DOSOVITSKIY A, BEYER L, KOLESNIKOV A, et al.. An image is worth 16 x16 words: transformers for image recognition at scale[C]. 9th International Conference on Learning Representations, ICLR, 2020. [23] MA N N, ZHANG X Y, ZHENG H T, et al.. ShuffleNet V2: practical guidelines for efficient CNN architecture design[C]. Proceedings of the 15th European Conference on Computer Vision, Springer, 2018, 122-138. [24] VOITA E, TALBOT D, MOISEEV F, et al. Analyzing multi-head self-attention: specialized heads do the heavy lifting, the rest can be pruned[J]. Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics,Association for Computational Linguistics, 2019: 5797-5808. [25] XIONG R B, YANG Y C, HE D, et al.. On layer normalization in the transformer architecture[C]//Proceedings of the 37th International Conference on Machine Learning, PMLR, 2020: 10524-10533. [26] BUADES A, COLL B, MOREL J M. A non-local algorithm for image denoising[C]//2005 IEEE Computer Society Conference On Computer Vision and Pattern Recognition, IEEE, 2005, 2: 60-65. [27] REZA A M. Realization of the contrast limited adaptive histogram equalization (CLAHE) for real-time image enhancement[J]. Journal of VLSI Signal Processing Systems for Signal,Image and Video Technology, 2004, 38(1): 35-44. [28] 江泽涛, 钱艺, 伍旭, 等. 一种基于ARD-GAN的低照度图像增强方法[J]. 电子学报,2021,49(11):2160-2165.JIANG Z T, QIAN Y, WU X, et al. Low-light image enhancement method based on ARD-GAN[J]. Acta Electronica Sinica, 2021, 49(11): 2160-2165. (in Chinese) [29] 刘柯, 李旭健. 水下和微光图像的去雾及增强方法[J]. 光学学报,2020,40(19):1910003. doi: 10.3788/AOS202040.1910003LIU K, LI X J. De-hazing and enhancement methods for underwater and low-light images[J]. Acta Optica Sinica, 2020, 40(19): 1910003. (in Chinese) doi: 10.3788/AOS202040.1910003 [30] 江巨浪, 刘国明, 朱柱, 等. 基于快速模糊聚类的动态多直方图均衡化算法[J]. 电子学报,2022,50(1):167-176. doi: 10.12263/DZXB.20201040JIANG J L, LIU G M, ZHU ZH, et al. Dynamic multi-histogram equalization Based on fast fuzzy clustering[J]. Acta Electronica Sinica, 2022, 50(1): 167-176. (in Chinese) doi: 10.12263/DZXB.20201040 [31] HAN K, WANG Y H, TIAN Q, et al.. GhostNet: more features from cheap operations[C]. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, 2020: 1577-1586. [32] HOWARD A, SANDLER M, CHEN B, et al.. Searching for MobileNetV3[C]. 2019 IEEE/CVF International Conference on Computer Vision (ICCV). IEEE, 2020: 1314-1324 [33] GE ZH, LIU S T, WANG F, et al.. Yolox: exceeding yolo series in 2021[J/OL]. arXiv: 2107.08430, 2021(2021-08-06). https://arxiv.org/abs/2107.08430