Improved SSD Object Detection Algorithm Based on Contrastive Learning
-
摘要:
现有基于深度学习的目标检测算法在图像的目标检测过程中存在物体视角的多样性、目标本身形变、检测物体受遮挡、光照性以及小目标检测等问题。为了解决这些问题,本文将对比学习思想引入到SSD(Single Shot MutiBox Detectior)目标检测网络中,对原有的SSD算法进行改进。首先,通过采用图像截块的方式随机截取样本图片中的目标图片与背景图片,将目标图像块与背景图像块输入到对比学习网络中提取图片特征进行对比损失计算。随后,使用监督学习的方法对SSD网络进行训练,将对比损失传入到SSD网络中与SSD损失值加权求和反馈给SSD网络,进行网络参数的优化。由于在目标检测网络中加入了对比学习的思想,提高了背景和目标在特征空间中的区分度。因此所提出的算法能显著提高SSD网络对于目标检测的精度,并在可见光和热红外图像中均取得了令人满意的检测效果。在PASCAL VOC2012数据集实验中,AP50值提升了0.3%,在LLVIP数据集实验中,AP50值提升了0.2%。
Abstract:The existing deep learning-based object detection algorithms encounter various issues during the object detection process in images, such as object viewpoint diversity, object deformation, detection occlusion, illumination variations, and detection of small objects. To address these issues, this paper introduces the concept of contrastive learning into the SSD object detection network and improves the original SSD algorithm. First, by randomly cropping object images and background images from sample images using the method of image cropping, the object image blocks and background image blocks are input into the contrastive learning network for feature extraction and contrastive loss calculation. The supervised learning method is then used to train the SSD network, and the contrastive loss is fed into the SSD network and weighted and summed with the SSD loss value for feedback to optimize the network parameters. Because the contrastive learning concept is introduced into the object detection network, the distinction between the background and object in the feature space is improved. Therefore, the proposed algorithm significantly improves the accuracy of the SSD network for object detection, and obtains satisfactory detection results in both visible and thermal infrared images. In the experiment on the PASCAL VOC2012 dataset, the proposed algorithm shows an increase in the AP50 value by 0.3%, whereas in the case of the LLVIP dataset, the corresponding increase in AP50 value is 0.2%.
-
Keywords:
- deep learning /
- SSD /
- object detection /
- contrastive learning /
- infrared thermal /
- image cropping
-
0. 引言
由两条金属线通过溅射的方式形成了一组窄缝,这组窄缝的距离小于入射光的波长,这就形成了亚波长金属光栅偏振器,它的体积属于纳米级别,但其偏振性能却非常好且容易集成,因此它被广泛应用于光通讯及液晶显示屏的制造中。其中双层金属纳米光栅偏振器属于纳米光栅偏振器件中的一种,由于其偏振效果更好得到人们的青睐。
纳米压印光刻技术在1995年首次由美国人提出[1],是近20年才发展起来的新型的微细加工工艺,它是利用高分辨率的模板来复制加工微纳结构的一种新工艺,所以可以说这种技术首先建立在光刻技术上。第一个提出亚波长金属光栅具有检偏的偏振特性的是Hertz教授[2-3],随后才相继出现了有关亚波长金属光栅相关理论及其制造方法。2005年,韩国LG电子研究院利用周期140 nm的硅基亚波长光栅作为压印模板制作了单层金属偏振光栅。2006年瑞士保罗谢尔研究所[4-5]在石英板上通过极紫外干涉光刻技术制备了周期为100 nm的亚波长光栅。随后几年,美国密歇根大学[6-7]开发一种可以连续制备周期为200 nm的亚波长结构的亚波长光栅,利用电子束在光栅上方沉积一层金属铝,经过测量其消光比为1000。这种压印技术在当时被认为是未来制备亚波长金属光栅的有效方法[8]。但是随着社会的快速发展,越来越多的曲面屏及可折叠屏成为了人们生活的主流[9-10],这就让人不得不往柔性偏振器上思考。但是,目前对柔性纳米光栅偏振器的研究甚少。所以,通过对柔性纳米光栅偏振器在结构和制作工艺方面的研究,以制作出成本低、产出高的偏振器,这对柔性电子器件的工艺推进起到了很大的支撑作用。
基于以上分析,本文在严格耦合波理论[11]的基础上以复眼结构中的偏振敏感单元为模仿对象,利用微加工工艺制备了一种可用于仿生的偏振光光电传感器的偏振器。该偏振器是以柔性材料PC(Polycarbonate)作为基底利用纳米压印和磁控溅射技术制作而成的柔性双层金属光栅偏振器,并对制作的偏振器利用光谱测试系统进行偏振特性测试。
1. 实验
图 1为PC上制作的偏振器的模型图,将入射光中垂直和平行与于电场方向的光分别称为TM偏振光和TE偏振光。当TM偏振光照射在偏振器上时,由于电子振荡通过栅线方向时会受到阻碍,此时的光栅层就如同介质层可使TM光透过。电子会在TE光入射时以自由振荡的形式出现,导致TE光反射。
1.1 模板介绍
模板对于纳米压印相当重要,因此选择上海纳腾公司提供的模板,模板的周期是278 nm,线宽是139 nm,高度100 nm,模板的扫描电子显微镜图如图 2所示。模板防粘使用了来自Sigma-Aldrich公司的Trichloro (1H,1H,2H,2H-heptadecafluorodecyl) silane[12-13]。这种硅烷可以很好地与Si或SiO2表面的OH键结合形成含有C-F功能基单分子层,这种分子层在衬底表面表现出了很好的抗粘性能。做过表面处理的Si模版接触角从30°增大为110°,如图 3所示,表现出较好的疏水性能,将有利于压印时脱模。
1.2 双层金属纳米光栅偏振片的制作
在介质光栅的顶端和底端都沉积一层金属层的光栅称之为双层金属光栅。包含双层金属光栅的偏振器的制作只需在光栅上镀一次铝膜,比单层或包裹型金属光栅不仅降低了制作工艺难度,而且偏振和滤波效果更佳。①选择铝作为偏振器的金属层,是因为铝可以实现可见光波段的最优偏振特性;②0.5的占空比在同一波段具有最大的透射率和最大的消光比,由于透射率与金属的厚度成正比关系,但是,随着金属高度的增加,偏振器的消光比呈指数倍增大。但是,金属线栅高度的增加又会增大加工难度。因此,综合考虑,溅射金属铝的厚度为70 nm;③偏振器的消光比会因为金属光栅层之间距离的逐渐增大呈周期性震荡,根据文献[14]中的仿真本文选择金属光栅层的距离是50 nm;④光栅的周期和PC光栅高度是由模板决定的,目前的模板参数是周期278 nm,高度为100 nm[14]。
使用纳米压印的热压过程在柔性材料PC(聚碳酸酯)上压印纳米光栅。纳米压印技术最早由周郁教授提出的,它的优点在于可完成纳米结构的制作[15-16]。将模板与含有压印胶的基底紧密结合,等压印结束后小心地将模板和基底分开,这样就会在基底上形成模板上的图案。图 4所示为压印,脱模,和铝沉积的双层金属线栅偏振器的制造过程的示意图。本文使用的PC基底材料的厚度为0.2 mm。PC具备非常优异的性能,包括高透光率、高折射率、高抗冲性、尺寸稳定性及易加工成型等,因此PC被广泛应用于光学器件的制备中。另外,其热稳定性好,成型温度范围宽,是作为压印基底的一种理想材料。所使用的纳米压印仪(型号为NIL-150)是从中国上海纳腾仪器有限公司引进的最新微纳结构加工设备。
实验前需要将去掉保护膜的PC基底材料裁剪为20 mm×20 mm的正方形备用。但是剪切下来的PC片表面并不是很平整,会使其在压印过程中不能和模板完全接触,这就会影响应力的分布在加压和保压的过程中不能使结构完全地转移到基底上。为了解决这个问题,如图 5所示在压印的过程中在PC基底下面又增加了一片1 mm厚的聚二甲基硅氧烷(Polydimethylsiloxane:PDMS)柔性薄膜,因为PDMS具有很好的柔韧性和高温稳定性,在高温施压的过程中可以很好地分散加载在硬质模板上的应力,同时对模板起到一个保护作用。
压印参数为:真空度为0.07 MPa,压力为0.65 MPa,压印温度为160℃,压印时间设定为5 min。等压印时间一到立马开启冷却水进行腔室的降温,直到操作面板上的温度显示40℃时关闭压力阀往里面充氮气,待室门自动开启后用镊子取出样品然后小心地将两者分开,就可得到光栅结构,实物图和SEM图如图 6所示。
最后,利用真空度为7×10-6 Mbar的磁控溅射在光栅结构上表面溅射一层厚度为70 nm的Al,加工参数如表 1所示。
表 1 柔性双层金属光栅偏振器的参数Table 1. Parameters of subwavelength metal grating polarizerMaterials and structures Materials and parameters Substrate materials PC Metallic materials Al Period/nm 278 Duty cycle 0.5 Aluminum thickness/nm 70 Distance between two metal grating layers/nm 50 PC grating height/nm 100 2. 结果和讨论
偏振器的性能由透过率和消光比决定,因此利用搭建的光谱测试系统对制造的金属光栅偏振器进行了透过率和消光比的测量[17],光谱测试系统如图 7所示。
利用氙气灯发出的白光作为检测光源,经透镜聚光后再经过小孔光阑后作为点光源,非线偏光透过偏振片后形成线偏光。透过的偏振光直接垂直照射在光栅上,光栅后面放置爱万提斯光纤光谱仪,利用光纤探头测试透射光光谱。旋转偏振片的相应位置分别得到TE和TM偏振光的最大与最小透射强度。然后利用公式:
$$ {\rm{ER}}={T_{{\rm{TM}}}}/{T_{{\rm{TE}}}} $$ 计算得到消光比,式中TTM、TTE分别表示TM和TE偏振光的透射率。
应用严格耦合波理论对制造的柔性双层金属光栅偏振器进行了TM透射率及消光比的计算,由于一般只有TM偏振光才能透过偏振器,而且计算消光比也已用到TE偏振光的信息,所以文中不单独对TE偏振光进行分析。如图 8所示为本文制造的柔性双层金属光栅偏振器的性能测试图,从图上可以看出本文制造的偏振器在入射光波长范围为350~800 nm时的透过率可达48%,消光比可达100000,具有非常好的偏振效果,达到了用于偏振导航的需求。
3. 结论
利用纳米压印技术和磁控溅射在柔性材料上通过简单的方法制作出了柔性双层金属光栅偏振器,并进行了透过率和消光比的测试。实验结果显示,当入射光的波长在350~800 nm之间,加工的偏振器性能优良,透过率和消光比分别高达48%和100000,具有较好的偏振效果,达到了用于偏振导航的要求。制作的柔性双层金属光栅偏振器只涉及纳米压印和磁控溅射两个工艺,并且不包括任何抗蚀剂旋涂、剥离和刻蚀工艺,制作过程是非常简单的,适合大批量生产。本文制造的柔性双层金属光栅偏振器有望应用到光学系统中,特别是在液晶显示器领域。
-
图 4 改进SSD与原SSD算法在PASCAL VOC2012数据集上的检测结果(上排为改进SSD算法的检测效果图,下排为原SSD算法检测效果图)
Figure 4. The detection results of the improved SSD and the original SSD algorithms on the PASCAL VOC2012 dataset (The top row shows the detection results of the improved SSD algorithm, while the bottom row shows the detection results of the original SSD algorithm)
图 5 改进SSD与原SSD算法在LLVIP数据集上的检测结果(上排为改进SSD算法的检测效果图,下排为原SSD算法检测效果图)
Figure 5. The detection results of the improved SSD and the original SSD algorithms on the LLVIP dataset (The top row shows the detection results of the improved SSD algorithm, while the bottom row shows the detection results of the original SSD algorithm)
表 1 PASCAL VOC2012数据集上改进SSD算法与原SSD算法结果比较
Table 1 Comparison of the results between the improved SSD algorithm and the original SSD algorithm on the PASCAL VOC2012 dataset
Models AP AP50 AP75 APS APM APL Improved SSD algorithm 0.452 0.718 0.487 0.091 0.281 0.522 Original SSD algorithm 0.451 0.715 0.491 0.088 0.270 0.524 表 2 在PASCAL VOC2012数据集中不同图像块截取尺寸下的算法结果比较
Table 2 Comparison of algorithm results under different sizes of image cropping on the PASCAL VOC2012 dataset
Image cropping size (Pixels) AP AP50 AP75 APS APM APL Improved SSD Algorithm(32×32) 0.450 0.717 0.485 0.091 0.281 0.521 Improved SSD Algorithm(64×64) 0.452 0.718 0.487 0.091 0.281 0.522 Improved SSD Algorithm(96×96) 0.449 0.713 0.485 0.085 0.279 0.524 表 3 LLVIP数据集上改进SSD算法与原SSD算法结果比较
Table 3 Comparison of results between the improved SSD algorithm and the original SSD algorithm on the LLVIP dataset
Models AP AP50 AP75 APS APM APL Improved SSD algorithm 0.524 0.928 0.539 0.013 0.272 0.539 Original SSD algorithm 0.522 0.926 0.536 0.011 0.275 0.537 表 4 MS COCO2017数据集上改进SSD算法与其他目标检测算法结果比较
Table 4 Comparison of results between the improved SSD algorithm and other object detection algorithms on the MS COCO 2017 dataset
Models AP AP50 AP75 APS APM APL YOLOv2 [6] 21.6 44.0 19.2 5.0 22.4 35.5 YOLOv3 33.0 57.9 34.4 18.3 35.4 41.9 YOLOv5 36.9 58.4 - - - - SSD [4] 23.2 41.2 23.4 5.3 23.2 39.6 Fast R-CNN [10] 20.5 39.9 19.4 4.1 20.0 35.8 Faster R-CNN [11] 21.9 42.7 - - - - ION [24] 23.6 43.2 23.6 6.4 24.1 38.3 Improved SSD Algorithm 28.9 47.5 30.7 5.5 26.5 43.5 -
[1] XIA G S, BAI X, DING J, et al. DOTA: a large scale dataset for object detection in aerial images[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018: 3974-3983.
[2] ZHANG J, LIANG X, WANG M, et al. Coarse⁃to⁃fine object detection in unmanned aerial vehicle imagery using lightweight convolutional neural network and deep motion saliency[J]. Neurocomputing, 2020, 398: 555-565. DOI: 10.1016/j.neucom.2019.03.102
[3] Pathak A, Pandey M, Rautaray S. Application of deep learning for object detection[J]. Procedia Computer Science, 2018, 132: 1706⁃1717. DOI: 10.1016/j.procs.2018.05.144
[4] LIU W, Anguelov D, Erhan D, et al. SSD: Single shot MultiBox detector[C]//Proceedings of the 14th 284 European Conference on Computer Vision, 2016: 21-37.
[5] LIU G, NOUAZE J C, TOUKO P L, et al. YOLO-tomato: A robust algorithm for tomato detection based on YOLOv3[J]. Sensors, 2020, 20(7): 2145.1-2145.20.
[6] Redmon J, Farhadi A. Yolo9000: Better, faster, stronger[C]// Computer Vision and Pattern Recognition (CVPR), 2017: 6517-6525.
[7] Sruthi M S, Poovathingal M J, Nandana V N, et al. YOLOv5 based open-source UAV for human detection during search and rescue (SAR) [C]// 10th International Conference on 13 Advances in Computing and Communications, 2021: 1-6.
[8] ZHU X K, LYU S C, WANG X, et al. TPH-YOLOv5: improved YOLOv5 based on transformer prediction head for object detection on drone-captured scenarios[C]//Proceedings of the IEEE International Conference on Computer Vision, 2021: 2778-2788.
[9] CHEN C, LIU M Y, Tuzel O, et al. R-CNN for small object detection[C]//Asian Conference on Computer Vision, 2016: 214-230.
[10] Girshick R. Fast R-CNN[C]//IEEE International Conference on Computer Vision, 2015: 1440-1448.
[11] REN S Q, HE K M, Girshick R, et al. Faster CNN: Towards real-time object detection with region proposal networks[C]//Proceedings of the 28th International Conference on Neural Information Processing Systems, 2015: 91-99.
[12] WANG Longguang, WANG Yingqian, DONG Xiaoyu, et al. Unsupervised degradation representation learning for blind super-resolution[C]//CVPR, 2021: 10581-10590.
[13] HUANG Y, TU X, FU G, et al. Low-Light image enhancement by learning contrastive representations in spatial and frequency domains[J]. arXiv preprint arXiv: 2303.13412, 2023.
[14] SUN X H, GU J N, HUANG R. A modified SSD method for electronic computer fast recognition[J]. Optik, 2020, 205: 163767. DOI: 10.1016/j.ijleo.2019.163767
[15] FU C Y, LIU W, Ranga A, et al. Dssd: DeConvolutional single shot detector[J]. arXiv preprint arXiv: 1701. 06659, 2017.
[16] Jeong J, Park H, Kwak N. Enhancement of SSD by con-catenating feature maps for object detection[J]. arXiv preprint arXiv: 1705. 09587, 2017.
[17] 李文涛, 彭力. 多尺度通道注意力融合网络的小目标检测算法[J]. 计算机科学与探索, 2021, 15(12): 2390-2400. https://www.cnki.com.cn/Article/CJFDTOTAL-KXTS202112013.htm LI Wentao, PENG Li. Small objects detection algorithm with multi-scale channel attention fusion network[J]. Journal of Frontiers of Computer Science & Technology, 2021, 15(12): 2390-2400. https://www.cnki.com.cn/Article/CJFDTOTAL-KXTS202112013.htm
[18] LI Z, ZHOU F. FSSD: feature fusion single shot multibox detector[J]. arXiv preprint arXiv: 1712. 00960, 2017.
[19] CHEN T, Kornblith S, Norouzi M, et al. A simple framework for contrastive learning of visual representations[C]//Proceedings of the 37th International Conference on Machine Learning, 2020: 1597-1607.
[20] HE K M, FAN H Q, WU Y X, et al. Momentum contrast for unsupervised visual representation learning[C]//Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020: 9726-9735.
[21] Grill J B, Strub F, Altche F, et al. Bootstrap your own latent a new approach to self-supervised learning[C]//Proceedings of the 34th International Conference on Neural Information Processing Systems (NIPS), 2020: 2127121284.
[22] Caron M, Misra I, Mairal J, et al. Unsupervised learning of visual features by contrasting cluster assignments[C]//Proceedings of the 34th International Conference on Neural Information Processing Systems, 2020: 99129924.
[23] CHEN X L, HE K M. Exploring simple Siamese representation learning[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021: 1574515753.
[24] Bell S, Zitnick CL, Bala K, Girshick R. Inside-outside net: Detecting objects in context with skip pooling and recurrent neural networks[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016: 2874-2883.
-
期刊类型引用(2)
1. 汪会达,张栋,肖焰辉,张潇云,刘宇,陈德明. 改进SSD算法的光伏板污损检测. 上海电机学院学报. 2025(01): 52-57 . 百度学术
2. 李春亚,王建华,尹土兵,卢建飞,邹晓波,叶儒桦. 个人防护装备穿戴安全检测技术的进展与应用. 武汉理工大学学报. 2024(10): 149-155+162 . 百度学术
其他类型引用(2)