Sensor time sequence data anomaly detection method and device

By establishing an adjacency matrix of sensor node relationships and combining the use of variational autoencoder and graph neural network, the robustness and accuracy of sensor timing data anomaly detection in industrial environments are solved, and the extremes of different distribution characteristics and abnormal proportions are achieved Efficient abnormal identification in the case.

CN119004299AActive Publication Date: 2024-11-22HUAZHONG UNIV OF SCI & TECH

Patent Information

Application Number
CN202410661322.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-11-22
Estimated Expiration
2044-05-27

AI Technical Summary

Technical Problem

In industrial environments, sensor timing data abnormality detection is difficult to maintain robustness when considering data timing relationships and sensor correlations, and the detection accuracy is low in extreme cases of abnormal sample proportions.

Method used

By establishing an adjacency matrix describing the relationship between sensor nodes, combining variational autoencoder and graph neural network, joint training is performed to generate reconstruction modules and prediction modules for abnormal scoring of timing data.

Benefits of technology

It improves the accuracy and robustness of abnormal detection of sensor timing data, can effectively identify abnormal data of different distribution characteristics, and maintain high detection accuracy in extreme abnormal proportions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004299A_ABST
    Figure CN119004299A_ABST
Patent Text Reader

Abstract

The invention discloses a sensor time series data anomaly detection method, which comprises the following steps of: S1, establishing an adjacent matrix for describing a relationship between sensor nodes according to the correlation of data acquired by each sensor; s2, training a variational auto-encoder based on original sample data collected by a sensor to obtain a reconstruction module; s3, training a graph neural network based on the reconstruction module and the original sample data to obtain a prediction module; and S4, performing joint anomaly scoring on the to-be-detected time series data based on the reconstruction module and the prediction module to obtain a joint score value, and performing anomaly judgment on the to-be-detected time series data based on the joint score value. The method has the technical effect of high detection precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things data detection, and in particular to a method and device for detecting anomalies in sensor time series data. Background Art

[0002] Internet of Things (IoT) is widely used in industrial environments due to its advantages of distribution, self-organization, dynamic topology, rapid deployment and low cost, including key applications such as equipment monitoring and maintenance, production process optimization, safety monitoring and management. At the same time, artificial intelligence, as an important technical support for building an intelligent and reliable modern infrastructure system, is deeply integrated with the Internet of Things, which can realize the digitization and intelligent connection of all things, build a new type of industrial Internet of Things, and ensure data security.

[0003] In industrial environments, systems usually work continuously, generating multivariate time series data monitored by multiple sensors. Due to sensor failure, equipment failure, environmental changes or other factors, sensors may collect data that is inconsistent with normal operation or expected values, i.e., abnormal data. These abnormal data can have an adverse effect on the system. Timely detection and identification of abnormal data can effectively improve production efficiency, monitor and control in real time, and avoid economic losses.

[0004] The difficulties of anomaly detection in sensor network time series data are mainly reflected in three aspects. First, it is necessary to consider the correlation between sensors while considering the time series relationship of data, and comprehensively consider the impact of various factors on the anomaly detection results; second, industrial Internet of Things data may have different distribution characteristics, and the proposed anomaly detection method cannot be based solely on the assumption that the data obeys a specific distribution, but should ensure the robustness of anomaly detection for industrial Internet of Things time series data with different distributions; third, when the proportion of abnormal samples is large or small, it may lead to class imbalance problems, which in turn has an adverse effect on the accuracy of anomaly detection. Summary of the invention

[0005] In view of this, it is necessary to provide a sensor time series data anomaly detection method and device to effectively solve the technical problem of low accuracy in time series data anomaly detection.

[0006] The present invention provides a method for detecting abnormality in sensor time series data, comprising the following steps:

[0007] Step S1: Establish an adjacency matrix describing the relationship between sensor nodes according to the correlation of the data collected by each sensor;

[0008] Step S2: training the variational autoencoder based on the original sample data collected by the sensor to obtain a reconstruction module;

[0009] Step S3: training a graph neural network based on the reconstruction module and the original sample data to obtain a prediction module;

[0010] Step S4: perform a joint abnormality score on the time series data to be tested based on the reconstruction module and the prediction module to obtain a joint score value, and perform an abnormality judgment on the time series data to be tested based on the joint score value.

