Manuscript Offprint
arXiv:2611.07853CANMentor: A Large-Small Model Collaboration Framework for CAN Bus Intrusion Detection
Zhiquan Liu, Haolin Gao, Bo Wu, Jingjing Guo, Heng Sun, Jianfeng Ma
Abstract—The Controller Area Network (CAN) bus lacks built-in security mechanisms, making real-time intrusion detection necessary. However, resource and latency constraints limit vehicle-side intrusion detection systems (IDSs) to lightweight models, whose detection performance and generalization can degrade under non-independent and identically distributed (non-IID) data. Meanwhile, uploading original CAN messages to the cloud for more powerful model inference risks exposing sensitive vehicle information. We propose CANMentor, a large-small model collaboration framework in which a cloud-side large language model (LLM) teacher supervises vehicle-side lightweight IDS models for CAN bus intrusion detection. Each vehicle first performs local inference, and a privacy-aware generator then produces proxies from the original CAN messages for cloud-side teacher inference to protect data privacy. The vehicle uses the teacher prediction only when the response arrives within a prescribed latency bound and otherwise retains the local prediction; all returned teacher logits are converted into soft targets for periodic knowledge distillation. On non-IID partitions of the ROAD dataset and the HCRL Car-Hacking dataset, knowledge distillation yields maximum relative Macro F1 improvements of 25.01% and 20.79%, respectively. Teacher predictions also improve detection accuracy for CAN messages near the local decision boundary by 38.71–42.00 percentage points.
Index Terms—Controller Area Network (CAN), intrusion detection systems (IDSs), non-IID, knowledge distillation, vehicular cybersecurity.
I. INTRODUCTION
MODERN vehicles rely on electronic control units (ECUs) connected by in-vehicle networks (IVNs) to perform safety-critical functions. The Controller Area Network (CAN) bus remains widely used in the Internet of Vehicles (IoV) because of its low cost, reliability, and real-time performance [1]. CAN does not authenticate the sender of a message. A malicious node can therefore inject forged CAN messages that receiving ECUs may act on, or flood the bus and disrupt the transmission of legitimate CAN messages [2]–[4]. Detecting these intrusions on the vehicle is important because the affected functions must respond in real time.
Prior research has improved what vehicle-side intrusion detection systems (IDSs) can recognize. Learned detectors
capture patterns across CAN messages [5]–[8], while message, signal, voltage, and time-frequency features provide complementary evidence of an intrusion [9]–[14]. Federated training, transfer learning, and cloud–vehicle collaboration draw on knowledge beyond a single vehicle [15]–[19]. Language models have also been adapted to detect anomalies and classify attacks in CAN sequences [20]–[22].
The difficulty arises when a vehicle encounters an attack that was rare in its own training data. Attack exposure differs across vehicles, so a lightweight IDS trained on data that are not independent and identically distributed (non-IID) can develop detection blind spots for underrepresented attack classes. A more capable cloud model could help with such decisions, but sending the original CAN messages would expose vehicle data, and waiting for a cloud response could delay the decision. The challenge is to obtain useful supervision for the current input while keeping the original CAN messages local, and to use that supervision to improve subsequent decisions on the vehicle.
We propose CANMentor, a large-small model collaboration framework for CAN bus intrusion detection, in which a cloud-side large language model (LLM) serves as a teacher for lightweight vehicle-side IDS models (Fig. 1). Each vehicle first makes a local prediction. For selected inputs, it generates a proxy sample that preserves information useful for classification and sends the proxy, not the original CAN messages, to the teacher. The vehicle uses the teacher prediction if the response arrives within the prescribed latency bound; otherwise, it retains the local prediction. All returned teacher logits are converted into soft targets for periodic knowledge distillation of the vehicle-side IDS model.
The main contributions of this paper are summarized as follows.
-
We propose CANMentor, a large-small model collaboration framework for CAN bus intrusion detection that combines immediate vehicle-side inference with cloud-side teacher predictions and periodic knowledge distillation from teacher soft targets.
-
We design a privacy-aware proxy generation mechanism that supports effective knowledge distillation and accurate cloud-side detection while reducing the risk of data leakage. The maximum reconstruction advantage over the no-proxy prior is 4.22% on ROAD at d = 0.40 and 5.47% on HCRL Car-Hacking at d = 0.35.
-
We evaluate CANMentor with three cloud-side LLM teachers on non-IID partitions of the ROAD dataset and the HCRL Car-Hacking dataset. Knowledge distillation yields maximum relative Macro F1 improvements of 25.01% and 20.79% on the two datasets, respectively.
This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.
This work was supported in part by the National Natural Science Foundation of China under Grant 62272195.
Zhiquan Liu, Haolin Gao, and Bo Wu are with the College of Cyber Security, Jinan University, Guangzhou 510632, China (e-mail: zqliu@vip.qq.com; esiokg123gao@gmail.com; rdgalaxy520@gmail.com).
Jingjing Guo and Jianfeng Ma are with the School of Cyber Engineering, Xidian University, Xi'an 710071, China (e-mail: jjguo@xidian.edu.cn; jfma@mail.xidian.edu.cn).
Heng Sun is with the College of Information Science and Technology, Jinan University, Guangzhou 510632, China (e-mail: tsunheng@jnu.edu.cn).

Fig. 1. Overall framework of CANMentor. The numbered flows denote: 1) upload of proxy samples generated from selected CAN messages; 2) return of teacher logits and result selection; and 3) vehicle-side knowledge distillation and lightweight IDS model update. The local prediction is retained when the teacher response time exceeds the latency bound, while all returned logits are used for distillation.
Teacher predictions on proxy samples corresponding to low-confidence inputs outperform the local predictions by 38.71–42.00 percentage points.
A. Vehicle-Side CAN Bus Intrusion Detection
Vehicle-side IDSs can identify an intrusion from the sender's physical characteristics or from changes in traffic behavior. Viden uses transmitter voltages to identify attacker ECUs [2]. Taylor et al. and Song et al. examine message frequencies and inter-arrival times, respectively [4], [23].
Learned detectors use CAN traffic itself to identify attack patterns, including through deep convolutional networks and frame-aware features [3], [5], [9], [24]. Reviews discuss automotive IDS design and explainability in connected vehicles [25], [26]. Other work addresses deployment through lightweight detection, hardware acceleration, or support for both CAN and CAN with flexible data rate (CAN-FD) [6]–[8]. Efficient local inference addresses the cost of executing the detector. A separate problem is how that detector learns to recognize attacks scarcely represented in its local training set.
B. Collaborative IDS Under Non-IID Data
Collaborative IDS methods leverage knowledge across vehicles or cloud-side components to mitigate the limitations of isolated local training under non-IID data. Abdel-Basset et al. applied federated intrusion detection to smart transportation systems [16], while Zhang et al. developed a federated two-stage Transformer for non-IID CAN bus intrusion detection [15]. CVMIDS maps CAN messages from different vehicles into a shared multidimensional feature space
for cloud-side model training [19]. FedGAN-ID combines federated learning with differentially private synthetic attack data generated by a generative adversarial network (GAN) to address the scarcity of attack samples and mitigate the effects of non-IID data across vehicles [17]. These studies primarily improve collaborative training through federated optimization, shared representations, or privacy-preserving data augmentation. Taken together, existing studies mainly focus on either privacy-preserving collaborative training or cloud-assisted detection. At their intersection, CANMentor introduces a privacy-preserving collaboration mechanism that uses proxy samples within a cloud–vehicle teacher–student framework for online detection and continued vehicle-side model improvement under latency constraints.
C. Language-Model-Based CAN Bus Intrusion Detection
Transformer-based language models capture long-range dependencies in CAN sequences through self-attention [27], while low-rank adaptation (LoRA) reduces the cost of downstream adaptation [28]. Nwafor and Olufowobi proposed CANBERT for supervised intrusion classification using CAN message fields, whereas Alkhatib et al. proposed CAN-BERT for self-supervised anomaly detection over CAN identifier sequences [20], [21].
Subsequent systems include CANLP, which combines natural language processing with embedded machine learning [29]; IoV-BERT-IDS, a hybrid LLM-based IDS for IoV environments [30]; and CAN-C-BERT, CAN-SecureBERT, and CAN-LLAMA2, which adapt pretrained language models to CAN bus intrusion detection [22]. A recent survey further identifies generative AI as an emerging direction for IVN intrusion de-
Standard Data Frame
| Arbitration Field | Control Field | Data Field | |||||||
|---|---|---|---|---|---|---|---|---|---|
Fig. 2. CAN frame format.
tection [31]. CANMentor focuses on a cloud-side LLM teacher that supports vehicle-side detection and periodic knowledge distillation.
III. PRELIMINARIES
A. CAN Frame Format
CAN uses broadcast communication, allowing all ECUs on a bus to receive each transmitted frame. As shown in Fig. 2, a standard Classical CAN data frame contains framing, arbitration, control, data, cyclic redundancy check (CRC), and acknowledgment fields [1]. Its 11-bit identifier determines message type and arbitration priority, while the data field carries up to 8 bytes. Identifiers, payloads, timestamps, and inter-arrival times provide content and temporal features for intrusion detection. Because individual frames provide limited context, sequence analysis helps identify anomalous communication patterns.
B. Adversary Model
We consider an adversary that has gained access to the in-vehicle CAN bus and can observe traffic, inject malicious CAN messages, and, for masquerade attacks, suppress and replace legitimate transmissions. The adversary may manipulate CAN identifiers, payloads, or transmission patterns [32], [33]. We consider the following attack capabilities.
-
Flooding and Fuzzing Attacks: The adversary can inject high-priority messages at a high rate to disrupt legitimate communication, as in denial-of-service (DoS) attacks, or inject randomly constructed messages with arbitrary identifiers and payloads, as in fuzzing attacks.
-
Spoofing Attacks: The adversary can identify a target CAN identifier and inject fabricated messages with manipulated payloads to alter the corresponding vehicle state, while legitimate messages associated with the same identifier may remain on the bus.
-
Masquerade Attacks: The adversary can suppress legitimate messages associated with a target CAN identifier and replace them with manipulated messages while preserving the expected transmission pattern, thereby altering vehicle-state information and misleading receiving ECUs.
C. Wasserstein GAN With Gradient Penalty
Wasserstein GAN (WGAN) optimizes the Wasserstein-1 distance through a real-valued critic to provide informative gradients and stabilize training. Wasserstein GAN with gradient penalty (WGAN-GP) replaces weight clipping with a gradient penalty that encourages a 1-Lipschitz critic by keeping its gradient norm close to 1 [34]. A generator G maps noise z to generated samples , and a critic D assigns higher scores to real samples than to generated samples. The critic loss is
where and are the real and generated data distributions, respectively, is the gradient penalty coefficient, and is sampled along straight lines between real and generated samples. CANMentor uses WGAN-GP to train the vehicle-side proxy generator.
D. Large Language Models and LoRA Fine-Tuning
Large language models (LLMs) are typically Transformer-based models trained on large-scale text corpora. Their sequence modeling capability enables them to learn contextual representations and capture dependencies within sequences [27], [35]. Low-rank adaptation (LoRA) is a parameter-efficient method that adapts a pretrained LLM by freezing its weights and learning low-rank update matrices for downstream tasks [28]. For a frozen weight matrix , the update is
where , , is the LoRA rank, and is a scaling factor. During fine-tuning, remains frozen, while and are updated.
E. Knowledge Distillation
Knowledge distillation transfers predictive knowledge from a teacher to a student suited to deployment using soft targets that convey the teacher's relative class confidence [36]. Temperature-scaled softmax with temperature converts teacher logits and student logits into soft targets and student probabilities , respectively, over classes; larger produces smoother targets. Transfer minimizes the Kullback–Leibler divergence from teacher soft targets to student probabilities.
IV. METHOD
The main notation used in this section is summarized in Table I.
A. System Model
As shown in Fig. 1, CANMentor comprises vehicles equipped with lightweight IDS models and proxy generators, and a cloud-side LLM teacher. Each vehicle first performs local inference and generates proxy samples from selected CAN messages, preserving class-relevant behavior while retaining raw messages locally.
TABLE I MAIN NOTATION USED IN CANMENTOR
| Symbol | Description | Symbol | Description |
|---|---|---|---|
| Window length; number of classes | Local prediction confidence; confidence threshold | ||
| Local dataset of windowed samples; labeled public CAN dataset | Prescribed perturbation distance; mean absolute perturbation distance | ||
| Original windowed sample; corresponding proxy sample | Local detection logits; teacher logits; anchor logits | ||
| Lightweight IDS model; its frozen copy before distillation | Response time; prescribed latency bound | ||
| Proxy generator; WGAN-GP critic | Distillation temperature | ||
| Complete teacher mapping | Entropy of the teacher prediction; corresponding weight |
Before online collaboration, the teacher is fine-tuned and adapted in a trusted offline environment, then deployed to the cloud. It returns logits for each uploaded proxy sample. The vehicle uses a teacher prediction only if it arrives within the prescribed latency bound; otherwise, it retains the local prediction. All returned logits support periodic knowledge distillation of the vehicle-side IDS models.
B. Data Preprocessing
CANMentor represents each CAN message using its identifier, payload, and inter-arrival time. Let denote the -th message, where , and are its timestamp, CAN identifier, and payload, respectively. The standard 11-bit identifier and payload are encoded and concatenated as
For payloads shorter than 8 bytes, valid bytes are retained according to the data length code (DLC), and zero padding maintains a fixed length. The normalized inter-arrival time is appended to each encoded message, and sliding windows group consecutive messages:
Here, and are the mean and standard deviation of inter-arrival times computed on the training set, and is a small constant preventing division by zero. For vehicle , the resulting windowed samples form , with .
C. Vehicle-Side Detection and Proxy Sample Generation
Vehicle uses a lightweight IDS model and a proxy generator . Any IDS architecture that outputs detection logits

