A Sensor Anomaly Detection Method for Vehicle Networks Based on Channel-Spatiotemporal Attention Autoencoders
Patent Information
- Application Number
- CN202311167968.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-11
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-09-11
AI Technical Summary
[0004]鉴于此,本发明提出了一种新颖的基于通道-时空注意的自编码器网络来增强网络的表达能力,用于解决隐蔽型攻击产生的异常数据能被编码器精准拟合和重建的问题,降低漏报率
[0016] (1) This invention utilizes the Res2Net module to learn and fuse input-related information from multi-sensor data and generate multi-scale feature maps, thereby enhancing the multi-dimensional representation capability of the neural network.
Smart Images

Figure CN117041972B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of anomaly detection technology for autonomous vehicles, and relates to an anomaly detection method for vehicle network sensors based on channel-spatiotemporal attention autoencoders, and particularly to an anomaly detection method based on autoencoders combined with a memory enhancement model. Background Technology
[0002] Autonomous vehicles (AVs) rely on various sensors to assess the driving environment and issue necessary control commands. However, these sensors are vulnerable to spoofing and malicious data injection attacks. Anomalies in sensor readings caused by malicious cyberattacks can lead to destructive consequences. Anomaly detection strategies are applied in various applications, including fault diagnosis and attack detection. Due to the rapid development of wireless sensing and measurement technologies, autonomous driving process data can be described as a set of time-series observations. Time-series anomaly detection is spatiotemporally dependent, and classical statistical methods struggle to capture the long-term dynamic time-series model of a vehicle. Utilizing deep neural network methods to extract hierarchical and deep representations of the time-series model and constructing a model that facilitates future state inference is a novel anomaly detection and safety incident prevention strategy.
[0003] Reconstruction-based methods learn specific models to capture the low-dimensional latent space of given time-series data, then create a comprehensive reconstruction of the data to approximate the original input. Autoencoders are the foundational models for reconstruction learning, trained unsupervised on data to learn important features and latent related structures of the input data, comprising both an encoder and a decoder. As sequence length increases, the number of hidden states traversed from the encoder's hidden state to the corresponding hidden state in the decoder increases, leading to long-term dependency problems, and the most recent frames in the sequence are more informative than older frames. To address these issues, recent research introduces an attention mechanism between the encoder and decoder, which facilitates the selection of relevant encoder hidden states across all time steps, improving the model's ability to represent multivariate time-series data.
[0004] In view of this, the present invention proposes a novel channel-spatiotemporal attention-based autoencoder network to enhance the expressive power of the network, in order to solve the problem that the abnormal data generated by covert attacks can be accurately fitted and reconstructed by the encoder, thereby reducing the false negative rate. Summary of the Invention
[0005] This invention addresses the problems of existing reconstruction-based anomaly detection technologies by providing a vehicle network sensor anomaly detection method based on channel-spatiotemporal attention autoencoders, which has robustness, high detection efficiency, and accuracy.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows:
[0007] A method for anomaly detection of vehicle-to-everything (V2X) sensors based on channel-spatiotemporal attention autoencoder networks, comprising the following:
[0008] Time-series data of the vehicle's driving status are acquired by multiple sensors installed on the vehicle, and the data is preprocessed.
[0009] The preprocessed data is encoded using a PSE-Res2Net-based encoder;
[0010] The features output by the PSE-Res2Net-based encoder are integrated with a memory-enhanced temporal attention mechanism to achieve long-term dependency tracking and generate time-dependent global sequence features across segments.
[0011] By using a PSE-Res2Net-based decoder, the time-dependent global sequence features are transformed from the encoded low-dimensional representation to the high-dimensional representation of the original input. The reconstruction error is then calculated to obtain the detection results.
[0012] Secondly, the present invention provides a vehicle networking sensor anomaly detection system, comprising:
[0013] The data acquisition and preprocessing module acquires time-series data of the vehicle's driving status through multiple sensors installed on the vehicle, and preprocesses the data.
[0014] The detection module utilizes a channel-spatiotemporal attention-based autoencoder model to detect anomalies in vehicle driving states. This model includes a PSE-Res2Net-based encoder, a PSE-Res2Net-based decoder, and a memory-enhanced temporal attention module. The PSE-Res2Net-based encoder encodes the data output from the data acquisition and preprocessing module. The memory-enhanced temporal attention module integrates multi-scale features from the PSE-Res2Net-based encoder's output using a memory-enhanced temporal attention mechanism, enabling long-term dependency tracking and generating time-dependent global sequence features across segments. The PSE-Res2Net-based decoder converts the time-dependent global sequence features from the encoded low-dimensional representation into a high-dimensional representation of the original input, calculates the reconstruction error, and obtains the detection result.
[0015] Compared with the prior art, the present invention has the following advantages:
[0016] (1) This invention utilizes the Res2Net module to learn and fuse input-related information from multi-sensor data and generate multi-scale feature maps, thereby enhancing the multi-dimensional representation capability of the neural network.
[0017] (2) This invention uses the PSENet module to extract channel spatial attention of multi-scale feature maps. Through the interaction of channel attention mechanism and spatial attention mechanism, it captures position-aware channel information and channel-sensitive spatial information, so that feature context information can be fully utilized.
[0018] (3) In order to capture long-term dependencies across sequence segments, this invention designs a memory-enhanced temporal attention block to integrate multi-scale features and obtain global sequence information measured by the sensor.
[0019] In summary, this invention is used for sensor anomaly detection in autonomous vehicles. It introduces a channel-spatiotemporal attention mechanism to enhance the effective learning capability of multi-sensor time series data, while increasing the reconstruction error of abnormal data, thereby improving the efficiency of anomaly detection. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating the workflow of the method of the present invention;
[0021] Figure 2 is a framework diagram of the PSE-Res2Net module; (a) Res2Net module, (b) PSENet module;
[0022] Figure 3 This is a schematic diagram of the time-based attention module for memory enhancement.
[0023] Figure 4 It is a statistical histogram of reconstruction error;
[0024] Figures 5(a) and (b) show the reconstruction results of the velocity and acceleration features of the test set, respectively. Detailed Implementation
[0025] The present invention will now be further analyzed with reference to the accompanying drawings.
[0026] This invention proposes a method for anomaly detection of vehicle network sensors based on channel-spatiotemporal attention autoencoders. The technical solution is as follows: First, a data statistical detection mechanism is used to remove anomalous data from vehicle sensors. Then, a channel-spatiotemporal attention-based autoencoder network is used to detect sensor anomalies. The autoencoder consists of a memory-enhanced spatial attention module and an encoder and decoder based on a PSE-Res2Net module. The memory-enhanced temporal attention module is used to collect multi-scale features, thereby integrating the global sequence information estimated by the sensors. The PSE-Res2Net module uses Res2Net to generate multi-scale feature maps, enhancing the multi-dimensional representation capability of the neural network. Then, the PSENet module is applied to capture the interaction between channel attention and spatial attention, thereby obtaining location-aware channel information and channel-sensitive spatial information. Figure 1 Specifically:
[0027] Step 1: Acquire time-series data of the vehicle's driving status (e.g., position, speed, acceleration, steering angle) using multiple sensors installed on the vehicle; preprocess the above data;
[0028] The preprocessing involves removing outlier data.
[0029] The outlier removal process specifically involves using a state estimator based on an extended Kalman filter (EKF) to estimate the state of the multi-sensor fused time series data, then calculating the state residuals and performing statistical analysis on the residuals to remove outlier data.
[0030] Step 2: Encode the data from Step 1 using a PSE-Res2Net-based encoder.
[0031] Step 3: The features output by the PSE-Res2Net-based autoencoder are integrated with multi-scale features using a memory-enhanced temporal attention mechanism, which tracks long-term dependencies and generates time-dependent global sequence features across segments.
[0032] Step 4: Using a PSE-Res2Net-based decoder, the time-dependent global sequence features from Step 3 are converted from the encoded low-dimensional representation to the high-dimensional representation of the original input. The reconstruction error is then calculated and the detection results are obtained.
[0033] The method of this invention utilizes reconstruction error based on an autoencoder to detect anomalies in multi-sensor input time series.
[0034] In step one, data preprocessing relies on the perception and fusion of information from multiple sensors to perform state assessment, in order to obtain accurate information about the vehicle's surrounding environment and driving state, thereby eliminating abnormal data.
[0035] In step one, the state estimator based on EKF is modeled as follows:
[0036]
[0037]
[0038] P k+1|k+1 =(IK k+1|k S k+1|k )P k+1|k
[0039] in P is the state estimate at time steps k and k+1. k+1|k With P k+1|k+1 S is the error covariance matrix at time steps k and k+1. k With Hk It is a Jacobian matrix, K k+1|k It is the Kalman gain, S k+1|k It is the value of the Jacobian matrix at the predicted state value, y k+1 With y k+1|k These are the system measurement state and the system estimated state, respectively, and I is the identity matrix.
[0040] In step two, the PSE-Res2Net-based encoder will input the sequence X = [X1, X2, ..., X...]. T Encoded as Where T1 = T / 8; the PSE-Res2Net-based encoder includes four cascaded residual blocks, as shown in Figure 2. Each residual block consists of a Res2Net module and a PSENet module, and the convolutional layers of the encoder contain max pooling operations.
[0041] Each residual block uses the Res2Net module to obtain multi-scale feature maps, and then uses the PSENet module to extract channel and spatial attention.
[0042] The operation steps of the Res2Net module as shown in Figure 2(a) are as follows:
[0043] (1) Feature Subgraph Partitioning: Accepts the time series data after preprocessing in step one or the output of the previous residual block X = [X1, X2, ..., X...]. T [T] represents time, and a 1×1 convolution is used to process the input data. Divided into four sub-feature maps x i ∈R H×W×C' (i∈{1,2,3,4},C'=C / 4), where H, W and C represent the height, width and number of channels of the feature map, respectively;
[0044] (2) Convolution operation: The first sub-feature map x1 is directly used as the segmentation feature x1'; the second sub-feature map x2 is processed by a 3×3 convolution to obtain the segmentation feature x2'; the third sub-feature map x3 and the segmentation feature x2' are processed by a 3×3 convolution to obtain the segmentation feature x3'; the fourth sub-feature map x4 and the segmentation feature x3' are processed by a 3×3 convolution to obtain the segmentation feature x4'; finally, all the segmentation features x1' are obtained. i '(i∈{1,2,3,4},C'=C / 4).
[0045] (3) Feature connection: Connect all segmentation features x i 'Connect and pass to a 1×1 convolution to obtain the output X of the Res2Net module'.
[0046] As shown in Figure 2(b), the PSENet module includes a channel attention module and a spatial attention module. SENet is an attention mechanism model used to enhance the expressive power of Convolutional Neural Networks (CNNs). The channel attention module focuses on the most salient local features at different scales of the received feature map X' by utilizing the squeezing and activation operations of the SENet network, thereby helping to infer detailed channel features. The spatial attention module selects important location features by weighting all spatial features. The specific operations of the PSENet module are as follows:
[0047] (1) Calculate Channel Attention: The channel attention module performs a squeezing operation along the channel axis by combining average pooling (GAP) and max pooling (GMP) operations, followed by an excitation operation, and summarizes the feature information of each channel to obtain the average pooling feature of the channel. and max pooling features Then, the average pooling features of the channels are... and max pooling features The input is fed into two convolutional layers to learn channel relationships. The first convolutional layer has an output dimension of C / r (where r represents the channel grouping factor, typically set to 16). After passing through the ReLU non-linear activation function, it is fed into the second convolutional layer, which has an output dimension of C. Then, the sigmoid activation function is used to adjust the channel weights to obtain channel attention. G c The formula for calculating (X') is as follows:
[0048]
[0049] in σ represents the weight parameters of the convolutional layer, and σ is the non-linear activation function ReLU.
[0050] (2) Computational Spatial Attention: The spatial attention module selects important location features by weighting all spatial features, thus obtaining the spatial dimension attention G. w (X'), G w The formula for calculating (X') is as follows:
[0051]
[0052] F1 3×3 This indicates the first 1×1 convolution operation. This indicates the second 3×3 convolution operation. This indicates the third 1×1 convolution operation. This indicates the fourth 3×3 convolution operation, and BN represents the batch normalization operation.
[0053] (3) Generate cross-dimensional channels. Note: Use element summation operations to combine channels. Note G. c (X') and spatial dimension attention G w (X'), generating dimension is The cross-dimensional channel attention is obtained and standardized using the sigmoid function. Then, the standardized cross-dimensional channel attention is element-wise multiplied with the original input X' of the PSENet module to obtain the output features. The calculation formula is as follows:
[0054]
[0055] in This represents the Kronecker product of two matrices.
[0056] PSE-Res2Net takes the input sequence X = [X1, X2, ..., X...] as an input sequence. T Encoded as Where T1 = T / 8. This represents the characteristics at time T1 after processing through four cascaded residual blocks.
[0057] In step three, such as Figure 3 The memory-enhanced temporal attention mechanism includes memory blocks responsible for storing and maintaining state information; a controller that performs read, write, and update operations on the memory blocks; and a multi-head attention module for extracting context sequence information.
[0058] A memory block, as a storage mechanism, consists of a fixed number of unordered memory entries, each of which is a vector. The memory block representation of the feature map in the nth training iteration is a matrix. Where q represents the height of the feature map, d is the size of the memory block, B = (l × (T1 - l + 1)) is the dimension of the memory term, and l is the sequence length. Then, the p-th memory term in the nth training iteration is denoted as... This represents the p-th memory entry on the feature map.
[0059] The controller acts as the central processing unit, managing the interaction between memory blocks and attention modules. It controls read and write operations on memory blocks, as well as updates to memory items.
[0060] The input to the memory block is used to calculate the read weight of that memory block. and write weight To minimize reconstruction errors of normal data, memory entries are updated to record the prototype elements of the encoded normal data. The update formula for the p-th memory entry is as follows:
[0061]
[0062] Because some outlier data exists, this data can be effectively memorized through a combination of complex memory terms. Therefore, memory terms with weights greater than 1 / S are selected to memorize the input feature vector, where S is a constant greater than 1. If the weight value of a certain memory term... If it is less than 1 / S, then it will be forcibly set to 0.
[0063] The final read feature vector r n It is a weighted sum of each memory item, calculated using the following formula:
[0064]
[0065] Based on the classification method of feature sequences, r n Divide into T1-l+1 subsequences of length l, 0 < l < T1, where the j-th subsequence is denoted as r. n-(j) .
[0066] In the context of a vehicle's operation, information about its past and future states is more valuable than information about its distant future. To capture this dependency, this invention extracts the most influential contextual sequence information. First, the feature sequence... Divide into T1-l+1 subsequences of length l, i.e. set up The j-th subsequence The left and right contexts are respectively represented as and Where j∈{1,2,…,T1-l+1}, and The lengths of are L and R, respectively, and L and R are integer multiples of l. Furthermore, the average context... It is a subsequence The average value is then used. Next, the multi-head attention mechanism of the multi-head attention module is employed to convert the subsequence features into multi-head queries. Multi-head key and long position value The calculation formula for the bullish attention mechanism is as follows:
[0067]
[0068]
[0069]
[0070] The weight matrix The weights of queries, keys, and values for a specific header (i∈{1,2,…,g}) represent g subspaces at different scales. These are linear transformation parameters. This represents the representation of the j-th subsequence calculated using the i-th head attention mechanism. The Attention(·) function is used to calculate... By query s and keys Interaction and value Multiplying yields the result. (Multiple queries) It is a subsequence The context sequence and the linear transformation of the average context. Multi-headed key. and long position value It is the j-th block of the feature sequence X' and the subsequence read from the memory module. And linear transformations of the connections between its context sequences. This represents the j-th subsequence output by the multi-head attention module.
[0071] Finally, the T1-l+1 subsequences mapped by the multi-head attention module are processed by batch normalization and then input into the max pooling layer to obtain time-dependent global sequence features.
[0072]
[0073] In step four, the structure of the PSE-Res2Net-based decoder is similar to that of the encoder, consisting of four cascaded residual blocks. These residual blocks facilitate information flow by skipping connections, enabling the decoder to reconstruct the output based on the encoded features. The PSE-Res2Net-based decoder adds upsampling operations between the convolutional layers of the PSE-Res2Net-based encoder, allowing the decoder to generate a high-resolution output corresponding to the input data.
[0074] When training the model, consider the training dataset X. Tr ={x1,x2,…,x n There are n samples, each training sample x i It consists of T elements. The loss function includes memory addressing loss. With reconstruction losses loss function The calculation formula is as follows:
[0075]
[0076]
[0077]
[0078]
[0079]
[0080] Where ||·||2 represents Norm, Let F represent the expectation, and F represent the addressing function. These are the model training parameters, γ is the weighted parameter that determines the significance of the two loss functions, and λ is the optimal regularization parameter; E(x) i ) represents the sample x i Encode; ω i Represents the weight of the memory block D(·) indicates decoding via a PSE-Res2Net-based decoder.
[0081] Model training and anomaly detection optimize the PSE-Res2Net-based encoder and decoder to minimize the reconstruction error of normal data, while minimizing the reconstruction error of anomalous samples.
[0082] ① Parameter initialization: including λ, γ, max pooling and upsampling rates, kernel size, learning decay rate and weight decay rate;
[0083] ② Obtain multi-scale feature maps: X'←Res2Net(X);
[0084] ③ Encoding:
[0085] ④ Enhance memory:
[0086] ⑤ Decoding:
[0087] ⑥ Loss function training and model parameter update:
[0088] ⑦ Determine if convergence has occurred. If convergence has occurred, end the training.
[0089] Example:
[0090] This invention was tested on three autonomous driving datasets: comma2k19, KITTI, and CCSAD. The experimental setup consisted of a 12-core Intel processor, two NVIDIA GeForce RTX 3090 GPUs, and 64GB of RAM.
[0091] The specific implementation steps of the present invention will now be described in detail with reference to the accompanying drawings:
[0092] Step 1: Data preparation. Standardize the collected features related to driving status, such as position, speed, acceleration, and steering angle, and use a sliding window to generate continuous segments to divide the training set and test set.
[0093] Step 2: Parameter selection. The selection of training parameters will affect the performance of the detection model. Two important parameters will be discussed: 1) Context length, 2) Detection threshold τ.
[0094] Table 1 shows the impact of left and right context lengths on the three datasets.
[0095]
[0096] Table 1 illustrates the impact of different context lengths on the detection accuracy of the three datasets. When the context length is 0, there is no context embedding, resulting in the lowest accuracy among the three datasets.
[0097] Figure 4 A statistical histogram of the reconstruction error is given. Using maximum likelihood estimation, the parameters α and β of the probability density function are obtained as 15 and 392, respectively. Therefore, the mean and variance of the gamma distribution are μ = α / β and σ, respectively. 2 =α / β 2 Then the threshold τ is defined as τ=μ+ε*σ.
[0098] Step 3: Anomaly detection. An autoencoder is used to reconstruct the feature set. The encoder maps normal sample data into the convex set of the coding space, while abnormal data is outside the convex set. The reconstruction error is used to detect anomalies in the time series data fused from multiple sensors.
[0099] Figure 5 shows the reconstruction results of velocity and acceleration features of the test set. As can be seen from the figure, the method of the present invention can reconstruct the normal subsequence well, and the reconstruction error of the acceleration features does not exceed 0.1 m / s. 2 However, the method of this invention has a large reconstruction error for abnormal subsequences, with the reconstruction error of velocity features exceeding 6.3 kph, which is helpful for the detection of abnormal sensor data.
[0100] The anomaly detection model in step three of this embodiment is described below:
[0101] (1) Detector components: such as Figure 1 As shown, the detection model consists of three components: a PSE-Res2Net-based encoder for input encoding and query generation, a time attention module with memory-enhanced memory for long-term dependency tracking, and a PSE-Res2Net-based decoder for sample reconstruction.
[0102] (2) Reconstruction Process: As shown in Figure 2, the PSE-Res2Net module uses the Res2Net module to obtain multi-scale feature maps, and then extracts channel and spatial attention through the PSENet module. Subsequently, it utilizes... Figure 3The memory-enhanced temporal attention module shown integrates multi-scale features to obtain global sequence information and transmits it to the decoder for reconstruction.
[0103] (3) Loss Function: The loss function of the autoencoder consists of reconstruction loss and memory addressing loss. Reconstruction loss is used to ensure the similarity between the reconstructed data and the original data. Memory addressing loss is used not only to encourage the compactness of memory modules to ensure the similarity between memory elements and original features, but also to constrain memory weights. The sparsity of the memory avoids abnormal over-reconstruction due to complex combinations of memory items. Loss function The calculation formula is as follows:
[0104]
[0105]
[0106]
[0107]
[0108]
[0109] Detection process: Based on the selected threshold τ, anomalies are detected using reconstruction error.
[0110] The simulation method for abnormal trajectory data in step three is as follows: adversarial data is artificially generated using a perturbation scheme to simulate a stealth attack. Specifically, samples {X} are randomly selected. j} of m l Subsequences, and from X j Subtract or add 2m to the horizontal position to simulate a sensor spoofing attack.
[0111] Obviously, the above embodiments are illustrative examples of an anomaly detection method for sensors in autonomous vehicles, and are not intended to limit the implementation. Those skilled in the art can make other variations or modifications based on the above description. Any modifications and variations made to this invention are still within the scope of protection of this invention.
Claims
1. A vehicular internet of things sensor anomaly detection method based on channel-spatiotemporal attention autoencoding, characterized in that The method includes the following steps: Step S1: Acquire time-series data of the vehicle's driving status using multiple sensors installed on the vehicle, and preprocess the data. Step S2: Encode the preprocessed data using a PSE-Res2Net-based encoder; The PSE-Res2Net-based encoder encodes an input sequence into wherein ; the PSE-Res2Net-based encoder comprises four residual blocks connected in series, each residual block comprising a Res2Net module and a PSENet module; each residual block acquires multi-scale feature maps by using the Res2Net module, and then extracts channel and spatial attention through the PSENet module; the PSENet module specifically operates as follows: Channel attention: the channel attention module combines average pooling and max pooling operations along the channel axis, and then performs an excitation operation to aggregate the feature information of each channel to obtain the average pooling feature and the max pooling feature of the channel ; then, the average pooling feature and the max pooling feature of the channel are input into two convolutional layers to learn the channel relationship, i.e., the output dimension of the first convolutional layer is , wherein k represents a grouping factor of the channel, and after a nonlinear activation function , the output dimension of the second convolutional layer is Next, the sigmoid activation function is used to adjust the channel weight to obtain the channel attention The calculation formula is as follows: Equation (2) wherein , are weight parameters of the convolutional layer, is a non-linear activation function ; Computational Spatial Attention: The spatial attention module selects important location features by weighting all spatial features, thus obtaining spatial dimension attention. , The calculation formula is as follows: Equation (3) in This indicates the first 1×1 convolution operation. This indicates the second 3×3 convolution operation. This indicates the third 1×1 convolution operation. This indicates the fourth 3×3 convolution operation. This indicates a batch normalization operation; Note on generating cross-dimensional channels: Note the use of element-wise summation to combine channels. Spatial Dimension Attention The generation dimension is The cross-dimensional channel attention is obtained and standardized using the sigmoid function. Then, the standardized cross-dimensional channel attention is compared with the original input of the PSENet module. Element-wise multiplication yields the output features. The calculation formula is as follows: Equation (4) in This represents the Kronecker product of two matrices; Step S3: Integrate multi-scale features into the features output by the PSE-Res2Net-based encoder using a memory-enhanced temporal attention mechanism, track long-term dependencies, and generate time-dependent global sequence features across segments. Step S4: Using a PSE-Res2Net-based decoder, the time-dependent global sequence features are converted from the encoded low-dimensional representation to the high-dimensional representation of the original input. The reconstruction error is then calculated and the detection result is obtained.
2. The method according to claim 1, characterized in that... The preprocessing includes outlier removal; specifically, outlier removal involves using an EKF-based state estimator to estimate the state of the multi-sensor fused time series data, then calculating the state residuals and performing statistical analysis on the residuals to remove outlier data.
3. The method according to claim 2, characterized in that... The state estimator based on EKF is modeled as follows: Equation (1) in , In time step and State estimates on and In time step and The error covariance matrix on and It is a Jacobian matrix. It is Kalman gain. It is the value of the Jacobian matrix at the predicted state value. These are the system measured state and the system estimated state, respectively. It is a unit array.
4. The method according to claim 1, characterized in that... The Res2Net module acquires multi-scale feature maps, specifically as follows: Feature subgraph partitioning: Acceptance The time series data after preprocessing in step one or the output of the previous residual block , To indicate time, use The convolution will input data Divided into four sub-feature maps ,in , and These represent the height, width, and number of channels of the feature map, respectively. , , ; Convolution operation: First sub-feature map Directly used as segmentation features ; Second sub-feature map Through a The segmentation features are obtained after convolution processing. ; Third sub-feature map and segmentation features Through a The segmentation features are obtained after convolution processing. ; Fourth sub-feature map and segmentation features Through a The segmentation features are obtained after convolution processing. ; All segmentation features ; Feature connection: Connect all segmentation features Connect and pass to In the convolution, the output of the Res2Net module is obtained. .
5. The method according to claim 1, characterized in that... The PSENet module includes a channel attention module and a spatial attention module; the channel attention module processes the received feature maps. By utilizing the squeezing and excitation operations of the SENet network, we can focus on the most salient local features in the feature maps at different scales, which helps to infer detailed channel features. The spatial attention module selects important location features by weighting all spatial features.
6. The method according to claim 1, characterized in that... The memory-enhanced temporal attention mechanism includes a memory block responsible for storing and maintaining state information; a controller that performs read, write, and update operations on the memory block; and a multi-head attention module for extracting context sequence information. A memory block, as a storage mechanism, consists of a fixed number of unordered memory items, each of which is a vector; The memory blocks of the feature maps trained in this iteration are represented as matrices. ,in Indicates the height of the feature map. It is the memory block size. It is the dimension of the memory term. It is the sequence length; then the first... The training session of the 1st time The next memory item is recorded as , indicating the first on the feature map 1 memory item, of which ; The controller acts as the central processing unit, managing the interaction between memory blocks and attention modules; it controls read and write operations on memory blocks, as well as updates to memory items. The input to the memory block is used to calculate the read weight of that memory block. and write weight To minimize reconstruction errors of normal data, memory entries will be updated to record the prototype elements of the encoded normal data; where, the first... The update formula for each memory item is as follows: Equation (5) Select weight greater than A memory term is used to remember the input feature vector, where S is a constant greater than 1; if the weight value of a memory term is... Less than If so, then force it to be set to 0; Final read feature vector It is a weighted sum of each memory item, calculated using the following formula: Equation (6) Based on the classification method of feature sequences, Divided into A length of subsequence of , 0< < , of which The subsequence is represented as ; feature sequence Divided into A length of subsequence of ,set up The Middle Subsequences The left and right contexts are respectively represented as and ,in , and The lengths are respectively and ,and and yes Integer multiples of; in addition, average context It is a subsequence The average value is then used; subsequently, the subsequence features are transformed into multi-head queries using the multi-head attention mechanism of the multi-head attention module. Multi-head key and long position value The calculation formula for the multi-head attention mechanism is as follows: Equation (7) The weight matrix , , It refers to the weights of queries, keys, and values within a specific header, representing different scales. Each subspace, in which ; These are linear transformation parameters. Indicates passing through the first The first head attention mechanism calculated the... Representation of each subsequence; Functions are used to calculate By querying s and keys Interaction and value Multiplication yields the result; multi-head query It is a subsequence The context sequence and the linear transformation of the average context; multi-headed keys and long position value It is a characteristic sequence The Subsequences read from blocks and memory modules And linear transformations of the connections between its context sequences; This represents the j-th subsequence output by the multi-head attention module; Finally, the multi-head attention module is mapped. After batch normalization, each subsequence is input into the max pooling layer to obtain time-dependent global sequence features. ; Equation (8).
7. The method according to claim 1, characterized in that... The loss function includes memory addressing loss. With reconstruction losses loss function The calculation formula is as follows: Equation (9) in express Norm, Expressing expectations, Indicates the addressing function, These are the model training parameters. It is a weighted parameter that determines the significance of the two loss functions. It is the optimal regularization parameter; Indicates the sample Encode; Represents the weight of the memory block ; This indicates that decoding is performed using a PSE-Res2Net-based decoder.
8. A vehicle networking sensor anomaly detection system implementing the method of any one of claims 1-7, characterized in that... include: The data acquisition and preprocessing module acquires time-series data of the vehicle's driving status through multiple sensors installed on the vehicle, and preprocesses the data. The detection module utilizes a channel-spatiotemporal attention-based autoencoder model to detect anomalies in the vehicle's driving state; the channel-spatiotemporal attention-based autoencoder model includes a PSE-Res2Net-based encoder, a PSE-Res2Net-based decoder, and a memory-enhanced temporal attention module. The PSE-Res2Net-based encoder is responsible for encoding the data output from the data acquisition and preprocessing modules; The memory-enhanced temporal attention module is responsible for integrating multi-scale features from the PSE-Res2Net-based encoder output using a memory-enhanced temporal attention mechanism, tracking long-term dependencies, and generating time-dependent global sequence features across segments. The PSE-Res2Net-based decoder is responsible for converting time-dependent global sequence features from the encoded low-dimensional representation to the high-dimensional representation of the original input, calculating the reconstruction error, and obtaining the detection result.
Citation Information
Patent Citations
Scene text detection method combining collaborative learning and cascade feature fusion
CN116386021A
Array geometry agnostic multi-channel personalized speech enhancement
US20230116052A1