Pith. sign in

REVIEW 4 major objections 5 minor 22 references

Few Edges Are Enough: Few-Shot Network Attack Detection with Graph Neural Networks

T0 review · 4 major / 5 minor · reviewed 2026-08-10 · deepseek-v4-flash

Pith's one-line read A graph neural network can detect network attacks using just one labeled malicious edge per attack family, matching or beating fully supervised detectors on two benchmark datasets.

desk verdict Plausible few-shot loss design, but the one-edge-per-family claim is not yet supported because support-set sampling is under-specified and no variance is reported. read the letter →

arxiv 2501.16964 v1 pith:VLVB5MQF submitted 2025-01-28 cs.LG cs.CR

classification cs.LGcs.CR
keywords few-shotlearninggraphneuralnetworksnetworkattackdetectionself-supervisedcontrastivereconstructionlossintrusionedgeclassification
verification ladder T0 review T1 audit T2 compute T3 formal

The pith

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The reading

FEAE is a graph-neural-network detector that combines self-supervised learning with few-shot learning so that a handful of labeled attack events—as few as one per attack family—suffices for competitive attack detection. The paper shows that on the NF-CSE-CIC-IDS2018-v2 dataset, one labeled malicious edge per family gives a macro F1 of 96.40%, and adding a particular graph augmentation reaches 97.44%, above the fully supervised E-GraphSAGE baseline; on NF-UNSW-NB15-v2, the same one-example setting reaches 92.64%, above the Anomal-E self-supervised baseline. The key insight is that the labeling burden in network intrusion detection can be cut from thousands of labeled flows to a half-dozen or so, provided the data is highly imbalanced so that unlabeled edges are mostly benign. If this holds, real-world deployments can skip the costly step of building clean benign-only training sets and instead rely on a small set of confirmed attacks.

What carries the argument

The central mechanism is the hybrid self-supervised objective $L_{\mathrm{FEAE}} = L_{\mathrm{DGI}} + \alpha L_{\mathrm{few}} - \beta \overline{L}_{\mathrm{few}}$, where $L_{\mathrm{few}} = \sum_{uv \in E_{\mathrm{mal}}} (X_{uv} - \hat{X}_{uv})^2$ is the reconstruction loss over the few-shot malicious edges (maximized) and $\overline{L}_{\mathrm{few}} = \sum_{uv \in E \setminus E_{\mathrm{mal}}} (X_{uv} - \hat{X}_{uv})^2$ is the reconstruction loss over the remaining edges (minimized). The sign pattern makes the encoder push known attacks away from the benign manifold while preserving the structure of the rest of the graph. This is paired with a one-layer GNN encoder that sums neighboring edge features to form node embeddings (chosen because sum aggregation is injective, per the GIN analysis) and then concatenates node embeddings to form edge embeddings. The discriminator and readout of Deep Graph Infomax provide the contrastive term $L_{\mathrm{DGI}}$, which teaches the encoder to distinguish the original graph from a corrupted graph. The few-shot decoder is a 2-layer MLP trained separately with BCE on the few-shot labels.

What would settle it

Train FEAE with k=1 on a deliberately class-balanced version of NF-CSE-CIC-IDS2018-v2 (e.g., 50% attack edges) and measure the macro F1; the mechanism predicts that the malicious cluster merges into the benign region, so F1 should fall far below the reported 96–97%, demonstrating the imbalance dependence.

Watch

Extended reading notes

Core claim

The central claim is that the few-shot-aware reconstruction loss, combined with a contrastive DGI loss, trains the GNN encoder to place malicious edges into a compact cluster in embedding space while keeping benign edges reconstructable. Concretely, FEAE maximizes the reconstruction error (MSE) on the $k m$ labeled malicious edges $E_{\mathrm{mal}}$ and minimizes it on all remaining edges $E \setminus E_{\mathrm{mal}}$; because the datasets are imbalanced (12% and 4% attacks), almost all of those remaining edges are benign. This separation lets a shallow two-layer MLP decoder, trained on just the few-shot labels, classify edges accurately. The paper demonstrates that $k=1$ already reaches 96.40% macro F1 on NF-CSE-CIC-IDS2018-v2 and 92.64% on NF-UNSW-NB15-v2, that FEAE+aug1 (97.44%) surpasses the supervised E-GraphSAGE (96.02%) on the former, and that attack edges visibly cluster in the learned embedding space, unlike in Anomal-E.