[0011] Preferably, the step S1 is specifically:

[0012] A randomized initial embedding vector is set for each sensor node, and a bidirectional long short-term memory recurrent neural network is used to perform cyclic embedding on the sensor nodes in each unit to obtain a node embedding vector.

[0013] The similarity of embedding vectors of different sensor nodes is calculated using tensor neural network;

[0014] Calculate the similarity of the embedded vectors between each pair of sensor nodes, select the K nodes with the highest similarity to the embedded vectors between each sensor node as the adjacent nodes of the corresponding sensor node, 1<K<N, N is the number of sensor nodes, and obtain the adjacency matrix representing the relationship between sensor nodes.

[0015] Preferably, the step S2 is specifically:

[0016] Use sliding windows to process the time series data collected by each sensor to obtain the original sample data within the sampling time;

[0017] Inputting the original sample data into the variational autoencoder for training, using the variational autoencoder to learn the potential space distribution of the original sample data to obtain a generation model, and obtaining a reconstruction error;

[0018] The generative model is used to generate reconstructed sample data corresponding to the original sample data.

[0019] Preferably, the generation model is used to generate reconstructed sample data corresponding to the sample data, specifically:

[0020] The generative model extracts data from the sample space with a set probability, the extracted data is affected by latent variables, and the posterior distribution obeys the standard normal distribution;

[0021] By maximizing the posterior distribution, the decoder of the generative model generates reconstructed sample data corresponding to the original digital sample data from the latent variables.

[0022] Preferably, before the sample data is input into the variational autoencoder for training, random Gaussian noise is added to the sample data to enhance the generalization of the generative model.

[0023] Preferably, the reconstruction error includes KL divergence loss and mean square error loss;

[0024] A hypothesized distribution is introduced using variational inference to approximate the actual distribution of the data, and the KL divergence is used to quantify the difference between the actual distribution and the hypothesized distribution;

[0025] In the sliding window, the difference between the posterior distribution and the prior distribution of all sample data related to the latent space is calculated as the KL divergence loss;

[0026] The reconstructed latent variables are input into the attention layer of the variational autoencoder to be effectively represented;

[0027] Inputting the effective representation into a decoder to obtain reconstructed sample data, calculating the mean square error between the reconstructed sample data and the original sample data to obtain the mean square error loss;

[0028] The KL divergence loss and the mean square error loss are added to obtain the reconstruction error.

[0029] Preferably, the step S3 is specifically:

[0030] Based on the reconstruction module, calculating the aggregated features of the sensor nodes;

[0031] After obtaining the aggregate features of all sensor nodes, perform element-by-element multiplication operation on the aggregate features of each sensor node and the corresponding embedding vector, and then input the element-by-element multiplication result of each sensor node into the fully connected layer of the graph neural network to obtain the prediction value of the prediction module;

[0032] The mean square error between the predicted value and the true value is calculated as the minimization loss function of the prediction module.

[0033] Preferably, the step S4 is specifically:

[0034] The reconstruction module and the prediction module are used to perform abnormality scoring on the time series data to be tested respectively, and a weighted average of the scores of the two is used as a joint scoring value;

[0035] The maximum anomaly score in the validation set is used as the anomaly threshold. When the joint score value is greater than the anomaly threshold, the time series data to be tested is anomaly data. When the joint anomaly score is less than the anomaly threshold, the time series data to be tested is normal data.

[0036] Preferably, the reconstruction module and the prediction module are used to perform abnormality scoring on the time series data to be tested, specifically:

[0037] For each sensor node, the difference between the predicted value and the actual value is calculated as the anomaly score;

[0038] Normalize the abnormal score value corresponding to each sensor node to obtain the benchmark abnormal score value;

[0039] Compare the baseline anomaly score values ​​of each sensor node at each moment, and take the largest baseline anomaly score value as the overall anomaly score value at the corresponding moment.

[0040] The present invention also provides a sensor time series data anomaly detection device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the sensor time series data anomaly detection method is implemented.

