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. 引言
随着航天事业的进步,高精度星敏感器被广泛应用于各种空间遥感器。国内学者针对不同星敏感器的特点进行了相应的热设计。例如,吕建伟和王领华等人针对微型星敏感器组件进行了热设计,并通过仿真和地面试验验证了方案正确性和合理性。得到了以石墨作为导热通路的方案是合理的结论[1]。余成武等人对多探头甚高精度星敏感器进行了热稳定性的详细热设计。仿真分析和地面热试验结果表明,在各种工况下,星敏感器的安装法兰、光学镜头、镜筒的温度都能满足热控指标要求,热稳定性指标也符合任务需求[2]。江帆等人对高分辨率卫星的星敏感器组件进行了仿真分析和试验,使组件在各种极端工况下都能满足热控指标18℃±3℃,并验证了热设计的有效性[3]。
本文所介绍的高精度一体式星敏感器搭载的空间遥感器运行于近地圆轨道,与太阳同步轨道相比,在整个寿命周期内,β角(轨道面与太阳光矢量的夹角)变化的范围很大,在-66°~+66°之间,轨道倾角为41°~43°,轨道高度为400 km,没有固定的阳照面和背照面。该星敏感器直接安装在舱外,相较于舱内更容易受到空间热环境的直接影响[1, 4],在轨运行时,它将直接面对4 K冷黑空间或受到太阳照射。其一体式的结构设计使得星敏感器的热耗更集中,散热设计更困难,加上其发热量更大。而星敏感器高精度的特性对其结构稳定性、热稳定性提出了极高的要求,其中热稳定性决定在轨运行时的定位精度与重复定位精度[4]。
为确保星敏感器在工作时的高精度定位和导航,以及减少环境温度对其定姿精度的影响,本文首先介绍了星敏感器的结构、布局与内热源,对该星敏感器所受的外热流进行了分析,确定了散热面的位置和大小,并根据空间环境进行了热控设计,还进行了热仿真计算以验证星敏感器的热设计是否正确与合理。
1. 热设计输入条件
1.1 星敏感器的结构与安装布局
星敏感器采用一体式结构,由遮光罩、光学构件、法兰、支架、电源盒等组成,其中遮光罩、安装法兰、电路盒为铝合金材料,支架为钛合金材料。其结构如图 1所示。
图 2展示了星敏感器的位置分布情况,其位于空间遥感器主体的-Z偏+Y面。
1.2 星敏感器内热源与散热面布局
星敏感器电源盒中的内热源需要长期运行,电源盒内的电路板会产生工作热耗,其值为2.2 W。考虑星敏感器工作时的温度范围,表 1列出了各重要部分的温控指标。
表 1 重要结构热控指标Table 1. Important structure thermal control indexStructure Index content Thermal control index Installation flange Temperature 20℃±0.5℃ Lens cone Axial temperature difference <3℃ Circumferential temperature difference <1℃ Power supply chassis Temperature <25℃ 星敏感器的热源集中在电源盒中,因此在轨工作时发热量较大。为了解决星敏感器电源盒的散热问题,需要在电源盒外部增设散热面,将其产生的热量排散。由于电源盒外部紧挨支架内表面,无法直接将散热面安装在电源盒上。则需要设计散热面的位置。星敏感器的预设散热面位置如图 3所示。
2. 外热流分析
星敏感器的外热流受到飞行轨道、安装布局、飞行姿态的影响,所处空间环境外热流变化复杂,不仅需要考虑空间遥感器工作时所处轨道与姿态,也需要考虑星敏感本身安装位置的影响[5]。
该空间遥感器运行于近地圆轨道,其轨道β角变化范围为-66°~66°。在轨运行姿态复杂多变,进而影响星敏感器外热流大小。
空间遥感器工作姿态为:阳光照射在+Z面,光轴与天顶夹角为30°,光轴与太阳矢量夹角为120°,+x轴指向地球,轨道β角在-66°~66°的范围内变化,如图 4所示为遥感器高温工况下的工作姿态。
根据空间遥感器飞行轨道参数分析轨道外热流大小和变化规律,是确定散热面的位置和定义极端工况的重要输入条件[6],并结合散热面表面属性,使用平均吸收热流密度进行表征外热流。利用热分析软件计算出-Z偏+Y面星敏感器关键部位在夏至时刻工作时外热流随β角变化规律,如图 5所示。
工作时星敏感器入光口外热流在β角从-60°~0°增大过程中减小,在β角从0°~60°增大过程中曲折增大。预设散热面1,散热面2,散热面3外热流以β角为0°基本呈对称分布且变化趋势相同,随着β角的绝对值增大而增大。则工作时低温工况β角为0°,高温工况β角为66°。
星敏感器入光口、预设散热面1,散热面2,散热面3工作时高温工况与低温工况下外热流分析如图 6、图 7所示。
星敏感器安装在空间遥感器-Z偏+Y面,阳光直射遥感器+Z面,星敏感器由于遥感器主体的遮挡,并不会整体直接受到阳光直射。在β角为-60°~60°时,整体上到达预设散热面2的外热流最小。则预设散热面2为最理想的散热面。但是由于预设散热面2外部支架扶手结构的限制。则应选择到达外热流较小,结构更适合安装散热面的预设散热面1作为星敏感器的散热面。
3. 热设计
3.1 热设计概述
针对星敏感器独特的外热流特性,结合内热源的分布情况,总结以下热控难点。
星敏感器暴露安装在舱外,整体直接受到外热流的影响,内热源长期工作,结构一体化的设计,使其电源盒发热量大,需要计算散热面的大小将电源盒产生的热量进行排散。
针对上述热控设计难点,保证星敏感器正常工作,为空间遥感器提供高精度的位置与方位导航,采用被动热控和主动热控相结合的热控措施。
3.2 被动热控设计
由于星敏感器所处空间环境温度变化复杂,为保证星敏感器内部温度稳定性,防止温度不稳定对星敏感器光学镜头功能的影响,需要进行被动热控设计。
星敏感器除入光口外,整体包覆多层隔热组件,其中遮光罩采用20单元多层隔热组件,面膜采用白色防原子氧布。支架外表面包覆20单元多层隔热组件,面膜为白色防原子氧布。
为使星敏感器温度更加稳定,改善其表面的属性。电源盒表面发黑处理,提高表面发射率,遮光罩内侧喷涂黑漆,使其内部红外发射率达到0.85。镜筒前端外表面粘贴黑色聚酰亚胺薄膜,降低镜筒红外发射率。
3.3 散热计算
电源盒热量来源主要是各个结构的辐射、传导,内部芯片工作时电路板发热。其中内部小电路板发热量为0.6 W,大电路板为1.6 W。
为使短期工作与长期工作热源均满足温度指标与合理规划热控资源,保证星敏感器内热源产生的热量有效排散,需要计算散热面面积并带入仿真计算进行校核,最终确定散热面的面积。由于无法直接在电源盒开设散热面,需要额外设置散热面。散热面喷涂KS-ZA白漆来增大散热效果,电源盒通过碳导热索将热量传导至散热面,并辐射至外部空间。碳导热索如图 8所示。
根据外热流与散热面涂层属性,计算散热面吸收热量Q1:
$$ Q_1=Q_{\text {内 }}+\alpha\left(q_1+q_2\right) A+\varepsilon q_3 A $$ (1) 式中:Q内为内热源功耗;α为散热面太阳吸收率;q1为太阳直射的到达外热流密度;q2为阳光反照的到达外热流密度;ε为散热面表面发射率;q3为地球红外的到达外热流密度;A为散热面面积。
散热面散出的热量Q2为:
$$ Q_2=A \varepsilon \sigma T^4 $$ (2) 式中:σ为斯特藩-玻尔兹曼常数,其值为5.67$ \times $10-8 W/(m2$ \cdot $K4)[7]。
当热平衡时,有:
$$ Q_1=Q_2 $$ (3) 通过仿真计算可得到,散热面面积为8936 mm2。
3.4 主动热控设计
主动热控是在被动热控的基础上进一步提高并维持温度水平的热设计方法,采用加热片加热的方式控制内部组件温度,使星敏感器在低温工况下也满足控温指标。
根据星敏感器的控温指标,需要对星敏感器镜筒,镜头电源盒等部位进行控温。但此类结构因设计需要,不能直接在外表面粘贴加热片,则设计在遮光罩后段靠近镜筒区域布置加热区,控温传感器粘贴在安装法兰上,通过辐射对镜筒、镜片以及安装法兰进行加热保温。总体热设计如图 9所示。
加热回路采用PI控温法进行控温,当温度低于温度指标时,加热片正常工作,对相应结构进行加热,当温度高于温度指标时,加热片停止工作,直到温度低于温度指标时,加热片再次工作[8-9]。加热片使用聚酰亚胺薄膜型加热片,并使用热敏电阻测控温度。
4. 热分析
4.1 热仿真模型
根据上述热设计方案,利用有限元软件对星敏感器进行建模,星敏感器主体简化模型如图 10所示,壳单元划分,单元厚度按照等效厚度计算,采用热耦合的方式对模型进行简化,共建立30个热耦合,划分了8428个单元,2个内热源。
4.2 极端工况
根据空间遥感器太阳位置,β角,散热面表面属性,选取了高温与低温两个极端工况,如表 2所示。高温工况选取太阳常数最大的冬至时刻,散热面表面白漆寿命末期属性,低温工况选取太阳常数最小的夏至时刻,散热面表面白漆寿命初期属性。
表 2 极端工况Table 2. Extreme conditionsSolar position β Heat sink surface coating surface properties High temperature
working conditionWinter
solstice60° End period Low temperature
working conditionSummer
solstice0° Initial period 4.3 计算结果
根据上述工况定义,利用仿真软件计算近地轨道高精度一体化星敏感器在高温工况与低温工况下的温度结果,单轨结束时各重要部分温度分布云图与温度变化曲线如图 11、图 12所示。
从仿真结果图可以看出,星敏感器在温度稳定后安装法兰温度为19.82℃~20.10℃,镜头组件温度18.67℃~21.86℃,镜头轴向温差小于2.23℃,周向温差小于0.48℃,电路盒温度为19.10℃~23.49℃,均满足热控指标要求。
5. 结论
本文针对一种近地轨道一体式星敏感器进行详细的热设计,分析了星敏感器外热流变化规律,计算了近地轨道舱外安装一体式星敏感器散热面的大小。仿真分析结果表明,极端工况下星敏感器安装法兰的温度范围小于20℃±0.5℃,镜头轴向温差小于3℃,周向温差小于1℃,电路盒温度低于25℃,均满足热控指标要求,验证了热设计的有效性。文中的热设计思路及方法可借鉴于近地轨道各类星敏感器的热设计。
-
图 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.