Domain adaptive and graph perception pruning lightweight intrusion detection method for Internet of Vehicles
By employing domain-adaptive feature selection and graph-aware hierarchical pruning techniques, the problems of heterogeneous data and limited resources in the Internet of Vehicles are solved, improving detection accuracy and real-time performance, and achieving lightweight intrusion detection.
Patent Information
- Application Number
- CN202511768108.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-10
AI Technical Summary
The Internet of Vehicles (IoV) faces challenges such as significant differences in heterogeneous data domains, limited computing power and memory of onboard terminals, and the difficulty of effectively detecting collaborative attacks using existing methods. Furthermore, existing lightweight models lack awareness of the IoV domain characteristics and graph structure, resulting in significant loss of detection accuracy and failing to meet real-time requirements.
We employ domain-adaptive feature selection, a detection engine that integrates topology awareness and temporal patterns, and graph-aware hierarchical pruning techniques. We use the FCBFiP algorithm for feature filtering and cross-domain mapping, the VTR-LightGBM engine for topology-aware encoding and temporal pattern extraction, and graph neural networks for node importance assessment and hierarchical pruning to achieve adaptive resource deployment.
It improves the model's adaptability in multiple scenarios, enhances its ability to identify collaborative attacks and time-dependent attacks, and achieves lightweight model and real-time detection, meeting the real-time intrusion detection needs of the Internet of Vehicles.
Smart Images