[0041] Compared with the prior art, the present invention has the following beneficial effects: the present invention establishes an adjacency matrix that describes the relationship between sensor nodes, and trains the prediction module based on the adjacency matrix, which can better mine the timing characteristics and node correlation of sensor node data, and can more accurately and reasonably capture the characteristic relationship of sensor timing data, so as to better perform abnormal inference; at the same time, based on the variational autoencoder and graph neural network under the deep learning mechanism, a joint optimization framework is constructed, which can accurately identify abnormal data by comparing input and output data, improve data reliability, and has good guiding reference value. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0043] Figure 1 A flowchart of an embodiment of a sensor time series data anomaly detection method provided by the present invention;

[0044] Figure 2 yes Figure 1 The schematic diagram of an embodiment of sensor timing data anomaly detection in the illustrated embodiment. DETAILED DESCRIPTION

[0045] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0046] Embodiment 1

[0047] See also Figure 1 In this embodiment, a sensor time series data anomaly detection method specifically includes the following steps:

[0048] Step S1: Establish an adjacency matrix describing the relationship between sensor nodes according to the correlation of the data collected by each sensor;

[0049] Step S2: training the variational autoencoder based on the original sample data collected by the sensor to obtain a reconstruction module;

[0050] Step S3: training a graph neural network based on the reconstruction module and the original sample data to obtain a prediction module;

[0051] Step S4: perform a joint abnormality score on the time series data to be tested based on the reconstruction module and the prediction module to obtain a joint score value, and perform an abnormality judgment on the time series data to be tested based on the joint score value.

[0052] This embodiment discloses a sensor time series data anomaly detection method based on deep learning: according to the correlation of sensor collected data, an adjacency matrix describing the relationship between sensor nodes is established; after learning the relationship representation between sensor nodes, the time series data is reconstructed based on a variational autoencoder; based on the data reconstruction, the time series data is predicted based on a graph neural network to further learn the characteristics of normal data and identify abnormal data; after the reconstruction module and the prediction module are jointly trained, the final anomaly score is jointly optimized to achieve accurate detection of abnormal data and improve the reliability of industrial Internet of Things data.

[0053] In view of the problem that the existing methods do not consider the data time series relationship and the sensor node correlation at the same time, this embodiment establishes an adjacency matrix to describe the correlation between sensors, and considers the data time series relationship and the correlation between sensors at the same time, which can more accurately and reasonably capture the characteristic relationship of sensor time series data, so as to better perform abnormal inference. In view of the problem that the existing methods have poor robustness in detecting abnormalities in industrial Internet of Things time series data with different distributions, this embodiment combines the variational autoencoder and the graph neural network models for joint abnormality scoring, builds a joint optimization framework, accurately identifies abnormal data by comparing input and output data, and has good robustness when processing a variety of time series data with different distributions, which is more in line with practical applications. In view of the problem that the existing abnormality detection methods have low abnormality detection accuracy when the abnormality ratio is large or small, this method proposes a prediction and reconstruction joint time series data abnormality detection scheme, adopts a deep learning mechanism under the artificial intelligence framework, accurately identifies abnormal data by comparing input and output data, has good guiding reference value, can well deal with scenes with extreme abnormality ratios, can perform abnormality identification on a large number of high-dimensional time series data of the industrial Internet of Things, and has high abnormality detection accuracy.

[0054] Further, such as Figure 2 As shown, the step S1 is specifically:

[0055] The original time series data is collected by N sensors, with dimension d = N; N embedding modules are set to set a random initial embedding vector p for each sensor node. u,i ,p u,i represents the initial embedding vector of sensor node i, which belongs to unit u;

[0056] For each sensor node in each unit, a bidirectional long short-term memory recursive neural network is used for recurrent embedding. The embedding module is stacked in n layers and f is used to embed the sensor node in each unit. n Indicates that the node embedding vector v is obtained u,i ;

[0057] The similarity of embedding vectors of different sensor nodes is calculated using tensor neural network;

[0058] The embedding vector similarity is expressed as:

[0059] S ij =Sigmod(sum(W@v i )*v j )v u,i

[0060] Among them, S ij Represents the embedding vector v of sensor node i i and the embedding vector v of sensor node j j Similarity, Sigmod() represents the activation function, sum() represents the sum of tensor elements, W is the weight tensor, @ represents tensor multiplication, and * represents vector element-by-element multiplication;