Fig. 3. Architecture of the noise-conditioned U-Net proxy generator. Dashed lines indicate encoder-decoder skip connections. Down and Up denote stride-2 convolution and linear upsampling, respectively. The output stage enforces the prescribed perturbation distance.
over classes can be used. For an input windowed sample , the local detection logits, class probabilities, and predicted label are
CANMentor queries the cloud-side teacher for windows on which the local IDS has low confidence. Under non-IID data, attacks underrepresented in local training can also receive incorrect predictions with high confidence. To sample such cases, CANMentor randomly selects a small proportion of the remaining windows. For , the local prediction confidence is measured by the maximum class probability:
A windowed sample is selected by the low-confidence criterion when ; the remaining samples are eligible for random selection.
CANMentor uploads only proxy samples while retaining the corresponding windowed samples on the vehicle. As shown in Fig. 3, consists of a noise-conditioned 1D U-Net with a three-stage encoder, a symmetric decoder, and cross-scale skip connections, followed by pointwise convolution, binary quantization, and fixed-distance projection. For a selected windowed sample , a noise vector , and a prescribed perturbation distance , the mapping is
Following the WGAN-GP formulation in Section III-C, vehicle trains to match the distribution of real windowed samples. The generator adversarial loss is
where is the WGAN-GP critic.
To preserve class-relevant behavior, is frozen during proxy generator training. CANMentor introduces the semantic-consistency loss and feature-consistency loss .
These losses constrain each proxy sample to match the prediction behavior and intermediate representation of its source windowed sample:
(9)
Here, is the temperature parameter, and denotes an intermediate feature layer of .
The distance loss controls how much each proxy differs from its source window. Larger perturbations obscure more of the original bit pattern but can also disrupt features used for classification. We measure the mean absolute perturbation distance and penalize distances outside the interval :
(10)
The overall loss for training the proxy generator is
is trained by minimizing . During training, softly guides the perturbation distance. Because this loss cannot guarantee the prescribed distance for every uploaded proxy sample, the generator output stage enforces as a hard constraint. Specifically, it converts d into the required number of bit flips and flips the positions with the highest generator-predicted flip probabilities.
D. Cloud-Side Teacher Inference and Knowledge Distillation
- Numerical CAN Frame Encoding and Teacher Fine-Tuning: CAN messages are commonly recorded in textual form with a timestamp and hexadecimal representations of the CAN identifier and payload. Directly concatenating these fields for LLM tokenization is problematic because language tokenizers are designed for natural language and may split hexadecimal fields into variable-length units without explicitly preserving the field boundaries or bit-level relationships within a CAN frame. Prior studies address similar representation mismatches using learnable encoders that map numerical time-series data into the embedding space of pretrained language models [37], [38].
Following this idea, CANMentor introduces a numerical CAN frame encoder , hereafter referred to as the numerical encoder, before the cloud-side LLM teacher. For each frame , an identifier encoder processes , a payload-byte encoder processes the eight bytes in , and a temporal encoder processes . Learnable position embeddings distinguish the eight payload-byte positions. The resulting field embeddings are concatenated and projected into the hidden dimension of the LLM. A residual projection of is further added to retain the complete frame-level information.
For a windowed sample , the numerical encoder produces one continuous embedding for each frame and appends a learnable classification token:
where and is the hidden dimension of the LLM. The resulting embeddings are supplied directly to the embedding interface of the LLM without textual serialization or tokenization.
The cloud-side LLM teacher processes the encoded sequence, and a classification head maps the hidden state of the classification token to the teacher logits:
where denotes the frozen pretrained parameters of the LLM and denotes its trainable LoRA parameters.
The numerical encoder, LoRA parameters, and classification head are jointly fine-tuned using a large labeled public CAN dataset \mathcal{D}_{\mathrm{pub}} = \{(\mathbf{X}_j^{\mathrm{pub}}, y_j^{\mathrm{pub}})\}_{j=1}^N_{\mathrm{pub}}. The corresponding classification objective is
Here, denotes the cross-entropy loss. After fine-tuning, the teacher can directly capture discriminative patterns in CAN messages and provide class-level supervision.
- Teacher Adaptation to Proxy Samples: For brevity, denotes the complete teacher mapping, including , , and .
The teacher is initially fine-tuned on original public windowed samples but receives proxy samples during online inference. Perturbations introduced by the proxy generator create a distribution shift between these inputs. To address this shift, the teacher is adapted using proxy samples generated from public CAN data once per deployed generator version and reused until that generator is updated. We assume that initial fine-tuning and all proxy adaptation occur in a trusted offline environment (e.g., a vehicle manufacturer's server). Only the resulting teacher weights are transferred to the inference cloud.
For proxy adaptation, each current generator transforms the labeled public windowed samples into proxy samples at the prescribed distance , while retaining the corresponding labels . The teacher is then adapted using both the generated proxy samples and the corresponding public windowed samples:
Here, U denotes the set of vehicles, and and are weighting coefficients. This joint objective enables the teacher to identify class-discriminative attack patterns in proxy samples while retaining its detection capability on original windowed samples.
- Cloud-Side Teacher Inference and Vehicle-Side Knowledge Distillation: For each selected windowed sample , vehicle uploads the corresponding proxy sample . The adapted cloud-side LLM teacher produces the teacher logits
Let denote the vehicle-side processing time, the round-trip communication time, and the teacher inference time. The response time is
Given a prescribed latency bound , vehicle u selects the current detection result as
Regardless of the response time, all returned teacher logits are retained for periodic knowledge distillation. During distillation, vehicle u converts them into soft targets using temperature-scaled softmax and updates on the corresponding selected windowed samples retained locally.
To account for differences in teacher prediction confidence, CANMentor converts the teacher logits into class probabilities . The entropy of the teacher prediction and its corresponding weight are
(19)
Let denote the number of selected windowed samples at vehicle u. The entropy-weighted distillation loss is
where the sums are taken over the selected windowed samples.
Directly distilling the teacher soft targets may shift the existing detection behavior of the lightweight IDS model. CANMentor therefore retains a frozen copy of the model before distillation and computes its anchor logits as . The anchor loss and the complete distillation objective are
Here, is the distillation temperature, is a small numerical constant, and controls the strength of the anchor loss.
TABLE II STATISTICS OF THE ROAD DATASET
| Attack class | Number of attack messages |
|---|---|
| Fuzzing attack | 1,059 |
| Correlated signal fabrication | 5,493 |
| Correlated signal masquerade | 5,493 |
| Max engine coolant temperature fabrication | 43 |
| Max engine coolant temperature masquerade | 43 |
| Max speedometer fabrication | 11,694 |
| Max speedometer masquerade | 11,694 |
| Reverse light off fabrication | 5,480 |
| Reverse light off masquerade | 5,480 |
| Reverse light on fabrication | 8,034 |
| Reverse light on masquerade | 8,034 |
| Total | 62,547 |
TABLE III STATISTICS OF THE HCRL CAR-HACKING DATASET
| Attack class | Number of normal messages | Number of attack messages | Total number of messages |
|---|---|---|---|
| DoS | 3,078,250 | 587,521 | 3,665,771 |
| Fuzzy | 3,347,013 | 491,847 | 3,838,860 |
| Gear spoofing | 3,845,890 | 597,252 | 4,443,142 |
| RPM spoofing | 3,966,805 | 654,897 | 4,621,702 |
V. EXPERIMENTS
A. Datasets
We use the ROAD and HCRL Car-Hacking datasets to evaluate CANMentor on the attack types described in Section III-B [39], [40]. HCRL Car-Hacking covers flooding, fuzzing, and spoofing attacks, whereas ROAD covers fuzzing and simulated masquerade attacks targeting selected vehicle signals.
- ROAD Dataset: The Real ORNL Automotive Dynamometer (ROAD) CAN Intrusion Dataset was collected from a real vehicle under ambient driving and physically verified attack conditions [40]. It contains 12 ambient captures totaling about 3 hours and 33 attack captures totaling about 30 minutes, covering fuzzing and five targeted attack classes: correlated signal, max engine coolant temperature, max speedometer, reverse light off, and reverse light on.
In our evaluation, the simulated masquerade variants of the five targeted attack classes represent the masquerade capability defined in Section III-B. Table II summarizes the publicly labeled attack captures. Accelerator attack captures are excluded because their labels are not publicly available.
- HCRL Car-Hacking Dataset: The HCRL Car-Hacking dataset, used in GIDS [39], was collected from a real vehicle through the on-board diagnostics II (OBD-II) port during CAN message injection attacks. It contains denial-of-service (DoS), Fuzzy, gear spoofing, and revolutions-per-minute (RPM) spoofing attacks. Each attack file includes normal and injected CAN messages; Table III summarizes the dataset statistics.
B. Experimental Setup
The vehicle-side lightweight IDS models and proxy generators were evaluated on a workstation equipped with an NVIDIA GeForce RTX 4060 Laptop GPU and an Intel Core
TABLE IV ORIGINAL VEHICLE RESULTS ON THE ROAD DATASET BEFORE DISTILLATION
| Veh | Acc | Macro P | Macro R | Macro F1 |
|---|---|---|---|---|
| V0 | 0.9809 | 0.9814 | 0.9747 | 0.9775 |
| V1 | 0.9764 | 0.9743 | 0.9648 | 0.9687 |
| V2 | 0.9948 | 0.9955 | 0.9910 | 0.9932 |
| V3 | 0.9178 | 0.9614 | 0.8577 | 0.8399 |
| V4 | 0.6252 | 0.8144 | 0.8950 | 0.7778 |
i7-13620H CPU. Raw CAN messages were preprocessed into windowed samples with using the method described in Section IV-B.
For each dataset, the raw CAN message stream was first divided into disjoint blocks. These blocks were then assigned approximately equally to the training, test, and online detection sets, after which windowed samples with were constructed independently within each set. No window crossed a split boundary. The training set was subsequently partitioned into five equal-sized local training sets with class proportions drawn from a Dirichlet distribution with .
Each vehicle used a bidirectional long short-term memory (BiLSTM) network with a serialized size below 1 MB as its lightweight IDS model. CANMentor can also use other lightweight multiclass models.
The confidence threshold and random high-confidence sampling ratio were set to 0.90 and 0.5%, respectively. We set for teacher adaptation and for knowledge distillation.
C. Cloud-Side Teacher Inference and Knowledge Distillation Results
We evaluate Qwen2.5-1.5B, Qwen2.5-7B, and OPT-2.7B as cloud-side LLM teachers and compare the vehicle-side IDS models before and after knowledge distillation. We report accuracy and class-wise precision, recall, and F1, with macro averages summarizing class-level performance. Proxy samples use on the ROAD dataset and on the HCRL Car-Hacking dataset, as detailed in Section V-D.
- ROAD Dataset Results: Table IV reports the non-IID baseline results for all five vehicles, whose equal-sized training sets have different class proportions under the Dirichlet partition. Throughout Tables IV–XI, Acc denotes the overall accuracy for each vehicle. In the class-wise tables, P, R, and F1 are reported per class, and the Macro row gives their unweighted averages across classes.
Vehicle 2 already achieves 0.9948 accuracy and 0.9932 Macro F1. In contrast, Vehicle 3 has only two Coolant training windows, while Vehicle 4 has few Normal and Fuzzing windows and only 0.6252 accuracy. We therefore evaluate distillation on Vehicles 0, 1, 3, and 4, whose class-specific blind spots vary in severity.
Tables V–VII report overall accuracy and class-wise precision, recall, and F1 on the test set before and after knowledge distillation on selected windowed samples from the online detection set. N, Fuz, Cool, ROn, Corr, Spd, and ROff denote Normal, Fuzzing, Coolant, Reverse On, Correlated, Speedometer, and Reverse Off, respectively. The targeted attack classes
TABLE V RESULTS ON THE ROAD DATASET USING QWEN2.5-1.5B AS THE CLOUD-SIDE LLM TEACHER
| Veh Class | Acc | P | R | F1 |
|---|---|---|---|---|
| N | 0.9798/0.9993 | 0.9892/0.9961 | 0.9845/0.9977 | |
| Fuz | 0.9895/0.9989 | 1.0000/1.0000 | 0.9947/0.9994 | |
| Cool | 0.9996/1.0000 | 0.9826/0.9826 | 0.9910/0.9912 | |
| ROn | 0.9554/0.9816 | 0.8514/0.9952(*) | 0.9004/0.9884(*) | |
| Corr | 1.0000/1.0000 | 1.0000/1.0000 | 1.0000/1.0000 | |
| Spd | 0.9797/0.9994 | 0.9995/0.9995 | 0.9895/0.9994 | |
| ROff | 0.9658/0.9786 | 1.0000/1.0000 | 0.9826/0.9892 | |
| Macro | 0.9814/0.9940 | 0.9747/0.9962 | 0.9775/0.9951 | |
| N | 0.9800/0.9966 | 0.9919/0.9936 | 0.9859/0.9951 | |
| Fuz | 0.9893/0.9949 | 0.8440/0.9750(*) | 0.9109/0.9848(*) | |
| Cool | 0.9999/1.0000 | 1.0000/1.0000 | 0.9999/1.0000 | |
| ROn | 0.9874/0.9960 | 0.9982/0.9999 | 0.9928/0.9979 | |
| Corr | 1.0000/1.0000 | 1.0000/1.0000 | 1.0000/1.0000 | |
| Spd | 0.9018/0.9690(*) | 0.9195/0.9892(*) | 0.9106/0.9790(*) | |
| ROff | 0.9617/0.9866 | 1.0000/1.0000 | 0.9805/0.9932 | |
| Macro | 0.9743/0.9919 | 0.9648/0.9940 | 0.9687/0.9929 | |
| N | 0.8778/0.9613(*) | 0.9980/0.9977 | 0.9341/0.9792 | |
| Fuz | 0.9607/1.0000 | 1.0000/1.0000 | 0.9800/1.0000 | |
| Cool | 0.9804/0.9812 | 0.0063/0.7296(*) | 0.0124/0.8369(*) | |
| ROn | 0.9988/0.9996 | 0.9995/0.9995 | 0.9991/0.9996 | |
| Corr | 1.0000/0.9999 | 1.0000/1.0000 | 1.0000/0.9999 | |
| Spd | 1.0000/1.0000 | 0.9999/0.9961 | 0.9999/0.9981 | |
| ROff | 0.9122/0.9767(*) | 1.0000/1.0000 | 0.9541/0.9882 | |
| Macro | 0.9614/0.9884 | 0.8577/0.9604(*) | 0.8399/0.9717(*) | |
| N | 0.9998/0.9994 | 0.2655/0.9425(*) | 0.4196/0.9701(*) | |
| Fuz | 0.9736/0.9994 | 1.0000/1.0000 | 0.9866/0.9997 | |
| Cool | 0.9959/0.9995 | 1.0000/1.0000 | 0.9979/0.9998 | |
| ROn | 0.2141/0.7790(*) | 0.9998/0.9965 | 0.3527/0.8744(*) | |
| Corr | 0.9980/0.9996 | 0.9990/1.0000 | 0.9990/0.9998 | |
| Spd | 0.9856/1.0000 | 0.9999/0.9999 | 0.9927/0.9995 | |
| ROff | 0.5336/0.9291(*) | 1.0000/0.9998 | 0.6959/0.9632(*) | |
| Macro | 0.8144/0.9580(*) | 0.8950/0.9911(*) | 0.7778/0.9723(*) |
TABLE VI RESULTS ON THE ROAD DATASET USING QWEN2.5-7B AS THE CLOUD-SIDE LLM TEACHER
| Veh Class | Acc | P | R | F1 |
|---|---|---|---|---|
| N | 0.9798/0.9996 | 0.9892/0.9973 | 0.9845/0.9984 | |
| Fuz | 0.9895/0.9989 | 1.0000/1.0000 | 0.9947/0.9994 | |
| Cool | 0.9996/1.0000 | 0.9826/0.9826 | 0.9910/0.9912 | |
| ROn | 0.9554/0.9895 | 0.8514/0.9971(*) | 0.9004/0.9933(*) | |
| Corr | 1.0000/1.0000 | 1.0000/1.0000 | 1.0000/1.0000 | |
| Spd | 0.9797/0.9996 | 0.9995/0.9995 | 0.9895/0.9996 | |
| ROff | 0.9658/0.9774 | 1.0000/1.0000 | 0.9826/0.9886 | |
| Macro | 0.9814/0.9950 | 0.9747/0.9966 | 0.9775/0.9958 | |
| N | 0.9800/0.9974 | 0.9919/0.9944 | 0.9859/0.9959 | |
| Fuz | 0.9893/0.9924 | 0.8440/0.9852(*) | 0.9109/0.9888(*) | |
| Cool | 0.9999/1.0000 | 1.0000/1.0000 | 0.9999/1.0000 | |
| ROn | 0.9874/0.9975 | 0.9982/0.9990 | 0.9928/0.9983 | |
| Corr | 1.0000/1.0000 | 1.0000/1.0000 | 1.0000/1.0000 | |
| Spd | 0.9018/0.9733(*) | 0.9195/0.9931(*) | 0.9106/0.9831(*) | |
| ROff | 0.9617/0.9959 | 1.0000/1.0000 | 0.9805/0.9979 | |
| Macro | 0.9743/0.9938 | 0.9648/0.9960 | 0.9687/0.9949 | |
| N | 0.8778/0.9847(*) | 0.9980/0.9952 | 0.9341/0.9899(*) | |
| Fuz | 0.9607/0.9995 | 1.0000/1.0000 | 0.9800/0.9998 | |
| Cool | 0.9804/0.9699 | 0.0063/0.8986(*) | 0.0124/0.9329(*) | |
| ROn | 0.9988/1.0000 | 0.9995/0.9992 | 0.9991/0.9996 | |
| Corr | 1.0000/0.9985 | 1.0000/1.0000 | 1.0000/0.9993 | |
| Spd | 1.0000/1.0000 | 0.9999/1.0000 | 0.9999/1.0000 | |
| ROff | 0.9122/0.9940(*) | 1.0000/0.9996 | 0.9541/0.9968 | |
| Macro | 0.9614/0.9924 | 0.8577/0.9847(*) | 0.8399/0.9833(*) | |
| N | 0.9998/0.9993 | 0.2655/0.9336(*) | 0.4196/0.9654(*) | |
| Fuz | 0.9736/0.9999 | 1.0000/1.0000 | 0.9866/0.9999 | |
| Cool | 0.9959/1.0000 | 1.0000/1.0000 | 0.9979/1.0000 | |
| ROn | 0.2141/0.7336(*) | 0.9998/0.9949 | 0.3527/0.8445(*) | |
| Corr | 0.9980/0.9999 | 1.0000/1.0000 | 0.9990/0.9999 | |
| Spd | 0.9856/0.9983 | 0.9999/1.0000 | 0.9927/0.9991 | |
| ROff | 0.5336/0.9495(*) | 1.0000/0.9998 | 0.6959/0.9740(*) | |
| Macro | 0.8144/0.9544(*) | 0.8950/0.9897(*) | 0.7778/0.9690(*) |
use the masquerade setting. Changes within remain black; larger improvements and decreases are shown in green and red, respectively, and (*) marks a large improvement with .
TABLE VII RESULTS ON THE ROAD DATASET USING OPT-2.7B AS THE CLOUD-SIDE LLM TEACHER
| Veh Class | Acc | P | R | F1 |
|---|---|---|---|---|
| N | 0.9798/0.9993 | 0.9892/0.9943 | 0.9845/0.9968 | |
| Fuz | 0.9895/0.9995 | 1.0000/1.0000 | 0.9947/0.9998 | |
| Cool | 0.9996/1.0000 | 0.9826/0.9826 | 0.9910/0.9912 | |
| RON | 0.9554/0.9715 | 0.8514/0.9930(*) | 0.9004/0.9821(*) | |
| Corr | 1.0000/1.0000 | 1.0000/1.0000 | 1.0000/1.0000 | |
| Spd | 0.9797/0.9973 | 0.9995/0.9995 | 0.9895/0.9984 | |
| ROff | 0.9658/0.9767 | 1.0000/1.0000 | 0.9826/0.9882 | |
| Macro | 0.9814/0.9920 | 0.9747/0.9956 | 0.9775/0.9938 | |
| N | 0.9800/0.9972 | 0.9919/0.9922 | 0.9859/0.9947 | |
| Fuz | 0.9893/0.9939 | 0.8440/0.9766(*) | 0.9109/0.9852(*) | |
| Cool | 0.9999/0.9999 | 1.0000/1.0000 | 0.9999/0.9999 | |
| RON | 0.9874/0.9933 | 0.9982/1.0000 | 0.9928/0.9966 | |
| Corr | 1.0000/1.0000 | 1.0000/1.0000 | 1.0000/1.0000 | |
| Spd | 0.9018/0.9636(*) | 0.9195/0.9908(*) | 0.9106/0.9770(*) | |
| ROff | 0.9617/0.9864 | 1.0000/1.0000 | 0.9805/0.9932 | |
| Macro | 0.9743/0.9906 | 0.9648/0.9942 | 0.9687/0.9924 | |
| N | 0.8778/0.9694(*) | 0.9980/0.9974 | 0.9341/0.9832 | |
| Fuz | 0.9607/0.9996 | 1.0000/1.0000 | 0.9800/0.9998 | |
| Cool | 0.9804/0.9815 | 0.0063/0.7820(*) | 0.0124/0.8705(*) | |
| RON | 0.9988/1.0000 | 0.9995/0.9995 | 0.9991/0.9997 | |
| Corr | 1.0000/0.9998 | 1.0000/1.0000 | 1.0000/0.9999 | |
| Spd | 1.0000/1.0000 | 0.9999/0.9998 | 0.9999/0.9999 | |
| ROff | 0.9122/0.9778(*) | 1.0000/1.0000 | 0.9541/0.9888 | |
| Macro | 0.9614/0.9897 | 0.8577/0.9684(*) | 0.8399/0.9774(*) | |
| N | 0.9998/0.9995 | 0.2655/0.9345(*) | 0.4196/0.9659(*) | |
| Fuz | 0.9736/0.9994 | 1.0000/1.0000 | 0.9866/0.9997 | |
| Cool | 0.9959/0.9903 | 1.0000/1.0000 | 0.9979/0.9951 | |
| RON | 0.2141/0.7501(*) | 0.9998/0.9970 | 0.3527/0.8561(*) | |
| Corr | 0.9980/0.9996 | 1.0000/1.0000 | 0.9990/0.9998 | |
| Spd | 0.9856/1.0000 | 0.9999/0.9995 | 0.9927/0.9997 | |
| ROff | 0.5336/0.9370(*) | 1.0000/1.0000 | 0.6959/0.9675(*) | |
| Macro | 0.8144/0.9537(*) | 0.8950/0.9901(*) | 0.7778/0.9691(*) |
TABLE VIII ORIGINAL VEHICLE RESULTS ON THE HCRL CAR-HACKING DATASET BEFORE DISTILLATION
| Veh | Acc | Macro P | Macro R | Macro F1 |
|---|---|---|---|---|
| V0 | 0.9143 | 0.9647 | 0.8243 | 0.8258 |
| V1 | 0.9991 | 0.9996 | 0.9984 | 0.9990 |
| V2 | 0.9765 | 0.9573 | 0.9917 | 0.9732 |
| V3 | 0.9828 | 0.9831 | 0.9656 | 0.9728 |
| V4 | 0.9984 | 0.9977 | 0.9984 | 0.9980 |
The largest ROAD gains occur for Vehicles 3 and 4. Vehicle 3's Coolant F1 rises from 0.0124 to 0.8369–0.9329 after distillation, reflecting repair of its severe blind spot. Its Macro F1 increases from 0.8399 to 0.9717–0.9883.
Vehicle 4's accuracy increases from 0.6252 to 0.9657–0.9703, while Macro F1 rises from 0.7778 to 0.9690–0.9723, with a maximum relative Macro F1 improvement of 25.01%. Its Normal F1 improves from 0.4196 to 0.9654–0.9701, addressing a major initial weakness.
Vehicles 0 and 1 show smaller refinements, mainly in Reverse On for Vehicle 0 and Fuzzing and Speedometer for Vehicle 1; previously strong classes remain stable. The vehicle-side IDS models achieve their best results after distillation from Qwen2.5-7B on Vehicles 0, 1, and 3, and from Qwen2.5-1.5B on Vehicle 4. Thus, distillation gains do not depend solely on teacher size.
- HCRL Car-Hacking Dataset Results: Table VIII reports the non-IID baseline results for all five vehicles.
Vehicles 1 and 4 already achieve accuracies of 0.9991 and 0.9984, with Macro F1 close to 1.0, so we evaluate Vehicles 0, 2, and 3. Vehicle 0 has a pronounced DoS blind spot; Vehicle
TABLE IX RESULTS ON THE HCRL CAR-HACKING DATASET USING QWEN2.5-1.5B AS THE CLOUD-SIDE LLM TEACHER
| Veh Class | Acc | P | R | F1 |
|---|---|---|---|---|
| N | 0.8848/0.9964(*) | 0.9999/0.9989 | 0.9388/0.9977(*) | |
| DoS | 1.0000/1.0000 | 0.1260/0.9814(*) | 0.2238/0.9906(*) | |
| Fuz | 0.9414/0.9992(*) | 0.9978/0.9978 | 0.9687/0.9985 | |
| Gear | 0.9975/0.9935 | 0.9979/0.9982 | 0.9977/0.9959 | |
| RPM | 0.9999/1.0000 | 1.0000/0.9995 | 0.9999/0.9997 | |
| Macro | 0.9647/0.9978 | 0.8243/0.9952(*) | 0.8258/0.9965(*) | |
| N | 0.9994/0.9989 | 0.9620/0.9982 | 0.9803/0.9985 | |
| DoS | 0.8664/0.9937(*) | 0.9991/0.9982 | 0.9281/0.9959(*) | |
| Fuz | 0.9373/0.9958(*) | 0.9989/0.9975 | 0.9671/0.9966 | |
| Gear | 0.9846/0.9995 | 0.9984/0.9979 | 0.9914/0.9987 | |
| RPM | 0.9986/1.0000 | 0.9999/0.9992 | 0.9993/0.9996 | |
| Macro | 0.9573/0.9976 | 0.9917/0.9982 | 0.9732/0.9979 | |
| N | 0.9831/0.9972 | 0.9991/0.9999 | 0.9911/0.9986 | |
| DoS | 0.9741/1.0000 | 0.9985/0.9985 | 0.9862/0.9992 | |
| Fuz | 1.0000/0.9999 | 0.8331/0.9870(*) | 0.9090/0.9934(*) | |
| Gear | 0.9762/1.0000 | 0.9991/0.9984 | 0.9875/0.9992 | |
| RPM | 0.9822/0.9997 | 0.9982/0.9985 | 0.9901/0.9991 | |
| Macro | 0.9831/0.9994 | 0.9656/0.9965 | 0.9728/0.9979 |
TABLE X RESULTS ON THE HCRL CAR-HACKING DATASET USING QWEN2.5-7B AS THE CLOUD-SIDE LLM TEACHER
| Veh Class | Acc | P | R | F1 |
|---|---|---|---|---|
| N | 0.8848/0.9971(*) | 0.9999/0.9996 | 0.9388/0.9984(*) | |
| DoS | 1.0000/1.0000 | 0.1260/0.9871(*) | 0.2238/0.9935(*) | |
| Fuz | 0.9414/0.9976(*) | 0.9978/0.9979 | 0.9687/0.9978 | |
| Gear | 0.9975/0.9997 | 0.9979/0.9968 | 0.9977/0.9982 | |
| RPM | 0.9999/1.0000 | 1.0000/0.9996 | 0.9999/0.9998 | |
| Macro | 0.9647/0.9989 | 0.8243/0.9962(*) | 0.8258/0.9975(*) | |
| N | 0.9994/0.9988 | 0.9620/0.9985 | 0.9803/0.9986 | |
| DoS | 0.8664/0.9963(*) | 0.9991/0.9981 | 0.9281/0.9972(*) | |
| Fuz | 0.9373/0.9944(*) | 0.9989/0.9976 | 0.9671/0.9960 | |
| Gear | 0.9846/0.9999 | 0.9984/0.9974 | 0.9914/0.9986 | |
| RPM | 0.9986/1.0000 | 0.9999/0.9994 | 0.9993/0.9997 | |
| Macro | 0.9573/0.9979 | 0.9917/0.9982 | 0.9732/0.9980 | |
| N | 0.9831/0.9975 | 0.9991/0.9999 | 0.9911/0.9987 | |
| DoS | 0.9741/1.0000 | 0.9985/0.9984 | 0.9862/0.9992 | |
| Fuz | 1.0000/0.9991 | 0.8331/0.9890(*) | 0.9090/0.9940(*) | |
| Gear | 0.9762/1.0000 | 0.9991/0.9984 | 0.9875/0.9992 | |
| RPM | 0.9822/1.0000 | 0.9982/0.9981 | 0.9901/0.9991 | |
| Macro | 0.9831/0.9993 | 0.9656/0.9968 | 0.9728/0.9980 |
2 has weaker DoS and Fuzzy precision than Vehicles 1 and 4, while scarce local Fuzzy samples limit Vehicle 3's recall.
Tables IX–XI use the same before/after and visual annotation conventions as the ROAD tables. N, DoS, Fuz, Gear, and RPM denote Normal, DoS, Fuzzy, Gear spoofing, and RPM spoofing, respectively.
Vehicle 0 benefits most: all three teachers raise its DoS recall from 0.1260 to 0.9814–0.9871 and F1 from 0.2238 to 0.9906–0.9935. Its Macro F1 increases from 0.8258 to 0.9964–0.9975, with a maximum relative improvement of 20.79%.
Vehicles 2 and 3 also improve: Vehicle 2's Macro F1 rises from 0.9732 to 0.9979–0.9980, and Vehicle 3's Fuzzy F1 rises from 0.9090 to 0.9934–0.9940. All three teachers improve the evaluated vehicles. The vehicle-side IDS models achieve the highest accuracy and Macro F1 after distillation from Qwen2.5-7B in each case, although the differences among distillation settings are small.
- Teacher Performance on Selected Windowed Samples: We compare local predictions on selected windowed samples with teacher predictions on the corresponding proxy samples. Randomly selected high-confidence samples are excluded, and labels are used only for offline evaluation. Table XII reports the results.
TABLE XI
RESULTS ON THE HCRL CAR-HACKING DATASET USING OPT-2.7B AS THE CLOUD-SIDE LLM TEACHER
| Veh Class | Acc | P | R | F1 |
|---|---|---|---|---|
| N | 0.8848/0.9969(*) | 0.9999/0.9982 | 0.9388/0.9976(*) | |
| DoS | 1.0000/1.0000 | 0.1260/0.9850(*) | 0.2238/0.9924(*) | |
| Fuz | 0.9414/0.9997(*) | 0.9978/0.9971 | 0.9687/0.9984 | |
| Gear | 0.9975/0.9887 | 0.9979/0.9986 | 0.9977/0.9937 | |
| RPM | 0.9999/1.0000 | 1.0000/0.9995 | 0.9999/0.9997 | |
| Macro | 0.9647/0.9971 | 0.8243/0.957(*) | 0.8258/0.9964(*) | |
| N | 0.9994/0.9987 | 0.9620/0.9984 | 0.9803/0.9986 | |
| DoS | 0.8664/0.9963(*) | 0.9991/0.9982 | 0.9281/0.9973(*) | |
| Fuz | 0.9373/0.9940(*) | 0.9989/0.9979 | 0.9671/0.9959 | |
| Gear | 0.9846/0.9999 | 0.9984/0.9965 | 0.9914/0.9982 | |
| RPM | 0.9986/1.0000 | 0.9999/0.9992 | 0.9993/0.9996 | |
| Macro | 0.9573/0.9978 | 0.9917/0.9981 | 0.9732/0.9979 | |
| N | 0.9831/0.9973 | 0.9991/0.9999 | 0.9911/0.9986 | |
| DoS | 0.9741/1.0000 | 0.9985/0.9981 | 0.9862/0.9991 | |
| Fuz | 1.0000/0.9990 | 0.8331/0.9885(*) | 0.0900/0.9937(*) | |
| Gear | 0.9762/1.0000 | 0.9991/0.9984 | 0.9875/0.9992 | |
| RPM | 0.9822/1.0000 | 0.9982/0.9981 | 0.9901/0.9991 | |
| Macro | 0.9831/0.9993 | 0.9656/0.9966 | 0.9728/0.9979 |
TABLE XII
TEACHER PERFORMANCE ON SELECTED WINDOWED SAMPLES
| Dataset | Teacher | N | Local Acc (%) | Teacher Acc (%) | Gain (pp) |
|---|---|---|---|---|---|
| ROAD | Qwen2.5-1.5B | 6,192 | 55.91 | 96.95 | +41.04 |
| OPT-2.7B | 6,155 | 57.55 | 96.26 | +38.71 | |
| Qwen2.5-7B | 5,840 | 56.01 | 95.70 | +39.69 | |
| HCRL Car-Hacking | Qwen2.5-1.5B | 3,846 | 54.60 | 96.13 | +41.53 |
| OPT-2.7B | 3,828 | 54.81 | 96.81 | +42.00 | |
| Qwen2.5-7B | 3,947 | 55.13 | 96.55 | +41.42 |
Note: N is the number of low-confidence windowed samples selected from the online detection set. Local Acc is computed on the selected windowed samples retained on the vehicle, whereas Teacher Acc is computed on their corresponding proxy samples.
Local accuracy is relatively low because these windowed samples lie near the local decision boundary. Despite their difficulty and the perturbations introduced into the corresponding proxy samples, the three teachers achieve 95.70%–96.95% accuracy and outperform the local predictions by 38.71–42.00 percentage points across the two datasets. These results support using a timely teacher prediction as the current detection result while retaining all returned teacher logits for periodic knowledge distillation.
D. Perturbation–Privacy and Utility Trade-off Analysis
We evaluate two external reconstruction attacks: perturbation-matched reconstruction and architecture-aware shadow-generator transfer. Both use public CAN data and uploaded proxy samples, without query access to the deployed generators.
- Perturbation-Matched Reconstruction Attack: To evaluate the privacy of uploaded proxy samples, we consider a reconstruction adversary that has access to a separate public dataset from the same application domain and the proxy samples uploaded by the vehicles. Following denoising-based reconstruction approaches [41], [42], the adversary trains reconstruction models using synthetically perturbed public data at perturbation levels matched to those of the observed proxy samples. However, it cannot access the target vehicle's original CAN messages or the parameters of the proxy generator. This training encourages the models to learn regularities in the underlying CAN data to support the reconstruction of original samples from perturbed inputs. Reconstruction performance is measured using the bit error rate (BER).
We evaluate a temporal convolutional neural network (T-CNN), BiLSTM, Transformer, and CNN-BiLSTM. For each vehicle and distance, the lowest-BER reconstructor defines the strongest learned attack, evaluated against the no-proxy per-bit prior.
Fig. 4 shows reconstruction advantage and distillation performance as functions of d. We define reconstruction advantage as the percentage reduction in BER achieved by the best of the four learned reconstructors relative to the no-proxy per-bit prior, setting negative reductions to zero. This measure represents reconstruction leakage relative to the no-proxy prior. Panels (a) and (b) report this measure for each vehicle. Reconstruction advantage is at most 4.22% for ROAD (d = 0.40) and 5.47% for HCRL Car-Hacking (d = 0.35), and at most 0.43% and 0.26%, respectively, at d = 0.45. All evaluated vehicles remain below 10% leakage at and above these distances within the tested range. Overall, reconstruction advantage decreases as d increases.
Panels (c) and (d) show that Qwen2.5-1.5B distillation gains generally decrease with d, with vehicle-dependent sensitivity.
We select d = 0.40 for ROAD and d = 0.35 for HCRL Car-Hacking. Both settings already yield low reconstruction advantage, while increasing d to 0.45 further reduces reconstruction advantage but lowers the mean Macro F1 gain.
Table XIII details the four learned reconstructors at the selected distances. Their lowest BERs range from 0.2795 to 0.2873 on the ROAD dataset and from 0.2469 to 0.2606 on the HCRL Car-Hacking dataset, against prior BERs of 0.2918 and 0.2612, respectively.
- Architecture-Aware Shadow-Generator Transfer Attack: We further consider an architecture-aware adversary that knows the generator architecture, training procedure, and perturbation levels. Using only public CAN data, the adversary trains a surrogate IDS and a shadow generator, constructs public proxy-original pairs, and trains the same four reconstructors. The learned reconstructors are then directly applied to the proxy samples uploaded by the target vehicles, without access to the target generators' parameters.
The lowest BERs range from 0.3283 to 0.3740 on ROAD and from 0.3174 to 0.3518 on HCRL Car-Hacking. Both ranges exceed the respective no-proxy prior BERs of 0.2918 and 0.2612.
To further examine these results, we compare BERs on HCRL Car-Hacking. The BiLSTM reconstructor achieves a BER of 0.0915 on validation pairs constructed using the shadow generator, but 0.4179 on target proxy samples from Vehicle V0. This indicates that low reconstruction error in the shadow domain does not translate into a reconstruction advantage in the target domain. Differences in the mappings and data distributions between the two domains may limit the transfer of reconstruction capabilities. Under our deployment assumptions, vehicles retain their original CAN data locally, and the external adversary cannot access proxy-original pairs from the target generator. It therefore cannot use such paired

(a)
(b)

(c)
(d)
Fig. 4. Effect of the fixed perturbation distance on (a, b) reconstruction advantage and (c, d) change in vehicle-side Macro F1 after distillation from Qwen2.5-1.5B. Panels (a, c) show ROAD results; panels (b, d) show HCRL Car-Hacking results. Dashed lines show linear trends, and r denotes the Pearson correlation coefficient.
TABLE XIII
RECONSTRUCTION ATTACK RESULTS AT ON THE ROAD DATASET AND ON THE HCRL CAR-HACKING DATASET. LOWER BER INDICATES A STRONGER RECONSTRUCTION ATTACK.
| Dataset | Veh | Prior BER | T-CNN BER | BiLSTM BER | Transformer BER | CNN-BiLSTM BER | Reconstruction advantage (%) |
|---|---|---|---|---|---|---|---|
| ROAD | V0 | 0.2918 | 0.2878 | 0.2904 | 0.2795 | 0.2901 | 4.22 |
| V1 | 0.2918 | 0.2884 | 0.2902 | 0.2843 | 0.2907 | 2.57 | |
| V3 | 0.2918 | 0.2873 | 0.2885 | 0.3124 | 0.2897 | 1.54 | |
| V4 | 0.2918 | 0.2847 | 0.2883 | 0.2912 | 0.2883 | 2.43 | |
| HCRL Car-Hacking | V0 | 0.2612 | 0.2517 | 0.2597 | 0.2469 | 0.2598 | 5.47 |
| V2 | 0.2612 | 0.2606 | 0.2614 | 0.2614 | 0.2616 | 0.23 | |
| V3 | 0.2612 | 0.2798 | 0.2630 | 0.2587 | 0.2525 | 3.33 |
Note: Bold values indicate the lowest BER among the four learned reconstructors. Reconstruction advantage is calculated as , where is the no-proxy prior BER and is the lowest BER among the four learned reconstructors. Veh. denotes vehicle (V0 = Vehicle 0, etc.).
supervision to directly learn a reconstruction mapping specific to the target generator.
E. Ablation Study
We conduct two ablation studies to examine the contribution of the cloud-side teacher design. First, we replace the LLM teacher with BiLSTM teachers of different sizes to determine
whether increasing the capacity of a conventional teacher is sufficient to reproduce the distillation benefit. Second, we remove teacher adaptation to proxy samples while retaining the numerical input representation.
- Effect of Cloud-Side Teacher Selection: We replace the cloud-side LLM teacher with BiLSTM teachers based on the vehicle-side IDS architecture. Three configurations with

Fig. 5. Effect of teacher selection on the ROAD dataset. Solid lines show the F1 of each vehicle's blind-spot class, while dashed lines show the corresponding Macro F1. Results for each teacher represent vehicle-side IDS performance after distillation; Original denotes the pre-distillation baseline. The blind-spot classes are identified before distillation: Reverse On for Vehicles 0 and 4, Speedometer for Vehicle 1, and Coolant for Vehicle 3.

Fig. 6. HCRL-to-ROAD Normal/Fuzzy transfer without ROAD windowed samples for training. The Fuzzy label denotes the HCRL Fuzzy class and the ROAD Fuzzing class. Each confusion matrix is normalized by ground-truth class, and entries are percentages.
serialized sizes of approximately 100 MB, 1 GB, and 3 GB are evaluated alongside Qwen2.5-1.5B, the smallest LLM teacher in the main experiments, with a serialized size of approximately 3.1 GB. The 3 GB BiLSTM provides a size-comparable reference for determining whether conventional teacher capacity alone can reproduce the benefit of the LLM teacher.
In Fig. 5, each vehicle-side IDS model achieves its highest blind-spot F1 and Macro F1 after distillation from Qwen2.5-1.5B. Blind-spot F1 on Vehicles 3 and 4 rises from 0.012
and 0.353 to 0.837 and 0.874, respectively. Student Macro F1 exceeds 0.97 on both vehicles, compared with 0.937 and 0.829 after distillation from the 3 GB BiLSTM. Increasing BiLSTM size does not produce monotonic gains across vehicles; the difference between the two teachers of similar size indicates that size alone does not explain the student results.
To assess robustness beyond in-domain ROAD performance, we conduct an HCRL-to-ROAD stress test. We map the HCRL Fuzzy class to the ROAD Fuzzing class and use Fuzzy as their shared label. Because Normal and Fuzzy are the only classes shared by both datasets, the teachers are trained only on the corresponding windowed samples from the HCRL Car-Hacking dataset and evaluated directly on the ROAD dataset without using ROAD windowed samples for training. Fig. 6 compares Qwen2.5-1.5B with the 100 MB, 1 GB, and 3 GB BiLSTM teachers.
All three BiLSTM teachers collapse to a single-class prediction under the cross-dataset shift. The 100 MB and 3 GB models classify every ROAD windowed sample as Fuzzy, whereas the 1 GB model classifies every sample as Normal. Each therefore obtains 50% accuracy on the balanced test set and completely misses one class. In contrast, Qwen2.5-1.5B retains discrimination between the classes, achieving recalls of 63.23% and 65.13% for Normal and Fuzzy, respectively, and an overall accuracy of 64.18%. This size-matched comparison further supports the cross-dataset robustness advantage of the LLM teacher.
- Effect of Teacher Adaptation to Proxy Samples: We next evaluate whether the cloud-side LLM teachers can perform reliable inference on proxy samples without additional adaptation. For each teacher, we compare the settings with and without proxy adaptation using the same generators and evaluation samples (Fig. 7).
Without adaptation to proxy samples, the mean Macro F1 values are only 0.233, 0.315, and 0.352 for Qwen2.5-1.5B, OPT-2.7B, and Qwen2.5-7B, respectively. After adaptation, the corresponding mean values increase to 0.970, 0.985, and 0.984, with all per-vehicle Macro F1 values reaching at least 0.957. Although the numerical encoder addresses the mismatch between CAN signal fields and the LLM input space, proxy adaptation remains necessary to accommodate generator perturbations. The high Macro F1 after adaptation indicates that proxy samples retain information useful for distinguishing normal traffic from attacks and differentiating attack classes. Adaptation enables the teacher to use this information despite the distribution shift introduced by the proxy generator.
F. Runtime Overhead Analysis
Table XIV reports mean latencies per windowed sample, excluding communication. IDS inference takes 0.60 and 0.59 ms on ROAD and HCRL Car-Hacking, respectively, while proxy generation takes 3.63 and 2.85 ms. Proxy generation is performed only for selected windowed samples and is not required to obtain the local prediction. Cloud-side teacher inference, including the numerical encoder, LLM, and classification head, is reported separately. Actual response time also includes the round-trip communication time ,

Fig. 7. Macro F1 on proxy samples with and without teacher adaptation on ROAD () for Vehicles 0, 1, 3, and 4. All settings use the field-aware numerical input representation. Teachers from left to right are Qwen2.5-1.5B, OPT-2.7B, and Qwen2.5-7B.
TABLE XIV
RUNTIME OVERHEAD OF CANMENTOR ON THE ROAD DATASET AND THE HCRL CAR-HACKING DATASET (IN MILLISECONDS)
| Operation | ROAD | HCRL Car-Hacking |
|---|---|---|
| Vehicle-side processing time | ||
| IDS inference | 0.60 | 0.59 |
| Proxy sample generation | 3.63 | 2.85 |
| Teacher inference time | ||
| Qwen2.5-1.5B | 27.04 | 28.51 |
| OPT-2.7B | 27.53 | 28.62 |
| Qwen2.5-7B | 30.85 | 34.22 |
which depends on network conditions. If the total response time exceeds , CANMentor retains the local prediction and uses returned logits for subsequent distillation.
VI. DISCUSSION
Results show that cloud-side LLM teachers improve vehicle-side IDS models under non-IID data through privacy-preserving proxies that keep original CAN messages local. For online detection, CANMentor uses teacher predictions only when responses arrive within the latency bound; otherwise, it retains the local prediction. Returned logits also support periodic distillation, enabling cloud assistance without continuous dependence on cloud availability.
Real-vehicle and larger-scale IoV evaluations can examine communication delay, intermittent cloud availability, and increased vehicle participation. Adaptive perturbation control and teacher selection can account for variations in vehicle data distributions, network conditions, and teacher models. Broader evaluations across vehicle platforms, attack classes, CAN datasets, and lightweight IDS architectures can further assess generalizability. The cloud-side LLM teacher can also be explored for attack explanation and cross-vehicle alert analysis.
VII. CONCLUSION
CANMentor combines vehicle-side lightweight IDS models with a cloud-side LLM teacher through fixed-distance
proxy samples. Teacher predictions are used only within the prescribed latency bound; otherwise, local predictions are retained. All returned teacher logits are converted into soft targets for periodic knowledge distillation.
Experiments on the ROAD dataset and the HCRL Car-Hacking dataset show that CANMentor improves vehicle-side IDS models with blind spots for underrepresented attack classes under non-IID data. The maximum relative Macro F1 improvements reach 25.01% and 20.79%, respectively. At on the ROAD dataset and on the HCRL Car-Hacking dataset, the maximum reconstruction advantage is 4.22% and 5.47%, respectively. The cloud-side teachers also achieve 95.70%–96.95% accuracy on proxy samples corresponding to selected low-confidence windows.
REFERENCES
[1] Y. Liu et al., “Vehicular intrusion detection system for controller area network: A comprehensive survey and evaluation,” IEEE Trans. Intell. Transp. Syst., vol. 26, no. 7, pp. 10979–11009, Jul. 2025, doi: 10.1109/TITS.2025.3567940.
[2] K.-T. Cho and K. G. Shin, “Viden: Attacker identification on in-vehicle networks,” in Proc. 2017 ACM SIGSAC Conf. Comput. Commun. Security (CCS), Dallas, TX, USA, Oct. 2017, pp. 1109–1123, doi: 10.1145/3133956.3134001.
[3] V. Tanksale, “Intrusion detection system for controller area network,” Cybersecurity, vol. 7, no. 1, Feb. 2024, Art. no. 4, doi: 10.1186/s42400-023-00195-4.
[4] H. M. Song, H. R. Kim, and H. K. Kim, “Intrusion detection system based on the analysis of time intervals of CAN messages for in-vehicle network,” in Proc. 2016 Int. Conf. Inf. Netw. (ICOIN), Kota Kinabalu, Malaysia, Jan. 2016, pp. 63–68, doi: 10.1109/ICOIN.2016.7427089.
[5] H. M. Song, J. Woo, and H. K. Kim, “In-vehicle network intrusion detection using deep convolutional neural network,” Veh. Commun., vol. 21, Jan. 2020, Art. no. 100198, doi: 10.1016/j.vehcom.2019.100198.
[6] Y. L. Aung, W. Cahyadi, and J. Zhou, “CANDIDS: CAN/CAN-FD deep learning-based intrusion detection systems,” in Proc. 11th ACM Cyber-Phys. Syst. Security Workshop (CPSS), Hanoi, Vietnam, Aug. 2025, pp. 74–86, doi: 10.1145/3709017.3737713.
[7] W. Aljabri, M. A. Hamid, and R. Mosli, “Lightweight and adaptive data-driven intrusion detection system for autonomous vehicles,” IEEE Trans. Intell. Transp. Syst., vol. 26, no. 2, pp. 2282–2292, Feb. 2025, doi: 10.1109/TITS.2024.3509459.
[8] H. Xu et al., “MULSAM: Multidimensional attention with hardware acceleration for efficient intrusion detection on vehicular CAN bus,” IEEE Trans. Comput.-Aided Design Integr. Circuits Syst., vol. 44, no. 9, pp. 3274–3288, Sep. 2025, doi: 10.1109/TCAD.2025.3541566.
[9] Y. Jeong, H. Kim, S. Lee, W. Choi, D. H. Lee, and H. J. Jo, "In-vehicle network intrusion detection system using CAN frame-aware features," IEEE Trans. Intell. Transp. Syst., vol. 25, no. 5, pp. 3843–3853, May 2024, doi: 10.1109/TITS.2023.3323622.
[10] H. Kang, T. Vo, H. K. Kim, and J. B. Hong, “CANival: A multimodal approach to intrusion detection on the vehicle CAN bus,” Veh. Commun., vol. 50, Dec. 2024, Art. no. 100845, doi: 10.1016/j.vehcom.2024.100845.
[11] M. H. Shahriar, Y. Xiao, P. Moriano, W. Lou, and Y. T. Hou, “CAN-Shield: Deep-learning-based intrusion detection framework for controller area networks at the signal level,” IEEE Internet Things J., vol. 10, no. 24, pp. 22 111–22 127, Dec. 2023, doi: 10.1109/JIOT.2023.3303271.
[12] Z. Deng, J. Liu, Y. Xun, and J. Qin, “IdentifierIDS: A practical voltage-based intrusion detection system for real in-vehicle networks,” IEEE Trans. Inf. Forensics Security, vol. 19, pp. 661–676, 2024, doi: 10.1109/TIFS.2023.3327026.
[13] Z. Deng, X. Zheng, J. Qin, and J. Liu, “VSSIDS: A novel intrusion detection scheme based on signal stretching for in-vehicle networks,” in Proc. IEEE Global Commun. Conf. (GLOBECOM), Taipei, Taiwan, Dec. 2025, pp. 955–960, doi: 10.1109/GLOBECOM59602.2025.11432296.
[14] W. Liu, G. Qin, Y. Liang, J. Song, Q. Liu, and X. Zhou, “ETFIDS: An entropy-driven, time-frequency analysis framework for in-vehicle CAN signal intrusion detection,” IEEE Internet Things J., vol. 12, no. 12, pp. 21507–21522, Jun. 2025, doi: 10.1109/JIOT.2025.3547575.
[15] Y. Zhang, J. Song, Y. Sun, Z. Gao, Z. Hu, and M. Sun, “Federated two-stage Transformer-based network for intrusion detection in non-IID data of controller area networks,” Cybersecurity, vol. 8, no. 1, May 2025, Art. no. 29, doi: 10.1186/s42400-024-00329-2.
[16] M. Abdel-Basset, N. Moustafa, H. Hawash, I. Razzak, K. M. Sallam, and O. M. Elkomy, “Federated intrusion detection in blockchain-based smart transportation systems,” IEEE Trans. Intell. Transp. Syst., vol. 23, no. 3, pp. 2523–2537, Mar. 2022, doi: 10.1109/TITS.2021.3119668.
[17] M. Chen, B. Wu, H. Sun, and Z. Wang, “FedGAN-ID: Federated-learning-based intrusion detection for in-vehicle network using GANs,” IEEE Internet Things J., vol. 12, no. 17, pp. 36 155–36 167, Sep. 2025, doi: 10.1109/JIOT.2025.3580537.
[18] T. Zhang et al., “Hybrid transfer and self-supervised learning approaches in neural networks for intelligent vehicle intrusion detection and analysis,” IEEE Internet Things J., vol. 12, no. 7, pp. 7677–7692, Apr. 2025, doi: 10.1109/JIOT.2024.3518636.
[19] J. Qin, Y. Xun, and J. Liu, “CVMIDS: Cloud–vehicle collaborative intrusion detection system for Internet of Vehicles,” IEEE Internet Things J., vol. 11, no. 1, pp. 321–332, Jan. 2024, doi: 10.1109/JIOT.2023.3318181.
[20] E. Nwafor and H. Olufowobi, “CANBERT: A language-based intrusion detection model for in-vehicle networks,” in Proc. 21st IEEE Int. Conf. Mach. Learn. Appl. (ICMLA), Nassau, Bahamas, Dec. 2022, pp. 294–299, doi: 10.1109/ICMLA55696.2022.00048.
[21] N. Alkhatib, M. Mushtaq, H. Ghauch, and J.-L. Danger, “CAN-BERT do it? Controller area network intrusion detection system based on BERT language model,” in Proc. 19th IEEE/ACS Int. Conf. Comput. Syst. Appl. (AICCSA), Abu Dhabi, United Arab Emirates, Dec. 2022, pp. 1–8, doi: 10.1109/AICCSA56895.2022.10017800.
[22] X. Li and H. Fu, “SecureBERT and Llama 2 empowered control area network intrusion detection and classification,” IEEE Trans. Intell. Transp. Syst., vol. 26, no. 10, pp. 15248–15263, Oct. 2025, doi: 10.1109/TITS.2025.3596915.
[23] A. Taylor, N. Japkowicz, and S. Leblanc, “Frequency-based anomaly detection for the automotive CAN bus,” in Proc. World Congr. Ind. Control Syst. Security (WCICSS), London, U.K., Dec. 2015, pp. 45–49, doi: 10.1109/WCICSS.2015.7420322.
[24] F. Amato, L. Coppolino, F. Mercaldo, F. Moscato, R. Nardone, and A. Santone, “CAN-bus attack detection with deep learning,” IEEE Trans. Intell. Transp. Syst., vol. 22, no. 8, pp. 5081–5090, Aug. 2021, doi: 10.1109/TITS.2020.3046974.
[25] B. Lampe and W. Meng, “Intrusion detection in the automotive domain: A comprehensive review,” IEEE Commun. Surveys Tuts., vol. 25, no. 4, pp. 2356–2426, Fourth quarter 2023, doi: 10.1109/COMST.2023.3309864.
[26] C. I. Nwakanma et al., “Explainable artificial intelligence (XAI) for intrusion detection and mitigation in intelligent connected vehicles: A review,” Appl. Sci., vol. 13, no. 3, Jan. 2023, Art. no. 1252, doi: 10.3390/app13031252.
[27] A. Vaswani et al., “Attention is all you need,” in Proc. Adv. Neural Inf. Process. Syst. (NIPS), vol. 30, Long Beach, CA, USA, Dec. 2017, pp. 5998–6008. Accessed: Sep. 2, 2026. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html
[28] E. J. Hu et al., “LoRA: Low-rank adaptation of large language models,” in Proc. Int. Conf. Learn. Represent. (ICLR), Virtual Event, Apr. 2022. Accessed: Sep. 2, 2026. [Online]. Available: https://openreview.net/forum?id=nZeVKeeFYf9
[29] K. Balasubramanian et al., “CANLP: Intrusion detection for controller area networks using natural language processing and embedded machine learning,” IEEE Trans. Dependable Secure Comput., vol. 22, no. 6, pp. 7203–7214, Nov. 2025, doi: 10.1109/TDSC.2025.3596516.
[30] M. Fu, P. Wang, M. Liu, Z. Zhang, and X. Zhou, “IoV-BERT-IDS: Hybrid network intrusion detection system in IoV using large language models,” IEEE Trans. Veh. Technol., vol. 74, no. 2, pp. 1909–1921, Feb. 2025, doi: 10.1109/TVT.2024.3402366.
[31] G. Asaouer and D. E. Boubiche, “Generative AI-based intrusion detection systems for intra-vehicle networks,” Ad Hoc Netw., vol. 180, Jan. 2026, Art. no. 104031, doi: 10.1016/j.adhoc.2025.104031.
[32] S. Woo, H. J. Jo, and D. H. Lee, “A practical wireless attack on the connected car and security protocol for in-vehicle CAN,” IEEE Trans. Intell. Transp. Syst., vol. 16, no. 2, pp. 993–1006, Apr. 2015, doi: 10.1109/TITS.2014.2351612.
[33] J. Sun, S. Iqbal, N. Seifollahpour Arabi, and M. Zulkernine, “A classification of attacks to in-vehicle components (IVCs),” Veh. Commun., vol. 25, Oct. 2020, Art. no. 100253, doi: 10.1016/j.vehcom.2020.100253.
[34] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A. C. Courville, “Improved training of Wasserstein GANs,” in Proc. Adv. Neural Inf. Process. Syst. (NIPS), vol. 30, Long Beach, CA, USA, Dec. 2017, pp. 5767–5777. Accessed: Sep. 2, 2026. [Online]. Available: https://proceedings.neurips.cc/paper_files/paper/2017/hash/892c3b1c6dcded52936e27cbd0ff683d6-Abstract.html
[35] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of deep bidirectional Transformers for language understanding,” in Proc. Conf. North Amer. Chapter Assoc. Comput. Linguistics: Hum. Lang. Technol. (NAACL-HLT), vol. 1, Minneapolis, MN, USA, Jun. 2019, pp. 4171–4186, doi: 10.18653/v1/N19-1423.
[36] G. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” arXiv:1503.02531, Mar. 2015. Accessed: Sep. 2, 2026. [Online]. Available: https://arxiv.org/abs/1503.02531
[37] C. Sun, H. Li, Y. Li, and S. Hong, “TEST: Text prototype aligned embedding to activate LLM’s ability for time series,” in Proc. Int. Conf. Learn. Represent. (ICLR), Vienna, Austria, May 2024. Accessed: Sep. 2, 2026. [Online]. Available: https://openreview.net/forum?id=Tuh4nZVb0g
[38] Y. Chen, Z. Li, C. Yang, X. Wang, and G. Xu, “Large language models are few-shot multivariate time series classifiers,” Data Min. Knowl. Discov., vol. 39, no. 5, Aug. 2025, Art. no. 66, doi: 10.1007/s10618-025-01145-z.
[39] E. Seo, H. M. Song, and H. K. Kim, “GIDS: GAN based intrusion detection system for in-vehicle network,” in Proc. 16th Annu. Conf. Privacy, Security Trust (PST), Belfast, U.K., Aug. 2018, pp. 1–6, doi: 10.1109/PST.2018.8514157.
[40] M. E. Verma et al., “A comprehensive guide to CAN IDS data and introduction of the ROAD dataset,” PLoS One, vol. 19, no. 1, Jan. 2024, Art. no. e0296879, doi: 10.1371/journal.pone.0296879.
[41] K. Zhang, W. Zuo, Y. Chen, D. Meng, and L. Zhang, “Beyond a Gaussian denoiser: Residual learning of deep CNN for image denoising,” IEEE Trans. Image Process., vol. 26, no. 7, pp. 3142–3155, 2017, doi: 10.1109/TIP.2017.2662206.
[42] Z. Wang et al., “Task-oriented training data privacy protection for cloud-based model training,” in Proc. 34th USENIX Security Symp. (USENIX Security), Seattle, WA, USA, Aug. 2025, pp. 3123–3140. [Online]. Available: https://www.usenix.org/conference/usenixsecurity25/presentation/wang-zhiqiang