Skip to main content
QUICK REVIEW

[Paper Review] SecureBERT and LLAMA 2 Empowered Control Area Network Intrusion Detection and Classification

Xuemei Li, Huirong Fu|arXiv (Cornell University)|Nov 19, 2023
Network Security and Intrusion DetectionComputer Science6 citations
TL;DR

This paper proposes CAN-SecureBERT and CAN-Llama2, fine-tuned transformer-based models for direct intrusion detection and attack classification in CAN networks using raw text-based CAN message logs. The CAN-Llama2 model achieves a balanced accuracy of 0.999993 and a false alarm rate of 3.1e-6—52× lower than the state-of-the-art MTH-IDS—demonstrating superior performance without feature engineering.

ABSTRACT

Numerous studies have proved their effective strength in detecting Control Area Network (CAN) attacks. In the realm of understanding the human semantic space, transformer-based models have demonstrated remarkable effectiveness. Leveraging pre-trained transformers has become a common strategy in various language-related tasks, enabling these models to grasp human semantics more comprehensively. To delve into the adaptability evaluation on pre-trained models for CAN intrusion detection, we have developed two distinct models: CAN-SecureBERT and CAN-LLAMA2. Notably, our CAN-LLAMA2 model surpasses the state-of-the-art models by achieving an exceptional performance 0.999993 in terms of balanced accuracy, precision detection rate, F1 score, and a remarkably low false alarm rate of 3.10e-6. Impressively, the false alarm rate is 52 times smaller than that of the leading model, MTH-IDS (Multitiered Hybrid Intrusion Detection System). Our study underscores the promise of employing a Large Language Model as the foundational model, while incorporating adapters for other cybersecurity-related tasks and maintaining the model's inherent language-related capabilities.

Motivation & Objective

  • Address the limitations of existing CAN intrusion detection systems that require extensive preprocessing, rule-based workflows, and feature engineering.
  • Evaluate the adaptability of pre-trained transformer models—especially large language models—for CAN network intrusion detection and attack classification.
  • Develop models that can directly process raw CAN message logs while maintaining high detection accuracy and low false alarm rates.
  • Assess the impact of pre-training domain knowledge (e.g., cybersecurity-focused data) and model scale (e.g., Llama2 vs. BERT) on IDS performance.
  • Demonstrate that large, pre-trained LLMs fine-tuned with parameter-efficient methods (e.g., LoRA) can surpass traditional ML-based IDS systems in both accuracy and robustness.

Proposed method

  • Fine-tune pre-trained transformer models—CAN-C-BERT, CAN-SecureBERT, and CAN-Llama2—on a pre-balanced dataset of raw CAN message logs.
  • Utilize LoRA (Low-Rank Adaptation) to fine-tune only 40 million parameters of the large Llama2 model, while freezing the remaining 54× larger parameter base.
  • Process raw, text-based CAN messages directly without manual feature extraction or preprocessing, leveraging the models’ attention mechanisms to learn intrinsic patterns.
  • Apply multi-head self-attention and position encoding to model long-range dependencies and semantic relationships in CAN message sequences.
  • Train models end-to-end on a balanced dataset of four attack types: DoS, Fuzzy, Gear Spoofing, and RPM Spoofing.
  • Evaluate performance using standard metrics: balanced accuracy (BA), precision (PREC), detection rate (DR), F1 score, and false alarm rate (FAR).

Experimental results

Research questions

  • RQ1Can pre-trained large language models like Llama2 be effectively fine-tuned for direct CAN intrusion detection using raw message logs without feature engineering?
  • RQ2How does the scale and pre-training domain of a transformer model (e.g., Llama2 vs. BERT vs. SecureBERT) affect its performance in CAN IDS tasks?
  • RQ3To what extent does parameter-efficient fine-tuning (e.g., LoRA) enable high-performance inference in resource-constrained vehicular environments?
  • RQ4How does model performance vary with training data size, and does a larger model converge faster and generalize better on limited data?
  • RQ5Can LLM-based models achieve significantly lower false alarm rates than state-of-the-art systems like MTH-IDS while maintaining near-perfect detection accuracy?

Key findings

  • CAN-Llama2 achieves a balanced accuracy of 0.999993, precision of 1.0, detection rate of 1.0, and F1 score of 1.0, with a false alarm rate of 3.1e-6.
  • The false alarm rate of CAN-Llama2 (3.1e-6) is 52 times lower than that of the state-of-the-art MTH-IDS model.
  • CAN-Llama2 converges faster than other models when trained on only 1% of the data, indicating superior inductive bias and pattern recognition from large-scale pre-training.
  • Despite having fewer fine-tuned parameters, CAN-Llama2 outperforms CAN-SecureBERT and CAN-C-BERT due to its larger pre-trained parameter base and domain-optimized architecture.
  • Models trained on 10% of the data consistently outperform those trained on 1% of the data, indicating better generalization with increased data scale.
  • CAN-SecureBERT, pre-trained on cybersecurity-focused data, achieves slightly lower performance than CAN-Llama2 but still outperforms CAN-C-BERT, suggesting domain-specific pre-training enhances IDS performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.