The proposed EGSCA framework focuses on network traffic anomaly detection under unsupervised settings based on self-supervised graph representation learning. To clarify the positioning and novelty of this work within existing research, related studies are systematically reviewed from two closely related perspectives. First, graph neural network-based intrusion detection methods are examined, with particular emphasis on their evolution and limitations in terms of graph construction strategies, edge feature modeling, and label dependency. Second, the application of self-supervised learning in intrusion detection is analyzed, especially focusing on different paradigms such as graph contrastive learning and masked autoencoding, along with their technical routes, key challenges, and limitations in modeling feature distribution alignment and structural similarity. Through this twofold review, the strong dependence of existing methods on labeled data and their limited adaptability in unlabeled scenarios are revealed, while the insufficiency of current self-supervised approaches in jointly modeling feature distributions and topological structures is highlighted, thereby naturally motivating the design of the EGSCA framework.
2.1. GNN-Based Network Intrusion Detection
Traditional network intrusion detection methods primarily rely on rule-based feature matching or conventional machine learning algorithms, such as random forests, support vector machines, and decision trees. These approaches typically treat each network flow or session as an independent sample, thereby overlooking the inherent structural dependencies among network entities. However, modern cyber attacks—such as distributed denial-of-service (DDoS), lateral movement, botnets, and command-and-control communications—often manifest as coordinated behaviors across multiple entities, naturally exhibiting graph-structured characteristics in their propagation patterns and attack paths. In recent years, graph neural networks have been widely applied to network intrusion detection due to their capability to capture structural dependencies among network entities. By modeling network flows as graphs, nodes typically represent hosts or flows, while edges describe communication relationships. This formulation enables GNNs to aggregate both local and global contextual information, significantly improving detection performance.
Zhong et al. [
3] conducted a comprehensive survey of GNN-based intrusion detection systems, reviewing over 100 studies from the perspectives of graph construction, model architecture, learning paradigms, and deployment scenarios. Their analysis highlighted key challenges, including dynamic graph updates, large-scale graph sampling, and dependence on labeled data. Similarly, Alshehri et al. [
4] evaluated 28 GNN-based malicious traffic detection approaches (2020–2025) across diverse environments, including IoT, enterprise networks, software-defined networks, and vehicular networks, demonstrating that GNNs significantly outperform traditional feature-based methods in capturing multi-step attacks and lateral movement behaviors.
From the perspective of graph construction, existing approaches can be broadly categorized into flow-level graphs and host-level communication graphs. In flow-level methods, each network flow (e.g., a five-tuple consisting of source IP, source port, destination IP, destination port, and protocol) is modeled as a node, with features including duration, packet counts, byte volumes, and flags. Edges are established based on temporal proximity or shared attributes.
In terms of flow-level graph construction, the GNN-IDS framework proposed by Sun et al. [
5] leverages graph convolutional networks to perform neighborhood aggregation, and superior performance has been achieved compared with GCN and GAT on the CIC-IDS2017 dataset. However, GCN follows a transductive learning paradigm, in which the complete graph structure is required to be known prior to training, thereby limiting its applicability in dynamic networks with unseen nodes. Building upon this, Li et al. [
6] further introduced an edge-enhanced EE-GraphSAGE model, in which node features are initialized via aggregation of neighboring edge attributes, and both node and edge features are jointly incorporated during message passing. Residual connections are introduced to preserve original edge attributes and mitigate over-smoothing. As a result, F1-scores of 99.41%, 98.66%, and 99.78% have been reported on CICIoT2023, Edge-IIoT, and BoT-IoT datasets, respectively. Similarly, Tran et al. [
7] proposed FN-GNN, in which a hybrid graph model combining GCN and SAGEConv is designed. In this approach, graph nodes are initialized using flow feature data, while edges are constructed based on IP relationships, and its effectiveness has been validated on the CICIDS-2017 and UNSW-NB15 datasets. Furthermore, Lin et al. [
8] proposed the E-GRACL method, where residual connections and global context modeling are incorporated into GraphSAGE [
9], leading to further improvements in IoT intrusion detection performance. Sagar et al. [
10] addressed the limitations of traditional centralized anomaly detection methods in scalability and privacy preservation by proposing a federated adversarial learning framework, GNN-FedGAN. Specifically, a GNN-based discriminator is introduced to model the structural characteristics of IoT attack graphs, thereby enhancing the detection capability for complex attack patterns. As network traffic becomes increasingly complex, it is generally observed that single-modality feature extraction is insufficient to fully capture the complete patterns of attack behaviors. To overcome this limitation, Farrukh et al. [
11] proposed the XG-NID framework, in which flow-level and packet-level data are integrated into a heterogeneous graph for the first time. A heterogeneous graph neural network is employed to perform graph-level classification, enabling real-time inference and achieving an F1-score of 97% in multi-class classification tasks. In addition, Ma et al. [
12] proposed XMF-GNN, where a cross-modal attention fusion mechanism is adopted to construct a dual-modality heterogeneous graph representation based on flow and packet data. The importance weights across modalities are dynamically learned, resulting in F1-scores of 0.977 and 0.985 on multi-class classification tasks over the CIC-IDS2017 and CIC-IoT2023 datasets, respectively.
Alternatively, host-level communication graphs model IP addresses or devices as nodes, with edges representing communication events. This formulation naturally captures communication patterns and community structures. For instance, Li et al. [
13] proposed a malicious host detection system based on a relation-enhanced graph convolutional network (RE-GCN). In this system, host communication graphs are constructed through temporal slicing, and sample imbalance is alleviated via random undersampling. A relation-edge graph convolutional network is further designed, in which features are directly aggregated and learned on edges. By leveraging edge information for node classification, the limitations of traditional GNNs in handling edge attributes are effectively mitigated, thereby improving classification precision. In the context of host intrusion detection based on system provenance graphs, Furthermore, Luša et al. [
14] proposed TE-G-SAGE, in which the SHAP-based explainability method is integrated with a temporal-aware and edge-aware GNN. Built upon the GraphSAGE [
9] architecture, an interpretable inductive intrusion detection model is developed. By transforming flow data from the NF-UNSW-NB15-v3 dataset into temporal communication graphs, superior recall performance has been achieved in temporal evaluation settings.
Notably, many early GNN-based methods focus primarily on node features while neglecting the rich semantic information contained in edges. In network traffic, edges correspond to communication behaviors and encode critical attributes such as protocol types, port numbers, TCP flags, packet counts, and byte volumes. To address this limitation, Lo et al. [
15] proposed E-GraphSAGE, which integrates both node and edge features through an edge-aware aggregation mechanism, significantly improving detection accuracy for DDoS and scanning attacks in IoT datasets.
Despite these advances, most GNN-based methods rely heavily on supervised learning and require large-scale labeled datasets. Their performance heavily depends on the availability and quality of labeled data. In real-world scenarios, such assumptions are often unrealistic, limiting their scalability and adaptability. In real-world scenarios, labeling massive volumes of traffic is prohibitively expensive and often infeasible, particularly for emerging or unknown attack types. Moreover, the dynamic nature of network environments renders labeled data quickly outdated. This strong reliance on labeled data significantly limits the generalization and practical deployment of supervised GNN models, motivating a shift toward self-supervised and unsupervised approaches.
2.2. Self-Supervised Learning on Graphs
To reduce reliance on labeled data, self-supervised learning has been increasingly explored in graph representation learning. Typical approaches include contrastive learning, where models are trained to distinguish between positive and negative samples generated through graph augmentations. Methods such as Deep Graph Infomax and Graph Contrastive Learning have demonstrated strong capability in learning informative node and graph representations.
Self-supervised learning aims to exploit intrinsic supervisory signals from unlabeled data through the design of auxiliary tasks, and has achieved remarkable success in computer vision and natural language processing. In graph representation learning, graph contrastive learning has emerged as a dominant paradigm, where different augmented views of the same graph are constructed, and representations are learned by maximizing agreement between positive pairs while minimizing agreement between negative pairs. Representative methods include GraphCL [
16], GCA [
17], and GRACE [
18]. GraphCL systematically investigates four graph augmentation strategies, while GCA introduces adaptive augmentation based on structural importance, and GRACE designs node-level contrastive objectives that achieve competitive performance with supervised methods.
In the context of network intrusion detection, several self-supervised GNN frameworks have been proposed. Guerra et al. [
19] introduced GraphIDS, which encodes each network flow and its local topology into a graph and employs a Transformer-based masked autoencoder to reconstruct node embeddings, using reconstruction error as an anomaly score. This method achieves up to 99.98% PR-AUC and 99.61% macro F1-score on multiple NetFlow benchmarks without requiring labeled data. Caville et al. [
20] proposed Anomal-E, a self-supervised network intrusion detection system based on graph neural networks. Unlike existing methods that rely on node features, Anomal-E aggregates edge features through an improved E-GraphSAGE [
15] to generate edge embeddings and introduces DGI [
21] (Deep Graph Infomax) to maximize local and global mutual information, thereby effectively addressing the issue of insufficient utilization of edge information in traditional methods. By learning graph embeddings of network flows in a self-supervised manner, the method can better adapt to unknown attack types and significantly reduce the dependence on large-scale labeled data. For IoT environments, SSTD [
22] adopts a cosine-similarity-based contrastive learning strategy, significantly improving detection rates for unknown attacks. However, from the perspective of loss design, most existing methods rely on InfoNCE-based objectives, which focus on cosine similarity in feature space but fail to capture global distribution differences and structural alignment. Similarly, Anomal-EFD [
23] is a self-supervised dynamic anomaly detection model designed for IoT networks, which leverages a random sliding window and gradient aggregation mechanism to capture both short-term and long-term temporal dynamics. Furthermore, it incorporates a multi-head attention-based neighbor aggregation and a contrastive self-supervised objective to achieve robust node-level anomaly detection under dynamic network structures. In cloud–edge collaborative settings, SSGMHAN [
24] employs structure-aware graph contrastive learning to construct positive and negative pairs, learns from large-scale unlabeled traffic, and generates representations that are robust to structural perturbations. It also integrates structure-aware contrastive learning with a multi-head node–edge attention mechanism to dynamically emphasize attack-relevant nodes and edges, producing more expressive embeddings. Xu et al. [
25] designed a graph attention mechanism-based encoder for the multi-classification problem of network traffic. They construct positive sample pairs by subgraph sampling on the original nodes and generating interpolated graphs, and introduce a structured contrastive loss function that considers edge features and local topology. In the multi-classification task on NF-CSE-CIC-IDS2018-v2, their method achieves a weighted average F1-score exceeding 0.97.
Nevertheless, a critical challenge in graph contrastive learning lies in designing effective and semantically consistent augmentation strategies. Common operations such as edge removal or feature masking may distort important attack patterns in network traffic. To mitigate this, augmentation-free methods such as HEC-GAD [
26] have been proposed. This method avoids graph augmentation to prevent anomaly distortion, samples multi-view subgraphs from higher-order neighbors, and combines intra-view node-subgraph and inter-view subgraph-subgraph contrastive learning with reconstruction error for effective anomaly detection. TCL-GAD [
27] introduces global information via a hierarchical Transformer and a multi-level contrastive learning framework, achieving superior detection performance and efficiency across diverse datasets.
In addition to contrastive learning, generative self-supervised methods, such as masked graph autoencoders (e.g., GraphMAE [
28]), have also been explored. These methods reconstruct masked node or edge features to learn representations, although they often require careful tuning and may exhibit lower sensitivity to anomalies compared to contrastive approaches.
In summary, although existing self-supervised methods have demonstrated considerable potential, several key challenges remain, including how to jointly model feature distributions and topological structures, design semantically consistent contrastive objectives, and develop effective subgraph sampling strategies tailored to network traffic. Furthermore, most existing graph self-supervised approaches primarily focus on feature-level consistency, while failing to adequately capture structural similarities across graphs or subgraphs. Based on this, current research suffers from two main limitations: (1) graph neural network-based methods exhibit a strong dependence on labeled data; and (2) in self-supervised settings, the joint modeling of feature and structural information remains insufficient. To address these issues, this paper proposes the EGSCA framework, which integrates generative graph contrastive learning with hybrid structure–feature alignment into a unified framework, thereby enabling robust anomaly detection under unlabeled conditions.