[0061] Calculate the embedding vector similarity between each pair of sensor nodes, select the K nodes with the highest embedding vector similarity between each sensor node as the adjacent nodes of the corresponding sensor node, 1<K<N, N is the number of sensor nodes, and obtain the adjacency matrix representing the relationship between sensor nodes;

[0062] The adjacency matrix is ​​represented as follows:

[0063] A ij =1{j∈TopK({S ki :k∈{1,2,…,N}})}

[0064] Among them, A ij is the adjacency matrix, S ki represents the embedding vector similarity between sensor node k and sensor node i, k∈{1,2,…,N}, N is the number of sensor nodes, TopK() represents the number of S ki The largest K values, j∈TopK({S ki:k∈{1,2,…,N}}) means taking S ki The k values ​​corresponding to the largest K values ​​are taken as the set of j, 1{j∈TopK({S ki :k∈{1,2,…,N}})} means that for the adjacency matrix A ij For the elements in the set, the corresponding elements of j are assigned a value of 1, and the others are assigned a value of 0.

[0065] In this embodiment, each sensor node is embedded. Node embedding is a term used to map each sensor node in the graph to a low-dimensional vector space to represent the characteristics and relationships of the nodes. After the node embedding is completed, the similarity of the embedded vectors is calculated to measure the similarity between different nodes, and finally an adjacency matrix describing the relationship between the nodes is obtained.

[0066] Further, such as Figure 2 As shown, the step S2 is specifically:

[0067] Use the sliding window to process the time series data collected by each sensor to obtain the original sample data x within the sampling time;

[0068] The original sample data is represented as follows:

[0069] x=[s (1) ,s (2) ,…,s (T) ]

[0070] Among them, x is the original sample data, s (t) represents the sensor reading at time t, t = 1, 2, …, T, T is the sampling time of the sliding window;

[0071] Inputting the original sample data into the variational autoencoder, using the encoder of the variational autoencoder to learn the potential space distribution of the original sample data to obtain a generation model, and obtaining a reconstruction error;

[0072] The generation model is used to generate reconstructed sample data corresponding to the original sample data to achieve resampling.

[0073] This embodiment uses a variational autoencoder to learn the latent spatial distribution of input multidimensional time series data and obtain the reconstruction error. Based on the variational autoencoder learning, a generative model is obtained. For the sample space X, when data is extracted with a set probability p(x), the generative model can extract data similar to the training sample data with a high probability, and the reconstructed sample data has a high similarity with the original sample data.

[0074] Further, the generation model is used to generate reconstructed sample data corresponding to the sample data, specifically:

[0075] The generative model extracts data from the sample space with a set probability. The extracted data is affected by hidden variables, and the posterior distribution obeys the standard normal distribution:

[0076] p(x)=∫ z p(xz)p(z)dz

[0077] Among them, p(x) is the set probability, p(xz) is the posterior distribution, p(z) is the probability variable caused by the latent variable, and z is the latent variable;

[0078] By maximizing the posterior distribution p(xz), the decoder of the generative model generates reconstructed sample data similar to the original sample data x from the latent variable z.

[0079] In this embodiment, the generative model achieves the purpose of extracting data similar to the training sample data with a higher probability by maximizing the posterior distribution p(xz).

[0080] Furthermore, before the sample data is input into the variational autoencoder, random Gaussian noise is added to the sample data to enhance the generalization of the generative model.

[0081] Furthermore, the reconstruction error includes KL divergence loss and mean square error loss;

[0082] KL divergence is the English name of Ullback-Leibler divergence, which is used to measure the difference or distance between two probability distributions. It is an asymmetric measure used to measure the information loss from one probability distribution to another.

[0083] Mean square error, referred to as MSE, is used to measure and evaluate the quality of reconstruction and estimation of unused spatial environmental variable values, that is, the error measure between the estimated value and the reference point value;

[0084] A hypothesized distribution q(zx) is introduced using variational inference to approximate the actual distribution p(zx) of the data, and the KL divergence is used to quantify the difference between the actual distribution p(zx) and the hypothesized distribution q(zx);

[0085] The KL divergence is expressed as:

[0086] KL(q(zx)p(zx))=∫ z q(zx)log(p(zx)q(zx))dz

