Electronic Science and Technology ›› 2025, Vol. 38 ›› Issue (3): 22-31.doi: 10.16180/j.cnki.issn1007-7820.2025.03.004

Previous Articles     Next Articles

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)

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

CLC Number: 

  • TP393