Intelligent automobile explainability anomaly diagnosis method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGAN UNIV
- Filing Date
- 2025-10-10
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]其次,现有基于重建的方法仅关注数据的表面重建,未充分考虑多维传感器数据变量间的内在结构关系,可能会导致在未见过的正常模式上泛化能力受限,一些罕见但合法的正常模式可能会被模型判为异常,从而导致更高的误报率
本发明公开了一种智能汽车可解释性异常诊断方法及系统,所述方法包括基于智能汽车测试平台采集多维传感器数据,并构建用于描述传感器数据之间因果关系的有向因果图和因果邻接矩阵;基于所述因果邻接矩阵设计因果约束的图注意力机制,并构建因果约束增强的图注意力异常诊断模型;基于所述有向因果图和所述图注意力异常诊断模型,构建集成特征重构误差、变量因果关系和图注意力网络权重的分层异常诊断策略,定位异常根因并识别异常在传感器网络中的传播路径。本发明能够克服现有技术中图注意力网络学习虚假相关以及缺乏异常解释能力的问题,实现智能汽车多传感器数据的可靠异常检测与根因诊断。
Smart Images

Figure CN121211270B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a method and system for diagnosing interpretable anomalies in intelligent vehicles. Background Technology
[0002] With the advancement of artificial intelligence technology and the increasing global demand for traffic safety, intelligent vehicles are rapidly developing as a revolutionary mode of transportation, promising to significantly improve travel efficiency and reduce traffic accidents. Intelligent driving systems rely heavily on diverse sensor networks to perceive the environment in real time and make decisions; the stability and data quality of these sensors directly affect the safety and reliability of the entire system.
[0003] However, in real-world operating environments, sensors are susceptible to extreme weather, electromagnetic interference, and hardware malfunctions, leading to abnormal data and posing safety risks to intelligent driving systems. Existing anomaly detection technologies suffer from the following technical problems: First, traditional graph attention networks, based on unconstrained fully connected attention mechanisms, tend to capture statistical correlations between nodes rather than causal relationships. This feature induction bias based on co-occurrence can easily lead to the model learning spurious correlations and the influence of confounding variables, thereby weakening its generalization ability and causal robustness on out-of-distribution data. This problem is particularly prominent in autonomous driving scenarios when there is a distributional shift between the operating environment and the training environment.
[0004] Secondly, existing reconstruction-based methods only focus on the surface reconstruction of data and do not fully consider the inherent structural relationships between multidimensional sensor data variables. This may lead to limited generalization ability on unseen normal patterns. Some rare but legitimate normal patterns may be judged as anomalous by the model, resulting in a higher false alarm rate.
[0005] Finally, some existing studies only detect anomalies without providing explanations, failing to diagnose the root causes of the anomalies or determine their propagation paths within sensor networks. This is crucial for intelligent driving systems in safety-critical applications. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for diagnosing interpretable anomalies in intelligent 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 diagnosing interpretability anomalies in intelligent vehicles, comprising: Multi-dimensional sensor data is collected based on an intelligent vehicle testing platform, and a directed causal graph and a causal adjacency matrix are constructed to describe the causal relationships between the sensor data. Based on the causal adjacency matrix, a causal constraint-based graph attention mechanism is designed, and a causal constraint-enhanced graph attention anomaly diagnosis model is constructed. Based on the directed causal graph and the graph attention anomaly diagnosis model, a hierarchical anomaly diagnosis strategy integrating feature reconstruction error, variable causal relationship and graph attention network weights is constructed to locate the root cause of the anomaly and identify the propagation path of the anomaly in the sensor network.
[0008] Optionally, the step of collecting multi-dimensional sensor data based on the intelligent vehicle testing platform and constructing a directed causal graph and a causal adjacency matrix to describe the causal relationships between the sensor data specifically includes: Multi-dimensional sensor data is collected based on an intelligent vehicle testing platform; the multi-dimensional sensor data includes motor drive torque, vehicle chassis speed, wheel rotation angle, northbound speed, eastbound speed, etc. x Axial acceleration, y Axial acceleration, vehicle longitude, vehicle latitude, heading angle, pitch angle, and roll angle; Based on the multidimensional sensor data, a deep separable dilated temporal convolutional network based on an attention mechanism is used to infer the causal relationships between sensor variables, and a directed causal graph and a causal adjacency matrix are constructed to describe the causal relationships between sensor data.
[0009] Optionally, the process of inferring causal relationships between sensor variables using a deep separable dilated temporal convolutional network based on an attention mechanism specifically includes: According to Granger's definition of causality, if data X i It can improve the data X j The prediction accuracy is considered to be X i Granger caused X j ; In deduction X j When the cause variable is all variables X i≠j exist t Historical information prior to the time step should be included in the prediction. X j The value at the current time step, to avoid feature cross-confusion, the deep separating dilated temporal convolutional network is separated into... D Each channel, for any given channel i Deeply separable dilated temporal convolutional networks use independent convolutional kernels to process attention-fused feature sequences. ,in It corresponds to the first i The parameterized attention score for each channel is used for quantization.X i right X j Independent causal effect; Dilated causal convolution introduces a dilation factor into standard convolution, enabling the convolution kernel to expand its receptive field exponentially for any sensor data sequence in a smart car. X i and scale u 1D convolution kernel U In time step t The output of the dilated causal convolution at the position is represented as: , in, f As the expansion factor, w i,z Indicates the first i The convolution kernel of the first... z The weight of each position, x t-φ·z Indicates time step t - f · z The input value at the location; if the expansion factor is set to the exponential value. f l = c l So, the network's first l The receptive field of the layer is: , in, k Indicates the kernel size. L Indicates the number of network layers. c Indicates the expansion coefficient; Solving the problem of training deep networks through residual connections, particularly for learning identity mappings. H ( x )= x A deep temporal convolutional network is represented as: , in, F ( x ) represents the residual function, and PReLU represents the parameterized modified linear activation function, which transforms the network from learning the identity mapping to learning the residual function. F ( x )= O ( x )- x .
[0010] Optionally, the step of designing a causal-constrained graph attention mechanism based on the causal adjacency matrix and constructing a causal-constrained enhanced graph attention anomaly diagnostic model specifically includes: Based on the causal adjacency matrix, a causal constraint graph attention mechanism is designed, which transforms the traditional fully connected attention computation into a sparse connected attention computation guided by the causal relationship of nodes. The temporal dependency relationship is modeled based on a decoder composed of a gated recurrent unit stacked network and a fully connected layer, the original input is reconstructed and trained. During the training process, the model parameters are optimized by minimizing the reconstruction error to obtain a trained graph attention anomaly diagnosis model.
[0011] Optionally, the design process of the graph attention mechanism for causal constraints is as follows: Let the causal adjacency matrix be A, for nodes X i and X j The features are concatenated to obtain the concatenated representation v. ij : , Among them, A ij =1 indicates a node X j It is a node X i The direct cause, || represents the feature concatenation operation; when node X j no X i The reason node is A ij =0, the concatenated vectors are filled with -∞; To maintain the dynamic attention advantage of graph attention networks, the concatenated features v are first processed. ij A linear transformation is performed, followed by nonlinear activation using LeakyReLU, and finally node calculation is performed based on the attention vector a. i For its cause node j Attention weights: , in, C i = { j | A ij = 1} represents a node X i The set of cause nodes, W represents the linear transformation weight matrix, a represents the attention vector, and LeakyReLU represents the modified linear activation function with leakage; After obtaining the normalized attention weights, the feature update of each node is achieved by weighted aggregation of the features of the cause node: H C = σ(α·X), in, The attention weight matrix is calculated using causal constraints. It is the unbiased representation composed of all updated node representations, where σ represents the nonlinear activation function; H C The original input is then reconstructed by a gated cyclic unit decoder, and α outputs the result for anomaly root cause localization and anomaly propagation path analysis.
[0012] Optionally, the hierarchical anomaly diagnosis strategy, based on the directed causal graph and the graph attention anomaly diagnosis model, integrates feature reconstruction error, variable causal relationships, and graph attention network weights to locate the root cause of the anomaly and identify the propagation path of the anomaly in the sensor network, specifically includes: The optimal anomaly detection threshold and corresponding reconstruction error for each sample are calculated using the directed causal graph and the graph attention anomaly diagnosis model. When the reconstruction error of any sample exceeds the set threshold, the sample is marked as an anomaly. For all samples marked as anomalous, feature anomaly scores are calculated, and all calculated anomaly scores are sorted in descending order. The features corresponding to the top K scores are selected as the potential root cause candidate set. P Then iterate through P Each feature in f i Different diagnostic strategies are used depending on the type of feature: like f i ∈ F c Then mark f i The root cause of the abnormality; among them, F c Represents the set of pure causal features; F e Represents the set of features of a pure fruit; F m Represents the intermediate feature set; like f i ∈ F e ∪ F m First check f i Causes and characteristics f c Does it appear P If it does not appear in the middle, then f i If it is an abnormal root cause, f c exist P In the middle, then calculate f i and f c abnormal score ratio x = s i / s c ,in s i Representation of features f i Abnormal scores, s c Representation of features f c Abnormal scores; if x Greater than the preset ratio threshold β This indicates that an anomaly occurred. f i Otherwise, it is believed that the root cause cannot be determined by abnormal scores alone, and it is necessary to combine graph attention weights for diagnosis. When the root cause cannot be identified by the outlier score, attention weight α based on the outlier sample sequence graph attention weight α is used. e Attention weight α of the most recent normal sample sequence n calculate f i and f c Inbound and outbound edge weight perturbation ratio c i and c c : , in, O f ={ g | A[ g , f ]=1} and I f ={ g |A[ f , g ]=1} respectively represent features f The set of outgoing and incoming edge feature indices, where |·| represents the absolute value operation. If c i and c c The ratio is greater than β Then the root is because f i Otherwise f c ; After identifying the root cause, the anomaly propagation path is traced based on the structure of the directed causal graph, as shown below: , in, f root Indicates the characteristics of abnormal root causes.f target Indicates the affected target features, in the middle. f 1, f 2 represents an intermediate feature on the abnormal propagation path; the propagation path is determined based on the directed edge relationships in the causal adjacency matrix A, starting from the root cause feature and tracing along the causal relationship chain to all affected downstream features.
[0013] Optionally, the feature types include pure causal features, pure effect features, and intermediate features; wherein, the pure causal feature is a feature with an in-degree of 0 in the directed causal graph; the pure effect feature is a feature with an out-degree of 0 in the directed causal graph; and the intermediate feature is a feature with both in-degree and out-degree being non-zero in the causal graph.
[0014] The present invention also provides an interpretable anomaly diagnostic system for intelligent vehicles, comprising: The causal relationship construction unit is used to collect multi-dimensional sensor data based on the intelligent vehicle test platform and construct a directed causal graph and a causal adjacency matrix to describe the causal relationships between sensor data. An anomaly diagnosis model construction unit is used to design a causal constraint graph attention mechanism based on the causal adjacency matrix and to construct a causal constraint-enhanced graph attention anomaly diagnosis model. The model application unit is used to construct a hierarchical anomaly diagnosis strategy that integrates feature reconstruction error, variable causal relationship and graph attention network weights based on the directed causal graph and the graph attention anomaly diagnosis model, so as to locate the root cause of the anomaly and identify the propagation path of the anomaly in the sensor network.
[0015] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: This invention discloses a method and system for interpretable anomaly diagnosis in intelligent vehicles. The method includes: collecting multi-dimensional sensor data based on an intelligent vehicle testing platform and constructing a directed causal graph and a causal adjacency matrix to describe the causal relationships between sensor data; designing a graph attention mechanism with causal constraints based on the causal adjacency matrix and constructing a graph attention anomaly diagnosis model with enhanced causal constraints; and constructing a hierarchical anomaly diagnosis strategy integrating feature reconstruction error, variable causal relationships, and graph attention network weights based on the directed causal graph and the graph attention anomaly diagnosis model to locate the root cause of the anomaly and identify the propagation path of the anomaly in the sensor network. This invention overcomes the problems of spurious correlation learning and lack of anomaly interpretation ability in existing technologies, achieving reliable anomaly detection and root cause diagnosis of multi-sensor data in intelligent vehicles. Attached Figure Description
[0016] 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.
[0017] Figure 1 This is a schematic diagram of the installation of the intelligent vehicle sensor data acquisition equipment in this embodiment; Figure 2 This is a schematic diagram illustrating the specific implementation process of the intelligent vehicle anomaly diagnosis framework in this embodiment; Figure 3 This is a schematic diagram of the attention-based deep separable dilated temporal convolutional network architecture in this embodiment; Figure 4 This is a diagram illustrating the causal relationships between the sensor variables of the intelligent vehicle in this embodiment; Figure 5 This is a schematic diagram of the causal adjacency matrix in this embodiment. Detailed Implementation
[0018] 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.
[0019] The purpose of this invention is to provide a method and system for diagnosing interpretable anomalies in intelligent vehicles, aiming to solve or improve at least one of the above-mentioned technical problems.
[0020] 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.
[0021] like Figure 1 As shown, this invention provides a method for interpretability anomaly diagnosis in intelligent vehicles, specifically a multi-sensor data anomaly diagnosis method for intelligent vehicles based on causal constraint-enhanced graph attention networks. The data acquisition device includes a high-precision integrated navigation system, a drive-by-wire chassis sensing system, data recording equipment, and a power supply device, all installed on an intelligent vehicle test platform. The data acquisition device is as follows: Figure 1 As shown, it is fixedly installed on the intelligent vehicle test vehicle to collect multi-dimensional sensor data in real time during the vehicle's operation.
[0022] like Figure 2As shown, the intelligent vehicle interpretability anomaly diagnosis framework of the present invention integrates causal inference and graph attention network technologies, aiming to effectively detect anomalies in intelligent vehicle sensor data and provide interpretable diagnostic results. The specific implementation process of this framework includes three main stages: variable causal relationship construction, model training, and anomaly diagnosis. Each stage works collaboratively to achieve end-to-end interpretable anomaly diagnosis capabilities.
[0023] S1, Constructing Variable Causality: Constructing variable causality includes the following steps: S11, Multi-source sensor data acquisition: This involves acquiring multi-dimensional sensor data based on the intelligent vehicle testing 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, speed, acceleration, and attitude information. The drive-by-wire chassis system provides the vehicle's control inputs and actuator status information.
[0024] The collected sensor data includes motor drive torque, vehicle chassis speed, wheel angle, northbound speed, eastbound speed, and so on. x Axial acceleration, y The system includes twelve characteristic variables: axial acceleration, vehicle longitude, vehicle latitude, 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.
[0025] Suppose the collected multidimensional time-series sensor data is ,in D Indicates the number of sensors. T The time step is defined as X. X is divided into a training set X' containing only normal data according to a certain splitting ratio. train Validation set X val and test set X containing injection anomalies test Use a length of oh The sliding window is in steps s Extract subsequence sets from each dataset ,in M This represents the total number of subsequences.
[0026] S12, Design of a Deep Separating Dilated Temporal Convolutional Network Based on Attention Mechanism: (e.g.) Figure 3 As shown, an attention-based Deep Separation Dilated Temporal Convolutional Network (ADSTCN) is used to infer causal relationships between sensor variables. According to Granger's definition of causality, if... X i Historical information can improve understanding X j The prediction accuracy is considered to be X i Granger caused Xj .
[0027] In deduction X j When the cause variable is , all other variables... X i≠j exist t Historical information prior to the time step should be included in the prediction. X j The value at the current time step. To avoid feature cross-contamination, ADSTCN is separated into... D Each channel. For any given channel i ADSTCN uses independent convolutional kernels to process attention-fused feature sequences. ,in It corresponds to the first i The parameterized attention score for each channel is used for quantization. X i right X j Independent causal effect.
[0028] Dilated causal convolution introduces a dilation factor into standard convolution, enabling the convolution kernel to expand its receptive field exponentially. This applies to any sensor data sequence in a smart car. X i and scale u 1D convolution kernel U In time step t The output of the dilated causal convolution at the position can be represented as: (1) in, f As the expansion factor, w i,z Indicates the first i The convolution kernel of the first... z The weight of each position, x t-φ·z Indicates time step t - f · z The input value at that location. If the expansion factor is set to an exponential value... f l = c l So, the network's first l The receptive field of the layer is: (2) in, k Indicates the kernel size. L Indicates the number of network layers. cThis represents the expansion coefficient. This exponential expansion allows the network to observe longer historical information without increasing the number of parameters, ensuring effective capture of long-term dependencies in time series data. As can be seen from the formula... y t Based on time step only t Previous data calculations ensure that information flows only from the past to the future, consistent with the basic assumption that "cause precedes effect".
[0029] Residual connection techniques are used to address the difficulty of training deep networks. For learning identity mappings... H ( x )= x For deep temporal convolutional networks, the stochastic gradient descent training strategy can easily lead to the network getting stuck in local optima. To alleviate network degradation, the network output is usually replaced with residual connections. (3) in, F ( x ) represents the residual function, and PReLU represents the parameterized modified linear activation function. This essentially transforms the network's learning from learning identity mappings to learning residual functions. F ( x )= O ( x )- x During training, based on F ( x Optimizing network parameters with a target of 0 is easier to achieve.
[0030] S13, Causality Verification: At the start of training, the attention scores for all channels are initialized to 1 and normalized using the softmax function. It is important to note that... X j The input sequence for the corresponding channel must lag behind other channels by at least one time step, because X j The result of the current time step can only be generated based on the value of its past time steps.
[0031] The sequences modeled independently for all channels are then residually connected, and subsequently compressed into one dimension through pointwise convolution to generate the target sequence. X j Predicted value During training, mean squared error was used as the prediction loss, and the initial loss of ADSTCN on the input data was recorded. and final loss To calculate the loss increment This is used for subsequent causal verification.
[0032] After training, the attention vector q jThe value of the attention vector changes, with higher attention scores implying a stronger predictive contribution. To determine the potential causes of the target variable, the k-means algorithm is used to refine the trained attention vector. Cluster analysis was performed to adaptively divide the attention scores into two clusters, with the cluster with the higher cluster center value identified as the "potential cause cluster" of the target variable, and the other cluster as the non-cause cluster.
[0033] Inspired by causal intervention theory, this study employs the permutation importance method to assess the causal influence of each variable within a potential causal cluster on the target feature, thereby identifying the primary causal variables. Specifically, for each potential causal feature... X c Create an intervention dataset, in which X c The sequence order is randomly permuted, while other features remain unchanged.
[0034] Use the trained network N j Re-predicting based on intervention dataset X j And calculate the incremental intervention loss. .like Then determine X c yes X j The real reason, and record it. X j The set of reasons C j .
[0035] Finally, ADSTCN is trained individually for each sensor feature in the intelligent vehicle system. Attention weights are analyzed to determine the potential causes of each feature, and the permutation importance method is used to verify the true causal features of each feature. All verified causal relationships are then integrated to construct a directed causal graph G=(V,E) and a causal adjacency matrix A∈{0,1}. D×D , respectively Figure 4 and Figure 5 As shown.
[0036] S2, Constructing a causal-constrained enhanced graph attention anomaly diagnostic model: This step specifically includes the following steps: S21, Design of a causal-constrained graph attention mechanism: Based on the causal adjacency matrix A constructed in stage S1, a causal-constrained graph attention mechanism is designed to restrict attention computation to the edge set determined by the causal adjacency matrix. According to the adjacency matrix A, attention is applied to nodes... X i and X j The eigenvalues are concatenated to obtain the concatenated representation v. ij : (4) Among them, A ij =1 indicates a node X j It is a node X i The direct cause is that || represents the feature concatenation operation. When a node X j no X i The cause node is A ij When = 0, the concatenated vector is padded with -∞ (in practical applications, the minimum value -10 is used). 9 Instead of using softmax normalization, the attention weights at these minimum-filled locations tend to zero, ensuring that feature aggregation is based solely on the actual causal features of each feature. During backpropagation in model training, gradients propagate only along causal paths, effectively isolating spurious correlations between unstable variables and ensuring the causal unbiasedness of model parameter estimation.
[0037] To maintain the dynamic attention advantage of graph attention networks, the concatenated features v need to be processed first. ij A linear transformation is performed, followed by nonlinear activation using LeakyReLU, and finally node calculation is performed based on the attention vector a. i Its cause node j Attention weights: (5) Among them, C i = { j | A ij = 1} represents a node X i The set of cause nodes is defined by W, where W represents the linear transformation weight matrix, a represents the attention vector, and LeakyReLU represents the modified linear activation function with leakage. This order of operations allows the attention mechanism to adaptively adjust the strength of the causal relationship between query nodes and key nodes during training, enabling more accurate modeling of complex interaction patterns between sensor features in intelligent vehicles.
[0038] After obtaining the normalized attention weights, the feature update of each node is achieved by weighted aggregation of the features of its cause node: H C = σ(α·X) (6) in, The attention weight matrix is calculated using causal constraints. H is the unbiased representation composed of all updated node representations, where σ represents the nonlinear activation function. CThe original input is then reconstructed by a gated cyclic unit decoder, and α outputs the result for anomaly root cause localization and anomaly propagation path analysis.
[0039] S22, Gated Recurrent Unit Decoder Design: Embedded Representation H of Causal Constraint Graph Attention Layer Output C The data encoded in the image contains spatial causal information among features of intelligent vehicle sensor data, and these features also have rich temporal dependencies that need to be modeled. A decoder based on a stacked network of gated recurrent units (GRUs) and fully connected layers models the temporal dependencies in the embedded representation and reconstructs the new representation as the original input.
[0040] The core of the GRU decoder consists of multiple stacked GRU networks. In sequential processing mode, the GRU processes the embedding representation h output by the causal graph attention layer step by step. t : (7) Among them, z t and r t These are the update gate and the reset gate, respectively, controlling the flow of information. z W r and W h U is the weight matrix used by the corresponding gating mechanism to process the input linear transformation. z U r and U h This is the weight matrix used to handle hidden state loops. z , b r and b h These are the corresponding bias vectors. t-1 m t and These represent the previous time step, the current time step, and the candidate hidden state, respectively. ⊙ represents the Hadamard product, σ represents the sigmoid activation function, and tanh represents the hyperbolic tangent activation function.
[0041] After processing the entire window in the GRU network, the set of hidden states for all time steps can be obtained. ,in H To conceal the spatial dimension. The final output layer will be H. G Mapped to a space with the same dimensions as the original input: X̂ = W o ·H G + b o (8) Among them, W o and b o These represent the weight matrix and bias vector of the output layer, respectively.
[0042] During training, the parameters of the decoder and the graph attention anomaly diagnosis model proposed in this invention are optimized by minimizing the reconstruction error: (9) Among them, ||·|| F This represents the Frobenius norm. This end-to-end training ensures that the model can accurately reconstruct sensor data from intelligent vehicles under normal operating conditions, while producing larger reconstruction errors when faced with anomalous data.
[0043] S3, Abnormal Root Cause Diagnosis and Propagation Path Analysis: This step specifically includes the following steps: S31, Anomaly Detection Threshold Determination: Using the causal relationship network constructed in S1 and the graph attention anomaly diagnosis model trained in S2, the optimal anomaly detection threshold is determined based on the validation set data. The reconstruction error for each sample in the validation set is calculated. (10) in, e i Indicates the first i The reconstruction error of each validation sample, X i Represents the original input, X̂ i This represents the output of the model reconstruction.
[0044] Set a series of candidate thresholds on the validation set. i candidate ∈ [ i min , i max For each candidate threshold, samples with reconstruction errors exceeding that threshold are marked as anomalies, and the corresponding precision, recall, and F1 score are calculated: (11) Where TP represents true positives, FP represents false positives, and FN represents false negatives. The threshold that optimizes the F1 score is selected as the final anomaly detection threshold. i optimal .
[0045] S32, Feature Type Classification: Based on the causal relationship network constructed in S1, features are classified into three types according to the in-degree and out-degree of nodes in the causal graph: Pure cause characteristics f c ∈ F c : F c = { v i | v j Aji = 0} refers to a feature with an in-degree of 0 in a causal graph. f c It is unaffected by any other characteristics besides itself and is the starting point of the causal chain.
[0046] Pure fruit characteristics f e ∈ F e : F e = { v i | v j A ij = 0} refers to a feature with an out-degree of 0 in a causal graph. f e It does not affect other characteristics except itself, and is the end point of the causal chain.
[0047] intermediate features f m ∈ F m : F m = { v i | j , k A ji = 1 ∩ A ik = 1} refers to a feature in a causal graph where both in-degree and out-degree are not 0. f m It is influenced by both upstream and downstream characteristics, and is an intermediate node in the propagation of causal effects.
[0048] S33, Hierarchical Anomaly Diagnosis Strategy: For test sets where reconstruction errors exceed a threshold i optimal For the abnormal sample sequence, the anomaly score for each feature is calculated based on the mean and variance of the feature reconstruction error: (12) in, m i Representation of features f i The mean reconstruction error, s i Representation of features f i The standard deviation of the reconstruction error l It is a balancing factor.
[0049] Sort all features by their anomaly scores in descending order, and select the top K features corresponding to these scores as the potential root cause candidate set P. Then iterate through each feature in P. f i Different diagnostic strategies are used depending on the type of feature: like f i ∈ F c ,because f i If there are no upstream causes, the anomaly must originate from itself, so it can be directly marked as the root cause of the anomaly.
[0050] like f i ∈ F e ∪ F m First check f i Causes and characteristics f c Does it appear in P? If it does not appear, then f i This is the root cause of the anomaly, indicating that the anomaly occurred independently rather than due to causal propagation. If f c In P, then calculate f i and f c abnormal score ratio x = s i / s c ,like x Greater than the preset ratio threshold β This indicates that an anomaly occurred. f i Otherwise, it is believed that the root cause cannot be determined by abnormal scores and that graph attention weights need to be combined for diagnosis.
[0051] S34, Graph Attention Weight Perturbation Analysis: When the root cause cannot be identified by the outlier score, graph attention weight α based on the outlier sample sequence is used. e Attention weight α of the most recent normal sample sequence n calculate f i and f c Inbound and outbound edge weight perturbation ratio c i and c c : (13) in, O f ={ g | A[ g , f ]=1} and I f ={ g |A[ f , g ]=1} respectively represent features f The set of outgoing and incoming edge feature indices, where |·| represents the absolute value operation. If c i and c c The ratio is greater than β Then the root is because f i Otherwise f c .
[0052] S35: Anomaly Propagation Path Identification: After identifying the root cause, the anomaly propagation path is traced based on the causal graph structure constructed in S1, and the propagation mechanism of the anomaly in the intelligent vehicle sensor network is analyzed. The anomaly propagation path can be represented as: (14) in, f root Indicates the characteristics of abnormal root causes. f target Indicates the affected target features, in the middle. f 1, f 2 represents intermediate features along the anomaly propagation path. The propagation path is determined based on the directed edge relationships in the causal adjacency matrix A, starting from the root cause feature and tracing along the causal chain to all affected downstream features.
[0053] Analyzing anomaly propagation paths allows us to understand how anomalies originate from root cause features and spread along causal chains to other features, providing valuable guidance for subsequent anomaly recovery and system maintenance. Identifying propagation paths not only helps understand the scope of anomaly impact but also provides targeted improvement suggestions for preventing similar anomalies from recurring.
[0054] The present invention provides a method and system for interpretable anomaly diagnosis of intelligent vehicles. By integrating graph attention network technology enhanced by causal constraints, it achieves efficient, reliable, and interpretable detection and diagnosis of anomalies in multi-sensor data of intelligent vehicles. This method not only accurately detects anomalies of various sensors but also provides detailed root cause analysis and propagation path identification, offering crucial technical support for the safe operation and system maintenance of intelligent vehicles.
[0055] In summary, the present invention has the following beneficial technical effects: This invention effectively addresses key issues in existing intelligent vehicle anomaly detection technologies by proposing a graph attention network framework based on causal constraints. First, by designing a causal-constrained graph attention mechanism, traditional fully connected attention computation is transformed into sparse connected attention computation guided by node causal relationships. This significantly reduces spurious correlation interference that may exist in traditional graph attention networks, improving the model's generalization ability and robustness.
[0056] Secondly, by constructing a hierarchical anomaly diagnosis strategy that integrates feature reconstruction error, variable causal relationships, and graph attention network weights, the root cause localization and propagation path identification of different types of anomalies were realized, providing actionable guidance for the safety and maintenance of intelligent vehicles.
[0057] Finally, this invention can effectively handle various types of sensor anomalies, including gradual drift, numerical deviation, data loss, signal instability, spike anomalies, and constant value anomalies. It maintains a high detection rate across all anomaly types, demonstrating excellent adaptability to multiple anomalies and providing important technical support for the safe operation of intelligent vehicle systems.
[0058] 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.
[0059] 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 diagnosing interpretability anomalies in intelligent vehicles, characterized in that, include: Multi-dimensional sensor data is collected based on an intelligent vehicle testing platform, and a directed causal graph and a causal adjacency matrix are constructed to describe the causal relationships between the sensor data. Based on the aforementioned causal adjacency matrix, a causal-constrained graph attention mechanism is designed, and a causal-constrained enhanced graph attention anomaly diagnostic model is constructed, specifically including: Based on the causal adjacency matrix, a causal constraint graph attention mechanism is designed, which transforms the traditional fully connected attention computation into a sparse connected attention computation guided by the causal relationship of nodes. Temporal dependencies are modeled based on a decoder composed of a gated recurrent unit stacked network and a fully connected layer to reconstruct the original input and perform training. During the training process, the model parameters are optimized by minimizing the reconstruction error to obtain a trained graph attention anomaly diagnosis model. Based on the directed causal graph and the graph attention anomaly diagnosis model, a hierarchical anomaly diagnosis strategy integrating feature reconstruction error, variable causal relationships, and graph attention network weights is constructed to locate the root cause of anomalies and identify the propagation path of anomalies in sensor networks. Specifically, this includes: The optimal anomaly detection threshold and corresponding reconstruction error for each sample are calculated using the directed causal graph and the graph attention anomaly diagnosis model. When the reconstruction error of any sample exceeds the set threshold, the sample is marked as an anomaly. For all samples marked as anomalous, feature anomaly scores are calculated, and all calculated anomaly scores are sorted in descending order. The features corresponding to the top K scores are selected as the potential root cause candidate set. P Then iterate through P Each feature in f i Different diagnostic strategies are used depending on the type of feature: like f i ∈ F c Then mark f i The root cause of the abnormality; among them, F c Represents the set of pure causal features; F e Represents the set of features of a pure fruit; F m Represents the intermediate feature set; like f i ∈ F e ∪ F m First check f i Causes and characteristics f c Does it appear P If it does not appear in the middle, then f i If it is an abnormal root cause, f c exist P In the middle, then calculate f i and f c abnormal score ratio ξ = s i / s c ,in s i Representation of features f i Abnormal scores, s c Representation of features f c Abnormal scores; if ξ Greater than the preset ratio threshold β This indicates that an anomaly occurred. f i Otherwise, it is believed that the root cause cannot be determined by abnormal scores alone, and it is necessary to combine graph attention weights for diagnosis. When the root cause cannot be identified by the outlier score, attention weight α based on the outlier sample sequence graph attention weight α is used. e Attention weight α of the most recent normal sample sequence n calculate f i and f c Inbound and outbound edge weight perturbation ratio γ i and γ c : in, O f ={ g | A[ g , f ]=1} and I f ={ g |A[ f , g ]=1} respectively represent features f The set of outgoing and incoming edge feature indices, where |·| represents the absolute value operation; if γ i and γ c The ratio is greater than β Then the root is because f i Otherwise f c ; After identifying the root cause, the anomaly propagation path is traced based on the structure of the directed causal graph, as shown below: in, f root Indicates the characteristics of abnormal root causes. f target Indicates the affected target features, in the middle. f 1, f 2 represents an intermediate feature on the abnormal propagation path; the propagation path is determined based on the directed edge relationships in the causal adjacency matrix A, starting from the root cause feature and tracing along the causal relationship chain to all affected downstream features.
2. The intelligent vehicle interpretability anomaly diagnosis method according to claim 1, characterized in that, The process of collecting multi-dimensional sensor data based on an intelligent vehicle testing platform and constructing a directed causal graph and a causal adjacency matrix to describe the causal relationships between the sensor data specifically includes: Multi-dimensional sensor data is collected based on an intelligent vehicle testing platform; the multi-dimensional sensor data includes motor drive torque, vehicle chassis speed, wheel rotation angle, northbound speed, eastbound speed, etc. x Axial acceleration, y Axial acceleration, vehicle longitude, vehicle latitude, heading angle, pitch angle, and roll angle; Based on the multidimensional sensor data, a deep separable dilated temporal convolutional network based on an attention mechanism is used to infer the causal relationships between sensor variables, and a directed causal graph and a causal adjacency matrix are constructed to describe the causal relationships between sensor data.
3. The intelligent vehicle interpretability anomaly diagnosis method according to claim 2, characterized in that, The process of inferring causal relationships between sensor variables using a deep separable dilated temporal convolutional network based on an attention mechanism includes: According to Granger's definition of causality, if data X i It can improve the data X j The prediction accuracy is considered to be X i Granger caused X j ; In deduction X j When the cause variable is all variables X i≠j exist t Historical information prior to the time step should be included in the prediction. X j The value at the current time step, to avoid feature cross-confusion, the deep separating dilated temporal convolutional network is separated into... D Each channel, for any given channel i Deeply separable dilated temporal convolutional networks use independent convolutional kernels to process attention-fused feature sequences. ,in It corresponds to the first i The parameterized attention score for each channel is used for quantization. X i right X j Independent causal effect; Dilated causal convolution introduces a dilation factor into standard convolution, enabling the convolution kernel to expand its receptive field exponentially for any sensor data sequence in a smart car. X i and scale u 1D convolution kernel U In time step t The output of the dilated causal convolution at the specified location is represented as: in, As the expansion factor, w i,z Indicates the first i The convolution kernel of the first generation z The weight of each position, Indicates time step t - · z The input value at the location; if the expansion factor is set to the exponential value. So, the network's first l The receptive field of the layer is: in, k Indicates the kernel size. L Indicates the number of network layers. c Indicates the expansion coefficient; Solving the problem of training deep networks through residual connections, particularly for learning identity mappings. H ( x )= x A deep temporal convolutional network is represented as: in, F ( x ) represents the residual function, and PReLU represents the parameterized modified linear activation function, which transforms the network from learning the identity mapping to learning the residual function. F ( x )= O ( x )- x .
4. The intelligent vehicle interpretability anomaly diagnosis method according to claim 1, characterized in that, The design process of the graph attention mechanism with causal constraints is as follows: Let the causal adjacency matrix be A, for nodes X i and X j The eigenvalues are concatenated to obtain the concatenated representation v. ij : Among them, A ij =1 indicates a node X j It is a node X i The direct cause, || represents the feature concatenation operation; when node X j no X i The reason node is A ij =0, the concatenated vectors are filled with -∞; To maintain the dynamic attention advantage of graph attention networks, the concatenated features v are first processed. ij A linear transformation is performed, followed by nonlinear activation using LeakyReLU, and finally node calculation is performed based on the attention vector a. X i For its cause node X j Attention weights: in, C i = { j | A ij = 1} represents a node X i The set of cause nodes, W represents the linear transformation weight matrix, a represents the attention vector, and LeakyReLU represents the modified linear activation function with leakage; After obtaining the normalized attention weights, the feature update of each node is achieved by weighted aggregation of the features of the cause node: H C = σ(α·X) Where, α∈ The attention weight matrix H is obtained through causal constraints. C ∈ It is the unbiased representation composed of all updated node representations, where σ represents the nonlinear activation function; H C The original input is then reconstructed by a gated cyclic unit decoder, and α outputs the result for anomaly root cause localization and anomaly propagation path analysis.
5. The intelligent vehicle interpretability anomaly diagnosis method according to claim 1, characterized in that, The feature types include pure causal features, pure effect features, and intermediate features; wherein, the pure causal feature is a feature with an in-degree of 0 in the directed causal graph; the pure effect feature is a feature with an out-degree of 0 in the directed causal graph; and the intermediate feature is a feature with both in-degree and out-degree being non-zero in the causal graph.
6. An intelligent vehicle interpretability anomaly diagnostic system, using the method as described in any one of claims 1-5, characterized in that, include: The causal relationship construction unit is used to collect multi-dimensional sensor data based on the intelligent vehicle test platform and construct a directed causal graph and a causal adjacency matrix to describe the causal relationships between sensor data. An anomaly diagnosis model construction unit is used to design a causal constraint graph attention mechanism based on the causal adjacency matrix and to construct a causal constraint-enhanced graph attention anomaly diagnosis model. The model application unit is used to construct a hierarchical anomaly diagnosis strategy that integrates feature reconstruction error, variable causal relationship and graph attention network weights based on the directed causal graph and the graph attention anomaly diagnosis model, so as to locate the root cause of the anomaly and identify the propagation path of the anomaly in the sensor network.
Citation Information
Patent Citations
Petrochemical production process anomaly diagnosis and optimization method and system integrated with knowledge graph
CN119668245A
Causal discovery and missing value imputation
EP4123509A1