基于轻量化Transformer的无人机流量入侵检测方法
网络出版日期: 2026-05-13
基金资助
国家自然科学基金(61806219,61703426,61876189);陕西省科学基金(2021JM-226);陕西省高校科协青年人才托举计划(20190108,20220106);陕西省创新能力支撑计划(2020KJXX-065)
版权
UAV traffic intrusion detection method based on lightweight Transformer model
Online published: 2026-05-13
Copyright
随着无人机技术的快速发展和广泛应用,无人机网络遭受非法入侵事件频发,给公共安全带来了严重威胁。为了增强无人机网络流量的特征提取能力,有效监视无人机运行状态,本文提出一种基于轻量化 Transformer 的无人机流量入侵检测方法,该方法融合旋转位置编码、局部聚合注意力单元及改进型前馈神经网络。首先,采用旋转位置编码对网络流量进行位置编码;为增强网络流量的局部和全局信息提取,本文提出了一种局部聚合注意力单元,利用分组线性变换能够有效地聚合和提取局部特征,并利用自注意力机制实现对全局信息的感知和增强。然后,利用改进型轻量化前馈神经网络对增强后的特征进行提取。最后,在CICIDS2017和UNSWNB15数据集上验证了所提方法的有效性,实验结果表明,所提出的无人机流量入侵检测方法具有更加优越的检测性能,为无人机系统的安全防护提供了新的轻量化解决方案。
关键词: 无人机; 流量入侵检测; Transformer模型; 自注意力机制
田德阳 , 王鹏 , 吴暄 , 王晓丹 , 刘昌云 , 宋亚飞 , 雷琴 . 基于轻量化Transformer的无人机流量入侵检测方法[J]. 网络空间安全科学学报, 2026 , 4(1) : 34 -43 . DOI: 10.20172/j.issn.2097-3136.260201
With the rapid development and widespread application of unmanned aerial vehicles (UAV), the frequent occurrence of unauthorized intrusions into UAV networks has posed serious threats to public safety. To enhance the feature extraction capabilities of UAV network traffic and effectively monitor the operational status of UAV, we propose a lightweight Transformer-based UAV traffic intrusion detection method that incorporates rotational position encoding, locally aggregated attention units, and improved feedforward neural network (FFN). Firstly, we employ rotational position encoding to encode the positions of network traffic and propose a locally aggregated attention unit. By utilizing grouped linear transformations, the unit can effectively aggregate and extract local features, and leverage the self-attention mechanism to perceive and enhance global information. Subsequently, the enhanced features are extracted using a improved lightweight FFN. Finally, the effectiveness of the proposed method is validated on the CICIDS2017 and UNSWNB15 datasets. Experimental results demonstrate that the proposed UAV traffic intrusion detection method exhibits superior detection performance, providing a new lightweight solution for the security protection of UAV systems.
表 1 模型配置Table 1 Model configuration |
| 配置项 | 配置内容 |
| 损失函数 | Cross entropy |
| 优化器 | Adam |
表 2 模型超参数设置Table 2 Model hyperparameter settings |
| 超参数 | 值 |
| 早停迭代次数 | 30 |
| 特征映射维度 | 128 |
| 分组变换层数 | 3 |
| 编码器层数 | 3 |
| 前馈神经网络维度 | 64 |
| 学习率 | 0.001 |
| 迭代次数 | 100 |
| Batch size | 512 |
图 6 UNSWNB15噪声数据集泛化性能对比实验结果Fig.6 Generalization performance comparison experiment results of UNSWNB15 noisy dataset |
图 7 CICIDS2017数据集超参数实验结果Fig.7 Hyperparameter experiment results of CICIDS2017 dataset |
表 3 消融实验结果Table 3 Ablation experiment results |
| 序号 | 多头注意力机制 | 局部聚合注意力单元 | 轻量化FFN | 传统FNN | 准确率 | 精确率 | 召回率 | F1 分数 |
| 1 | √ | √ | 97.84% | 97.92% | 97.96% | 97.94% | ||
| 2 | √ | √ | 97.34% | 97.72% | 97.12% | 97.42% | ||
| 3 | √ | √ | 98.44% | 98.52% | 98.34% | 98.43% | ||
| 4 | √ | √ | 99.34% | 99.43% | 99.94% | 99.52% |
| 1 |
Shafik W, Matinkhah S M, Shokoor F. Cybersecurity in unmanned aerial vehicles: a review[J]. International Journal on Smart Sensing and Intelligent Systems, 2023, 16, 20230012.
|
| 2 |
Fotohi R, Abdan M, Ghasemi S. A self-adaptive intrusion detection system for securing UAV-to-UAV communications based on the human immune system in UAV networks[J]. Journal of Grid Computing, 2022, 20 (3): 22.
|
| 3 |
Choudhary G, Sharma V, You I, et al. Intrusion detection systems for networked unmanned aerial vehicles: a survey[C]//Proceedings of the 2018 14th International Wireless Communications & Mobile Computing Conference (IWCMC). Piscataway: IEEE Press, 2018: 560-565.
|
| 4 |
Muniraj D, Farhood M. A framework for detection of sensor attacks on small unmanned aircraft systems[C]//Proceedings of the 2017 International Conference on Unmanned Aircraft Systems (ICUAS) . Piscataway: IEEE Press, 2017: 1189-1198.
|
| 5 |
Zhu H J, Du S G, Gao Z Y, et al. A probabilistic misbehavior detection scheme toward efficient trust establishment in delay-tolerant networks[J]. IEEE Transactions on Parallel and Distributed Systems, 2014, 25 (1): 22- 32.
|
| 6 |
Condomines J P, Zhang R H, Larrieu N. Network intrusion detection system for UAV ad-hoc communication: from methodology design to real test validation[J]. Ad Hoc Networks, 2019, 90, 101759.
|
| 7 |
Xie Y W, He W, Zhu H L, et al. A new unmanned aerial vehicle intrusion detection method based on belief rule base with evidential reasoning[J]. Heliyon, 2022, 8 (9): e10481.
|
| 8 |
Hassler S C, Ahmad Mughal U, Ismail M. Cyber-physical intrusion detection system for unmanned aerial vehicles[J]. IEEE Transactions on Intelligent Transportation Systems, 2024, 25 (6): 6106- 6117.
|
| 9 |
Shrestha R, Omidkar A, Roudi S A, et al. Machine-learning-enabled intrusion detection system for cellular connected UAV networks[J]. Electronics, 2021, 10 (13): 1549.
|
| 10 |
Samriya J K, Kumar M, Tiwari R. Energy-aware ACO-DNN optimization model for intrusion detection of unmanned aerial vehicle (UAVs)[J]. Journal of Ambient Intelligence and Humanized Computing, 2023, 14 (8): 10947- 10962.
|
| 11 |
Sucharitha Y, Reddy P C S, Surya N G. Network intrusion detection of drones using recurrent neural networks[J]. Drone Technology, 2023, 6 (3): 375- 392.
|
| 12 |
Ahmad W, Almaiah M A, Ali A, et al. Deep learning based network intrusion detection for unmanned aerial vehicle (UAV)[C]//Proceedings of the 2024 7th World Conference on Computing and Communication Technologies (WCCCT). Piscataway: IEEE Press, 2024: 31-36.
|
| 13 |
Patwardhan N, Marrone S, Sansone C. Transformers in the real world: a survey on NLP applications[J]. Information, 2023, 14 (4): 242.
|
| 14 |
Brasoveanu A M P, Andonie R. Visualizing transformers for NLP: a brief survey[C]//Proceedings of the 2020 24th International Conference Information Visualisation (IV) . Piscataway: IEEE Press, 2020: 270-279.
|
| 15 |
Han K, Wang Y H, Chen H T, et al. A survey on vision transformer[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45 (1): 87- 110.
|
| 16 |
Liu Y, Zhang Y, Wang Y X, et al. A survey of visual transformers[J]. IEEE Transactions on Neural Networks and Learning Systems, 2024, 35 (6): 7478- 7498.
|
| 17 |
Boukhamla A, Gaviro J C. CICIDS2017 dataset: performance improvements and validation as a robust intrusion detection system testbed[J]. International Journal of Information and Computer Security, 2021, 16 (1/2): 20.
|
| 18 |
Moustafa N, Slay J. UNSW-NB15: a comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set)[C]//Proceedings of the 2015 Military Communications and Information Systems Conference (MilCIS). Piscataway: IEEE Press, 2015: 1-6.
|
| 19 |
Navya V K, Adithi J, Rudrawal D, et al. Intrusion detection system using deep neural networks (DNN)[C]//Proceedings of the 2021 International Conference on Advancements in Electrical, Electronics, Communication, Computing and Automation (ICAECA). Piscataway: IEEE Press, 2021: 1-6.
|
| 20 |
Mohammadpour L, Ling T C, Liew C S, et al. A survey of CNN-based network intrusion detection[J]. Applied Sciences, 2022, 12 (16): 8162.
|
| 21 |
Laghrissi F, Douzi S, Douzi K, et al. Intrusion detection systems using long short-term memory(LSTM)[J]. Journal of Big Data, 2021, 8, 65.
|
| 22 |
Zhai f, Yang t, Chen h, et al. Intrusion detection method based on CNN–GRU–FL in a smart grid environment[J/OL]. Electronics, 2023, 12(5): 1164. https://doi.org/10.3390/electronics12051164.
|
/
| 〈 |
|
〉 |