Figure CN121509014A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle networking, specifically to a lightweight intrusion detection method for vehicle networking using domain adaptation and graph-aware pruning. Background Technology
[0002] As a core component of intelligent transportation systems, the Internet of Vehicles (IoV) integrates heterogeneous data from multiple sources, including CAN bus, V2X communication, and GPS. However, its open communication environment and resource-constrained vehicle terminals present three major challenges to traditional intrusion detection methods: First, the heterogeneous data domains differ significantly, leading to prominent cross-domain feature distribution shifts, making it difficult for single-domain models to adapt to IoV data across various scenarios. Second, vehicle terminals (such as OBUs and ECUs) have limited computing power and memory, making it difficult to deploy complex deep learning models. Third, existing methods often neglect the integration of IoV communication topology and temporal patterns, making it difficult to effectively detect coordinated attacks targeting specific subsystems. Although existing lightweight models attempt to compress parameters through pruning, they lack awareness of IoV domain characteristics and graph structures, resulting in significant accuracy loss after pruning and failing to meet real-time detection requirements. Summary of the Invention
[0003] To address the problems of existing technologies, this invention provides a lightweight intrusion detection method based on domain adaptation and graph-aware pruning for vehicle-to-everything (V2X) networks.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] A lightweight intrusion detection method based on domain adaptation and graph-aware pruning for vehicle-to-everything (V2X) communication includes the following steps:
[0006] a) Domain Adaptive Feature Selection: The FCBFiP algorithm is used to perform feature filtering, cross-domain mapping, and importance ranking on heterogeneous data of the Internet of Vehicles, and output a key feature set that is adapted to the target domain;
[0007] b) Detection engine integrating topology awareness and temporal pattern: The key feature set is topology-aware encoded to generate network topology features through the VTR-LightGBM engine, and intrusion behavior is detected by combining the temporal pattern extraction model, and preliminary detection results are output.
[0008] c) Graph-aware hierarchical pruning: Based on the graph structure, the importance of nodes in the detection engine is evaluated, and a hierarchical pruning strategy is adopted to remove non-critical computing nodes, thereby achieving adaptive deployment of vehicle terminal resources and outputting a lightweight detection model and the final intrusion detection results.
[0009] The FCBFiP algorithm includes the following sub-steps:
[0010] a) Feature correlation filtering: Calculate the Pearson correlation coefficient between the features of the source domain and the target domain, and filter out redundant features whose correlation coefficient is lower than a preset threshold;
[0011] b) Cross-domain feature mapping: An adversarial learning mechanism is used to construct a domain adaptive mapping function, which maps the feature space of the source domain to the feature space of the target domain according to the differences in the vehicle network domain;
[0012] c) Feature importance ranking: The importance of the mapped features is scored based on the LightGBM model, and the top N features with the highest scores are selected to form a key feature set, where N≤30.
[0013] The adversarial learning mechanism employs a game-like training approach between a domain discriminator and a feature extractor. The domain discriminator, targeting the domain labels of the Internet of Vehicles, minimizes the difference in feature distribution between the source and target domains.
[0014] The VTR-LightGBM engine includes:
[0015] a) Topology-aware coding unit: Generates an adjacency matrix based on the communication topology of the vehicle network, and generates node feature vectors by combining node attributes;
[0016] b) Temporal pattern extraction unit: The time series data is segmented using the sliding window technique, and the temporal features are extracted using the LightGBM model;
[0017] c) Fusion Detection Unit: Inputs topological features and temporal features into the LightGBM classifier and outputs detection results for vehicle network intrusion types;
[0018] 5. The method according to claim 4, wherein the topology-aware coding unit uses the GraphSAGE algorithm to generate node embedding vectors, and the temporal pattern extraction unit uses a 10-second sliding window to segment the temporal data.
[0019] The graph-aware hierarchical pruning includes:
[0020] a) Node importance assessment: The centrality index of each node is calculated based on a graph neural network to assess the contribution of each node to the vehicle network intrusion detection task;
[0021] b) Layered pruning strategy: Nodes are divided according to the model calculation layer. Non-critical layer nodes with a contribution value lower than the preset threshold are pruned first, while core calculation nodes related to CAN bus and V2X communication are retained.
[0022] c) Resource adaptive deployment: Based on the CPU and memory resource limitations of the vehicle terminal (e.g., strengthen pruning when CPU utilization is ≥70%), dynamically adjust the degree of pruning to generate a lightweight model adapted to different terminals.
[0023] The centrality index includes a weighted combination of degree centrality, betweenness centrality, and proximity centrality.
[0024] Compared with existing technologies, the beneficial effects of this invention are: 1) The domain-adaptive feature selection mechanism effectively solves the problem of cross-domain distribution offset of heterogeneous data in the Internet of Vehicles, improving the adaptability of the model in multiple scenarios; 2) The detection engine that integrates topology perception and temporal pattern enhances the ability to identify cooperative attacks and temporally dependent attacks, and the detection accuracy is improved by more than 15% compared with traditional methods; 3) The graph perception hierarchical pruning strategy realizes model lightweighting, with a parameter compression ratio of up to 70%, adapting to the resource-constrained characteristics of vehicle terminals; 4) The resource-adaptive deployment mechanism can dynamically adjust the model size according to the terminal CPU and memory status, balancing detection accuracy and system overhead; 5) The overall solution has a response time of less than 100ms, meeting the real-time intrusion detection requirements of the Internet of Vehicles. Attached Figure Description
[0025] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings.
[0026] Figure 1 This is the overall flow chart of the present invention.
[0027] Figure 2 This is a diagram of the VTR-LightGBM algorithm of this invention. Detailed Implementation
[0028] The present invention will be further described in detail below through embodiments. These embodiments are only used to illustrate the present invention and do not limit the scope of the present invention.
[0029] A lightweight intrusion detection method based on domain adaptation and graph-aware pruning for vehicle-to-everything (V2X) communication includes the following steps:
[0030] a) Domain Adaptive Feature Selection: The FCBFiP algorithm is used to perform feature filtering, cross-domain mapping, and importance ranking on heterogeneous data of the Internet of Vehicles (such as CAN bus messages, GPS trajectories, and RSU communication data), and output a key feature set that adapts to the target domain.
[0031] b) Detection engine integrating topology awareness and temporal pattern: The key feature set is topology-aware encoded (based on the communication topology of OBU, RSU, and cloud nodes) using the VTR-LightGBM engine to generate network topology features, and intrusion behavior is detected by combining the temporal pattern extraction model, and preliminary detection results are output.
[0032] c) Graph-aware hierarchical pruning: Based on the graph structure, the detection engine is evaluated for node importance, and a hierarchical pruning strategy is adopted to remove non-critical computing nodes, realize adaptive deployment of vehicle terminal (such as OBU) resources, and output a lightweight detection model and the final intrusion detection results.
[0033] The FCBFiP algorithm includes the following sub-steps:
[0034] a) Feature correlation filtering: Calculate the Pearson correlation coefficient between features of the source domain (such as laboratory simulation data) and the target domain (such as actual vehicle environment data), and filter out redundant features with correlation coefficients lower than a preset threshold;
[0035] b) Cross-domain feature mapping: An adversarial learning mechanism is used to construct a domain adaptive mapping function to map the source domain feature space to the target domain feature space based on the differences in the vehicle network domain (such as the differences in CAN bus protocols between different vehicle models);
[0036] c) Feature importance ranking: The importance of the mapped features is scored based on the LightGBM model, and the top N features with the highest scores are selected to form a key feature set, where N≤30 (to adapt to the computing power of the vehicle terminal).
[0037] The adversarial learning mechanism employs a game-like training approach between the domain discriminator and the feature extractor. The domain discriminator targets the domain labels of the Internet of Vehicles (such as the ECU data domains of different car manufacturers) and minimizes the difference in feature distribution between the source domain and the target domain.
[0038] The VTR-LightGBM engine includes:
[0039] a) Topology-aware coding unit: Generates an adjacency matrix based on the communication topology of the vehicle network (such as V2V and V2I connections), and generates node feature vectors by combining node attributes (such as OBU ID and RSU location);
[0040] b) Temporal pattern extraction unit: The time series data is segmented using the sliding window technique (window size is 1-10 seconds to adapt to the real-time requirements of vehicle networking), and the temporal features are extracted using the LightGBM model;
[0041] c) Fusion Detection Unit: Inputs topological features and temporal features into the LightGBM classifier and outputs detection results for vehicle network intrusion types (such as CAN injection attacks and DDoS attacks);
[0042] The topology-aware coding unit uses the GraphSAGE algorithm to generate node embedding vectors (adapting to the dynamic topology of the vehicle network), and the temporal pattern extraction unit uses a 10-second sliding window to segment temporal data (adapting to the 1Hz sampling rate of vehicle data).
[0043] Image-aware layered pruning includes:
[0044] a) Node importance assessment: Based on graph neural networks, calculate the centrality index of each node to assess the contribution of each node to the vehicle network intrusion detection task (e.g., attack detection-related nodes have higher weights).
[0045] b) Layered pruning strategy: Nodes are divided according to the model calculation layer. Non-critical layer nodes with a contribution value lower than the preset threshold are pruned first, while core calculation nodes related to CAN bus and V2X communication are retained.
[0046] c) Resource adaptive deployment: Based on the CPU and memory resource limitations of the vehicle terminal (e.g., strengthen pruning when CPU utilization is ≥70%), dynamically adjust the degree of pruning to generate a lightweight model adapted to different terminals.
[0047] Centrality metrics include a weighted combination of degree centrality, betweenness centrality, and proximity centrality, with weight allocation taking into account the role of vehicle network nodes (e.g., RSU nodes have a higher weight for betweenness centrality).
[0048] The specific implementation of this method in the Internet of Vehicles includes the following steps:
[0049] 1. Preprocessing of heterogeneous data in the Internet of Vehicles: Cleaning and standardizing heterogeneous data from multiple sources such as OBU, RSU, and cloud platform (e.g., CAN bus messages, GPS trajectories, network traffic) in the Internet of Vehicles to provide high-quality input for domain adaptive feature selection;
[0050] 2. Edge-Cloud Collaborative Deployment: Deploy lightweight detection models on in-vehicle edge devices (such as intelligent OBUs) to achieve low-latency detection, while the cloud retains the complete model for global threat analysis and model updates, and synchronizes with edge devices via OTA.
[0051] 3. Dynamic mode switching: Based on the load of the vehicle network (such as vehicle density during peak hours), different pruning modes are automatically triggered to balance detection accuracy and resource consumption. For example, a fast decision mode can be enabled to reduce latency in high-speed moving scenarios.
[0052] The system sequentially filters key features through domain adaptive feature engineering, captures attack patterns through temporal topology enhancement models, and compresses model size through graph-aware pruning, ultimately achieving dynamic adaptive deployment in the vehicle environment.
[0053] Among them, intelligent feature engineering for heterogeneous data in the Internet of Vehicles:
[0054] This scheme proposes the FCBFiP algorithm, which achieves intelligent feature selection through three major mechanisms: data distribution awareness, dynamic resource allocation, and attack mode adaptation. Given a feature set... Given the label Y, the goal is to select the feature subset that has the highest relevance to the label and the lowest redundancy between features. FCBFiP employs a three-stage progressive process: information gain pre-screening, dynamic symmetric uncertainty filtering, and kernel principal component dimensionality reduction.
[0055] In the first stage of the FCBFiP algorithm, this scheme first implements an information gain pre-screening mechanism to initially evaluate the predictive ability of features. This scheme uses information gain to quantify the contribution of each feature xᵢ to the classification task, as shown in the formula: The entropy H(Y) of the label is defined as follows: K is the total number of categories. For category The probability of this, expressed by the formula, reflects the uncertainty of the category distribution. Conditional entropy. Then through the formula We obtain, where J is the feature. The number of possible values, For feature values The probability of.
[0056] To enhance the data adaptability of FCBFiP, this scheme further introduces a domain-adaptive strategy and a continuous feature discretization mechanism. This scheme automatically detects the domain to which the data belongs based on the number of features, n, and implements a domain-adaptive feature preservation strategy. For low-dimensional time-series data, a conservative strategy is used to retain a higher proportion of features; for high-dimensional statistical data, a standard strategy is used to filter redundant features; and for transitional domains between these two, a linear interpolation strategy is used for smooth transition. For continuous features, when the number of unique values exceeds a threshold... At that time, the equal-frequency binning method is used to discretize it into... Each interval, the container boundary passes through calculate, ,in Indicates the first Each container boundary, Representation of features The percentile.
[0057] To address the prevalent class imbalance problem in real-world network traffic, this solution integrates a weighted information gain mechanism and attack-aware weight calculation into FCBFiP. The system uses formulas... Calculate the weighted information gain, where The category balance adjustment factor is defined as follows: The parameters within. For attack-aware weights, For an unbalanced proportion, it is defined as . This represents the number of samples in category k, which is the ratio of the number of samples in the largest class to the number of samples in the smallest class. When At that time, the information gain threshold is automatically adjusted to 50% of its original value. Attack perception weight. Through formula The variance of the analyzed features is calculated under different attack types. Features Mean variance across all attack types = 0.5 is the magnification factor. The final number of features retained. pass Sure, For the domain-related retention ratio, This represents the upper limit of the maximum number of features. Imbalance Ratio (IR): In the formula, IR = number of samples in the largest class / number of samples in the smallest class.
[0058] Example parameters: Assuming the vehicle network dataset contains 10,000 normal CAN bus messages and 500 attack messages, then IR=20. In this case, the information gain threshold is automatically adjusted to 50% of its original value, prioritizing features related to attacks. Attack awareness weight (W_attack): In the formula, W_attack=0.5×mean variance of the feature across attack types. Example parameters: If a feature (such as "message interval time") has a variance of 0.8 under a DDoS attack and 0.2 under normal scenarios, then the mean variance = 0.5, W_attack = 0.5×0.5=0.25, and this feature will be assigned a higher weight.
[0059] Number of features retained (k): In the formula, k = min(β × n, M) (β is the domain retention ratio, n is the original number of features, and M is the maximum upper limit of the number of features). Example parameters: For low-dimensional time-series data of vehicle networking (such as GPS trajectory), β = 0.8, the original number of features n = 50, and M = 30, then k = min(50 × 0.8, 30) = 30, and finally 30 key features are retained.
[0060] After initial screening, FCBFiP enters its second phase, balancing feature correlation and redundancy through a dynamic symmetric uncertainty filtering mechanism. For features... and Symmetric uncertainty is defined as Its value range is [0, 1]. The core innovation of FCBFiP lies in its dynamic threshold calculation mechanism, which allows the system to monitor CPU utilization in real time. and memory usage The threshold is adaptively adjusted based on resource levels. Dynamic threshold. The calculation formula is .in Based on the threshold, = 0.5 and γ = 0.3 are resource impact coefficients. Adjustment factor for data distribution. When resources are sufficient ( < 0.4 and When < 0.5), the threshold is kept at a low level of 0.01 to maximize feature quality; when resources are limited ( > 0.7 or When the threshold is greater than 0.8, the threshold is automatically increased to 0.02-0.03 to reduce computational overhead. Dynamic threshold (T): In the formula T=β×(1-α×u-γ×v) (β is the base threshold, u is the CPU utilization rate, v is the memory utilization rate, and α / γ is the resource impact coefficient).
[0061] Case parameters: For the vehicle-mounted OBU device, the base threshold β = 0.05, CPU utilization u = 0.6, memory utilization v = 0.7, α = 0.5, γ = 0.3. Therefore, T = 0.05 × (1 - 0.5 × 0.6 - 0.3 × 0.7) = 0.05 × 0.49 ≈ 0.0245. In this case, the threshold is increased to filter out more redundant features and save resources. Symmetric uncertainty (SU): If the mutual information IG between the feature "network traffic" and the label "attack" is 0.6, the feature entropy H(X) = 1.2, and the label entropy H(Y) = 0.8, then SU = 2 × (0.6 / (1.2 + 0.8)) = 0.6. If the dynamic threshold T = 0.0245, this feature will be retained.
[0062] To enable FCBFiP to better adapt to different data distribution characteristics, this scheme designs a data distribution sensing mechanism based on skewness and kurtosis. The data distribution sensing mechanism calculates the skewness of the features. Kurt(xᵢ) is used to identify distribution types, and the skewness formula is... The kurtosis formula is Where μ and σ are the mean and standard deviation, respectively. When more than 30% of the features satisfy... The distribution is determined to be highly skewed, and the distribution adjustment factor is set to [value missing]. When more than 30% of the features satisfy It is determined to be a heavy-tailed distribution. = 0.9; other cases = 1.0.
[0063] In the dynamic filtering phase, FCBFiP employs a forward greedy strategy to systematically eliminate feature redundancy. Firstly, through the formula... The symmetric uncertainty of the features and labels is calculated, and the features are then processed by thresholding. Candidate set obtained by sorting in descending order Then check them one by one, for the current feature If a selected feature exists Make If x'ᵢ is redundant, it is marked as redundant and removed. The final output feature subset S satisfies: To ensure that the correlation between the selected features and the labels is higher than the redundancy between features, for network traffic data (high-dimensional statistics): calculate the symmetric uncertainty between statistical features such as traffic mean and abnormal packet ratio and the labels, and check the redundancy between features one by one after screening the candidate set—if the symmetric uncertainty between the current network feature and the selected features is too high (information duplication), remove the redundant features and retain the key statistical features related to the attack;
[0064] The final output feature subset strictly satisfies the constraint that "the correlation between features and labels is higher than the redundancy between features". This not only compresses the feature dimensions of heterogeneous data in the Internet of Vehicles (to adapt to the resource limitations of vehicle terminals), but also ensures that the core features that are strongly related to intrusion detection in the CAN bus and network domain are retained, providing efficient input for subsequent lightweight detection models.
[0065] Finally, FCBFiP further extracts nonlinear feature relationships and completes the final feature optimization through the third stage of kernel principal component dimensionality reduction. The kernel principal component dimensionality reduction stage optimizes the selected feature subset. Kernel principal component analysis is used to capture nonlinear relationships. The kernel matrix K is constructed using the Gaussian radial basis function. .in For bandwidth parameters, via Automatically determined. After centering, the kernel matrix undergoes eigenvalue decomposition. The number of principal components, k, is determined using the cumulative variance contribution rate formula: .in The variance retention ratio is determined adaptively by the system based on the attack variance. When the attack mean variance A variance < 0.5 indicates a low variance pattern. = 0.99; when 0.5 ≤ A variance of < 1.5 indicates a moderate variance model. = 0.95; when A variance ≥ 1.5 indicates a high variance pattern. =0.90.
[0066] When the number of samples N exceeds the threshold of 10,000, the system automatically switches to incremental principal component analysis to avoid memory overflow. Data is processed in batches, with a batch size of 1,000. The final dimensionality reduction reduces the feature dimension from the original m to k, with a typical compression ratio of [missing value]. .
[0067] The time complexity of the FCBFiP algorithm is... The space complexity is Compared to traditional feature engineering methods, FCBFiP has three key advantages. First, its domain adaptation mechanism effectively solves the problem of data heterogeneity. Second, its dynamic threshold mechanism achieves an optimal trade-off between accuracy and resources. Third, its attack-aware weights significantly improve the detection capability across multiple attack scenarios.
[0068] VTR-LightGBM algorithm-driven time-aware and topology coding architecture
[0069] Traditional intrusion detection methods face three major challenges in the connected vehicle environment. First, a single model struggles to cope with diverse attack patterns, as the feature distributions of different attack types vary significantly. Second, they lack time-series awareness and cannot capture the time dependencies of CAN bus data. Third, they lack understanding of the topology and ignore the domain knowledge of the vehicle network. While the LightGBM algorithm has advantages such as fast training speed, low memory consumption, and support for parallel computing, its standard implementation is not optimized for the characteristics of connected vehicles.
[0070] This solution proposes a lightweight gradient boosting machine (VTR-enhanced Light Gradient Boosting Machine, VTR-LightGBM) algorithm that integrates vehicle topology recognition (VTR). The algorithm flowchart is shown below. Figure 2 As shown, this algorithm integrates three technologies: time-series awareness mechanism, vehicle topology coding, and adversarial training. It also employs a dual-domain fusion detection architecture, performing differentiated modeling for the two core domains of CAN bus and network traffic to achieve a layered and progressive detection strategy.
[0071] To address the problem that traditional methods often treat different types of data as independent samples and lose information in the time dimension, VTR-LightGBM has designed a dedicated time-series perception module for the time-series characteristics of vehicle-to-everything (V2X) data.
[0072] Fixed time series number The system extracts three types of time-series features: time interval features, rate of change features, and trend features. These three types of features characterize the temporal patterns of the data from different perspectives, with the aim of enabling the model to understand the evolutionary patterns of attack behavior over time.
[0073] The temporal trend coefficient, as one of the key temporal features of VTR-LightGBM, is calculated using an adaptive sliding window. Due to the differences in temporal characteristics across different attack scenarios, the system dynamically adjusts the window size based on data complexity. The formula for defining data complexity is as follows: ,when Lightweight mode is used. ;when Standard mode is used at that time ;when Use full mode at this time For CAN bus data, considering its inherent 10ms cycle characteristic, it is preferable to choose... Network traffic data is dynamically selected from a preset set based on the burst characteristics of traffic, thereby balancing computational overhead and accuracy assurance. For time intervals... The trend coefficient is defined as ,in For linearly decreasing weights, This represents the mean value within the window.
[0074] Time interval characteristic formula As a complementary feature to the time-series trend coefficient, it can directly capture the time-series pattern of message arrival. The system uses a formula... The time interval between adjacent messages is calculated, and further interval statistics (mean, variance, maximum / minimum) are extracted and input into VTR-LightGBM. This feature has a strong ability to distinguish between periodic attacks and anomalous temporal behavior. The rate of change feature is used to quantify the degree of data volatility, and its calculation formula is as follows: ,in To prevent small constants from being divided by zero.
[0075] Periodicity is a typical characteristic of many attack behaviors. To capture this periodic pattern, VTR-LightGBM introduces autocorrelation features, using the formula... ,in Lagging covariance, The variance is used to identify the location of autocorrelation peaks. As a periodic indicator, This is the maximum lag order.
[0076] Cyberattacks are often accompanied by sudden changes in communication traffic. To identify this abnormal communication pattern, VTR-LightGBM has designed a burst detection mechanism. A burst event is defined as one that meets the following criteria: The formula for calculating the outbreak rate is as follows: [Formula omitted for brevity] ,in This represents the total number of incidents. Detected incident patterns can serve as important indicators of attack behavior.
[0077] The predictions of a model over time series often exhibit a certain degree of continuity; drastic fluctuations often indicate misjudgments. Therefore, the temporal consistency constraint mechanism in the VTR-LightGBM algorithm improves detection stability by analyzing the continuity of predictions at adjacent time points. The formula for calculating the smoothed prediction value is as follows: ,in This is the original prediction for the current moment. For history The arithmetic mean of the prediction results at each time point. This is a time-series smoothing factor. The system predicts jumps by detecting them. Trigger smoothing processing when Timing smoothing is enabled at this time.
[0078] Attack methods in the connected vehicle environment are constantly evolving, requiring models to quickly adapt to new attacks. To address this, VTR-LightGBM employs a lightweight online update mechanism. The system maintains a sliding window buffer, collecting new data streams in real time. Incremental learning updates are triggered when model performance degradation is detected (accuracy drops beyond a preset threshold) or when the buffer accumulates sufficient samples. The update process borrows a rapid adaptation strategy from meta-learning frameworks: sampling support and query sets from the buffer, fine-tuning the model using a small number of gradient descent steps on the support set, and then validating the update effect on the query set. This mechanism achieves rapid adaptation with low computational overhead, balancing model timeliness with system resource consumption. For completely unknown threats like zero-day attacks, the system pre-builds robust reserves using adversarial example generation techniques. By controlling the perturbation intensity, diverse adversarial examples are generated, enhancing the model's generalization ability to unknown threats.
[0079] Vehicle networks have a well-defined topology, with different subsystems performing different functions, and attacks often target specific subsystems. Traditional methods ignore this structural information, treating all features equally. To fully utilize the domain knowledge of vehicle networks, VTR-LightGBM integrates a topology encoder to transform the structural information of the vehicle network into an understandable feature representation. The system predefines four vehicle domains: powertrain domain D1 (corresponding to the CAN ID range [0x100, 0x200)), chassis domain D2 (corresponding to [0x200, 0x300)), body domain D3 (corresponding to [0x300, 0x400)), and driver assistance system domain D4 (corresponding to [0x600, 0x700)). Topological features such as domain activity strength, connectivity characteristics, and CAN ID entropy are designed as important input dimensions for VTR-LightGBM.
[0080] Domain activity intensity reflects the operating status of each subsystem, and its evaluation formula is as follows: .in For the set of feature indices belonging to domain d, These are domain weighting factors set based on safety importance. The powertrain and chassis system weights are set to... = = 1.4, Body System Weight = 1.0, weight of driver assistance system =1.2, This represents the total number of features contained in domain d. These features can identify attack behaviors targeting a specific domain, providing VTR-LightGBM with domain-level attack localization capabilities.
[0081] Connection features are used to quantify the connectivity activity between network nodes. The formulas for calculating connection density (CD) and connection change rate (CR) are as follows: , .in For connection density, For the rate of change of connection, For indicator functions, The mean of the features. CAN ID information entropy quantifies the randomness of the ID distribution: ,in The total number of unique IDs The probability of ID i. Attacks often lead to abrupt changes in network topology, and these characteristics enable VTR-LightGBM to detect attacks from a topology evolution perspective.
[0082] The topological anomaly score is calculated by comparing the current state with the historical baseline, and the formula is as follows: .in and These represent the historical mean and standard deviation of the activity intensity in domain d, respectively. Domain priority vector. Based on the degree of safety criticality, among which , , This integrated anomaly score fuses multi-domain information into a single feature, simplifying the learning task of VTR-LightGBM while preserving domain-level interpretability.
[0083] The convergence of VTR-LightGBM stems from its multi-level optimization strategy design. Two-stage hyperparameter optimization employs the TPE sampler, first optimizing the basic LightGBM parameters (20-30 trials) and then fixing the basic parameters to optimize the timing configuration (10-15 trials), reducing the search space from 10 dimensions to 3 dimensions, improving sample efficiency by approximately 40% while maintaining convergence quality. Adaptive learning rate adjustment is used during training: when the validation accuracy is below 0.7, the learning rate increases to 0.2 to accelerate optimization; when it is above 0.85, it decreases to 0.05 for fine-tuning, coupled with an early stopping strategy (terminating after 10 consecutive rounds of improvement less than 0.001) to prevent overfitting. The topology encoder dynamically selects the enhancement strength based on the data feature dimensions and number of categories. The CAN domain uses a lightweight configuration (6-dimensional features, 1.3x expansion rate), while the network domain uses a standard configuration (10-dimensional features), ensuring controllable feature space expansion. Temporal feature extraction adaptively selects the number of windows (1-3) and feature density based on data complexity, ensuring a linear relationship between temporal dimensionality growth and data complexity, thus avoiding the curse of dimensionality. The adversarial enhancement module, with a 10% sample generation ratio and a perturbation strength of 0.05-0.1, improves robustness while maintaining the stability of the training data distribution, theoretically satisfying the convergence requirement under bounded perturbation conditions. Experimental results show that VTR-LightGBM achieves superior detection performance compared to traditional methods on multiple real-world vehicle networking datasets.
[0084] Image-aware hierarchical pruning and adaptive deployment in the vehicle environment
[0085] While the trained VTR-LightGBM model possesses excellent detection capabilities, its computational complexity and memory consumption still limit its practical deployment on resource-constrained in-vehicle devices. Traditional model pruning methods employ a uniform compression strategy, neglecting the hierarchical characteristics of the model's internal structure and domain knowledge of the vehicle network topology. Furthermore, the resource status of the in-vehicle environment exhibits dynamic fluctuations, making fixed model configurations unsuitable for diverse operational scenarios. This solution proposes a graph-aware hierarchical pruning technique. This technique abstracts the model structure into a computational graph, performs intelligent compression in conjunction with vehicle network topology knowledge, and achieves dynamic resource management through an adaptive mechanism for the in-vehicle environment.
[0086] To achieve graph-aware hierarchical pruning, this solution first abstracts the VTR-LightGBM decision tree set into a hierarchical computational graph structure and defines a quantitative index for node importance. The decision tree set is essentially a hierarchical structure, with different nodes playing significantly different roles in the decision-making process. To achieve precise pruning, the system abstracts the VTR-LightGBM decision tree set into a hierarchical computational graph structure. Each node in the diagram Represents a split node or leaf node in a decision tree, and an edge. Indicates the data flow path. For split nodes... Its importance is determined by the split gain. Quantification: .in The loss is the parent node's loss. and The loss is for the left and right child nodes. , , These represent the number of samples for the corresponding node. The larger the split gain, the more significant the contribution of that node to the classification task.
[0087] After establishing the computational graph structure, this scheme further introduces a graph-theoretic centrality index to comprehensively evaluate the criticality of nodes within the overall structure. The system further calculates the graph-theoretic centrality index of the nodes. Degree centrality is defined as... ,in For nodes The degree of closeness centrality. The formula for calculating closeness centrality is: ,in For nodes arrive The shortest path length. Betweenness centrality is defined as... ,in For nodes arrive The number of shortest paths, For the nodes The number of shortest paths.
[0088] To incorporate vehicle network topology knowledge into pruning decisions, this scheme designs a topology mapping mechanism and a comprehensive importance evaluation formula. For features... nodes Based on the domain affiliation of features Assign safety weights The relevant node weights in the powertrain and chassis system domains are set to... The body system domain is set to The driver assistance system domain is set to The formula for calculating the overall importance of a node is as follows: The weighting coefficient is set to... , , These correspond to three types of centrality indicators.
[0089] After completing the node importance assessment, the graph-aware hierarchical pruning system implements the first pruning strategy in the hierarchical pruning strategy—threshold pruning based on gain analysis. The system integrates four complementary pruning strategies. Threshold pruning based on gain analysis statistically analyzes the split gain distribution of all nodes and calculates the dynamic threshold as defined below. . Based on the target compression ratio Dynamic adjustment to meet A bottom-up traversal approach is used for each node. ,when And sample coverage The time marker is marked as a candidate for pruning. This strategy is fast but relatively coarse.
[0090] To improve the accuracy of pruning decisions, this scheme further implements a precise pruning strategy based on sensitivity assessment. The performance impact of removing nodes based on sensitivity assessment is tested through actual node removal. For the candidate node set... Remove nodes one by one In the validation subset Evaluation of performance changes ,in For the original model, To remove a node The model after that. The sensitivity score is defined as follows: A lower score indicates that the node is more suitable for pruning. This method is accurate but computationally expensive.
[0091] To balance accuracy and efficiency, loss prediction pruning based on Taylor expansion utilizes first- and second-order derivative information to predict the pruning effect. For nodes... Corresponding parameters The change in loss caused by removing this node is approximated by Taylor expansion: .in For the loss function with respect to gradient, This is a Hessian matrix. The degree of pruning is determined by... The higher the evaluation value, the smaller the impact of removing the node on the loss.
[0092] Based on the integration of multiple pruning methods, this scheme designs a differentiated hybrid pruning strategy for different tree depths. For a depth of... The node, when When the layer is shallow, conservative sensitivity pruning is used to ensure the integrity of the main decision path; when When it is an intermediate layer, it combines gain threshold and topological weights; when At a deeper level, a radical Taylor pruning approach is adopted.
[0093] To avoid severe performance degradation caused by a single pruning iteration, graph-aware hierarchical pruning employs a multi-round iterative progressive compression strategy, with the pruning process designed to have a maximum of [number missing] rounds. Rounds of iterations, with the compression ratio controlled at [value missing] in each round. Within. The overall compression ratio is calculated using the following formula: The goal was achieved. Each round of pruning consists of three sub-steps: candidate node selection, safety verification, and conditional removal. To avoid spatial clustering, distribution constraints are introduced for selected nodes. its neighborhood Nodes within the area receive a penalty factor. spatial radius .
[0094] To further reduce the damage of pruning to the model, the system performs fine-tuning recovery between every two rounds of pruning, using 10% of the initial learning rate. Number of training rounds The early stop strategy monitors and verifies losses; fine-tuning terminates when losses fail to decrease after three consecutive rounds of verification. A freeze strategy protects critical nodes that meet the following criteria. or The nodes are marked as non-pruning to avoid over-compression.
[0095] Adaptive deployment for the in-vehicle environment. To address the issue of fluctuating CPU and memory usage during driving due to the launch of other applications, the pruned and optimized model adapts to the dynamic state of in-vehicle devices through real-time resource monitoring. The system updates every... Collect CPU utilization Memory usage Available memory For indicators such as these, a moving average filter is used to eliminate instantaneous fluctuations: Smoothing coefficient .
[0096] Based on the model's resource status, the system defines four operating modes: the trigger condition for performance mode is... Enable the full model Includes all Trees, batch size This mode aims for the highest detection accuracy; the trigger condition for the balanced mode is... Adjust batch size to Feature engineering is simplified to a two-stage process (information gain + FCBF), skipping KPCA dimensionality reduction. This achieves a balance between accuracy and efficiency; the power-saving mode is triggered by... Only the top 70% of important trees are loaded; tree selection is based on importance sorting. Confirmed, the feature sampling rate has been reduced to This mode prioritizes ensuring stable system operation; the trigger condition for the critical mode is... Only the top 50% of important trees are retained, and the batch size is reduced to... Enable rapid decision-making mode. Rapid decision-making is achieved through an early termination mechanism, when the prediction confidence level... Stop the reasoning of subsequent trees in time to avoid system crash.
[0097] The system employs a state machine mechanism to manage mode switching and maintains state duration counters. The observation period is set as The mode switching condition is: To avoid accidental switching, a hysteresis mechanism is introduced, requiring the triggering conditions for the new mode to be met continuously. Switching is performed only after one monitoring cycle.
[0098] Gradual adjustment strategy during mode switching The parameter transition is completed in steps, with an adjustment amount of [amount] per step. The inter-step delay is This ensures a smooth system transition and maintains continuous availability.
[0099] CAN bus injection attack detection (CAN bus field)
[0100] Attack scenario: Malicious messages are injected into the CAN bus of an autonomous vehicle, forging braking system status information and attempting to trigger abnormal deceleration.
[0101] VTR-LightGBM Application Process:
[0102] Timing Aware Module:
[0103] Adaptive sliding window: The CAN bus data has an inherent 10ms cycle. During normal driving, the data complexity is low (the interval is stable), and a lightweight mode is adopted (window size = 10 cycles, i.e. 100ms). When an attack occurs, the message interval changes abruptly from 10ms to 5ms / 20ms, the data complexity increases, and it automatically switches to full mode (window size = 30 cycles, i.e. 300ms).
[0104] Feature extraction:
[0105] Time interval characteristics: Extract the mean interval (which drops to 5ms during an attack), variance (which increases from 0.5ms² to 5ms²), and extreme values (outliers of 5ms / 20ms appear).
[0106] Change rate characteristics: Abrupt changes in intervals result in an absolute change rate of 0.5 or higher (e.g., from 10ms to 5ms, change rate = -0.5).
[0107] Trend characteristics: Under linearly decreasing weights, the trend coefficient is significantly negative (indicating an attack trend with shortening intervals).
[0108] Topology coding module:
[0109] Predefined CAN ID domain: Malicious messages belong to the power system domain D1 (CAN ID range [0x100, 0x200)), and the domain activity intensity is abnormally high (normal percentage 15% → attack percentage 40%).
[0110] CAN ID entropy: Malicious message ID duplication injection leads to a decrease in the randomness of ID distribution, and the entropy value drops from 1.2 to 0.6.
[0111] Detection results: The model captures interval anomalies through temporal features and locates anomalies in the power system domain by combining topological features. The attack detection accuracy reaches 96%, and the response time is <100ms (meeting the real-time requirements of vehicle networking).
[0112] The FCBFiP algorithm is an intelligent feature engineering solution for heterogeneous data in the Internet of Vehicles (IoV) network (such as CAN bus messages, GPS trajectories, and V2X communication traffic). Through three mechanisms—data distribution perception, dynamic resource allocation, and attack mode adaptation—it addresses three major pain points in IoV scenarios: data heterogeneity, resource constraints, and class imbalance. It outputs a key feature set adapted to the target domain, supporting subsequent intrusion detection engines. The following explanation, in three stages, is based on a specific IoV scenario:
[0113] I. Information Gain Pre-screening Stage: Initial Filtering of Redundant Features
[0114] In response to the multi-source nature of vehicle-to-everything (V2X) data, this stage employs three mechanisms to achieve precise pre-screening:
[0115] Domain Adaptive Strategy:
[0116] A conservative retention strategy is adopted for low-dimensional time-series data of vehicle networking (such as GPS trajectory): β=0.8 (domain retention ratio), original number of features n=50, maximum number of features M=30, and finally retain k=min(50×0.8,30)=30 key features;
[0117] For high-dimensional statistical data (such as V2X traffic statistics), a standard strategy is used to filter out redundant features.
[0118] Class imbalance handling:
[0119] There is a severe imbalance in the CAN bus data (10,000 normal messages / 500 attack messages, IR=20). The system automatically adjusts the information gain threshold to 50% of the original value, prioritizing the retention of attack-related features.
[0120] Attack perception weight calculation: Taking the "packet interval time" feature as an example, its variance is 0.8 in DDoS attack and 0.2 in normal scenario, with a mean variance of 0.5. W_attack = 0.5 × 0.5 = 0.25, so this feature is given a higher weight.
[0121] Discretization of continuous features:
[0122] For continuous features such as CAN message interval time (if the unique value exceeds the threshold), equal-frequency binning is used to discretize it into 5 intervals. The bin boundaries are calculated based on percentiles to adapt to the nonlinear distribution of vehicle network data.
[0123] II. Dynamic Symmetric Uncertainty Filtering Stage: Balancing Correlation and Redundancy
[0124] Given the resource-constrained nature of in-vehicle terminals (such as OBUs), this stage implements resource-adaptive feature redundancy elimination:
[0125] Dynamic threshold calculation:
[0126] The vehicle-mounted OBU device monitors CPU utilization u=0.6, memory utilization v=0.7, basic threshold β=0.05, resource impact coefficients α=0.5 and γ=0.3, and calculates the dynamic threshold T=0.05×(1-0.5×0.6-0.3×0.7)=0.0245. The threshold is increased to save resources.
[0127] Symmetric uncertainty filtering:
[0128] For the "V2X network traffic" feature, its mutual information with the attack label IG=0.6, feature entropy H(X)=1.2, label entropy H(Y)=0.8, and symmetric uncertainty SU=2×(0.6 / (1.2+0.8))=0.6>0.0245, this feature is preserved;
[0129] Data distribution awareness:
[0130] CAN data distribution is determined by skewness / kurtosis: if the absolute value of skewness of more than 30% of the features is >1.5, it is determined to be a highly skewed distribution. The adjustment factor λ=0.8 is used to further optimize the threshold calculation and adapt to the abnormal data distribution caused by attacks.
[0131] III. Kernel Principal Component Reduction Stage: Extracting Key Nonlinear Features;
[0132] To address the non-linear relationships in vehicle-to-everything (V2X) data, this stage achieves feature dimension compression:
[0133] Kernel function processing: The kernel matrix is constructed using the Gaussian radial basis kernel function, and the bandwidth parameter is automatically adapted to the complexity of the vehicle network data;
[0134] Adaptive principal component retention: Adjust the cumulative variance contribution rate according to the attack variance: retain 0.95 for medium attack variance and 0.90 for high variance to ensure that attack features are not lost;
[0135] Incremental PCA optimization: When the number of vehicle network samples exceeds 10,000, incremental PCA is enabled for batch processing to avoid OBU memory overflow, with a typical compression ratio of 1:5 (e.g., from 50 dimensions to 10 dimensions).
[0136] Case Value Summary
[0137] The FCBFiP algorithm provides a high-quality key feature set for vehicle-to-everything (V2X) intrusion detection through a three-stage progressive process:
[0138] Solving the problem of heterogeneous data adaptation: covering multiple data sources such as CAN bus, GPS, and V2X;
[0139] Adapting to resource-constrained scenarios: Dynamically adjusting thresholds and dimensionality reduction strategies to meet OBU computing power requirements;
[0140] Improve attack detection accuracy: Weighted information gain and attack perception weight prioritize retaining attack-related features;
[0141] The final output key feature set (such as 30 CAN bus features and 10 V2X traffic features) provides efficient input for the subsequent VTR-LightGBM detection engine, supporting real-time intrusion detection in the vehicle network.
Claims
1. A lightweight intrusion detection method for vehicle-to-everything (V2X) networks, characterized in that: Includes the following steps: a) Domain Adaptive Feature Selection: The FCBFiP algorithm is used to perform feature filtering, cross-domain mapping, and importance ranking on heterogeneous data of the Internet of Vehicles, and output a key feature set that is adapted to the target domain; b) Detection engine integrating topology awareness and temporal pattern: The key feature set is topology-aware encoded to generate network topology features through the VTR-LightGBM engine, and intrusion behavior is detected by combining the temporal pattern extraction model, and preliminary detection results are output. c) Graph-aware hierarchical pruning: Based on the graph structure, the importance of nodes in the detection engine is evaluated, and a hierarchical pruning strategy is adopted to remove non-critical computing nodes, thereby achieving adaptive deployment of vehicle terminal resources and outputting a lightweight detection model and the final intrusion detection results.
2. The lightweight intrusion detection method for vehicle-to-everything (V2X) networks based on domain adaptation and graph-aware pruning as described in claim 1, characterized in that, The FCBFiP algorithm includes the following sub-steps: a) Feature correlation filtering: Calculate the Pearson correlation coefficient between the features of the source domain and the target domain, and filter out redundant features whose correlation coefficient is lower than a preset threshold; b) Cross-domain feature mapping: An adversarial learning mechanism is used to construct a domain adaptive mapping function, which maps the feature space of the source domain to the feature space of the target domain according to the differences in the vehicle network domain; c) Feature importance ranking: The importance of the mapped features is scored based on the LightGBM model, and the top N features with the highest scores are selected to form a key feature set, where N≤30.
3. The lightweight intrusion detection method for vehicle-to-everything (V2X) networks based on domain adaptation and graph-aware pruning as described in claim 2, characterized in that, The adversarial learning mechanism employs a game-like training approach between a domain discriminator and a feature extractor. The domain discriminator, targeting the domain labels of the Internet of Vehicles, minimizes the difference in feature distribution between the source and target domains.
4. The lightweight intrusion detection method for vehicle-to-everything (V2X) networks based on domain adaptation and graph-aware pruning as described in claim 1, characterized in that, The VTR-LightGBM engine includes: a) Topology-aware coding unit: Generates an adjacency matrix based on the communication topology of the vehicle network, and generates node feature vectors by combining node attributes; b) Temporal pattern extraction unit: The time series data is segmented using the sliding window technique, and the temporal features are extracted using the LightGBM model; c) Fusion Detection Unit: Inputs topological features and temporal features into the LightGBM classifier and outputs detection results for vehicle network intrusion types.
5. The lightweight intrusion detection method for vehicle-to-everything (V2X) networks based on domain adaptation and graph-aware pruning as described in claim 4, characterized in that, The topology-aware coding unit uses the GraphSAGE algorithm to generate node embedding vectors, and the temporal pattern extraction unit uses a 10-second sliding window to segment temporal data.
6. The lightweight intrusion detection method for vehicle-to-everything (V2X) networks based on domain adaptation and graph-aware pruning as described in claim 1, characterized in that, The graph-aware hierarchical pruning includes: a) Node importance assessment: The centrality index of each node is calculated based on a graph neural network to assess the contribution of each node to the vehicle network intrusion detection task; b) Layered pruning strategy: Nodes are divided according to the model calculation layer. Non-critical layer nodes with a contribution value lower than the preset threshold are pruned first, while core calculation nodes related to CAN bus and V2X communication are retained. c) Resource adaptive deployment: Based on the CPU and memory resource limitations of the vehicle terminal (e.g., strengthening pruning when CPU utilization is ≥70%), dynamically adjust the degree of pruning to generate a lightweight model adapted to different terminals.
7. The lightweight intrusion detection method for vehicle-to-everything (V2X) networks based on domain adaptation and graph-aware pruning as described in claim 6, characterized in that, The centrality index includes a weighted combination of degree centrality, betweenness centrality, and proximity centrality.