留言板

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

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

面向无人机平台的CNN-Transformer混合模型训练后量化方法

赵呈功,  胡纪远,  杨星宇,  陈磊,  姜宏旭

赵呈功,胡纪远,杨星宇,等. 面向无人机平台的CNN-Transformer混合模型训练后量化方法[J]. 北京航空航天大学学报,2026,52(9):3066-3074
引用本文: 赵呈功,胡纪远,杨星宇,等. 面向无人机平台的CNN-Transformer混合模型训练后量化方法[J]. 北京航空航天大学学报,2026,52(9):3066-3074
Zhao C G,Hu J Y,Yang X Y,et al. A post-training quantization method for CNN-Transformer hybrid models on UAV platforms[J]. Journal of Beijing University of Aeronautics and Astronautics,2026,52(9):3066-3074 (in Chinese)
Citation: Zhao C G,Hu J Y,Yang X Y,et al. A post-training quantization method for CNN-Transformer hybrid models on UAV platforms[J]. Journal of Beijing University of Aeronautics and Astronautics,2026,52(9):3066-3074 (in Chinese)

面向无人机平台的CNN-Transformer混合模型训练后量化方法

doi: 10.13700/j.bh.1001-5965.2025.0411
详细信息
    通讯作者:

    E-mail:jianghx@buaa.edu.cn

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

A post-training quantization method for CNN-Transformer hybrid models on UAV platforms