Load-bearing premise

The approach only separates attacks from benign traffic because the dataset is so imbalanced that almost all unlabeled non-few-shot edges are benign; if the data were balanced or contained many hidden attacks, the reconstruction-loss minimization would pull malicious edges toward the benign cluster and the separation would disappear.

Editorial extensions

If this is right

  • A security team needs to label only 6 malicious flows (one per family) on NF-CSE-CIC-IDS2018-v2 and 9 on NF-UNSW-NB15-v2 to reach near-supervised detection, removing the need for a clean benign-only training set.
  • Because the few-shot-aware loss is a standalone term, it can be combined with any edge-embedding GNN encoder, not just the one-layer encoder used here.
  • The clustering of attack edges in the learned embedding space lets an analyst harvest predicted malicious edges to reconstruct the topology of an attack campaign.
  • Training time stays well below Anomal-E's Isolation-Forest-based pipeline, since the few-shot decoder is a lightweight MLP and early stopping kicks in sooner.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • The reported gains likely depend heavily on the 4–12% attack share in the two datasets; a natural testable prediction is that macro F1 degrades as the attack proportion grows toward balance, even with the same k=1 regimen.
  • The same few-shot-aware reconstruction trick should transfer to other graph domains with rare labeled positives, such as financial fraud or fake-review networks, because those share the same imbalance structure.
  • The paper does not test generalization to unseen attack families; holding out a family entirely would reveal whether the embedding cluster is attack-generic or family-specific, and could guide synthetic-data augmentation.
Share X Bluesky LinkedIn Reddit HN

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, and a circularity audit.

Referee Report

4 major / 5 minor

Summary. The paper proposes FEAE, a GNN-based architecture for network attack detection that combines DGI-style contrastive self-supervised learning with a reconstruction-based loss using a small number of labeled malicious edges (k per attack family) plus randomly selected pseudo-benign edges. The encoder is trained end-to-end with a hybrid SSL objective, and a separate MLP decoder is trained on the few-shot edge embeddings. Experiments on NF-CSE-CIC-IDS2018-v2 and NF-UNSW-NB15-v2 report macro F1 scores around 97.4% and 92.6% with k=1, respectively, which the paper interprets as evidence that one malicious edge per attack family suffices to match or surpass supervised and benign-supervised baselines.

Significance. If the central claim holds, the contribution is practically significant: it would substantially reduce the labeling burden for GNN-based network intrusion detection and offers a simple, reproducible recipe (a DGI-based encoder plus a few-shot reconstruction term and a lightweight decoder). The paper is honest about some limitations, notably the imbalance condition in Section 3.5 and the dependence on some malicious history data in Section 5.1. It also compares against a reasonable set of supervised, benign-supervised, and few-shot baselines on two standard NetFlow datasets. However, the experimental evidence as reported is not yet sufficient to establish the headline claim: the table promises mean±standard-deviation values that are never shown, the provenance of the few-shot support set is ambiguous, and the key F1 differences are small enough to be explained by run-to-run variation or by accidental test-set leakage.

