《计算机应用》唯一官方网站 ›› 2025, Vol. 45 ›› Issue (2): 403-410.DOI: 10.11772/j.issn.1001-9081.2024010070
• 人工智能 • 上一篇
收稿日期:2024-01-22
									
				
											修回日期:2024-03-27
									
				
											接受日期:2024-03-29
									
				
											发布日期:2024-05-09
									
				
											出版日期:2025-02-10
									
				
			通讯作者:
					高婉银
							作者简介:谢斌红(1971—),男,山西运城人,教授,硕士,CCF会员,主要研究方向:智能化软件工程、机器学习基金资助:
        
                                                                                                                                            Binhong XIE1, Wanyin GAO1( ), Wangdong LU2, Yingjun ZHANG1, Rui ZHANG1
), Wangdong LU2, Yingjun ZHANG1, Rui ZHANG1
			  
			
			
			
                
        
    
Received:2024-01-22
									
				
											Revised:2024-03-27
									
				
											Accepted:2024-03-29
									
				
											Online:2024-05-09
									
				
											Published:2025-02-10
									
			Contact:
					Wanyin GAO   
							About author:XIE Binhong, born in 1971, M. S., professor. His research interests include intelligent software engineering, machine learning.Supported by:摘要:
为了解决训练数据有限且类别多的问题,引入小样本学习方法。针对现有密集目标计数方法中存在的密集物体边界不清晰、空间不一致性和模型泛化能力弱等问题,提出一种小样本相似性匹配特征增强密集目标计数网络(SMFENet)。首先,通过特征提取模块提取图像特征,并使用ROI Align方法对齐样例特征;其次,设计相似性比较特征增强模块(SCFEM)计算样例特征和图像特征的相似度,得到相似度图,并将该图作为加权系数用样例特征自适应地增强图像特征,使最终得到的增强特征更关注与样例特征相似的区域;同时,采用内部特征增强、内部尺度增强以及信息合并等方法解决密集物体边界不清晰和空间不一致性问题;最后,利用密度预测模块生成密度图。此外,采用内容感知标注法生成高质量Ground-Truth密度图,以进一步提升模型的准确性。测试时,通过自适应损失调整网络使网络泛化到新类别上。在FSC-147数据集和CARPK数据集上的实验结果表明,与现有的小样本目标计数方法相比,所提模型的平均绝对误差(MAE)降低到13.82,均方根误差(RMSE)降低到45.91;与特定类别计数方法相比,所提模型的MAE降低到4.16,RMSE降低到5.91。以上充分证明SMFENet模型在提高计数的准确性和鲁棒性等方面能取得较好的效果,展示了该模型的实际应用价值。
中图分类号:
谢斌红, 高婉银, 陆望东, 张英俊, 张睿. 小样本相似性匹配特征增强的密集目标计数网络[J]. 计算机应用, 2025, 45(2): 403-410.
Binhong XIE, Wanyin GAO, Wangdong LU, Yingjun ZHANG, Rui ZHANG. Dense object counting network with few-shot similarity matching feature enhancement[J]. Journal of Computer Applications, 2025, 45(2): 403-410.
| 方法 | 验证集 | 测试集 | ||
|---|---|---|---|---|
| MAE | RMSE | MAE | RMSE | |
| Mean | 53.38 | 124.53 | 47.55 | 147.67 | 
| Median | 48.68 | 129.70 | 47.73 | 152.46 | 
| FR few-shot detector[ | 45.45 | 112.53 | 41.64 | 141.04 | 
| FSOD few-shot detector[ | 36.36 | 115.00 | 32.53 | 140.65 | 
| GMN[ | 29.66 | 89.81 | 26.52 | 124.57 | 
| MAML[ | 25.54 | 79.44 | 24.90 | 112.68 | 
| FamNet[ | 23.75 | 69.07 | 22.08 | 99.54 | 
| CFOCNet[ | 21.19 | 61.41 | 22.10 | 112.71 | 
| BMNet+[ | 15.74 | 58.53 | 14.62 | 91.83 | 
| SAFECount[ | 15.28 | 47.20 | 14.32 | 85.54 | 
| SMFENet | 13.82 | 45.91 | 14.01 | 84.93 | 
表1 SMFENet与小样本目标计数方法的实验结果比较
Tab. 1 Comparison of experimental results of SMFENet and few-shot counting methods
| 方法 | 验证集 | 测试集 | ||
|---|---|---|---|---|
| MAE | RMSE | MAE | RMSE | |
| Mean | 53.38 | 124.53 | 47.55 | 147.67 | 
| Median | 48.68 | 129.70 | 47.73 | 152.46 | 
| FR few-shot detector[ | 45.45 | 112.53 | 41.64 | 141.04 | 
| FSOD few-shot detector[ | 36.36 | 115.00 | 32.53 | 140.65 | 
| GMN[ | 29.66 | 89.81 | 26.52 | 124.57 | 
| MAML[ | 25.54 | 79.44 | 24.90 | 112.68 | 
| FamNet[ | 23.75 | 69.07 | 22.08 | 99.54 | 
| CFOCNet[ | 21.19 | 61.41 | 22.10 | 112.71 | 
| BMNet+[ | 15.74 | 58.53 | 14.62 | 91.83 | 
| SAFECount[ | 15.28 | 47.20 | 14.32 | 85.54 | 
| SMFENet | 13.82 | 45.91 | 14.01 | 84.93 | 
| 方法 | 是否微调 | MAE | RMSE | 
|---|---|---|---|
| SAFECount | × | 16.66 | 24.08 | 
| √ | 5.33 | 7.04 | |
| SMFENet | × | 7.60 | 10.25 | 
| √ | 4.16 | 5.91 | 
表2 SMFENet与汽车计数方法的实验结果比较
Tab. 2 Comparison of experimental results of SMFENet and vehicle counting method
| 方法 | 是否微调 | MAE | RMSE | 
|---|---|---|---|
| SAFECount | × | 16.66 | 24.08 | 
| √ | 5.33 | 7.04 | |
| SMFENet | × | 7.60 | 10.25 | 
| √ | 4.16 | 5.91 | 
| 方法 | MAE | RMSE | GFLOPs | 帧率/(frame·s-1) | 
|---|---|---|---|---|
| SMFENet(fixed-5) | 19.26 | 59.07 | 4.8 | 30.0 | 
| SMFENet(neighbor) | 17.50 | 57.11 | 6.5 | 25.0 | 
| SMFENet | 13.82 | 45.91 | 7.0 | 21.0 | 
表3 各种Ground-Truth密度图生成方法的性能比较
Tab. 3 Performance comparison of various Ground-Truth density map generation methods
| 方法 | MAE | RMSE | GFLOPs | 帧率/(frame·s-1) | 
|---|---|---|---|---|
| SMFENet(fixed-5) | 19.26 | 59.07 | 4.8 | 30.0 | 
| SMFENet(neighbor) | 17.50 | 57.11 | 6.5 | 25.0 | 
| SMFENet | 13.82 | 45.91 | 7.0 | 21.0 | 
| 样例数 | MAE | RMSE | 
|---|---|---|
| 1 | 17.37 | 60.10 | 
| 2 | 14.71 | 49.04 | 
| 3 | 13.82 | 45.91 | 
表4 样例数对计数性能的影响
Tab. 4 Influence of sample size on counting accuracy
| 样例数 | MAE | RMSE | 
|---|---|---|
| 1 | 17.37 | 60.10 | 
| 2 | 14.71 | 49.04 | 
| 3 | 13.82 | 45.91 | 
| 组件 | 评价指标 | |||
|---|---|---|---|---|
| SCFEM— | FEM | 自适应损失 | MAE | RMSE | 
| × | × | × | 20.45 | 61.71 | 
| √ | × | × | 17.21 | 56.81 | 
| √ | √ | × | 14.52 | 48.94 | 
| √ | √ | √ | 13.82 | 45.91 | 
表5 消融实验结果
Tab. 5 Ablation experimental results
| 组件 | 评价指标 | |||
|---|---|---|---|---|
| SCFEM— | FEM | 自适应损失 | MAE | RMSE | 
| × | × | × | 20.45 | 61.71 | 
| √ | × | × | 17.21 | 56.81 | 
| √ | √ | × | 14.52 | 48.94 | 
| √ | √ | √ | 13.82 | 45.91 | 
| 处理方式 | 特征组合方法 | 评价指标 | |||||
|---|---|---|---|---|---|---|---|
| 拼接 | 逐元素相加 | XS | XI+ XS | XM+ XS | XI+ XM+ XS | MAE | RMSE | 
| × | × | √ | × | × | × | 17.21 | 56.81 | 
| √ | × | × | √ | × | × | 15.26 | 52.07 | 
| √ | × | × | × | √ | × | 14.90 | 50.68 | 
| √ | × | × | × | × | √ | 13.82 | 45.91 | 
| × | √ | × | √ | × | × | 16.38 | 54.57 | 
| × | √ | × | × | √ | × | 15.71 | 52.90 | 
| × | √ | × | × | × | √ | 14.31 | 48.27 | 
表6 FEM不同特征组合及其处理方式的性能比较
Tab. 6 Performance comparison of different feature combinations and corresponding processing methods within the FEM
| 处理方式 | 特征组合方法 | 评价指标 | |||||
|---|---|---|---|---|---|---|---|
| 拼接 | 逐元素相加 | XS | XI+ XS | XM+ XS | XI+ XM+ XS | MAE | RMSE | 
| × | × | √ | × | × | × | 17.21 | 56.81 | 
| √ | × | × | √ | × | × | 15.26 | 52.07 | 
| √ | × | × | × | √ | × | 14.90 | 50.68 | 
| √ | × | × | × | × | √ | 13.82 | 45.91 | 
| × | √ | × | √ | × | × | 16.38 | 54.57 | 
| × | √ | × | × | √ | × | 15.71 | 52.90 | 
| × | √ | × | × | × | √ | 14.31 | 48.27 | 
| 方法 | Fold 0 | Fold 1 | Fold 2 | Fold 3 | 平均 | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | |
| {60}(Baseline) | 29.13 | 111.68 | 21.11 | 45.75 | 23.78 | 117.94 | 26.16 | 75.45 | 25.05 | 87.71 | 
| {60}+PPM[ | 28.03 | 93.65 | 19.01 | 30.67 | 23.88 | 121.10 | 25.36 | 65.34 | 24.07 | 77.69 | 
| {60}+ASPP[ | 25.83 | 82.31 | 19.01 | 32.67 | 24.18 | 127.58 | 27.56 | 92.68 | 24.15 | 83.81 | 
| {60,6,3,2,1} | 24.63 | 72.19 | 19.41 | 33.13 | 22.89 | 106.52 | 25.56 | 67.16 | 23.12 | 69.75 | 
| {60,30} | 28.40 | 95.10 | 19.61 | 34.40 | 22.28 | 101.72 | 25.56 | 67.16 | 23.96 | 74.60 | 
| {60,30,15} | 26.83 | 90.16 | 19.41 | 33.13 | 22.40 | 102.10 | 23.66 | 53.31 | 23.08 | 69.68 | 
| {60,30,15,8} | 24.03 | 68.70 | 18.51 | 28.68 | 22.28 | 101.72 | 22.96 | 46.52 | 21.95 | 61.41 | 
| {60,30,15,8,4} | 24.73 | 72.87 | 18.57 | 28.48 | 22.88 | 106.84 | 22.06 | 40.89 | 22.06 | 62.27 | 
| {60,30,15,8}-WO | 25.53 | 79.81 | 20.01 | 36.89 | 23.28 | 112.18 | 22.96 | 46.32 | 22.95 | 68.80 | 
表7 不同尺寸的FEM、PPM和ASPP的实验结果比较
Tab. 7 Comparison of experimental results of FEM, PPM and ASPP of different sizes
| 方法 | Fold 0 | Fold 1 | Fold 2 | Fold 3 | 平均 | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | |
| {60}(Baseline) | 29.13 | 111.68 | 21.11 | 45.75 | 23.78 | 117.94 | 26.16 | 75.45 | 25.05 | 87.71 | 
| {60}+PPM[ | 28.03 | 93.65 | 19.01 | 30.67 | 23.88 | 121.10 | 25.36 | 65.34 | 24.07 | 77.69 | 
| {60}+ASPP[ | 25.83 | 82.31 | 19.01 | 32.67 | 24.18 | 127.58 | 27.56 | 92.68 | 24.15 | 83.81 | 
| {60,6,3,2,1} | 24.63 | 72.19 | 19.41 | 33.13 | 22.89 | 106.52 | 25.56 | 67.16 | 23.12 | 69.75 | 
| {60,30} | 28.40 | 95.10 | 19.61 | 34.40 | 22.28 | 101.72 | 25.56 | 67.16 | 23.96 | 74.60 | 
| {60,30,15} | 26.83 | 90.16 | 19.41 | 33.13 | 22.40 | 102.10 | 23.66 | 53.31 | 23.08 | 69.68 | 
| {60,30,15,8} | 24.03 | 68.70 | 18.51 | 28.68 | 22.28 | 101.72 | 22.96 | 46.52 | 21.95 | 61.41 | 
| {60,30,15,8,4} | 24.73 | 72.87 | 18.57 | 28.48 | 22.88 | 106.84 | 22.06 | 40.89 | 22.06 | 62.27 | 
| {60,30,15,8}-WO | 25.53 | 79.81 | 20.01 | 36.89 | 23.28 | 112.18 | 22.96 | 46.32 | 22.95 | 68.80 | 
| 1 | 刘春磊,陈天恩,王聪,等. 小样本目标检测研究综述[J]. 计算机科学与探索, 2023, 17(1):53-73. | 
| LIU C L, CHEN T E, WANG C, et al. Survey of few-shot object detection[J]. Journal of Frontiers of Computer Science and Technology, 2023, 17(1):53-73. | |
| 2 | SAM D B, SAJJAN N N, BABU R V, et al. Divide and grow: capturing huge diversity in crowd images with incrementally growing CNN[C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2018:3618-3626. | 
| 3 | MUNDHENK T N, KONJEVOD G, SAKLA W A, et al. A large contextual dataset for classification,detection and counting of cars with deep learning[C]// Proceedings of the 2016 European Conference on Computer Vision, LNCS 9907. Cham: Springer, 2016:785-800. | 
| 4 | ARTETA C, LEMPITSKY V, ZISSERMAN A. Counting in the wild[C]// Proceedings of the 2016 European Conference on Computer Vision, LNCS 9911. Cham: Springer, 2016: 483-498. | 
| 5 | XIE W, NOBLE J A, ZISSERMAN A. Microscopy cell counting and detection with fully convolutional regression networks[J]. Computer Methods in Biomechanics and Biomedical Engineering: Imaging and Visualization, 2018, 6(3): 283-292. | 
| 6 | RAHNEMOONFAR M, SHEPPARD C. Deep count: fruit counting based on deep simulated learning[J]. Sensors, 2017, 17(4): No.905. | 
| 7 | 赵凯琳,靳小龙,王元卓. 小样本学习研究综述[J]. 软件学报, 2021, 32(2):349-369. | 
| ZHAO K L, JIN X L, WANG Y Z. Survey on few-shot learning[J]. Journal of Software, 2021, 32(2):349-369. | |
| 8 | YANG S D, SU H T, HSU W H, et al. Class-agnostic few-shot object counting[C]// Proceedings of the 2021 IEEE Winter Conference on Applications of Computer Vision. Piscataway: IEEE, 2021: 870-878. | 
| 9 | RANJAN V, SHARMA U, NGUYEN T, et al. Learning to count everything[C]// Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2021: 3393-3402. | 
| 10 | ZHANG Y, ZHOU D, CHEN S, et al. Single-image crowd counting via multi-column convolutional neural network[C]// Proceedings of the 2016 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2016: 589-597. | 
| 11 | HSIEH M R, LIN Y L, HSU W H. Drone-based object counting by spatially regularized regional proposal network[C]// Proceedings of the 2017 IEEE International Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2017: 4145-4153. | 
| 12 | KIM T, PAIK J. Intelligent video surveillance with abandoned object detection and multiple pedestrian counting[C]// Proceedings of the SPIE 7542, Multimedia on Mobile Devices 2010. Bellingham, WA: SPIE, 2010: No.75420K. | 
| 13 | ATKINS D C, GALLOP R J. Rethinking how family researchers model infrequent outcomes: a tutorial on count regression and zero-inflated models[J]. Journal of Family Psychology, 2007, 21(4): 726-735. | 
| 14 | OÑORO-RUBIO D, LÓPEZ-SASTRE R J. Towards perspective-free object counting with deep learning[C]// Proceedings of the 2016 European Conference on Computer Vision, LNCS 9911. Cham: Springer, 2016: 615-629. | 
| 15 | LU E, XIE W, ZISSERMAN. Class-agnostic counting[C]// Proceedings of the 2018 Asian Conference on Computer Vision, LNCS 11363. Cham: Springer, 2019:669-684. | 
| 16 | SHI M, LU H, FENG C, et al. Represent, compare, and learn: a similarity-aware framework for class-agnostic counting[C]// Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Piscataway: IEEE, 2022: 9529-9538. | 
| 17 | YOU Z, YANG K, LUO W, et al. Few-shot object counting with similarity-aware feature enhancement[C]// Proceedings of the 2023 IEEE/CVF Winter Conference on Applications of Computer Vision. Piscataway: IEEE, 2023: 6304-6313. | 
| 18 | HE K, ZHANG X, REN S, et al. Deep residual learning for image recognition[C]// Proceedings of the 2016 IEEE International Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2016: 770-778. | 
| 19 | ZHAO H, SHI J, QI X, et al. Pyramid scene parsing network[C]// Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2017: 6230-6239. | 
| 20 | CHEN L C, PAPANDREOU G, KOKKINOS I, et al. DeepLab: semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2018, 40(4):834-848. | 
| 21 | VALMADRE J, BERTINETTO L, HENRIQUES J, et al. End-to-end representation learning for correlation filter based tracking[C]// Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2017: 5000-5008. | 
| 22 | WANG Q, ZHANG L, BERTINETTO L, et al. Fast online object tracking and segmentation: a unifying approach[C]// Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2019:1328-1338. | 
| 23 | KANG B, LIU Z, WANG X, et al. Few-shot object detection via feature reweighting[C]// Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision. Piscataway: IEEE, 2019: 8419-8428. | 
| 24 | FAN Q, ZHUO W, TANG C K, et al. Few-shot object detection with attention-RPN and multi-relation detector[C]// Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2020: 4012-4021. | 
| 25 | FINN C, ABBEEL P, LEVINE S. Model-agnostic meta-learning for fast adaptation of deep networks[C]// Proceedings of the 34th International Conference on Machine Learning. New York: JMLR.org, 2017: 1126-1135. | 
| [1] | 富坤, 应世聪, 郑婷婷, 屈佳捷, 崔静远, 李建伟. 面向小样本节点分类的图数据增强方法[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 392-402. | 
| [2] | 严雪文, 黄章进. 基于对比学习的小样本图像分类方法[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 383-391. | 
| [3] | 余新言, 曾诚, 王乾, 何鹏, 丁晓玉. 基于知识增强和提示学习的小样本新闻主题分类方法[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1767-1774. | 
| [4] | 谢莉, 舒卫平, 耿俊杰, 王琼, 杨海麟. 结合加权原型和自适应张量子空间的小样本宫颈细胞分类[J]. 《计算机应用》唯一官方网站, 2024, 44(10): 3200-3208. | 
| [5] | 于碧辉, 蔡兴业, 魏靖烜. 基于提示学习的小样本文本分类方法[J]. 《计算机应用》唯一官方网站, 2023, 43(9): 2735-2740. | 
| [6] | 姜钧舰, 刘达维, 刘逸凡, 任酉贵, 赵志滨. 基于孪生网络的小样本目标检测算法[J]. 《计算机应用》唯一官方网站, 2023, 43(8): 2325-2329. | 
| [7] | 许仁杰, 刘宝弟, 张凯, 刘伟锋. 基于贝叶斯权函数的模型无关元学习算法[J]. 《计算机应用》唯一官方网站, 2022, 42(3): 708-712. | 
| [8] | 杜芸彦, 李鸿, 杨锦辉, 江彧, 毛耀. 基于负边距损失的小样本目标检测[J]. 《计算机应用》唯一官方网站, 2022, 42(11): 3617-3624. | 
| [9] | 杜炎, 吕良福, 焦一辰. 基于模糊推理的模糊原型网络[J]. 计算机应用, 2021, 41(7): 1885-1890. | 
| [10] | 王翔, 胡学钢. 高维小样本分类问题中特征选择研究综述[J]. 计算机应用, 2017, 37(9): 2433-2438. | 
| 阅读次数 | ||||||
| 全文 |  | |||||
| 摘要 |  | |||||