FlowTransformer: A transformer framework for flow-based network intrusion detection systems
Open accessThe DOI matches its Crossref record; 34 of the 34 references it cites were found in a registry or an index.
Abstract
This paper presents the FlowTransformer framework, a novel approach for implementing transformer-based Network Intrusion Detection Systems (NIDSs). FlowTransformer leverages the strengths of transformer models in identifying the long-term behaviour and characteristics of networks, which are often overlooked by most existing NIDSs. By capturing these complex patterns in network traffic, FlowTransformer offers a flexible and efficient tool for researchers and practitioners in the cybersecurity community who are seeking to implement NIDSs using transformer-based models. FlowTransformer allows the direct substitution of various transformer components, including the input encoding, transformer, classification head, and the evaluation of these across any flow-based network dataset. To demonstrate the effectiveness and efficiency of the FlowTransformer framework, we utilise it to provide an extensive evaluation of various common transformer architectures, such as GPT 2.0 and BERT, on three commonly used public NIDS benchmark datasets. We provide results for accuracy, model size and speed. A key finding of our evaluation is that the choice of classification head has the most significant impact on the model performance. Surprisingly, Global Average Pooling, which is commonly used in text classification, performs very poorly in the context of NIDS. In addition, we show that model size can be reduced by over 50%, and inference and training times improved, with no loss of accuracy, by making specific choices of input encoding and classification head instead of other commonly used alternatives.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Adam: A Method for Stochastic Optimization
Kingma, D. P., & Ba, J. (2014) · arXiv · doi:10.48550/arxiv.1412.6980 · Cited by 98,946 · cited 1×
“We used the Adam [26] optimiser for training with the parameters defined in the paper, with learning rate being specified in each experiment (as this was part of the grid search).”
MethodExploiting Generative AI to Scale up Intelligent Tutoring Systems
Jakubův, J., Chvalovský, K., Goertzel, Z., Kaliszyk, C., Olšák, M., Piotrowski, B., Schulz, S., Suda, M., & Urban, J. (2023) · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · doi:10.4230/lipics.itp.2023.19 · Cited by 76,658
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018) · arXiv · doi:10.48550/arxiv.1810.04805 · Cited by 73,173
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019) · Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) · doi:10.18653/v1/n19-1423 · Cited by 54,325
Distributed Representations of Words and Phrases and their Compositionality
Mikolov, T., Sutskever, I., Chen, K., Corrado, G., & Dean, J. (2013) · arXiv · doi:10.48550/arxiv.1310.4546 · Cited by 24,533
A detailed analysis of the KDD CUP 99 data set
Tavallaee, M., Bagheri, E., Lu, W., & Ghorbani, A. A. (2009) · 2009 IEEE Symposium on Computational Intelligence for Security and Defense Applications · doi:10.1109/cisda.2009.5356528 · Cited by 5,396
Toward Generating a New Intrusion Detection Dataset and Intrusion Traffic Characterization
Sharafaldin, I., Habibi Lashkari, A., & Ghorbani, A. A. (2018) · Proceedings of the 4th International Conference on Information Systems Security and Privacy · doi:10.5220/0006639801080116 · Cited by 5,318 · cited 1×
“3) CSE-CIC-IDS2018 [30], an NIDS dataset for traditional networks including ‘seven different attack scenarios: Brute-force, Heartbleed, Botnet, DoS, DDoS, Web attacks, and infiltration of the network from inside.”
BackgroundMoustafa, N., & Slay, J. (2015) · 2015 Military Communications and Information Systems Conference (MilCIS) · doi:10.1109/milcis.2015.7348942 · Cited by 4,033
HuggingFace's Transformers: State-of-the-art Natural Language Processing
Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., Cistac, P., Rault, T., Louf, R., Funtowicz, M., et al. (2019) · arXiv · doi:10.48550/arxiv.1910.03771 · Cited by 3,347
Parmar, N., Vaswani, A., Uszkoreit, J., Kaiser, Ł., Shazeer, N., Ku, A., & Tran, D. (2018) · arXiv · doi:10.48550/arxiv.1802.05751 · Cited by 1,085
Moustafa, N. (2021) · Sustainable Cities and Society · doi:10.1016/j.scs.2021.102994 · Cited by 721
Yun, S., Jeong, M., Kim, R., Kang, J., & Kim, H. J. (2019) · arXiv (Cornell University) · doi:10.48550/arxiv.1911.06455 · Cited by 471 · cited 1×
“Although initially designed for NLP, transformer architectures have proven to be versatile and powerful tools for capturing complex patterns and relationships in various types of sequential data, including but not limited to image, graph, and speech [2]–[4].”
MethodTowards a Standard Feature Set for Network Intrusion Detection System Datasets
Sarhan, M., Layeghy, S., & Portmann, M. (2022) · Mobile Networks and Applications · doi:10.1007/s11036-021-01843-0 · Cited by 405 · cited 1×
“The conversion process of these datasets to flow format is detailed in [27] which was proposed by the authors as a standardised format for flow-based NIDS.”
MethodSelf-citationA hybrid deep learning model for efficient intrusion detection in big data environment
Hassan, M. M., Gumaei, A., Alsanad, A., Alrubaian, M., & Fortino, G. (2020) · Information Sciences · doi:10.1016/j.ins.2019.10.069 · Cited by 401 · cited 1×
“[16] propose a NIDS (Network Intrusion Detection System) that combines Convolutional Neural Network (CNN) and Long Short-Term Memory (LSTM) architectures using deep learning techniques.”
MethodInMon Corporation's sFlow: A Method for Monitoring Traffic in Switched and Routed Networks
Phaal, P., Panchen, S., & McKee, N. (2001) · doi:10.17487/rfc3176 · Cited by 370 · cited 1×
“Although in this work we use NetFlow version of benchmark NIDS datasets, there are other flow standards, such as IPFix [8] or SFlow [9], and these flow formats are also natively supported by the FlowTransformer implementation.”
MethodRTIDS: A Robust Transformer-Based Approach for Intrusion Detection System
Wu, Z., Zhang, H., Wang, P., & Sun, Z. (2022) · IEEE Access · doi:10.1109/access.2022.3182333 · Cited by 317 · cited 1×
“Wu et al. [10] present a Transformer-based Intrusion Detection System called RTIDS, which incorporates the positional embedding technique to associate sequential information be-tween features.”
MethodA survey of dimensionality reduction techniques
Sorzano, C. Ó. S., Vargas, J., & Pascual-Montano, A. (2014) · arXiv (Cornell University) · doi:10.48550/arxiv.1403.2877 · Cited by 305 · cited 1×
“This can be seen as a very basic form of dimensionality reduction and is widely used for this purpose [23].”
BackgroundUllah, F., Ullah, S., Srivastava, G., & Lin, J. C.-W. (2024) · Digital Communications and Networks · doi:10.1016/j.dcan.2023.03.008 · Cited by 266
2014 IEEE Conference on Communications and Network Security
(2014) · doi:10.1109/cns31964.2014 · Cited by 263
ML-Decoder: Scalable and Versatile Classification Head
Ridnik, T., Sharir, G., Ben-Cohen, A., Ben-Baruch, E., & Noy, A. (2023) · IEEE Winter Conference on Applications of Computer Vision · doi:10.1109/wacv56688.2023.00012 · Cited by 220 · cited 1×
“There has been recent work proposing new classification heads such as [19], which leverage attention mechanisms to process the output of the transformer, however, many traditional approaches used a simple Global Average Pooling approach on the output of the transformer [20].”
MethodTabTransformer: Tabular Data Modeling Using Contextual Embeddings
Huang, X., Khetan, A., Cvitkovic, M. W., & Karnin, Z. S. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2012.06678 · Cited by 200 · cited 2×
“One common method, employed by previous works such as ”TabTransformer” [21], is to encode categorical fields individually by transforming them into a contextually meaningful continuous vector.”
MethodResearch Trends in Network-Based Intrusion Detection Systems: A Review
Kumar, S., Gupta, S., & Arora, S. (2021) · IEEE Access · doi:10.1109/access.2021.3129775 · Cited by 167
2011 Military Communications and Information Systems Conference
(2011) · doi:10.1109/milcis18043.2011 · Cited by 141
Intrusion Detection Method Using Bi-Directional GPT for in-Vehicle Controller Area Networks
Nam, M., Park, S., & Kim, D. S. (2021) · IEEE Access · doi:10.1109/access.2021.3110524 · Cited by 100 · cited 1×
“Nam et al. [13] present a novel method for detecting spoofing attacks in Controller Area Networks (CAN) by training a transformer-based language model (GPT) on normal CAN ID sequences.”
MethodDI-NIDS: Domain invariant network intrusion detection system
Layeghy, S., Baktashmotlagh, M., & Portmann, M. (2023) · Knowledge-Based Systems · doi:10.1016/j.knosys.2023.110626 · Cited by 99
Self-citationExplainable Cross-domain Evaluation of ML-based Network Intrusion Detection Systems
Layeghy, S., & Portmann, M. (2023) · Computers & Electrical Engineering · doi:10.1016/j.compeleceng.2023.108692 · Cited by 97
Self-citationRobust unsupervised network intrusion detection with self-supervised masked context reconstruction
Wang, W., Jian, S., Tan, Y., Wu, Q., & Huang, C. (2023) · Computers & Security · doi:10.1016/j.cose.2023.103131 · Cited by 83
Intrusion Detection Model Based on Improved Transformer
Liu, Y., & Wu, L. (2023) · Applied Sciences · doi:10.3390/app13106251 · Cited by 80
Network intrusion detection based on n-gram frequency and time-aware transformer
Han, X., Cui, S., Liu, S., Zhang, C., Jiang, B., & Lü, Z. (2023) · Computers & Security · doi:10.1016/j.cose.2023.103171 · Cited by 79 · cited 1×
“[15] present a new intrusion detection method for encrypted traffic called GTID.”
MethodSingh, G., & Khare, N. (2022) · International Journal of Computers and Applications · doi:10.1080/1206212x.2021.1885150 · Cited by 59
Intrusion detection: A model based on the improved vision transformer
Yang, Y., Fu, H., Gao, S., Zhou, Y., & Shi, W. (2022) · Transactions on Emerging Telecommunications Technologies · doi:10.1002/ett.4522 · Cited by 48
Flow-based network intrusion detection based on BERT masked language model
Nguyen, L. G., & Watabe, K. (2022) · doi:10.1145/3565477.3569152 · Cited by 22 · cited 1×
“Loc et al. [14] propose a method to improve the domain adaptation capability of Network Intrusion Detection Systems (NIDS) by employing the Bidirectional Encoder Representations from Transformers (BERT).”
MethodGroup Generalized Mean Pooling for Vision TransformerPreprint
Ko, B., Kim, H., Heo, B., Yun, S., Chun, S., Gu, G., & Kim, W. (2022) · arXiv (Cornell University) · doi:10.48550/arxiv.2212.04114 · Cited by 12 · cited 1×
“There has been recent work proposing new classification heads such as [19], which leverage attention mechanisms to process the output of the transformer, however, many traditional approaches used a simple Global Average Pooling approach on the output of the transformer [20].”
Method
Cited by
Large Language Models for Cyber Security: A Systematic Literature Review
Xu, H., Wang, S., Li, N., Wang, K., Zhao, Y., Chen, K., Yu, T., Liu, Y., & Wang, H. (2025) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3769676 · Cited by 189
“LLMs have been widely applied in network intrusion detection tasks, covering traditional web applications, IoT (Internet of Things), and in-vehicle network scenarios [11, 62, 131, 138].”
Kheddar, H. (2025) · Information Fusion · doi:10.1016/j.inffus.2025.103347 · Cited by 161
RHAD: A Reinforced Heterogeneous Anomaly Detector for Robust Industrial Control System Security
Han, X., Niu, Y., Cao, Z., Zhou, D., & Liu, B. (2025) · Electronics · doi:10.3390/electronics14122440 · Cited by 5
Metadata
- Authors
- Manocchio, L. D., Layeghy, S., Lo, W. W., Kulatilleke, G. K., Sarhan, M., & Portmann, M.
- Venue
- Expert Systems with Applications
- Publisher
- Elsevier BV
- Published
- 2024-05
- Volume
- 241
- Pages
- 122564
- ISSN
- 0957-4174 (ISSN-L)
- OpenAlex
- W4388948449
- Cited by
- 215
- References
- 34
- FWCI
- 24.14
- Type
- journal article
- Language
- en
- Open access
- hybrid
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.