An intelligent network connection automatic driving automobile exception detection method and system
Patent Information
- Application Number
- CN202511442540.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-10-10
AI Technical Summary
[0003]现有的针对CAVs的异常检测方法虽然在处理高维复杂且非线性的传感器数据时表现出色,但存在以下技术问题:
本发明公开了一种智能网联自动驾驶汽车异常检测方法及系统,所述方法包括基于CAV测试平台采集多种时序传感器数据,通过滑动窗口技术将数据切分为序列,并基于转移熵理论构建传感器变量间的因果关系网络;构建贝叶斯LSTM网络,并融合静态因果关系先验知识和动态数据变化特征设计因果注意力机制,通过复合损失函数训练异常检测模型;对训练好的异常检测模型进行验证,量化评估整体的预测不确定性并构建预测置信区间;基于所述预测置信区间,采用基于预测不确定性量化的非参数异常阈值动态更新策略,通过实时调整异常控制限对目标样本进行异常检测。本发明能够提高异常检测精度。
Smart Images

Figure CN121211271B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to an anomaly detection method and system for intelligent connected autonomous vehicles. Background Technology
[0002] With the rapid development of intelligent transportation systems, connected and automated vehicles (CAVs) have become an important development direction in the transportation sector. By integrating artificial intelligence and automation technologies, CAVs can significantly improve road safety and alleviate traffic congestion. However, the operation of CAVs heavily relies on complex sensor networks to perceive the environment and monitor vehicle status; anomaly detection in sensor data is crucial for timely identification of potential risks and prevention of accidents.
[0003] While existing anomaly detection methods for CAVs perform well in handling high-dimensional, complex, and nonlinear sensor data, they suffer from the following technical problems: First, existing methods generally ignore the uncertainties inherent in the data and the model itself, outputting only deterministic anomaly detection results without providing corresponding confidence estimates. For safety-critical systems such as CAVs, quantifying the confidence of anomaly detection results is crucial. Uncertainties in anomaly detection mainly include random uncertainties caused by the inherent randomness of the system and sensor measurement noise, as well as cognitive uncertainties caused by the model's insufficient understanding of the data.
[0004] Secondly, existing methods fail to distinguish between causal relationships and statistical correlations between data points, instead using all correlations indiscriminately to guide model learning and prediction. The predictive performance of this approach largely depends on the statistical correlation between input variables and the prediction target in the training data, rather than the true causal relationship, leading to insufficient robustness of the model in unknown application environments.
[0005] Finally, traditional fixed-threshold anomaly detection methods are difficult to adapt to the complex and ever-changing operating environment of CAVs and cannot maintain consistent detection performance in different driving scenarios and system states. Summary of the Invention
[0006] The purpose of this invention is to provide an anomaly detection method and system for intelligent connected autonomous vehicles, aiming to solve or improve at least one of the above-mentioned technical problems.
[0007] To achieve the above objectives, the present invention provides the following solution: A method for anomaly detection in intelligent connected autonomous vehicles includes: Data from various time-series sensors was collected using the CAV testing platform. The data was segmented into sequences using sliding window technology, and a causal relationship network between sensor variables was constructed based on the transfer entropy theory. A Bayesian LSTM network is constructed, and a causal attention mechanism is designed by integrating static causal prior knowledge and dynamic data change features. An anomaly detection model is trained through a composite loss function. The trained anomaly detection model is validated, the overall prediction uncertainty is quantitatively assessed, and prediction confidence intervals are constructed. Based on the predicted confidence interval, a nonparametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification is adopted to detect anomalies in target samples by adjusting the anomaly control limit in real time.
[0008] Optionally, the time-series sensor data includes torque signal, actual vehicle speed, eastward speed component, northward speed component, lateral acceleration, longitudinal acceleration, wheel angle, latitude coordinates, longitude coordinates, heading angle, pitch angle, and roll angle.
[0009] Optionally, the construction of the causal relationship network among sensor variables based on transfer entropy theory specifically includes: The transfer entropy based on Copula entropy is calculated on the sequence data to obtain the forward and backward transfer entropy between each variable and other variables in the sensor data. The strength and direction of the causal relationship between variables are determined. By removing the edge with the smallest weight in the relationship loop one by one, the loop structure in the causal relationship network is avoided, and the causal relationship network between sensor variables is completed.
[0010] Optionally, the Bayesian LSTM network includes multiple neural network units, each of which includes an input gate, a forget gate, an output gate, and candidate value computation; the gating mechanism parameters of each neural network unit are set to sample from the posterior distribution.
[0011] Optionally, the causal attention mechanism includes allocating static causal attention weights and dynamic causal attention weights; wherein, the allocation strategy for the static causal attention weights is: allocating initial values based on the causal relationship network; the allocation strategy for the dynamic causal attention weights is: assigning a first weight value to direct cause features and assigning a second weight value to indirect cause features; the first weight value is greater than the second weight value.
[0012] Optionally, the composite loss function includes a first part loss, a second part loss, and a third part loss; wherein the first part loss includes prediction loss and variational inference loss; the second part loss is negative log-likelihood loss; and the third part loss is regularization loss.
[0013] Optionally, the quantitative assessment of overall prediction uncertainty and the construction of prediction confidence intervals specifically include: The sum of random uncertainty and cognitive uncertainty is calculated as the result of prediction uncertainty, and a 95% confidence interval for the predicted value is constructed.
[0014] Optionally, the nonparametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification specifically includes: Calculate real-time updated exception control limits CL t The formula is: in, CL t Indicates the first [number]th ... t Anomaly control limits for each time step; UQ 0 represents the maximum prediction uncertainty value in the training set, which serves as the baseline value for the adaptive threshold; L This represents the standard deviation multiplier; Indicates the scaling factor; (1- λ t ) 2t Indicates the exponential decay factor; σ t The standard deviation of the quantized value of prediction uncertainty in the test sample sequence is: in, s Indicates the length of the test sample sequence. μ t This represents the mean of the prediction uncertainty for all test samples in the test sample sequence: according to UQ t The scaling factor is dynamically adjusted based on its value. in, UQ t Indicates the first t The prediction uncertainty value for each sample; Control scaling factor as UQ t The value is increased, and the control limit is adjusted accordingly to obtain the adaptive control limit. Anomaly determination is then performed based on the adaptive control limit.
[0015] The present invention also provides an anomaly detection system for intelligent connected autonomous vehicles, comprising: The data acquisition and causal network construction unit is used to acquire data from various time-series sensors based on the CAV testing platform, divide the data into sequences using sliding window technology, and construct a causal network between sensor variables based on the transfer entropy theory. The model building and training unit is used to build a Bayesian LSTM network and design a causal attention mechanism by integrating static causal prior knowledge and dynamic data change features. The anomaly detection model is trained through a composite loss function. The confidence interval definition unit is used to validate the trained anomaly detection model, quantitatively evaluate the overall prediction uncertainty, and construct the prediction confidence interval. An anomaly detection unit is used to perform anomaly detection on target samples by adjusting the anomaly control limits in real time, based on the predicted confidence interval and a nonparametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification.
[0016] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: This invention discloses an anomaly detection method and system for intelligent connected autonomous vehicles. The method includes: collecting various time-series sensor data based on a CAV testing platform; segmenting the data into sequences using a sliding window technique; constructing a causal relationship network between sensor variables based on transfer entropy theory; constructing a Bayesian LSTM network and designing a causal attention mechanism by integrating prior knowledge of static causal relationships and dynamic data change characteristics; training an anomaly detection model using a composite loss function; validating the trained anomaly detection model, quantifying and evaluating the overall prediction uncertainty, and constructing a prediction confidence interval; and based on the prediction confidence interval, employing a non-parametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification to perform anomaly detection on target samples by adjusting the anomaly control limits in real time. This invention can improve the accuracy of anomaly detection. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the installation of the high-precision integrated navigation system and related equipment in an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the specific implementation process of the intelligent anomaly detection framework in this invention. Figure 3 This is a schematic diagram of the Bayesian LSTM neural network unit structure and gating mechanism parameter sampling in an embodiment of the present invention; Figure 4 This is a schematic diagram of dynamic attention weight calculation in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] The purpose of this invention is to provide an anomaly detection method and system for intelligent connected autonomous vehicles, aiming to solve or improve at least one of the above-mentioned technical problems.
[0021] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] This invention provides an anomaly detection method for intelligent connected autonomous vehicles, comprising: S1: Collect data from various time-series sensors using the CAV testing platform, divide the data into sequences using sliding window technology, and construct a causal relationship network between sensor variables based on the transfer entropy theory.
[0023] S2: Construct a Bayesian LSTM network and design a causal attention mechanism by integrating prior knowledge of static causal relationships and dynamic data change features. Train the anomaly detection model through a composite loss function.
[0024] S3: Validate the trained anomaly detection model, quantitatively assess the overall prediction uncertainty, and construct prediction confidence intervals.
[0025] S4: Based on the predicted confidence interval, a non-parametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification is adopted to detect anomalies in the target sample by adjusting the anomaly control limit in real time.
[0026] As one specific implementation, this invention presents a CAV sensor data anomaly detection method based on causal attention mechanism and Bayesian deep learning. The data acquisition device used includes a high-precision integrated navigation system, a drive-by-wire chassis sensor system, a data recording device, and a power supply device, all installed on a CAV testing platform. The data acquisition device is as follows: Figure 1 As shown, it is fixedly installed on the CAV test vehicle to collect multi-dimensional sensor data in real time during the vehicle's operation.
[0027] like Figure 2As shown, the intelligent anomaly detection framework of this invention integrates causal inference and Bayesian deep learning techniques, aiming to effectively detect anomalies in time-series sensor data in autonomous driving systems. The specific implementation process of this framework includes three main stages: data acquisition and causal relationship identification, model training, and anomaly detection. Each stage works collaboratively to achieve end-to-end anomaly detection capabilities, specifically including the following steps: S1, Data Acquisition and Causal Relationship Identification: Data acquisition and causal relationship identification specifically include the following steps: S11, Multi-source sensor data acquisition: Data is collected from various time-series sensors based on a normally functioning CAV test platform, specifically including data from the integrated navigation system and the drive-by-wire chassis system. The integrated navigation system, built upon a global satellite navigation system and an inertial measurement unit, provides the vehicle's position, velocity, acceleration, and attitude information. The drive-by-wire chassis system provides the vehicle's control inputs and actuator status information.
[0028] The collected sensor data includes twelve characteristic variables: torque signal, actual vehicle speed, eastward velocity component, northward velocity component, lateral acceleration, longitudinal acceleration, wheel angle, latitude coordinates, longitude coordinates, heading angle, pitch angle, and roll angle. The data sampling frequency is set to 100Hz to ensure that high-frequency characteristics of the vehicle's dynamic behavior can be captured.
[0029] S12, Data Preprocessing and Serialization: The continuous sensor data acquired in S11 is divided into fixed-length time sequences using a sliding window technique. The window size is set to 20 time steps, and the sliding step size is 1 time step to ensure sufficient overlap between adjacent sequences to maintain temporal continuity.
[0030] The processed data sequence was divided into training, validation, and test sets according to time sequence, with split ratios of 85%, 7%, and 8%, respectively. The training set was used for model parameter learning, the validation set for hyperparameter tuning, and the test set for performance evaluation.
[0031] S13, Causal Relationship Construction Based on Transfer Entropy: Based on the partial training data obtained in S12, a causal relationship network between sensor variables is constructed using transfer entropy theory. Transfer entropy is a nonparametric statistic used to measure directed information transfer between two stochastic processes; its essence is conditional mutual information. Given a stochastic process... X i and Y i ,in i ∈ℕ represents a time index, from X arrive Y The transition entropy is defined as: (1) Transition entropy can be further expressed in the form of conditional mutual information: (2) in, I (·;·|·) represents conditional mutual information. Y i = ( Y 1, Y 2, ..., Y i ) indicates the time to i The formula measures the historical observation sequence up to this point. Y i In this case, Y i+1 right X i The degree of dependence.
[0032] S14, Calculation of Transition Entropy Based on Copula Entropy: Directly calculating transition entropy for complex high-dimensional data is challenging. This paper simplifies the computational complexity by employing the Copula entropy equivalence relation. H c It has an equivalent relationship with mutual information: (3) in, H c ( X ) represents a random variable X Copula entropy, I ( X )express X The mutual information. Based on this equivalence relation, the transition entropy obtained in S13 can be represented by Copula entropy: (4) in, This represents the joint Copula entropy of the three variables. express Y i and Y i+1 Joint Copula entropy, express Y i and X i The joint Copula entropy.
[0033] To calculate the Copula entropy, the original data is first transformed into a uniform distribution in the interval [0,1] using an empirical cumulative distribution function: (5) in, F i ( xi ) indicates the first i The empirical cumulative distribution function of the variables, T Represents the total number of samples. Indicates the first t In the nth sample i The values of the variables, This represents an indicator function that takes a value of 1 when a condition is met and 0 otherwise. This transformation converts the original data to Copula space, resulting in a new sample set { u 1, u 2, ..., u T This transformation preserves the dependency structure between variables while stripping away their respective marginal distribution characteristics.
[0034] Estimating the Copula empirical density function based on the transformed sample set: (6) in, c ( u ) represents the Copula empirical density function. K h Indicates bandwidth is h kernel function, u t Indicates the first t A transformed sample.
[0035] In obtaining c ( u Then, the Copula entropy is calculated through integration: (7) Finally, the transfer entropy is obtained by transforming the Copula entropy through equation (4).
[0036] S15, Causal Relationship Network Optimization: Following step S14, calculate the forward and backward transfer entropy between each variable and other variables in the sensor data to determine the strength and direction of the causal relationship between variables. (This involves judging two variables.) X and Y When there is a causal relationship between them, if TE X→Y > TE Y→X Then it is believed X yes Y The reason.
[0037] To reduce the likelihood of spurious causal relationships, the conditional independence test is used. Let... X and Y For a pair of causal features in the initial causal network, Z This represents other features in the dataset. (The remaining text is incomplete and cannot be translated.)X and Y Return to Z And calculate the residuals x res and y res : (8) (9) in, f X(Z) and f Y(Z) They represent X and Y about Z The regression function.
[0038] Further y res Return to x res Calculate the coefficient of determination: (10) in, Indicates based on x res Predicted y res , express y res The mean.
[0039] based on R ²Construction F Statistic, and calculate F The right-tail probability of the statistic: (11) in, F cdf express F The cumulative distribution function of the distribution. For a given significance level. α ,if p ≥ α Then it is believed X and Y It is a false causal relationship and the corresponding edge is removed from the network.
[0040] To avoid loop structures in the causal relationship network, the loops are broken by removing the edge with the smallest weight in each loop. The edge with the smallest weight usually corresponds to the variable pair with the weakest causal relationship. Removing these edges can obtain a loop-free directed graph while maintaining the main causal relationships, that is, the optimized causal relationships between sensor variables.
[0041] S2, Constructing a Causal Attention Bayesian LSTM Anomaly Detection Model: Constructing a causal attention Bayesian LSTM anomaly detection model specifically includes the following steps: S21, Bayesian LSTM network construction: as follows Figure 3 As shown, a Bayesian LSTM network with variable parameters is constructed. The structure of each neural network unit in the Bayesian LSTM layer is consistent with that of a traditional LSTM network, including input gate, forget gate, output gate, and candidate value computation. However, the gating mechanism parameters of each network unit in this layer are set to be sampled from the posterior distribution.
[0042] like Figure 3 As shown, the parameter posterior inference problem is transformed into an optimization problem through variational inference. Using parameters... θ =( μ , ρ Variational posterior distribution of control q θ (W| D To estimate the true posterior distribution p (W| D ): (12) Where W represents the network parameter matrix, D Represents training data, w i Indicates the first i One parameter, μ i Indicates the first i The mean of each parameter, σ i Indicates the first i The standard deviation of each parameter N (·|·,·) represents a normal distribution.
[0043] The variational parameters are optimized by minimizing the KL divergence between the variational posterior distribution and the true posterior distribution. (13) Where KL[·||·] represents the KL divergence. The KL divergence is transformed into an optimization objective for variational inference: (14) in, O VI This represents the optimization objective function for variational inference.
[0044] S22, Design of Causal Attention Mechanism: The causal attention mechanism includes two parts: calculating static causal attention weights and dynamic causal attention weights.
[0045] Static causal attention weight WS The initial values are assigned based on the causal network constructed in step S1. Among the input features selected based on the causal network, the direct and indirect cause features of the target feature are located at different levels of the network, reflecting the difference in the degree of influence of each input feature on the target feature.
[0046] The initial static causal attention weight allocation strategy is as follows: features representing direct causes are assigned larger weight values, while features representing indirect causes are assigned smaller weight values. Features that are both direct and indirect causes are assigned even greater weights to reflect their combined impact. When setting the initial weights, the weight range for direct cause features is [80, 95], and the weight range for indirect cause features is [55, 75]. The specific weight values are refined based on the magnitude of the transfer entropy. During actual training, these initial static causal attention weights are set as learnable parameters, allowing the model to fine-tune and encouraging it to learn attention patterns that conform to expectations.
[0047] like Figure 4 As shown, the dynamic causal attention weight W D Real-time computation is performed using a lightweight neural network embedded in a causal attention layer. This network calculates dynamic attention weights based on short-term historical data of time series data, reflecting the model's attention level to outlier data. The short window length is set to... l Calculate the mean of the feature values within the window. u l and standard deviation σ l : (15) (16) in, x k Indicates the first k Feature values at each time step t Indicates the current time step. Use u l and σ l Data at the current time step x t After standardization, the z-score is obtained: (17) in, ε This represents a small constant to avoid division by zero, usually set to 10. -8 .
[0048] The z-score is input into a lightweight neural network to calculate the dynamic attention score: S D,t = W O·ReLU(W I · z t + b I ) + b O (18) Among them, W I and b I W represents the weight matrix and bias vector of the network input layer, respectively. O and b O represents the weight matrix and bias vector of the network output layer, respectively, and ReLU represents the modified linear live function.
[0049] The dynamic attention scores are normalized using the Softmax function to obtain the dynamic attention weights. (19) in, l Represents the total number of features. Indicates the first t The first time step l Dynamic attention scores for each feature.
[0050] Introducing adjustable hyperparameters τ To control the balance between static and dynamic weights, we obtain the causal attention weights ultimately used by the model: (20) in, τ ∈[0,1] represents the balance coefficient, when τ When =1, it depends entirely on static weights. τ When =0, it depends entirely on dynamic weights.
[0051] S23, Implicit Representation Layer Design: The implicit representation layer maps the output of the Bayesian LSTM layer back to the original input dimension, providing a foundation for subsequent anomaly detection. This layer uses a fully connected neural network structure, containing one hidden layer and one output layer. The number of neurons in the hidden layer is set to half the hidden dimension of the Bayesian LSTM layer, and the ReLU activation function is used. The number of neurons in the output layer is equal to the dimension of the original input features, and a linear activation function is used to preserve the original range of values.
[0052] The calculation process of the implicit representation layer is as follows: h hidden = ReLU(W hidden · h lstm + b hidden ) (twenty one) h output = W output · h hidden + b output (twenty two) in, h lstm This represents the output of the Bayesian LSTM layer. h hidden This represents the output of the hidden layer. h output W represents the final implicit representation. hidden and b hidden W represents the weight matrix and bias vector of the hidden layer, respectively. output and b output These represent the weight matrix and bias vector of the output layer, respectively.
[0053] S24, Composite Loss Function Design: To ensure the anomaly detection model designed in this invention can be trained stably and has good generalization ability, a composite loss function with specific constraints is designed. The total loss function consists of three parts: L = L 1+ L 2+ L 3(23) Part 1: Loss Function L 1. Includes prediction loss and variational inference loss: (twenty four) in, D Indicates the number of samples in the batch. δ The proportional coefficient representing the weight of complexity loss. y i Indicates the first i The true value of each sample Indicates the first i The predicted value for each sample, K This indicates the number of times the model parameters are sampled during each forward propagation. Indicates the first k Variational inference loss from subsampling.
[0054] Part Two: Loss Function L 2 represents the negative log-likelihood loss, which measures the difference between the predicted distribution and the actual data distribution. (25) in, express y iIn the predicted distribution The probability density value in and They represent the first i The predicted mean and predicted standard deviation of each sample.
[0055] Part Three: Loss Function L 3 represents the regularization loss, which constrains the model to retain its memory of the initial static causal attention weights set in S22: (26) in, ω Indicates the regularization strength. N This represents the total number of static causal attention weights. Indicates the first n The current static causal attention weights, Indicates the first n An initial static causal attention weight.
[0056] S3, Quantification of Predictive Uncertainty: Predictive uncertainty is the sum of stochastic uncertainty (AU) and cognitive uncertainty (EU). Quantification of predictive uncertainty specifically includes the following steps: S31, Quantification of Random Uncertainty: Random uncertainty reflects the inherent noise of the data and the randomness of the system, and is independent of model parameters. When quantifying random uncertainty, fixed model parameters are used for sample prediction.
[0057] For parameters The trained anomaly detection model, when encountering a new sample point x * When using the mean of the variational posterior distribution as a fixed parameter: (27) Based on fixed parameters, predictions are made, yielding predicted values and prediction distributions: (28) (29) in, f (·; ·) represents the model's prediction function. and These represent the predicted mean and the predicted standard deviation, respectively.
[0058] From the predicted distribution S By sampling and calculating the sample variance, an estimate of the random uncertainty is obtained: (30) in, S Indicates the number of samples. This represents the s-th value sampled from the predicted distribution.
[0059] S32, Cognitive Uncertainty Quantification: Cognitive uncertainty measures the uncertainty of model parameters, reflecting the degree to which the model lacks understanding of the data. For the same sample, multiple predictions are made using variable parameters, resulting in multiple predicted values and prediction distributions.
[0060] Sample M distinct model parameters from the variational posterior distribution: (31) Among them, W (m) Indicates the first m The model parameters are obtained from each sampling. Prediction is then performed using each set of parameters: (32) (33) Use the mean of these predicted values as the final sample predicted values: (34) in, M This indicates the number of times the model uses different parameters to make predictions for the same sample.
[0061] Sample from each prediction distribution R Next, calculate the sampling variance: (35) in, Indicates from the first m The sampled from the predicted distribution is the th r One value, R This represents the number of samples for each distribution. The mean of the sampling variance and the prediction bias are used as estimates of the EU: (36) The first term represents the average value of the sampling variance, and the second term represents the variance of the prediction results for different parameters.
[0062] S33, Quantification of Total Uncertainty and Construction of Confidence Intervals: The quantified values of the random uncertainty obtained in S31 and the cognitive uncertainty obtained in S32 ultimately constitute the model's total predictive uncertainty for new samples. U = AU + EU (37) To visually demonstrate the uncertainty of the model's predictions for a specific sample, a 95% confidence interval for the predicted values is constructed: (38) in, CI 95%This represents the 95% confidence interval. t α / 2 Indicates the significance level as α of t Distribution critical value, usually α =0.05 corresponds to t 0.025 Width of the confidence interval W = The confidence interval represents the range of uncertainty in the predicted values of the sample. The wider the confidence interval, the greater the uncertainty of the prediction; the narrower the confidence interval, the higher the reliability of the prediction.
[0063] S4, Adaptive Anomaly Detection: Adaptive anomaly detection involves nonparametric anomaly threshold design and anomaly detection result output, specifically including the following steps: S41, Nonparametric Anomaly Threshold Design: To improve the sensitivity and accuracy of real-time detection, this invention designs a nonparametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification. Traditional fixed threshold methods are difficult to adapt to the complex and ever-changing operating environment of CAV, while adaptive thresholds can dynamically adjust the anomaly judgment criteria according to the current data characteristics.
[0064] Real-time updated exception control limits CL t The calculation formula is: (39) in, CL t Indicates the first [number]th ... t Anomaly control limits for each time step UQ t Indicates the first t The prediction uncertainty value for each sample, UQ 0 represents the maximum prediction uncertainty value in the training set, which serves as the baseline value for the adaptive threshold. σ t The standard deviation of the quantized value of prediction uncertainty in the test sample sequence is: (40) in, s Indicates the length of the test sample sequence. μ t This represents the mean of the prediction uncertainty for all test samples in the test sample sequence: (41) In equation (39) L This represents the standard deviation multiplier, used to control the sensitivity of anomaly detection, and is usually set to 2 or 3. λ t Indicates the scaling factor, according to UQt The value is dynamically adjusted: (42) Scaling factor ensures that as UQ t Increase the control limits accordingly to improve the sensitivity of anomaly detection. (1- λ t ) 2t This represents the exponential decay factor, used to ensure that control limits remain within a reasonable range when historical data is lacking in the early stages of anomaly detection. As time steps... t As the exponential decay factor increases, it rapidly shrinks to 0, reducing the impact of past data on the control limits and giving new samples more weight.
[0065] S42, Anomaly Detection Result Output: Anomaly determination is performed based on the adaptive control limits obtained in S41. When the prediction uncertainty of a sample exceeds the corresponding control limit, the sample is marked as an anomaly. The anomaly detection module outputs detection results containing the following information: Anomaly timestamp: Identifies the specific time point when an anomaly was detected, facilitating subsequent analysis and processing.
[0066] Anomaly confidence: The anomaly confidence is calculated based on the quantified value of prediction uncertainty, reflecting the credibility of the detection results.
[0067] Severity of anomalies: Based on the degree of deviation of the predicted uncertainty value from the historical normal range, it is classified into mild, moderate and severe anomalies.
[0068] Prediction confidence interval: Provides the predicted value and its 95% confidence interval at abnormal times, intuitively showing the range of uncertainty in the prediction.
[0069] The present invention provides a method and system for anomaly detection in connected autonomous vehicles, which achieves efficient and reliable detection of CAV sensor data anomalies by integrating causal attention mechanisms and uncertainty quantification technology. This method can accurately detect various sensor anomalies, including gradient drift, numerical deviation, missing data, signal instability, spike anomalies, and constant value anomalies, providing important technical support for the safe operation of connected autonomous vehicles.
[0070] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0071] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for anomaly detection in intelligent connected autonomous vehicles, characterized in that, include: Data from various time-series sensors was collected using the CAV testing platform. The data was segmented into sequences using sliding window technology, and a causal relationship network between sensor variables was constructed based on the transfer entropy theory. A Bayesian LSTM network is constructed, and a causal attention mechanism is designed by integrating static causal prior knowledge and dynamic data change features. An anomaly detection model is trained through a composite loss function. The trained anomaly detection model is validated, the overall prediction uncertainty is quantitatively assessed, and prediction confidence intervals are constructed. Based on the predicted confidence interval, a non-parametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification is adopted to detect anomalies in target samples by adjusting the anomaly control limit in real time. The time-series sensor data includes torque signal, actual vehicle speed, eastward speed component, northward speed component, lateral acceleration, longitudinal acceleration, wheel angle, latitude coordinates, longitude coordinates, heading angle, pitch angle, and roll angle. The construction of the causal relationship network among sensor variables based on transfer entropy theory specifically includes: The transfer entropy based on Copula entropy is calculated on the sequence data to obtain the forward and backward transfer entropy between each variable and other variables in the sensor data, determine the strength and direction of the causal relationship between variables, and avoid the appearance of loop structure in the causal relationship network by removing the edge with the smallest weight in the relationship loop one by one, thus completing the construction of the causal relationship network between sensor variables. The Bayesian LSTM network includes multiple neural network units, each of which includes an input gate, a forget gate, an output gate, and a candidate value calculation; the gating mechanism parameters of each neural network unit are set to be sampled from the posterior distribution; The causal attention mechanism includes allocating static causal attention weights and dynamic causal attention weights; wherein, the allocation strategy for the static causal attention weights is: allocating initial values based on the causal relationship network; the allocation strategy for the dynamic causal attention weights is: allocating a first weight value to direct cause features and a second weight value to indirect cause features; the first weight value is greater than the second weight value; The composite loss function includes a first part loss, a second part loss, and a third part loss; wherein, the first part loss includes prediction loss and variational inference loss; the second part loss is negative log-likelihood loss; and the third part loss is regularization loss. The quantitative assessment of overall prediction uncertainty and the construction of prediction confidence intervals specifically include: The sum of random uncertainty and cognitive uncertainty is calculated as the result of prediction uncertainty, and a 95% confidence interval for the predicted value is constructed. The nonparametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification is as follows: Calculate real-time updated exception control limits CL t The formula is: in, CL t Indicates the first [number]th ... t Anomaly control limits for each time step; UQ 0 represents the maximum prediction uncertainty value in the training set, which serves as the baseline value for the adaptive threshold; L This represents the standard deviation multiplier; Indicates the scaling factor; (1- λ t ) 2t Indicates the exponential decay factor; σ t The standard deviation of the quantized value of prediction uncertainty in the test sample sequence is: in, s Indicates the length of the test sample sequence. μ t This represents the mean of the prediction uncertainty for all test samples in the test sample sequence: according to UQ t The scaling factor is dynamically adjusted based on its value. in, UQ t Indicates the first t The prediction uncertainty value for each sample; Control scaling factor as UQ t The value is increased, and the control limit is adjusted accordingly to obtain the adaptive control limit. Anomaly determination is then performed based on the adaptive control limit.
2. An anomaly detection system for intelligent connected autonomous vehicles, employing the method described in claim 1, characterized in that, include: The data acquisition and causal network construction unit is used to acquire data from various time-series sensors based on the CAV testing platform, divide the data into sequences using sliding window technology, and construct a causal network between sensor variables based on the transfer entropy theory. The model building and training unit is used to build a Bayesian LSTM network and design a causal attention mechanism by integrating static causal prior knowledge and dynamic data change features. The anomaly detection model is trained through a composite loss function. The confidence interval definition unit is used to validate the trained anomaly detection model, quantitatively evaluate the overall prediction uncertainty, and construct the prediction confidence interval. An anomaly detection unit is used to perform anomaly detection on target samples by adjusting the anomaly control limits in real time, based on the predicted confidence interval and a nonparametric anomaly threshold dynamic update strategy based on prediction uncertainty quantification.