CANShield: Deep-Learning-Based Intrusion Detection Framework for Controller Area Networks at the Signal Level

Md Hasan Shahriar, Yang Xiao, Pablo Moriano, Wenjing Lou, Y. Thomas Hou

TL;DR

Modern vehicles are increasingly vulnerable to sophisticated cyberattacks targeting their internal communication networks (CAN buses). This paper introduces CANShield, a novel deep learning framework that detects these advanced attacks by analyzing vehicle data at the signal level, offering improved accuracy and responsiveness compared to existing methods.

What Problem Does This Paper Address?

Modern vehicles are essentially rolling computers, with numerous Electronic Control Units (ECUs) communicating critical data over Controller Area Networks (CAN buses). While CAN is robust, its widespread adoption and increasing connectivity (e.g., for Over-The-Air updates, infotainment) expose it to sophisticated cyber threats. Traditional intrusion detection systems (IDS) often struggle with advanced attacks that manipulate data at the signal or semantic level, rather than just disrupting message patterns or IDs. These "stealthy" attacks can inject false data that appears normal to simpler IDS, making it difficult to detect them. The challenge is to build an IDS that can understand the nuanced behavior of vehicle signals and identify subtle deviations indicative of malicious activity.

Methods

CANShield employs a multi-stage deep learning approach:

  • Data Preprocessing Module: This module transforms the high-dimensional, raw CAN data into a format suitable for deep learning. It parses binary payloads into real-valued signals, creating a time-series data queue. To capture different temporal patterns, it generates multiple "views" of this data queue, each representing the data at different sampling rates (short-term and long-term). This multi-view approach allows the system to analyze data at various granularities.
  • Data Analyzing Module: This module utilizes multiple Convolutional Neural Network (CNN)-based Autoencoders (AEs). Each AE is trained on one of the data views generated by the preprocessing module. AEs are well-suited for anomaly detection as they learn to reconstruct normal data with high fidelity. When presented with anomalous data, the reconstruction error (loss) will be significantly higher, signaling a potential intrusion. The use of CNNs helps in capturing spatial (signal-to-signal) correlations within the data views.
  • Attack Detection Module: This module takes the reconstruction losses from each AE and performs a three-step analysis to determine an anomaly score. This involves setting thresholds for signal-wise reconstruction loss, time-step violations, and overall signal violations. Finally, an ensemble method combines the anomaly scores from all AEs to make a final, more robust detection decision. Transfer learning is used to speed up the training of multiple AEs by initializing subsequent models with parameters from previously trained ones.

Datasets

The paper evaluates CANShield using two datasets:

  • SynCAN Dataset: A synthetic CAN bus dataset designed to emulate real-world CAN traffic and include stealthy signal-level attacks. It contains 20 signals and 24 hours of data.
  • ROAD Dataset: A realistic CAN attack dataset from Oak Ridge National Laboratory, featuring physically verified attacks. It provides 3.5 hours of data and is considered more realistic due to attacks being collected from actual vehicles.

Key Insights and Ideas

  • Signal-Level Analysis is Crucial: The paper strongly advocates for analyzing CAN data at the signal level, rather than just message IDs or binary payloads, to detect sophisticated attacks.
  • Multi-View Data Representation: Creating multiple "views" of the CAN data queue, each with different sampling periods, allows the system to capture both short-term and long-term temporal patterns effectively.
  • Ensemble of Autoencoders: Combining multiple AEs, each trained on a different data view, leads to a more robust and comprehensive detection system that can handle diverse attack types.
  • Three-Step Loss Analysis: Moving beyond simple average reconstruction loss, a structured three-step analysis of reconstruction losses provides finer granularity and improves detection accuracy, especially for stealthy attacks.
  • Transfer Learning for Efficiency: Utilizing transfer learning significantly reduces the training time for multiple AEs, making the framework more practical for resource-constrained environments.

Key Results

  • CANShield demonstrated high accuracy and responsiveness in detecting advanced intrusion attacks, including fabrication, suspension, and masquerade attacks.
  • The ensemble model (CANShield-Ens) achieved AUROC scores of up to 0.95-1.00 on the SynCAN dataset for various attacks, outperforming baseline models.
  • On the ROAD dataset, CANShield-Ens achieved near-perfect performance with AUROC scores around 1.00.
  • The proposed three-step analysis of reconstruction loss improved the overall AUROC by 6.40% compared to a simple mean average method.
  • The multi-view approach reduced variance and increased AUROC by at least 2.19% compared to single-AE frameworks.
  • CANShield is computationally lighter than comparable models like CANet, using only 525 KB of memory compared to 8718 KB.
  • Inference time was around 1ms on a laptop and 10ms on a Raspberry Pi, meeting the near real-time detection requirement.

Limitations and Future Work

  • DBC File Dependency: A key limitation is the reliance on accurate DBC files to decode CAN messages into signals. The authors assume the defender has direct access to these files or an efficient reverse-engineering tool.
  • Data Collection and Generalization: Obtaining sufficient and diverse training data that covers various driving patterns and scenarios is crucial for generalizing the AE models and ensuring effective anomaly detection across different driving contexts.
  • Hyperparameter Tuning: The performance of CANShield is sensitive to system hyperparameters (p, q, r for confidence percentiles), requiring careful tuning for optimal accuracy.
  • Future Work: The paper suggests exploring more sophisticated ensemble methods and investigating the use of CANShield in more complex vehicular architectures. Further research into robust methods for obtaining signal-level data without explicit DBC files could also be a valuable direction.

Summary updated

BibTeX
@article{shahriar2023canshield,
  author = {Md Hasan Shahriar and Yang Xiao and Pablo Moriano and Wenjing Lou and Y. Thomas Hou},
  title = {{CANShield: Deep-Learning-Based Intrusion Detection Framework for Controller Area Networks at the Signal Level}},
  journal = {IEEE Internet of Things Journal},
  year = {2023},
  doi = {10.1109/jiot.2023.3303271},
}
Figure