留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

基于改进Transformer的视觉语言模型

金泽辉,  陈凯,  唐敦兵,  方国宇,  温菲霞

金泽辉,陈凯,唐敦兵,等. 基于改进Transformer的视觉语言模型[J]. 北京航空航天大学学报,2026,52(11):4019-4028
引用本文: 金泽辉,陈凯,唐敦兵,等. 基于改进Transformer的视觉语言模型[J]. 北京航空航天大学学报,2026,52(11):4019-4028
Jin Z H,Chen K,Tang D B,et al. Visual language model based on improved Transformer[J]. Journal of Beijing University of Aeronautics and Astronautics,2026,52(11):4019-4028 (in Chinese)
Citation: Jin Z H,Chen K,Tang D B,et al. Visual language model based on improved Transformer[J]. Journal of Beijing University of Aeronautics and Astronautics,2026,52(11):4019-4028 (in Chinese)

基于改进Transformer的视觉语言模型

doi: 10.13700/j.bh.1001-5965.2024.0656
基金项目: 

国家自然科学基金(52202417);中国博士后科学基金(2022TQ0155,2022M721605);虚拟现实技术与系统全国重点实验室(北京航空航天大学)开放课题基金(VRLAB2023A02);中国科协青年科技人才托举工程(2023QNRC001);中央高校基本科研业务费专项资金(NS2024030);江苏省科协青年科技人才托举工程(JSTJ-2023-XH032)

详细信息
    通讯作者:

    E-mail:chen_kai@nuaa.edu.cn

  • 中图分类号: V221+.3;TB553

Visual language model based on improved Transformer

Funds: 

National Natural Science Foundation of China (52202417); China Postdoctoral Science Foundation (2022TQ0155,2022M721605); Open Project Program of State Key Laboratory of Virtual Reality Technology and Systems, Beihang University (VRLAB2023A02), Young Elite Scientists Sponsorship Program by CAST (2023QNRC001); The Fundamental Research Funds for the Central Universities (NS2024030); Young Elite Scientists Sponsorship Program by JSTJ (JSTJ-2023-XH032)