[0087] Where KL(q(zx)p(zx)) represents the KL divergence between the actual distribution p(zx) and the hypothesized distribution q(zx);

[0088] In the sliding window, the difference between the posterior distribution and the prior distribution of all sample data related to the latent space is calculated as the KL divergence loss;

[0089] The KL divergence loss is expressed as:

[0090]

[0091] Among them, L KL is the KL divergence loss, KL(q(zx)p(zx)) represents the KL divergence loss between the posterior distribution and the prior distribution of all sample data at time t, t represents the sampling time, w is the position of the sliding window, T train is the size of the sliding window;

[0092] like Figure 2 As shown in Figure 2, the reconstructed latent variables are input into the attention layer of the variational autoencoder to be effectively represented; the latent variables of the N sensor nodes are represented as z1, z2, …, z N , the effective representations of N sensor nodes are expressed as

[0093] The effective representation is expressed as:

[0094]

[0095] in, is the effective representation, Attention() represents the attention layer, Q, K, and V are obtained by linearly transforming the latent variable z through the weight matrix W, Softmax() is the activation function, T represents the transposition operation of the matrix, and d K represents the dimension of matrix K;

[0096] like Figure 2 As shown, the effective representation is input into a decoder to obtain reconstructed sample data, and then the mean square error between the reconstructed sample data and the original sample data is calculated to obtain the mean square error loss;

[0097] The mean square error loss is expressed as:

[0098]

[0099] Among them, L MSE represents the mean square error loss, T train is the size of the sliding window, w is the position of the sliding window, t represents the sampling time, is the reconstructed sample data at time t, x (t) is the original sample data at time t;

[0100] Adding the KL divergence loss to the mean square error loss to obtain the reconstruction error;

[0101] The reconstruction error is expressed as:

[0102] L r =L MSE +L KL

[0103] Among them, L r represents the reconstruction error, L MSE represents the mean square error loss, L KL is the KL divergence loss.

[0104] Further, such as Figure 2 As shown, the step S3 is specifically:

[0105] Based on the reconstruction module, calculating the aggregated features of the sensor nodes;

[0106] Node aggregation features refer to the process of aggregating or summarizing the features of a node's neighbor nodes in a graph structure to generate global features representing the node. This aggregation process can help capture the relationship and contextual information between a node and its neighbor nodes, thereby better understanding the features and attributes of nodes in the graph.

[0107] The formula for the aggregation feature is as follows:

[0108]

[0109] Among them, F i (t) is the aggregation feature, ReLU() is the activation function of the graph neural network, and a i,i 、a i,j is the attention coefficient, W is the trainable weight parameter, W∈R d×w , z i (t) is the original sample data of sensor node i at time t after being processed by the variational autoencoder and the attention layer and then resampled. N(i) is the set of adjacent nodes of sensor node i, N(i) = jA ji >0, A ij is the adjacency matrix of sensor node i;

[0110] The calculation formula of the attention coefficient is:

[0111]

[0112] Among them, a i,j is the attention coefficient, π(i,j) is the intermediate parameter, LeakyReLU() is the activation function, a is a parameter that can be learned, a Τ represents the transposed matrix of a, is the intermediate parameter, v i represents the embedding vector of sensor node i, Indicates a merge connection;

[0113] After obtaining the aggregate features of all sensor nodes, perform element-by-element multiplication operation on the aggregate features of each sensor node and the corresponding embedding vector, and then input the element-by-element multiplication result of each sensor node into the fully connected layer of the graph neural network to obtain the prediction value of the prediction module;

[0114] The predicted value is expressed as:

[0115]

[0116] in, represents the predicted value at time t, f θ () represents the fully connected layer, v i represents the embedding vector of sensor node i, represents the aggregated features of sensor node i, i∈{1,2,…,N}, N is the number of sensor nodes;

[0117] Calculate the mean square error between the predicted value and the true value as the minimization loss function of the prediction module;

[0118] The minimization loss function is:

[0119]

[0120] Among them, L p represents the minimization loss function, T train is the size of the sliding window, w is the position of the sliding window, t represents the sampling time, is the predicted value at time t, s (t) is the true value at time t.

[0121] like Figure 2 As shown, the overall loss of the reconstruction module and the prediction module is recorded as L, and the overall loss function is defined as follows:

