Self-Supervised Transformer-based Contrastive Learning for Intrusion Detection Systems
Not on the map. Why?
Abstract (arXiv)
As the digital landscape becomes more interconnected, the frequency and severity of zero-day attacks, have significantly increased, leading to an urgent need for innovative Intrusion Detection Systems (IDS). Machine Learning-based IDS that learn from the network traffic characteristics and can discern attack patterns from benign traffic offer an advanced solution to traditional signature-based IDS. However, they heavily rely on labeled datasets, and their ability to generalize when encountering unseen traffic patterns remains a challenge. This paper proposes a novel self-supervised contrastive learning approach based on transformer encoders, specifically tailored for generalizable intrusion detection on raw packet sequences. Our proposed learning scheme employs a packet-level data augmentation strategy combined with a transformer-based architecture to extract and generate meaningful representations of traffic flows. Unlike traditional methods reliant on handcrafted statistical features (NetFlow), our approach automatically learns comprehensive packet sequence representations, significantly enhancing performance in anomaly identification tasks and supervised learning for intrusion detection. Our transformer-based framework exhibits better performance in comparison to existing NetFlow self-supervised methods. Specifically, we achieve up to a 3% higher AUC in anomaly detection for intra-dataset evaluation and up to 20% higher AUC scores in inter-dataset evaluation. Moreover, our model provides a strong baseline for supervised intrusion detection with limited labeled data, exhibiting an improvement over self-supervised NetFlow models of up to 1.5% AUC when pretrained and evaluated on the same dataset. Additionally, we show the adaptability of our pretrained model when fine-tuned across different datasets, demonstrating strong performance even when lacking benign data from the target domain.
Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Builds on 18 of its 37 references that are in the map. First posted on arXiv 12 May 2025.
Builds on
18 of 37 references.
References · 18
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 12,049
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,884
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
- 2021SAINT: Improved Neural Networks for Tabular Data via Row Attention and Contrastive Pre-Trainingcited by 319
- 2021SCARF: Self-Supervised Contrastive Learning using Random Feature Corruptioncited by 156
- 2022ET-BERT: A Contextualized Datagram Representation with Pre-training Transformers for Encrypted Traffic Classificationcited by 66
- 2023Revolutionizing Cyber Threat Detection with Large Language Models: A privacy-preserving BERT-based Lightweight Model for IoT/IIoT Devicescited by 39
- 2023NetGPT: Generative Pretrained Transformer for Network Trafficcited by 31
- 2022Anomal-E: A Self-Supervised Network Intrusion Detection System based on Graph Neural Networkscited by 27
- 2020New Directions in Automated Traffic Analysiscited by 26
6 more
- 2023FlowTransformer: A Transformer Framework for Flow-based Network Intrusion Detection Systemscited by 24
- 2023netFound: Principled Design for Network Foundation Modelscited by 17
- 2023Real-time Network Intrusion Detection via Decision Transformerscited by 12
- 2022A new hope for network model generalizationcited by 11
- 2019Should I Raise The Red Flag? A comprehensive survey of anomaly scoring methods toward mitigating false alarmscited by 4
- 2023A Method for Network Intrusion Detection Using Flow Sequence and BERT Frameworkcited by 2
Built on by
Citing papers per year: 2026: 2.
2 papers.