Computer Engineering and Applications ›› 2025, Vol. 61 ›› Issue (18): 300-308.DOI: 10.3778/j.issn.1002-8331.2406-0009

• Network, Communication and Security • Previous Articles     Next Articles

Research on Intrusion Detection for CAN/CAN-FD Protocol Based on Transformer Encoder

CAO Juyang, WANG Sishan, SI Huachao, ZHANG Guihai, WU Qi, WANG Tao, WANG Wentao   

  1. 1.Hubei University of Automotive Technology, Shiyan, Hubei 442002, China
    2.VOYAH Automobile Technology Co., Ltd., Wuhan 430000, China
  • Online:2025-09-15 Published:2025-09-15

基于Transformer编码器的CAN/CAN-FD协议入侵检测研究

曹举阳,王思山,司华超,张贵海,吴奇,汪涛,王文涛   

  1. 1.湖北汽车工业学院,湖北 十堰 442002
    2.岚图汽车科技有限公司,武汉 430000

Abstract: The CAN/CAN-FD protocol of the automotive bus transmits information in a broadcast manner, the messages are easily intercepted and are extremely vulnerable to attacks. To address the issues of intrusion detection in intelligent connected vehicles, an improved Transformer encoder-based intrusion detection model is proposed. The accuracy, precision, recall and F1 of this model exceed 99.9% for various attacks on the public dataset CAN-FD intrusion. Compared with typical models on public dataset, the experimental results show that the improved Transformer encoder is better than the comparison model in all evaluation metrics. In order to verify the generalization of this model, a real vehicle dataset is created by injecting DoS and Fuzzing attacks into the CAN/CAN-FD bus of an intelligent connected vehicle, and the model is used to detect the dataset. The experimental results demonstrate that the model has a high detection rate and good generalizability.

Key words: CAN-FD, intrusion detection, Transformer encoder, DoS attack, Fuzzing attack

摘要: 汽车总线CAN/CAN-FD协议以广播的形式传播信息,报文容易被截取,极易受到攻击。为解决智能网联汽车CAN/CAN-FD总线的入侵攻击识别问题,提出了一种改进的Transformer编码器入侵检测模型。该模型在公开数据集CAN-FD Intrusion上进行各种攻击的入侵检测,检测率、精确率、召回率和F1均超过99.9%。通过在公开数据集上与典型模型的对比评测,实验结果表明改进的Transformer编码器模型在各项评价指标均优于对比模型。为了验证此模型的泛化性,通过在智能网联汽车实车CAN/CAN-FD总线上注入DoS和Fuzzing攻击制作实车数据集,并使用该模型对数据集进行检测,实验结果表明该模型具有较高的识别率和较好的泛化性。

关键词: CAN-FD, 入侵检测, Transformer编码器, DoS攻击, Fuzzing攻击