major comments (4)
  1. [§4.4, Table 2] The caption of Table 2 states that performance is measured over 5 iterations with the notation 'mean ± standard deviation', yet no standard deviation or repetition count appears in any row; every reported F1 is a single number. The differences that support the headline claims are small (FEAE+aug1 97.44 vs. E-GraphSAGE 96.02 on NF-CSE-CIC-IDS2018-v2; FEAE 92.64 vs. 95.35 on NF-UNSW-NB15-v2), so without variance estimates the claims 'surpasses' and 'competitive' are not established. Please report mean ± std over repeated runs with different random seeds and support-set draws, and add a paired significance test for the key comparisons.
  2. [§3.6 and §4.1] The provenance of the few-shot support set is not specified. Section 4.1 splits the 10% sample into 70% train and 30% test, but Section 3.6 says the benign few-shot edges are 'randomly selected from the dataset' without restricting them to the training split, and the procedure for selecting the k malicious edges per family is never described. If Emal or the random support edges include test-set edges, the decoder loss in Eq. (15) is trained on test edges and then evaluated on those same edges, which would inflate the few-shot F1 numbers. Please state explicitly that all few-shot edges are drawn only from the training split, and give the exact selection mechanism (random seed, stratification by family, and whether the split is fixed across runs).
  3. [§3.5, Eq. (13)] The hybrid objective minimizes LFEAE = LDGI + α Lfew − β Lfew, which requires maximizing the MSE term Lfew over the malicious few-shot edges. This maximization is not otherwise constrained apart from the sigmoid reconstruction in Eq. (10), and no analysis is given for why this produces a distinct malicious cluster in embedding space, as claimed in §3.5 and Fig. 3. At minimum, provide a sensitivity analysis for α and β (fixed at 0.2 and 0.8 in §4.1), an ablation that removes the few-shot reconstruction term (k = 0 or α = β = 0), and a discussion of the stability and regularization of the maximization term.
  4. [§3.6, §4.2] The paper's own imbalance condition is load-bearing: Section 3.5 states that the non-few-shot set E \ Emal is 'overwhelmingly benign,' and this is what justifies treating random edges as benign. On NF-CSE-CIC-IDS2018-v2, 12% of flows are attacks, so a random 5% support set drawn as in Section 3.6 will contain roughly 12% actual attack edges that are labeled benign in Eq. (15) and used to train the decoder. Please quantify this label noise for both datasets and show that the k = 1 results are not an artifact of random support-set composition. Also qualify the abstract's 'surpasses some supervised approaches' claim, since on NF-UNSW-NB15-v2 FEAE (92.64) remains below all supervised baselines (e.g., E-GraphSAGE 95.35).
minor comments (5)
  1. [Table 1 and Eqs. (11)–(15)] The same symbol E is used for 'Training edges' and 'Few-shot edges' in the notation table, which makes equations such as Eq. (12) and Eq. (15) difficult to read; please use distinct symbols for the training-edge set, the few-shot set, and the non-few-shot set.
  2. [Eq. (9)] The expectation notation E_G and E_~G is not defined; please clarify what distribution the expectation is taken over and how it is estimated in practice.
  3. [§4.1] Please state explicitly how the 43 standardized NetFlow features were scaled or encoded before being used as edge features, and whether categorical features were included or dropped.
  4. [Fig. 2] The x-axis extends to k = 9 for both datasets, but NF-CSE-CIC-IDS2018-v2 has only 6 attack families; please clarify the range of k that was actually evaluated and how k is defined when it exceeds the number of families.
  5. [§3.6] The phrase 'while attempting to maintain the same class distribution' followed immediately by 'information on labels and their distribution is considered unavailable' is contradictory; please rephrase to describe what is actually done.

Circularity Check

0 steps flagged · score 0.0 of 10

No circularity found; FEAE's results are empirical benchmarks against held-out test edges, not reductions to their training inputs.

full rationale

The contribution is empirical rather than definitional. FEAE's encoder is trained with Eq. 13, a weighted combination of a DGI contrastive loss and two reconstruction losses, and the few-shot decoder is trained with Eq. 15 on the selected few-shot embeddings. Test F1 is measured on the hold-out portion of the 10% sample described in Section 4.1, where 70% is used for training and 30% for testing. The reported gains over E-GraphSAGE and Anomal-E are benchmark outcomes, not algebraic consequences of the loss definitions. I could not exhibit a step where a fitted parameter is renamed as a prediction or where an output quantity is identical to an input by construction. The self-citations—[1] for augmentation options and [2] for a survey—supply design choices and background, but no load-bearing theorem from the same authors is invoked to forbid alternatives. The imbalance assumption in Section 3.5 is a stated boundary condition, not a circular derivation. The main validity threats are experimental and reproducibility-related: Table 2's caption promises 'mean ± standard deviation' but no standard deviations are shown, and Section 3.6 does not explicitly state that the few-shot edges are drawn only from the training split, so a leakage risk cannot be ruled out. However, the text does not define the support selection in a way that makes the test labels equal to the training labels, and there is no exhibited equation-level reduction. Accordingly, no circularity steps are listed.

