Multivariable time sequence classification method based on depth map neural network
Through the multivariate time series classification method based on deep graph neural network, the DTW distance method and variational autoencoder combined with the depth graph convolution network GCN are used to extract the potential similarity relationship between multivariate time series samples, solving the problem of difficulty in extracting higher-order relationships in the prior art and achieving higher classification accuracy.
Patent Information
- Application Number
- CN202510224205.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-10
AI Technical Summary
The existing multivariate time series classification method based on GNN is difficult to extract higher-order relationships in sample graphs, ignoring the potential similarity relationships between samples in different regions, resulting in low classification accuracy.
Using a multivariate time series classification method based on deep graph neural network, a relationship diagram of multivariate time series samples is constructed through the DTW distance method, combining the variational autoencoder and the depth graph convolution network GCN, the potential similarity relationship between samples is extracted and feature fusion is performed.
Effectively mining the similarity relationship between multivariate time series samples, improving the accuracy of classification and feature extraction capabilities, and significantly improving the performance of multivariate time series classification.
Smart Images

Figure CN120123822A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of multivariate time series classification, and particularly relates to a multivariate time series classification method based on a deep graph neural network. Background Art
[0002] A multivariate time series (MTS) refers to a dataset with time characteristics obtained by monitoring multiple variables. Multivariate time series classification (MTSC) is the problem of assigning labels to multivariate time series. In the past decade, with the development of data acquisition and storage technologies, time series data mining has gradually become an important research topic.
[0003] To improve the accuracy of time series classification, researchers have proposed many effective classification models and algorithms. The existing classification methods mainly fall into two categories: traditional classification methods based on distance similarity and features, such as time series classification methods based on dynamic time warping with k-nearest neighbors (DTW-kNN) and time series classification methods based on Shapelets, which are time-consuming in data preprocessing and feature engineering; the other is classification methods based on deep learning, such as MLSTM-FCN that uses LSTM layers and stacked CNN layers to generate features, and these methods can effectively learn low-dimensional features. To better capture potential relationships from MTS data, many existing MTS methods use graph structures to process MTS data, and these methods can effectively utilize GNNs to model the spatial dependencies of MTS. However, the existing GNN-based MTSC methods are limited by the defects of deep GNN structures and it is difficult to extract sample representations by extracting high-order relationships in MTS sample graphs, ignoring the potential similarity relationships between samples in different regions. Taking the regional classification scenario of traffic flow as an example, the goal is to determine the function of each region (such as residential areas and commercial areas). Each traffic flow sample contains multiple variables, including the number of pedestrians, traffic flow, air quality, and noise decibels. There are potential correlations between the variables of each sample. For example, if the number of pedestrians is large, the traffic flow is usually also large, and a large number of pedestrians and traffic flow usually lead to a higher noise level and poorer air quality. In addition, if the MTS data of each region is similar, it is possible to determine that these regions have the same functional partition. This is actually the potential similarity relationship between MTS samples. However, most of the existing classification methods ignore the potential similarity relationships between samples in different regions. Summary of the Invention
[0004] The present invention is to solve the above-mentioned deficiencies of the existing technology and proposes a multivariate time series classification method based on a deep graph neural network, in order to obtain the similarity relationship between time series samples, thereby improving the accuracy of classification.
[0005] To achieve the above object, the present invention is implemented through the following technical solutions:
[0006] A multivariate time series classification method based on a deep graph neural network according to the present invention is characterized by comprising the following steps:
[0007] S1: After obtaining a multivariate time series dataset and performing Z-Score normalization on each multivariate time series sample therein, the cubic spline interpolation method is used to make the lengths of the normalized multivariate time series samples consistent, so as to obtain a preprocessed multivariate time series dataset ={ }, where, represents the i-th multivariate time series sample after preprocessing, and ={ } , represents the time series of the s-th variable in ={ }, represents the feature at the a-th time step in , v is the number of variables, l is the time length of ; n represents the total number of multivariate time series samples; let the true label of be , and
[0008] S2: According to , use the DTW distance method to construct a relationship graph of multivariate time series samples and obtain a static adjacency matrix A;
[0009] S3: Input into a variational autoencoder for processing, and obtain the latent space feature representation of as well as the reconstructed sample feature of ;
[0010] S4: Based on A, construct a deep graph convolutional network GCN, and input into the deep graph convolutional network GCN for processing. After obtaining the relationship features of each layer in GCN, input the latent space feature representation into the corresponding layer in GCN as well. After fusing the two through a balance coefficient , obtain the relationship feature matrix of the last layer in GCN , so as to obtain Relational feature matrix ;
[0011] S5: Input into the neural network classifier for processing to obtain predicted label ;
[0012] S6: Based on true label and predicted label to construct the i-th cross-entropy loss; Based on and to construct the i-th reconstruction loss and the i-th KL divergence loss, thereby obtaining the total loss ;
[0013] S7: Use the optimizer to train the multivariate time series classification network composed of the variational autoencoder, the deep graph neural network GCN, and the neural network classifier, and calculate the total loss to update the network parameters until the total loss converges, thereby obtaining the optimal multivariate time series classification model for classifying the input multivariate time series to obtain the corresponding predicted label.
[0014] Another feature of the multivariate time series classification method based on the deep graph neural network according to the present invention is that in S2, the DTW distance between the preprocessed a-th multivariate time series sample and the preprocessed b-th multivariate time series sample is obtained, thereby obtaining the static adjacency matrix A: (1)
[0015] (1)
[0016] In formula (2), represents and the Euclidean distance of all features at different time steps, represents the DTW distance of the preprocessed (b - 1)-th multivariate time series sample ; represents the DTW distance of the preprocessed (a - 1)-th multivariate time series sample ; represents the DTW distance of
[0017] Further, the variational autoencoder in S3 includes: an encoder and a decoder. Among them, the encoder consists of a fully connected layer and two parallel neural networks, and the decoder consists of two layers of fully connected layers:
[0018] S3.1. The encoder uses equations (2) and (3) to generate expectation and variance :
[0019] (2)
[0020] (3)
[0021] In equations (3) and (4), , , are the weight matrices of the fully connected layer and the two parallel neural networks respectively, , , are the bias terms of the fully connected layer and the two parallel neural networks, represents the activation function, represents the exponential function;
[0022] S3.2. The offset parameter of is randomly sampled from the standard Gaussian distribution, so that the encoder uses equation (4) to obtain :
[0023] (4)
[0024] S3.3. After the decoder processes , it outputs the reconstructed sample feature .
[0025] Further, S4 obtains the relationship feature of the j-th layer in the GCN using equation (5):
[0026] (5)
[0027] In equation (5), represents all adjacent network nodes of the corresponding node in the deep graph convolutional network GCN, , J represents the total number of layers of the GCN, represents the weight matrix of the (j - 1)-th layer in the GCN, represents the relationship feature of the adjacent network node u of represents the number of adjacent network nodes of the corresponding node, represents the number of adjacent network nodes of u; represents the relationship feature in the (j - 1)-th layer in the GCN.
[0028] Furthermore, S5 is obtained by using Equation (6) the predicted label ;
[0029] (6)
[0030] In Equation (6), represents the activation function, is the balance coefficient, is the weight matrix of the neural network classifier, is the bias term in the neural network classifier.
[0031] Furthermore, S6 constructs the total loss by using Equation (7) :
[0032] (7)
[0033] In Equation (7), M is the feature dimension of, N is the feature dimension of, represents the variance feature on the m-th dimension in, represents the expected feature on the m-th dimension in, the feature on the k-th dimension in, the feature on the k-th dimension in.
[0034] An electronic device according to the present invention includes a memory and a processor, characterized in that the memory is used to store a program for supporting the processor to execute the multivariate time series classification method, and the processor is configured to execute the program stored in the memory.
[0035] A computer-readable storage medium according to the present invention, characterized in that a computer program stored on the computer-readable storage medium executes the steps of the multivariate time series classification method when being run by a processor.
[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0037] 1. The present invention proposes a graph mapping criterion, which converts the MTS dataset into a graph based on the DTW distance to clearly reflect the similarity relationship between samples, thereby effectively mining the similarity relationship between samples, providing richer feature information for classification, and improving the classification performance.
[0038] 2. The present invention proposes a sample structure information extractor based on a deep GCN to uniformly obtain the potential sample similarity relationship of multivariate time series, so as to improve the feature extraction ability and obtain more accurate classification results.
[0039] 3. The present invention proposes a feature constraint method based on a variational autoencoder, which can map the features of multivariate time series to a broader distribution space to solve the over-smoothing problem in mining the deep features of multivariate time series, so as to achieve a higher classification accuracy in the classification problem of multivariate time series. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flowchart of a multivariate time series classification method based on a deep graph neural network according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0041] In this embodiment, a multivariate time series classification method based on a deep graph neural network converts the MTS dataset into a graph based on the DTW distance through a graph mapping criterion to clearly reflect the similarity relationship between traffic flow samples; through a sample structure information extractor based on a deep GCN, the potential sample similarity relationship of multivariate time series is uniformly obtained, so that the optimizer can more accurately optimize the classifier parameters and obtain a more accurate regional classification result; through a feature constraint method based on a variational autoencoder, the features of multivariate time series can be mapped to a broader distribution space, thereby solving the over-smoothing problem in mining the deep features of multivariate time series. Specifically, taking the regional classification scenario of traffic flow as an example, as Figure 1 shown, the method includes the following steps:
[0042] S1: After obtaining the traffic flow sample dataset and performing Z-Score standardization on each traffic flow sample therein, the length of the standardized traffic flow samples is made consistent by using the cubic spline interpolation method, thereby obtaining the preprocessed traffic flow dataset ={ }, where, represents the i-th traffic flow sample after preprocessing, and ={ } , represents The time series of the s-th variable in, where the variables include pedestrian flow, traffic flow, air quality, and noise decibels, and ={ } represents the feature at the a-th time step in, reflecting the measured value of the s-th variable at the a-th timestamp, v is the number of variables, and l is the time length; n represents the total number of samples; let the true label of the traffic flow area of be ∈ and represents the traffic flow area label set, where the categories include: residential area, commercial area, industrial area, transportation hub area, and undeveloped area. The true label refers to the true class label of each sample in the training set, represented in the form of a binary encoded vector, i.e., a one-hot vector (the corresponding label position is 1, and the rest are 0).
[0043] S2: According to , use the DTW distance method to construct a relationship graph of traffic flow samples and obtain a static adjacency matrix A, which represents the similarity relationship between traffic flow samples; use Equation (1) to obtain and the DTW distance between the preprocessed b-th traffic flow sample , thus obtaining the static adjacency matrix A:
[0044] (1)
[0045] where represents and the Euclidean distance of all features at different time steps, represents the DTW distance of the preprocessed -1-th traffic flow sample ; represents the DTW distance of the preprocessed (a - 1)-th traffic flow sample ; represents the DTW distance of
[0046] S3: Input into the variational autoencoder for processing and obtain the latent space feature representation of as well as the reconstructed sample feature of The latent space feature representation reflects the core patterns of traffic flow in different regions.
[0047] Among them, the variational autoencoder includes: an encoder and a decoder. Among them, the encoder consists of a fully connected layer and two parallel neural networks, and the decoder consists of two layers of fully connected layers:
[0048] The encoder uses equations (2) and (3) to generate expectation and variance :
[0049] (2)
[0050] (3)
[0051] Among them, , , are the weight matrices of the fully connected layer and the two parallel neural networks respectively, , , are the bias terms of the fully connected layer and the two parallel neural networks, represents the activation function, represents the exponential function.
[0052] is randomly sampled from the standard Gaussian distribution to obtain the offset parameter , so that the encoder uses equation (4) to obtain :
[0053] (4)
[0054] After the decoder processes , it outputs the reconstructed traffic flow sample features .
[0055] S4: Based on A, construct a deep graph convolutional network GCN, and input into the deep graph convolutional network GCN for processing. The GCN can capture the traffic flow interaction relationship between adjacent regions (such as residential areas and commercial areas), and obtain After the relationship features of each layer in the GCN, the latent space feature representation is also input into the corresponding layer in the GCN. Through the balance coefficient fuse the two, so as to use equation (5) to obtain the relationship features of the j-th layer in the GCN :
[0056] (5)
[0057] Among them, All adjacent network nodes corresponding to the nodes in the depth graph convolutional network GCN, j where J represents the total number of layers of the GCN, denotes the weight matrix of the (j - 1)-th layer in the GCN, denotes the relationship feature of the adjacent network node u of at the (j - 1)-th layer in the GCN, denotes the number of adjacent network nodes corresponding to the node, denotes the number of adjacent network nodes of u; denotes the relationship feature at the (j - 1)-th layer in the GCN. Among them, is the relationship feature matrix of the last layer in the GCN.
[0058] S5: Input into the neural network classifier for processing, so as to obtain the traffic flow region prediction label using Equation (6), and and is a probability vector, where each element represents the probability that the sample belongs to the corresponding category, that is, = …, , where C is the total number of categories of the traffic flow region, represents the sample belonging to the probability of the category, and the final predicted category is determined by the maximum probability index;
[0059] (6)
[0060] In Equation (6), represents the activation function, is the balance coefficient, is the weight matrix of the neural network classifier, is the bias term in the neural network classifier, denotes the latent space feature representation of
[0061] S6: Based on the true label and the predicted label of construct the i-th cross-entropy loss; based on and construct the i-th reconstruction loss and the i-th KL divergence loss, so as to construct the total loss
[0062] (7)
[0063] In formula (7), M is the characteristic dimension of , and N is denotes the variance feature on the m-th dimension in denotes the expected feature on the m-th dimension in the feature of the k-th dimension in the feature of the k-th dimension in
[0064] S7: Use an optimizer to train the traffic flow region classification network composed of a variational autoencoder, a deep graph neural network GCN, and a neural network classifier, and calculate the total loss to update the network parameters until the total loss converges, so as to obtain an optimal traffic flow region classification model for classifying the input traffic flow sample data set to obtain corresponding traffic flow region prediction labels.
[0065] As an embodiment, the present invention proposes a multivariate time series classification method based on a deep graph neural network (hereinafter simply referred to as VAE-GCN).
[0066] In the experimental part, the MTSC method proposed by the present invention is compared with six relatively influential time series classification algorithms in recent years.
[0067] 1NN-ED, 1NN-DTWI, 1NN-DTWD: are commonly used distance-based methods that determine a nearest neighbor based on the Euclidean distance.
[0068] WEASEL-MUSE: is a bag-of-pattern based sliding window method with statistical feature extraction and filtering functions.
[0069] MLSTM-FCN: a new general deep learning framework for multivariate time series classification. This model consists of an LSTM layer, a stacked CNN layer, and a channel attention mechanism module for generating latent features.
[0070] TapNet: a new model that combines the advantages of traditional learning and deep learning. It designs a framework that includes an LSTM layer, a stacked CNN layer, and an attention prototype network.
[0071] ShapeNet: The latest shapelet classifier that embeds shapelet candidates of different lengths into a unified space.
[0072] TS2Vec: A general framework for learning time series representations at any semantic level is proposed. This framework conducts comparative learning on enhanced context views in a hierarchical manner to generate robust context representations.
[0073] To verify the effectiveness of the multivariate time series classification based on the deep graph neural network proposed in the present invention, the classification accuracies of VAE-GCN, 1NN-ED, 1NN-DTWI, 1NN-DTWD, WEASEL-MUSE, MLSTM-FCN, TapNet, ShapeNet, and TS2Vec are compared in the experiments.
[0074] This application tests these methods on six widely used real time series datasets: AtrialFibrillation (abbreviated as AF), ERing, HandMovementDirection (abbreviated as HMD), MotorImagery (abbreviated as MI), SelfRegulationSCP2 (abbreviated as SCP2), and StandWalkJump (abbreviated as SWJ). The average accuracy obtained by running each algorithm ten times on each dataset is taken as the final result.
[0075] Table 1 details the main features of the above datasets.
[0076] Table 1: Datasets used in the experiments
[0077]
[0078] Table 2 shows the classification result accuracies obtained by each method on each dataset. The MTSC method with the best performance on the corresponding dataset in each row is indicated in bold.
[0079] Table 2: Comparison results of the classification accuracies of each algorithm in the experiments (the results are in percentages)
[0080] It can be seen from the experimental results in Table 2 that:
[0081] The multi-variable time series classification method based on deep graph neural network proposed by the present invention has the highest classification accuracy on six data sets. Especially on the two data sets with relatively small scales, namely AF and SWJ, the classification accuracy of the multi-variable time series classification method based on deep graph neural network proposed by the present invention has been greatly improved compared with the comparative algorithms. This reflects that the multi-variable time series classification method based on deep graph neural network has strong feature extraction ability for MTS data, thus improving the MTS classification performance.
Claims
1. A multivariate time series classification method based on deep graph neural network, characterized in that: The steps include: S1: Obtain a multivariate time series data set and perform Z-Score standardization on each multivariate time series sample, then use cubic spline interpolation to make the standardized multivariate time series samples consistent in length, thus obtaining the preprocessed multivariate time series data set ={ },in, represents the i-th multivariate time series sample after preprocessing, and ={ } , express The time series of the sth variable in ={ }, express The feature of the ath time step in , v is the number of variables, l is The length of time; n represents the total number of multivariate time series samples; let The true label is ,and ∈ , Represents a tag set; S2: According to , use the DTW distance method to construct the relationship diagram of multivariate time series samples and obtain the static adjacency matrix A; S3: Input into the variational autoencoder for processing and obtain The latent space feature representation as well as Reconstructed sample features ; S4: Build a deep graph convolutional network GCN based on A and Input the deep graph convolutional network GCN for processing and obtain After the relational features of each layer in GCN, the latent space features are represented Also input into the corresponding layer in GCN, through the balance coefficient After combining the two, we get The relation feature matrix of the last layer in GCN , thus obtaining The relationship feature matrix ; S5: Input into the neural network classifier for processing and obtain The predicted label ; S6: Based on The real label and The predicted label Construct the i-th cross entropy loss; based on and Construct the i-th reconstruction loss and the i-th KL divergence loss to get the total loss ; S7: Use the optimizer to train a multivariate time series classification network consisting of a variational autoencoder, a deep graph neural network GCN, and a neural network classifier, and calculate the total loss To update the network parameters until the total loss Until convergence, the optimal multivariate time series classification model is obtained, which is used to classify the input multivariate time series and obtain the corresponding prediction label.
2. A multivariate time series classification method based on deep graph neural network as claimed in claim 1, characterized in that: S2 is the a-th multivariate time series sample obtained after preprocessing using formula (1) and the bth multivariate time series sample after preprocessing DTW distance , thus obtaining the static adjacency matrix A: (1) In formula (2), express and The Euclidean distance of all features at different time steps, express The b-1th multivariate time series sample after preprocessing DTW distance; Represents the a-1th multivariate time series sample after preprocessing DTW distance; express DTW distance.
3. A multivariate time series classification method based on deep graph neural network as claimed in claim 1, characterized in that: The variational autoencoder in S3 includes: an encoder and a decoder, wherein the encoder is composed of a fully connected layer and two parallel neural networks, and the decoder is composed of two fully connected layers: S3.1, the encoder uses equation (2) and equation (3) to generate expect and variance : (2) (3) In formula (3) and formula (4), , , They are the weight matrices of the fully connected layer and two parallel neural networks, , , is the bias term of the fully connected layer and two parallel neural networks, represents the activation function, represents the exponential function; S3.2, obtained by random sampling from standard Gaussian distribution The offset parameter , so the encoder uses formula (4) to get : (4) S3.3, the decoder After processing, the reconstructed sample features are output .
4. A multivariate time series classification method based on deep graph neural network as claimed in claim 3, characterized in that: S4 is obtained by using formula (5) Relation features at layer j in GCN : (5) In formula (5), Represents the deep graph convolutional network GCN All adjacent network nodes of the corresponding node, , J represents the total number of layers of GCN, represents the weight matrix of the j-1th layer in GCN, express The relationship features of the adjacent network node u in the j-1th layer in GCN, express The number of adjacent network nodes of the corresponding node, Indicates the number of adjacent network nodes of u; express Relation features at layer j-1 in GCN.
5. The multivariate time series classification method based on deep graph neural network according to claim 1 is characterized in that: S5 is obtained by using formula (6): The predicted label ; (6) In formula (6), represents the activation function, is the balance coefficient, is the weight matrix of the neural network classifier, is the bias term in the neural network classifier.
6. A multivariate time series classification method based on deep graph neural network according to claim 1, characterized in that: S6 is the total loss constructed using formula (7) : (7) In formula (7), M is The characteristic dimension of The characteristic dimension of express The variance feature on the mth dimension in , express The expected features in the mth dimension, The kth dimension of feature, The kth dimension of feature.
7. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the multivariate time series classification method described in any one of claims 1 to 6, and the processor is configured to execute the program stored in the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multivariate time series classification method according to any one of claims 1 to 6 are performed.
Citation Information
Cited By
Channel access attack classification method based on Shaplet and Transform graph convolutional network
CN121188559A
Channel access attack classification method based on shapelet and transformer graph convolution network
CN121188559B