[0122] L=λL p +(1-λ)L r

[0123] Among them, λ∈(0~1), λ is the weight parameter.

[0124] Furthermore, the step S4 is specifically:

[0125] The reconstruction module and the prediction module are used to perform abnormality scoring on the time series data to be tested respectively, and a weighted average of the scores of the two is used as a joint scoring value;

[0126] The combined score value is expressed as:

[0127]

[0128] Among them, AnoS t is the joint score value, λ is the weight coefficient, is the score value obtained by the prediction module, The score obtained for the reconstruction module;

[0129] The maximum anomaly score in the validation set is used as the anomaly threshold. When the joint score value is greater than the anomaly threshold, the time series data to be tested is anomaly data. When the joint anomaly score is less than the anomaly threshold, the time series data to be tested is normal data.

[0130] Since the model consists of a reconstruction module and a prediction module, both modules will generate corresponding anomaly scores. The reconstruction module is recorded as The prediction module is denoted as Use their weighted average to represent the final anomaly score AnoS at time t t .

[0131] The anomaly threshold is set to the maximum value on the validation set. After the model training is completed, the joint score value is compared with the anomaly threshold to distinguish normal data from abnormal data, thus achieving the purpose of anomaly detection.

[0132] Furthermore, the reconstruction module and the prediction module are used to perform abnormality scoring on the time series data to be tested, specifically:

[0133] For each sensor node, the difference between the predicted value and the actual value is calculated as the anomaly score;

[0134] The abnormality score value is expressed as:

[0135]

[0136] Among them, Err i (t) is the abnormal score value of sensor node i at time t, is the true value of sensor node i at time t, is the predicted value of sensor node i at time t;

[0137] Normalize the abnormal score value corresponding to each sensor node to obtain the benchmark abnormal score value;

[0138] The baseline anomaly score value is expressed as:

[0139]

[0140] Among them, a i (t) is the baseline anomaly score of sensor node i at time t, is the abnormal score Err i (t) the median on the time scale, is the abnormal score Err i (t) interquartile range on the time scale;

[0141] Compare the baseline anomaly score values ​​of each sensor node at each moment, and take the largest baseline anomaly score value as the overall anomaly score value at the corresponding moment.

[0142] After obtaining the baseline anomaly scores of all sensors, the overall anomaly score at time t is represented by the maximum baseline anomaly score. Since the model consists of a reconstruction module and a prediction module, both modules generate corresponding overall anomaly scores.

[0143] Interquartile range, also known as IQR in English, is used to measure the degree of dispersion of a data set or the degree of diffusion of its distribution. It is the difference between the third quartile and the first quartile.

[0144] Embodiment 2

[0145] This embodiment provides a sensor time series data anomaly detection device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the sensor time series data anomaly detection method described in the first embodiment is implemented.

[0146] The sensor time series data anomaly detection device provided in this embodiment is used to implement the sensor time series data anomaly detection method. Therefore, the technical effects possessed by the sensor time series data anomaly detection method are also possessed by the sensor time series data anomaly detection device, which will not be repeated here.

[0147] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed in the present invention should be covered by the present invention.

Claims

1. A sensor time series data anomaly detection method, characterized in that: The following steps are involved: Step S1: Establish an adjacency matrix describing the relationship between sensor nodes according to the correlation of the data collected by each sensor; Step S2: training the variational autoencoder based on the original sample data collected by the sensor to obtain a reconstruction module; Step S3: training a graph neural network based on the reconstruction module and the original sample data to obtain a prediction module; Step S4: perform a joint abnormality score on the time series data to be tested based on the reconstruction module and the prediction module to obtain a joint score value, and perform an abnormality judgment on the time series data to be tested based on the joint score value.

2. The sensor time series data anomaly detection method according to claim 1, characterized in that: The step S1 is specifically: A randomized initial embedding vector is set for each sensor node, and a bidirectional long short-term memory recurrent neural network is used to perform cyclic embedding on the sensor nodes in each unit to obtain a node embedding vector. The similarity of embedding vectors of different sensor nodes is calculated using tensor neural network; Calculate the similarity of the embedded vectors between each pair of sensor nodes, select the K nodes with the highest similarity to the embedded vectors between each sensor node as the adjacent nodes of the corresponding sensor node, 1<K<N, N is the number of sensor nodes, and obtain the adjacency matrix representing the relationship between sensor nodes.

