作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2023, Vol. 49 ›› Issue (3): 29-36,57. doi: 10.19678/j.issn.1000-3428.0065135

• 热点与综述 • 上一篇    下一篇

基于Transformer与BiLSTM的网络流量入侵检测

石磊1, 张吉涛1, 高宇飞1, 卫琳1, 陶永才1,2   

  1. 1. 郑州大学 网络空间安全学院, 郑州 450002;
    2. 郑州大学 信息工程学院, 郑州 450001
  • 收稿日期:2022-07-01 修回日期:2022-08-29 发布日期:2022-10-09
  • 作者简介:石磊(1967—),男,教授、博士、博士生导师,主研方向为高性能计算、大数据、人工智能;张吉涛,硕士研究生;高宇飞,讲师、博士;卫琳,副教授、硕士;陶永才,讲师、博士。
  • 基金资助:
    国家重点研发计划(2020YFB1712401)。

Intrusion Detection of Network Traffic Based on Transformer and BiLSTM

SHI Lei1, ZHANG Jitao1, GAO Yufei1, WEI Lin1, TAO Yongcai1,2   

  1. 1. School of Cyber Science and Engineering, Zhengzhou University, Zhengzhou 450002, China;
    2. School of Information Engineering, Zhengzhou University, Zhengzhou 450001, China
  • Received:2022-07-01 Revised:2022-08-29 Published:2022-10-09

摘要: 网络流量入侵检测技术对主机和平台安全起着重要作用。目前常采用机器学习和深度学习技术进行网络流量入侵检测,然而相关数据集的不平衡问题导致模型偏向于学习多数类数据的特征而忽视少数类数据的特征,严重影响了检测准确率。结合SMOTE算法和生成对抗网络(GAN)构建OSW模型对训练数据进行预处理,通过Wasserstein GAN学习少数类数据分布情况,避免边缘分布问题,构造平衡数据集。建立基于Transformer与双向长短时记忆-深度神经网络(BiLSTM-DNN)的TBD入侵检测模型,使用Transformer中的编码器捕捉全局联系并对输入数据进行初步特征提取,利用BiLSTM网络进行长距离依赖特征提取保留数据的序列化特征,采用DNN进一步提取深层次特征,最终通过Softmax分类器获得分类结果。在NSL_KDD数据集上的实验结果表明,在进行数据平衡处理后TBD模型的二分类和五分类任务检测准确率分别达到90.3%和79.8%,均高于对比的深度神经网络模型以及机器学习算法。

关键词: 入侵检测, 多头注意力, 双向长短时记忆网络, 深度神经网络, 数据平衡处理

Abstract: Intrusion detection technology based on network traffic plays a critical role in host and platform security. Currently, machine learning and deep learning are often used for network traffic intrusion detection.However, the imbalance in datasets causes the model to tend to learn the features of the majority class data and ignore the features of the minority class data, adversely affecting the accuracy of the network intrusion detection model.Therefore, the Synthetic Minority Oversampling Technique(SMOTE) algorithm and the Generative Adversarial Network(GAN) is combined to construct a model, called OSW, to preprocess the training data.The minority class data distribution is learned through Wasserstein GAN(WGAN) to prevent the problem of marginal distribution and construct a balanced dataset.In addition, an intrusion detection model based on the Transformer and Bidirectional Long Short-Term Memory Deep Neural Network(BiLSTM-DNN), called TBD, is built.The encoder part of the transformer is used to globally capture the connection, and preliminary feature extraction is performed on the input data.The BiLSTM network is used to perform long-distance-dependent feature extraction to retain the serialized features of the data, and DNN is used to further extract deep-level features.The classification results are obtained using the Softmax classifier.The NSL_KDD dataset is used in the experiment. The experimental results show that after the dataset balance processing, the TBD model achieves 90.3% accuracy for the two-class task and 79.8% for the five-class task, which are both higher than those of the comparative deep learning network models and machine learning algorithms.

Key words: intrusion detection, multi-head attention, Bidirectional Long Short-Term Memory(BiLSTM) network, Deep Neural Network(DNN), data balance processing

中图分类号: