FlowTransformer: A Transformer Framework for Flow-based Network Intrusion Detection Systems

Liam Daly Manocchio, Siamak Layeghy, Wai Weng Lo, Gayan K. Kulatilleke, Mohanad Sarhan +1 more
4/28/2023
cs.CRcs.AIcs.CL

No official code found. Best implementation: liamdm/FlowTransformer (105 stars, AGPL-3.0, last commit 2023-11-25).

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.

View on arXivView PDF

Code Implementations(1)

AGPL-3.0
10520Python, Jupyter NotebookApr 20, 20232 years agoAGPL-3.0

Similar Papers

Cite this paper

@article{manocchio2023flowtransformer,
  title  = {FlowTransformer: A Transformer Framework for Flow-based Network Intrusion Detection Systems},
  author = {Liam Daly Manocchio and Siamak Layeghy and Wai Weng Lo and Gayan K. Kulatilleke and Mohanad Sarhan and Marius Portmann},
  year   = {2023},
  eprint = {2304.14746},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.14746v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.14746.svg)](https://codeofpaper.com/paper/2304.14746)

Discussion