《计算机应用》唯一官方网站 ›› 2025, Vol. 45 ›› Issue (7): 2269-2277.DOI: 10.11772/j.issn.1001-9081.2024071008
收稿日期:
2024-07-17
修回日期:
2024-09-26
接受日期:
2024-10-09
发布日期:
2025-07-10
出版日期:
2025-07-10
通讯作者:
苟光磊
作者简介:
白瑞峰(1999—),男,河南商丘人,硕士研究生,CCF会员,主要研究方向:粒计算、小样本学习基金资助:
Ruifeng BAI, Guanglei GOU(), Lang WEN, Wanyu MIAO
Received:
2024-07-17
Revised:
2024-09-26
Accepted:
2024-10-09
Online:
2025-07-10
Published:
2025-07-10
Contact:
Guanglei GOU
About author:
BAI Ruifeng, born in 1999, M. S. candidate. His research interests include granular computing, few-shot learning.Supported by:
摘要:
针对小样本学习中训练数据稀少以及单一距离度量无法全面衡量样本之间关系的问题,提出一种基于粒球原型网络(GBProtoNet)的小样本图像分类方法。首先,将粒球算法(Ball k-means)应用于查询集,并通过自适应更新迭代得到查询集类别信息,之后将这些信息与原型网络(ProtoNet)结合,构造具有查询集与支持集信息的粒球原型,从而缓解训练数据量少的问题;其次,在GBProtoNet特征提取后,设计一个特征筛选模块用于提取样本的重要信息,利用Ball k-means算法得到查询集各类的簇心,并把它们与初始原型进行加权融合,以构造更具代表性的粒球原型;再次,计算初始查询集样本与粒球原型的欧氏距离与余弦距离,并将二者相乘得到综合考量的距离,从而使样本间距离的度量更全面;最后,按照最邻近分配原则,将查询集样本分配给所属类别。实验结果表明,在MiniImageNet和TieredImageNet数据集的5-way 1-shot和5-way 5-shot的图像分类任务中,相较于基线模型ProtoNet,所提方法在MiniImageNet数据集上分类准确率分别提升了6.18%和3.85%,而在TieredImageNet数据集上分别提升了6.89%和3.57%。并且,所提方法在MiniImageNet数据集5-shot图像分类任务上所需时间成本比SSL-ProtoNet (Self-Supervised Learning Prototypical Network)减少了72.6%。可见,所提方法在有效提高小样本图像分类准确度的同时具有高效性。
中图分类号:
白瑞峰, 苟光磊, 文浪, 缪宛谕. 基于粒球原型网络的小样本图像分类方法[J]. 计算机应用, 2025, 45(7): 2269-2277.
Ruifeng BAI, Guanglei GOU, Lang WEN, Wanyu MIAO. Granular-ball prototypical network for few-shot image classification[J]. Journal of Computer Applications, 2025, 45(7): 2269-2277.
模型 | Backbone | 5-way 1-shot | 5-way 5-shot |
---|---|---|---|
MatchNet[ | Conv-4 | 43.56 | 55.31 |
MAML[ | Conv-4 | 48.70 | 63.11 |
ProtoNet[ | Conv-4 | 49.20 | 66.20 |
RelationNe[ | Conv-4 | 50.44 | 65.32 |
SSL[ | Conv-4 | 50.60 | 65.71 |
ECMT[ | Conv-4 | 49.07 | 65.73 |
BOIL[ | Conv-4 | 49.61 | 65.44 |
Bayesian[ | Conv-4 | 50.02 | 65.48 |
LSTAL-ProtoNet[ | Conv-4 | 51.23 | 67.95 |
DW-ProtoNet[ | Conv-4 | 51.08 | 67.51 |
CGRN[ | Conv-4 | 50.85 | 64.13 |
HFFCR[ | Conv-4 | 51.79 | 65.74 |
SSL-ProtoNet[ | Conv-4 | 51.95 | 68.44 |
本文模型 | Conv-4 | 52.24 | 68.75 |
表1 MiniImageNet数据集上的分类结果 ( %)
Tab. 1 Classification results on MiniImageNet dataset
模型 | Backbone | 5-way 1-shot | 5-way 5-shot |
---|---|---|---|
MatchNet[ | Conv-4 | 43.56 | 55.31 |
MAML[ | Conv-4 | 48.70 | 63.11 |
ProtoNet[ | Conv-4 | 49.20 | 66.20 |
RelationNe[ | Conv-4 | 50.44 | 65.32 |
SSL[ | Conv-4 | 50.60 | 65.71 |
ECMT[ | Conv-4 | 49.07 | 65.73 |
BOIL[ | Conv-4 | 49.61 | 65.44 |
Bayesian[ | Conv-4 | 50.02 | 65.48 |
LSTAL-ProtoNet[ | Conv-4 | 51.23 | 67.95 |
DW-ProtoNet[ | Conv-4 | 51.08 | 67.51 |
CGRN[ | Conv-4 | 50.85 | 64.13 |
HFFCR[ | Conv-4 | 51.79 | 65.74 |
SSL-ProtoNet[ | Conv-4 | 51.95 | 68.44 |
本文模型 | Conv-4 | 52.24 | 68.75 |
模型 | Backbone | 5-way 1-shot | 5-way 5-shot |
---|---|---|---|
MatchNet[ | Conv-4 | 42.10 | 50.04 |
MAML[ | Conv-4 | 51.67 | 70.30 |
ProtoNet[ | Conv-4 | 50.32 | 69.42 |
RelationNet[ | Conv-4 | 53.18 | 69.38 |
SSL[ | Conv-4 | 52.93 | 71.71 |
ECMT[ | Conv-4 | 48.19 | 65.50 |
BOIL[ | Conv-4 | 49.35 | 69.37 |
LSTAL-ProtoNet[ | Conv-4 | 50.45 | 70.28 |
DW-ProtoNet[ | Conv-4 | 50.25 | 70.14 |
CGRN[ | Conv-4 | 53.54 | 70.53 |
SSL-ProtoNet[ | Conv-4 | 53.64 | 71.64 |
本文模型 | Conv-4 | 53.79 | 71.90 |
表2 TieredImageNet数据集上的分类结果 ( %)
Tab. 2 Classification results on TieredImageNet dataset
模型 | Backbone | 5-way 1-shot | 5-way 5-shot |
---|---|---|---|
MatchNet[ | Conv-4 | 42.10 | 50.04 |
MAML[ | Conv-4 | 51.67 | 70.30 |
ProtoNet[ | Conv-4 | 50.32 | 69.42 |
RelationNet[ | Conv-4 | 53.18 | 69.38 |
SSL[ | Conv-4 | 52.93 | 71.71 |
ECMT[ | Conv-4 | 48.19 | 65.50 |
BOIL[ | Conv-4 | 49.35 | 69.37 |
LSTAL-ProtoNet[ | Conv-4 | 50.45 | 70.28 |
DW-ProtoNet[ | Conv-4 | 50.25 | 70.14 |
CGRN[ | Conv-4 | 53.54 | 70.53 |
SSL-ProtoNet[ | Conv-4 | 53.64 | 71.64 |
本文模型 | Conv-4 | 53.79 | 71.90 |
模型 | 5-way 1-shot | 5-way 5-shot |
---|---|---|
Ball k-means | 45.26 | 60.99 |
Ball k-means+① | 49.56 | 67.47 |
Ball k-means+② | 45.67 | 61.26 |
Ball k-means+③ | 46.28 | 61.66 |
Ball k-means+①+② | 51.63 | 68.16 |
Ball k-means+①+③ | 51.91 | 68.40 |
本文模型 | 52.24 | 68.75 |
表3 在MiniImageNet数据集上的消融实验结果 (%)
Tab. 3 Ablation experimental results on MiniImageNet dataset
模型 | 5-way 1-shot | 5-way 5-shot |
---|---|---|
Ball k-means | 45.26 | 60.99 |
Ball k-means+① | 49.56 | 67.47 |
Ball k-means+② | 45.67 | 61.26 |
Ball k-means+③ | 46.28 | 61.66 |
Ball k-means+①+② | 51.63 | 68.16 |
Ball k-means+①+③ | 51.91 | 68.40 |
本文模型 | 52.24 | 68.75 |
模型 | 5-way 1-shot | 5-way 5-shot |
---|---|---|
Ball k-means +① | 49.56 | 67.47 |
Ball k-means +①+(a) | 50.12 | 67.68 |
Ball k-means +①+(b) | 51.02 | 68.03 |
Ball k-means +①+(a)(c) | 51.52 | 68.23 |
Ball k-means +①+③ | 51.91 | 68.40 |
表4 在MiniImageNet数据集上方法③的消融实验结果 ( %)
Tab. 4 Method ③ ablation experimental results on MiniImageNet dataset
模型 | 5-way 1-shot | 5-way 5-shot |
---|---|---|
Ball k-means +① | 49.56 | 67.47 |
Ball k-means +①+(a) | 50.12 | 67.68 |
Ball k-means +①+(b) | 51.02 | 68.03 |
Ball k-means +①+(a)(c) | 51.52 | 68.23 |
Ball k-means +①+③ | 51.91 | 68.40 |
5-way 1-shot | 5-way 5-shot | |||
---|---|---|---|---|
损失 | 准确率/% | 损失 | 准确率/% | |
0.40 | 1.433 | 49.41 | 0.934 7 | 66.62 |
0.48 | 1.421 | 49.31 | 0.921 3 | 67.05 |
0.50 | 1.419 | 49.89 | 0.919 7 | 67.32 |
0.52 | 1.387 | 50.56 | 0.920 3 | 67.58 |
0.56 | 1.457 | 49.42 | 0.924 7 | 67.04 |
0.60 | 1.384 | 50.32 | 0.911 4 | 67.44 |
0.005*epoch | 1.216 | 52.24 | 0.890 5 | 68.34 |
0.4+0.001*epoch | 1.310 | 51.35 | 0.899 8 | 68.17 |
0.6-0.001*epoch | 1.375 | 50.92 | 0.903 5 | 67.99 |
0.004*epoch | 1.298 | 51.74 | 0.881 5 | 68.75 |
0.003*epoch | 1.314 | 51.28 | 0.911 8 | 67.54 |
表5 不同α设置的损失与准确率对比实验结果
Tab. 5 Comparison experimental results of loss and accuracy under different α
5-way 1-shot | 5-way 5-shot | |||
---|---|---|---|---|
损失 | 准确率/% | 损失 | 准确率/% | |
0.40 | 1.433 | 49.41 | 0.934 7 | 66.62 |
0.48 | 1.421 | 49.31 | 0.921 3 | 67.05 |
0.50 | 1.419 | 49.89 | 0.919 7 | 67.32 |
0.52 | 1.387 | 50.56 | 0.920 3 | 67.58 |
0.56 | 1.457 | 49.42 | 0.924 7 | 67.04 |
0.60 | 1.384 | 50.32 | 0.911 4 | 67.44 |
0.005*epoch | 1.216 | 52.24 | 0.890 5 | 68.34 |
0.4+0.001*epoch | 1.310 | 51.35 | 0.899 8 | 68.17 |
0.6-0.001*epoch | 1.375 | 50.92 | 0.903 5 | 67.99 |
0.004*epoch | 1.298 | 51.74 | 0.881 5 | 68.75 |
0.003*epoch | 1.314 | 51.28 | 0.911 8 | 67.54 |
模型 | 浮点运算量/MFLOPs | 时间/h | 准确率/% | 时间复杂度 | |||
---|---|---|---|---|---|---|---|
1shot | 5shot | 1shot | 5shot | 1shot | 5shot | ||
ProtoNet[ | 3.47 | 8.60 | 1.4 | 1.7 | 49.20 | 66.20 | O(s+kq) |
Ball k-means[ | 8.15 | 12.79 | 2.0 | 2.2 | 45.26 | 60.99 | O(s+2kq+2k+q+tk²+tkq) |
SSL-ProtoNet[ | 19.60 | 24.30 | 6.9 | 7.3 | 49.23 | 68.44 | — |
本文模型 | 7.70 | 12.34 | 1.8 | 2.0 | 52.24 | 68.75 | O(s+2kq+2k+q+tk²+tkq) |
表6 在MiniImageNet数据集上的计算复杂度对比
Tab. 6 Computational complexity comparison on MiniImageNet dataset
模型 | 浮点运算量/MFLOPs | 时间/h | 准确率/% | 时间复杂度 | |||
---|---|---|---|---|---|---|---|
1shot | 5shot | 1shot | 5shot | 1shot | 5shot | ||
ProtoNet[ | 3.47 | 8.60 | 1.4 | 1.7 | 49.20 | 66.20 | O(s+kq) |
Ball k-means[ | 8.15 | 12.79 | 2.0 | 2.2 | 45.26 | 60.99 | O(s+2kq+2k+q+tk²+tkq) |
SSL-ProtoNet[ | 19.60 | 24.30 | 6.9 | 7.3 | 49.23 | 68.44 | — |
本文模型 | 7.70 | 12.34 | 1.8 | 2.0 | 52.24 | 68.75 | O(s+2kq+2k+q+tk²+tkq) |
[1] | ZHANG A, LIPTON Z C, LI M, et al. Dive into deep learning [EB/OL]. [2024-03-20]. . |
[2] | ZENG W, XIAO Z Y. Few-shot learning based on deep learning: a survey [J]. Mathematical Biosciences and Engineering, 2024, 21(1): 679-711. |
[3] | WANG Y, YAO Q, KWOK J T, et al. Generalizing from a few examples: a survey on few-shot learning [J]. ACM Computing Surveys, 2020, 53(3): No.63. |
[4] | 彭云聪,秦小林,张力戈.面向图像分类的小样本学习算法综述[J].计算机科学,2022, 49(5): 1-9. |
PENG Y C, QIN X L, ZHANG L G. Survey on few-shot learning algorithms for image classification [J]. Computer Science, 2022, 49(5): 1-9. | |
[5] | SNELL J, SWERSKY K, ZEMEL R. Prototypical networks for few-shot learning [C]// Proceedings of the 31st International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2017: 4080-4090. |
[6] | JI Z, CHAI X, YU Y, et al. Improved prototypical networks for few-shot learning [J]. Pattern Recognition Letters, 2020, 140: 81-87. |
[7] | 华超,刘向阳.基于密度加权原型网络的小样本学习算法[J].计算机技术与发展,2022, 32(9): 8-13. |
HUA C, LIU X Y. Few-shot learning based on density-weighted prototypical network [J]. Computer Technology and Development, 2022, 32(9): 8-13. | |
[8] | XIAO Y, JIN Y, HAO K. Adaptive prototypical networks with label words and joint representation learning for few-shot relation classification [J]. IEEE Transactions on Neural Networks and Learning Systems, 2023, 34(3): 1406-1417. |
[9] | LIM J Y, LIM K M, LEE C P, et al. SSL-ProtoNet: Self-Supervised Learning Prototypical Networks for few-shot learning [J]. Expert Systems with Applications, 2024, 238(Pt E): No.122173. |
[10] | REN M, TRIANTAFILLOU E, RAVI S, et al. Meta-learning for semi-supervised few-shot classification [EB/OL]. [2024-03-20]. . |
[11] | LIU X, LIU P, ZONG L. Transductive prototypical network for few-shot classification [C]// Proceedings of the 2020 IEEE International Conference on Image Processing. Piscataway: IEEE, 2020: 1671-1675. |
[12] | XIA S, PENG D, MENG D, et al. Ball k-means: fast adaptive clustering with no bounds [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 44(1): 87-99. |
[13] | XIA S, ZHENG S, WANG G, et al. Granular ball sampling for noisy label classification or imbalanced classification [J]. IEEE Transactions on Neural Networks and Learning Systems, 2023, 34(4): 2144-2155. |
[14] | XIA S, XIE J, WANG G. An adaptive granularity clustering method based on hyper-ball [EB/OL]. [2024-05-22]. . |
[15] | XIA S, LIU Y, DING X, et al. Granular ball computing classifiers for efficient, scalable and robust learning [J]. Information Sciences, 2019, 483: 136-152. |
[16] | 南通大学.基于原型网络的小样本垃圾图像分类方法:202210159436.X [P]. 2022-05-27. |
Nantong University. Prototypical network-based few-shot classification method for trash images: 202210159436.X [P]. 2022-05-27. | |
[17] | LI X, YANG X, MA Z, et al. Deep metric learning for few-shot image classification: a review of recent developments [J]. Pattern Recognition, 2023, 138: No.109381. |
[18] | VINYALS O, BLUNDELL C, LILLICRAP T, et al. Matching networks for one shot learning [C]// Proceedings of the 30th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2016: 3637-3645. |
[19] | CHEN W Y, LIU Y C, KIRA Z, et al. A closer look at few-shot classification [EB/OL]. [2024-05-22]. . |
[20] | GAO F, LUO X, YANG Z, et al. Label smoothing and task-adaptive loss function based on prototype network for few-shot learning [J]. Neural Networks, 2022, 156: 39-48. |
[21] | HU W, ZHONG J, XIA Y, et al. Adaptive prototype network with common and discriminative representation learning for few-shot relation extraction [C]// Proceedings of the 2023 International Conference on Advanced Data Mining and Applications, LNCS 14179. Cham: Springer, 2023: 63-77. |
[22] | 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. |
[23] | NICHOL A, ACHIAM J, SCHULMAN J. On first-order meta-learning algorithms [EB/OL]. [2024-05-22]. . |
[24] | RAGHU A, RAGHU M, BENGIO S, et al. Rapid learning or feature reuse? towards understanding the effectiveness of MAML [EB/OL]. [2024-05-22]. . |
[25] | RAJESWARAN A, FINN C, KAKADE S M, et al. Meta-learning with implicit gradients [EB/OL]. [2024-02-25]. . |
[26] | RAJASEGARAN J, KHAN S, HAYAT M, et al. iTAML: an incremental task-agnostic meta-learning approach [C]// Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2020: 13588-13597. |
[27] | AHMED M, SERAJ R, ISLAM S M S. The k-means algorithm: a comprehensive survey and performance evaluation [J]. Electronics, 2020, 9(8): No.1295. |
[28] | XIA S, WANG G, GAO X. Granular ball computing: an efficient, robust, and interpretable adaptive multi-granularity representation and computation method [EB/OL]. [2024-05-22]. . |
[29] | XIA S, WU S, CHEN X, et al. GRRS: accurate and efficient neighborhood rough set for feature selection [J]. IEEE Transactions on Knowledge and Data Engineering, 2022. |
[30] | XIA S, WANG C, WANG G, et al. A unified granular-ball learning model of Pawlak rough set and neighborhood rough set [EB/OL]. [2024-05-25]. . |
[31] | XIE, JIANG, et al. An efficient spectral clustering algorithm based on granular-ball [J]. IEEE Transactions on Knowledge and Data Engineering, 2023, 35(9): 9743-9753. |
[32] | SUNG F, YANG Y, ZHANG L, et al. Learning to compare: relation network for few-shot learning [C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2018: 1199-1208. |
[33] | RAVICHANDRAN A, BHOTIKA R, SOATTO S. Few-shot learning with embedded class models and shot-free meta training [C]// Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision. Piscataway: IEEE, 2019: 331-339. |
[34] | OH J, YOO H, KIM C H, et al. BOIL: towards representation change for few-shot learning [EB/OL]. [2024-05-25]. . |
[35] | PATACCHIOLA M, TURNER J, CROWLEY E J, et al. Bayesian meta-learning for the few-shot setting via deep kernels [C]// Proceedings of the 34th International Conference on Neural Information Processing Systems. New York: ACM, 2020: 16108-16118. |
[36] | JIA X, SU Y, ZHAO H. Few-shot learning via relation network based on coarse-grained granulation [J]. Applied Intelligence, 2023, 53(1): 996-1008. |
[37] | JIA X, MAO Y, PAN Z, et al. Few-shot learning based on hierarchical feature fusion via relation networks [J]. International Journal of Approximate Reasoning, 2024, 170: No.109186. |
[1] | 李维刚, 李歆怡, 王永强, 赵云涛. 基于自适应动态图卷积和无参注意力的点云分类分割方法[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1980-1986. |
[2] | 崔双双, 王宏志, 朱加昊, 吴昊. 面向低能耗高性能的分类器两阶段数据选择方法[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1703-1711. |
[3] | 蒋杰, 骆功宁, 董素宇, 李凡丁, 李向宇, 李钦策, 袁永峰, 王宽全. 信息瓶颈引导的颅内出血分割方法[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1998-2006. |
[4] | 李道全, 徐正, 陈思慧, 刘嘉宇. 融合变分自编码器与自适应增强卷积神经网络的网络流量分类模型[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1841-1848. |
[5] | 王建华, 吴传宇, 许莉萍. 多因素柔性作业车间绿色调度的改进进化算法[J]. 《计算机应用》唯一官方网站, 2025, 45(6): 1954-1962. |
[6] | 王泉, 陆啟想, 施珮. 用于交通流量预测的多图扩散注意力网络[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1472-1479. |
[7] | 胡婕, 武帅星, 曹芝兰, 张龑. 基于全域信息融合和多维关系感知的命名实体识别模型[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1511-1519. |
[8] | 曾碧卿, 钟广彬, 温志庆. 基于分解式模糊跨度的小样本命名实体识别[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1504-1510. |
[9] | 严一钦, 罗川, 李天瑞, 陈红梅. 基于关系网络和Vision Transformer的跨域小样本分类模型[J]. 《计算机应用》唯一官方网站, 2025, 45(4): 1095-1103. |
[10] | 丁美荣, 卓金鑫, 陆玉武, 刘庆龙, 郎济聪. 融合环境标签平滑与核范数差异的领域自适应[J]. 《计算机应用》唯一官方网站, 2025, 45(4): 1130-1138. |
[11] | 王蔡琪, 崔西宁, 熊毅, 伍世虔. 基于节点到障碍物距离的自适应扩展RRT*路径规划算法[J]. 《计算机应用》唯一官方网站, 2025, 45(3): 920-927. |
[12] | 王兴旺, 张清杨, 姜守勇, 董永权. 基于改进鲸鱼优化算法的动态无人机路径规划[J]. 《计算机应用》唯一官方网站, 2025, 45(3): 928-936. |
[13] | 张传浩, 屠晓涵, 谷学汇, 轩波. 基于多模态信息相互引导补充的雷达-相机三维目标检测[J]. 《计算机应用》唯一官方网站, 2025, 45(3): 946-952. |
[14] | 王雅伦, 张仰森, 朱思文. 面向知识推理的位置编码标题生成模型[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 345-353. |
[15] | 谢斌红, 高婉银, 陆望东, 张英俊, 张睿. 小样本相似性匹配特征增强的密集目标计数网络[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 403-410. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||