电子科技 ›› 2025, Vol. 38 ›› Issue (3): 22-31.doi: 10.16180/j.cnki.issn1007-7820.2025.03.004

• • 上一篇    下一篇

基于图对比学习的自监督网络流量检测模型

王紫祎, 陈世平()   

  1. 上海理工大学 光电信息与计算机工程学院,上海 200093
  • 收稿日期:2023-08-12 修回日期:2023-09-14 出版日期:2025-03-15 发布日期:2025-03-11
  • 通讯作者: 陈世平(1964-),男,E-mail:1164624362@qq.com,博士,教授。研究方向:信息检索、大数据、云计算。
  • 作者简介:王紫祎(1998-),女,硕士研究生。研究方向:异常检测、信息安全。
  • 基金资助:
    国家自然科学基金(61472256);国家自然科学基金(61170277);上海理工大学科技发展基金(16KJFZ035);上海理工大学科技发展基金(2017KJFZ033);沪江基金(A14006)

Self-Supervised Network Intrusion Detection Model Based on Graph Contrastive Learning

WANG Ziyi, CHEN Shiping()   

  1. School of Optical-Electrical and Computer Engineering,University of Shanghai for Science and Technology,Shanghai 200093,China
  • Received:2023-08-12 Revised:2023-09-14 Online:2025-03-15 Published:2025-03-11
  • Supported by:
    National Natural Science Foundation of China(61472256);National Natural Science Foundation of China(61170277);Shanghai University of Technology Science and Technology Development Foundation(16KJFZ035);Shanghai University of Technology Science and Technology Development Foundation(2017KJFZ033);Hujiang Foundation(A14006)

摘要:

传统网络异常流量检测方法存在忽略网络拓扑结构、获取标注数据成本高等问题,导致模型的准确率和泛化性较低。为此,文中提出了一种基于图神经网络和自监督学习的检测方法。利用网络流量数据的特点构建自监督图对比学习任务,通过边特征变换和边遮掩进行流量图增强生成对比样本。改进基于GraphSAGE(Graph SAmple and aggreGatE)的图编码器以充分利用相关关系来丰富节点的特征表示。使用适合对比学习的InfoNCE损失函数训练图编码器的参数,实现自主学习特征表示,摆脱对网络流量标签数据的依赖,并提高网络异常流量检测的准确率。实验结果表明,所提模型在没有标签数据的情况下在检测异常网络流量性能方面表现良好,在两个公开数据集上的F1值分别达到了92.64%和90.97%。

关键词: 网络流量检测, 图神经网络, 对比学习, 自监督表征学习, InfoNCE损失函数, 图表示学习, 深度学习, 图数据增强

Abstract:

Traditional methods for detecting network traffic anomalies suffer from issues such as neglecting network topology and high costs associated with acquiring labeled data, leading to lower model accuracy and generalization. This study proposes a detection approach based on graph neural networks and self-supervised learning. Based on the characteristics of network traffic data, the self-supervised graph comparison learning task is constructed, and the traffic graph is enhanced by edge feature transformation and edge masking to generate comparison samples. The graph encoder based on GraphSAGE(Graph SAmple and aggreGatE)is improved to make full use of correlation to enrich the feature representation of nodes, and the parameters of the graph encoder are trained with InfoNCE loss function suitable for comparative learning to achieve self-learning feature representation, get rid of the dependence on network traffic label data, and improve the accuracy of network abnormal traffic detection. The experimental results show that the proposed model performs well in detecting abnormal network traffic without label data, with F1 values reaching 92.64% and 90.97% on two public data sets, respectively.

Key words: network intrusion detection, graph neural networks, contrastive learning, self-supervised learning, InfoNCE loss function, graph representation learning, deep learning, graph data enhancement

中图分类号: 

  • TP393