Assumptions & free parameters 4 free parameters · 5 assumptions · 0 invented entities

No new physical or conceptual entities are introduced; the few-shot aware reconstruction loss is a loss function, not an entity. The free parameters are hyperparameters of the loss and architecture, chosen without sensitivity analysis.

free parameters (4)
  • alpha = 0.2
    Trade-off coefficient scaling the maximization of reconstruction loss on malicious few-shot edges (Eq. 13). Set manually without reported sensitivity analysis.
  • beta = 0.8
    Trade-off coefficient scaling the minimization of reconstruction loss on non-few-shot edges (Eq. 13). Set manually; paper recommends alpha < beta.
  • benign_ratio = 0.05
    Fraction of edges randomly selected as benign few-shot examples for decoder training (Section 3.6).
  • hidden_size = 128
    Hidden dimension of encoder and SSL module (Section 4.1).
assumptions (5)
  • standard math Sum aggregation is injective on multisets (GIN Lemma 5)
    Invoked in Section 3.4 to justify preserving structure, cited to Xu et al.
  • domain assumption Network flows can be represented as edges between host IP nodes with flow features
    The entire graph construction in Section 3.1 assumes this encoding is lossless enough for detection.
  • domain assumption The dataset is highly imbalanced, so non-few-shot edges are predominantly benign
    Stated in Section 3.5 as required for the reconstruction loss to separate attacks.
  • domain assumption Randomly selected edges for the decoder's benign set are actually benign
    Section 3.6 assumes random selection yields a clean benign class, relying on imbalance.
  • domain assumption DGI contrastive objective provides a useful prior for edge embeddings
    The method builds on Anomal-E's DGI training; the paper accepts this as a proven component.

how reviews work

0 comments
Cite this review

Pith. "Pith review of Few Edges Are Enough: Few-Shot Network Attack Detection with Graph Neural Networks." pith.science (2026). https://pith.science/paper/VLVB5MQF

