CN117041972A - Channel-space-time attention self-coding based anomaly detection method for vehicle networking sensor - Google Patents
Channel-space-time attention self-coding based anomaly detection method for vehicle networking sensor Download PDFInfo
- Publication number
- CN117041972A CN117041972A CN202311167968.9A CN202311167968A CN117041972A CN 117041972 A CN117041972 A CN 117041972A CN 202311167968 A CN202311167968 A CN 202311167968A CN 117041972 A CN117041972 A CN 117041972A
- Authority
- CN
- China
- Prior art keywords
- attention
- module
- channel
- memory
- res2net
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 38
- 230000006855 networking Effects 0.000 title claims description 7
- 230000003993 interaction Effects 0.000 claims abstract description 7
- 238000005259 measurement Methods 0.000 claims abstract description 5
- 238000000034 method Methods 0.000 claims description 38
- 230000006870 function Effects 0.000 claims description 20
- 230000007246 mechanism Effects 0.000 claims description 20
- 230000002159 abnormal effect Effects 0.000 claims description 17
- 238000004364 calculation method Methods 0.000 claims description 15
- 238000011176 pooling Methods 0.000 claims description 14
- 238000012549 training Methods 0.000 claims description 14
- 230000011218 segmentation Effects 0.000 claims description 12
- 208000037170 Delayed Emergence from Anesthesia Diseases 0.000 claims description 11
- 239000011159 matrix material Substances 0.000 claims description 10
- 238000007781 pre-processing Methods 0.000 claims description 10
- 230000007774 longterm Effects 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 9
- 230000004913 activation Effects 0.000 claims description 6
- 230000009466 transformation Effects 0.000 claims description 6
- 238000010606 normalization Methods 0.000 claims description 4
- 230000005284 excitation Effects 0.000 claims description 3
- 239000000284 extract Substances 0.000 claims description 3
- 238000001125 extrusion Methods 0.000 claims description 3
- 238000007619 statistical method Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 2
- 238000012545 processing Methods 0.000 claims description 2
- 238000003860 storage Methods 0.000 claims description 2
- 230000036962 time dependent Effects 0.000 claims description 2
- 230000006993 memory improvement Effects 0.000 abstract description 5
- 238000013528 artificial neural network Methods 0.000 abstract description 4
- 230000002123 temporal effect Effects 0.000 abstract description 3
- 230000008447 perception Effects 0.000 abstract description 2
- 230000035945 sensitivity Effects 0.000 abstract description 2
- 230000005856 abnormality Effects 0.000 description 5
- 230000001133 acceleration Effects 0.000 description 5
- 238000013527 convolutional neural network Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000002708 enhancing effect Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 238000007476 Maximum Likelihood Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W12/00—Security arrangements; Authentication; Protecting privacy or anonymity
- H04W12/12—Detection or prevention of fraud
- H04W12/121—Wireless intrusion detection systems [WIDS]; Wireless intrusion prevention systems [WIPS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/30—Services specially adapted for particular environments, situations or purposes
- H04W4/40—Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Evolutionary Computation (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Data Mining & Analysis (AREA)
- Signal Processing (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention discloses a channel-space-time attention self-coding based anomaly detection method for an Internet of vehicles sensor. The invention utilizes a self-encoder network based on memory enhanced channel-space-time attention to detect sensor spoofing attacks in an autopilot system, and the proposed detection method utilizes reconstruction errors to detect anomalies in a multi-sensor input time sequence. The detection model in the invention consists of a time attention block based on memory enhancement and an encoder and a decoder based on a PSE-Res2Net module. The PSE-Res2Net module firstly adopts the Res2Net module to generate a multi-scale feature map, the multi-dimensional representation capability of the neural network is enhanced, and then the PSENT module is used for capturing the channel information of the position perception and the space information of the channel sensitivity through the interaction of the channel attention and the space attention. Based on the memory-enhanced temporal attention module, global sequence information of sensor measurements is collected to integrate multi-scale features.
Description
Technical Field
The invention belongs to the technical field of automatic driving automobile anomaly detection, relates to an automobile networking sensor anomaly detection method based on channel-space-time attention self-coding, and particularly relates to anomaly detection based on a self-encoder, combined with a memory enhancement model.
Background
Autopilot cars (Autonomous Vehicles, AV) rely on various types of sensors to evaluate the driving environment and issue necessary control commands, however, these sensors are susceptible to false data injection and spoofing attacks, and anomalies in sensor readings caused by malicious network attacks can lead to damaging consequences. The anomaly detection strategy is applied to various applications such as fault diagnosis, attack detection and the like. Due to the rapid development of wireless sensing and measurement technologies, autopilot process data may be described in terms of a time series as a set of time series observations. Time series anomaly detection has space-time dependence, and a classical statistical method is difficult to capture a long-term dynamic time series model of a vehicle. The hierarchical representation and the depth representation of the time series model are extracted by using a deep neural network method, and the model which is helpful for future state inference is constructed as a novel abnormality detection and safety event prevention strategy.
The reconstruction-based method learns a particular model to capture a low-dimensional potential space for a given time series of data, and then creates a comprehensive reconstruction of the data to approximate the original input data. An automatic encoder is a fundamental model of a reconstruction learning method, and can train data in an unsupervised manner to learn important features and potentially relevant structures of input data, including both encoder and decoder components. As the length of the sequence increases, the number of concealment states passing from the concealment state of the encoder to the concealment state corresponding to the decoder increases, leading to long-term dependency problems, and observing the latest frame in the sequence is more informative than the old frame. In order to solve the series of problems, the latest research method introduces a focus mechanism between the model encoder and the decoder, which is beneficial to selecting relevant encoder hiding states in all time steps and improving the representation capability of the model on multi-element time series data.
In view of this, the invention proposes a novel channel-space-time attention-based self-encoder network to enhance the expression capability of the network, which is used for solving the problem that abnormal data generated by hidden attack can be accurately fitted and reconstructed by an encoder, and reducing the false alarm rate.
Disclosure of Invention
Aiming at the problems of the existing anomaly detection technology based on reconstruction, the invention provides the anomaly detection method of the vehicle networking sensor based on channel-space-time attention self-coding, which has robustness, higher detection efficiency and accuracy.
In order to achieve the above purpose, the technical scheme of the invention is as follows:
the method for detecting the anomaly of the vehicle networking sensor based on the channel-space-time attention self-encoder network comprises the following steps:
acquiring time series data of the running state of the automobile through a plurality of sensors arranged on the automobile, and preprocessing the data;
encoding the preprocessed data by using an encoder based on PSE-Res2 Net;
integrating multi-scale features on the features output by the encoder based on PSE-Res2Net by using a memory-enhanced time-attention mechanism, tracking long-term dependence, and generating global sequence features with time dependence in a span;
using a PSE-Res2Net based decoder, the global sequence features with time dependence are converted from a low-dimensional representation of the code to a high-dimensional representation of the original input, the reconstruction error is calculated and the detection result is obtained.
In a second aspect, the present invention provides an anomaly detection system for a vehicle networking sensor, comprising:
the data acquisition and preprocessing module acquires time series data of the running state of the automobile through a plurality of sensors arranged on the automobile and preprocesses the data;
the detection module is used for realizing abnormal detection of the running state of the automobile by using a self-encoder model based on channel-space-time attention; the self-encoder model based on channel-space-time attention comprises an encoder based on PSE-Res2Net, a decoder based on PSE-Res2Net and a memory enhanced time attention module; the encoder based on PSE-Res2Net is responsible for encoding the data output by the data acquisition and preprocessing module; the memory-enhanced time attention module is responsible for integrating multi-scale features on the features output by the encoder based on PSE-Res2Net by using a memory-enhanced time-attention mechanism, long-term dependency tracking and span generation of global sequence features with time dependency; the PSE-Res2Net based decoder is responsible for converting the time-dependent global sequence features from a coded low-dimensional representation to a high-dimensional representation of the original input, computing the reconstruction error and obtaining the detection result.
Compared with the prior art, the invention has the following advantages:
the invention utilizes Res2Net modules to learn information related to inputs fused with multisensor data and generate multiscale feature maps, thereby enhancing the multidimensional representation capability of a neural network
The PSENT module is used for extracting the channel space attention of the multi-scale feature map, and the channel information of the position perception and the channel sensitive space information are captured through the interaction of the channel attention mechanism and the space attention mechanism, so that the feature context information can be fully utilized.
Third, to capture long-term dependencies across sequence segments, the invention designs a memory-enhanced temporal attention block to integrate multi-scale features and obtain global sequence information for sensor measurements.
In summary, the invention is used for detecting the anomaly of the sensor of the automatic driving automobile, and a channel-space-time attention mechanism is introduced to aim at enhancing the effective learning capability of the multi-sensor time sequence and increasing the reconstruction error of the anomaly data, thereby improving the efficiency of anomaly detection.
Drawings
FIG. 1 is a block diagram of the workflow of the method of the present invention;
FIG. 2 is a block diagram of a PSE-Res2Net module; (a) a Res2Net module, (b) a PSENet module;
FIG. 3 is a schematic diagram of a memory enhanced time attention module;
FIG. 4 is a statistical histogram of reconstruction errors;
fig. 5 (a) - (b) are graphs of the reconstruction effect of the test set velocity and acceleration features, respectively.
Detailed Description
The invention is further analyzed in connection with the following figures.
The invention provides a channel-space-time attention self-coding based anomaly detection method for an Internet of vehicles sensor. The technical scheme adopted is as follows: firstly, eliminating abnormal data of a vehicle sensor by using a data statistics detection mechanism, and then, detecting the abnormal sensor by using a self-encoder network based on channel-space-time attention; the self-encoder consists of a spatial attention module based on memory enhancement and an encoder and a decoder based on a PSE-Res2Net module; the time attention module based on memory enhancement is used for collecting multi-scale characteristics so as to integrate global sequence information estimated by the sensor; the PSE-Res2Net module generates a multi-scale feature map by utilizing Res2Net, the multi-dimensional representation capability of the neural network is enhanced, and then the PSENT module is applied to capture interaction of channel attention and space attention, so that the channel information of location awareness and the space information of channel sensitivity are obtained. As shown in fig. 1, the following steps are specifically:
step one: acquiring time-series data (e.g., position, speed, acceleration, steering angle) of a running state of an automobile by a plurality of sensors mounted on the automobile; preprocessing the data;
the preprocessing adopts abnormal data elimination;
the abnormal data rejection specifically comprises the steps of performing state estimation on the time series data fused by the multiple sensors by using a state estimator based on extended Kalman filtering (Extended Kalman Filter, EKF), and then calculating state residual errors and performing statistical analysis on the residual errors so as to reject the abnormal data.
Step two: step one data is encoded using a PSE-Res2Net based encoder.
Step three: integrating multi-scale features on the features output by the encoder based on PSE-Res2Net by using a memory-enhanced time-attention mechanism, tracking long-term dependence, and generating global sequence features with time dependence in a span;
step four: and converting the global sequence characteristics with time dependence in the step three from the encoded low-dimensional representation to the high-dimensional representation of the original input by using a decoder based on PSE-Res2Net, calculating a reconstruction error and obtaining a detection result.
The method of the invention utilizes reconstruction errors based on the self-encoder to detect anomalies in the multi-sensor input time series.
In the first step, the data preprocessing is to perform state evaluation according to the sensing and fusion of the multi-sensor information so as to acquire accurate information of the surrounding environment and driving state of the vehicle, thereby eliminating abnormal data.
In step one, an EKF-based state estimator is modeled as:
P k+1|k+1 =(I-K k+1|k S k+1|k )P k+1|k
wherein the method comprises the steps ofIs the state estimate, P, at time steps k and k+1 k+1|k And P k+1|k+1 Is the error covariance matrix at time steps k and k+1, S k And H is k Is a jacobian matrix, K k+1|k Is Kalman gain, S k+1|k Is the value of the jacobian matrix at the state prediction value, y k+1 And y is k+1|k The system measurement state and the system estimation state are respectively, and I is a unit array.
In the second step, the encoder based on PSE-Res2Net inputs the sequence X= [ X ] 1 ,X 2 ,…,X T ]Encoded asWherein T is 1 =t/8; the PSE-Res2 Net-based encoder comprises four serially connected residual blocks, wherein each residual block is composed of a Res2Net module and a PSENT module in FIG. 2, and the convolution layers of the encoder comprise maximum pooling operation.
Each residual block acquires a multi-scale feature map using a Res2Net module, and then extracts channel and spatial attention through a PSENet module.
The operation steps of the Res2Net module as described in fig. 2 (a) are:
dividing a characteristic subgraph: receiving the time series data preprocessed in the step one or the output result X= [ X ] of the last residual block 1 ,X 2 ,…,X T ]T represents time, input data is convolved with 1×1Divided into four sub-feature maps x i ∈R H×W×C' (i e {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;
the convolution operation: first sub-feature map x 1 Directly as a segmentation feature x 1 'A'; second sub-feature map x 2 The segmentation feature x is obtained after a 3 x 3 convolution process 2 'A'; third sub-feature map x 3 And segmentation feature x 2 ' after a 3 x 3 convolution process, the segmented feature x is obtained 3 'A'; fourth sub-feature map x 4 And segmentation feature x 3 ' after a 3 x 3 convolution process, the segmented feature x is obtained 4 'A'; finally, all the segmentation features x are obtained i ’(i∈{1,2,3,4},C'=C/4)。
Characteristic connection: all the segmentation features x i The 'connection is passed to a 1X 1 convolution to yield the output X' of the Res2Net block.
The PSENet module as described in fig. 2 (b) includes a channel attention module and a spatial attention module. SENet is a model of the attention mechanism used to enhance the expression capacity of convolutional neural networks (Convolutional Neural Network, CNN). The channel attention module focuses on the most significant local features in the feature map at different scales by both pressing and exciting the received feature map X' with the SENet network, thereby helping to infer fine channel features. The spatial attention module selects important location features by weighting all spatial features. The specific operation of the PSENet module is as follows:
calculating channel attention: the channel attention module performs extrusion operation along channel axis by combining average pooling (GAP) and maximum pooling (GMP) operation, and then performs excitation operation, and sums characteristic information of each channel to obtain average pooling characteristic of the channelAnd maximum pooling feature->Then, the average pooling feature of the channel +.>And maximum pooling feature->The relation of the channels is learned by inputting the relation into two convolution layers, namely, the output dimension of the first convolution layer is C/r (r represents the grouping factor of the channels and is usually set to be 16), and the relation is input into the second convolution layer after passing through a nonlinear activation function ReLU, wherein the output dimension is C. Then, the channel weights are adjusted using the sigmoid activation function to get the channel attention +.>G c The calculation formula of (X') is as follows,
wherein the method comprises the steps ofIs a weight parameter of the convolution layer, σ is a nonlinear activation function ReLU.
The calculation space is noted: the spatial attention module selects important position features by weighting all spatial features to obtain spatial dimension attention G w (X'),G w The calculation formula of (X') is as follows,
wherein F is 1 3×3 Representing the first 1 x 1 convolution operation,representing a second 3 x 3 convolution operation, < > and->Representing a third 1 x 1 convolution operation, < >>Representing the fourth 3 x 3 convolution operation, BN represents the batch normalization operation.
Generating cross-dimensional space channel attention: combining channel attention G using element summation operations c (X') and spatial dimension attention G w (X') with a dimension of generationThe cross-dimensional space channel attention of the PSENT module is normalized by adopting a sigmoid function, and then the normalized cross-dimensional space channel attention is multiplied by the original input X' of the PSENT module to obtain an output characteristic-> The calculation formula of (c) is as follows,
wherein the method comprises the steps ofThe Kronecker product of the two matrices is represented.
PSE-Res2Net will input sequence x= [ X 1 ,X 2 ,…,X T ]Encoded asWherein T is 1 =T/8。/>Representing T processed through four serially connected residual blocks 1 The characteristics of the moment.
In step three, the time-attention mechanism of memory enhancement as in FIG. 3 includes a memory block responsible for storing and maintaining state information; a controller for performing read, write and update operations on the memory block; and a multi-headed note module for extracting context sequence information.
Memory blocks are used as a storage mechanism and consist of a fixed number of unordered memory entries, each of which is a vector. The memory blocks of the feature map of the nth training are represented as a matrixWhere q represents the height of the feature map, d is the memory block size, b= (l× (T 1 -l+1)) is the dimension of the memory term, l is the sequence length. The p-th memory term of the nth training is marked as +.>Representing the p-th memory item on the feature map.
The controller acts as a central processing unit, managing interactions between the memory blocks and the attention module. It controls the read-write operation of the memory block and the update of the memory item.
The input of the memory block is used for calculating the reading weight of the memory blockAnd write weight +.>To minimize reconstruction of normal dataError, the memory item will be updated to record the prototype element of the encoded normal data. Wherein, the update formula of the p-th memory term is as follows,
since there are some abnormal sample data, these data can be memorized well by the combination of complex memory terms, so memory terms with weights greater than 1/S are selected to memorize the input feature vector, S is a constant greater than 1. If the weight value of a certain memory termLess than 1/S, it is forced to be 0.
Final read feature vector r n Is the weighted sum of each memory term, the calculation formula is as follows,
according to the classification method of the characteristic sequence, r is calculated n Divided into T 1 L+1 subsequences of length l, 0 < l < T 1 Wherein the jth subsequence is denoted r n-(j) 。
In the running state of the vehicle, the state information of the past and future periods is more valuable than the information of the distant time. To capture this dependency, the present invention will extract the most influential context information. First, the feature sequence isDivided into T 1 -l+1 subsequences of length l, i.e.>Is provided with->The j-th subsequence->The left-hand context and the right-hand context of (a) are denoted by +.>And->Wherein j is {1,2, …, T 1 -l+1},/>And->Is L and R, respectively, and L and R are integer multiples of L. Furthermore, the average context->Is a subsequence->Average value of (2). Then, the sub-sequence feature is converted into a multi-head query +.>Multi-head key-> And Multihead value->The calculation formula of the multi-head attention mechanism is as follows:
wherein the weight matrixIs the weight of the query, key and value of a particular header (i e {1,2, …, g }) representing g subspaces of different dimensions, < }>Is a linear transformation parameter, +.>A representation of the jth subsequence calculated by the ith head-attention mechanism. Attention (& gt) function for computingBy making inquiries +.>And bond->Interaction with the value->Multiplication. Multi-head inquiry->Is a subsequence->Is a linear transformation of the average context. Multi-headKey->And Multihead value->Is the j-th block of the characteristic sequence X' and the subsequence read by the memory module +.>And linear transformation of the connection between its context sequences. />Representing the j-th sub-sequence output by the multi-head attention module.
Finally, T mapping the multi-head attention module 1 The l+1 subsequences are input to the maximum pool layer after Batch normalization operation, and global sequence characteristics with time dependency are obtained
In the fourth step, the structure of the decoder based on PSE-Res2Net is similar to that of the encoder, and the decoder consists of four serially connected residual blocks. These residual blocks facilitate the information flow by skipping the connection, enabling the decoder to reconstruct the output from the coding features. The PSE-Res2Net based decoder is to add up-sampling operations between convolutions of the PSE-Res2Net based encoder to enable the decoder to generate a high resolution output corresponding to the input data.
During model training, a training data set X is considered Tr ={x 1 ,x 2 ,…,x n N samples, each training sample x i Consists of T elements. The penalty function includes memory addressing penaltyAnd reconstruction loss->Loss function->The calculation formula of (c) is as follows,
wherein I II 2 Representation ofNorms (F/F)>Indicating the desire, F indicates the addressing function, +.>Is a model training parameter, gamma is a weighting parameter for determining the significance of two loss functions, and lambda is an optimal regularization parameter; e (x) i ) Representation of sample x i Coding; omega i Weight representing memory block>D (-) represents decoding by a PSE-Res2Net based decoder.
Model training and anomaly detection optimize the encoder based on PSE-Res2Net and the decoder based on PSE-Res2Net, so that the reconstruction error of normal data is minimized, and the reconstruction error of an anomaly sample is larger.
(1) Parameter initialization: the method comprises lambda, gamma, maximum pooling and up-sampling rate, convolution kernel size, learning attenuation rate and weight attenuation rate;
(2) acquiring a multi-scale feature map: x' ≡Res2Net (X);
(3) encoding:
(4) enhancing memory:
(5) decoding:
(6) loss function training and model parameter updating:
(7) judging whether convergence is carried out, if so, ending training.
Examples:
the invention has been tested on 3 autopilot datasets: comma2k19, KITTI and CCSAD data sets. The experimental setup was equipped with a 12-core intel processor, two NVIDIA GeForce RTX 3090 GPUs and 64GB memory.
The following describes in detail the specific implementation steps of the present invention with reference to the accompanying drawings:
step one: and (3) data preparation, namely standardizing the acquired characteristics of the position, the speed, the acceleration, the steering angle and the like related to the driving state, generating continuous segments by applying a sliding window, and dividing a training set and a testing set.
Step two: 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 τ.
Table 1 influence of left and right context length on three data sets
Table 1 illustrates the effect of different context lengths on the detection accuracy of three data sets. When the context length is 0, no context is embedded, and accuracy is the lowest among the three data sets.
Fig. 4 shows a statistical histogram of the reconstruction errors. Parameters alpha and beta of probability density function obtained by maximum likelihood estimation are 15 and 392 respectively, and mean value and variance of gamma distribution are μ=alpha/beta, sigma respectively 2 =α/β 2 The threshold τ is defined as τ=μ+ε.
Step three: and (3) abnormality detection, wherein an automatic encoder is adopted to reconstruct a feature set, the encoder maps normal sample data into a convex set of an encoding space, abnormal data is outside the convex set, and a reconstruction error is utilized to detect abnormality of time series data input by a fusion multi-sensor.
FIG. 5 is a graph showing the reconstruction effects of the velocity features and the acceleration features of the test set, and from the graph, it can be seen that the method of the invention can well reconstruct a normal subsequence, and the reconstruction error of the acceleration features is not more than 0.1m/s 2 . The method has larger reconstruction error of the abnormal subsequence and the reconstruction error of the speed characteristic is larger than 6.3kph, thereby being beneficial to the detection of the abnormal sensor data.
The abnormality detection model in step three of the present embodiment is described as follows:
the detector assembly: as shown in fig. 1, the detection model consists of three components, including a PSE-Res2Net based encoder for input encoding and query generation, a time-awareness module for memory-enhanced long-term dependency tracking, and a PSE-Res2Net based decoder for sample reconstruction.
The reconstruction process: as shown in FIG. 2, the PSE-Res2Net module takes the multi-scale feature map with the Res2Net module and then draws channel and spatial attention through the PSENT module. The multi-scale features are then integrated using the memory enhanced temporal attention module shown in fig. 3, global sequence information is obtained and transmitted to the decoder for reconstruction.
The loss function is as follows: the loss function of the self-encoder consists of reconstruction loss for ensuring the similarity between reconstructed data and original data and memory addressing loss for not only encouraging the compactness of the memory module to ensure the similarity between memory elements and original features, but also for constraining the memory weightsAvoiding abnormal over-reconstruction due to complex combinations of memory terms. Loss function->The calculation formula of (c) is as follows,
the detection process comprises the following steps: and detecting the abnormality by using the reconstruction error according to the selected threshold tau.
The simulation mode of the abnormal track data in the third step is as follows: challenge data is artificially generated using a perturbation scheme to simulate a stealth attack. Specifically, randomly select samples { X } j M of } l Subsequence, and from X j Subtracting or adding 2m from the lateral position of (c), simulating a sensor spoofing attack.
It is apparent that the above-described embodiments are illustrative of a method for detecting anomalies in an autopilot sensor, and are not intended to be limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. Any modifications and variations made thereto are still within the scope of the invention.
Claims (10)
1. The method for detecting the anomaly of the vehicle networking sensor based on the channel-space-time attention self-coding is characterized by comprising the following steps of:
acquiring time series data of the running state of the automobile through a plurality of sensors arranged on the automobile, and preprocessing the data;
encoding the preprocessed data by using an encoder based on PSE-Res2 Net;
integrating multi-scale features on the features output by the encoder based on PSE-Res2Net by using a memory-enhanced time-attention mechanism, tracking long-term dependence, and generating global sequence features with time dependence in a span;
using a PSE-Res2Net based decoder, the global sequence features with time dependence are converted from a low-dimensional representation of the code to a high-dimensional representation of the original input, the reconstruction error is calculated and the detection result is obtained.
2. The method of claim 1, wherein the preprocessing includes outlier rejection; the abnormal data rejection specifically comprises the steps of performing state estimation on the multi-sensor fused time series data by using an EKF-based state estimator, then calculating a state residual error and performing statistical analysis on the residual error, so as to reject the abnormal data.
3. The method of claim 2, wherein the EKF-based state estimator is modeled as:
P k+1|k+1 =(I-K k+1|k S k+1|k )P k+1|k (1)
Wherein the method comprises the steps ofIs the state estimate, P, at time steps k and k+1 k+1|k And P k+1|k+1 Is the error covariance matrix at time steps k and k+1, S k And H is k Is a jacobian matrix, K k+1|k Is Kalman gain, S k+1|k Is the value of the jacobian matrix at the state prediction value, y k+1 And y is k+1|k The system measurement state and the system estimation state are respectively, and I is a unit array.
4. The method according to claim 1, characterized in that the PSE-Res2Net based encoder will input the sequence x= [ X 1 ,X 2 ,…,X T ]Encoded asWherein T is 1 =t/8; the PSE-Res2 Net-based encoder comprises four serially connected residual blocks, wherein each residual block comprises a Res2Net module and a PSENT module;
each residual block acquires a multi-scale feature map using a Res2Net module, and then extracts channel and spatial attention through a PSENet module.
5. The method according to claim 4, wherein the Res2Net module obtains a multi-scale feature map, specifically:
dividing a characteristic subgraph: receiving the time series data preprocessed in the step one or the output result X= [ X ] of the last residual block 1 ,X 2 ,…,X T ]T represents time, input data is convolved with 1×1Division into four sub-feature maps->Wherein H, W and C respectively represent the height, width and channel number of the feature map;
the convolution operation: first sub-feature map x 1 Directly as a segmentation feature x 1 'A'; second sub-feature map x 2 The segmentation feature x is obtained after a 3 x 3 convolution process 2 'A'; third sub-feature map x 3 And segmentation feature x 2 ' after a 3 x 3 convolution process, the segmented feature x is obtained 3 'A'; fourth sub-feature map x 4 And segmentation feature x 3 ' after a 3 x 3 convolution process, the segmented feature x is obtained 4 'A'; finally, all the segmentation features x are obtained i ’(i∈{1,2,3,4},C'=C/4);
Characteristic connection: all the segmentation features x i The 'connection is passed to a 1X 1 convolution to yield the output X' of the Res2Net block.
6. The method of claim 4, wherein the PSENet module comprises a channel attention module and a spatial attention module; the channel attention module focuses on the most obvious local features in the received feature map X' by utilizing two operations of extrusion and excitation of a SENet network under different scales, so that the channel attention module is helpful for deducing detailed channel features; the spatial attention module selects important location features by weighting all spatial features.
7. The method of claim 4, wherein the PSENet module operates as follows:
calculating channel attention: the channel attention module performs extrusion operation along the channel axis by combining average pooling and maximum pooling operation, and performs excitation operation afterwards, and gathers characteristic information of each channel to obtain average pooling characteristics of the channelAnd maximum pooling feature->Then, the average pooling feature of the channel +.>And maximum pooling feature->The relation of the channels is learned by inputting the relation into two convolution layers, namely, the output dimension of the first convolution layer is C/r, r represents the grouping factor of the channels, the channel is input into the second convolution layer after passing through a nonlinear activation function ReLU, and the output dimension is C; then, the channel weights are adjusted using the sigmoid activation function to get the channel attention +.>G c The calculation formula of (X') is as follows:
wherein the method comprises the steps ofIs the weight parameter of the convolution layer, sigma is the nonlinear activation function ReLU;
the calculation space is noted: the spatial attention module selects important position features by weighting all spatial features to obtain spatial dimension attention G w (X'),G w The calculation formula of (X') is as follows:
wherein F is 1 1×1 Representing the first 1X 1 convolution operation, F 2 3×3 Representing a second 3 x 3 convolution operation, F 3 3×3 Representing a third 1 x 1 convolution operation, F 4 1×1 Representing a fourth 3 x 3 convolution operation, BN representing a batch normalization operation;
generating cross-dimensional space channel attention: combining channel attention G using element summation operations c (X') and spatial dimension attention G w (X') with a dimension of generationThe cross-dimensional space channel attention of the PSENT module is normalized by adopting a sigmoid function, and then the normalized cross-dimensional space channel attention is multiplied by the original input X' of the PSENT module to obtain an output characteristic-> The calculation formula of (2) is as follows:
wherein the method comprises the steps ofThe Kronecker product of the two matrices is represented.
8. The method of claim 7, wherein the memory-enhanced time-attention mechanism comprises a memory block responsible for storing and maintaining state information; a controller for performing read, write and update operations on the memory block; a multi-head attention module for extracting context sequence information;
the memory block is used as a storage mechanism and consists of a fixed number of unordered memory items, and each memory item is a vector; the memory blocks of the feature map of the nth training are represented as a matrixWhere q represents the height of the feature map, d is the memory block size, b= (l× (T 1 -l+1)) is the dimension of the memory term, l is the sequence length; the p-th memory term of the nth training is marked as +.>Representing the p-th memory item on the feature map;
the controller acts as a central processing unit and manages the interaction between the memory block and the attention module; it controls the read-write operation of the memory block and the update of the memory item;
the input of the memory block is used for calculating the reading weight of the memory blockAnd write weight +.>In order to minimize the reconstruction error of the normal data, the memory item is updated to record the prototype element of the encoded normal data; wherein, the update formula of the p-th memory term is as follows,
selecting a memory term having a weight greater than 1/S to store the input feature vector, S being a constant greater than 1; if the weight value of a certain memory termLess than 1/S, it is forcedly set to 0;
final read feature vector r n Is the weighted sum of each memory term, the calculation formula is as follows,
according to the classification method of the characteristic sequence, r is calculated n Divided into T 1 L+1 subsequences of length l, 0 < l < T 1 Wherein the jth subsequence is denoted r n-(j) ;
Sequence of featuresDivided into T 1 -l+1 subsequences of length l, i.e.>Is provided withThe j-th subsequence->The left-hand context and the right-hand context of (a) are denoted by +.>And->Wherein j is {1,2, …, T 1 -l+1},/>And->Is L and R, respectively, and L and R are integer multiples of L; furthermore, the average context->Is a subsequence->Average value of (2); then, the sub-sequence features are converted into multi-head queries by utilizing the multi-head attention mechanism of the multi-head attention moduleMulti-head key->And Multihead value->The calculation formula of the multi-head attention mechanism is as follows:
wherein the weight matrixIs the weight of the query, key and value of a particular header (i e {1,2, …, g }) representing g subspaces of different dimensions, < }>Is a linear transformation parameter, +.>A representation representing a j-th subsequence calculated by an i-th head attention mechanism; attention (&) function is used to calculate +.>By making inquiries +.>And bond->Interaction with the value->Multiplying to obtain; multi-head inquiry->Is a subsequence->A linear transformation of the context sequence and the average context; multi-head key->And Multihead value->Is the j-th block of the characteristic sequence X' and the subsequence read by the memory module +.>Linear transformation of the connection between its context sequences; />Representing the j sub-sequence output by the multi-head attention module;
finally, T mapping the multi-head attention module 1 The l+1 subsequences are input to the maximum pool layer after Batch normalization operation, and global sequence characteristics with time dependency are obtained
9. The method of claim 1 wherein the penalty function comprises a memory addressing penalty/ fmem And reconstruction loss l rec Loss functionThe calculation formula of (2) is as follows:
wherein I II 2 Representation l 2 The norm of the sample is calculated,indicating the desire, F indicates the addressing function, +.>Is a model training parameter, gamma is a weighting parameter for determining the significance of two loss functions, and lambda is an optimal regularization parameter; e (x) i ) Representation of sample x i Coding; omega i Weight representing memory block>D (-) represents decoding by a PSE-Res2Net based decoder.
10. An internet of vehicles sensor anomaly detection system for implementing the method of any one of claims 1-9, comprising:
the data acquisition and preprocessing module acquires time series data of the running state of the automobile through a plurality of sensors arranged on the automobile and preprocesses the data;
the detection module is used for realizing abnormal detection of the running state of the automobile by using a self-encoder model based on channel-space-time attention; the self-encoder model based on channel-space-time attention comprises an encoder based on PSE-Res2Net, a decoder based on PSE-Res2Net and a memory enhanced time attention module; the encoder based on PSE-Res2Net is responsible for encoding the data output by the data acquisition and preprocessing module; the memory-enhanced time attention module is responsible for integrating multi-scale features on the features output by the encoder based on PSE-Res2Net by using a memory-enhanced time-attention mechanism, long-term dependency tracking and span generation of global sequence features with time dependency; the PSE-Res2Net based decoder is responsible for converting the time-dependent global sequence features from a coded low-dimensional representation to a high-dimensional representation of the original input, computing the reconstruction error and obtaining the detection result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311167968.9A CN117041972A (en) | 2023-09-11 | 2023-09-11 | Channel-space-time attention self-coding based anomaly detection method for vehicle networking sensor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311167968.9A CN117041972A (en) | 2023-09-11 | 2023-09-11 | Channel-space-time attention self-coding based anomaly detection method for vehicle networking sensor |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117041972A true CN117041972A (en) | 2023-11-10 |
Family
ID=88622896
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311167968.9A Pending CN117041972A (en) | 2023-09-11 | 2023-09-11 | Channel-space-time attention self-coding based anomaly detection method for vehicle networking sensor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117041972A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117544421A (en) * | 2024-01-08 | 2024-02-09 | 广州大学 | Network threat detection method, device, medium and electronic equipment |
-
2023
- 2023-09-11 CN CN202311167968.9A patent/CN117041972A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117544421A (en) * | 2024-01-08 | 2024-02-09 | 广州大学 | Network threat detection method, device, medium and electronic equipment |
CN117544421B (en) * | 2024-01-08 | 2024-03-26 | 广州大学 | Network threat detection method, device, medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7004364B1 (en) | Multi-source timing data failure diagnosis method and medium based on graph neural network | |
CN110298235B (en) | Hyperspectral anomaly detection method and system based on manifold constraint self-coding network | |
Wu et al. | A weighted deep domain adaptation method for industrial fault prognostics according to prior distribution of complex working conditions | |
CN112115769A (en) | Unsupervised sparse population abnormal behavior detection algorithm based on video | |
CN114509266B (en) | Bearing health monitoring method based on fault feature fusion | |
CN111863244B (en) | Functional connection mental disease classification method and system based on sparse pooling graph convolution | |
CN114386521A (en) | Method, system, device and storage medium for detecting abnormality of time-series data | |
CN114429150A (en) | Rolling bearing fault diagnosis method and system under variable working conditions based on improved depth subdomain adaptive network | |
CN117041972A (en) | Channel-space-time attention self-coding based anomaly detection method for vehicle networking sensor | |
CN112487948B (en) | Multi-space fusion-based concentration perception method for learner in learning process | |
CN112597921B (en) | Human behavior recognition method based on attention mechanism GRU deep learning | |
CN115169430A (en) | Cloud network end resource multidimensional time sequence anomaly detection method based on multi-scale decoding | |
CN116522265A (en) | Industrial Internet time sequence data anomaly detection method and device | |
CN114357372A (en) | Aircraft fault diagnosis model generation method based on multi-sensor data driving | |
Chang et al. | A multi-task imputation and classification neural architecture for early prediction of sepsis from multivariate clinical time series | |
CN112257817B (en) | Geological geology online semantic recognition method and device and electronic equipment | |
CN115935187B (en) | Nuclear sensitivity alignment network-based mechanical fault diagnosis method under variable working conditions | |
CN116628612A (en) | Unsupervised anomaly detection method, device, medium and equipment | |
CN112541524A (en) | BP-Adaboost multi-source information motor fault diagnosis method based on attention mechanism improvement | |
CN116595465A (en) | High-dimensional sparse data outlier detection method and system based on self-encoder and data enhancement | |
CN115034307A (en) | Vibration data self-confirmation method, system and terminal for multi-parameter self-adaptive fusion | |
Liu et al. | Missing data imputation and classification of small sample missing time series data based on gradient penalized adversarial multi-task learning | |
CN117688496B (en) | Abnormality diagnosis method, system and equipment for satellite telemetry multidimensional time sequence data | |
CN117909854B (en) | Zero sample composite fault diagnosis method based on multi-mode contrast embedding | |
CN117830874B (en) | Remote sensing target detection method under multi-scale fuzzy boundary condition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |