TrustMyIDS: A BERT-Based Intrusion Detection System for Network Security
Sankar Kumar Mridha, Nihar Ranjan Sahu, Ritwik Kumar Bholika · 2025
In recent years, the rapid growth of the Internet has led to a significant increase in Internet users worldwide. Therefore, the volume of network packets traded between users has continuously increased. Classifying malicious packets from network traffic in real-time remains a challenging problem due to the evolving nature of cyber threats and the increasing network complexity. Due to the growing number of cyberattacks and the vibrant nature of malware with constantly altering attacking signatures, current safety mechanisms do not provide efficient solutions to secure the network and the host levels in real time. Various machine learning models, including intrusion detection systems, have been proposed for security applications. To address the above problem, we present an efficient BERT-based deep learning model based on the Transformer architecture for intrusion detection systems (IDS). The BERT model is pre-trained on a large corpus of general data and then fine-tuned on network traffic-labeled data. The BERT model understands the contents of data packets and captures complex relationships from packet data by looking at both directions of the data sequence. Furthermore, we use the CyberAI Cup 2024 challenge dataset to estimate the performance of the proposed BERT model, which achieved higher accuracy (99.44%), precision (99.28%), recall (99.60%), and F1-score (99.44%) compared to several existing approaches.