Decentralized and Lightweight Transformer-Based Framework for Cybersecurity in Vehicular Networks

Ankit Mundra

Pankaj Vyas

Vivek Kumar VermaEmail

Department of Information Technology, Manipal University Jaipur, Jaipur, Rajasthan, 302022, India

Abstract

The rapid integration of connectivity and electronic control systems in modern vehicles has enhanced functionality while introducing significant cybersecurity vulnerabilities. This work presents a decentralized and lightweight Transformer-based intrusion detection system (IDS) for automotive cybersecurity, addressing these challenges with a scalable and adaptive framework. Leveraging the Car Hacking Dataset (CHD), the proposed methodology incorporates advanced feature engineering, including temporal attributes like time differences and message frequency, as well as payload entropy, to effectively capture complex vehicular communication patterns. A sequence-to-sequence (Seq2Seq) Transformer model is employed to analyze controller area network (CAN) bus data, enabling precise detection of sophisticated anomalies, including denial of service (DoS), fuzzy, and spoofing attacks. The model’s attention mechanisms and positional encoding enhance its ability to learn sequential dependencies and contextual relationships in vehicular data. Evaluation results demonstrate the framework’s high precision (96.7%), recall (95.3%), and attack detection rate (ADR, 97.5%), coupled with a low false alarm rate (FAR, 3.4%) and real-time detection capabilities with an average time to detect (ATD) of 22 milliseconds. These findings establish the proposed IDS as a reliable, efficient, and scalable solution for securing modern vehicular networks against evolving cyber threats. Future work aims to extend this framework to additional vehicular protocols and real-world deployment scenarios.