Improved YOLOv5-based Infrared Dim-small Target Detection under Complex Background
-
摘要: 针对传统算法依赖于对红外目标与环境背景的精确分离和信息提取,难以满足复杂背景和噪声等干扰因素下的检测需求。论文提出一种基于改进YOLOv5(You Only Look Once)的复杂背景红外弱小目标检测算法。该算法在YOLOv5基础上,添加注意力机制提高算法的特征提取能力和检测效率,同时改进原YOLOv5目标检测网络的损失函数和预测框的筛选方式提高算法对红外弱小目标检测的准确率。实验选取了来自不同复杂背景的7组红外弱小目标数据集,将这些图像数据集进行标注并训练,得到红外弱小目标检测模型,然后从模型训练结果和目标检测结果的角度评估算法和模型的正确性。实验结果表明:改进的YOLOv5算法训练出来的模型,检测准确性和检测速度对比实验列出的几种目标检测算法均有明显的提升,平均精度均值(mean Average Precision,mAP)可达99.6%以上,在不同复杂背景下均可有效检测出红外弱小目标,且漏警率、虚警率低。Abstract: Using the traditional algorithm to meet the detection requirements of interference factors, such as complex background and noise, relying on the precise separation and information extraction of infrared targets and environmental background, is difficult. This paper presents a dim–small target detection method for an infrared imaging algorithm based on the improved YOLOv5 for complex backgrounds. Based on YOLOv5, an attention mechanism is introduced in the algorithm to improve the feature extraction ability and detection efficiency. In addition, the loss function and prediction box screening method of the original YOLOv5 target detection network are used to improve the accuracy of the algorithm for infrared dim–small target detection. In the experiment, seven sets of infrared dim–small target image datasets with different complex backgrounds are selected, the data are labeled and trained, and an infrared dim–small target detection model is established. Finally, the accuracy of the algorithm and model is evaluated in terms of the model training and target detection results. The experimental results show that the model trained by employing the improved YOLOv5 algorithm in this study has a significant improvement in detection accuracy and speed compared with several target detection algorithms used in the experiment, and the average accuracy can reach more than 99.6%. The model can effectively detect infrared dim–small targets in different complex backgrounds, and the leakage and false alarm rates are low.
-
Keywords:
- infrared dim-small target /
- complex backgrounds /
- YOLOv5 /
- attention mechanism /
- loss function
-
-
表 1 红外图像数据划分
Table 1 Infrared image data segmentation
Dataset Total Training set Validation set Test set data1 400 280 80 40 data2 400 280 80 40 data3 500 350 100 50 data4 500 350 100 50 data5 600 420 120 60 data6 600 420 120 60 data7 600 420 120 60 表 2 训练环境配置
Table 2 Training environment configuration
Parameters Configuration Operating system ubuntu16.04 Video memory 8G RAM 8G GPU NVIDIA GeForce GTX 1050 Ti GPU acceleration environment Training framework CUDA10.1
Pytorch表 3 训练参数配置
Table 3 Training parameters configuration
Parameters Configuration Model YOLOv5s Training rounds 50 Batch size 8 Weights Yolov5s.pt 表 4 算法模型结果对比
Table 4 Comparison of 5 model results
Parameters mAP Time/s SSD 78.88% 5.80 Faster R-CNN 90.33% 4.89 YOLOv3 97.55% 2.47 YOLOv5
Improved YOLOv598.76%
99.65%1.25
0.82 -
[1] GAO Jinyan, GUO Yulan, LIN Zaiping, et al. Robust infrared small target detection using multiscale gray and variance difference measures[J]. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2018, 11(12): 5039-5052. DOI: 10.1109/JSTARS.2018.2877501
[2] XU Yongli, WANG Weihua. A method for single frame detection of infrared dim small target in complex background[J]. Journal of Physics. Conference Series, 2020, 1634(1): 012063. DOI: 10.1088/1742-6596/1634/1/012063
[3] 马铭阳, 王德江, 孙翯, 等. 基于稳健主成分分析和多点恒虚警的红外弱小目标检测[J]. 光学学报, 2019, 39(8): 0810001. https://www.cnki.com.cn/Article/CJFDTOTAL-GXXB201908013.htm MA Mingyang, WANG Dejiang, SUN He, et al. Infrared dim-small target detection based on robust principal component analysis and multi-point constant false alarm[J]. Acta Photonica Sinica, 2019, 39(8): 0810001. https://www.cnki.com.cn/Article/CJFDTOTAL-GXXB201908013.htm
[4] 杨其利, 周炳红, 郑伟, 等. 基于全卷积网络的红外弱小目标检测算法[J]. 红外技术, 2021, 43(4): 349-356. http://hwjs.nvir.cn/article/id/3abe1943-0aea-49e7-b39f-cfad3d9c8ac4 YANG Qili, ZHOU Binghong, ZHENG Wei, et al. Infrared weak target detection algorithm based on full convolutional network[J]. Infrared Technology, 2021, 43(4): 349-356. http://hwjs.nvir.cn/article/id/3abe1943-0aea-49e7-b39f-cfad3d9c8ac4
[5] 仇国庆, 杨海静, 王艳涛, 等. 基于视觉特征融合的机载红外弱小目标检测[J]. 激光与光电子学进展, 2020, 57(18): 79-86. https://www.cnki.com.cn/Article/CJFDTOTAL-JGDJ202018007.htm QIU Guoqing, YANG Haijing, WANG Yantao, et al. Dim target detection in airborne infrared images based on visual feature fusion[J]. Laser & Optoelectronics Progress, 2020, 57(18): 79-86. https://www.cnki.com.cn/Article/CJFDTOTAL-JGDJ202018007.htm
[6] 陆福星, 李夜金, 陈忻, 等. 基于Top-hat变换的PM模型弱小目标检测[J]. 系统工程与电子技术, 2018, 40(7): 1417-1422. https://www.cnki.com.cn/Article/CJFDTOTAL-XTYD201807001.htm LU Fuxing, LI Yegin, CHEN Xin, et al. Weak target detection for PM model based on Top-hat transform[J]. Systems Engineering and Electronics, 2018, 40(7): 1417-1422. https://www.cnki.com.cn/Article/CJFDTOTAL-XTYD201807001.htm
[7] 汪烈兵, 姜雄飞, 石春光, 等. 基于图像滤波与Hough变换的红外弱小目标检测[J]. 红外技术, 2020, 42(7): 683-687. http://hwjs.nvir.cn/article/id/hwjs202007012 WANG Liebing, JIANG Xiongfei, SHI Chunguang, et al. Infrared small target detection based on image filtering and Hough transform[J]. Infrared Technology, 2020, 42(7): 683-687. http://hwjs.nvir.cn/article/id/hwjs202007012
[8] 韩金辉, 董兴浩, 蒋亚伟, 等. 基于局部对比度机制的红外弱小目标检测算法[J]. 红外技术, 2021, 43(4): 357-366. http://hwjs.nvir.cn/article/id/29b77b73-8c1e-4251-9ae4-c9f39e265270 HAN Jinhui, DONG Xinjhao, JIANG Yawei, et al. Infrared small dim target detection based on local contrast mechanism[J]. Infrared Technology, 2021, 43(4): 357-366. http://hwjs.nvir.cn/article/id/29b77b73-8c1e-4251-9ae4-c9f39e265270
[9] Kaveh Ahmadi, Ezzatollah Salari. Small dim object tracking using frequency and spatial domain information[J]. Pattern Recognition, 2016, 58: 227-234. DOI: 10.1016/j.patcog.2016.04.001
[10] 冯洋. 基于小波包变换的红外弱小目标检测[J]. 计算机与现代化, 2020(12): 112-115, 122. DOI: 10.3969/j.issn.1006-2475.2020.12.019 FENG Yang. Infrared dim small target detection based on wavelet packet transform[J]. Computers and Modernization, 2020(12): 112-115, 122. DOI: 10.3969/j.issn.1006-2475.2020.12.019
[11] 李德新, 钟洪. 基于差异梯度直方图与显著性映射的红外弱小目标检测算法[J]. 光学技术, 2021, 47(5): 594-600. https://www.cnki.com.cn/Article/CJFDTOTAL-GXJS202105015.htm LI Dexin, ZHONG Hong. Infrared dim small target detection algorithm based on difference histogram of oriented gradients and saliency map[J]. Optical Technique, 2021, 47(5): 594-600. https://www.cnki.com.cn/Article/CJFDTOTAL-GXJS202105015.htm
[12] ZHANG N, Donahue J, Girshick R, et al. Part-based R-CNNs for fine-grained category detection[C]//European Conference on Computer Vision, 2014: 834-849.
[13] Girshick R. Fast R-CNN[C]//Proceedings of the IEEE International Conference on Computer Vision, 2015: 1440-1448.
[14] 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.
[15] Redmon J, Divvala S, Girshick R, et al. You Only Look Once: real-time object detection[C]// IEEE Conference on Computer Vision and Pattern Recognition, 2016: 779-788.
[16] LIU W, Anguelov D, Erhan D, et al. SSD: Single shot multibox detector[C]//European Conference on Computer Vision, 2016: 21-37.
[17] 杨晓玲, 江伟欣, 袁浩然. 基于Yolov5的交通标志识别检测[J]. 信息技术与信息化, 2021(4): 28-30. DOI: 10.3969/j.issn.1672-9528.2021.04.005 YANG Xiaoling, JIANG Weixin, YUAN Haoran. Traffic sign recognition detection based on Yolov5[J]. Information Technology and Informatization, 2021(4): 28-30. DOI: 10.3969/j.issn.1672-9528.2021.04.005
[18] Lowe D G. Distinctive image features from scale invariant keypoints[J]. International Journal of Computer Vision, 2004, 60(2): 91-110. DOI: 10.1023/B:VISI.0000029664.99615.94
[19] 范有臣, 马旭, 马淑丽, 等. 深度学习在激光干扰效果评估中的应用[J/OL]. 红外与激光工程, [2021-08-03]: 1-8. FAN Youchen, MA Xu, MA Shuli et al. Evaluation method of laser jamming learning effect based on deep learning[J/OL]. Infrared and Laser Engineering, [2021-08-03]: 1-8.
[20] 林清平, 张麒麟, 肖蕾. 采用改进YOLOv5网络的遥感图像目标识别方法[J]. 空军预警学院学报, 2021, 35(2): 117-120. https://www.cnki.com.cn/Article/CJFDTOTAL-KLDX202102008.htm LIN Qingping, ZHANG Qilin, XIAO Lei. A remote sensing image target recognition method using improved YOLOv5 network[J]. Journal of Air Force Early Warning Academy, 2021, 35(2): 117-120. https://www.cnki.com.cn/Article/CJFDTOTAL-KLDX202102008.htm
[21] 王宇宁, 庞智恒, 袁德明. 基于YOLO算法的车辆实时检测[J]. 武汉理工大学学报, 2016, 38(10): 41-46. DOI: 10.3963/j.issn.1671-4431.2016.10.008 WANG Yuning, PANG Zhiheng, YUAN Deming. Vehicle detection based on YOLO in real time[J]. Journal of Wuhan University of Technology, 2016, 38(10): 41-46. DOI: 10.3963/j.issn.1671-4431.2016.10.008
[22] 周飞燕, 金林鹏, 董军. 卷积神经网络研究综述[J]. 计算机学报, 2017, 40(6): 1229-1251. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJX201706001.htm ZHOU Feiyan, JIN Linpeng, DONG Jun. Review of convolutional neural network[J]. Chinese Journal of Computers, 2017, 40(6): 1229-1251. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJX201706001.htm
[23] ZHOU Junchi et al. Ship target detection algorithm based on improved YOLOv5[J]. Journal of Marine Science and Engineering, 2021, 9(8): 908-908. DOI: 10.3390/jmse9080908
[24] 张宏群, 班勇苗, 郭玲玲, 等. 基于YOLOv5的遥感图像舰船的检测方法[J]. 电子测量技术, 2021, 44(8): 87-92. https://www.cnki.com.cn/Article/CJFDTOTAL-DZCL202108017.htm ZHANG Hongqun, BAN Yongmiao, GUO Lingling, et al. Detection method of remote sensing image ship based on YOLOv5[J]. Electronic Measurement Technology, 2021, 44(8): 87-92. https://www.cnki.com.cn/Article/CJFDTOTAL-DZCL202108017.htm