@misc{pith2026250116964,
  author       = {Pith},
  title        = {Pith review of: Few Edges Are Enough: Few-Shot Network Attack Detection with Graph Neural Networks},
  year         = {2026},
  howpublished = {\url{https://pith.science/paper/VLVB5MQF}},
  note         = {Machine review of arXiv:2501.16964}
}
read the original abstract

Detecting cyberattacks using Graph Neural Networks (GNNs) has seen promising results recently. Most of the state-of-the-art models that leverage these techniques require labeled examples, hard to obtain in many real-world scenarios. To address this issue, unsupervised learning and Self-Supervised Learning (SSL) have emerged as interesting approaches to reduce the dependency on labeled data. Nonetheless, these methods tend to yield more anomalous detection algorithms rather than effective attack detection systems. This paper introduces Few Edges Are Enough (FEAE), a GNN-based architecture trained with SSL and Few-Shot Learning (FSL) to better distinguish between false positive anomalies and actual attacks. To maximize the potential of few-shot examples, our model employs a hybrid self-supervised objective that combines the advantages of contrastive-based and reconstruction-based SSL. By leveraging only a minimal number of labeled attack events, represented as attack edges, FEAE achieves competitive performance on two well-known network datasets compared to both supervised and unsupervised methods. Remarkably, our experimental results unveil that employing only 1 malicious event for each attack type in the dataset is sufficient to achieve substantial improvements. FEAE not only outperforms self-supervised GNN baselines but also surpasses some supervised approaches on one of the datasets.

Figures

Figures reproduced from arXiv: 2501.16964 by the authors.

Figure 1
Figure 1. Illustration of the few-shot aware reconstruction- [PITH_FULL_IMAGE:figures/full_fig_p009_1.png] view at source ↗
Figure 2
Figure 2. FEAE performance with respect to k. Setting k = 0 indicates that only benign edges are used for training, without any labeled malicious edge. For the NF-UNSW-NB15-v2 dataset, a 92.60% F1-score is reached starting from k = 1, and the performance remains nearly linear for k > 1. In the two outlined scenarios, employing merely one or two malicious samples within this model’s framework suffices to reach performance leve… view at source ↗
Figure 3
Figure 3. Left: Some edge embeddings produced by Anomal-E. Note that the few￾shot edges are just for comparison as they are not leveraged in the original Anomal-E. Right: Edge embeddings generated by FEAE. cessfully clusters benign and malicious edges, which facilitates the classification by the downstream decoder. On the NF-UNSW-NB15-v2 dataset, the observed performance exceeds that of Anomal-E yet does not reach the results… view at source ↗

Discussion (0). Continue with ORCID to comment.

Reference graph

Works this paper leans on

22 extracted references · 18 canonical work pages

  1. [1]

    In: 2023 7th Cyber Security in Networking C onference (CSNet)

    Bilot, T., El Madhoun, N., Al Agha, K., Zouaoui, A.: A bench mark of graph augmentations for contrastive learning-based network att ack detection with graph neural networks. In: 2023 7th Cyber Security in Networking C onference (CSNet). pp. 53–56. IEEE (2023)

  2. [2]

    IEEE Access (2023)

    Bilot, T., El Madhoun, N., Al Agha, K., Zouaoui, A.: Graph n eural networks for intrusion detection: A survey. IEEE Access (2023)

  3. [3]

    Knowledge- Based Systems 258, 110030 (2022)

    Caville, E., Lo, W.W., Layeghy, S., Portmann, M.: Anomal- e: A self-supervised network intrusion detection system based on graph neural ne tworks. Knowledge- Based Systems 258, 110030 (2022)

  4. [4]

    arXiv preprint arXiv:2111.13597 (2021)

    Chang, L., Branco, P.: Graph-based solutions with residu als for intrusion de- tection: The modified e-graphsage and e-resgat algorithms. arXiv preprint arXiv:2111.13597 (2021)

  5. [5]

    Neurocomp uting 474, 37–47 (2022)

    Fang, Y., Wang, C., Fang, Z., Huang, C.: Lmtracker: Latera l movement path de- tection based on heterogeneous graph embedding. Neurocomp uting 474, 37–47 (2022)

  6. [6]

    In: International conferen ce on machine learning

    Gilmer, J., Schoenholz, S.S., Riley, P.F., Vinyals, O., D ahl, G.E.: Neural message passing for quantum chemistry. In: International conferen ce on machine learning. pp. 1263–1272. PMLR (2017)

  7. [7]

    Advances in neural information processing systems 30 (2017)

    Hamilton, W., Ying, Z., Leskovec, J.: Inductive represen tation learning on large graphs. Advances in neural information processing systems 30 (2017)

  8. [8]

    ACM Transactions on Privacy and S ecurity (2023)

    King, I.J., Huang, H.H.: Euler: Detecting network latera l movement via scalable temporal link prediction. ACM Transactions on Privacy and S ecurity (2023)

Show all 22 references
  1. [9]

    Security and Communication Networks 2022 (2022) 18 Tristan Bilot, Nour El Madhoun, Khaldoun Al Agha, and Anis Zouaoui

    Lan, J., Lu, J.Z., Wan, G.G., Wang, Y.Y., Huang, C.Y., Zhan g, S.B., Huang, Y.Y., Ma, J.N.: E-minbatch graphsage: An industrial internet att ack detection model. Security and Communication Networks 2022 (2022) 18 Tristan Bilot, Nour El Madhoun, Khaldoun Al Agha, and Anis Zouaoui

  2. [10]

    IEEE Transactions on Dependable and Secure Computing (2022)

    Liu, C., Li, B., Zhao, J., Zhen, Z., Liu, X., Zhang, Q.: Few m-hgcl: Few-shot malware variants detection via heterogeneous graph contrastive learning. IEEE Transactions on Dependable and Secure Computing (2022)

  3. [11]

    In: 2008 eighth ieee international conference on data mining

    Liu, F.T., Ting, K.M., Zhou, Z.H.: Isolation forest. In: 2008 eighth ieee international conference on data mining. pp. 413–422. IEEE (2008)

  4. [12]

    IEEE Transactions on Knowle dge and Data Engi- neering 35(6), 5879–5900 (2022)

    Liu, Y., Jin, M., Pan, S., Zhou, C., Zheng, Y., Xia, F., Phi lip, S.Y.: Graph self- supervised learning: A survey. IEEE Transactions on Knowle dge and Data Engi- neering 35(6), 5879–5900 (2022)

  5. [13]

    Internet of Things 22, 100747 (2023)

    Lo, W.W., Kulatilleke, G., Sarhan, M., Layeghy, S., Port mann, M.: Xg-bot: An explainable deep graph neural network for botnet detection and forensics. Internet of Things 22, 100747 (2023)

  6. [14]

    In: NOMS 2022- 2022 IEEE/IFIP Network Operations and Management Symposiu m

    Lo, W.W., Layeghy, S., Sarhan, M., Gallagher, M., Portma nn, M.: E-graphsage: A graph neural network based intrusion detection system for iot. In: NOMS 2022- 2022 IEEE/IFIP Network Operations and Management Symposiu m. pp. 1–9. IEEE (2022)

  7. [15]

    In: 2015 mi litary communications and information systems conference (MilCIS)

    Moustafa, N., Slay, J.: Unsw-nb15: a comprehensive data set for network intrusion detection systems (unsw-nb15 network data set). In: 2015 mi litary communications and information systems conference (MilCIS). pp. 1–6. IEEE (2015)

  8. [16]

    In: NOMS 2022-2022 IEEE /IFIP Network Operations and Management Symposium

    Paudel, R., Huang, H.H.: Pikachu: Temporal walk based dy namic graph embed- ding for network anomaly detection. In: NOMS 2022-2022 IEEE /IFIP Network Operations and Management Symposium. pp. 1–7. IEEE (2022)

  9. [17]

    ACM SIGMETRICS Performance Evaluation Review 49(4), 111–117 (2022)

    Pujol-Perich, D., Suárez-Varela, J., Cabellos-Aparic io, A., Barlet-Ros, P.: Unveil- ing the potential of graph neural networks for robust intrus ion detection. ACM SIGMETRICS Performance Evaluation Review 49(4), 111–117 (2022)

  10. [18]

    Mobile networks and a pplications pp

    Sarhan, M., Layeghy, S., Portmann, M.: Towards a standar d feature set for network intrusion detection system datasets. Mobile networks and a pplications pp. 1–14 (2022)

  11. [19]

    I CISSp 1, 108–116 (2018)

    Sharafaldin, I., Lashkari, A.H., Ghorbani, A.A.: Towar d generating a new intrusion detection dataset and intrusion traffic characterization. I CISSp 1, 108–116 (2018)

  12. [20]

    arXiv preprint arXiv:1710.10903 (201 7)

    Veličković, P., Cucurull, G., Casanova, A., Romero, A., Lio, P., Bengio, Y.: Graph attention networks. arXiv preprint arXiv:1710.10903 (201 7)

  13. [21]

    arXiv preprint arXiv:1809.10341 (2018)

    Veličković, P., Fedus, W., Hamilton, W.L., Liò, P., Beng io, Y., Hjelm, R.D.: Deep graph infomax. arXiv preprint arXiv:1809.10341 (2018)

  14. [22]

    Xu, K., Hu, W., Leskovec, J., Jegelka, S.: How powerful ar e graph neural networks? arXiv preprint arXiv:1810.00826 (2018)

Pith tools

Reviewed August 10, 2026 · model on record in the stance chip above.