More Information
  • 摘要:

    近年,无人机在各类低空生产、服务场景作用愈发重要。由于边缘计算平台的存储、计算资源受限,视觉模型的边端侧运行性能短板成为算法应用于以上场景的技术瓶颈。针对卷积神经网络(CNN)-Transformer混合模型激活值长尾分布导致量化精度严重退化问题,提出高效训练后量化方法。该方法通过激活值噪声补偿(ANC)和自适应难度迁移抑制异常值对量化精度的影响,在提升模型量化精度同时提高其推理速度。实验结果表明:所提方法在典型模型的8 bit量化场景下,精度损失小于1%,量化后推理速度最高提升超过200%。所提方法显著提升了边端侧设备的视觉模型推理性能,为低空无人机平台上的模型部署提供了技术支撑。

     

  • 图 1  ANC/ADM的优化过程

    Figure 1.  Optimization process of ANC/ADM

    图 2  比较量化前后各模型的推理速度

    Figure 2.  Comparison of inference speed before and after quantization across different models

    图 3  ANC和ADM在MobileViT模型和MobileViTv2模型上的消融实验结果

    Figure 3.  Ablation results of ANC and ADM on MobileViT and MobileViTv2 model

    图 4  Efficientformer中间和最后阶段全连接层卷积的激活值分布变化

    Figure 4.  Change in activation value distribution of fully connected layer convolutions in middle and final stages of Efficientformer

    表  1  MobileViT模型量化后精度

    Table  1.   Accuracy of MobileViT after quantization

    方法权重/激活值精度Top-1/%
    MobileViT-xxsMobileViT-xsMobileViT-s
    全精度32/3269.0074.8078.40
    FQ-ViT[18]8/866.4668.2877.67
    PTQ4ViT[19]8/837.7565.5268.19
    RepQ-ViT[24]8/81.8541.9650.01
    Q-HyViT[22]8/867.2073.8977.72
    HyQ[23]8/868.1573.9977.93
    EasyQuant[25]8/836.1373.1674.21
    本文OAQ方法8/868.6574.3578.09
    下载: 导出CSV

    表  2  MobileViTv2模型量化后精度

    Table  2.   Accuracy of MobileViTv2 after quantization

    方法 权重/激活值 精度Top-1/%
    MobileViTv2-50 MobileViTv2-75 MobileViTv2-100
    全精度 32/32 70.20 75.60 78.10
    FQ-ViT[18] 8/8 67.66 69.56 77.15
    PTQ4ViT[19] 8/8 39.39 65.54 51.02
    RepQ-ViT[24] 8/8 26.60 55.52 40.85
    Q-HyViT[22] 8/8 69.89 75.29 77.63
    HyQ[23] 8/8 69.16 74.47 76.63
    EasyQuant[25] 8/8 66.80 62.91 69.34
    本文OAQ方法 8/8 69.97 75.31 77.86
    下载: 导出CSV

    表  3  EfficientFormer模型量化后精度

    Table  3.   Accuracy of EfficientFormer after quantization

    方法权重/激活值Top-1精度/%
    EfficientFormer-L1EfficientFormer-L3EfficientFormer-L7
    全精度32/3280.2082.4083.30
    FQ-ViT[18]8/866.6381.8582.47
    PTQ4ViT[19]8/879.1480.3181.56
    RepQ-ViT[24]8/879.6781.9882.47
    HyQ[23]8/878.5582.2682.66
    EasyQuant[25]8/878.4281.0382.27
    本文OAQ方法8/880.0982.1483.15
    下载: 导出CSV
  • [1] Dai Z, Liu H, Le Q V, et al. Coatnet: marrying convolution and attention for all data sizes[J]. Advances in neural information processing systems, 2021, 34: 3965-3977.
    [2] KRIZHEVSKY A, SUTSKEVER I, HINTON G E. ImageNet classification with deep convolutional neural networks[J]. Communications of the ACM, 2017, 60(6): 84-90.
    [3] Zeiler M D, Fergus R. Visualizing and understanding convolutional networks[C]//Proceedings of the Computer Vision-ECCV. Berlin: Springer, 2014: 818-833.
    [4] Simonyan K, Zisserman A. Very deep convolutional networks for large-scale image recognition[EB/OL]. (2014-09-04)[2025-06-20]. https://arxiv.org/abs/1409.1556.
    [5] Shafiq M, Gu Z Q. Deep residual learning for image recognition: a survey[J]. Applied Sciences, 2022, 12(18): 8972.
    [6] Liu Z, Lin Y T, Cao Y, et al. Swin transformer: hierarchical vision transformer using shifted windows[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Piscataway: IEEE Press, 2022: 9992-10002.
    [7] Dosovitskiy A, Beyer L, Kolesnikov A, et al. An image is worth 16x16 words: transformers for image recognition at scale[EB/OL]. (2020-12-22)[2025-06-20]. https://arxiv.org/abs/2010.11929.
    [8] Touvron H, Cord M, Douze M, et al. Training data-efficient image transformers & distillation through attention[EB/OL]. (2020-12-23)[2025-06-20]. https://arxiv.org/abs/2012.12877.
    [9] Selva J, Johansen A S, Escalera S, et al. Video transformers: a survey[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45(11): 12922-12943.
    [10] Hashiguchi R, Tamaki T. Vision transformer with cross-attention by temporal shift for efficient action recognition[EB/OL]. (2022-04-01)[2025-06-21]. https://arxiv.org/abs/2204.00452.
    [11] Manzari O N, Ahmadabadi H, Kashiani H, et al. MedViT: a robust vision transformer for generalized medical image classification[J]. Computers in Biology and Medicine, 2023, 157: 106791.
    [12] Mehta S, Rastegari M. MobileViT: light-weight, general-purpose, and mobile-friendly vision transformer[EB/OL]. (2021-10-05)[2025-06-21]. https://arxiv.org/abs/2110.02178.
    [13] Maaz M, Shaker A, Cholakkal H, et al. EdgeNeXT: efficiently amalgamated CNN-transformer architecture forMobile vision applications[C]//Proceedings of the Computer Vision-ECCV Workshops. Berilin: Springer, 2023: 3-20.
    [14] Evangelidis G, Hu J, Li Y Y, et al. EfficientFormer: vision transformers at MobileNet speed[C]//Proceedings of the Advances in Neural Information Processing Systems 35. San Diego: Neural Information Processing Systems Foundation, Inc., 2022: 12934-12949.
    [15] Zhang D Q, Yang J L, Ye D, et al. LQ-nets: learned quantization for highly accurate and compact deep neural networks[C]//Proceedings of the Computer Vision-ECCV. Berlin: Springer, 2018: 373-390.
    [16] Dong P Y, Lu L, Lyu C, et al. PackQViT: faster sub-8-bit vision transformers via full and packed quantization on the mobile[C]// Proceedings of the Advances in Neural Information Processing Systems 36. San Diego: Neural Information Processing Systems Foundation, Inc., 2023: 9015-9028.
    [17] Liu Z H, Wang Y H, Han K, et al. Post-training quantization for vision transformer[EB/OL]. (2021-06-27)[2025-06-21]. https://arxiv.org/abs/2106.14156.
    [18] Lin Y, Zhang T Y, Sun P Q, et al. FQ-ViT: post-training quantization for fully quantized vision transformer[EB/OL]. (2021-11-27)[2025-06-21]. https://arxiv.org/abs/2111.13824.
    [19] Yuan Z H, Xue C H, Chen Y Q, et al. PTQ4ViT: post-training quantization for vision transformers with twin uniform quantization[C]//Proceedings of the Computer Vision-ECCV. Berlin: Springer, 2022: 191-207.
    [20] Jacob B, Kligys S, Chen B, et al. Quantization and training of neural networks for efficient integer-arithmetic-only inference[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2018: 2704-2713.
    [21] Nagel M, Ali Amjad R, Van Baalen M, et al. Up or down adaptive rounding for post-training quantization[C]//Proceedings of the 37th International Conference on Machine Learning. New York: ACM, 2020: 7197-7206.
    [22] Lee J, Kwon Y, Park S, et al. Q-HyViT: post-training quantization of hybrid vision transformers with bridge block reconstruction for IoT systems[J]. IEEE Internet of Things Journal, 2024, 11(22): 36384-36396.
    [23] Kim N J, Lee J, Kim H. HyQ: hardware-friendly post-training quantization for CNN-transformer hybrid networks[C]//Proceedings of the 33th International Joint Conference on Artificial Intelligence . New York: ACM, 2024: 4291-4299.
    [24] Mehta S, Rastegari M. Separable self-attention for mobile vision transformers[EB/OL]. (2022-06-06)[2025-06-21]. https://arxiv.org/abs/2206.02680.
    [25] Li Z K, Xiao J R, Yang L W, et al. RepQ-ViT: scale reparameterization for post-training quantization of vision transformers[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Piscataway: IEEE Press, 2024: 17181-17190.
    [26] Wu D, Tang Q, Zhao Y L, et al. EasyQuant: post-training quantization via scale optimization[EB/OL]. (2020-06-30)[2025-06-21]. https://arxiv.org/abs/2006.16669.
    [27] Chen J M, Chao Y H, Wang Y J, et al. QuantTune: optimizing model quantization with adaptive outlier-driven fine tuning[EB/OL]. (2024-03-11)[2025-06-21]. https://arxiv.org/abs/2403.06497.
  • 加载中
图(4) / 表(3)
计量
  • 文章访问数:  250
  • HTML全文浏览量:  93
  • PDF下载量:  13
  • 被引次数: 0
出版历程
  • 收稿日期:  2025-06-27
  • 录用日期:  2025-09-25
  • 网络出版日期:  2025-09-30
  • 整期出版日期:  2026-09-01

目录

    /

    返回文章
    返回
    常见问答