More Information
  • 摘要:

    图像字幕是一项结合计算机视觉和自然语言处理的跨模态任务,模型需要为图像生成恰当的描述。为了应对这一挑战,提出一种带有残差注意力模块和门控线性单元的增强Transformer——残差门控 Transformer (RGFormer)。基于CLIP和RGFormer,提出一种生成图像字幕的模型——CRM。CRM利用CLIP的图像编码器提取特征作为图像字幕的前缀,该前缀通过映射网络RGFormer被投影到文本空间,然后被输入GPT-2语言模型中生成图像字幕。CLIP是在一个大型的图像-文本对数据集上进行训练的,包含丰富的视觉和语义信息,非常适合完成视觉-语言跨模态任务。CRM的核心理念是使用RGFormer映射网络来缩小视觉与文本表示之间的差距,从而完成图像字幕任务。CRM可以在短时间内为大规模的数据集生成有意义的描述,且无需额外监督。定量评估实验表明,CRM在COCO Caption数据集上的表现可与一些先进模型相媲美,且效率更高。

     

  • 图 1  CRM网络总体框架

    Figure 1.  Overall structure of CRM

    图 2  CRM编码器和Transformer编码器

    Figure 2.  Image encoder and Transformer encoder

    图 3  RGFormer模块结构

    Figure 3.  Structure of RGFormer module

    图 4  RMHA模块结构

    Figure 4.  Structure of RMHA module

    图 5  集束搜索算法

    Figure 5.  Beam search algorithm

    图 6  COCO Caption测试集中随机选择图像的未筛选结果

    Figure 6.  Unfiltered results of randomly selected images from COCO Caption test set

    图 7  注意力可视化结果

    Figure 7.  Attention visualization results

    图 8  CRM为网络图片生成的字幕

    Figure 8.  Captions for online pictures generated by CRM

    图 9  CRM在不同前缀长度下的性能

    Figure 9.  Performance of CRM under different prefix lengths

    表  1  COCO Caption数据集定量评估结果

    Table  1.   Quantitative evaluation on COCO caption dataset

    模型 BLEU@4 METEOR CIDEr SPICE 参数规模 训练时间/h 设备型号
    BUTD[1] 36.2 27.0 113.5 20.3 5.20×107 960 M40
    VLP[14] 36.5 28.4 117.7 21.3 1.15×108 48 V100
    VL-T5[34] 34.5 28.7 116.5 21.9 2.70×108
    VLKD[35] 34.1 27.5 114.3 21.0
    Oscar[3] 36.58 30.4 124.12 23.17 1.35×108 74 V100
    CRM 33.61 27.85 114.60 21.67 4.60×107 4 3090 Ti
    下载: 导出CSV

    表  2  RGFormer消融实验结果

    Table  2.   Results of ablation experiment of RGFormer

    模型 BLEU@4 METEOR CIDEr SPICE
    CTM 33.53 27.45 113.08 21.05
    CTM+RMHA 33.59 27.73 114.27 21.56
    CTM+GLU 33.50 27.62 113.49 21.23
    CTM+RGFormer(CRM) 33.61 27.85 114.60 21.67
    下载: 导出CSV
  • [1] Anderson P, He X D, Buehler C, et al. Bottom-up and top-down attention for image captioning and visual question answering[C]//Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway Palo Alto: IEEE Press, 2018: 6077-6086.
    [2] Chen X L, Zitnick C L. Learning a recurrent visual representation for image caption generation[EB/OL]. (2014-11-20)[ 2024-12-18]. https://doi.org/10.48550/arXiv.1411.5654.
    [3] Li X J, Yin X, Li C Y, et al. Oscar: object-semantics aligned pre-training for vision-language tasks[C]//Computer Vision-ECCV 2020. Cham: Springer International Publishing, 2020: 121-137.
    [4] Stefanini M, Cornia M, Baraldi L, et al. From show to tell: a survey on deep learning-based image captioning[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45(1): 539-559.
    [5] Tan H, Bansal M. LXMERT: learning cross-modality encoder representations from transformers[EB/OL]. (2019-12-03)[2024-12-20]. https://doi.org/10.48550/arXiv.1908.07490.
    [6] Xu K, Ba J L, Kiros R, et al. Show, attend and tell: neural image caption generation with visual attention[C]//International Conference on Machine Learning. New York: ACM, 2015: 2048-2057.
    [7] Yao T, Pan Y W, Li Y H, et al. Exploring visual relationship for image captioning[C]//Computer Vision-ECCV 2018. Cham: Springer International Publishing, 2018: 711-727.
    [8] Radford A, Kim J W, Hallacy C, et al. Learning transferable visual models from natural language supervision[C]//International Conference on Machine Learning. Virtual Event: PMLR, 2021: 8748-8763.
    [9] Chen X L, Fang H, Lin T Y, et al. Microsoft COCO captions: data collection and evaluation server[EB/OL]. (2015-04-03)[2024-12-20]. https://doi.org/10.48550/arXiv.1504.00325.
    [10] Lin T Y, Maire M, Belongie S, et al. Microsoft COCO: common objects in context[C]//Computer Vision-ECCV 2014. Cham: Springer International Publishing, 2014: 740-755.
    [11] Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition[EB/OL]. (2015-04-10)[2024-12-20]. https://arxiv.org/abs/1409.1556.
    [12] He K M, Zhang X Y, Ren S Q, et al. Deep residual learning for image recognition[C]//Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 770-778.
    [13] Ren S Q, He K M, Girshick R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149.
    [14] Zhou L, Palangi H, Zhang L, et al. Unified vision-language pre-training for image captioning and VQA[C]//Proceedings of the 34th AAAI Conference on Artificial Intelligence Palo Alto: AAAI Press, 2020: 13041-13049.
    [15] Conde M V, Turgutlu K. CLIP-art: contrastive pre-training for fine-grained art classification[C]//Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. Piscataway: IEEE Press, 2021: 3951-3955.
    [16] Zhang R R, Zhang W, Fang R Y, et al. Tip-adapter: training-free adaption of CLIP for few-shot classification[C]//Computer Vision-ECCV 2022. Cham: Springer Nature Switzerland, 2022: 493-510.
    [17] Liu H D, Xu S Y, Fu J M, et al. CMA-CLIP: cross-modality attention CLIP for image-text classification[EB/OL]. (2021-12-09)[2024-12-21]. https://arxiv.org/abs/2112.03562.
    [18] Vidit V, Engilberge M, Salzmann M. CLIP the gap: a single domain generalization approach for object detection[C]//Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2023: 3219-3229.
    [19] Teng Z, Duan Y N, Liu Y, et al. Global to local: clip-LSTM-based object detection from remote sensing images[J]. IEEE Transactions on Geoscience and Remote Sensing, 2022, 60: 5603113.
    [20] Gu X Y, Lin T Y, Kuo W C, et al. Open-vocabulary object detection via vision and language knowledge distillation[EB/OL]. (2022-05-12)[2024-12-21]. https://doi.org/10.48550/arXiv.2104.13921.
    [21] Anderson P, Fernando B, Johnson M, et al. SPICE: semantic propositional image caption evaluation[C]//Computer Vision-ECCV 2016. Cham: Springer International Publishing, 2016: 382-398.
    [22] Yong C, Fei H, Lian Z, et al. A hierarchical multimodal attention-based neural network for image captioning[J]. ACM SIGIR Forum, 2017, 51(CD): 889-892.
    [23] Ji J Y, Luo Y P, Sun X S, et al. Improving image captioning by leveraging intra-and inter-layer global representation in transformer network[C]//Proceedings of the AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2021, 35(2): 1655-1663.
    [24] Luo Y P, Ji J Y, Sun X S, et al. Dual-level collaborative transformer for image captioning[C]//Proceedings of the AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2021, 35(3): 2270-2277.
    [25] Hochreiter S, Schmidhuber J. Long short-term memory[J]. Neural Computation, 1997, 9(8): 1735-1780.
    [26] Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[C]//Advances in Neural Information Processing Systems. Long Beach: Curran Associates, Inc. , 2017, 30: 5998-6008.
    [27] Devlin J, Chang M W, Lee K, et al. BERT: pre-training of deep bidirectional transformers for language understanding[EB/OL]. (2019-05-24)[2024-12-24]. https://doi.org/10.48550/arXiv.1810.04805.
    [28] Lu J, Batra D, Parikh D, et al. Vilbert: pretraining task-agnostic visiolinguistic representations for vision-and-language tasks[J]. Advances in neural information processing systems, 2019, 32.
    [29] Radford A, Wu J, Child R, et al. Language models are unsupervised multitask learners[J]. OpenAI Blog, 2019, 1(8): 9.
    [30] Zhang P C, Li X J, Hu X W, et al. VinVL: revisiting visual representations in vision-language models[C]//Proceedings of the 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2021: 5575-5584.
    [31] Li X L, Liang P. Prefix-tuning: optimizing continuous prompts for generation[EB/OL]. (2021-01-01)[2024-12-25]. https://doi.org/10.48550/arXiv.2101.00190.
    [32] Dosovitskiy A, Beyer L, Kolesnikov A, et al. An image is worth 16x16 words: transformers for image recognition at scale[EB/OL]. V2. (2021-06-03)[2024-12-25]. https://doi.org/10.48550/arXiv.2010.11929.
    [33] Karpathy A, Li F F. Deep visual-semantic alignments for generating image descriptions[C]//Proceedings of the 2015 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2015: 3128-3137.
    [34] Cho J, Lei J, Tan H, et al. Unifying vision-and-language tasks via text generation[C]//International Conference on Machine Learning. Virtual Event: PMLR, 2021: 1931-1942.
    [35] Sun L, Li Y W, Dong Y M. Learning from expert: vision-language knowledge distillation for unsupervised cross-modal hashing retrieval[C]//Proceedings of the 2023 ACM International Conference on Multimedia Retrieval. New York: ACM, 2023: 499-507.
    [36] Raffel C, Shazeer N, Roberts A, et al. Exploring the limits of transfer learning with a unified text-to-text transformer[J]. Journal of Machine Learning Research, 2020, 21(140): 1-67.
    [37] Lewis M, Liu Y H, Goyal N, et al. BART: denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension[EB/OL]. (2019-10-29)[2024-12-25]. https://doi.org/10.48550/arXiv.1910.13461.
    [38] Papineni K, Roukos S, Ward T, et al. Bleu: a method for automatic evaluation of machine translation[C]//Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics. Philadelphia: Association for Computational Linguistics, 2002: 311-318.
    [39] Denkowski M, Lavie A. Meteor universal: language specific translation evaluation for any target language[C]//Proceedings of the Ninth Workshop on Statistical Machine Translation. Philadelphia: Association for Computational Linguistics, 2014: 376-380.
    [40] Vedantam R, Zitnick C L, Parikh D. CIDEr: consensus-based image description evaluation[C]//Proceedings of the 2015 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2015: 4566-4575.
  • 加载中
图(9) / 表(2)
计量
  • 文章访问数:  95
  • HTML全文浏览量:  9
  • PDF下载量:  97
  • 被引次数: 0
出版历程
  • 收稿日期:  2024-09-05
  • 录用日期:  2025-02-14
  • 网络出版日期:  2025-03-19
  • 整期出版日期:  2026-11-30

目录

    /

    返回文章
    返回
    常见问答