3. The sensor time series data anomaly detection method according to claim 1, characterized in that: The step S2 is specifically: Use sliding windows to process the time series data collected by each sensor to obtain the original sample data within the sampling time; Inputting the original sample data into the variational autoencoder for training, using the variational autoencoder to learn the potential spatial distribution of the original sample data to obtain a generation model, and obtaining a reconstruction error; The generative model is used to generate reconstructed sample data corresponding to the original sample data.

4. The sensor time series data anomaly detection method according to claim 3, characterized in that: The reconstructed sample data corresponding to the sample data is generated by using the generation model, specifically: The generative model extracts data from the sample space with a set probability, the extracted data is affected by latent variables, and the posterior distribution obeys the standard normal distribution; By maximizing the posterior distribution, the decoder of the generative model generates reconstructed sample data corresponding to the original digital sample data from the latent variables.

5. The sensor time series data anomaly detection method according to claim 3, characterized in that: Before inputting the sample data into the variational autoencoder for training, random Gaussian noise is added to the sample data to enhance the generalization of the generative model.

6. The sensor time series data anomaly detection method according to claim 3, characterized in that: The reconstruction error includes KL divergence loss and mean square error loss; A hypothesized distribution is introduced using variational inference to approximate the actual distribution of the data, and the KL divergence is used to quantify the difference between the actual distribution and the hypothesized distribution; In the sliding window, the difference between the posterior distribution and the prior distribution of all sample data related to the latent space is calculated as the KL divergence loss; The reconstructed latent variables are input into the attention layer of the variational autoencoder to be effectively represented; Inputting the effective representation into a decoder to obtain reconstructed sample data, calculating the mean square error between the reconstructed sample data and the original sample data to obtain the mean square error loss; The KL divergence loss and the mean square error loss are added to obtain the reconstruction error.

7. The sensor time series data anomaly detection method according to claim 1, characterized in that: The step S3 is specifically: Based on the reconstruction module, calculating the aggregated features of the sensor nodes; After obtaining the aggregate features of all sensor nodes, perform element-by-element multiplication operation on the aggregate features of each sensor node and the corresponding embedding vector, and then input the element-by-element multiplication result of each sensor node into the fully connected layer of the graph neural network to obtain the prediction value of the prediction module; The mean square error between the predicted value and the true value is calculated as the minimization loss function of the prediction module.

8. The sensor time series data anomaly detection method according to claim 1, characterized in that: The step S4 is specifically: The reconstruction module and the prediction module are used to perform abnormality scoring on the time series data to be tested respectively, and a weighted average of the scores of the two is used as a joint scoring value; The maximum anomaly score in the validation set is used as the anomaly threshold. When the joint score value is greater than the anomaly threshold, the time series data to be tested is anomaly data. When the joint anomaly score is less than the anomaly threshold, the time series data to be tested is normal data.

9. The sensor time series data anomaly detection method according to claim 8, characterized in that: The reconstruction module and the prediction module are used to perform abnormal scoring on the time series data to be tested, specifically: For each sensor node, the difference between the predicted value and the actual value is calculated as the anomaly score; Normalize the abnormal score value corresponding to each sensor node to obtain the benchmark abnormal score value; Compare the baseline anomaly score values ​​of each sensor node at each moment, and take the largest baseline anomaly score value as the overall anomaly score value at the corresponding moment.

10. A sensor time series data anomaly detection device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method for detecting anomalies in sensor time series data as described in any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Mixed model multivariate time sequence anomaly detection method based on graph neural network

    CN113516226A

  • Machine room anomaly detection method and device based on graph structure and abnormal attention mechanism

    CN115018021A

  • Industrial control system-oriented anomaly detection system and method

    CN115484102A

  • Dam monitoring time sequence data anomaly detection method based on graph attention network

    CN115618296A

  • Dam safety monitoring multivariate time sequence anomaly detection method based on space-time diagram

    CN116665130A

Cited By

  • Abnormity detection method and adaptive information distribution method for underwater multi-source navigation system

    CN120194737A

  • Flight data anomaly detection method and device based on variational inference

    CN121211249A