To address the challenge of identifying IPSec products, a deep learning method based on data equilibrium combining Transformer and bidirectional long short-term memory network (DETB) is proposed. The method is divided into 3 stages: preprocessing, feature extraction, and feature fusion. In the preprocessing stage, raw traffic is divided into session-level bidirectional flows, and a data equilibrium strategy is introduced. In the feature extraction stage, global and spatio-temporal feature extraction are performed. In the feature fusion stage, global and spatio-temporal features are weighted and fused to achieve product classification. Experiments are conducted on the public dataset ISCXVPN-2016 and a self-built dataset IKEv1. The results show that F1 scores of 95.88% and 97.15% are achieved by using DETB, respectively. Compared with existing mainstream methods, significant advantages in classification performance and generalization capability are shown by using DETB.
针对上述问题,融合Transformer与Bi-LSTM的优势,并引入数据均衡策略,提出一种基于数据均衡的结合Transformer和Bi-LSTM的深度学习方法(Deep Learning Method Based on Data Equilibrium Combining Transformer and Bi-LSTM, DETB)。该方法共分为3个阶段,其中:预处理阶段,将数据流中包序列分为会话级双向流并通过累积分布函数(Cumulative Distribution Function, CDF)实现流内数据均衡;特征提取阶段,预处理后的数据流被并行输入全局特征提取模块和时空特征提取模块,分别用于提取数据的全局特征和时空特征;特征融合分类阶段则通过加权机制融合全局和时空特征,利用Softmax和Argmax函数对流量进行分类,成功识别各类IPSec产品。
1)计算3个矩阵。将经过单词编码和位置编码的数据输入特征相加后的向量作为Transformer的输入。将该输入通过3个独立的可学习线性变换矩阵分别映射到不同的语义子空间,生成3个矩阵 Q (查询)、 K (键)、 V (值),分别代表当前位置的语义特征、每个位置的可被注意的特征表示、每个位置的实际内容。
2)计算注意力权重。首先,通过利用查询矩阵 Q 与键矩阵 K 的转置相乘,并除以缩放因子,得到注意力得分矩阵;其次,可选择性地加入掩码Mask(opt.)以屏蔽无效或未来位置的信息;最后,利用Softmax函数进行归一化操作,得到注意力权重矩阵。其具体公式为
NGUYENT T T, ARMITAGEG. A survey of techniques for Internet traffic classification using machine learning[J]. IEEE Communications Surveys & Tutorials, 2008,10(4):56-76.
[2]
FINSTERBUSCHM, RICHTERC, ROCHAE, et al. A survey of payload-based traffic classification approaches[J]. IEEE Communications Surveys & Tutorials, 2014,16(2):1135-1156.
XUEB, YIW J, JINGF, et al. Complex ISAR target recognition using deep adaptive learning[J]. Engineering Applications of Artificial Intelligence, 2021,97:No.104025.
ZHANGH, GUANH C, YANH B, et al. Webshell traffic detection with character-level features based on deep learning[J]. IEEE Access, 2018,6:75268-75277.
[7]
HENDAOUIF, FERCHICHIA, TRABELSIL, et al. Advances in deep learning intrusion detection over encrypted data with privacy preservation: a systematic review[J]. Cluster Computing, 2024,27(7):8683-8724.
[8]
LIUY, WANGX, QUB, et al. ATVITSC: a novel encrypted traffic classification method based on deep learning[J]. IEEE Transactions on Information Forensics and Security, 2024,19:9374-9389.
KIPERWASSERE, GOLDBERGY. Simple and accurate dependency parsing using bidirectional LSTM feature representations[J]. Transactions of the Association for Computational Linguistics, 2016,4:313-327.
[11]
SUBHAN RIZAD B, YUNITAD R, ROSNELLYD R. Comparative analysis of LSTM and BiLSTM in image detection processing[J]. Journal of Wireless Mobile Networks, Ubiquitous Computing, and Dependable Applications, 2024,15(1):244-260.
[12]
VASWANIA, SHAZEERN, PARMARN, et al. Attention is all you need[J]. Advances in Neural Information Processing Systems, 2017,30:No.5998.
[13]
SHERSTINSKYA. Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network[J]. Physica D: Nonlinear Phenomena, 2020,404:No.132306.
[14]
ZOUZ, GEJ G, ZHENGH B, et al. Encrypted traffic classification with a convolutional long short-term memory neural network[C]∥Proceedings of 2018 IEEE 20th International Conference on High Performance Computing and Communications. Piscataway, USA: IEEE, 2019:329-334.
[15]
LIUC, HEL T, XIONGG, et al. FS-Net: a flow sequence network for encrypted traffic classification[C]∥Proceedings of IEEE INFOCOM 2019. Piscataway, USA: IEEE, 2019:1171-1179.
[16]
ZHUS Z, XUX L, GAOH H, et al. CMTSNN: a deep learning model for multiclassification of abnormal and encrypted traffic of Internet of Things[J]. IEEE Internet of Things Journal, 2023,10(13):11773-11791.